jinzd-ai-cli 0.4.241 → 0.4.243

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 (42) hide show
  1. package/README.md +2 -2
  2. package/dist/{batch-K66BLTLJ.js → batch-CUVZUPRK.js} +2 -2
  3. package/dist/{chat-index-7HXBWQFH.js → chat-index-ALUHFJKI.js} +3 -2
  4. package/dist/{chat-index-WYXYD7YP.js → chat-index-ML5FF5L6.js} +2 -1
  5. package/dist/{chunk-SMQHEJSH.js → chunk-66CE3E6X.js} +1 -1
  6. package/dist/chunk-B5TYJO7V.js +123 -0
  7. package/dist/{chunk-PGHTAKIA.js → chunk-DJGCG7SF.js} +1 -1
  8. package/dist/{chunk-2QQKS56X.js → chunk-DT77O33T.js} +1 -1
  9. package/dist/{chunk-2LLQOMMW.js → chunk-EMFCHE2B.js} +1 -1
  10. package/dist/chunk-GEWPLNKA.js +164 -0
  11. package/dist/{chunk-LXSUPLCK.js → chunk-H3ARWBYR.js} +2 -2
  12. package/dist/{chunk-3AIR7N5M.js → chunk-HNJX3N2V.js} +5 -5
  13. package/dist/{chunk-5MYPIQ3Y.js → chunk-IGPFYNZA.js} +4 -2
  14. package/dist/{chunk-GORPFFV4.js → chunk-KILKF2VN.js} +97 -254
  15. package/dist/{chunk-JMP3LJC2.js → chunk-KWQKQVPH.js} +4 -2
  16. package/dist/{chunk-NAQPP3GZ.js → chunk-L5IRDRWG.js} +1 -1
  17. package/dist/{chunk-UO3XWZFE.js → chunk-NV63EYFL.js} +3 -119
  18. package/dist/{chunk-KCEO2XJ4.js → chunk-PJ3ONBWZ.js} +0 -119
  19. package/dist/{chunk-ZPXMT2B6.js → chunk-PLEXBFCR.js} +4 -163
  20. package/dist/chunk-PNNZRJ67.js +523 -0
  21. package/dist/{chunk-CHFFEVVT.js → chunk-QNK7GUUB.js} +3 -3
  22. package/dist/chunk-TY4FSEZS.js +432 -0
  23. package/dist/{chunk-IV6GCDVR.js → chunk-X73Y4JZI.js} +7 -1
  24. package/dist/chunk-YVTASHS5.js +121 -0
  25. package/dist/{ci-T2ABDMMQ.js → ci-3O3JR6FX.js} +4 -4
  26. package/dist/{ci-format-S2PPU27O.js → ci-format-KGWF6KOU.js} +2 -2
  27. package/dist/{constants-RS7OUU7X.js → constants-NMFRZ5LW.js} +1 -1
  28. package/dist/{doctor-cli-TGAW6RAP.js → doctor-cli-4QUHTJZ4.js} +4 -4
  29. package/dist/electron-server.js +446 -579
  30. package/dist/{hub-GL5ZU6WS.js → hub-2GXFPWOR.js} +2 -2
  31. package/dist/index.js +273 -62
  32. package/dist/{persist-AMH5SQ4W.js → persist-WGIJ6RXY.js} +4 -3
  33. package/dist/persistent-memory-VFBRMKGG.js +65 -0
  34. package/dist/persistent-memory-ZCQKLIC5.js +63 -0
  35. package/dist/{pr-TJFKUZ4B.js → pr-GIDFO4KP.js} +5 -5
  36. package/dist/{run-tests-KEI7IXTB.js → run-tests-BMH6QJN2.js} +2 -2
  37. package/dist/{run-tests-EWMU34A4.js → run-tests-WCZBWQFS.js} +2 -1
  38. package/dist/{server-UVS2D4M6.js → server-A5NGGDMP.js} +130 -47
  39. package/dist/{server-E545UIX7.js → server-FEFIFJDA.js} +8 -6
  40. package/dist/{task-orchestrator-PWXV2EBN.js → task-orchestrator-J2H6OV6R.js} +8 -6
  41. package/dist/{usage-EDJ6QOWB.js → usage-7WJC234G.js} +2 -2
  42. package/package.json +1 -1
