jinzd-ai-cli 0.4.217 → 0.4.218

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 +4 -2
  2. package/dist/{batch-YCOVKTXD.js → batch-7V7OTMUP.js} +2 -2
  3. package/dist/{chunk-WZ3VKLF3.js → chunk-5CA2TJ5F.js} +1 -1
  4. package/dist/{chunk-QAYOI57M.js → chunk-C2Z42DI5.js} +1 -1
  5. package/dist/{chunk-MGBMNCHG.js → chunk-GX3HSGJX.js} +452 -156
  6. package/dist/{chunk-OUAZOE5U.js → chunk-H2UIHGHH.js} +23 -22
  7. package/dist/{chunk-KOPUCJXM.js → chunk-L4UREAID.js} +3 -3
  8. package/dist/{chunk-SNJAOXFT.js → chunk-MWKE2TNS.js} +1 -1
  9. package/dist/{chunk-XJGEQIYS.js → chunk-NTCB7CMT.js} +1 -1
  10. package/dist/{chunk-524WZOKS.js → chunk-OUC75QCF.js} +1 -1
  11. package/dist/{chunk-WKOQ5CYC.js → chunk-P4VBLXKS.js} +1 -1
  12. package/dist/{chunk-VTH7BLXK.js → chunk-VGFTM3XT.js} +1 -1
  13. package/dist/{ci-52RZIYWB.js → ci-L6GH2WVC.js} +4 -4
  14. package/dist/{ci-format-73UXKE65.js → ci-format-WW7454AY.js} +2 -2
  15. package/dist/{constants-DIXAD35W.js → constants-NCTFSHDU.js} +1 -1
  16. package/dist/{doctor-cli-7GOQPULZ.js → doctor-cli-EWMFBP5Q.js} +4 -4
  17. package/dist/electron-server.js +575 -231
  18. package/dist/{hub-GIGBITZN.js → hub-CDL6T7CP.js} +1 -1
  19. package/dist/index.js +148 -46
  20. package/dist/{pr-KPQ5RPKB.js → pr-D6PEKEGK.js} +4 -4
  21. package/dist/{run-tests-K7QR5QN4.js → run-tests-NXVVKAK2.js} +1 -1
  22. package/dist/{run-tests-ZDSA3QES.js → run-tests-SWU2XEV7.js} +2 -2
  23. package/dist/{server-QT3SC2KI.js → server-LHYSS6CK.js} +85 -21
  24. package/dist/{server-22YF3U34.js → server-WUT7VYTD.js} +4 -4
  25. package/dist/{task-orchestrator-BHQQCVTY.js → task-orchestrator-C5AA2BI5.js} +4 -4
  26. package/dist/{usage-WZZFSFLM.js → usage-6ZUUJBI2.js} +2 -2
  27. package/package.json +1 -1
