jinzd-ai-cli 0.4.330 → 0.4.333

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 (47) hide show
  1. package/dist/{batch-GXITPLER.js → batch-TYKULVIK.js} +2 -2
  2. package/dist/{chunk-LLXHA2LA.js → chunk-3JGBKYCN.js} +8 -8
  3. package/dist/{chunk-DX2U6QK4.js → chunk-4RVLGIK3.js} +1 -1
  4. package/dist/{chunk-DU44SD6A.js → chunk-4TKEA7RE.js} +1 -1
  5. package/dist/{chunk-GEC3MEVQ.js → chunk-5MUAJ742.js} +6 -4
  6. package/dist/{chunk-LUJ4JVMI.js → chunk-6WQCZTAJ.js} +4 -4
  7. package/dist/{chunk-M5B6G6AY.js → chunk-A4KKNBG3.js} +9 -7
  8. package/dist/{chunk-E2W2MI6H.js → chunk-C6GA7H5D.js} +1 -72
  9. package/dist/{chunk-C2Z77RTU.js → chunk-DAAR4XOY.js} +17 -4
  10. package/dist/{chunk-265M6ZLH.js → chunk-H4UIWMA5.js} +4 -4
  11. package/dist/{chunk-AJITHMRE.js → chunk-JTXHWIBO.js} +1 -1
  12. package/dist/{chunk-GWEBO4RF.js → chunk-K4AYNZF7.js} +1 -1
  13. package/dist/{chunk-72AR23R2.js → chunk-NP2GRK2N.js} +54 -2
  14. package/dist/{chunk-CCFCPAKN.js → chunk-NRDCQGAN.js} +1 -1
  15. package/dist/chunk-W4P2KJZN.js +75 -0
  16. package/dist/{chunk-HMQA2R3O.js → chunk-YIEOU7NG.js} +1 -1
  17. package/dist/{chunk-3YVZJHTF.js → chunk-YUQYVOY2.js} +1 -1
  18. package/dist/{chunk-2SYDIWRU.js → chunk-ZQ5HR7XN.js} +1 -1
  19. package/dist/{chunk-QU74ONFF.js → chunk-ZQFOY5FB.js} +1 -1
  20. package/dist/{ci-6K3JNHB4.js → ci-MYKIATCI.js} +7 -6
  21. package/dist/{ci-format-2L3RFJVH.js → ci-format-QOXT6E3A.js} +2 -2
  22. package/dist/{constants-J5SJ232X.js → constants-C55HE2E5.js} +1 -1
  23. package/dist/{constants-DLJECTGQ.js → constants-WK2I2UCZ.js} +1 -1
  24. package/dist/{doctor-cli-BHS7G2XY.js → doctor-cli-63GBR2D3.js} +7 -6
  25. package/dist/electron-server.js +195 -130
  26. package/dist/{hub-PPG4N6QQ.js → hub-J4FZ4GXX.js} +8 -18
  27. package/dist/{hub-server-JLC7CNP7.js → hub-server-HOQ6S3NK.js} +2 -1
  28. package/dist/index.js +20 -19
  29. package/dist/{persistent-memory-3XTSZ3QR.js → persistent-memory-6JN7AWD6.js} +2 -2
  30. package/dist/{persistent-memory-O4T2OTVV.js → persistent-memory-AEIRTKWX.js} +2 -2
  31. package/dist/{pr-M6ZY4CEK.js → pr-C53TJRXV.js} +7 -6
  32. package/dist/{run-tests-WQE3XTUL.js → run-tests-BKFV3HUZ.js} +2 -2
  33. package/dist/{run-tests-H3DIUCDB.js → run-tests-CZLZW5RL.js} +2 -2
  34. package/dist/{server-J2B26DZK.js → server-2GYX4CJC.js} +7 -6
  35. package/dist/{server-5NQSYQ2T.js → server-2UB74CEK.js} +29 -19
  36. package/dist/{task-orchestrator-CI7EDT25.js → task-orchestrator-EVONAO6V.js} +9 -7
  37. package/dist/{usage-AJYZ5A7P.js → usage-6Y7K2GNN.js} +2 -2
  38. package/dist/web/client/app.js +40 -16
  39. package/dist/web/client/app.js.br +0 -0
  40. package/dist/web/client/app.js.gz +0 -0
  41. package/dist/web/client/index.html +2 -1
  42. package/dist/web/client/index.html.br +0 -0
  43. package/dist/web/client/index.html.gz +0 -0
  44. package/dist/web/client/style.css +1 -0
  45. package/dist/web/client/style.css.br +0 -0
  46. package/dist/web/client/style.css.gz +0 -0
  47. package/package.json +1 -1
@@ -8,12 +8,14 @@ import {
8
8
  DiscussionOrchestrator,
9
9
  getPreset,
10
10
  listPresets,
11
+ parseRolesJson,
11
12
  resolveRoleProviders
12
- } from "./chunk-72AR23R2.js";
13
- import "./chunk-C2Z77RTU.js";
13
+ } from "./chunk-NP2GRK2N.js";
14
+ import "./chunk-DAAR4XOY.js";
14
15
  import {
15
16
  thinkingParamsFor
16
17
  } from "./chunk-6YZEZFX5.js";
