topchester-ai 0.34.0 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin.mjs
CHANGED
|
@@ -6894,13 +6894,15 @@ async function syncKnowledgeBase(workspaceRoot, options = {}) {
|
|
|
6894
6894
|
const queue = createL1QueueFile(queuedFiles, generatedAt);
|
|
6895
6895
|
options.onProgress?.({ message: options.full ? "Writing full L1 sync queue and manifest..." : "Writing L1 sync queue and manifest..." });
|
|
6896
6896
|
await writeFile(queuePath, `${JSON.stringify(queue, null, 2)}\n`);
|
|
6897
|
+
const dirtyFilePaths = new Set(dirtyFiles.map((file) => file.path));
|
|
6898
|
+
const currentEntryCount = options.full ? 0 : inventory.files.filter((file) => !dirtyFilePaths.has(file.path)).length;
|
|
6897
6899
|
const l1 = {
|
|
6898
6900
|
queued: queuedFiles.length,
|
|
6899
6901
|
completed: 0,
|
|
6900
6902
|
failed: 0,
|
|
6901
6903
|
changed: 0,
|
|
6902
6904
|
missing: 0,
|
|
6903
|
-
currentEntries:
|
|
6905
|
+
currentEntries: currentEntryCount
|
|
6904
6906
|
};
|
|
6905
6907
|
await writeFile(manifestPath, `${JSON.stringify({
|
|
6906
6908
|
name: "topchester-kb",
|
|
@@ -7828,9 +7830,38 @@ function renderSubagentMessage(message) {
|
|
|
7828
7830
|
switch (message.status) {
|
|
7829
7831
|
case "running": return [` ${ui.muted(`↳ task: ${label} (running)`)}`];
|
|
7830
7832
|
case "event": return message.text ? [` ${ui.muted(`↳ task: ${label}: ${message.text}`)}`] : [];
|
|
7831
|
-
case "completed": return [` ${ui.muted(`↳ task: ${label} (completed)`)}`, ...message.text
|
|
7832
|
-
case "failed": return [` ${ui.warn(`↳ task: ${label} (failed)`)}`, ...message.text
|
|
7833
|
+
case "completed": return [` ${ui.muted(`↳ task: ${label} (completed)`)}`, ...formatSubagentPreview(message.text).map((line) => ` ${line}`)];
|
|
7834
|
+
case "failed": return [` ${ui.warn(`↳ task: ${label} (failed)`)}`, ...formatSubagentPreview(message.text).map((line) => ` ${line}`)];
|
|
7835
|
+
}
|
|
7836
|
+
}
|
|
7837
|
+
const SUBAGENT_PREVIEW_MAX_LINES = 8;
|
|
7838
|
+
const SUBAGENT_PREVIEW_MAX_CHARS = 1e3;
|
|
7839
|
+
function formatSubagentPreview(text) {
|
|
7840
|
+
if (!text) return [];
|
|
7841
|
+
const lines = text.split("\n");
|
|
7842
|
+
const previewLines = [];
|
|
7843
|
+
let chars = 0;
|
|
7844
|
+
let truncated = false;
|
|
7845
|
+
for (const line of lines) {
|
|
7846
|
+
if (previewLines.length >= SUBAGENT_PREVIEW_MAX_LINES) {
|
|
7847
|
+
truncated = true;
|
|
7848
|
+
break;
|
|
7849
|
+
}
|
|
7850
|
+
const remainingChars = SUBAGENT_PREVIEW_MAX_CHARS - chars;
|
|
7851
|
+
if (remainingChars <= 0) {
|
|
7852
|
+
truncated = true;
|
|
7853
|
+
break;
|
|
7854
|
+
}
|
|
7855
|
+
if (line.length > remainingChars) {
|
|
7856
|
+
previewLines.push(`${line.slice(0, Math.max(0, remainingChars - 1))}…`);
|
|
7857
|
+
truncated = true;
|
|
7858
|
+
break;
|
|
7859
|
+
}
|
|
7860
|
+
previewLines.push(line);
|
|
7861
|
+
chars += line.length + 1;
|
|
7833
7862
|
}
|
|
7863
|
+
if (!truncated && previewLines.length < lines.length) truncated = true;
|
|
7864
|
+
return truncated ? [...previewLines, ui.muted("… full result saved in child session log")] : previewLines;
|
|
7834
7865
|
}
|
|
7835
7866
|
function shortSessionId(sessionId) {
|
|
7836
7867
|
return sessionId.length <= 8 ? sessionId : sessionId.slice(0, 8);
|
|
@@ -11996,11 +12027,7 @@ function renderRuntimeEvent(event) {
|
|
|
11996
12027
|
}
|
|
11997
12028
|
}
|
|
11998
12029
|
function formatForwardedSubagentEvent(sessionId, event) {
|
|
11999
|
-
if (event.type === "message" && event.role === "assistant") return [
|
|
12000
|
-
status: "event",
|
|
12001
|
-
sessionId,
|
|
12002
|
-
text: event.text
|
|
12003
|
-
})];
|
|
12030
|
+
if (event.type === "message" && event.role === "assistant") return [];
|
|
12004
12031
|
if (event.type === "tool_call") return [subagentMessage({
|
|
12005
12032
|
status: "event",
|
|
12006
12033
|
sessionId,
|
|
@@ -13677,4 +13704,4 @@ function formatDryRunSyncStatus(status) {
|
|
|
13677
13704
|
//#endregion
|
|
13678
13705
|
export { runTopchesterCli as t };
|
|
13679
13706
|
|
|
13680
|
-
//# sourceMappingURL=cli-
|
|
13707
|
+
//# sourceMappingURL=cli-BWT2aSBz.mjs.map
|