jinzd-ai-cli 0.4.208 → 0.4.209

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 (27) hide show
  1. package/README.md +5 -3
  2. package/dist/{batch-3T44NFLG.js → batch-45WLJUVP.js} +4 -4
  3. package/dist/{chunk-TD7JEHCR.js → chunk-ATNYI6JL.js} +19 -4
  4. package/dist/{chunk-SQB66GP6.js → chunk-BNERFXVO.js} +12 -9
  5. package/dist/{chunk-P7JY3SWA.js → chunk-D6M4E7SH.js} +1 -1
  6. package/dist/{chunk-TM4MS63K.js → chunk-DUZRQXIP.js} +6 -3
  7. package/dist/{chunk-VWYUB22Y.js → chunk-EN63JA7N.js} +1 -1
  8. package/dist/{chunk-QDY72ABW.js → chunk-EYID2AIR.js} +1 -1
  9. package/dist/{chunk-2OVMMSGQ.js → chunk-JVLRMIHA.js} +10 -9
  10. package/dist/{chunk-O6UFCEUZ.js → chunk-K3CF65QH.js} +12 -9
  11. package/dist/{chunk-J22B3OSQ.js → chunk-STIEOOOL.js} +1 -1
  12. package/dist/{chunk-KV4GYNEA.js → chunk-UPMBIS4T.js} +1 -1
  13. package/dist/{ci-6QWBVRJX.js → ci-PUE3MQ7J.js} +3 -2
  14. package/dist/{constants-SZTQNN7K.js → constants-VTZLKDAG.js} +1 -1
  15. package/dist/{doctor-cli-I2Y2YR4V.js → doctor-cli-IU6FSVLF.js} +4 -4
  16. package/dist/electron-server.js +82 -49
  17. package/dist/{hub-XVPFBODB.js → hub-4ETK4R2J.js} +1 -1
  18. package/dist/index.js +27 -28
  19. package/dist/{indexer-AKWMYNJI.js → indexer-2AG4G6B5.js} +1 -1
  20. package/dist/{indexer-BMYUUDLH.js → indexer-4WWS3VIL.js} +1 -1
  21. package/dist/{run-tests-D5SNUBYX.js → run-tests-NDS2IEMK.js} +2 -2
  22. package/dist/{run-tests-HZ2CRCTZ.js → run-tests-UAS5NJBM.js} +1 -1
  23. package/dist/{server-4EFTRFTN.js → server-4URLNC7P.js} +44 -22
  24. package/dist/{server-PVKLPRUP.js → server-72SAPLPS.js} +5 -5
  25. package/dist/{task-orchestrator-2A5VCFLS.js → task-orchestrator-6PZTB35T.js} +5 -5
  26. package/dist/{usage-Q24E5636.js → usage-ZNCKGF6U.js} +2 -2
  27. package/package.json +2 -1
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  indexProject,
3
3
  updateFile
4
- } from "./chunk-SQB66GP6.js";
4
+ } from "./chunk-BNERFXVO.js";
5
5
  import "./chunk-RWM2GFRC.js";
6
6
  import "./chunk-6BUTA5VW.js";
7
7
  export {
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  executeTests,
4
4
  runTestsTool
5
- } from "./chunk-VWYUB22Y.js";
6
- import "./chunk-KV4GYNEA.js";
5
+ } from "./chunk-EN63JA7N.js";
6
+ import "./chunk-UPMBIS4T.js";
7
7
  export {
8
8
  executeTests,
9
9
  runTestsTool
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  executeTests,
3
3
  runTestsTool
4
- } from "./chunk-QDY72ABW.js";
4
+ } from "./chunk-EYID2AIR.js";
5
5
  export {
6
6
  executeTests,
7
7
  runTestsTool
@@ -18,8 +18,9 @@ import {
18
18
  autoTrimSessionIfNeeded,
19
19
  loadDevState,
20
20
  persistToolRound,
21
+ readGitDiff,
21
22
  setupProxy
22
- } from "./chunk-TD7JEHCR.js";
23
+ } from "./chunk-ATNYI6JL.js";
23
24
  import {
24
25
  ToolExecutor,
25
26
  ToolRegistry,
@@ -38,10 +39,10 @@ import {
38
39
  spawnAgentContext,
39
40
  truncateOutput,
40
41
  undoStack
41
- } from "./chunk-2OVMMSGQ.js";
42
+ } from "./chunk-JVLRMIHA.js";
42
43
  import "./chunk-T2NL5ZIA.js";
43
44
  import "./chunk-BXP6YZ2P.js";
