dal-code 1.0.36 → 1.0.38

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 (121) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/core/agent-session.d.ts +4 -1
  3. package/dist/core/agent-session.js +8 -8
  4. package/dist/core/auth-storage.js +1 -1
  5. package/dist/core/compaction/utils.js +5 -6
  6. package/dist/core/extensions/index.d.ts +1 -1
  7. package/dist/core/extensions/runner.d.ts +3 -2
  8. package/dist/core/extensions/runner.js +1 -1
  9. package/dist/core/extensions/types.d.ts +11 -3
  10. package/dist/core/model-runtime.js +2 -2
  11. package/dist/core/package-manager.d.ts +4 -0
  12. package/dist/core/package-manager.js +2 -2
  13. package/dist/core/session-manager.d.ts +3 -0
  14. package/dist/core/session-manager.js +12 -12
  15. package/dist/core/settings-diagnostics.js +1 -1
  16. package/dist/core/settings-manager.d.ts +3 -0
  17. package/dist/core/settings-manager.js +1 -1
  18. package/dist/core/shared-data.js +1 -0
  19. package/dist/core/system-prompt.js +10 -10
  20. package/dist/core/trust-manager.js +2 -2
  21. package/dist/dal/reviewed/endorsed-cli.js +1 -0
  22. package/dist/dal/reviewed/endorsed-plan.js +1 -0
  23. package/dist/dal/reviewed/endorsed.js +1 -0
  24. package/dist/dal/reviewed/version.js +1 -0
  25. package/dist/extensions/mcp/config.js +2 -2
  26. package/dist/index.d.ts +1 -1
  27. package/dist/modes/print-mode.js +5 -5
  28. package/dist/node_modules/@dalcode/dal-bridge/package.json +2 -2
  29. package/dist/node_modules/@dalcode/dal-gateway/package.json +2 -2
  30. package/dist/node_modules/@dalcode/dal-goal/package.json +2 -2
  31. package/dist/node_modules/@dalcode/dal-guard/package.json +4 -4
  32. package/dist/node_modules/@dalcode/dal-guard/src/mode.js +2 -2
  33. package/dist/node_modules/@dalcode/dal-halo/package.json +1 -1
  34. package/dist/node_modules/@dalcode/dal-interactive/package.json +2 -2
  35. package/dist/node_modules/@dalcode/dal-lang/package.json +3 -3
  36. package/dist/node_modules/@dalcode/dal-lsp/package.json +3 -3
  37. package/dist/node_modules/@dalcode/dal-mcp/package.json +5 -5
  38. package/dist/node_modules/@dalcode/dal-mcp/src/config-edit.js +2 -2
  39. package/dist/node_modules/@dalcode/dal-office/package.json +2 -2
  40. package/dist/node_modules/@dalcode/dal-pi-kit/dist/i18n.js +1 -1
  41. package/dist/node_modules/@dalcode/dal-pi-kit/dist/index.js +1 -1
  42. package/dist/node_modules/@dalcode/dal-pi-kit/dist/shared-data.js +1 -0
  43. package/dist/node_modules/@dalcode/dal-pi-kit/package.json +1 -1
  44. package/dist/node_modules/@dalcode/dal-pi-kit/src/i18n.js +1 -1
  45. package/dist/node_modules/@dalcode/dal-pi-kit/src/index.js +1 -1
  46. package/dist/node_modules/@dalcode/dal-pi-kit/src/shared-data.js +1 -0
  47. package/dist/node_modules/@dalcode/dal-plugins/package.json +4 -4
  48. package/dist/node_modules/@dalcode/dal-plugins/src/state.js +2 -2
  49. package/dist/node_modules/@dalcode/dal-review/package.json +3 -3
  50. package/dist/node_modules/@dalcode/dal-rewind/package.json +2 -2
  51. package/dist/node_modules/@dalcode/dal-rewind/src/index.js +1 -1
  52. package/dist/node_modules/@dalcode/dal-router/package.json +4 -4
  53. package/dist/node_modules/@dalcode/dal-router/src/config.d.ts +1 -1
  54. package/dist/node_modules/@dalcode/dal-router/src/config.js +2 -2
  55. package/dist/node_modules/@dalcode/dal-router/src/index.js +1 -1
  56. package/dist/node_modules/@dalcode/dal-router/src/runtime.js +1 -1
  57. package/dist/node_modules/@dalcode/dal-skills/package.json +3 -3
  58. package/dist/node_modules/@dalcode/dal-subagent/package.json +5 -5
  59. package/dist/node_modules/@dalcode/dal-subagent/src/index.js +14 -12
  60. package/dist/node_modules/@dalcode/dal-subagent/src/process-runner.js +2 -2
  61. package/dist/node_modules/@dalcode/dal-telemetry/package.json +2 -2
  62. package/dist/node_modules/@dalcode/dal-telemetry/src/config.js +2 -2
  63. package/dist/node_modules/@dalcode/dal-terminal/package.json +2 -2
  64. package/dist/node_modules/@dalcode/dal-tool-catalog/package.json +2 -2
  65. package/dist/node_modules/@dalcode/dal-tool-catalog/src/index.js +4 -4
  66. package/dist/node_modules/@dalcode/dal-web/package.json +3 -3
  67. package/dist/node_modules/@dalcode/dal-workflow/package.json +2 -2
  68. package/dist/node_modules/@dalcode/dal-workflow/src/plan-mode.js +14 -14
  69. package/dist/node_modules/@dalcode/deepailab/package.json +3 -3
  70. package/dist/node_modules/@earendil-works/chord/package.json +1 -1
  71. package/dist/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
  72. package/dist/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +5 -5
  73. package/dist/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +1 -1
  74. package/dist/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +4 -4
  75. package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +5 -5
  76. package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +4 -4
  77. package/dist/node_modules/@earendil-works/pi-ai/dist/api/transform-messages.js +1 -1
  78. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  79. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
  80. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
  81. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
  82. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  83. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  84. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-ams.json +1 -1
  85. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-cn.json +1 -1
  86. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-sgp.json +1 -1
  87. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi.json +1 -1
  88. package/dist/node_modules/@earendil-works/pi-ai/dist/types.d.ts +1 -0
  89. package/dist/node_modules/@earendil-works/pi-ai/dist/utils/json-parse.d.ts +2 -0
  90. package/dist/node_modules/@earendil-works/pi-ai/dist/utils/json-parse.js +5 -2
  91. package/dist/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts +1 -1
  92. package/dist/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +1 -1
  93. package/dist/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +1 -1
  94. package/dist/node_modules/@earendil-works/pi-ai/dist/utils/validation.js +2 -2
  95. package/dist/node_modules/@earendil-works/pi-ai/package.json +2 -6
  96. package/dist/node_modules/@earendil-works/pi-client/package.json +3 -3
  97. package/dist/node_modules/@earendil-works/pi-codemode/package.json +1 -1
  98. package/dist/node_modules/@earendil-works/pi-coding-agent/package.json +1 -1
  99. package/dist/node_modules/@earendil-works/pi-mcp/package.json +1 -1
  100. package/dist/node_modules/@earendil-works/pi-protocol/package.json +2 -2
  101. package/dist/node_modules/@earendil-works/pi-server/package.json +3 -3
  102. package/dist/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  103. package/dist/node_modules/@earendil-works/pi-tui/package.json +1 -1
  104. package/dist/package-manager-cli.js +72 -72
  105. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  106. package/examples/extensions/gondolin/package-lock.json +2 -2
  107. package/examples/extensions/gondolin/package.json +1 -1
  108. package/examples/extensions/plan-mode/index.ts +6 -2
  109. package/examples/extensions/sandbox/package-lock.json +2 -2
  110. package/examples/extensions/sandbox/package.json +1 -1
  111. package/examples/extensions/with-deps/package-lock.json +2 -2
  112. package/examples/extensions/with-deps/package.json +1 -1
  113. package/npm-shrinkwrap.json +2 -2
  114. package/package.json +1 -1
  115. package/dist/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.js +0 -1
  116. package/dist/node_modules/@earendil-works/pi-ai/dist/auth/oauth/github-copilot.js +0 -1
  117. package/dist/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.js +0 -1
  118. package/dist/node_modules/@earendil-works/pi-ai/dist/bun-oauth.js +0 -1
  119. package/examples/extensions/custom-provider-anthropic/index.ts +0 -617
  120. package/examples/extensions/custom-provider-anthropic/package-lock.json +0 -24
  121. package/examples/extensions/custom-provider-anthropic/package.json +0 -19
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dalcode/dal-guard",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -18,9 +18,9 @@
18
18
  ]