package/README.md CHANGED
@@ -34,7 +34,7 @@
34
34
  - **MCP Server Mode** *(v0.4.84+)* — `aicli mcp-serve` reverses ai-cli into an MCP server (JSON-RPC 2.0 over stdio), exposing its 30 built-in tools (incl. `find_symbol` / `search_code` / `run_tests`) to Claude Desktop / Cursor / any MCP client. Opt-in destructive-tool allow, `--tools` whitelist, `--cwd` override
35
35
  - **Session Sensitive-Data Redaction** *(v0.4.88+)* — unified redactor scrubs `password=` / `api_key` / bearer tokens / OpenAI-style keys from every message **before it hits disk**. Query text is redacted too, so secrets never reach embeddings or logs. `/security status` + `/security scan` to audit
36
36
  - **Human-like Long-Term Memory** *(v0.4.89+, B4)* — semantic index over every past chat session + `recall_memory` AI tool + `/memory rebuild|refresh|status|recall` commands. AI is prompted to auto-recall when it sees "last time" / "之前" / ambiguous references. Reuses the same MiniLM embedder as semantic code search
37
- - **Governed Persistent Memory** *(v0.4.217+)* — `save_memory` and `/memory add` write auditable `memory.jsonl` entries with id/scope/source/sensitivity/approval/expiry; low-risk entries auto-approve, sensitive entries stay pending until `/memory approve <id>`, and project-scoped memories only inject inside the same project
37
+ - **Governed Persistent Memory** *(v0.4.217+)* — `save_memory` and `/memory add` write auditable `memory.jsonl` entries with id/scope/source/sensitivity/approval/expiry; AI-written entries (`save_memory`) always stay pending until `/memory approve <id>` (v0.4.242+), low-risk manual entries auto-approve, project-scoped memories only inject inside the same project, and `/memory clear` confirms + keeps a timestamped backup
38
38
  - **Package Plugin Ecosystem** *(v0.4.218+)* — install shareable .aicli-plugin/plugin.json packages with skills, hooks, commands, MCP servers, agents, and permission hints; only trusted+enabled plugins load, hooks still require hook trust, and MCP/tools remain under permission profiles/network policy
39
39
  - **Web UI Memory Panel** *(v0.4.90+, B4)* — new 🧠 Memory sidebar tab with semantic search across past chats; each hit has **➕ Inject** (quotes the snippet into the chat input as a markdown blockquote so you can review/edit before sending — no silent context injection) and **↗ Load** (jumps to source session). Bulk "Inject top 3" for recall bundles
40
40
  - **Streaming Tool Use** — Real-time streaming of AI reasoning and tool calls as they happen
@@ -173,7 +173,7 @@ AI autonomously invokes these 30 tools during conversations:
173
173
  | `run_tests` | safe | Auto-detect and run project tests (JUnit XML parsing) |
174
174
  | `spawn_agent` | safe | Delegate subtasks to named isolated agents (`agent`: explorer/worker/reviewer/security/tester) |
175
175
  | `ask_user` | safe | Pause and ask the user a question |
176
- | `save_memory` | safe | Persist governed memory across sessions; sensitive entries require `/memory approve <id>` |
176
+ | `save_memory` | safe | Persist governed memory across sessions; AI-written entries stay pending until `/memory approve <id>` |
177
177
  | `write_todos` | safe | Task breakdown with live progress rendering |
178
178
  | `save_last_response` | write | Save AI response to file |
179
179
  | `task_create` | write | Start a command running in the background |
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ConfigManager
4
- } from "./chunk-IV6GCDVR.js";
4
+ } from "./chunk-X73Y4JZI.js";
5
5
  import "./chunk-5ULLIOVC.js";