44
- import "./chunk-VWYUB22Y.js";
45
+ import "./chunk-EN63JA7N.js";
45
46
  import {
46
47
  SessionManager,
47
48
  getContentText
@@ -55,7 +56,7 @@ import {
55
56
  } from "./chunk-QMXC327F.js";
56
57
  import {
57
58
  runTool
58
- } from "./chunk-J22B3OSQ.js";
59
+ } from "./chunk-STIEOOOL.js";
59
60
  import {
60
61
  CONTENT_ONLY_STREAM_REMINDER,
61
62
  TEE_FINAL_USER_NUDGE,
@@ -74,7 +75,7 @@ import {
74
75
  } from "./chunk-XPBEJB27.js";
75
76
  import {
76
77
  ConfigManager
77
- } from "./chunk-TM4MS63K.js";
78
+ } from "./chunk-DUZRQXIP.js";
78
79
  import "./chunk-TZQHYZKT.js";
79
80
  import {
80
81
  AGENTIC_BEHAVIOR_GUIDELINE,
@@ -94,7 +95,7 @@ import {
94
95
  SKILLS_DIR_NAME,
95
96
  VERSION,
96
97
  buildUserIdentityPrompt
97
- } from "./chunk-KV4GYNEA.js";
98
+ } from "./chunk-UPMBIS4T.js";
98
99
  import {
99
100
  formatGitContextForPrompt,
100
101
  getGitContext,
@@ -104,7 +105,7 @@ import "./chunk-4BKXL7SM.js";
104
105
  import "./chunk-TB4W4Y4T.js";
105
106
  import "./chunk-KHYD3WXE.js";
106
107
  import "./chunk-SLSWPBK3.js";
107
- import "./chunk-O6UFCEUZ.js";
108
+ import "./chunk-K3CF65QH.js";
108
109
  import "./chunk-CKH4KQ4E.js";
109
110
  import {
110
111
  atomicWriteFileSync
@@ -519,9 +520,8 @@ function loadMemoryContent(configDir) {
519
520
  }
520
521
 
521
522
  // src/web/session-handler.ts
522
- import { existsSync as existsSync3, readFileSync as readFileSync3, appendFileSync, writeFileSync, mkdirSync, readdirSync, statSync, createWriteStream } from "fs";
523
+ import { existsSync as existsSync3, readFileSync as readFileSync3, writeFileSync, mkdirSync, readdirSync, statSync, createWriteStream } from "fs";
523
524
  import { join as join2, resolve, dirname } from "path";
524
- import { execSync } from "child_process";
525
525
  function lastAssistantText(messages) {
526
526
  for (let i = messages.length - 1; i >= 0; i--) {
527
527
  const m = messages[i];
@@ -2221,7 +2221,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
2221
2221
  const sub = (args[0] ?? "status").toLowerCase();
2222
2222
  const root = process.cwd();
2223
2223
  const { loadIndex, clearIndex } = await import("./store-MWNHVGJT.js");
2224
- const { indexProject } = await import("./indexer-AKWMYNJI.js");
2224
+ const { indexProject } = await import("./indexer-2AG4G6B5.js");
2225
2225
  const { loadVectorStore, clearVectorStore } = await import("./vector-store-BBDXB5IQ.js");
2226
2226
  if (sub === "status") {
2227
2227
  const idx = loadIndex(root);
@@ -2340,8 +2340,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
2340
2340
  const detailed = args.includes("--detailed");
2341
2341
  let diff;
2342
2342
  try {
2343
- const cmd = staged ? "git diff --staged" : "git diff";
2344
- diff = execSync(cmd, { encoding: "utf-8", timeout: 1e4 }).trim();
2343
+ diff = readGitDiff({ staged });
2345
2344
  } catch {
2346
2345
  this.send({ type: "error", message: "Failed to run git diff." });
2347
2346
  break;
@@ -2379,8 +2378,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
2379
2378
  const secStaged = args.includes("--staged");
2380
2379
  let secDiff;
2381
2380
  try {
2382
- const cmd = secStaged ? "git diff --staged" : "git diff";
2383
- secDiff = execSync(cmd, { encoding: "utf-8", timeout: 1e4 }).trim();
2381
+ secDiff = readGitDiff({ staged: secStaged });
2384
2382
  } catch {
2385
2383
  this.send({ type: "error", message: "Failed to run git diff." });
2386
2384
  break;
@@ -2458,7 +2456,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
2458
2456
  case "test": {
2459
2457
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
2460
2458
  try {
2461
- const { executeTests } = await import("./run-tests-D5SNUBYX.js");
2459
+ const { executeTests } = await import("./run-tests-NDS2IEMK.js");
2462
2460
  const argStr = args.join(" ").trim();
2463
2461
  let testArgs = {};
2464
2462
  if (argStr) {
@@ -2954,9 +2952,11 @@ Add .md files to create commands.` });
2954
2952
  try {
2955
2953
  mkdirSync(configDir, { recursive: true });
2956
2954
  const timestamp = (/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace("T", " ");
2957
- appendFileSync(memPath, `
2955
+ const previous = existsSync3(memPath) ? readFileSync3(memPath, "utf-8") : "";
2956
+ const entry = `
2958
2957
  - [${timestamp}] ${text}
2959
- `, "utf-8");
2958
+ `;
2959
+ atomicWriteFileSync(memPath, previous + entry);
2960
2960
  this.send({ type: "info", message: `\u{1F4DD} Memory entry added: "${text}"` });
2961
2961
  } catch (err) {
2962
2962
  this.send({ type: "error", message: `Failed to write memory: ${err.message}` });
@@ -2966,7 +2966,7 @@ Add .md files to create commands.` });
2966
2966
  const configDir = this.config.getConfigDir();
2967
2967
  const memPath = join2(configDir, MEMORY_FILE_NAME);
2968
2968
  try {
2969
- writeFileSync(memPath, "", "utf-8");
2969
+ atomicWriteFileSync(memPath, "");
2970
2970
  this.send({ type: "info", message: "\u{1F5D1}\uFE0F Persistent memory cleared." });
2971
2971
  } catch (err) {
2972
2972
  this.send({ type: "error", message: `Failed to clear memory: ${err.message}` });
@@ -3588,6 +3588,7 @@ async function startWebServer(options = {}) {
3588
3588
  clientDir = join3(process.cwd(), "src", "web", "client");
3589
3589
  }
3590
3590
  console.log(` Static files: ${clientDir}`);
3591
+ app.use("/vendor", express.static(join3(clientDir, "vendor"), { maxAge: "1y", immutable: true }));
3591
3592
  app.use(express.static(clientDir));
3592
3593
  app.get("/api/status", (_req, res) => {
3593
3594
  res.json({
@@ -3630,7 +3631,7 @@ async function startWebServer(options = {}) {
3630
3631
  }
3631
3632
  const token = authManager.login(username, password);
3632
3633
  console.log(` \u2713 User registered via API: ${username}${firstRun ? " (first-run)" : ""}`);
3633
- res.cookie("aicli_token", token, { httpOnly: true, sameSite: "strict", maxAge: TOKEN_EXPIRY_MS });
3634
+ res.cookie("aicli_token", token, authCookieOptions(req));
3634
3635
  res.json({ success: true, username });
3635
3636
  });
3636
3637
  app.post("/api/auth/login", (req, res) => {
@@ -3644,11 +3645,11 @@ async function startWebServer(options = {}) {
3644
3645
  res.status(401).json({ error: "Invalid username or password" });
3645
3646
  return;
3646
3647
  }
3647
- res.cookie("aicli_token", token, { httpOnly: true, sameSite: "strict", maxAge: TOKEN_EXPIRY_MS });
3648
+ res.cookie("aicli_token", token, authCookieOptions(req));
3648
3649
  res.json({ success: true, username });
3649
3650
  });
3650
- app.post("/api/auth/logout", (_req, res) => {
3651
- res.clearCookie("aicli_token", { httpOnly: true, sameSite: "strict" });
3651
+ app.post("/api/auth/logout", (req, res) => {
3652
+ res.clearCookie("aicli_token", clearAuthCookieOptions(req));
3652
3653
  res.json({ success: true });
3653
3654
  });
3654
3655
  app.get("/api/files", requireAuth, (req, res) => {
@@ -4025,6 +4026,27 @@ function loadProjectMcpConfig() {
4025
4026
  return null;
4026
4027
  }
4027
4028
  }
4029
+ function isHttpsRequest(req) {
4030
+ if (req.secure) return true;
4031
+ const forwardedProto = req.headers["x-forwarded-proto"];
4032
+ const proto = Array.isArray(forwardedProto) ? forwardedProto[0] : forwardedProto;
4033
+ return proto?.split(",")[0]?.trim().toLowerCase() === "https";
4034
+ }
4035
+ function authCookieOptions(req) {
4036
+ return {
4037
+ httpOnly: true,
4038
+ sameSite: "strict",
4039
+ maxAge: TOKEN_EXPIRY_MS,
4040
+ secure: isHttpsRequest(req)
4041
+ };
4042
+ }
4043
+ function clearAuthCookieOptions(req) {
4044
+ return {
4045
+ httpOnly: true,
4046
+ sameSite: "strict",
4047
+ secure: isHttpsRequest(req)
4048
+ };
4049
+ }
4028
4050
  function parseCookie(cookie) {
4029
4051
  const result = {};
4030
4052
  for (const part of cookie.split(";")) {
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ToolRegistry
4
- } from "./chunk-2OVMMSGQ.js";
4
+ } from "./chunk-JVLRMIHA.js";
5
5
  import "./chunk-T2NL5ZIA.js";
6
6
  import "./chunk-BXP6YZ2P.js";
7
- import "./chunk-VWYUB22Y.js";
7
+ import "./chunk-EN63JA7N.js";
8
8
  import {
9
9
  runTool
10
- } from "./chunk-J22B3OSQ.js";
10
+ } from "./chunk-STIEOOOL.js";
11
11
  import {
12
12
  getDangerLevel,
13
13
  schemaToJsonSchema
@@ -15,12 +15,12 @@ import {
15
15
  import "./chunk-TZQHYZKT.js";
16
16
  import {
17
17
  VERSION
18
- } from "./chunk-KV4GYNEA.js";
18
+ } from "./chunk-UPMBIS4T.js";
19
19
  import "./chunk-4BKXL7SM.js";
20
20
  import "./chunk-TB4W4Y4T.js";
21
21
  import "./chunk-KHYD3WXE.js";
22
22
  import "./chunk-SLSWPBK3.js";
23
- import "./chunk-O6UFCEUZ.js";
23
+ import "./chunk-K3CF65QH.js";
24
24
  import "./chunk-CKH4KQ4E.js";
25
25
  import "./chunk-IW3Q7AE5.js";
26
26
 
@@ -3,13 +3,13 @@ import {
3
3
  ToolRegistry,
4
4
  googleSearchContext,
5
5
  truncateOutput
6
- } from "./chunk-2OVMMSGQ.js";
6
+ } from "./chunk-JVLRMIHA.js";
7
7
  import "./chunk-T2NL5ZIA.js";
8
8
  import "./chunk-BXP6YZ2P.js";
9
- import "./chunk-VWYUB22Y.js";
9
+ import "./chunk-EN63JA7N.js";
10
10
  import {
11
11
  runTool
12
- } from "./chunk-J22B3OSQ.js";
12
+ } from "./chunk-STIEOOOL.js";
13
13
  import {
14
14
  getDangerLevel,
15
15
  runLeanAgentLoop
@@ -17,12 +17,12 @@ import {
17
17
  import "./chunk-TZQHYZKT.js";
18
18
  import {
19
19
  SUBAGENT_ALLOWED_TOOLS
20
- } from "./chunk-KV4GYNEA.js";
20
+ } from "./chunk-UPMBIS4T.js";
21
21
  import "./chunk-4BKXL7SM.js";
22
22
  import "./chunk-TB4W4Y4T.js";
23
23
  import "./chunk-KHYD3WXE.js";
24
24
  import "./chunk-SLSWPBK3.js";
25
- import "./chunk-O6UFCEUZ.js";
25
+ import "./chunk-K3CF65QH.js";
26
26
  import "./chunk-CKH4KQ4E.js";
27
27
  import {
28
28
  atomicWriteFileSync
@@ -8,9 +8,9 @@ import {
8
8
  } from "./chunk-E44DTERW.js";
9
9
  import {
10
10
  ConfigManager
11
- } from "./chunk-TM4MS63K.js";
11
+ } from "./chunk-DUZRQXIP.js";
12
12
  import "./chunk-TZQHYZKT.js";
13
- import "./chunk-KV4GYNEA.js";
13
+ import "./chunk-UPMBIS4T.js";
14
14
  import "./chunk-IW3Q7AE5.js";
15
15
 
16
16
  // src/cli/usage.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jinzd-ai-cli",
3
- "version": "0.4.208",
3
+ "version": "0.4.209",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -20,6 +20,7 @@
20
20
  "build": "tsup",
21
21
  "dev": "tsx src/index.ts",
22
22
  "test": "vitest run",
23
+ "test:providers": "vitest run --config vitest.providers.config.ts tests/integration/provider-smoke.test.ts",
23
24
  "test:watch": "vitest",
24
25
  "test:coverage": "vitest run --coverage",
25
26
  "lint": "eslint src",