jinzd-ai-cli 0.4.282 → 0.4.283
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/{batch-SBP6H7IK.js → batch-6WWR4P5U.js} +2 -2
- package/dist/{chunk-TNIMHTKG.js → chunk-2YVZTDP4.js} +1 -1
- package/dist/{chunk-HJDJAI7T.js → chunk-4J7FIGQD.js} +1 -1
- package/dist/{chunk-WMHLWCZQ.js → chunk-CUS4FJVP.js} +3 -3
- package/dist/{chunk-7XKIDSJT.js → chunk-D7BIF6JO.js} +4 -4
- package/dist/{chunk-6IRG727F.js → chunk-F3YN754E.js} +1 -1
- package/dist/{chunk-RHSCROLG.js → chunk-JR2J3V6J.js} +1 -1
- package/dist/{chunk-JQU4GYET.js → chunk-JSQGDPDK.js} +1 -1
- package/dist/{chunk-KDXA7RXA.js → chunk-LXJF46SO.js} +124 -3
- package/dist/{chunk-SGUPIQYT.js → chunk-M3UJ2JCW.js} +1 -1
- package/dist/{chunk-EVD6CCO2.js → chunk-QDOFRKY2.js} +1 -1
- package/dist/{chunk-GSGJABL6.js → chunk-RALUII7R.js} +3 -3
- package/dist/{chunk-LNUWIY6M.js → chunk-V4IY5CRJ.js} +1 -1
- package/dist/{chunk-YRPL7A3S.js → chunk-Z3QNLNSU.js} +1 -1
- package/dist/{ci-VAAMX44S.js → ci-FTS7XNWA.js} +4 -4
- package/dist/{ci-format-RMULFSB5.js → ci-format-N5PXGS7Y.js} +2 -2
- package/dist/{constants-PXLMEBJY.js → constants-3B5KIPLK.js} +1 -1
- package/dist/{doctor-cli-C2DFYU2M.js → doctor-cli-VRMIEREY.js} +4 -4
- package/dist/electron-server.js +225 -27
- package/dist/{hub-XIU3YTOE.js → hub-TZET5544.js} +1 -1
- package/dist/index.js +100 -89
- package/dist/{persistent-memory-ACXKU6RV.js → persistent-memory-3OYRXF2L.js} +2 -2
- package/dist/{persistent-memory-TA224ZFQ.js → persistent-memory-IPCUJVWF.js} +2 -2
- package/dist/{pr-J74HW44E.js → pr-XUXWP52Z.js} +4 -4
- package/dist/{run-tests-JLZ2KIGV.js → run-tests-3T5WRG62.js} +2 -2
- package/dist/{run-tests-4KTX5YMO.js → run-tests-PUOXATHQ.js} +2 -2
- package/dist/{server-226R6675.js → server-4XSDRPZM.js} +118 -30
- package/dist/{server-4CZXYGJN.js → server-WGEGVVY5.js} +5 -5
- package/dist/{task-orchestrator-6C3R7KSK.js → task-orchestrator-LEW2VSZD.js} +5 -5
- package/dist/{usage-FY3TEJJS.js → usage-7VEAXMMP.js} +2 -2
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ConfigManager
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QDOFRKY2.js";
|
|
5
5
|
import "./chunk-TU3L3PW7.js";
|
|
6
6
|
import {
|
|
7
7
|
atomicWriteFileSync
|
|
8
8
|
} from "./chunk-IW3Q7AE5.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-JSQGDPDK.js";
|
|
10
10
|
|
|
11
11
|
// src/cli/batch.ts
|
|
12
12
|
import Anthropic from "@anthropic-ai/sdk";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
evaluateCiGate,
|
|
4
4
|
normalizeCiThresholds
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-Z3QNLNSU.js";
|
|
6
6
|
import {
|
|
7
7
|
buildReviewPrompt,
|
|
8
8
|
buildSecurityReviewPrompt,
|
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
} from "./chunk-UGY5SVNX.js";
|
|
17
17
|
import {
|
|
18
18
|
ConfigManager
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-QDOFRKY2.js";
|
|
20
20
|
import {
|
|
21
21
|
VERSION
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-JSQGDPDK.js";
|
|
23
23
|
|
|
24
24
|
// src/cli/ci.ts
|
|
25
25
|
import { execFileSync } from "child_process";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
searchPersistentMemories,
|
|
12
12
|
touchMemoryReferences,
|
|
13
13
|
updateMemoryEntry
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-M3UJ2JCW.js";
|
|
15
15
|
import {
|
|
16
16
|
indexProject
|
|
17
17
|
} from "./chunk-4DEMGCK4.js";
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
runHook,
|
|
31
31
|
runLifecycleHooks,
|
|
32
32
|
runTool
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-V4IY5CRJ.js";
|
|
34
34
|
import {
|
|
35
35
|
buildTruncatedArgumentsError,
|
|
36
36
|
getDangerLevel,
|
|
@@ -50,14 +50,14 @@ import {
|
|
|
50
50
|
} from "./chunk-4BKXL7SM.js";
|
|
51
51
|
import {
|
|
52
52
|
runTestsTool
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-4J7FIGQD.js";
|
|
54
54
|
import {
|
|
55
55
|
CONFIG_DIR_NAME,
|
|
56
56
|
DEFAULT_MAX_TOOL_OUTPUT_CHARS_CAP,
|
|
57
57
|
SUBAGENT_ALLOWED_TOOLS,
|
|
58
58
|
SUBAGENT_DEFAULT_MAX_ROUNDS,
|
|
59
59
|
SUBAGENT_MAX_ROUNDS_LIMIT
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-JSQGDPDK.js";
|
|
61
61
|
|
|
62
62
|
// src/tools/shell-pool.ts
|
|
63
63
|
import { spawn as spawn2 } from "child_process";
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
estimateTokens,
|
|
7
7
|
truncateForPersist
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-D7BIF6JO.js";
|
|
9
9
|
import {
|
|
10
10
|
isMemoryExpired,
|
|
11
11
|
isMemoryStale
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-M3UJ2JCW.js";
|
|
13
13
|
import {
|
|
14
14
|
getContentText
|
|
15
15
|
} from "./chunk-IUVDZVZ4.js";
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
MCP_PROTOCOL_VERSION,
|
|
31
31
|
MCP_TOOL_PREFIX,
|
|
32
32
|
VERSION
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-JSQGDPDK.js";
|
|
34
34
|
|
|
35
35
|
// src/mcp/client.ts
|
|
36
36
|
import { spawn } from "child_process";
|
|
@@ -2075,6 +2075,121 @@ function formatForkReport(report) {
|
|
|
2075
2075
|
];
|
|
2076
2076
|
}
|
|
2077
2077
|
|
|
2078
|
+
// src/core/memory-command.ts
|
|
2079
|
+
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";
|
|
2080
|
+
function parseMemoryCommand(args) {
|
|
2081
|
+
const sub = (args[0] ?? "show").toLowerCase();
|
|
2082
|
+
const rest = args.slice(1);
|
|
2083
|
+
switch (sub) {
|
|
2084
|
+
case "rebuild":
|
|
2085
|
+
return { kind: "rebuild", full: true };
|
|
2086
|
+
case "refresh":
|
|
2087
|
+
return { kind: "rebuild", full: false };
|
|
2088
|
+
case "status":
|
|
2089
|
+
return { kind: "status" };
|
|
2090
|
+
case "recall": {
|
|
2091
|
+
const query = rest.join(" ").trim();
|
|
2092
|
+
return query ? { kind: "recall", query } : { kind: "usage", message: "Usage: /memory recall <query>" };
|
|
2093
|
+
}
|
|
2094
|
+
case "index-clear":
|
|
2095
|
+
return { kind: "index-clear" };
|
|
2096
|
+
case "show":
|
|
2097
|
+
case "view":
|
|
2098
|
+
case "list":
|
|
2099
|
+
return { kind: "show", rest };
|
|
2100
|
+
case "add":
|
|
2101
|
+
return { kind: "add", rest };
|
|
2102
|
+
case "edit":
|
|
2103
|
+
return { kind: "edit", rest };
|
|
2104
|
+
case "approve":
|
|
2105
|
+
case "reject":
|
|
2106
|
+
case "delete":
|
|
2107
|
+
case "expire":
|
|
2108
|
+
return { kind: "manage", action: sub, rest };
|
|
2109
|
+
case "rebind":
|
|
2110
|
+
return { kind: "rebind", rest };
|
|
2111
|
+
case "export":
|
|
2112
|
+
return { kind: "export", rest };
|
|
2113
|
+
case "clear":
|
|
2114
|
+
return { kind: "clear", rest };
|
|
2115
|
+
case "backup":
|
|
2116
|
+
return { kind: "backup", rest };
|
|
2117
|
+
case "restore":
|
|
2118
|
+
return { kind: "restore", rest };
|
|
2119
|
+
case "path":
|
|
2120
|
+
return { kind: "path" };
|
|
2121
|
+
default:
|
|
2122
|
+
return { kind: "usage", message: `Unknown /memory subcommand "${args[0]}".
|
|
2123
|
+
${MEMORY_USAGE}` };
|
|
2124
|
+
}
|
|
2125
|
+
}
|
|
2126
|
+
var mb = (n) => `${(n / 1024 / 1024).toFixed(2)} MB`;
|
|
2127
|
+
function buildMemoryStatusView(input) {
|
|
2128
|
+
const governed = [
|
|
2129
|
+
{ label: "active", value: String(input.active) }
|
|
2130
|
+
];
|
|
2131
|
+
governed.push(
|
|
2132
|
+
input.pending > 0 ? {
|
|
2133
|
+
label: "pending",
|
|
2134
|
+
// 照着敲就能用(v0.4.250 定的口径):跳到待批准列表 + 点明 id 是 8 位
|
|
2135
|
+
value: `${input.pending} \u2014 run /memory show --pending, then /memory approve <8-char-id>`,
|
|
2136
|
+
warn: true
|
|
2137
|
+
} : { label: "pending", value: "0" }
|
|
2138
|
+
);
|
|
2139
|
+
if (input.injected) {
|
|
2140
|
+
const note = input.injected.truncated ? ` \u26A0 truncated \u2014 only newest ${input.injected.entryCount} of ${input.injected.totalCount} injected` : "";
|
|
2141
|
+
governed.push({
|
|
2142
|
+
label: "injected",
|
|
2143
|
+
value: `${input.injected.entryCount} of ${input.injected.totalCount} (${input.injected.chars} chars)${note}`,
|
|
2144
|
+
warn: input.injected.truncated
|
|
2145
|
+
});
|
|
2146
|
+
} else {
|
|
2147
|
+
governed.push({ label: "injected", value: "0" });
|
|
2148
|
+
}
|
|
2149
|
+
governed.push({ label: "store", value: input.storePath });
|
|
2150
|
+
if (!input.chatIndex.exists) {
|
|
2151
|
+
return { governed, chatIndex: [], chatIndexHint: "not built yet \u2014 run /memory rebuild" };
|
|
2152
|
+
}
|
|
2153
|
+
return {
|
|
2154
|
+
governed,
|
|
2155
|
+
chatIndex: [
|
|
2156
|
+
{ label: "chunks", value: String(input.chatIndex.chunks) },
|
|
2157
|
+
{ label: "sessions", value: String(input.chatIndex.sessions) },
|
|
2158
|
+
{ label: "built", value: input.chatIndex.built?.replace("T", " ").slice(0, 19) ?? "-" },
|
|
2159
|
+
{ label: "model", value: input.chatIndex.model ?? "-" },
|
|
2160
|
+
{ label: "vec file", value: mb(input.chatIndex.vecFileSizeBytes) },
|
|
2161
|
+
{ label: "chunks file", value: mb(input.chatIndex.chunksFileSizeBytes) }
|
|
2162
|
+
],
|
|
2163
|
+
chatIndexHint: null
|
|
2164
|
+
};
|
|
2165
|
+
}
|
|
2166
|
+
function rebuildStartMessage(full) {
|
|
2167
|
+
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";
|
|
2168
|
+
}
|
|
2169
|
+
function rebuildDoneMessage(stats) {
|
|
2170
|
+
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`;
|
|
2171
|
+
}
|
|
2172
|
+
var clip = (text, max) => text.length > max ? `${text.slice(0, max)}\u2026` : text;
|
|
2173
|
+
function buildRecallView(query, persistent, chat) {
|
|
2174
|
+
const view = {
|
|
2175
|
+
persistentHeading: persistent.length > 0 ? `\u{1F4DD} Persistent memory \u2014 ${persistent.length} hit(s):` : null,
|
|
2176
|
+
persistent: persistent.map((h, i) => ({
|
|
2177
|
+
label: `[${i + 1}] id ${h.id.slice(0, 8)} \xB7 ${h.scope} \xB7 coverage ${h.score.toFixed(2)}`,
|
|
2178
|
+
body: h.content
|
|
2179
|
+
})),
|
|
2180
|
+
chatHeading: chat.length > 0 ? `\u{1F9E0} Chat history recall for "${query}" \u2014 ${chat.length} hit(s):` : null,
|
|
2181
|
+
chat: chat.map((h, i) => ({
|
|
2182
|
+
label: `[${i + 1}] ${h.timestamp.slice(0, 16).replace("T", " ")} \xB7 ${h.title} \xB7 score ${h.score.toFixed(3)}`,
|
|
2183
|
+
body: clip(h.text, 400)
|
|
2184
|
+
})),
|
|
2185
|
+
note: null
|
|
2186
|
+
};
|
|
2187
|
+
if (chat.length === 0) {
|
|
2188
|
+
view.note = persistent.length === 0 ? `No memories matched "${query}" (persistent + chat index).` : "(no chat-history hits above score 0.20)";
|
|
2189
|
+
}
|
|
2190
|
+
return view;
|
|
2191
|
+
}
|
|
2192
|
+
|
|
2078
2193
|
// src/core/session-cost.ts
|
|
2079
2194
|
function buildSessionCostReport(input) {
|
|
2080
2195
|
const { usage } = input;
|
|
@@ -2141,6 +2256,12 @@ export {
|
|
|
2141
2256
|
scanDirTree,
|
|
2142
2257
|
scanProject,
|
|
2143
2258
|
buildInitPrompt,
|
|
2259
|
+
MEMORY_USAGE,
|
|
2260
|
+
parseMemoryCommand,
|
|
2261
|
+
buildMemoryStatusView,
|
|
2262
|
+
rebuildStartMessage,
|
|
2263
|
+
rebuildDoneMessage,
|
|
2264
|
+
buildRecallView,
|
|
2144
2265
|
parseMemoryShowFilters,
|
|
2145
2266
|
filterMemoryEntries,
|
|
2146
2267
|
parseExportArgs,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
MEMORY_FILE_NAME,
|
|
14
14
|
MEMORY_MAX_CHARS,
|
|
15
15
|
MEMORY_STORE_FILE_NAME
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-JSQGDPDK.js";
|
|
17
17
|
|
|
18
18
|
// src/memory/persistent-memory.ts
|
|
19
19
|
import { copyFileSync, existsSync, mkdirSync, readFileSync, statSync } from "fs";
|
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
listHooks,
|
|
9
9
|
listInstalledPlugins,
|
|
10
10
|
resetStats
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-V4IY5CRJ.js";
|
|
12
12
|
import {
|
|
13
13
|
ProviderRegistry
|
|
14
14
|
} from "./chunk-UGY5SVNX.js";
|
|
15
15
|
import {
|
|
16
16
|
ConfigManager
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-QDOFRKY2.js";
|
|
18
18
|
import {
|
|
19
19
|
getGitRoot
|
|
20
20
|
} from "./chunk-HOSJZMQS.js";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
MCP_PROJECT_CONFIG_NAME,
|
|
27
27
|
MEMORY_FILE_NAME,
|
|
28
28
|
VERSION
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-JSQGDPDK.js";
|
|
30
30
|
|
|
31
31
|
// src/diagnostics/doctor-report.ts
|
|
32
32
|
import { existsSync as existsSync3, statSync as statSync2 } from "fs";
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
CI_COMMENT_MARKER,
|
|
4
4
|
countSeverity,
|
|
5
5
|
runCi
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-CUS4FJVP.js";
|
|
7
|
+
import "./chunk-Z3QNLNSU.js";
|
|
8
8
|
import "./chunk-HLWUDRBO.js";
|
|
9
9
|
import "./chunk-6YZEZFX5.js";
|
|
10
10
|
import "./chunk-UGY5SVNX.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-QDOFRKY2.js";
|
|
12
12
|
import "./chunk-TEXT4DAT.js";
|
|
13
13
|
import "./chunk-TU3L3PW7.js";
|
|
14
14
|
import "./chunk-IW3Q7AE5.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-JSQGDPDK.js";
|
|
16
16
|
export {
|
|
17
17
|
CI_COMMENT_MARKER,
|
|
18
18
|
countSeverity,
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import {
|
|
3
3
|
formatDoctorReport,
|
|
4
4
|
runDoctorCli
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-RALUII7R.js";
|
|
6
|
+
import "./chunk-V4IY5CRJ.js";
|
|
7
7
|
import "./chunk-UGY5SVNX.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-QDOFRKY2.js";
|
|
9
9
|
import "./chunk-TEXT4DAT.js";
|
|
10
10
|
import "./chunk-TU3L3PW7.js";
|
|
11
11
|
import "./chunk-HOSJZMQS.js";
|
|
12
12
|
import "./chunk-IW3Q7AE5.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-JSQGDPDK.js";
|
|
14
14
|
export {
|
|
15
15
|
formatDoctorReport,
|
|
16
16
|
runDoctorCli
|