jinzd-ai-cli 0.4.154 → 0.4.155

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.
Files changed (26) hide show
  1. package/dist/{batch-W57MV5OT.js → batch-LS3IJVBK.js} +2 -2
  2. package/dist/{chat-index-LUQWWLKO.js → chat-index-IF4EINLQ.js} +2 -1
  3. package/dist/{chunk-UE26B3RO.js → chunk-B3LFGPU2.js} +1 -1
  4. package/dist/{chunk-ZAYDVWY4.js → chunk-CIZQZ7CC.js} +23 -787
  5. package/dist/{chunk-SH7NTECG.js → chunk-D6GJTJQH.js} +1 -1
  6. package/dist/{chunk-XWYWASPT.js → chunk-E5ICQT3P.js} +4 -4
  7. package/dist/{chunk-OSTMMSOV.js → chunk-IBBYW6PM.js} +1 -1
  8. package/dist/{chunk-NP7WOVIH.js → chunk-JOJRBV2K.js} +1 -1
  9. package/dist/{chunk-2IODI5TI.js → chunk-JXSWY54M.js} +1 -1
  10. package/dist/{chunk-HVNEBTSF.js → chunk-NFRTSL3N.js} +1 -1
  11. package/dist/chunk-SLSWPBK3.js +120 -0
  12. package/dist/chunk-TOTEUETI.js +768 -0
  13. package/dist/{chunk-RXM76HB7.js → chunk-U5MY24UZ.js} +3 -117
  14. package/dist/{ci-JYZGZSMP.js → ci-34ZQH43L.js} +2 -2
  15. package/dist/{constants-S4Y6A25E.js → constants-DQ5VJOGS.js} +1 -1
  16. package/dist/{doctor-cli-FMTMDO2Z.js → doctor-cli-TSCI4ORL.js} +4 -4
  17. package/dist/electron-server.js +2 -2
  18. package/dist/{hub-OP7EWTQQ.js → hub-ZILVZWI2.js} +19 -3
  19. package/dist/index.js +28 -22
  20. package/dist/persist-3EBOLHFZ.js +52 -0
  21. package/dist/{run-tests-4XNY7QB4.js → run-tests-5CJRMOMI.js} +1 -1
  22. package/dist/{run-tests-3QAZGHP2.js → run-tests-5KWCHBQS.js} +2 -2
  23. package/dist/{server-UL42EXOA.js → server-35OQV62B.js} +16 -13
  24. package/dist/{server-W4TBZN6I.js → server-DVIP7NLW.js} +6 -5
  25. package/dist/{task-orchestrator-RLAZK5EB.js → task-orchestrator-AXSS7ROD.js} +6 -5
  26. package/package.json +1 -1
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  CONFIG_DIR_NAME,
4
4
  VERSION
5
- } from "./chunk-UE26B3RO.js";
5
+ } from "./chunk-B3LFGPU2.js";
6
6
 
7
7
  // src/diagnostics/crash-log.ts
8
8
  import {
@@ -5,10 +5,10 @@ import {
5
5
  } from "./chunk-HDSKW7Q3.js";
6
6
  import {
7
7
  runTestsTool
8
- } from "./chunk-NP7WOVIH.js";
8
+ } from "./chunk-JOJRBV2K.js";
9
9
  import {
10
10
  runTool
11
- } from "./chunk-HVNEBTSF.js";
11
+ } from "./chunk-NFRTSL3N.js";
12
12
  import {
13
13
  getDangerLevel,
14
14
  isFileWriteTool
@@ -25,14 +25,14 @@ import {
25
25
  SUBAGENT_ALLOWED_TOOLS,
26
26
  SUBAGENT_DEFAULT_MAX_ROUNDS,
27
27
  SUBAGENT_MAX_ROUNDS_LIMIT
28
- } from "./chunk-UE26B3RO.js";
28
+ } from "./chunk-B3LFGPU2.js";
29
29
  import {
30
30
  fileCheckpoints
31
31
  } from "./chunk-4BKXL7SM.js";
32
32
  import {
33
33
  loadChatIndex,
34
34
  searchChatMemory
35
- } from "./chunk-RXM76HB7.js";
35
+ } from "./chunk-U5MY24UZ.js";
36
36
  import {
37
37
  indexProject
38
38
  } from "./chunk-VNNYHW6N.js";
