jinzd-ai-cli 0.4.268 → 0.4.269
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-2N2YMRX2.js → batch-HUOYPVJQ.js} +2 -2
- package/dist/{chunk-UT2WAJJG.js → chunk-3TOMHXDW.js} +1 -1
- package/dist/{chunk-EPVJS4F6.js → chunk-4HTJMLFY.js} +1 -1
- package/dist/{chunk-VGVKJTHF.js → chunk-5IUFUCIT.js} +1 -1
- package/dist/{chunk-2FQGMR34.js → chunk-5PRWBJCI.js} +1 -1
- package/dist/{chunk-YLSM7RF6.js → chunk-6PROC2JO.js} +3 -3
- package/dist/{chunk-7US7K3CD.js → chunk-AAERHPBN.js} +1 -1
- package/dist/{chunk-74BK22BM.js → chunk-DJNGUPM3.js} +4 -4
- package/dist/{chunk-RRQZRSXW.js → chunk-KIHNZBEA.js} +1 -1
- package/dist/{chunk-XDITAGE5.js → chunk-NVN3FHXI.js} +1 -1
- package/dist/{chunk-WNG3YVZX.js → chunk-QPPUYCRF.js} +1 -1
- package/dist/{chunk-VNCBY4KY.js → chunk-S3F5LOV3.js} +162 -2
- package/dist/{chunk-WWLXW4SY.js → chunk-V6KQ67VF.js} +1 -1
- package/dist/{chunk-Z7CZ72RP.js → chunk-XJAGGJVU.js} +3 -3
- package/dist/{ci-3RWVJSZ3.js → ci-4QS2J7BG.js} +4 -4
- package/dist/{ci-format-M6HVCXCG.js → ci-format-6L6M67WC.js} +2 -2
- package/dist/{constants-G6VN7SJL.js → constants-IO5VJLEE.js} +1 -1
- package/dist/{doctor-cli-Y3SVVJBO.js → doctor-cli-ZU4E2DDL.js} +4 -4
- package/dist/electron-server.js +245 -48
- package/dist/{hub-5T5HKOAR.js → hub-AMDWXSKZ.js} +1 -1
- package/dist/index.js +64 -153
- package/dist/{persistent-memory-YBWIZWQP.js → persistent-memory-52SE5K44.js} +2 -2
- package/dist/{persistent-memory-XVSSR277.js → persistent-memory-H4DNDIOQ.js} +2 -2
- package/dist/{pr-NF5IWLH3.js → pr-Z4O5H6I3.js} +4 -4
- package/dist/{run-tests-33X3D7PV.js → run-tests-FZSYHWYX.js} +2 -2
- package/dist/{run-tests-Y44SCLIO.js → run-tests-PYKKYMPA.js} +2 -2
- package/dist/{server-NJ3ZNPQW.js → server-WTJSM2MT.js} +79 -31
- package/dist/{server-3LERX42X.js → server-ZSTVYSYC.js} +5 -5
- package/dist/{task-orchestrator-JN2WFZSF.js → task-orchestrator-PNLI3V36.js} +5 -5
- package/dist/{usage-IFTNXTWC.js → usage-GVFUVYUG.js} +2 -2
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ConfigManager
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5IUFUCIT.js";
|
|
5
5
|
import "./chunk-TU3L3PW7.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-3TOMHXDW.js";
|
|
7
7
|
import {
|
|
8
8
|
atomicWriteFileSync
|
|
9
9
|
} from "./chunk-IW3Q7AE5.js";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-AUEX6RNY.js";
|
|
5
5
|
import {
|
|
6
6
|
ConfigManager
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5IUFUCIT.js";
|
|
8
8
|
import {
|
|
9
9
|
getActivePluginAssets,
|
|
10
10
|
getPendingHookTrust,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
listHooks,
|
|
15
15
|
listInstalledPlugins,
|
|
16
16
|
resetStats
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-5PRWBJCI.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-3TOMHXDW.js";
|
|
30
30
|
|
|
31
31
|
// src/diagnostics/doctor-report.ts
|
|
32
32
|
import { existsSync as existsSync3, statSync as statSync2 } from "fs";
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
searchPersistentMemories,
|
|
8
8
|
touchMemoryReferences,
|
|
9
9
|
updateMemoryEntry
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QPPUYCRF.js";
|
|
11
11
|
import {
|
|
12
12
|
indexProject
|
|
13
13
|
} from "./chunk-GLSR2NR3.js";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
runHook,
|
|
27
27
|
runLifecycleHooks,
|
|
28
28
|
runTool
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-5PRWBJCI.js";
|
|
30
30
|
import {
|
|
31
31
|
buildTruncatedArgumentsError,
|
|
32
32
|
getDangerLevel,
|
|
@@ -43,14 +43,14 @@ import {
|
|
|
43
43
|
} from "./chunk-4BKXL7SM.js";
|
|
44
44
|
import {
|
|
45
45
|
runTestsTool
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-V6KQ67VF.js";
|
|
47
47
|
import {
|
|
48
48
|
CONFIG_DIR_NAME,
|
|
49
49
|
DEFAULT_MAX_TOOL_OUTPUT_CHARS_CAP,
|
|
50
50
|
SUBAGENT_ALLOWED_TOOLS,
|
|
51
51
|
SUBAGENT_DEFAULT_MAX_ROUNDS,
|
|
52
52
|
SUBAGENT_MAX_ROUNDS_LIMIT
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-3TOMHXDW.js";
|
|
54
54
|
import {
|
|
55
55
|
loadChatIndex,
|
|
56
56
|
searchChatMemory
|
|
@@ -5,7 +5,11 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
estimateTokens,
|
|
7
7
|
truncateForPersist
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DJNGUPM3.js";
|
|
9
|
+
import {
|
|
10
|
+
isMemoryExpired,
|
|
11
|
+
isMemoryStale
|
|
12
|
+
} from "./chunk-QPPUYCRF.js";
|
|
9
13
|
import {
|
|
10
14
|
APP_NAME,
|
|
11
15
|
CONFIG_DIR_NAME,
|
|
@@ -16,7 +20,7 @@ import {
|
|
|
16
20
|
MCP_PROTOCOL_VERSION,
|
|
17
21
|
MCP_TOOL_PREFIX,
|
|
18
22
|
VERSION
|
|
19
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-3TOMHXDW.js";
|
|
20
24
|
import {
|
|
21
25
|
atomicWriteFileSync
|
|
22
26
|
} from "./chunk-IW3Q7AE5.js";
|
|
@@ -893,6 +897,84 @@ Output the Markdown content directly, do not wrap the entire file in a code bloc
|
|
|
893
897
|
return parts.join("\n");
|
|
894
898
|
}
|
|
895
899
|
|
|
900
|
+
// src/core/memory-filters.ts
|
|
901
|
+
function parseFlags(items) {
|
|
902
|
+
const flags = {};
|
|
903
|
+
const text = [];
|
|
904
|
+
for (let i = 0; i < items.length; i++) {
|
|
905
|
+
const item = items[i];
|
|
906
|
+
if (item.startsWith("--")) {
|
|
907
|
+
const key = item.slice(2);
|
|
908
|
+
const next = items[i + 1];
|
|
909
|
+
if (next && !next.startsWith("--")) {
|
|
910
|
+
flags[key] = next;
|
|
911
|
+
i++;
|
|
912
|
+
} else {
|
|
913
|
+
flags[key] = true;
|
|
914
|
+
}
|
|
915
|
+
} else {
|
|
916
|
+
text.push(item);
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
return { flags, text: text.join(" ").trim() };
|
|
920
|
+
}
|
|
921
|
+
var SCOPES = /* @__PURE__ */ new Set(["personal", "project", "session", "team"]);
|
|
922
|
+
var BOOLEAN_FLAGS = ["pending", "orphaned"];
|
|
923
|
+
function parseMemoryShowFilters(args) {
|
|
924
|
+
const { flags, text } = parseFlags(args);
|
|
925
|
+
const strayTerms = [];
|
|
926
|
+
for (const key of BOOLEAN_FLAGS) {
|
|
927
|
+
const v = flags[key];
|
|
928
|
+
if (typeof v === "string") {
|
|
929
|
+
strayTerms.push(v);
|
|
930
|
+
flags[key] = true;
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
const scopeRaw = flags["scope"];
|
|
934
|
+
const freeText = [text, ...strayTerms].filter(Boolean).join(" ").trim();
|
|
935
|
+
const searchRaw = typeof flags["search"] === "string" ? flags["search"] : freeText || void 0;
|
|
936
|
+
const staleRaw = flags["stale"];
|
|
937
|
+
let staleDays;
|
|
938
|
+
let invalidStale = false;
|
|
939
|
+
if (staleRaw !== void 0) {
|
|
940
|
+
const n = typeof staleRaw === "string" ? Number(staleRaw) : NaN;
|
|
941
|
+
if (!Number.isFinite(n) || n <= 0) invalidStale = true;
|
|
942
|
+
else staleDays = n;
|
|
943
|
+
}
|
|
944
|
+
return {
|
|
945
|
+
pending: flags["pending"] === true,
|
|
946
|
+
orphaned: flags["orphaned"] === true,
|
|
947
|
+
scope: typeof scopeRaw === "string" && SCOPES.has(scopeRaw) ? scopeRaw : void 0,
|
|
948
|
+
search: searchRaw?.toLowerCase(),
|
|
949
|
+
staleDays,
|
|
950
|
+
invalidStale
|
|
951
|
+
};
|
|
952
|
+
}
|
|
953
|
+
function filterMemoryEntries(entries, filters) {
|
|
954
|
+
let out = entries;
|
|
955
|
+
const applied = [];
|
|
956
|
+
if (filters.orphaned) applied.push("orphaned");
|
|
957
|
+
if (filters.pending) {
|
|
958
|
+
out = out.filter((m) => !m.approved && !isMemoryExpired(m));
|
|
959
|
+
applied.push("pending");
|
|
960
|
+
}
|
|
961
|
+
if (filters.scope) {
|
|
962
|
+
out = out.filter((m) => m.scope === filters.scope);
|
|
963
|
+
applied.push(`scope:${filters.scope}`);
|
|
964
|
+
}
|
|
965
|
+
if (filters.search) {
|
|
966
|
+
const q = filters.search;
|
|
967
|
+
out = out.filter((m) => m.content.toLowerCase().includes(q) || m.id.startsWith(q));
|
|
968
|
+
applied.push(`search:"${q}"`);
|
|
969
|
+
}
|
|
970
|
+
if (filters.staleDays !== void 0) {
|
|
971
|
+
const days = filters.staleDays;
|
|
972
|
+
out = out.filter((m) => isMemoryStale(m, days));
|
|
973
|
+
applied.push(`stale>${days}d`);
|
|
974
|
+
}
|
|
975
|
+
return { entries: out, applied };
|
|
976
|
+
}
|
|
977
|
+
|
|
896
978
|
// src/session/tool-history.ts
|
|
897
979
|
var SESSION_SIZE_LIMIT = 2 * 1024 * 1024;
|
|
898
980
|
function persistToolRound(session, toolCalls, toolResults, opts) {
|
|
@@ -1012,6 +1094,80 @@ function evaluateContextPressure(input) {
|
|
|
1012
1094
|
}
|
|
1013
1095
|
var AUTO_COMPACT_INSTRUCTION = "Preserve key context, compress old content, ensure seamless continuation";
|
|
1014
1096
|
|
|
1097
|
+
// src/core/model-router.ts
|
|
1098
|
+
var TAG_REGEX = /(?:^|\s)#([a-zA-Z][\w-]{0,31})\b/g;
|
|
1099
|
+
function extractTags(message) {
|
|
1100
|
+
const tags = /* @__PURE__ */ new Set();
|
|
1101
|
+
let m;
|
|
1102
|
+
TAG_REGEX.lastIndex = 0;
|
|
1103
|
+
while ((m = TAG_REGEX.exec(message)) !== null) {
|
|
1104
|
+
tags.add(m[1].toLowerCase());
|
|
1105
|
+
}
|
|
1106
|
+
return tags;
|
|
1107
|
+
}
|
|
1108
|
+
function matches(message, matcher) {
|
|
1109
|
+
const trimmed = message.trim();
|
|
1110
|
+
const lower = trimmed.toLowerCase();
|
|
1111
|
+
if (matcher.tag) {
|
|
1112
|
+
const tags = extractTags(trimmed);
|
|
1113
|
+
if (!tags.has(matcher.tag.toLowerCase())) return false;
|
|
1114
|
+
}
|
|
1115
|
+
if (matcher.contains && matcher.contains.length > 0) {
|
|
1116
|
+
const hit = matcher.contains.some((kw) => lower.includes(kw.toLowerCase()));
|
|
1117
|
+
if (!hit) return false;
|
|
1118
|
+
}
|
|
1119
|
+
if (typeof matcher.maxLength === "number") {
|
|
1120
|
+
if (trimmed.length > matcher.maxLength) return false;
|
|
1121
|
+
}
|
|
1122
|
+
if (typeof matcher.minLength === "number") {
|
|
1123
|
+
if (trimmed.length < matcher.minLength) return false;
|
|
1124
|
+
}
|
|
1125
|
+
const hasAnyCondition = !!matcher.tag || matcher.contains && matcher.contains.length > 0 || typeof matcher.maxLength === "number" || typeof matcher.minLength === "number";
|
|
1126
|
+
return !!hasAnyCondition;
|
|
1127
|
+
}
|
|
1128
|
+
function pickModel(message, currentModel, config, availableModels = []) {
|
|
1129
|
+
if (!config.enabled || config.rules.length === 0) {
|
|
1130
|
+
return { model: currentModel, reason: "routing disabled", overridden: false };
|
|
1131
|
+
}
|
|
1132
|
+
const isAvailable = (m) => availableModels.length === 0 || availableModels.includes(m);
|
|
1133
|
+
for (let i = 0; i < config.rules.length; i++) {
|
|
1134
|
+
const rule = config.rules[i];
|
|
1135
|
+
if (!matches(message, rule.match)) continue;
|
|
1136
|
+
if (!isAvailable(rule.model)) continue;
|
|
1137
|
+
if (rule.model === currentModel) {
|
|
1138
|
+
return {
|
|
1139
|
+
model: currentModel,
|
|
1140
|
+
reason: `rule "${rule.name ?? `#${i}`}" matched (same as current)`,
|
|
1141
|
+
overridden: false,
|
|
1142
|
+
ruleIdx: i
|
|
1143
|
+
};
|
|
1144
|
+
}
|
|
1145
|
+
return {
|
|
1146
|
+
model: rule.model,
|
|
1147
|
+
reason: `rule "${rule.name ?? `#${i}`}" matched`,
|
|
1148
|
+
overridden: true,
|
|
1149
|
+
ruleIdx: i
|
|
1150
|
+
};
|
|
1151
|
+
}
|
|
1152
|
+
if (config.fallback && config.fallback !== currentModel && isAvailable(config.fallback)) {
|
|
1153
|
+
return {
|
|
1154
|
+
model: config.fallback,
|
|
1155
|
+
reason: "fallback",
|
|
1156
|
+
overridden: true
|
|
1157
|
+
};
|
|
1158
|
+
}
|
|
1159
|
+
return { model: currentModel, reason: "no rule matched", overridden: false };
|
|
1160
|
+
}
|
|
1161
|
+
function stripRoutingTags(message) {
|
|
1162
|
+
return message.replace(/(?:^|\s)#(fast|deep|default)\b/gi, " ").replace(/\s{2,}/g, " ").trim();
|
|
1163
|
+
}
|
|
1164
|
+
function decideModel(input) {
|
|
1165
|
+
if (!input.routingConfig || !input.routingConfig.enabled) {
|
|
1166
|
+
return { model: input.currentModel, reason: "routing disabled", overridden: false };
|
|
1167
|
+
}
|
|
1168
|
+
return pickModel(input.userInput, input.currentModel, input.routingConfig, input.availableModels);
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1015
1171
|
// src/repl/dev-state.ts
|
|
1016
1172
|
import { existsSync as existsSync3, readFileSync as readFileSync3, unlinkSync, mkdirSync as mkdirSync2 } from "fs";
|
|
1017
1173
|
import { join as join3 } from "path";
|
|
@@ -1330,6 +1486,8 @@ export {
|
|
|
1330
1486
|
scanDirTree,
|
|
1331
1487
|
scanProject,
|
|
1332
1488
|
buildInitPrompt,
|
|
1489
|
+
parseMemoryShowFilters,
|
|
1490
|
+
filterMemoryEntries,
|
|
1333
1491
|
buildSessionCostReport,
|
|
1334
1492
|
costSourceNote,
|
|
1335
1493
|
parseSimpleYaml,
|
|
@@ -1338,6 +1496,8 @@ export {
|
|
|
1338
1496
|
estimateConversationTokens,
|
|
1339
1497
|
evaluateContextPressure,
|
|
1340
1498
|
AUTO_COMPACT_INSTRUCTION,
|
|
1499
|
+
stripRoutingTags,
|
|
1500
|
+
decideModel,
|
|
1341
1501
|
SNAPSHOT_PROMPT,
|
|
1342
1502
|
sessionHasMeaningfulContent,
|
|
1343
1503
|
saveDevState,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
evaluateCiGate,
|
|
4
4
|
normalizeCiThresholds
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-AAERHPBN.js";
|
|
6
6
|
import {
|
|
7
7
|
buildReviewPrompt,
|
|
8
8
|
buildSecurityReviewPrompt,
|
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
} from "./chunk-AUEX6RNY.js";
|
|
17
17
|
import {
|
|
18
18
|
ConfigManager
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-5IUFUCIT.js";
|
|
20
20
|
import {
|
|
21
21
|
VERSION
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-3TOMHXDW.js";
|
|
23
23
|
|
|
24
24
|
// src/cli/ci.ts
|
|
25
25
|
import { execFileSync } from "child_process";
|
|
@@ -3,15 +3,15 @@ import {
|
|
|
3
3
|
CI_COMMENT_MARKER,
|
|
4
4
|
countSeverity,
|
|
5
5
|
runCi
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-XJAGGJVU.js";
|
|
7
|
+
import "./chunk-AAERHPBN.js";
|
|
8
8
|
import "./chunk-HLWUDRBO.js";
|
|
9
9
|
import "./chunk-6YZEZFX5.js";
|
|
10
10
|
import "./chunk-AUEX6RNY.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-5IUFUCIT.js";
|
|
12
12
|
import "./chunk-3OBY7WSS.js";
|
|
13
13
|
import "./chunk-TU3L3PW7.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-3TOMHXDW.js";
|
|
15
15
|
import "./chunk-IW3Q7AE5.js";
|
|
16
16
|
export {
|
|
17
17
|
CI_COMMENT_MARKER,
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import {
|
|
3
3
|
formatDoctorReport,
|
|
4
4
|
runDoctorCli
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-6PROC2JO.js";
|
|
6
6
|
import "./chunk-AUEX6RNY.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-5IUFUCIT.js";
|
|
8
|
+
import "./chunk-5PRWBJCI.js";
|
|
9
9
|
import "./chunk-3OBY7WSS.js";
|
|
10
10
|
import "./chunk-TU3L3PW7.js";
|
|
11
11
|
import "./chunk-HOSJZMQS.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-3TOMHXDW.js";
|
|
13
13
|
import "./chunk-IW3Q7AE5.js";
|
|
14
14
|
export {
|
|
15
15
|
formatDoctorReport,
|