19
19
  },
20
20
  "dependencies": {
21
- "@dalcode/dal-pi-kit": "1.0.36",
22
- "@dalcode/dal-bridge": "1.0.36",
23
- "@dalcode/dal-halo": "1.0.36"
21
+ "@dalcode/dal-pi-kit": "1.0.38",
22
+ "@dalcode/dal-bridge": "1.0.38",
23
+ "@dalcode/dal-halo": "1.0.38"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "@earendil-works/pi-coding-agent": "^1.0.9"
@@ -1,2 +1,2 @@
1
- var g=Object.defineProperty;var n=(o,r)=>g(o,"name",{value:r,configurable:!0});var G=Object.defineProperty,t=n((o,r)=>G(o,"name",{value:r,configurable:!0}),"o");import{existsSync as M,readFileSync as m,renameSync as D,writeFileSync as S}from"node:fs";import{join as h}from"node:path";const a="DAL_GUARD_MODE";function d(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)}n(d,"u"),t(d,"isRecord");function u(o){try{const r=JSON.parse(m(o,"utf8"));return d(r)?r:void 0}catch{return}}n(u,"s"),t(u,"readJson");function i(o){return h(o,"settings.json")}n(i,"i"),t(i,"userSettingsPath");function c(o){const r=u(i(o))?.guard,e=d(r)?r.mode:void 0;return e==="yolo"||e==="default"?e:void 0}n(c,"f"),t(c,"savedGuardMode");function f(o,r,e=process.env){return r||e[a]==="yolo"?"yolo":c(o)??"default"}n(f,"m"),t(f,"startupGuardMode");function v(o,r){const e=i(o);if(M(e)&&u(e)===void 0)throw new Error(`${e} is not valid JSON; not overwriting it`);const s=u(e)??{};s.guard={...d(s.guard)?s.guard:{},mode:r};const l=`${e}.${process.pid}.tmp`;S(l,`${JSON.stringify(s,null,2)}
2
- `),D(l,e)}n(v,"D"),t(v,"saveGuardMode");function p(o,r=process.env){o==="yolo"?r[a]="yolo":delete r[a]}n(p,"x"),t(p,"exportGuardMode");function y(o){const r=o.env??process.env;return o.mode!=="tui"||!o.hasUI||o.flag||o.underDalCode||r[a]||r.DAL_SUBAGENT_DEPTH||!o.languageChosen?!1:c(o.agentDir)===void 0}n(y,"h"),t(y,"shouldAskGuardMode");export{a as GUARD_MODE_ENV,p as exportGuardMode,v as saveGuardMode,c as savedGuardMode,y as shouldAskGuardMode,f as startupGuardMode,i as userSettingsPath};
1
+ var g=Object.defineProperty;var e=(r,o)=>g(r,"name",{value:o,configurable:!0});var p=Object.defineProperty,a=e((r,o)=>p(r,"name",{value:o,configurable:!0}),"o");import{existsSync as m,readFileSync as w}from"node:fs";import{join as G}from"node:path";import{declaredDataFormat as A,reportNewerDataFormat as D,withFileLockSync as M,writeFileAtomicSync as h}from"@dalcode/dal-pi-kit";const s="DAL_GUARD_MODE";function d(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}e(d,"a"),a(d,"isRecord");function i(r){try{const o=JSON.parse(w(r,"utf8"));return d(o)?o:void 0}catch{return}}e(i,"i"),a(i,"readJson");function u(r){return G(r,"settings.json")}e(u,"u"),a(u,"userSettingsPath");function c(r){const o=i(u(r))?.guard,t=d(o)?o.mode:void 0;return t==="yolo"||t==="default"?t:void 0}e(c,"s"),a(c,"savedGuardMode");function l(r,o,t=process.env){return o||t[s]==="yolo"?"yolo":c(r)??"default"}e(l,"S"),a(l,"startupGuardMode");function f(r,o){const t=u(r);M(t,()=>{if(m(t)&&i(t)===void 0)throw new Error(`${t} is not valid JSON; not overwriting it`);const n=i(t)??{};if(A(n)>1)throw D(t),new Error(`${t} was written by a newer DAL; not overwriting it`);n.guard={...d(n.guard)?n.guard:{},mode:o},h(t,`${JSON.stringify(n,null,2)}
2
+ `)})}e(f,"h"),a(f,"saveGuardMode");function v(r,o=process.env){r==="yolo"?o[s]="yolo":delete o[s]}e(v,"x"),a(v,"exportGuardMode");function y(r){const o=r.env??process.env;return r.mode!=="tui"||!r.hasUI||r.flag||r.underDalCode||o[s]||o.DAL_SUBAGENT_DEPTH||!r.languageChosen?!1:c(r.agentDir)===void 0}e(y,"A"),a(y,"shouldAskGuardMode");export{s as GUARD_MODE_ENV,v as exportGuardMode,f as saveGuardMode,c as savedGuardMode,y as shouldAskGuardMode,l as startupGuardMode,u as userSettingsPath};
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dalcode/dal-halo",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dalcode/dal-interactive",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
4
4
  "private": true,