@@ -8,7 +8,7 @@ import {
8
8
  CONFIG_FILE_NAME,
9
9
  HISTORY_DIR_NAME,
10
10
  PLUGINS_DIR_NAME
11
- } from "./chunk-UE26B3RO.js";
11
+ } from "./chunk-B3LFGPU2.js";
12
12
 
13
13
  // src/config/config-manager.ts
14
14
  import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  TEST_TIMEOUT
4
- } from "./chunk-UE26B3RO.js";
4
+ } from "./chunk-B3LFGPU2.js";
5
5
 
6
6
  // src/tools/builtin/run-tests.ts
7
7
  import { execSync, spawnSync } from "child_process";
@@ -6,7 +6,7 @@ import { platform } from "os";
6
6
  import chalk from "chalk";
7
7
 
8
8
  // src/core/constants.ts
9
- var VERSION = "0.4.154";
9
+ var VERSION = "0.4.155";
10
10
  var APP_NAME = "ai-cli";
11
11
  var CONFIG_DIR_NAME = ".aicli";
12
12
  var CONFIG_FILE_NAME = "config.json";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CONFIG_DIR_NAME
4
- } from "./chunk-UE26B3RO.js";
4
+ } from "./chunk-B3LFGPU2.js";
5
5
 
6
6
  // src/diagnostics/tool-stats.ts
7
7
  import { existsSync, readFileSync, writeFileSync, mkdirSync, renameSync } from "fs";