18
+ import "./chunk-C6GA7H5D.js";
17
19
 
18
20
  // src/hub/index.ts
19
21
  import { readFileSync, existsSync } from "fs";
@@ -39,20 +41,8 @@ async function startHub(options, configManager, providers) {
39
41
  process.exit(1);
40
42
  }
41
43
  try {
42
- const raw = readFileSync(options.rolesFile, "utf-8");
43
- const parsed = JSON.parse(raw);
44
- const rawRoles = Array.isArray(parsed) ? parsed : parsed.roles;
45
- if (!Array.isArray(rawRoles) || rawRoles.length === 0) {
46
- throw new Error("roles must be a non-empty array");
47
- }
48
- roles = rawRoles.map((r) => ({
49
- id: r.id ?? r.name?.toLowerCase().replace(/\s+/g, "-") ?? "agent",
50
- name: r.name ?? r.id ?? "Agent",
51
- persona: r.persona ?? r.description ?? `You are ${r.name ?? "an AI assistant"}.`,
52
- ...r.provider && { provider: r.provider },
53
- ...r.model && { model: r.model },
54
- ...r.color && { color: r.color }
55
- }));
44
+ const raw = readFileSync(options.rolesFile, "utf-8").replace(/^/, "");
45
+ roles = parseRolesJson(JSON.parse(raw));
56
46
  } catch (err) {
57
47
  console.error(` \u2717 Invalid roles file: ${err.message}`);
58
48
  process.exit(1);
@@ -158,7 +148,7 @@ ${content}`);
158
148
  }
159
149
  }
160
150
  async function runTaskMode(config, providers, configManager, topic) {
161
- const { TaskOrchestrator } = await import("./task-orchestrator-CI7EDT25.js");
151
+ const { TaskOrchestrator } = await import("./task-orchestrator-EVONAO6V.js");
162
152
  const orchestrator = new TaskOrchestrator(config, providers, configManager);
163
153
  let interrupted = false;
164
154
  const onSigint = () => {
@@ -194,7 +184,7 @@ async function runTaskMode(config, providers, configManager, topic) {
194
184
  }
195
185
  }
196
186
  async function runDistributedDiscussion(config, providers, topic, port) {
197
- const { HubServer } = await import("./hub-server-JLC7CNP7.js");
187
+ const { HubServer } = await import("./hub-server-HOQ6S3NK.js");
198
188
  const hub = new HubServer(config, providers, port);
199
189
  let interrupted = false;
200
190
  const onSigint = () => {
@@ -16,7 +16,8 @@ import {
16
16
  } from "./chunk-TDQW2YHK.js";
17
17
  import {
18
18
  HubAgent
19
- } from "./chunk-C2Z77RTU.js";
19
+ } from "./chunk-DAAR4XOY.js";
20
+ import "./chunk-C6GA7H5D.js";
20
21
 
21
22
  // src/hub/hub-server.ts
22
23
  import { randomBytes, randomUUID } from "crypto";
package/dist/index.js CHANGED
@@ -24,7 +24,7 @@ import {
24
24
  setupProxy,
25
25
  snapshotFile,
26
26
  stripRoutingTags
27
- } from "./chunk-LLXHA2LA.js";
27
+ } from "./chunk-3JGBKYCN.js";
28
28
  import {
29
29
  CostTracker,
30
30
  getPricing,
@@ -47,7 +47,7 @@ import {
47
47
  setMaxOutputCap,
48
48
  spawnAgentContext,
49
49
  undoStack
50
- } from "./chunk-M5B6G6AY.js";
50
+ } from "./chunk-A4KKNBG3.js";
51
51
  import "./chunk-HLWUDRBO.js";
52
52
  import {
53
53
  NO_THINKING,
@@ -60,7 +60,7 @@ import {
60
60
  countPendingMemories,
61
61
  detectStaleLegacyMarkdownEdit,
62
62
  formatMemoryForPrompt
63
- } from "./chunk-DX2U6QK4.js";
63
+ } from "./chunk-4RVLGIK3.js";
64
64
  import "./chunk-RWRZVQCB.js";
65
65
  import "./chunk-B3MPYI4E.js";
66
66
  import "./chunk-M6HLYG33.js";
@@ -81,22 +81,23 @@ import {
81
81
  import {
82
82
  loadContextFiles,
83
83
  writeCrashLog
84
- } from "./chunk-265M6ZLH.js";
84
+ } from "./chunk-H4UIWMA5.js";
85
85
  import {
86
86
  getActivePluginAssets,
87
87
  getPendingHookTrust,
88
88
  installFlushOnExit,
89
89
  mergePluginHooks,
90
90
  runLifecycleHooks
91
- } from "./chunk-HMQA2R3O.js";
91
+ } from "./chunk-YIEOU7NG.js";
92
92
  import "./chunk-RS7SKYTS.js";
93
93
  import {
94
94
  ProviderRegistry,
95
95
  listBuiltInProviderMetadata
96
- } from "./chunk-GEC3MEVQ.js";
96
+ } from "./chunk-5MUAJ742.js";
97
97
  import {
98
98
  ConfigManager
99
- } from "./chunk-QU74ONFF.js";
99
+ } from "./chunk-ZQFOY5FB.js";
100
+ import "./chunk-W4P2KJZN.js";
100
101
  import {
101
102
  CONTENT_ONLY_STREAM_REMINDER,
102
103
  TEE_FINAL_USER_NUDGE,
@@ -114,7 +115,7 @@ import {
114
115
  runAgentLoop,
115
116
  stripToolCallReminder,
116
117
  teeStreamErrorSummary
117
- } from "./chunk-E2W2MI6H.js";
118
+ } from "./chunk-C6GA7H5D.js";
118
119
  import {
119
120
  AuthError,
120
121
  ProviderError,
@@ -134,7 +135,7 @@ import {
134
135
  isInterrupted,
135
136
  requestInterrupt,
136
137
  resetInterrupt
137
- } from "./chunk-GWEBO4RF.js";
138
+ } from "./chunk-K4AYNZF7.js";
138
139
  import {
139
140
  AGENTIC_BEHAVIOR_GUIDELINE,
140
141
  AUTHOR,
@@ -152,7 +153,7 @@ import {
152
153
  SKILLS_DIR_NAME,
153
154
  VERSION,
154
155
  buildUserIdentityPrompt
155
- } from "./chunk-AJITHMRE.js";
156
+ } from "./chunk-JTXHWIBO.js";
156
157
  import "./chunk-SXIJLSVF.js";
157
158
 
158
159
  // src/index.ts
@@ -4118,7 +4119,7 @@ program.command("web").description("Start Web UI server with browser-based chat
4118
4119
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
4119
4120
  process.exit(1);
4120
4121
  }
4121
- const { startWebServer, WebStartupError } = await import("./server-5NQSYQ2T.js");
4122
+ const { startWebServer, WebStartupError } = await import("./server-2UB74CEK.js");
4122
4123
  try {
4123
4124
  await startWebServer({ port, host: options.host, externalOrigin: options.externalOrigin });
4124
4125
  } catch (err) {
@@ -4295,11 +4296,11 @@ program.command("sessions").description("List recent conversation sessions").opt
4295
4296
  console.log(footer + "\n");
4296
4297
  });
4297
4298
  program.command("usage").description("Show token + cost usage grouped by provider/model (cross-session)").option("--days <n>", "Only the last N days (inclusive of today)").option("--month <ym>", "Only a specific month, format YYYY-MM (e.g. 2026-06)").option("--json", "Output as JSON (for scripting)").action(async (options) => {
4298
- const { runUsageCli } = await import("./usage-AJYZ5A7P.js");
4299
+ const { runUsageCli } = await import("./usage-6Y7K2GNN.js");
4299
4300
  await runUsageCli(options);
4300
4301
  });
4301
4302
  program.command("doctor").description("Health check: API keys, config, MCP, recent crashes, tool usage, disk usage").option("--json", "Output as JSON (for scripting)").option("--reset-stats", "Reset accumulated tool usage statistics").action(async (options) => {
4302
- const { runDoctorCli } = await import("./doctor-cli-BHS7G2XY.js");
4303
+ const { runDoctorCli } = await import("./doctor-cli-63GBR2D3.js");
4303
4304
  const argv = process.argv.slice(2);
4304
4305
  await runDoctorCli({
4305
4306
  json: !!options.json || argv.includes("--json"),
@@ -4308,7 +4309,7 @@ program.command("doctor").description("Health check: API keys, config, MCP, rece
4308
4309
  });
4309
4310
  program.command("batch <action> [arg] [arg2]").description("Anthropic Message Batches: submit | list | status <id> | results <id> [out] | cancel <id>").option("--dry-run", "Parse and validate input without submitting (submit only)").action(async (action, arg, arg2, options) => {
4310
4311
  try {
4311
- const batch = await import("./batch-GXITPLER.js");
4312
+ const batch = await import("./batch-TYKULVIK.js");
4312
4313
  switch (action) {
4313
4314
  case "submit":
4314
4315
  if (!arg) {
@@ -4351,7 +4352,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
4351
4352
  }
4352
4353
  });
4353
4354
  program.command("mcp-serve").description("Start an MCP server over STDIO, exposing aicli's built-in tools to Claude Desktop / Cursor / other MCP clients").option("--allow-destructive", "Allow bash / run_interactive / task_create (always destructive in MCP mode)").option("--allow-outside-cwd", "Allow tool path arguments to escape the sandbox root \u2014 disabled by default").option("--tools <list>", "Comma-separated whitelist of tools to expose (default: all eligible tools)").option("--cwd <path>", "Working directory AND sandbox root (default: current directory)").action(async (options) => {
4354
- const { startMcpServer } = await import("./server-J2B26DZK.js");
4355
+ const { startMcpServer } = await import("./server-2GYX4CJC.js");
4355
4356
  await startMcpServer({
4356
4357
  allowDestructive: !!options.allowDestructive,
4357
4358
  allowOutsideCwd: !!options.allowOutsideCwd,
@@ -4364,7 +4365,7 @@ program.command("pr <action> [target]").description("PR review helpers: review |
4364
4365
  console.error(`Unknown pr action: ${action}. Use review | security-review | summarize.`);
4365
4366
  process.exit(1);
4366
4367
  }
4367
- const { runPrCli } = await import("./pr-M6ZY4CEK.js");
4368
+ const { runPrCli } = await import("./pr-C53TJRXV.js");
4368
4369
  const result = await runPrCli({
4369
4370
  action,
4370
4371
  target,
@@ -4384,8 +4385,8 @@ program.command("pr <action> [target]").description("PR review helpers: review |
4384
4385
  process.exit(result.exitCode);
4385
4386
  });
4386
4387
  program.command("ci").description("Headless PR review (code + security) \u2014 reads git/gh diff, optionally posts to PR. Designed for GitHub Actions.").option("--pr <num>", "PR number or URL; diff fetched via gh pr diff <value>", (v) => /^#?\d+$/.test(v) ? parseInt(v.replace(/^#/, ""), 10) : v).option("--base <ref>", "Base ref for git diff <ref>...HEAD (ignored when --pr set)").option("--post", "Post review as a PR comment (requires gh CLI + GH_TOKEN, needs --pr)").option("--no-update", "Always create a new comment instead of updating the previous aicli review").option("--skip-code", "Skip the code review section").option("--skip-security", "Skip the security review section").option("--detailed", "Use the detailed code-review prompt").option("--max-diff <n>", "Max diff chars sent to the model (default 30000)", (v) => parseInt(v, 10)).option("--provider <id>", "Override provider (default: config.defaultProvider)").option("--model <id>", "Override model").option("--dry-run", "Print result to stdout instead of posting (overrides --post)").option("--json", "Output a structured JSON report").option("--markdown", "Output Markdown report (default)").option("--sarif", "Output SARIF 2.1.0 for code scanning artifacts").option("--fail-on-security-high", "Fail when the security review contains HIGH/CRITICAL findings (default)").option("--no-fail-on-security-high", "Do not fail on security HIGH/CRITICAL findings").option("--fail-on-test-failure", "Fail when the report mentions test failures (default)").option("--no-fail-on-test-failure", "Do not fail on test failure findings").option("--fail-on-lint-failure", "Fail when the report mentions lint/typecheck failures (default)").option("--no-fail-on-lint-failure", "Do not fail on lint/typecheck failure findings").action(async (options) => {
4387
- const { runCi } = await import("./ci-6K3JNHB4.js");
4388
- const { formatCiResult } = await import("./ci-format-2L3RFJVH.js");
4388
+ const { runCi } = await import("./ci-MYKIATCI.js");
4389
+ const { formatCiResult } = await import("./ci-format-QOXT6E3A.js");
4389
4390
  const formats = [options.json, options.markdown, options.sarif].filter(Boolean).length;
4390
4391
  if (formats > 1) {
4391
4392
  console.error("Choose only one output format: --json, --markdown, or --sarif.");
@@ -4544,7 +4545,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
4544
4545
  config.get("customProviders"),
4545
4546
  config.getConfigDir()
4546
4547
  );
4547
- const { startHub } = await import("./hub-PPG4N6QQ.js");
4548
+ const { startHub } = await import("./hub-J4FZ4GXX.js");
4548
4549
  await startHub(
4549
4550
  {
4550
4551
  topic: topic ?? "",
@@ -27,11 +27,11 @@ import {
27
27
  touchMemoryReferences,
28
28
  updateMemoryApproval,
29
29
  updateMemoryEntry
30
- } from "./chunk-2SYDIWRU.js";
30
+ } from "./chunk-ZQ5HR7XN.js";
31
31
  import "./chunk-FSC6KEWU.js";
32
32
  import "./chunk-2XMUCC42.js";
33
33
  import "./chunk-CGLYJRFA.js";
34
- import "./chunk-3YVZJHTF.js";
34
+ import "./chunk-YUQYVOY2.js";
35
35
  export {
36
36
  addMemoryEntry,
37
37
  backupMemoryStore,
@@ -28,11 +28,11 @@ import {
28
28
  touchMemoryReferences,
29
29
  updateMemoryApproval,
30
30
  updateMemoryEntry
31
- } from "./chunk-DX2U6QK4.js";
31
+ } from "./chunk-4RVLGIK3.js";
32
32
  import "./chunk-3FEZSLGI.js";
33
33
  import "./chunk-HOSJZMQS.js";
34
34
  import "./chunk-BMLQPSHP.js";
35
- import "./chunk-AJITHMRE.js";
35
+ import "./chunk-JTXHWIBO.js";
36
36
  export {
37
37
  addMemoryEntry,
38
38
  backupMemoryStore,
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  countSeverity,
4
4
  runCi
5
- } from "./chunk-LUJ4JVMI.js";
6
- import "./chunk-CCFCPAKN.js";
5
+ } from "./chunk-6WQCZTAJ.js";
6
+ import "./chunk-NRDCQGAN.js";
7
7
  import {
8
8
  buildReviewPrompt,
9
9
  buildSecurityReviewPrompt,
@@ -14,16 +14,17 @@ import {
14
14
  } from "./chunk-6YZEZFX5.js";
15
15
  import {
16
16
  ProviderRegistry
17
- } from "./chunk-GEC3MEVQ.js";
17
+ } from "./chunk-5MUAJ742.js";
18
18
  import {
19
19
  ConfigManager
20
- } from "./chunk-QU74ONFF.js";
21
- import "./chunk-E2W2MI6H.js";
20
+ } from "./chunk-ZQFOY5FB.js";
21
+ import "./chunk-W4P2KJZN.js";
22
+ import "./chunk-C6GA7H5D.js";
22
23
  import "./chunk-TU3L3PW7.js";
23
24
  import "./chunk-BMLQPSHP.js";
24
25
  import {
25
26
  VERSION
26
- } from "./chunk-AJITHMRE.js";
27
+ } from "./chunk-JTXHWIBO.js";
27
28
 
28
29
  // src/cli/pr.ts
29
30
  import { execFileSync } from "child_process";
@@ -2,9 +2,9 @@ import {
2
2
  executeTests,
3
3
  runTestProcess,
4
4
  runTestsTool
5
- } from "./chunk-DU44SD6A.js";
5
+ } from "./chunk-4TKEA7RE.js";
6
6
  import "./chunk-QMFMST2T.js";
7
- import "./chunk-3YVZJHTF.js";
7
+ import "./chunk-YUQYVOY2.js";
8
8
  export {
9
9
  executeTests,
10
10
  runTestProcess,
@@ -3,8 +3,8 @@ import {
3
3
  executeTests,
4
4
  runTestProcess,
5
5
  runTestsTool
6
- } from "./chunk-GWEBO4RF.js";
7
- import "./chunk-AJITHMRE.js";
6
+ } from "./chunk-K4AYNZF7.js";
7
+ import "./chunk-JTXHWIBO.js";
8
8
  import "./chunk-SXIJLSVF.js";
9
9
  export {
10
10
  executeTests,
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ToolRegistry
4
- } from "./chunk-M5B6G6AY.js";
4
+ } from "./chunk-A4KKNBG3.js";
5
5
  import "./chunk-6JHACXB3.js";
6
- import "./chunk-DX2U6QK4.js";
6
+ import "./chunk-4RVLGIK3.js";
7
7
  import "./chunk-RWRZVQCB.js";
8
8
  import "./chunk-B3MPYI4E.js";
9
9
  import "./chunk-M6HLYG33.js";
@@ -14,20 +14,21 @@ import "./chunk-JL44HGZC.js";
14
14
  import "./chunk-3FEZSLGI.js";
15
15
  import {
16
16
  runTool
17
- } from "./chunk-HMQA2R3O.js";
17
+ } from "./chunk-YIEOU7NG.js";
18
18
  import "./chunk-RS7SKYTS.js";
19
19
  import {
20
20
  getDangerLevel,
21
21
  schemaToJsonSchema
22
- } from "./chunk-E2W2MI6H.js";
22
+ } from "./chunk-W4P2KJZN.js";
23
+ import "./chunk-C6GA7H5D.js";
23
24
  import "./chunk-TU3L3PW7.js";
24
25
  import "./chunk-HOSJZMQS.js";
25
26
  import "./chunk-BMLQPSHP.js";
26
27
  import "./chunk-JJFJWD35.js";
27
- import "./chunk-GWEBO4RF.js";
28
+ import "./chunk-K4AYNZF7.js";
28
29
  import {
29
30
  VERSION
30
- } from "./chunk-AJITHMRE.js";
31
+ } from "./chunk-JTXHWIBO.js";
31
32
  import "./chunk-SXIJLSVF.js";
32
33
 
33
34
  // src/mcp/server.ts
@@ -5,11 +5,13 @@ import {
5
5
  equalToken
6
6
  } from "./chunk-TDQW2YHK.js";
7
7
  import {
8
+ CUSTOM_PRESET_PREFIX,
8
9
  DiscussionOrchestrator,
9
10
  getPreset,
11
+ loadCustomPresets,
10
12
  resolveRoleProviders
11
- } from "./chunk-72AR23R2.js";
12
- import "./chunk-C2Z77RTU.js";
13
+ } from "./chunk-NP2GRK2N.js";
14
+ import "./chunk-DAAR4XOY.js";
13
15
  import {
14
16
  AuthManager,
15
17
  TOKEN_EXPIRY_MS
@@ -86,7 +88,7 @@ import {
86
88
  skillHistoryNote,
87
89
  snapshotFile,
88
90
  stripRoutingTags
89
- } from "./chunk-LLXHA2LA.js";
91
+ } from "./chunk-3JGBKYCN.js";
90
92
  import {
91
93
  CNY_PER_USD,
92
94
  CostTracker,
@@ -130,7 +132,7 @@ import {
130
132
  spawnAgentContext,
131
133
  truncateOutput,
132
134
  undoStack
133
- } from "./chunk-M5B6G6AY.js";
135
+ } from "./chunk-A4KKNBG3.js";
134
136
  import {
135
137
  buildReviewPrompt,
136
138
  buildSecurityReviewPrompt
@@ -157,7 +159,7 @@ import {
157
159
  restoreMemoryEntries,
158
160
  updateMemoryApproval,
159
161
  updateMemoryEntry
160
- } from "./chunk-DX2U6QK4.js";
162
+ } from "./chunk-4RVLGIK3.js";
161
163
  import "./chunk-RWRZVQCB.js";
162
164
  import "./chunk-B3MPYI4E.js";
163
165
  import "./chunk-M6HLYG33.js";
@@ -176,7 +178,7 @@ import {
176
178
  buildDoctorReport,
177
179
  formatDoctorReport,
178
180
  loadContextFiles
179
- } from "./chunk-265M6ZLH.js";
181
+ } from "./chunk-H4UIWMA5.js";
180
182
  import {
181
183
  describePlugin,
182
184
  getActivePluginAssets,
@@ -191,14 +193,17 @@ import {
191
193
  runTool,
192
194
  setPluginEnabled,
193
195
  trustPlugin
194
- } from "./chunk-HMQA2R3O.js";
196
+ } from "./chunk-YIEOU7NG.js";
195
197
  import "./chunk-RS7SKYTS.js";
196
198
  import {
197
199
  ProviderRegistry
198
- } from "./chunk-GEC3MEVQ.js";
200
+ } from "./chunk-5MUAJ742.js";
199
201
  import {
200
202
  ConfigManager
201
- } from "./chunk-QU74ONFF.js";
203
+ } from "./chunk-ZQFOY5FB.js";
204
+ import {
205
+ getDangerLevel
206
+ } from "./chunk-W4P2KJZN.js";
202
207
  import {
203
208
  CONTENT_ONLY_STREAM_REMINDER,
204
209
  TEE_FINAL_USER_NUDGE,
@@ -209,12 +214,11 @@ import {
209
214
  consumeToolCallStream,
210
215
  evaluateTeeContent,
211
216
  freshPriorContent,
212
- getDangerLevel,
213
217
  isAbortError,
214
218
  runAgentLoop,
215
219
  stripToolCallReminder,
216
220
  teeStreamErrorSummary
217
- } from "./chunk-E2W2MI6H.js";
221
+ } from "./chunk-C6GA7H5D.js";
218
222
  import "./chunk-TU3L3PW7.js";
219
223
  import {
220
224
  formatGitContextForPrompt,
@@ -231,7 +235,7 @@ import {
231
235
  import {
232
236
  assertReadablePath
233
237
  } from "./chunk-JJFJWD35.js";
234
- import "./chunk-GWEBO4RF.js";
238
+ import "./chunk-K4AYNZF7.js";
235
239
  import {
236
240
  AGENTIC_BEHAVIOR_GUIDELINE,
237
241
  AUTHOR,
@@ -247,7 +251,7 @@ import {
247
251
  SKILLS_DIR_NAME,
248
252
  VERSION,
249
253
  buildUserIdentityPrompt
250
- } from "./chunk-AJITHMRE.js";
254
+ } from "./chunk-JTXHWIBO.js";
251
255
  import {
252
256
  runWithExecutionContext,
253
257
  runWithSessionKey
@@ -979,7 +983,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
979
983
  Cost: ${formatCost(cost)}` : "";
980
984
  let memoryLine = "";
981
985
  try {
982
- const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-O4T2OTVV.js");
986
+ const { countPendingMemories: countPendingMemories2 } = await import("./persistent-memory-AEIRTKWX.js");
983
987
  const pending = countPendingMemories2(ctx.config.getConfigDir());
984
988
  if (pending > 0) memoryLine = `
985
989
  Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
@@ -1908,7 +1912,7 @@ async function handleTest(args, ctx) {
1908
1912
  const isCommand = argStr.includes(" ") || /^(mvn|gradle|npm|pytest|cargo|go)\b/.test(argStr);
1909
1913
  testArgs = isCommand ? { command: argStr } : { filter: argStr };
1910
1914
  }
1911
- const runTests = ctx.runTests ?? (await import("./run-tests-H3DIUCDB.js")).executeTests;
1915
+ const runTests = ctx.runTests ?? (await import("./run-tests-CZLZW5RL.js")).executeTests;
1912
1916
  const report = await runTests(testArgs);
1913
1917
  ctx.send({ type: "info", message: report });
1914
1918
  } catch (err) {
@@ -2184,7 +2188,7 @@ async function handleMemory(args, ctx) {
2184
2188
  }
2185
2189
  if (intent.kind === "status") {
2186
2190
  const { getChatIndexStatus } = await import("./chat-index-7CLR4CBG.js");
2187
- const { listMemoryEntries: listMemoryEntries2, isMemoryExpired: isMemoryExpired2, formatMemoryForPrompt: formatMemoryForPrompt2 } = await import("./persistent-memory-O4T2OTVV.js");
2191
+ const { listMemoryEntries: listMemoryEntries2, isMemoryExpired: isMemoryExpired2, formatMemoryForPrompt: formatMemoryForPrompt2 } = await import("./persistent-memory-AEIRTKWX.js");
2188
2192
  const memories = listMemoryEntries2(configDir, { includeExpired: true, includeRejected: true });
2189
2193
  const injected = formatMemoryForPrompt2(configDir, process.cwd(), ctx.config.get("memory")?.maxChars);
2190
2194
  const view = buildMemoryStatusView({
@@ -2207,7 +2211,7 @@ async function handleMemory(args, ctx) {
2207
2211
  return;
2208
2212
  }
2209
2213
  if (intent.kind === "recall") {
2210
- const { searchPersistentMemories, touchMemoryReferences } = await import("./persistent-memory-O4T2OTVV.js");
2214
+ const { searchPersistentMemories, touchMemoryReferences } = await import("./persistent-memory-AEIRTKWX.js");
2211
2215
  const { searchChatMemory } = await import("./chat-index-7CLR4CBG.js");
2212
2216
  const persistentHits = searchPersistentMemories(configDir, intent.query, process.cwd(), 3);
2213
2217
  if (persistentHits.length > 0) {
@@ -2328,7 +2332,7 @@ async function handleMemory(args, ctx) {
2328
2332
  ctx.handleMemoryManage(intent.action, args[1], intent.action === "expire" ? args[2] : void 0);
2329
2333
  } else if (intent.kind === "export") {
2330
2334
  if (args[1] === "md") {
2331
- const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-O4T2OTVV.js");
2335
+ const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-AEIRTKWX.js");
2332
2336
  ctx.send({
2333
2337
  type: "export_data",
2334
2338
  format: "md",
@@ -2936,6 +2940,11 @@ var SessionHandler = class _SessionHandler {
2936
2940
  costCnyPerUsd: CNY_PER_USD,
2937
2941
  costPricingUnknown,
2938
2942
  providers: providerList,
2943
+ hubPresets: loadCustomPresets(this.config.getConfigDir()).presets.map((p) => ({
2944
+ id: p.id,
2945
+ name: p.name,
2946
+ description: p.description
2947
+ })),
2939
2948
  branches,
2940
2949
  activeBranchId: sess?.activeBranchId ?? "main",
2941
2950
  agents: listAgentRuns().slice(0, 20).map((run) => ({
@@ -3189,7 +3198,8 @@ var SessionHandler = class _SessionHandler {
3189
3198
  this.send({ type: "error", message: "Hub topic is required." });
3190
3199
  return;
3191
3200
  }
3192
- const preset = getPreset(msg.preset ?? "brainstorm");
3201
+ const presetId = msg.preset ?? "brainstorm";
3202
+ const preset = presetId.startsWith(CUSTOM_PRESET_PREFIX) ? loadCustomPresets(this.config.getConfigDir()).presets.find((p) => p.id === presetId) : getPreset(presetId);
3193
3203
  if (!preset) {
3194
3204
  this.send({ type: "error", message: `Unknown preset "${msg.preset}".` });
3195
3205
  return;
@@ -4,9 +4,9 @@ import {
4
4
  googleSearchContext,
5
5
  isToolCapableProvider,
6
6
  truncateOutput
7
- } from "./chunk-M5B6G6AY.js";
7
+ } from "./chunk-A4KKNBG3.js";
8
8
  import "./chunk-6JHACXB3.js";
9
- import "./chunk-DX2U6QK4.js";
9
+ import "./chunk-4RVLGIK3.js";
10
10
  import "./chunk-RWRZVQCB.js";
11
11
  import "./chunk-B3MPYI4E.js";
12
12
  import "./chunk-M6HLYG33.js";
@@ -17,22 +17,24 @@ import "./chunk-JL44HGZC.js";
17
17
  import "./chunk-3FEZSLGI.js";
18
18
  import {
19
19
  runTool
20
- } from "./chunk-HMQA2R3O.js";
20
+ } from "./chunk-YIEOU7NG.js";
21
21
  import "./chunk-RS7SKYTS.js";
22
22
  import {
23
- getDangerLevel,
23
+ getDangerLevel
24
+ } from "./chunk-W4P2KJZN.js";
25
+ import {
24
26
  runLeanAgentLoop
25
- } from "./chunk-E2W2MI6H.js";
27
+ } from "./chunk-C6GA7H5D.js";
26
28
  import "./chunk-TU3L3PW7.js";
27
29
  import "./chunk-HOSJZMQS.js";
28
30
  import {
29
31
  atomicWriteFileSync
30
32
  } from "./chunk-BMLQPSHP.js";
31
33
  import "./chunk-JJFJWD35.js";
32
- import "./chunk-GWEBO4RF.js";
34
+ import "./chunk-K4AYNZF7.js";
33
35
  import {
34
36
  SUBAGENT_ALLOWED_TOOLS
35
- } from "./chunk-AJITHMRE.js";
37
+ } from "./chunk-JTXHWIBO.js";
36
38
  import "./chunk-SXIJLSVF.js";
37
39
 
38
40
  // src/hub/task-orchestrator.ts
@@ -9,10 +9,10 @@ import {
9
9
  import "./chunk-RS7SKYTS.js";
10
10
  import {
11
11
  ConfigManager
12
- } from "./chunk-QU74ONFF.js";
12
+ } from "./chunk-ZQFOY5FB.js";
13
13
  import "./chunk-TU3L3PW7.js";
14
14
  import "./chunk-BMLQPSHP.js";
15
- import "./chunk-AJITHMRE.js";
15
+ import "./chunk-JTXHWIBO.js";
16
16
 
17
17
  // src/cli/usage.ts
18
18
  function classifyRowCost(row) {
@@ -506,6 +506,7 @@ function handleStatus(msg) {
506
506
  providers = msg.providers || [];
507
507
  updateProviderSelect(msg.provider);
508
508
  updateModelSelect(msg.provider, msg.model);
509
+ updateHubPresets(msg.hubPresets);
509
510
 
510
511
  // ── Route by sessionId ────────────────────────────────────────────
511
512
  // Find the Tab this status payload belongs to. If the active Tab matches,
@@ -3202,6 +3203,42 @@ function hubAgentContainer(roleId) {
3202
3203
 
3203
3204
  function hubColor(c) { return HUB_COLORS[c] || '#9ca3af'; }
3204
3205
 
3206
+ /** Open a new turn block for roleId (its lane in lane mode, else the flow) and make it the stream slot. */
3207
+ function hubOpenTurn(roleId) {
3208
+ const role = hubRoles[roleId] || { name: roleId, color: 'white' };
3209
+ hubStreamEl = document.createElement('div');
3210
+ if (hubLaneMode) {
3211
+ // Column header already shows the role name — just the body here.
3212
+ hubStreamEl.className = 'hub-msg';
3213
+ hubStreamEl.innerHTML = `<div class="hub-body text-sm"></div>`;
3214
+ } else {
3215
+ hubStreamEl.className = 'hub-msg border-l-2 pl-2 my-2';
3216
+ hubStreamEl.style.borderColor = hubColor(role.color);
3217
+ hubStreamEl.innerHTML = `<div class="text-xs font-bold mb-1" style="color:${hubColor(role.color)}">${escapeHtml(role.name)}</div><div class="hub-body text-sm"></div>`;
3218
+ }
3219
+ hubAgentContainer(roleId).appendChild(hubStreamEl);
3220
+ hubStreamRoleId = roleId;
3221
+ hubStreamEl._raw = '';
3222
+ }
3223
+
3224
+ /** Sync the `custom:` entries of the preset dropdown with `<configDir>/hub-roles/*.json`. */
3225
+ function updateHubPresets(list) {
3226
+ const select = document.getElementById('hub-preset');
3227
+ if (!select) return;
3228
+ const presets = Array.isArray(list) ? list : [];
3229
+ const selected = select.value;
3230
+ for (const opt of [...select.options]) {
3231
+ if (opt.value.startsWith('custom:')) opt.remove();
3232
+ }
3233
+ for (const p of presets) {
3234
+ const opt = document.createElement('option');
3235
+ opt.value = p.id;
3236
+ opt.textContent = `★ ${p.name} — ${p.description}`;
3237
+ select.appendChild(opt);
3238
+ }
3239
+ if ([...select.options].some(o => o.value === selected)) select.value = selected;
3240
+ }
3241
+
3205
3242
  window.startHub = function () {
3206
3243
  const topic = (document.getElementById('hub-topic').value || '').trim();
3207
3244
  if (!topic) { document.getElementById('hub-status').textContent = 'Enter a topic first.'; return; }
@@ -3283,28 +3320,15 @@ function hubEvent(ev) {
3283
3320
  break;
3284
3321
  }
3285
3322
  case 'agent_token': {
3286
- if (hubStreamRoleId !== ev.roleId || !hubStreamEl) {
3287
- const role = hubRoles[ev.roleId] || { name: ev.roleId, color: 'white' };
3288
- hubStreamEl = document.createElement('div');
3289
- if (hubLaneMode) {
3290
- // Column header already shows the role name — just the body here.
3291
- hubStreamEl.className = 'hub-msg';
3292
- hubStreamEl.innerHTML = `<div class="hub-body text-sm"></div>`;
3293
- } else {
3294
- hubStreamEl.className = 'hub-msg border-l-2 pl-2 my-2';
3295
- hubStreamEl.style.borderColor = hubColor(role.color);
3296
- hubStreamEl.innerHTML = `<div class="text-xs font-bold mb-1" style="color:${hubColor(role.color)}">${escapeHtml(role.name)}</div><div class="hub-body text-sm"></div>`;
3297
- }
3298
- hubAgentContainer(ev.roleId).appendChild(hubStreamEl);
3299
- hubStreamRoleId = ev.roleId;
3300
- hubStreamEl._raw = '';
3301
- }
3323
+ if (hubStreamRoleId !== ev.roleId || !hubStreamEl) hubOpenTurn(ev.roleId);
3302
3324
  hubStreamEl._raw += ev.token;
3303
3325
  appendStreamText(hubStreamEl.querySelector('.hub-body'), ev.token);
3304
3326
  scrollToBottom();
3305
3327
  break;
3306
3328
  }
3307
3329
  case 'agent_spoke':
3330
+ // 一个 token 都没流出来(推理被截断后只剩提示、或 provider 不支持流式)时也要画出这条发言
3331
+ if (!hubStreamEl && ev.message?.content) hubOpenTurn(ev.roleId);
3308
3332
  if (hubStreamEl) renderMarkdown(hubStreamEl.querySelector('.hub-body'), ev.message?.content ?? hubStreamEl._raw);
3309
3333
  // Streaming already rendered the body; finalize the stream slot.
3310
3334
  hubStreamEl = null; hubStreamRoleId = null;
Binary file
Binary file