jinzd-ai-cli 0.4.92 → 0.4.93

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.
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ConfigManager
4
- } from "./chunk-ING3NMVR.js";
4
+ } from "./chunk-3SRJBTIY.js";
5
5
  import "./chunk-2ZD3YTVM.js";
6
- import "./chunk-5IL2BHSD.js";
6
+ import "./chunk-WR4M4TXV.js";
7
7
 
8
8
  // src/cli/batch.ts
9
9
  import Anthropic from "@anthropic-ai/sdk";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  schemaToJsonSchema,
4
4
  truncateForPersist
5
- } from "./chunk-CNI26J5Z.js";
5
+ } from "./chunk-5D7LG2TY.js";
6
6
  import {
7
7
  AuthError,
8
8
  ProviderError,
@@ -21,7 +21,7 @@ import {
21
21
  MCP_PROTOCOL_VERSION,
22
22
  MCP_TOOL_PREFIX,
23
23
  VERSION
24
- } from "./chunk-5IL2BHSD.js";
24
+ } from "./chunk-WR4M4TXV.js";
25
25
 
26
26
  // src/providers/claude.ts
27
27
  import Anthropic from "@anthropic-ai/sdk";
@@ -3556,13 +3556,16 @@ function parseSkillFile(filePath) {
3556
3556
  }
3557
3557
 
3558
3558
  // src/skills/manager.ts