6
- import "./chunk-SMQHEJSH.js";
6
+ import "./chunk-66CE3E6X.js";
7
7
  import {
8
8
  atomicWriteFileSync
9
9
  } from "./chunk-IW3Q7AE5.js";
@@ -6,9 +6,10 @@ import {
6
6
  getChatIndexStatus,
7
7
  loadChatIndex,
8
8
  searchChatMemory
9
- } from "./chunk-5MYPIQ3Y.js";
9
+ } from "./chunk-IGPFYNZA.js";
10
10
  import "./chunk-KHYD3WXE.js";
11
- import "./chunk-KCEO2XJ4.js";
11
+ import "./chunk-PJ3ONBWZ.js";
12
+ import "./chunk-B5TYJO7V.js";
12
13
  import "./chunk-IW3Q7AE5.js";
13
14
  export {
14
15
  buildChatIndex,
@@ -5,7 +5,8 @@ import {
5
5
  getChatIndexStatus,
6
6
  loadChatIndex,
7
7
  searchChatMemory
8
- } from "./chunk-UO3XWZFE.js";
8
+ } from "./chunk-NV63EYFL.js";
9
+ import "./chunk-YVTASHS5.js";
9
10
  import "./chunk-JV5N65KN.js";
10
11
  import "./chunk-6BUTA5VW.js";
11
12
  export {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/core/constants.ts
4
- var VERSION = "0.4.241";
4
+ var VERSION = "0.4.243";
5
5
  var APP_NAME = "ai-cli";
6
6
  var CONFIG_DIR_NAME = ".aicli";
7
7
  var CONFIG_FILE_NAME = "config.json";
@@ -0,0 +1,123 @@
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
+ // P2-PERF-02: PEM bodies use strict Base64 + =\n — narrowed char class avoids backtracking
42
+ { kind: "private-key", regex: /-----BEGIN [A-Z ]*PRIVATE KEY-----[ \t\n\r]*[A-Za-z0-9+/=\n\r-]*[ \t\n\r]*-----END [A-Z ]*PRIVATE KEY-----/g }
43
+ ];
44
+ var MAX_CUSTOM = 32;
45
+ var MAX_PATTERN_LEN = 500;
46
+ var SUSPICIOUS_REDOS = /\([^)]*[+*][^)]*\)\s*[+*{]/;
47
+ var MAX_REDACT_INPUT = 512e3;
48
+ function render(placeholder, kind) {
49
+ return placeholder.replace("{kind}", kind);
50
+ }
51
+ function redactString(input, options) {
52
+ if (!options.enabled || !input) return { redacted: input, hits: [] };
53
+ if (input.length > MAX_REDACT_INPUT) return { redacted: input, hits: [] };
54
+ const placeholder = options.placeholder ?? "[REDACTED:{kind}]";
55
+ const customSrcs = (options.customRegexes ?? []).slice(0, MAX_CUSTOM);
56
+ const patterns = [
57
+ ...options.patterns ?? DEFAULT_PATTERNS,
58
+ ...customSrcs.flatMap((src, i) => {
59
+ if (typeof src !== "string" || src.length === 0 || src.length > MAX_PATTERN_LEN) return [];
60
+ try {
61
+ const flags = src.match(/^\/.*\/([gimsuy]*)$/)?.[1] ?? "";
62
+ const body = src.replace(/^\/(.*)\/[gimsuy]*$/, "$1");
63
+ if (SUSPICIOUS_REDOS.test(body)) return [];
64
+ const regex = new RegExp(body, flags.includes("g") ? flags : flags + "g");
65
+ return [{ kind: `custom-${i}`, regex }];
66
+ } catch {
67
+ return [];
68
+ }
69
+ })
70
+ ];
71
+ let redacted = input;
72
+ const hits = [];
73
+ for (const { kind, regex } of patterns) {
74
+ const rx = new RegExp(regex.source, regex.flags);
75
+ const captureCount = new RegExp(rx.source + "|").exec("").length - 1;
76
+ redacted = redacted.replace(rx, (...args) => {
77
+ const match = args[0];
78
+ const g1 = captureCount >= 1 ? args[1] : void 0;
79
+ const g2 = captureCount >= 2 ? args[2] : void 0;
80
+ const offset = args[1 + captureCount];
81
+ if (captureCount >= 2 && typeof g2 === "string") {
82
+ hits.push({ kind, start: offset + (g1?.length ?? 0), length: g2.length, secret: g2 });
83
+ return `${g1}${render(placeholder, kind)}`;
84
+ }
85
+ hits.push({ kind, start: offset, length: match.length, secret: g1 ?? match });
86
+ return render(placeholder, kind);
87
+ });
88
+ }
89
+ return { redacted, hits };
90
+ }
91
+ function redactJson(value, options) {
92
+ if (!options.enabled) return { value, hits: [] };
93
+ const allHits = [];
94
+ function walk(v) {
95
+ if (typeof v === "string") {
96
+ const r = redactString(v, options);
97
+ allHits.push(...r.hits);
98
+ return r.redacted;
99
+ }
100
+ if (Array.isArray(v)) return v.map(walk);
101
+ if (v && typeof v === "object") {
102
+ const out = {};
103
+ for (const [k, vv] of Object.entries(v)) {
104
+ out[k] = walk(vv);
105
+ }
106
+ return out;
107
+ }
108
+ return v;
109
+ }
110
+ const redacted = walk(value);
111
+ return { value: redacted, hits: allHits };
112
+ }
113
+ function scanString(input, options) {
114
+ const { hits } = redactString(input, { ...options, enabled: true });
115
+ return hits;
116
+ }
117
+
118
+ export {
119
+ DEFAULT_PATTERNS,
120
+ redactString,
121
+ redactJson,
122
+ scanString
123
+ };
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  VERSION
4
- } from "./chunk-SMQHEJSH.js";
4
+ } from "./chunk-66CE3E6X.js";
5
5
 