5
5
  "description": "Terminal-UI conveniences adopted from pi's example extensions: the questionnaire tool (the model asks you questions), /handoff (carry context into a new session) and interactive ! commands (vim, git rebase -i, htop). Active only in the TUI; stands down under DAL Code.",
6
6
  "license": "MIT",
@@ -19,7 +19,7 @@
19
19
  ]
20
20
  },
21
21
  "dependencies": {
22
- "@dalcode/dal-pi-kit": "1.0.36",
22
+ "@dalcode/dal-pi-kit": "1.0.38",
23
23
  "typebox": "1.3.7"
24
24
  },
25
25
  "peerDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dalcode/dal-lang",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -17,8 +17,8 @@
17
17
  ]
18
18
  },
19
19
  "dependencies": {
20
- "@dalcode/dal-pi-kit": "1.0.36",
21
- "@dalcode/dal-bridge": "1.0.36"
20
+ "@dalcode/dal-pi-kit": "1.0.38",
21
+ "@dalcode/dal-bridge": "1.0.38"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "@earendil-works/pi-coding-agent": "^1.0.9"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dalcode/dal-lsp",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -20,8 +20,8 @@
20
20
  ]
21
21
  },
22
22
  "dependencies": {
23
- "@dalcode/dal-bridge": "1.0.36",
24
- "@dalcode/dal-pi-kit": "1.0.36",
23
+ "@dalcode/dal-bridge": "1.0.38",
24
+ "@dalcode/dal-pi-kit": "1.0.38",
25
25
  "cross-spawn": "7.0.6",
26
26
  "typebox": "1.3.7"
27
27
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dalcode/dal-mcp",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -26,10 +26,10 @@
26
26
  ]
