mvp-ai's picture
download
raw
1.67 kB
"use strict";
/**
* transcript.ts — the product-neutral transcript model.
*
* Every agent's history is normalized into a flat list of entries (text,
* tool_use, tool_result) plus an optional recap, so rendering and the hook
* never care which product a session belongs to.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.clean = clean;
exports.toolInputSummary = toolInputSummary;
const STRIP = [
/<system-reminder>[\s\S]*?<\/system-reminder>/g,
/<command-[^>]*>[\s\S]*?<\/command-[^>]*>/g,
/<local-command-[^>]*>[\s\S]*?<\/local-command-[^>]*>/g,
// crew's own injections (e.g. mail appended to OpenCode tool outputs);
// other sessions shouldn't see crew talking to itself.
/<crew-messages>[\s\S]*?<\/crew-messages>/g,
];
function clean(s) {
for (const r of STRIP)
s = s.replace(r, "");
return s.trim();
}
/** Best single-line summary of a tool call's input object. */
function toolInputSummary(input) {
if (typeof input === "string")
return input;
if (!input || typeof input !== "object")
return String(input ?? "");
const obj = input;
for (const key of [
"description",
"cmd",
"command",
"prompt",
"query",
"pattern",
"path",
"file_path",
"filePath",
"url",
"target",
]) {
const candidate = obj[key];
if (typeof candidate === "string")
return candidate;
if (Array.isArray(candidate))
return candidate.map(String).join(" ");
}
try {
return JSON.stringify(input);
}
catch {
return "";
}
}

Xet Storage Details

Size:
1.67 kB
·
Xet hash:
6805192dc4e72915a499bf75fdc0e025a76b34ddc09e7aa079dcb00058e23be1

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.