6
6
  // src/cli/ci-format.ts
7
7
  var DEFAULT_CI_THRESHOLDS = {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  SessionManager
4
- } from "./chunk-JMP3LJC2.js";
4
+ } from "./chunk-KWQKQVPH.js";
5
5
 
6
6
  // src/hub/persist.ts
7
7
  import { join } from "path";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  CONFIG_DIR_NAME,
4
4
  PLUGINS_DIR_NAME
5
- } from "./chunk-SMQHEJSH.js";
5
+ } from "./chunk-66CE3E6X.js";
6
6
  import {
7
7
  atomicWriteFileSync
8
8
  } from "./chunk-IW3Q7AE5.js";
@@ -0,0 +1,164 @@
1
+ // src/core/constants.ts
2
+ var VERSION = "0.4.243";
3
+ var APP_NAME = "ai-cli";
4
+ var CONFIG_DIR_NAME = ".aicli";
5
+ var CONFIG_FILE_NAME = "config.json";
6
+ var HISTORY_DIR_NAME = "history";
7
+ var PLUGINS_DIR_NAME = "plugins";
8
+ var SKILLS_DIR_NAME = "skills";
9
+ var CUSTOM_COMMANDS_DIR_NAME = "commands";
10
+ var CONTEXT_FILE_CANDIDATES = ["AICLI.override.md", "AGENTS.override.md", "AICLI.md", "CLAUDE.md", "AGENTS.md"];
11
+ var CONTEXT_FILE_MAX_BYTES = 32 * 1024;
12
+ var MEMORY_FILE_NAME = "memory.md";
13
+ var MEMORY_STORE_FILE_NAME = "memory.jsonl";
14
+ var MEMORY_MAX_CHARS = 1e4;
15
+ var DEV_STATE_FILE_NAME = "dev-state.md";
16
+ var DEFAULT_MAX_TOKENS = 8192;
17
+ var DEFAULT_MAX_TOOL_ROUNDS = 200;
18
+ var DEFAULT_MAX_TOOL_OUTPUT_CHARS_CAP = 5e5;
19
+ var MCP_TOOL_PREFIX = "mcp__";
20
+ var MCP_PROJECT_CONFIG_NAME = ".mcp.json";
21
+ var MCP_CONNECT_TIMEOUT = 3e4;
22
+ var MCP_CALL_TIMEOUT = 6e4;
23
+ var MCP_PROTOCOL_VERSION = "2024-11-05";
24
+ var PLAN_MODE_READONLY_TOOLS = /* @__PURE__ */ new Set([
25
+ "read_file",
26
+ "list_dir",
27
+ "grep_files",
28
+ "glob_files",
29
+ "web_fetch",
30
+ "google_search",
31
+ "ask_user",
32
+ // 允许:可向用户澄清需求
33
+ "write_todos",
34
+ // 允许:可输出任务列表作为实施计划
35
+ "find_symbol",
36
+ // C1 symbol index (read-only)
37
+ "get_outline",
38
+ // C1 symbol index (read-only)
39
+ "find_references",
40
+ // C1 symbol index (read-only)
41
+ "search_code"
42
+ // C2 semantic search (read-only)
43
+ ]);
44
+ var PLAN_MODE_SYSTEM_ADDON = `# \u{1F50D} Plan Mode \u2014 Read-Only Planning Mode
45
+
46
+ You are currently in read-only planning (Plan) mode.
47
+
48
+ **Allowed tools**: read_file \xB7 list_dir \xB7 grep_files \xB7 glob_files \xB7 web_fetch \xB7 google_search \xB7 ask_user \xB7 write_todos
49
+ **Disabled tools**: bash \xB7 write_file \xB7 edit_file \xB7 run_interactive \xB7 save_last_response \xB7 save_memory and all MCP tools
50
+
51
+ **Your task**:
52
+ 1. Use read-only tools to thoroughly analyze the codebase, file structure, and existing implementation
53
+ 2. Use ask_user to clarify any ambiguous requirements with the user
54
+ 3. Develop a detailed implementation plan (you may use write_todos to present the task list), including:
55
+ - List of files to be modified or created
56
+ - Specific changes for each file
57
+ - Execution order and dependencies
58
+ - Potential risks and considerations
59
+
60
+ **CRITICAL RULES**:
61
+ - Do NOT attempt to call bash, write_file, edit_file, or any disabled tool \u2014 they will fail silently.
62
+ - Do NOT write shell commands, SQL queries, or code in your text response as a substitute for tool calls \u2014 the user's system will misinterpret this as a pseudo-tool-call error.
63
+ - If the user asks you to run commands, test connections, or modify files, respond with: "This requires execution tools. Please type \`/plan execute\` to switch to execute mode, then I can perform these operations."
64
+ - Do NOT call write_todos repeatedly with the same content \u2014 call it once, then give a text response.
65
+ - Focus your analysis on reading files and producing actionable plans.
66
+
67
+ Once planning is complete, clearly inform the user: type \`/plan execute\` to begin executing the plan, or \`/plan exit\` to discard it.`;
68
+ var SUBAGENT_DEFAULT_MAX_ROUNDS = 15;
69
+ var SUBAGENT_MAX_ROUNDS_LIMIT = 30;
70
+ var SUBAGENT_ALLOWED_TOOLS = /* @__PURE__ */ new Set([
71
+ "read_file",
72
+ "write_file",
73
+ "edit_file",
74
+ "list_dir",
75
+ "grep_files",
76
+ "glob_files",
77
+ "web_fetch",
78
+ "google_search",
79
+ "write_todos",
80
+ "find_symbol",
81
+ "get_outline",
82
+ "find_references",
83
+ "search_code"
84
+ ]);
85
+ var TEST_TIMEOUT = 3e5;
86
+ var AGENTIC_BEHAVIOR_GUIDELINE = `# Important Behavioral Guidelines
87
+
88
+ **Respond appropriately to the user's intent \u2014 do NOT over-react**:
89
+ - For **greetings and casual chat** (e.g., "hello", "hi", "hey", "\u4F60\u597D", "what's up"): respond naturally with a friendly greeting. Do NOT use any tools. Do NOT explore directories, read files, or start any project work. Just chat.
90
+ - When the user asks you to "read", "understand", "review", "analyze", "examine", or "look at" files or a project, your task is only to **read and summarize**, then wait for the user's next instruction. Do not automatically start executing tasks described in the project.
91
+ - Only begin using write/execute tools when the user **explicitly requests** an action (e.g., "generate", "create", "modify", "run", "start", etc.).
92
+ - **Stop when the explicit task is done \u2014 do NOT autonomously test, verify, or run what you just created.** If the user asks "write/create/save file X", finish writing the file and STOP. Do not run it, do not test it, do not "verify it works" with bash/run_interactive. The user will run it themselves and tell you if anything is wrong. Only run/test when the user explicitly says "run", "test", "execute", "try it", "verify", "make sure it works", etc.
93
+ - **Do NOT retry the same failing command with variants.** If a command fails (exit code non-zero), report the failure to the user with a brief diagnosis and STOP. Do not loop through alternate shells, alternate quoting, alternate paths, or alternate Python invocations. The user can decide whether to retry.
94
+ - Project context files (AICLI.md, CLAUDE.md, AGENTS.md, and override variants) provide background information about the project. They are NOT instructions to start working. Only use them as reference when the user asks a project-related question or task.
95
+ - If you are unsure about the user's intent, use the ask_user tool to confirm with the user, rather than assuming and executing on your own.
96
+ - **Do NOT abuse ask_user for redundant confirmations**: When the user has already given a clear, explicit instruction (e.g., "write lesson 142", "generate file X", "create the report"), execute it immediately. Do NOT ask "are you sure?" or request details that can be found in project documents. Repeatedly asking the user to confirm wastes their time and is extremely frustrating. Only use ask_user when critical information is genuinely missing and cannot be inferred from context files.`;
97
+ function buildUserIdentityPrompt(profile) {
98
+ const lines = [];
99
+ const displayName = profile.nickname || profile.name;
100
+ if (displayName) {
101
+ lines.push(`The user's name is **${profile.name || displayName}**${profile.nickname && profile.name ? ` (prefers to be called **${profile.nickname}**)` : ""}.`);
102
+ }
103
+ if (profile.role) {
104
+ lines.push(`Role: ${profile.role}.`);
105
+ }
106
+ if (profile.bio) {
107
+ lines.push(`About: ${profile.bio}`);
108
+ }
109
+ if (profile.interests && profile.interests.length > 0) {
110
+ lines.push(`Interests & expertise: ${profile.interests.join(", ")}.`);
111
+ }
112
+ if (profile.locale) {
113
+ lines.push(`Preferred language: ${profile.locale}. Please respond in this language unless the user explicitly uses another language.`);
114
+ }
115
+ if (profile.extra) {
116
+ lines.push(`
117
+ ${profile.extra}`);
118
+ }
119
+ if (lines.length === 0) return null;
120
+ return `# Who You're Talking To
121
+
122
+ ${lines.join("\n")}
123
+
124
+ Address the user personally and adapt your communication style to their background. This identity persists across all conversations and all AI providers.`;
125
+ }
126
+ var AUTHOR = "Jin Zhengdong";
127
+ var AUTHOR_EMAIL = "zhengdong.jin@gmail.com";
128
+ var DESCRIPTION = "Cross-platform REPL-style AI conversation tool with multi-provider and agentic tool calling support";
129
+
130
+ export {
131
+ VERSION,
132
+ APP_NAME,
133
+ CONFIG_DIR_NAME,
134
+ CONFIG_FILE_NAME,
135
+ HISTORY_DIR_NAME,
136
+ PLUGINS_DIR_NAME,
137
+ SKILLS_DIR_NAME,
138
+ CUSTOM_COMMANDS_DIR_NAME,
139
+ CONTEXT_FILE_CANDIDATES,
140
+ CONTEXT_FILE_MAX_BYTES,
141
+ MEMORY_FILE_NAME,
142
+ MEMORY_STORE_FILE_NAME,
143
+ MEMORY_MAX_CHARS,
144
+ DEV_STATE_FILE_NAME,
145
+ DEFAULT_MAX_TOKENS,
146
+ DEFAULT_MAX_TOOL_ROUNDS,
147
+ DEFAULT_MAX_TOOL_OUTPUT_CHARS_CAP,
148
+ MCP_TOOL_PREFIX,
149
+ MCP_PROJECT_CONFIG_NAME,
150
+ MCP_CONNECT_TIMEOUT,
151
+ MCP_CALL_TIMEOUT,
152
+ MCP_PROTOCOL_VERSION,
153
+ PLAN_MODE_READONLY_TOOLS,
154
+ PLAN_MODE_SYSTEM_ADDON,
155
+ SUBAGENT_DEFAULT_MAX_ROUNDS,
156
+ SUBAGENT_MAX_ROUNDS_LIMIT,
157
+ SUBAGENT_ALLOWED_TOOLS,
158
+ TEST_TIMEOUT,
159
+ AGENTIC_BEHAVIOR_GUIDELINE,
160
+ buildUserIdentityPrompt,
161
+ AUTHOR,
162
+ AUTHOR_EMAIL,
163
+ DESCRIPTION
164
+ };
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  truncateForPersist
4
- } from "./chunk-GORPFFV4.js";
4
+ } from "./chunk-KILKF2VN.js";
5
5
  import {
6
6
  APP_NAME,
7
7
  CONFIG_DIR_NAME,
@@ -11,7 +11,7 @@ import {
11
11
  MCP_PROTOCOL_VERSION,
12
12
  MCP_TOOL_PREFIX,
13
13
  VERSION
14
- } from "./chunk-SMQHEJSH.js";
14
+ } from "./chunk-66CE3E6X.js";
15
15
  import {
16
16
  atomicWriteFileSync
17
17
  } from "./chunk-IW3Q7AE5.js";