27
27
  },
28
28
  "dependencies": {
29
- "@dalcode/dal-bridge": "1.0.36",
30
- "@dalcode/dal-guard": "1.0.36",
31
- "@dalcode/dal-pi-kit": "1.0.36",
32
- "@dalcode/deepailab": "1.0.36",
29
+ "@dalcode/dal-bridge": "1.0.38",
30
+ "@dalcode/dal-guard": "1.0.38",
31
+ "@dalcode/dal-pi-kit": "1.0.38",
32
+ "@dalcode/deepailab": "1.0.38",
33
33
  "cross-spawn": "7.0.6"
34
34
  },
35
35
  "peerDependencies": {
@@ -1,2 +1,2 @@
1
- var C=Object.defineProperty;var o=(e,r)=>C(e,"name",{value:r,configurable:!0});var g=Object.defineProperty,s=o((e,r)=>g(e,"name",{value:r,configurable:!0}),"s");import{existsSync as v,mkdirSync as w,readFileSync as B,renameSync as M,writeFileSync as x}from"node:fs";import{dirname as A,join as S}from"node:path";import{t as c}from"@dalcode/dal-pi-kit";import{CONFIG_DIR_NAME as N,getAgentDir as O}from"@earendil-works/pi-coding-agent";function f(e,r){return e==="user"?S(O(),"mcp.json"):S(r,N,"mcp.json")}o(f,"u"),s(f,"mcpConfigPath");function E(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(E,"d"),s(E,"isStringKeyedRecord");function D(e){return e.charCodeAt(0)===65279?e.slice(1):e}o(D,"F"),s(D,"stripBom");function F(e){if(!v(e))return{file:{},existed:!1};let r;try{r=JSON.parse(D(B(e,"utf8")))}catch(u){const t=u instanceof Error?u.message:String(u);throw new Error(`${e}: ${c("JSON \u89E3\u6790\u5931\u8D25\uFF0C\u62D2\u7EDD\u4FEE\u6539\u4EE5\u907F\u514D\u8986\u76D6\u73B0\u6709\u914D\u7F6E\u3002")}${t}`)}if(!E(r))throw new Error(`${e}: ${c("\u9876\u5C42\u4E0D\u662F JSON \u5BF9\u8C61\uFF0C\u62D2\u7EDD\u4FEE\u6539\u3002")}`);return{file:r,existed:!0}}o(F,"m"),s(F,"readConfigFile");function d(e,r){w(A(e),{recursive:!0});const u=`${e}.${process.pid}.tmp`;x(u,`${JSON.stringify(r,null,2)}
2
- `,"utf-8"),M(u,e)}o(d,"S"),s(d,"writeConfigFile");function l(e,r,u,t){const n=f(e,r),{file:i,existed:p}=F(n);i.mcpServers===void 0&&(i.mcpServers={});const a=i.mcpServers;if(!E(a))throw new Error(`${n}: ${c('"mcpServers" \u4E0D\u662F\u5BF9\u8C61\uFF0C\u62D2\u7EDD\u4FEE\u6539\u3002')}`);if(u in a)throw new Error(`${c("\u8BE5\u540D\u79F0\u5DF2\u5B58\u5728\u4E8E ")}${n}${c("\uFF1A")}${u}${c("\u3002\u5148 /mcp remove\uFF0C\u6216\u76F4\u63A5\u7F16\u8F91\u8BE5\u6587\u4EF6\u3002")}`);return a[u]=t,d(n,i),{path:n,created:!p}}o(l,"b"),s(l,"addMcpServerEntry");function h(e,r,u){const t=f(e,r),{file:n}=F(t);n.mcpServers===void 0&&(n.mcpServers={});const i=n.mcpServers;if(!E(i))throw new Error(`${t}: ${c('"mcpServers" \u4E0D\u662F\u5BF9\u8C61\uFF0C\u62D2\u7EDD\u4FEE\u6539\u3002')}`);const p=[],a=[];for(const{name:m,config:y}of u){if(m in i){a.push(m);continue}i[m]=y,p.push(m)}return p.length>0&&d(t,n),{path:t,added:p,existing:a}}o(h,"J"),s(h,"addMcpServerEntries");function $(e,r,u){const t=f(e,r);if(!v(t))return{path:t,removed:!1};const{file:n}=F(t),i=n.mcpServers;return!E(i)||!(u in i)?{path:t,removed:!1}:(delete i[u],d(t,n),{path:t,removed:!0})}o($,"R"),s($,"removeMcpServerEntry");export{h as addMcpServerEntries,l as addMcpServerEntry,f as mcpConfigPath,$ as removeMcpServerEntry};
1
+ var g=Object.defineProperty;var i=(e,r)=>g(e,"name",{value:r,configurable:!0});var w=Object.defineProperty,c=i((e,r)=>w(e,"name",{value:r,configurable:!0}),"s");import{existsSync as S,readFileSync as A}from"node:fs";import{join as D}from"node:path";import{t as s,withFileLockSync as v,writeFileAtomicSync as B}from"@dalcode/dal-pi-kit";import{CONFIG_DIR_NAME as M,getAgentDir as x}from"@earendil-works/pi-coding-agent";function p(e,r){return e==="user"?D(x(),"mcp.json"):D(r,M,"mcp.json")}i(p,"m"),c(p,"mcpConfigPath");function E(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}i(E,"u"),c(E,"isStringKeyedRecord");function l(e){return e.charCodeAt(0)===65279?e.slice(1):e}i(l,"x"),c(l,"stripBom");function m(e){if(!S(e))return{file:{},existed:!1};let r;try{r=JSON.parse(l(A(e,"utf8")))}catch(n){const u=n instanceof Error?n.message:String(n);throw new Error(`${e}: ${s("JSON \u89E3\u6790\u5931\u8D25\uFF0C\u62D2\u7EDD\u4FEE\u6539\u4EE5\u907F\u514D\u8986\u76D6\u73B0\u6709\u914D\u7F6E\u3002")}${u}`)}if(!E(r))throw new Error(`${e}: ${s("\u9876\u5C42\u4E0D\u662F JSON \u5BF9\u8C61\uFF0C\u62D2\u7EDD\u4FEE\u6539\u3002")}`);return{file:r,existed:!0}}i(m,"S"),c(m,"readConfigFile");function d(e,r){B(e,`${JSON.stringify(r,null,2)}
2
+ `)}i(d,"a"),c(d,"writeConfigFile");function h(e,r,n,u){const t=p(e,r);return v(t,()=>{const{file:o,existed:f}=m(t);o.mcpServers===void 0&&(o.mcpServers={});const a=o.mcpServers;if(!E(a))throw new Error(`${t}: ${s('"mcpServers" \u4E0D\u662F\u5BF9\u8C61\uFF0C\u62D2\u7EDD\u4FEE\u6539\u3002')}`);if(n in a)throw new Error(`${s("\u8BE5\u540D\u79F0\u5DF2\u5B58\u5728\u4E8E ")}${t}${s("\uFF1A")}${n}${s("\u3002\u5148 /mcp remove\uFF0C\u6216\u76F4\u63A5\u7F16\u8F91\u8BE5\u6587\u4EF6\u3002")}`);return a[n]=u,d(t,o),{path:t,created:!f}})}i(h,"j"),c(h,"addMcpServerEntry");function y(e,r,n){const u=p(e,r);return v(u,()=>{const{file:t}=m(u);t.mcpServers===void 0&&(t.mcpServers={});const o=t.mcpServers;if(!E(o))throw new Error(`${u}: ${s('"mcpServers" \u4E0D\u662F\u5BF9\u8C61\uFF0C\u62D2\u7EDD\u4FEE\u6539\u3002')}`);const f=[],a=[];for(const{name:F,config:$}of n){if(F in o){a.push(F);continue}o[F]=$,f.push(F)}return f.length>0&&d(u,t),{path:u,added:f,existing:a}})}i(y,"O"),c(y,"addMcpServerEntries");function C(e,r,n){const u=p(e,r);return v(u,()=>{if(!S(u))return{path:u,removed:!1};const{file:t}=m(u),o=t.mcpServers;return!E(o)||!(n in o)?{path:u,removed:!1}:(delete o[n],d(u,t),{path:u,removed:!0})})}i(C,"b"),c(C,"removeMcpServerEntry");export{y as addMcpServerEntries,h as addMcpServerEntry,p as mcpConfigPath,C as removeMcpServerEntry};
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dalcode/dal-office",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -17,7 +17,7 @@
17
17
  ]
18
18
  },
19
19
  "dependencies": {
20
- "@dalcode/dal-pi-kit": "1.0.36",
20
+ "@dalcode/dal-pi-kit": "1.0.38",
21
21
  "docx": "9.7.1",
22
22
  "echarts": "6.1.0",
23
23
  "exceljs": "4.4.0",