3559
- var SKILL_CONTENT_WARN_CHARS = 5e3;
3559
+ var SKILL_CONTENT_WARN_CHARS_DEFAULT = 1e4;
3560
3560
  var SkillManager = class {
3561
3561
  skills = /* @__PURE__ */ new Map();
3562
3562
  activeSkill = null;
3563
3563
  skillsDir;
3564
- constructor(skillsDir) {
3564
+ /** 超大技能文件警告阈值,由调用方从 config 传入;0 = 静默,undefined = 用默认 10000 */
3565
+ warnThreshold;
3566
+ constructor(skillsDir, warnThreshold) {
3565
3567
  this.skillsDir = skillsDir;
3568
+ this.warnThreshold = warnThreshold ?? SKILL_CONTENT_WARN_CHARS_DEFAULT;
3566
3569
  }
3567
3570
  /** 发现并加载 skillsDir 下所有 .md 文件,返回加载数量 */
3568
3571
  loadSkills() {
@@ -3607,9 +3610,9 @@ var SkillManager = class {
3607
3610
  skill.meta.name = entry;
3608
3611
  }
3609
3612
  this.skills.set(skill.meta.name, skill);
3610
- if (skill.content.length > SKILL_CONTENT_WARN_CHARS) {
3613
+ if (this.warnThreshold > 0 && skill.content.length > this.warnThreshold) {
3611
3614
  process.stderr.write(
3612
- `\u26A0 Skill '${skill.meta.name}' is ${skill.content.length} chars (>${SKILL_CONTENT_WARN_CHARS}), may consume significant context.
3615
+ `\u26A0 Skill '${skill.meta.name}' is ${skill.content.length} chars (>${this.warnThreshold}). Only consumed when activated via /skill. Adjust with: /config set ui.skillSizeWarn <n|0>
3613
3616
  `
3614
3617
  );
3615
3618
  }
@@ -8,7 +8,7 @@ import {
8
8
  CONFIG_FILE_NAME,
9
9
  HISTORY_DIR_NAME,
10
10
  PLUGINS_DIR_NAME
11
- } from "./chunk-5IL2BHSD.js";
11
+ } from "./chunk-WR4M4TXV.js";
12
12
 
13
13
  // src/config/config-manager.ts
14
14
  import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
@@ -95,6 +95,8 @@ var ConfigSchema = z.object({
95
95
  notificationThreshold: z.number().default(1e4),
96
96
  /** 终端输出折行宽度。0 = 自动(使用终端宽度),>0 = 固定列宽。默认 0 */
97
97
  wordWrap: z.number().int().min(0).default(0),
98
+ /** Skill 文件过大警告阈值(字符数)。超过此值的 skill 在启动加载时打印警告。0 = 静默。默认 10000 */
99
+ skillSizeWarn: z.number().int().min(0).default(1e4),
98
100
  /** 颜色主题:'dark'(默认)| 'light' | 'custom' */
99
101
  theme: z.enum(["dark", "light", "custom"]).default("dark"),
100
102
  /** 自定义颜色覆盖(仅在 theme='custom' 时生效)。值为 chalk 颜色名或 '#hex',支持 'bold.cyan' 组合 */
@@ -23,7 +23,7 @@ import {
23
23
  } from "./chunk-6VRJGH25.js";
24
24
  import {
25
25
  runTestsTool
26
- } from "./chunk-KLSISB52.js";
26
+ } from "./chunk-OL6TUUBE.js";
27
27
  import {
28
28
  CONFIG_DIR_NAME,
29
29
  DEFAULT_MAX_TOOL_OUTPUT_CHARS_CAP,
@@ -31,7 +31,7 @@ import {
31
31
  SUBAGENT_ALLOWED_TOOLS,
32
32
  SUBAGENT_DEFAULT_MAX_ROUNDS,
33
33
  SUBAGENT_MAX_ROUNDS_LIMIT
34
- } from "./chunk-5IL2BHSD.js";
34
+ } from "./chunk-WR4M4TXV.js";
35
35
 
36
36
  // src/tools/types.ts
37
37
  function isFileWriteTool(name) {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  TEST_TIMEOUT
4
- } from "./chunk-5IL2BHSD.js";
4
+ } from "./chunk-WR4M4TXV.js";
5
5
 
6
6
  // src/tools/builtin/run-tests.ts
7
7
  import { execSync } from "child_process";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/core/constants.ts
4
- var VERSION = "0.4.92";
4
+ var VERSION = "0.4.93";
5
5
  var APP_NAME = "ai-cli";
6
6
  var CONFIG_DIR_NAME = ".aicli";
7
7
  var CONFIG_FILE_NAME = "config.json";
@@ -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.92";
9
+ var VERSION = "0.4.93";
10
10
  var APP_NAME = "ai-cli";
11
11
  var CONFIG_DIR_NAME = ".aicli";
12
12
  var CONFIG_FILE_NAME = "config.json";
@@ -36,7 +36,7 @@ import {
36
36
  VERSION,
37
37
  buildUserIdentityPrompt,
38
38
  runTestsTool
39
- } from "./chunk-A4TUAW4J.js";
39
+ } from "./chunk-ZTBXPEG2.js";
40
40
  import {
41
41
  hasSemanticIndex,
42
42
  semanticSearch
@@ -145,6 +145,8 @@ var ConfigSchema = z.object({
145
145
  notificationThreshold: z.number().default(1e4),
146
146
  /** 终端输出折行宽度。0 = 自动(使用终端宽度),>0 = 固定列宽。默认 0 */
147
147
  wordWrap: z.number().int().min(0).default(0),
148
+ /** Skill 文件过大警告阈值(字符数)。超过此值的 skill 在启动加载时打印警告。0 = 静默。默认 10000 */
149
+ skillSizeWarn: z.number().int().min(0).default(1e4),
148
150
  /** 颜色主题:'dark'(默认)| 'light' | 'custom' */
149
151
  theme: z.enum(["dark", "light", "custom"]).default("dark"),
150
152
  /** 自定义颜色覆盖(仅在 theme='custom' 时生效)。值为 chalk 颜色名或 '#hex',支持 'bold.cyan' 组合 */
@@ -8747,13 +8749,16 @@ function parseSkillFile(filePath) {
8747
8749
  }
8748
8750
 
8749
8751
  // src/skills/manager.ts
8750
- var SKILL_CONTENT_WARN_CHARS = 5e3;
8752
+ var SKILL_CONTENT_WARN_CHARS_DEFAULT = 1e4;
8751
8753
  var SkillManager = class {
8752
8754
  skills = /* @__PURE__ */ new Map();
8753
8755
  activeSkill = null;
8754
8756
  skillsDir;
8755
- constructor(skillsDir) {
8757
+ /** 超大技能文件警告阈值,由调用方从 config 传入;0 = 静默,undefined = 用默认 10000 */
8758
+ warnThreshold;
8759
+ constructor(skillsDir, warnThreshold) {
8756
8760
  this.skillsDir = skillsDir;
8761
+ this.warnThreshold = warnThreshold ?? SKILL_CONTENT_WARN_CHARS_DEFAULT;
8757
8762
  }
8758
8763
  /** 发现并加载 skillsDir 下所有 .md 文件,返回加载数量 */
8759
8764
  loadSkills() {
@@ -8798,9 +8803,9 @@ var SkillManager = class {
8798
8803
  skill.meta.name = entry;
8799
8804
  }
8800
8805
  this.skills.set(skill.meta.name, skill);
8801
- if (skill.content.length > SKILL_CONTENT_WARN_CHARS) {
8806
+ if (this.warnThreshold > 0 && skill.content.length > this.warnThreshold) {
8802
8807
  process.stderr.write(
8803
- `\u26A0 Skill '${skill.meta.name}' is ${skill.content.length} chars (>${SKILL_CONTENT_WARN_CHARS}), may consume significant context.
8808
+ `\u26A0 Skill '${skill.meta.name}' is ${skill.content.length} chars (>${this.warnThreshold}). Only consumed when activated via /skill. Adjust with: /config set ui.skillSizeWarn <n|0>
8804
8809
  `
8805
8810
  );
8806
8811
  }
@@ -11342,7 +11347,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
11342
11347
  case "test": {
11343
11348
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
11344
11349
  try {
11345
- const { executeTests } = await import("./run-tests-4XJLQNUW.js");
11350
+ const { executeTests } = await import("./run-tests-LKZFHPQK.js");
11346
11351
  const argStr = args.join(" ").trim();
11347
11352
  let testArgs = {};
11348
11353
  if (argStr) {
@@ -12593,7 +12598,7 @@ async function startWebServer(options = {}) {
12593
12598
  let skillManager = null;
12594
12599
  const skillsDir = join15(config.getConfigDir(), SKILLS_DIR_NAME);
12595
12600
  if (existsSync22(skillsDir)) {
12596
- skillManager = new SkillManager(skillsDir);
12601
+ skillManager = new SkillManager(skillsDir, config.get("ui").skillSizeWarn);
12597
12602
  skillManager.loadSkills();
12598
12603
  const count = skillManager.listSkills().length;
12599
12604
  if (count > 0) {
@@ -385,7 +385,7 @@ ${content}`);
385
385
  }
386
386
  }
387
387
  async function runTaskMode(config, providers, configManager, topic) {
388
- const { TaskOrchestrator } = await import("./task-orchestrator-IQTIXEOM.js");
388
+ const { TaskOrchestrator } = await import("./task-orchestrator-3LZHLZCG.js");
389
389
  const orchestrator = new TaskOrchestrator(config, providers, configManager);
390
390
  let interrupted = false;
391
391
  const onSigint = () => {
package/dist/index.js CHANGED
@@ -30,10 +30,10 @@ import {
30
30
  saveDevState,
31
31
  sessionHasMeaningfulContent,
32
32
  setupProxy
33
- } from "./chunk-KPX72DTU.js";
33
+ } from "./chunk-3CU4NKPD.js";
34
34
  import {
35
35
  ConfigManager
36
- } from "./chunk-ING3NMVR.js";
36
+ } from "./chunk-3SRJBTIY.js";
37
37
  import {
38
38
  ToolExecutor,
39
39
  ToolRegistry,
@@ -52,7 +52,7 @@ import {
52
52
  spawnAgentContext,
53
53
  theme,
54
54
  undoStack
55
- } from "./chunk-CNI26J5Z.js";
55
+ } from "./chunk-5D7LG2TY.js";
56
56
  import "./chunk-2ZD3YTVM.js";
57
57
  import {
58
58
  fileCheckpoints
@@ -70,7 +70,7 @@ import "./chunk-KJLJPUY2.js";
70
70
  import "./chunk-6VRJGH25.js";
71
71
  import "./chunk-2DXY7UGF.js";
72
72
  import "./chunk-KHYD3WXE.js";
73
- import "./chunk-KLSISB52.js";
73
+ import "./chunk-OL6TUUBE.js";
74
74
  import {
75
75
  AGENTIC_BEHAVIOR_GUIDELINE,
76
76
  AUTHOR,
@@ -92,7 +92,7 @@ import {
92
92
  SKILLS_DIR_NAME,
93
93
  VERSION,
94
94
  buildUserIdentityPrompt
95
- } from "./chunk-5IL2BHSD.js";
95
+ } from "./chunk-WR4M4TXV.js";
96
96
 
97
97
  // src/index.ts
98
98
  import { program } from "commander";
@@ -2612,7 +2612,7 @@ ${hint}` : "")
2612
2612
  usage: "/test [command|filter]",
2613
2613
  async execute(args, ctx) {
2614
2614
  try {
2615
- const { executeTests } = await import("./run-tests-JROEDZES.js");
2615
+ const { executeTests } = await import("./run-tests-RO24F4Z2.js");
2616
2616
  const argStr = args.join(" ").trim();
2617
2617
  let testArgs = {};
2618
2618
  if (argStr) {
@@ -5000,7 +5000,7 @@ Session '${this.resumeSessionId}' not found.
5000
5000
  `));
5001
5001
  }
5002
5002
  const skillsDir = join5(this.config.getConfigDir(), SKILLS_DIR_NAME);
5003
- this.skillManager = new SkillManager(skillsDir);
5003
+ this.skillManager = new SkillManager(skillsDir, this.config.get("ui").skillSizeWarn);
5004
5004
  const skillCount = this.skillManager.loadSkills();
5005
5005
  if (skillCount > 0) {
5006
5006
  process.stdout.write(theme.dim(` \u{1F3AF} Skills: ${skillCount} available (use /skill to manage)
@@ -6738,7 +6738,7 @@ program.command("web").description("Start Web UI server with browser-based chat
6738
6738
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
6739
6739
  process.exit(1);
6740
6740
  }
6741
- const { startWebServer } = await import("./server-WHTZFKVB.js");
6741
+ const { startWebServer } = await import("./server-YHECGYRX.js");
6742
6742
  await startWebServer({ port, host: options.host });
6743
6743
  });
6744
6744
  program.command("user [action] [username]").description("Manage Web UI users (list | create <name> | delete <name> | reset-password <name> | migrate <name>)").action(async (action, username) => {
@@ -6861,7 +6861,7 @@ program.command("sessions").description("List recent conversation sessions").act
6861
6861
  });
6862
6862
  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) => {
6863
6863
  try {
6864
- const batch = await import("./batch-SK2YCZEY.js");
6864
+ const batch = await import("./batch-NAPWSE3V.js");
6865
6865
  switch (action) {
6866
6866
  case "submit":
6867
6867
  if (!arg) {
@@ -6904,7 +6904,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
6904
6904
  }
6905
6905
  });
6906
6906
  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) => {
6907
- const { startMcpServer } = await import("./server-DB4GMBDN.js");
6907
+ const { startMcpServer } = await import("./server-YXETATAI.js");
6908
6908
  await startMcpServer({
6909
6909
  allowDestructive: !!options.allowDestructive,
6910
6910
  allowOutsideCwd: !!options.allowOutsideCwd,
@@ -7031,7 +7031,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
7031
7031
  }),
7032
7032
  config.get("customProviders")
7033
7033
  );
7034
- const { startHub } = await import("./hub-YRYUBSEQ.js");
7034
+ const { startHub } = await import("./hub-LJAXL2LO.js");
7035
7035
  await startHub(
7036
7036
  {
7037
7037
  topic: topic ?? "",
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  executeTests,
3
3
  runTestsTool
4
- } from "./chunk-A4TUAW4J.js";
4
+ } from "./chunk-ZTBXPEG2.js";
5
5
  export {
6
6
  executeTests,
7
7
  runTestsTool
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  executeTests,
4
4
  runTestsTool
5
- } from "./chunk-KLSISB52.js";
6
- import "./chunk-5IL2BHSD.js";
5
+ } from "./chunk-OL6TUUBE.js";
6
+ import "./chunk-WR4M4TXV.js";
7
7
  export {
8
8
  executeTests,
9
9
  runTestsTool
@@ -23,10 +23,10 @@ import {
23
23
  persistToolRound,
24
24
  rebuildExtraMessages,
25
25
  setupProxy
26
- } from "./chunk-KPX72DTU.js";
26
+ } from "./chunk-3CU4NKPD.js";
27
27
  import {
28
28
  ConfigManager
29
- } from "./chunk-ING3NMVR.js";
29
+ } from "./chunk-3SRJBTIY.js";
30
30
  import {
31
31
  ToolExecutor,
32
32
  ToolRegistry,
@@ -44,7 +44,7 @@ import {
44
44
  spawnAgentContext,
45
45
  truncateOutput,
46
46
  undoStack
47
- } from "./chunk-CNI26J5Z.js";
47
+ } from "./chunk-5D7LG2TY.js";
48
48
  import "./chunk-2ZD3YTVM.js";
49
49
  import "./chunk-4BKXL7SM.js";
50
50
  import "./chunk-ANYYM4CF.js";
@@ -53,7 +53,7 @@ import "./chunk-KJLJPUY2.js";
53
53
  import "./chunk-6VRJGH25.js";
54
54
  import "./chunk-2DXY7UGF.js";
55
55
  import "./chunk-KHYD3WXE.js";
56
- import "./chunk-KLSISB52.js";
56
+ import "./chunk-OL6TUUBE.js";
57
57
  import {
58
58
  AGENTIC_BEHAVIOR_GUIDELINE,
59
59
  AUTHOR,
@@ -72,7 +72,7 @@ import {
72
72
  SKILLS_DIR_NAME,
73
73
  VERSION,
74
74
  buildUserIdentityPrompt
75
- } from "./chunk-5IL2BHSD.js";
75
+ } from "./chunk-WR4M4TXV.js";
76
76
 
77
77
  // src/web/server.ts
78
78
  import express from "express";
@@ -2237,7 +2237,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
2237
2237
  case "test": {
2238
2238
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
2239
2239
  try {
2240
- const { executeTests } = await import("./run-tests-JROEDZES.js");
2240
+ const { executeTests } = await import("./run-tests-RO24F4Z2.js");
2241
2241
  const argStr = args.join(" ").trim();
2242
2242
  let testArgs = {};
2243
2243
  if (argStr) {
@@ -3266,7 +3266,7 @@ async function startWebServer(options = {}) {
3266
3266
  let skillManager = null;
3267
3267
  const skillsDir = join3(config.getConfigDir(), SKILLS_DIR_NAME);
3268
3268
  if (existsSync4(skillsDir)) {
3269
- skillManager = new SkillManager(skillsDir);
3269
+ skillManager = new SkillManager(skillsDir, config.get("ui").skillSizeWarn);
3270
3270
  skillManager.loadSkills();
3271
3271
  const count = skillManager.listSkills().length;
3272
3272
  if (count > 0) {
@@ -3,7 +3,7 @@ import {
3
3
  ToolRegistry,
4
4
  getDangerLevel,
5
5
  schemaToJsonSchema
6
- } from "./chunk-CNI26J5Z.js";
6
+ } from "./chunk-5D7LG2TY.js";
7
7
  import "./chunk-2ZD3YTVM.js";
8
8
  import "./chunk-4BKXL7SM.js";
9
9
  import "./chunk-ANYYM4CF.js";
@@ -12,10 +12,10 @@ import "./chunk-KJLJPUY2.js";
12
12
  import "./chunk-6VRJGH25.js";
13
13
  import "./chunk-2DXY7UGF.js";
14
14
  import "./chunk-KHYD3WXE.js";
15
- import "./chunk-KLSISB52.js";
15
+ import "./chunk-OL6TUUBE.js";
16
16
  import {
17
17
  VERSION
18
- } from "./chunk-5IL2BHSD.js";
18
+ } from "./chunk-WR4M4TXV.js";
19
19
 
20
20
  // src/mcp/server.ts
21
21
  import { createInterface } from "readline";
@@ -4,7 +4,7 @@ import {
4
4
  getDangerLevel,
5
5
  googleSearchContext,
6
6
  truncateOutput
7
- } from "./chunk-CNI26J5Z.js";
7
+ } from "./chunk-5D7LG2TY.js";
8
8
  import "./chunk-2ZD3YTVM.js";
9
9
  import "./chunk-4BKXL7SM.js";
10
10
  import "./chunk-ANYYM4CF.js";
@@ -13,10 +13,10 @@ import "./chunk-KJLJPUY2.js";
13
13
  import "./chunk-6VRJGH25.js";
14
14
  import "./chunk-2DXY7UGF.js";
15
15
  import "./chunk-KHYD3WXE.js";
16
- import "./chunk-KLSISB52.js";
16
+ import "./chunk-OL6TUUBE.js";
17
17
  import {
18
18
  SUBAGENT_ALLOWED_TOOLS
19
- } from "./chunk-5IL2BHSD.js";
19
+ } from "./chunk-WR4M4TXV.js";
20
20
 
21
21
  // src/hub/task-orchestrator.ts
22
22
  import { createInterface } from "readline";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jinzd-ai-cli",
3
- "version": "0.4.92",
3
+ "version": "0.4.93",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",