@@ -24,7 +24,7 @@ import {
24
24
  scanDirTree,
25
25
  scanProject,
26
26
  setupProxy
27
- } from "./chunk-OUAZOE5U.js";
27
+ } from "./chunk-H2UIHGHH.js";
28
28
  import {
29
29
  buildReviewPrompt,
30
30
  buildSecurityReviewPrompt
@@ -40,21 +40,28 @@ import {
40
40
  clearRecentlyDeniedAutoActions,
41
41
  defaultActionClassifier,
42
42
  deleteMemoryEntry,
43
+ describePlugin,
43
44
  estimateTokens,
44
45
  expireMemoryEntry,
45
46
  exportMemoryEntries,
46
47
  formatMemoryForPrompt,
47
48
  formatPermissionProfileWarning,
49
+ getActivePluginAssets,
50
+ getInstalledPlugin,
48
51
  getPendingHookTrust,
49
52
  getPreferredAgentName,
50
53
  getRecentlyDeniedAutoActions,
51
54
  googleSearchContext,
52
55
  groupCallsByPhase,
56
+ installPlugin,
53
57
  isMemoryExpired,
54
58
  listAgentConfigs,
55
59
  listAgentRuns,
60
+ listInstalledPlugins,
56
61
  listMemoryEntries,
57
62
  memoryStorePath,
63
+ mergePluginHooks,
64
+ pluginRoot,
58
65
  recordRecentlyDeniedAutoAction,
59
66
  renderDiff,
60
67
  requestAgentStop,
@@ -65,15 +72,17 @@ import {
65
72
  runWithSessionKey,
66
73
  setContextWindow,
67
74
  setMaxOutputCap,
75
+ setPluginEnabled,
68
76
  setPreferredAgentName,
69
77
  spawnAgentContext,
70
78
  truncateOutput,
79
+ trustPlugin,
71
80
  undoStack,
72
81
  updateMemoryApproval
73
- } from "./chunk-MGBMNCHG.js";
82
+ } from "./chunk-GX3HSGJX.js";
74
83
  import "./chunk-T2NL5ZIA.js";
75
84
  import "./chunk-BXP6YZ2P.js";
76
- import "./chunk-VTH7BLXK.js";
85
+ import "./chunk-VGFTM3XT.js";
77
86
  import {
78
87
  SessionManager,
79
88
  getContentText
@@ -87,7 +96,7 @@ import {
87
96
  } from "./chunk-QMXC327F.js";
88
97
  import {
89
98
  runTool
90
- } from "./chunk-SNJAOXFT.js";
99
+ } from "./chunk-MWKE2TNS.js";
91
100
  import {
92
101
  CONTENT_ONLY_STREAM_REMINDER,
93
102
  TEE_FINAL_USER_NUDGE,
@@ -106,7 +115,7 @@ import {
106
115
  } from "./chunk-XPBEJB27.js";
107
116
  import {
108
117
  ConfigManager
109
- } from "./chunk-WKOQ5CYC.js";
118
+ } from "./chunk-P4VBLXKS.js";
110
119
  import "./chunk-TZQHYZKT.js";
111
120
  import {
112
121
  AGENTIC_BEHAVIOR_GUIDELINE,
@@ -124,7 +133,7 @@ import {
124
133
  SKILLS_DIR_NAME,
125
134
  VERSION,
126
135
  buildUserIdentityPrompt
127
- } from "./chunk-XJGEQIYS.js";
136
+ } from "./chunk-NTCB7CMT.js";
128
137
  import {
129
138
  formatGitContextForPrompt,
130
139
  getGitContext,
@@ -748,7 +757,7 @@ var SessionHandler = class {
748
757
  }
749
758
  this.updateContextWindow();
750
759
  this.activeSystemPrompt = this.loadContextFiles();
751
- const hooks = this.config.get("hooks");
760
+ const hooks = mergePluginHooks(this.config.get("hooks") ?? void 0, this.config.getConfigDir());
752
761
  const permissionRules = this.config.get("permissionRules");
753
762
  const defaultPermission = this.config.get("defaultPermission");
754
763
  const permissionProfileName = this.config.get("defaultPermissionProfile") ?? "legacy";
@@ -895,7 +904,7 @@ var SessionHandler = class {
895
904
  }
896
905
  }
897
906
  onDisconnect() {
898
- runLifecycleHooks(this.config.get("hooks") ?? void 0, "Stop", { sessionId: this.sessions.current?.id }, { configDir: this.config.getConfigDir() });
907
+ runLifecycleHooks(mergePluginHooks(this.config.get("hooks") ?? void 0, this.config.getConfigDir()), "Stop", { sessionId: this.sessions.current?.id }, { configDir: this.config.getConfigDir() });
899
908
  this.toolExecutor.cancelAll();
900
909
  if (this.abortController) this.abortController.abort();
901
910
  for (const resolve3 of this.pendingAskUser.values()) resolve3(null);
@@ -1074,7 +1083,7 @@ var SessionHandler = class {
1074
1083
  this.ensureSession();
1075
1084
  const session = this.sessions.current;
1076
1085
  const promptDecisions = runLifecycleHooks(
1077
- this.config.get("hooks") ?? void 0,
1086
+ mergePluginHooks(this.config.get("hooks") ?? void 0, this.config.getConfigDir()),
1078
1087
  "UserPromptSubmit",
1079
1088
  { sessionId: session.id, prompt: content },
1080
1089
  { configDir: this.config.getConfigDir(), onSummary: (message) => this.send({ type: "info", message: "[hook] " + message }) }
@@ -1916,6 +1925,7 @@ Tokens: in=${this.sessionTokenUsage.inputTokens} out=${this.sessionTokenUsage.ou
1916
1925
  " /add-dir [path|remove] \u2014 Add/remove directory from AI context",
1917
1926
  " /mcp [reconnect] \u2014 Show/manage MCP servers",
1918
1927
  " /plugins \u2014 Show loaded plugins",
1928
+ " /plugin <cmd> \u2014 Manage package plugins",
1919
1929
  " /commands \u2014 List custom commands",
1920
1930
  " /doctor \u2014 Health check (API keys, config, MCP)",
1921
1931
  " /bug \u2014 Generate bug report template",
@@ -2014,7 +2024,7 @@ ${lines.join("\n")}` });
2014
2024
  this.sendToolsList();
2015
2025
  this.sendStatus();
2016
2026
  } else if (sub === "reload") {
2017
- this.skillManager.loadSkills();
2027
+ this.skillManager.loadSkills(getActivePluginAssets(this.config.getConfigDir()).skillDirs);
2018
2028
  this.send({ type: "info", message: `\u{1F504} Reloaded ${this.skillManager.listSkills().length} skill(s).` });
2019
2029
  this.sendToolsList();
2020
2030
  } else {
@@ -2751,7 +2761,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
2751
2761
  case "test": {
2752
2762
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
2753
2763
  try {
2754
- const { executeTests } = await import("./run-tests-ZDSA3QES.js");
2764
+ const { executeTests } = await import("./run-tests-SWU2XEV7.js");
2755
2765
  const argStr = args.join(" ").trim();
2756
2766
  let testArgs = {};
2757
2767
  if (argStr) {
@@ -2918,7 +2928,7 @@ ${this.config.toFormattedJSON()}
2918
2928
  const result = this.contextLoadResult;
2919
2929
  const layers = ["\u{1F4DA} **Context Layers:**", ""];
2920
2930
  if (result && result.layers.length > 0) {
2921
- const labels = { global: "Global ", project: "Project", local: "Local " };
2931
+ const labels = { global: "Global ", project: "Project", plugin: "Plugin ", local: "Local " };
2922
2932
  for (const layer of result.layers) {
2923
2933
  layers.push(` \u2713 ${labels[layer.level] ?? layer.level}: ${layer.displayPath} (${layer.charCount} chars${layer.truncated ? ", truncated" : ""})`);
2924
2934
  }
@@ -3043,23 +3053,75 @@ Add .md files to create commands.` });
3043
3053
  }
3044
3054
  break;
3045
3055
  }
3046
- // ── /plugins ────────────────────────────────────────────────────
3056
+ // ── /plugins / /plugin ──────────────────────────────────────────
3047
3057
  case "plugins": {
3048
3058
  const configDir = this.config.getConfigDir();
3049
3059
  const pluginsDir = join(configDir, PLUGINS_DIR_NAME);
3050
3060
  const pluginTools = this.toolRegistry.listPluginTools();
3061
+ const pluginPackages = listInstalledPlugins(configDir);
3051
3062
  const lines = [`\u{1F50C} **Plugins:**`, `Dir: ${pluginsDir}`, ""];
3052
- if (pluginTools.length === 0) {
3063
+ if (pluginTools.length === 0 && pluginPackages.length === 0) {
3053
3064
  lines.push("No plugins loaded.");
3054
- lines.push("Add .js files to the plugins directory and set allowPlugins:true in config.");
3065
+ lines.push("Use /plugin install <path>, /plugin trust <name>, then /plugin enable <name>.");
3055
3066
  } else {
3056
- for (const t of pluginTools) {
3057
- lines.push(` \u2022 ${t.definition.name} \u2014 ${t.definition.description}`);
3067
+ if (pluginPackages.length > 0) {
3068
+ lines.push(`Package plugins (${pluginPackages.length}):`);
3069
+ for (const p of pluginPackages) lines.push(` \u2022 ${p.name}@${p.manifest.version} \u2014 ${p.enabled ? "enabled" : "disabled"} / ${p.trusted ? "trusted" : "untrusted"}`);
3070
+ lines.push("");
3071
+ }
3072
+ if (pluginTools.length > 0) {
3073
+ lines.push(`Legacy JS plugin tools (${pluginTools.length}):`);
3074
+ for (const t of pluginTools) lines.push(` \u2022 ${t.definition.name} \u2014 ${t.definition.description}`);
3058
3075
  }
3059
3076
  }
3060
3077
  this.send({ type: "info", message: lines.join("\n") });
3061
3078
  break;
3062
3079
  }
3080
+ case "plugin": {
3081
+ const configDir = this.config.getConfigDir();
3082
+ const sub = args[0] ?? "list";
3083
+ try {
3084
+ if (sub === "list") {
3085
+ const plugins = listInstalledPlugins(configDir);
3086
+ const lines = [`\u{1F50C} **Package Plugins**`, `Dir: ${pluginRoot(configDir)}`, ""];
3087
+ if (plugins.length === 0) lines.push("No package plugins installed.");
3088
+ for (const p of plugins) lines.push(` \u2022 ${p.name}@${p.manifest.version} \u2014 ${p.enabled ? "enabled" : "disabled"} / ${p.trusted ? "trusted" : "untrusted"}`);
3089
+ this.send({ type: "info", message: lines.join("\n") });
3090
+ break;
3091
+ }
3092
+ if (sub === "install") {
3093
+ const input = args[1];
3094
+ if (!input) throw new Error("Usage: /plugin install <path>");
3095
+ const plugin = installPlugin(configDir, input);
3096
+ this.send({ type: "info", message: `Installed plugin ${plugin.name}@${plugin.manifest.version}. Run /plugin trust ${plugin.name}, then /plugin enable ${plugin.name}.` });
3097
+ break;
3098
+ }
3099
+ if (sub === "trust") {
3100
+ const name2 = args[1];
3101
+ if (!name2) throw new Error("Usage: /plugin trust <name>");
3102
+ const state = trustPlugin(configDir, name2);
3103
+ this.send({ type: "info", message: `Trusted plugin ${state.name}.` });
3104
+ break;
3105
+ }
3106
+ if (sub === "enable" || sub === "disable") {
3107
+ const name2 = args[1];
3108
+ if (!name2) throw new Error(`Usage: /plugin ${sub} <name>`);
3109
+ const state = setPluginEnabled(configDir, name2, sub === "enable");
3110
+ this.send({ type: "info", message: `${sub === "enable" ? "Enabled" : "Disabled"} plugin ${state.name}. Restart Web UI for changes to take effect.` });
3111
+ break;
3112
+ }
3113
+ if (sub === "inspect") {
3114
+ const name2 = args[1];
3115
+ if (!name2) throw new Error("Usage: /plugin inspect <name>");
3116
+ this.send({ type: "info", message: describePlugin(getInstalledPlugin(configDir, name2)).join("\n") });
3117
+ break;
3118
+ }
3119
+ throw new Error("Usage: /plugin [list|install|enable|disable|inspect|trust]");
3120
+ } catch (err) {
3121
+ this.send({ type: "error", message: err instanceof Error ? err.message : String(err) });
3122
+ }
3123
+ break;
3124
+ }
3063
3125
  // ── /bug ────────────────────────────────────────────────────────
3064
3126
  case "bug": {
3065
3127
  const session = this.sessions.current;
@@ -3102,7 +3164,7 @@ Add .md files to create commands.` });
3102
3164
  return;
3103
3165
  }
3104
3166
  const preDecisions = runLifecycleHooks(
3105
- this.config.get("hooks") ?? void 0,
3167
+ mergePluginHooks(this.config.get("hooks") ?? void 0, this.config.getConfigDir()),
3106
3168
  "PreCompact",
3107
3169
  { sessionId: session.id, messageCount: session.messages.length, instruction },
3108
3170
  { configDir: this.config.getConfigDir(), onSummary: (message) => this.send({ type: "info", message: "[hook] " + message }) }
@@ -3139,7 +3201,7 @@ Add .md files to create commands.` });
3139
3201
  const removedCount = session.compact(summaryMsg, ackMsg, keepLast);
3140
3202
  const afterCount = session.messages.length;
3141
3203
  runLifecycleHooks(
3142
- this.config.get("hooks") ?? void 0,
3204
+ mergePluginHooks(this.config.get("hooks") ?? void 0, this.config.getConfigDir()),
3143
3205
  "PostCompact",
3144
3206
  { sessionId: session.id, beforeCount, afterCount, removedCount, keepLast, instruction },
3145
3207
  { configDir: this.config.getConfigDir(), onSummary: (message) => this.send({ type: "info", message: "[hook] " + message }) }
@@ -3591,6 +3653,8 @@ async function startWebServer(options = {}) {
3591
3653
  let mcpManager = null;
3592
3654
  const mcpEnabled = config.get("mcpEnabled") !== false;
3593
3655
  const globalMcpServers = mcpEnabled ? config.get("mcpServers") ?? {} : {};
3656
+ const pluginAssets = getActivePluginAssets(config.getConfigDir());
3657
+ const pluginMcpServers = mcpEnabled ? pluginAssets.mcpServers : {};
3594
3658
  const projectMcpResolved = mcpEnabled ? resolveProjectMcpPath() : null;
3595
3659
  let projectMcpServers = {};
3596
3660
  if (projectMcpResolved) {
@@ -3603,7 +3667,7 @@ async function startWebServer(options = {}) {
3603
3667
  console.log(` Skipped to prevent unintended RCE. Run "aicli" then "/mcp trust-project" to approve.`);
3604
3668
  }
3605
3669
  }
3606
- const mergedMcpServers = { ...globalMcpServers, ...projectMcpServers };
3670
+ const mergedMcpServers = { ...globalMcpServers, ...pluginMcpServers, ...projectMcpServers };
3607
3671
  if (!mcpEnabled) {
3608
3672
  console.log(" \u{1F50C} MCP: disabled (config.mcpEnabled=false)");
3609
3673
  }
@@ -3624,7 +3688,7 @@ async function startWebServer(options = {}) {
3624
3688
  const skillsDir = join2(config.getConfigDir(), SKILLS_DIR_NAME);
3625
3689
  if (existsSync3(skillsDir)) {
3626
3690
  skillManager = new SkillManager(skillsDir, config.get("ui").skillSizeWarn);
3627
- skillManager.loadSkills();
3691
+ skillManager.loadSkills(pluginAssets.skillDirs);
3628
3692
  const count = skillManager.listSkills().length;
3629
3693
  if (count > 0) {
3630
3694
  console.log(` Skills: ${count} available`);
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ToolRegistry
4
- } from "./chunk-MGBMNCHG.js";
4
+ } from "./chunk-GX3HSGJX.js";
5
5
  import "./chunk-T2NL5ZIA.js";
6
6
  import "./chunk-BXP6YZ2P.js";
7
- import "./chunk-VTH7BLXK.js";
7
+ import "./chunk-VGFTM3XT.js";
8
8
  import {
9
9
  runTool
10
- } from "./chunk-SNJAOXFT.js";
10
+ } from "./chunk-MWKE2TNS.js";
11
11
  import {
12
12
  getDangerLevel,
13
13
  schemaToJsonSchema
@@ -15,7 +15,7 @@ import {
15
15
  import "./chunk-TZQHYZKT.js";
16
16
  import {
17
17
  VERSION
18
- } from "./chunk-XJGEQIYS.js";
18
+ } from "./chunk-NTCB7CMT.js";
19
19
  import "./chunk-HOSJZMQS.js";
20
20
  import "./chunk-4BKXL7SM.js";
21
21
  import "./chunk-TB4W4Y4T.js";
@@ -3,13 +3,13 @@ import {
3
3
  ToolRegistry,
4
4
  googleSearchContext,
5
5
  truncateOutput
6
- } from "./chunk-MGBMNCHG.js";
6
+ } from "./chunk-GX3HSGJX.js";
7
7
  import "./chunk-T2NL5ZIA.js";
8
8
  import "./chunk-BXP6YZ2P.js";
9
- import "./chunk-VTH7BLXK.js";
9
+ import "./chunk-VGFTM3XT.js";
10
10
  import {
11
11
  runTool
12
- } from "./chunk-SNJAOXFT.js";
12
+ } from "./chunk-MWKE2TNS.js";
13
13
  import {
14
14
  getDangerLevel,
15
15
  runLeanAgentLoop
@@ -17,7 +17,7 @@ import {
17
17
  import "./chunk-TZQHYZKT.js";
18
18
  import {
19
19
  SUBAGENT_ALLOWED_TOOLS
20
- } from "./chunk-XJGEQIYS.js";
20
+ } from "./chunk-NTCB7CMT.js";
21
21
  import "./chunk-HOSJZMQS.js";
22
22
  import "./chunk-4BKXL7SM.js";
23
23
  import "./chunk-TB4W4Y4T.js";
@@ -8,9 +8,9 @@ import {
8
8
  } from "./chunk-E44DTERW.js";
9
9
  import {
10
10
  ConfigManager
11
- } from "./chunk-WKOQ5CYC.js";
11
+ } from "./chunk-P4VBLXKS.js";
12
12
  import "./chunk-TZQHYZKT.js";
13
- import "./chunk-XJGEQIYS.js";
13
+ import "./chunk-NTCB7CMT.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.217",
3
+ "version": "0.4.218",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",