@@ -2,6 +2,9 @@
2
2
  import {
3
3
  ProviderRegistry
4
4
  } from "./chunk-QYQI7ZWK.js";
5
+ import {
6
+ ConfigManager
7
+ } from "./chunk-X73Y4JZI.js";
5
8
  import {
6
9
  getActivePluginAssets,
7
10
  getPendingHookTrust,
@@ -11,10 +14,7 @@ import {
11
14
  listHooks,
12
15
  listInstalledPlugins,
13
16
  resetStats
14
- } from "./chunk-2LLQOMMW.js";
15
- import {
16
- ConfigManager
17
- } from "./chunk-IV6GCDVR.js";
17
+ } from "./chunk-EMFCHE2B.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-SMQHEJSH.js";
29
+ } from "./chunk-66CE3E6X.js";
30
30
 
31
31
  // src/diagnostics/doctor-report.ts
32
32
  import { existsSync as existsSync3, statSync as statSync2 } from "fs";
@@ -5,9 +5,11 @@ import {
5
5
  embedOne
6
6
  } from "./chunk-KHYD3WXE.js";
7
7
  import {
8
- getIndexMtimeMap,
8
+ getIndexMtimeMap
9
+ } from "./chunk-PJ3ONBWZ.js";
10
+ import {
9
11
  redactString
10
- } from "./chunk-KCEO2XJ4.js";
12
+ } from "./chunk-B5TYJO7V.js";
11
13
  import {
12
14
  atomicWriteFileSync
13
15
  } from "./chunk-IW3Q7AE5.js";