jinzd-ai-cli 0.4.282 → 0.4.284
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/README.md +2 -2
- package/README.zh-CN.md +2 -2
- package/dist/{batch-SBP6H7IK.js → batch-DA7VA35X.js} +2 -2
- package/dist/{chunk-TNIMHTKG.js → chunk-3DRSBZQ7.js} +1 -1
- package/dist/{chunk-LNUWIY6M.js → chunk-BXG44VIQ.js} +1 -1
- package/dist/{chunk-GSGJABL6.js → chunk-C4CIIIDT.js} +3 -3
- package/dist/{chunk-RHSCROLG.js → chunk-FZ4THGUP.js} +1 -1
- package/dist/{chunk-7XKIDSJT.js → chunk-I4FJGILK.js} +4 -4
- package/dist/{chunk-WMHLWCZQ.js → chunk-OZKTHQWA.js} +3 -3
- package/dist/{chunk-SGUPIQYT.js → chunk-PPPSK4MA.js} +1 -1
- package/dist/{chunk-HJDJAI7T.js → chunk-PWLQU43X.js} +1 -1
- package/dist/{chunk-6IRG727F.js → chunk-QKGKWCXE.js} +1 -1
- package/dist/{chunk-JQU4GYET.js → chunk-RV2YOTEQ.js} +1 -1
- package/dist/{chunk-YRPL7A3S.js → chunk-VFVN5CWA.js} +1 -1
- package/dist/{chunk-EVD6CCO2.js → chunk-XSBGCZOP.js} +1 -1
- package/dist/{chunk-KDXA7RXA.js → chunk-Z23JYUOL.js} +124 -3
- package/dist/{ci-VAAMX44S.js → ci-HG2TPYVY.js} +4 -4
- package/dist/{ci-format-RMULFSB5.js → ci-format-UB7K63UZ.js} +2 -2
- package/dist/{constants-PXLMEBJY.js → constants-3DDHA3LT.js} +1 -1
- package/dist/{doctor-cli-C2DFYU2M.js → doctor-cli-ISFDY7LZ.js} +4 -4
- package/dist/electron-server.js +225 -27
- package/dist/{hub-XIU3YTOE.js → hub-MP2CNDMZ.js} +1 -1
- package/dist/index.js +100 -89
- package/dist/{persistent-memory-TA224ZFQ.js → persistent-memory-AMDRRB5E.js} +2 -2
- package/dist/{persistent-memory-ACXKU6RV.js → persistent-memory-J2OVPLWI.js} +2 -2
- package/dist/{pr-J74HW44E.js → pr-BREZ3DJX.js} +4 -4
- package/dist/{run-tests-4KTX5YMO.js → run-tests-DPO23PKA.js} +2 -2
- package/dist/{run-tests-JLZ2KIGV.js → run-tests-XHLV74GU.js} +2 -2
- package/dist/{server-4CZXYGJN.js → server-KK7DIV3J.js} +5 -5
- package/dist/{server-226R6675.js → server-W2VIUKTQ.js} +118 -30
- package/dist/{task-orchestrator-6C3R7KSK.js → task-orchestrator-YM5IMIKL.js} +5 -5
- package/dist/{usage-FY3TEJJS.js → usage-TXPZY7EB.js} +2 -2
- package/package.json +2 -2
package/dist/electron-server.js
CHANGED
|
@@ -40,14 +40,14 @@ import {
|
|
|
40
40
|
touchMemoryReferences,
|
|
41
41
|
updateMemoryApproval,
|
|
42
42
|
updateMemoryEntry
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-FZ4THGUP.js";
|
|
44
44
|
import {
|
|
45
45
|
redactJson,
|
|
46
46
|
scanString
|
|
47
47
|
} from "./chunk-FSC6KEWU.js";
|
|
48
48
|
import {
|
|
49
49
|
runTestsTool
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-QKGKWCXE.js";
|
|
51
51
|
import {
|
|
52
52
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
53
53
|
APP_NAME,
|
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
SUBAGENT_MAX_ROUNDS_LIMIT,
|
|
81
81
|
VERSION,
|
|
82
82
|
buildUserIdentityPrompt
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-3DRSBZQ7.js";
|
|
84
84
|
import {
|
|
85
85
|
hasSemanticIndex,
|
|
86
86
|
semanticSearch
|
|
@@ -6621,8 +6621,8 @@ ${listing}` : "");
|
|
|
6621
6621
|
}
|
|
6622
6622
|
const { size } = st;
|
|
6623
6623
|
if (size > MAX_FILE_BYTES) {
|
|
6624
|
-
const
|
|
6625
|
-
return `[File too large: ${filePath} (${
|
|
6624
|
+
const mb2 = (size / 1024 / 1024).toFixed(1);
|
|
6625
|
+
return `[File too large: ${filePath} (${mb2} MB)]
|
|
6626
6626
|
Exceeds single read limit of ${MAX_FILE_BYTES / 1024 / 1024} MB.
|
|
6627
6627
|
Use the bash tool to read in segments, e.g.:
|
|
6628
6628
|
head -n 100 "${normalizedPath}" # first 100 lines
|
|
@@ -16838,7 +16838,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
|
|
|
16838
16838
|
Cost: ${formatCost(cost)}` : "";
|
|
16839
16839
|
let memoryLine = "";
|
|
16840
16840
|
try {
|
|
16841
|
-
const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-
|
|
16841
|
+
const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-AMDRRB5E.js");
|
|
16842
16842
|
const pending = countPendingMemories2(ctx.config.getConfigDir());
|
|
16843
16843
|
if (pending > 0) memoryLine = `
|
|
16844
16844
|
Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
|
|
@@ -17746,7 +17746,7 @@ async function handleTest(args, ctx) {
|
|
|
17746
17746
|
const isCommand = argStr.includes(" ") || /^(mvn|gradle|npm|pytest|cargo|go)\b/.test(argStr);
|
|
17747
17747
|
testArgs = isCommand ? { command: argStr } : { filter: argStr };
|
|
17748
17748
|
}
|
|
17749
|
-
const runTests = ctx.runTests ?? (await import("./run-tests-
|
|
17749
|
+
const runTests = ctx.runTests ?? (await import("./run-tests-XHLV74GU.js")).executeTests;
|
|
17750
17750
|
const report = await runTests(testArgs);
|
|
17751
17751
|
ctx.send({ type: "info", message: report });
|
|
17752
17752
|
} catch (err) {
|
|
@@ -17866,6 +17866,121 @@ function parseOutFlag(args) {
|
|
|
17866
17866
|
return v && !v.startsWith("--") ? v : void 0;
|
|
17867
17867
|
}
|
|
17868
17868
|
|
|
17869
|
+
// src/core/memory-command.ts
|
|
17870
|
+
var MEMORY_USAGE = "Governed persistent memory: show [--pending|--orphaned|--stale <days>|--scope <s>|--search <text>] | add | edit <id> <text> | approve/reject/delete/expire <id> | rebind <id> <path> | clear | backup [--out <file>] | restore <file> | export [--format json|md] [--out <file>] | path\nChat memory index (cross-session recall): rebuild | refresh | status | recall <query> | index-clear";
|
|
17871
|
+
function parseMemoryCommand(args) {
|
|
17872
|
+
const sub = (args[0] ?? "show").toLowerCase();
|
|
17873
|
+
const rest = args.slice(1);
|
|
17874
|
+
switch (sub) {
|
|
17875
|
+
case "rebuild":
|
|
17876
|
+
return { kind: "rebuild", full: true };
|
|
17877
|
+
case "refresh":
|
|
17878
|
+
return { kind: "rebuild", full: false };
|
|
17879
|
+
case "status":
|
|
17880
|
+
return { kind: "status" };
|
|
17881
|
+
case "recall": {
|
|
17882
|
+
const query = rest.join(" ").trim();
|
|
17883
|
+
return query ? { kind: "recall", query } : { kind: "usage", message: "Usage: /memory recall <query>" };
|
|
17884
|
+
}
|
|
17885
|
+
case "index-clear":
|
|
17886
|
+
return { kind: "index-clear" };
|
|
17887
|
+
case "show":
|
|
17888
|
+
case "view":
|
|
17889
|
+
case "list":
|
|
17890
|
+
return { kind: "show", rest };
|
|
17891
|
+
case "add":
|
|
17892
|
+
return { kind: "add", rest };
|
|
17893
|
+
case "edit":
|
|
17894
|
+
return { kind: "edit", rest };
|
|
17895
|
+
case "approve":
|
|
17896
|
+
case "reject":
|
|
17897
|
+
case "delete":
|
|
17898
|
+
case "expire":
|
|
17899
|
+
return { kind: "manage", action: sub, rest };
|
|
17900
|
+
case "rebind":
|
|
17901
|
+
return { kind: "rebind", rest };
|
|
17902
|
+
case "export":
|
|
17903
|
+
return { kind: "export", rest };
|
|
17904
|
+
case "clear":
|
|
17905
|
+
return { kind: "clear", rest };
|
|
17906
|
+
case "backup":
|
|
17907
|
+
return { kind: "backup", rest };
|
|
17908
|
+
case "restore":
|
|
17909
|
+
return { kind: "restore", rest };
|
|
17910
|
+
case "path":
|
|
17911
|
+
return { kind: "path" };
|
|
17912
|
+
default:
|
|
17913
|
+
return { kind: "usage", message: `Unknown /memory subcommand "${args[0]}".
|
|
17914
|
+
${MEMORY_USAGE}` };
|
|
17915
|
+
}
|
|
17916
|
+
}
|
|
17917
|
+
var mb = (n) => `${(n / 1024 / 1024).toFixed(2)} MB`;
|
|
17918
|
+
function buildMemoryStatusView(input) {
|
|
17919
|
+
const governed = [
|
|
17920
|
+
{ label: "active", value: String(input.active) }
|
|
17921
|
+
];
|
|
17922
|
+
governed.push(
|
|
17923
|
+
input.pending > 0 ? {
|
|
17924
|
+
label: "pending",
|
|
17925
|
+
// 照着敲就能用(v0.4.250 定的口径):跳到待批准列表 + 点明 id 是 8 位
|
|
17926
|
+
value: `${input.pending} \u2014 run /memory show --pending, then /memory approve <8-char-id>`,
|
|
17927
|
+
warn: true
|
|
17928
|
+
} : { label: "pending", value: "0" }
|
|
17929
|
+
);
|
|
17930
|
+
if (input.injected) {
|
|
17931
|
+
const note = input.injected.truncated ? ` \u26A0 truncated \u2014 only newest ${input.injected.entryCount} of ${input.injected.totalCount} injected` : "";
|
|
17932
|
+
governed.push({
|
|
17933
|
+
label: "injected",
|
|
17934
|
+
value: `${input.injected.entryCount} of ${input.injected.totalCount} (${input.injected.chars} chars)${note}`,
|
|
17935
|
+
warn: input.injected.truncated
|
|
17936
|
+
});
|
|
17937
|
+
} else {
|
|
17938
|
+
governed.push({ label: "injected", value: "0" });
|
|
17939
|
+
}
|
|
17940
|
+
governed.push({ label: "store", value: input.storePath });
|
|
17941
|
+
if (!input.chatIndex.exists) {
|
|
17942
|
+
return { governed, chatIndex: [], chatIndexHint: "not built yet \u2014 run /memory rebuild" };
|
|
17943
|
+
}
|
|
17944
|
+
return {
|
|
17945
|
+
governed,
|
|
17946
|
+
chatIndex: [
|
|
17947
|
+
{ label: "chunks", value: String(input.chatIndex.chunks) },
|
|
17948
|
+
{ label: "sessions", value: String(input.chatIndex.sessions) },
|
|
17949
|
+
{ label: "built", value: input.chatIndex.built?.replace("T", " ").slice(0, 19) ?? "-" },
|
|
17950
|
+
{ label: "model", value: input.chatIndex.model ?? "-" },
|
|
17951
|
+
{ label: "vec file", value: mb(input.chatIndex.vecFileSizeBytes) },
|
|
17952
|
+
{ label: "chunks file", value: mb(input.chatIndex.chunksFileSizeBytes) }
|
|
17953
|
+
],
|
|
17954
|
+
chatIndexHint: null
|
|
17955
|
+
};
|
|
17956
|
+
}
|
|
17957
|
+
function rebuildStartMessage(full) {
|
|
17958
|
+
return full ? "\u{1F9E0} Rebuilding chat memory index from scratch (this may take a while on first run \u2014 embedding model ~117 MB)\u2026" : "\u{1F9E0} Refreshing chat memory index (incremental)\u2026";
|
|
17959
|
+
}
|
|
17960
|
+
function rebuildDoneMessage(stats) {
|
|
17961
|
+
return `\u2713 Chat index: ${stats.chunksTotal} chunks (${stats.chunksAdded} new, ${stats.chunksRemoved} removed) across ${stats.sessionsIndexed + stats.sessionsSkipped} sessions (${stats.sessionsIndexed} re-indexed, ${stats.sessionsSkipped} cached) in ${stats.durationMs}ms`;
|
|
17962
|
+
}
|
|
17963
|
+
var clip = (text, max) => text.length > max ? `${text.slice(0, max)}\u2026` : text;
|
|
17964
|
+
function buildRecallView(query, persistent, chat) {
|
|
17965
|
+
const view = {
|
|
17966
|
+
persistentHeading: persistent.length > 0 ? `\u{1F4DD} Persistent memory \u2014 ${persistent.length} hit(s):` : null,
|
|
17967
|
+
persistent: persistent.map((h, i) => ({
|
|
17968
|
+
label: `[${i + 1}] id ${h.id.slice(0, 8)} \xB7 ${h.scope} \xB7 coverage ${h.score.toFixed(2)}`,
|
|
17969
|
+
body: h.content
|
|
17970
|
+
})),
|
|
17971
|
+
chatHeading: chat.length > 0 ? `\u{1F9E0} Chat history recall for "${query}" \u2014 ${chat.length} hit(s):` : null,
|
|
17972
|
+
chat: chat.map((h, i) => ({
|
|
17973
|
+
label: `[${i + 1}] ${h.timestamp.slice(0, 16).replace("T", " ")} \xB7 ${h.title} \xB7 score ${h.score.toFixed(3)}`,
|
|
17974
|
+
body: clip(h.text, 400)
|
|
17975
|
+
})),
|
|
17976
|
+
note: null
|
|
17977
|
+
};
|
|
17978
|
+
if (chat.length === 0) {
|
|
17979
|
+
view.note = persistent.length === 0 ? `No memories matched "${query}" (persistent + chat index).` : "(no chat-history hits above score 0.20)";
|
|
17980
|
+
}
|
|
17981
|
+
return view;
|
|
17982
|
+
}
|
|
17983
|
+
|
|
17869
17984
|
// src/web/commands/memory-commands.ts
|
|
17870
17985
|
async function handleSystem(args, ctx) {
|
|
17871
17986
|
const text = args.join(" ").trim();
|
|
@@ -17996,8 +18111,91 @@ async function handleIndex(args, ctx) {
|
|
|
17996
18111
|
}
|
|
17997
18112
|
}
|
|
17998
18113
|
async function handleMemory(args, ctx) {
|
|
17999
|
-
const
|
|
18000
|
-
|
|
18114
|
+
const intent = parseMemoryCommand(args);
|
|
18115
|
+
const configDir = ctx.config.getConfigDir();
|
|
18116
|
+
if (intent.kind === "usage") {
|
|
18117
|
+
ctx.send({ type: "error", message: intent.message });
|
|
18118
|
+
return;
|
|
18119
|
+
}
|
|
18120
|
+
if (intent.kind === "rebuild") {
|
|
18121
|
+
ctx.send({ type: "info", message: rebuildStartMessage(intent.full) });
|
|
18122
|
+
try {
|
|
18123
|
+
const { buildChatIndex } = await import("./chat-index-TDU3S2MG.js");
|
|
18124
|
+
const stats = await buildChatIndex({ full: intent.full });
|
|
18125
|
+
ctx.send({ type: "info", message: rebuildDoneMessage(stats) });
|
|
18126
|
+
} catch (err) {
|
|
18127
|
+
ctx.send({ type: "error", message: `Rebuild failed: ${err instanceof Error ? err.message : String(err)}` });
|
|
18128
|
+
}
|
|
18129
|
+
return;
|
|
18130
|
+
}
|
|
18131
|
+
if (intent.kind === "index-clear") {
|
|
18132
|
+
const { clearChatIndex } = await import("./chat-index-TDU3S2MG.js");
|
|
18133
|
+
clearChatIndex();
|
|
18134
|
+
ctx.send({ type: "info", message: "Chat memory index cleared (persistent memory untouched)." });
|
|
18135
|
+
return;
|
|
18136
|
+
}
|
|
18137
|
+
if (intent.kind === "status") {
|
|
18138
|
+
const { getChatIndexStatus } = await import("./chat-index-TDU3S2MG.js");
|
|
18139
|
+
const { listMemoryEntries: listMemoryEntries2, isMemoryExpired: isMemoryExpired2, formatMemoryForPrompt: formatMemoryForPrompt2 } = await import("./persistent-memory-AMDRRB5E.js");
|
|
18140
|
+
const memories = listMemoryEntries2(configDir, { includeExpired: true, includeRejected: true });
|
|
18141
|
+
const injected = formatMemoryForPrompt2(configDir, process.cwd(), ctx.config.get("memory")?.maxChars);
|
|
18142
|
+
const view = buildMemoryStatusView({
|
|
18143
|
+
active: memories.filter((m) => m.approved && !isMemoryExpired2(m)).length,
|
|
18144
|
+
pending: memories.filter((m) => !m.approved && !isMemoryExpired2(m)).length,
|
|
18145
|
+
injected: injected ? { entryCount: injected.entryCount, totalCount: injected.totalCount, chars: injected.content.length, truncated: injected.truncated } : null,
|
|
18146
|
+
storePath: memoryStorePath(configDir),
|
|
18147
|
+
chatIndex: getChatIndexStatus()
|
|
18148
|
+
});
|
|
18149
|
+
ctx.send({
|
|
18150
|
+
type: "info",
|
|
18151
|
+
message: [
|
|
18152
|
+
"\u{1F9E0} Governed Memory",
|
|
18153
|
+
...view.governed.map((r) => ` ${r.label.padEnd(13)}: ${r.value}`),
|
|
18154
|
+
"",
|
|
18155
|
+
"\u{1F9E0} Chat Memory Index",
|
|
18156
|
+
...view.chatIndexHint ? [` ${view.chatIndexHint}`] : view.chatIndex.map((r) => ` ${r.label.padEnd(13)}: ${r.value}`)
|
|
18157
|
+
].join("\n")
|
|
18158
|
+
});
|
|
18159
|
+
return;
|
|
18160
|
+
}
|
|
18161
|
+
if (intent.kind === "recall") {
|
|
18162
|
+
const { searchPersistentMemories: searchPersistentMemories2, touchMemoryReferences: touchMemoryReferences2 } = await import("./persistent-memory-AMDRRB5E.js");
|
|
18163
|
+
const { searchChatMemory: searchChatMemory2 } = await import("./chat-index-TDU3S2MG.js");
|
|
18164
|
+
const persistentHits = searchPersistentMemories2(configDir, intent.query, process.cwd(), 3);
|
|
18165
|
+
if (persistentHits.length > 0) {
|
|
18166
|
+
touchMemoryReferences2(configDir, persistentHits.map((h) => h.entry.id));
|
|
18167
|
+
}
|
|
18168
|
+
let chatHits = [];
|
|
18169
|
+
try {
|
|
18170
|
+
chatHits = await searchChatMemory2(intent.query, { topK: 5, minScore: 0.2 });
|
|
18171
|
+
} catch (err) {
|
|
18172
|
+
ctx.send({ type: "error", message: `Recall failed: ${err instanceof Error ? err.message : String(err)}` });
|
|
18173
|
+
return;
|
|
18174
|
+
}
|
|
18175
|
+
const view = buildRecallView(
|
|
18176
|
+
intent.query,
|
|
18177
|
+
persistentHits.map((h) => ({ id: h.entry.id, scope: h.entry.scope, score: h.score, content: h.entry.content })),
|
|
18178
|
+
chatHits.map((h) => ({
|
|
18179
|
+
timestamp: h.chunk.timestamp,
|
|
18180
|
+
title: h.chunk.sessionTitle ?? h.chunk.sessionId.slice(0, 8),
|
|
18181
|
+
score: h.score,
|
|
18182
|
+
text: h.chunk.text
|
|
18183
|
+
}))
|
|
18184
|
+
);
|
|
18185
|
+
const lines = [];
|
|
18186
|
+
if (view.persistentHeading) {
|
|
18187
|
+
lines.push(view.persistentHeading, "");
|
|
18188
|
+
for (const hit of view.persistent) lines.push(` ${hit.label}`, ` ${hit.body}`, "");
|
|
18189
|
+
}
|
|
18190
|
+
if (view.chatHeading) {
|
|
18191
|
+
lines.push(view.chatHeading, "");
|
|
18192
|
+
for (const hit of view.chat) lines.push(` ${hit.label}`, ` ${hit.body}`, "");
|
|
18193
|
+
}
|
|
18194
|
+
if (view.note) lines.push(view.note);
|
|
18195
|
+
ctx.send({ type: "info", message: lines.join("\n") });
|
|
18196
|
+
return;
|
|
18197
|
+
}
|
|
18198
|
+
if (intent.kind === "backup") {
|
|
18001
18199
|
try {
|
|
18002
18200
|
const result = backupMemoryStore(ctx.config.getConfigDir(), parseOutFlag(args.slice(1)));
|
|
18003
18201
|
ctx.send({ type: "info", message: `\u2713 Backed up ${result.count} entr${result.count === 1 ? "y" : "ies"} to ${result.backupPath}` });
|
|
@@ -18006,20 +18204,20 @@ async function handleMemory(args, ctx) {
|
|
|
18006
18204
|
}
|
|
18007
18205
|
return;
|
|
18008
18206
|
}
|
|
18009
|
-
if (
|
|
18010
|
-
const
|
|
18011
|
-
const verdict = checkWebRestorePath(
|
|
18207
|
+
if (intent.kind === "restore") {
|
|
18208
|
+
const configDir2 = ctx.config.getConfigDir();
|
|
18209
|
+
const verdict = checkWebRestorePath(configDir2, args[1]);
|
|
18012
18210
|
if (!verdict.ok) {
|
|
18013
18211
|
ctx.send({ type: "error", message: verdict.reason });
|
|
18014
18212
|
return;
|
|
18015
18213
|
}
|
|
18016
18214
|
try {
|
|
18017
|
-
const result = restoreMemoryEntries(
|
|
18215
|
+
const result = restoreMemoryEntries(configDir2, verdict.resolved);
|
|
18018
18216
|
const lines = [
|
|
18019
18217
|
`\u2713 Restored ${result.imported} entr${result.imported === 1 ? "y" : "ies"} (${result.skipped} duplicate${result.skipped === 1 ? "" : "s"} skipped)`
|
|
18020
18218
|
];
|
|
18021
18219
|
if (result.backupPath) lines.push(`Pre-restore backup: ${result.backupPath}`);
|
|
18022
|
-
const pending = countPendingMemories(
|
|
18220
|
+
const pending = countPendingMemories(configDir2);
|
|
18023
18221
|
if (pending > 0) lines.push(`${pending} entr${pending === 1 ? "y" : "ies"} pending approval \u2014 /memory show --pending`);
|
|
18024
18222
|
ctx.send({ type: "info", message: lines.join("\n") });
|
|
18025
18223
|
ctx.sendMemoryEntries();
|
|
@@ -18028,7 +18226,7 @@ async function handleMemory(args, ctx) {
|
|
|
18028
18226
|
}
|
|
18029
18227
|
return;
|
|
18030
18228
|
}
|
|
18031
|
-
if (
|
|
18229
|
+
if (intent.kind === "rebind") {
|
|
18032
18230
|
const id = args[1];
|
|
18033
18231
|
const newPath = args.slice(2).join(" ").trim();
|
|
18034
18232
|
if (!id || !newPath) {
|
|
@@ -18044,11 +18242,11 @@ async function handleMemory(args, ctx) {
|
|
|
18044
18242
|
}
|
|
18045
18243
|
return;
|
|
18046
18244
|
}
|
|
18047
|
-
if (
|
|
18245
|
+
if (intent.kind === "path") {
|
|
18048
18246
|
ctx.send({ type: "info", message: memoryStorePath(ctx.config.getConfigDir()) });
|
|
18049
18247
|
return;
|
|
18050
18248
|
}
|
|
18051
|
-
if (
|
|
18249
|
+
if (intent.kind === "add") {
|
|
18052
18250
|
const rest = args.slice(1);
|
|
18053
18251
|
const opts = {};
|
|
18054
18252
|
const text = [];
|
|
@@ -18066,7 +18264,7 @@ async function handleMemory(args, ctx) {
|
|
|
18066
18264
|
return;
|
|
18067
18265
|
}
|
|
18068
18266
|
ctx.memoryAdd(text.join(" "), opts);
|
|
18069
|
-
} else if (
|
|
18267
|
+
} else if (intent.kind === "edit") {
|
|
18070
18268
|
const id = args[1];
|
|
18071
18269
|
const text = args.slice(2).join(" ").trim();
|
|
18072
18270
|
if (!id || !text) {
|
|
@@ -18074,15 +18272,15 @@ async function handleMemory(args, ctx) {
|
|
|
18074
18272
|
return;
|
|
18075
18273
|
}
|
|
18076
18274
|
ctx.memoryEdit(id, text);
|
|
18077
|
-
} else if (
|
|
18275
|
+
} else if (intent.kind === "manage") {
|
|
18078
18276
|
if (!args[1]) {
|
|
18079
|
-
ctx.send({ type: "info", message: `Usage: /memory ${
|
|
18277
|
+
ctx.send({ type: "info", message: `Usage: /memory ${intent.action} <id>` });
|
|
18080
18278
|
return;
|
|
18081
18279
|
}
|
|
18082
|
-
ctx.handleMemoryManage(
|
|
18083
|
-
} else if (
|
|
18280
|
+
ctx.handleMemoryManage(intent.action, args[1], intent.action === "expire" ? args[2] : void 0);
|
|
18281
|
+
} else if (intent.kind === "export") {
|
|
18084
18282
|
if (args[1] === "md") {
|
|
18085
|
-
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-
|
|
18283
|
+
const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-AMDRRB5E.js");
|
|
18086
18284
|
ctx.send({
|
|
18087
18285
|
type: "export_data",
|
|
18088
18286
|
format: "md",
|
|
@@ -18092,7 +18290,7 @@ async function handleMemory(args, ctx) {
|
|
|
18092
18290
|
} else {
|
|
18093
18291
|
ctx.handleMemoryManage("export");
|
|
18094
18292
|
}
|
|
18095
|
-
} else if (
|
|
18293
|
+
} else if (intent.kind === "clear") {
|
|
18096
18294
|
if (args[1] === "confirm") {
|
|
18097
18295
|
ctx.memoryClear();
|
|
18098
18296
|
} else {
|
|
@@ -18102,8 +18300,7 @@ async function handleMemory(args, ctx) {
|
|
|
18102
18300
|
});
|
|
18103
18301
|
}
|
|
18104
18302
|
} else {
|
|
18105
|
-
|
|
18106
|
-
ctx.memoryShow(isShow ? args.slice(1) : args);
|
|
18303
|
+
ctx.memoryShow(intent.rest);
|
|
18107
18304
|
}
|
|
18108
18305
|
}
|
|
18109
18306
|
async function handleAddDir(args, ctx) {
|
|
@@ -18535,7 +18732,8 @@ async function handleHelp(_args, ctx) {
|
|
|
18535
18732
|
" /tools \u2014 Show tools, MCP servers & skills",
|
|
18536
18733
|
" /export [md|json] \u2014 Export conversation",
|
|
18537
18734
|
" /skill [name|off|list|reload] \u2014 Manage agent skills",
|
|
18538
|
-
" /memory
|
|
18735
|
+
" /memory show|add|edit|approve|reject|delete|expire|rebind|clear|backup|restore|export|path \u2014 Governed memory",
|
|
18736
|
+
" /memory rebuild|refresh|status|recall <query>|index-clear \u2014 Chat memory index (cross-session recall)",
|
|
18539
18737
|
" /agent list|switch|stop|summary \u2014 Manage named sub-agents",
|
|
18540
18738
|
" /yolo [on|off] \u2014 Toggle auto-approve (skip confirmations)",
|
|
18541
18739
|
" /search <keyword> \u2014 Search across all session histories",
|
|
@@ -158,7 +158,7 @@ ${content}`);
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
async function runTaskMode(config, providers, configManager, topic) {
|
|
161
|
-
const { TaskOrchestrator } = await import("./task-orchestrator-
|
|
161
|
+
const { TaskOrchestrator } = await import("./task-orchestrator-YM5IMIKL.js");
|
|
162
162
|
const orchestrator = new TaskOrchestrator(config, providers, configManager);
|
|
163
163
|
let interrupted = false;
|
|
164
164
|
const onSigint = () => {
|