@@ -0,0 +1,120 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/security/redactor.ts
4
+ var DEFAULT_PATTERNS = [
5
+ // password: xxx / password = xxx / password="xxx"
6
+ // Covers YAML / JSON / shell-ish / env-file forms.
7
+ { kind: "password", regex: /\b(password|passwd|pwd)\s*[:=]\s*["']?([^\s"',;{}]{4,200})["']?/gi },
8
+ // PGPASSWORD=xxx (explicit bash env-var form, separate rule because no quotes usually)
9
+ { kind: "pgpassword-env", regex: /\b(PGPASSWORD)=([^\s"']{4,200})/g },
10
+ // JDBC/PG/MySQL/Mongo connection strings with inline credentials
11
+ // postgresql://user:pass@host/db → redact pass
12
+ { kind: "db-uri-password", regex: /(\b(?:postgres(?:ql)?|mysql|mongodb(?:\+srv)?|redis|amqp|mssql):\/\/[^:\s]+:)([^@\s]+)(@)/gi },
13
+ // Anthropic API keys
14
+ { kind: "anthropic-key", regex: /(sk-ant-[a-zA-Z0-9_-]{90,})/g },
15
+ // L6 (v0.4.108): Zhipu / GLM API keys — `<24+ hex/base64-ish>.<32+>`
16
+ // Two segments separated by a dot, each safely identifiable by length
17
+ // and char class. Conservative on the lower bound so we don't eat
18
+ // version strings like `1.0.0` or filenames.
19
+ { kind: "zhipu-key", regex: /\b([a-zA-Z0-9]{24,}\.[a-zA-Z0-9]{32,})\b/g },
20
+ // OpenAI / generic sk- keys — requires length ≥32 to avoid eating short identifiers
21
+ { kind: "openai-key", regex: /(sk-(?:proj-)?[a-zA-Z0-9_-]{32,})/g },
22
+ // GitHub personal access tokens
23
+ { kind: "github-pat", regex: /\b(ghp_[a-zA-Z0-9]{36})\b/g },
24
+ { kind: "github-oauth", regex: /\b(gho_[a-zA-Z0-9]{36})\b/g },
25
+ { kind: "github-install", regex: /\b(ghs_[a-zA-Z0-9]{36})\b/g },
26
+ // Slack tokens
27
+ { kind: "slack-bot", regex: /\b(xoxb-\d+-\d+-[a-zA-Z0-9]+)\b/g },
28
+ { kind: "slack-user", regex: /\b(xoxp-\d+-\d+-\d+-[a-zA-Z0-9]+)\b/g },
29
+ // AWS access key IDs (AKIA...) and secret access keys are context-dependent;
30
+ // we only catch the ID because secret key alone is indistinguishable from random base64.
31
+ { kind: "aws-access-key-id", regex: /\b(AKIA[0-9A-Z]{16})\b/g },
32
+ // Google API keys
33
+ { kind: "google-api-key", regex: /\b(AIza[0-9A-Za-z_-]{35})\b/g },
34
+ // Generic "api_key": "..." / "apiKey": "..." / api-key=xxx
35
+ { kind: "api-key", regex: /\b(api[_-]?key)\s*[:=]\s*["']?([a-zA-Z0-9_\-.]{16,200})["']?/gi },
36
+ // Generic token: xxx (only when value looks token-shaped; avoids eating human prose)
37
+ { kind: "token", regex: /\b(token|access[_-]?token|bearer[_-]?token)\s*[:=]\s*["']?([a-zA-Z0-9_\-.]{20,300})["']?/gi },
38
+ // Bearer <token> in Authorization headers
39
+ { kind: "bearer", regex: /\b(Authorization:\s*Bearer\s+)([a-zA-Z0-9_\-.=]{20,500})/g },
40
+ // Private key PEM blocks — catch the header+footer together
41
+ { kind: "private-key", regex: /-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z ]*PRIVATE KEY-----/g }
42
+ ];
43
+ var MAX_CUSTOM = 32;
44
+ var MAX_PATTERN_LEN = 500;
45
+ var SUSPICIOUS_REDOS = /\([^)]*[+*][^)]*\)\s*[+*{]/;
46
+ function render(placeholder, kind) {
47
+ return placeholder.replace("{kind}", kind);
48
+ }
49
+ function redactString(input, options) {
50
+ if (!options.enabled || !input) return { redacted: input, hits: [] };
51
+ const placeholder = options.placeholder ?? "[REDACTED:{kind}]";
52
+ const customSrcs = (options.customRegexes ?? []).slice(0, MAX_CUSTOM);
53
+ const patterns = [
54
+ ...options.patterns ?? DEFAULT_PATTERNS,
55
+ ...customSrcs.flatMap((src, i) => {
56
+ if (typeof src !== "string" || src.length === 0 || src.length > MAX_PATTERN_LEN) return [];
57
+ try {
58
+ const flags = src.match(/^\/.*\/([gimsuy]*)$/)?.[1] ?? "";
59
+ const body = src.replace(/^\/(.*)\/[gimsuy]*$/, "$1");
60
+ if (SUSPICIOUS_REDOS.test(body)) return [];
61
+ const regex = new RegExp(body, flags.includes("g") ? flags : flags + "g");
62
+ return [{ kind: `custom-${i}`, regex }];
63
+ } catch {
64
+ return [];
65
+ }
66
+ })
67
+ ];
68
+ let redacted = input;
69
+ const hits = [];
70
+ for (const { kind, regex } of patterns) {
71
+ const rx = new RegExp(regex.source, regex.flags);
72
+ const captureCount = new RegExp(rx.source + "|").exec("").length - 1;
73
+ redacted = redacted.replace(rx, (...args) => {
74
+ const match = args[0];
75
+ const g1 = captureCount >= 1 ? args[1] : void 0;
76
+ const g2 = captureCount >= 2 ? args[2] : void 0;
77
+ const offset = args[1 + captureCount];
78
+ if (captureCount >= 2 && typeof g2 === "string") {
79
+ hits.push({ kind, start: offset + (g1?.length ?? 0), length: g2.length, secret: g2 });
80
+ return `${g1}${render(placeholder, kind)}`;
81
+ }
82
+ hits.push({ kind, start: offset, length: match.length, secret: g1 ?? match });
83
+ return render(placeholder, kind);
84
+ });
85
+ }
86
+ return { redacted, hits };
87
+ }
88
+ function redactJson(value, options) {
89
+ if (!options.enabled) return { value, hits: [] };
90
+ const allHits = [];
91
+ function walk(v) {
92
+ if (typeof v === "string") {
93
+ const r = redactString(v, options);
94
+ allHits.push(...r.hits);
95
+ return r.redacted;
96
+ }
97
+ if (Array.isArray(v)) return v.map(walk);
98
+ if (v && typeof v === "object") {
99
+ const out = {};
100
+ for (const [k, vv] of Object.entries(v)) {
101
+ out[k] = walk(vv);
102
+ }
103
+ return out;
104
+ }
105
+ return v;
106
+ }
107
+ const redacted = walk(value);
108
+ return { value: redacted, hits: allHits };
109
+ }
110
+ function scanString(input, options) {
111
+ const { hits } = redactString(input, { ...options, enabled: true });
112
+ return hits;
113
+ }
114
+
115
+ export {
116
+ DEFAULT_PATTERNS,
117
+ redactString,
118
+ redactJson,
119
+ scanString
120
+ };