@wirecat/cli-template 0.13.2 → 0.14.0

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 (112) hide show
  1. package/.github/workflows/changelog-guard.yml +1 -1
  2. package/.github/workflows/ci.yml +1 -1
  3. package/.github/workflows/monthly.yml +1 -1
  4. package/.github/workflows/release.yml +1 -1
  5. package/CHANGELOG.md +25 -0
  6. package/config/parity-groups.json +32 -1
  7. package/contracts/mcp-tools.json +100 -0
  8. package/dist/bin/clidev.js +6 -2
  9. package/dist/bundle/{all-profiles-MJ6XSFOO.js → all-profiles-NVB2HT2S.js} +6 -6
  10. package/dist/bundle/{anthropic-W5UKBZUB.js → anthropic-ICTW7CNQ.js} +4 -4
  11. package/dist/bundle/{app-server-EZ46JAHB.js → app-server-B6BCKXR7.js} +40 -38
  12. package/dist/bundle/{bun-HB6O2TTT.js → bun-ILPS6AYA.js} +2 -2
  13. package/dist/bundle/{bun-sqlite-KBXOW2ES.js → bun-sqlite-JE6FJFQT.js} +3 -3
  14. package/dist/bundle/{chunk-KJTNT4SW.js → chunk-2DAXUNTS.js} +2 -2
  15. package/dist/bundle/chunk-3MDNAYQA.js +34 -0
  16. package/dist/bundle/chunk-3WDYHOAF.js +91 -0
  17. package/dist/bundle/{chunk-EGRB55FF.js → chunk-45244QQ6.js} +14 -12
  18. package/dist/bundle/{chunk-JHO2LL2J.js → chunk-4PA6DJ7F.js} +7 -7
  19. package/dist/bundle/{chunk-FZZIU4B7.js → chunk-5SAF3XOL.js} +8196 -5601
  20. package/dist/bundle/chunk-62JRF2JA.js +35 -0
  21. package/dist/bundle/{chunk-TGB5F7NC.js → chunk-66VMJGV6.js} +4 -4
  22. package/dist/bundle/{chunk-V3ZTQ24B.js → chunk-6AW4DDK4.js} +4 -4
  23. package/dist/bundle/{chunk-PJOVK7PG.js → chunk-7F5VMLVK.js} +49 -24
  24. package/dist/bundle/{chunk-MFS52LTZ.js → chunk-7Z4HR6GO.js} +1 -1
  25. package/dist/bundle/{chunk-E42W72PQ.js → chunk-AS2PJNQ2.js} +7 -5
  26. package/dist/bundle/{chunk-SVDF6NJF.js → chunk-ASHVHS52.js} +14 -14
  27. package/dist/bundle/{chunk-N2Z3MCOF.js → chunk-BEBD27QT.js} +37 -35
  28. package/dist/bundle/{chunk-IGHEW777.js → chunk-BM5ZCDPQ.js} +5 -40
  29. package/dist/bundle/{chunk-AK257OMS.js → chunk-BVLPNNEL.js} +209 -78
  30. package/dist/bundle/{chunk-ERKR3VJ5.js → chunk-BWBZCYUN.js} +141 -46
  31. package/dist/bundle/{chunk-Z7MSIRSQ.js → chunk-CGFQT3LQ.js} +1 -1
  32. package/dist/bundle/{chunk-QKWRL4OD.js → chunk-DQIBGCF3.js} +6 -6
  33. package/dist/bundle/{chunk-RUKDZEID.js → chunk-DZLHY4IA.js} +3 -3
  34. package/dist/bundle/{chunk-TAYOKLGF.js → chunk-EMHCXXNJ.js} +7 -6
  35. package/dist/bundle/{chunk-IBBN7Z3A.js → chunk-F34HGYWF.js} +12 -3
  36. package/dist/bundle/{chunk-ERGB4NJA.js → chunk-G45R7M42.js} +1 -1
  37. package/dist/bundle/{chunk-ZLY6GUAS.js → chunk-G7W53MQP.js} +3 -3
  38. package/dist/bundle/{chunk-JAOGZMKQ.js → chunk-GUFPQZUA.js} +2 -2
  39. package/dist/bundle/{chunk-4LURWBVV.js → chunk-HYTHTSJP.js} +188 -22
  40. package/dist/bundle/{chunk-EFHLQXG6.js → chunk-IOJ2DTCY.js} +162 -55
  41. package/dist/bundle/{chunk-L5WWMP5M.js → chunk-IZKXJJ7V.js} +121 -31
  42. package/dist/bundle/{chunk-NOVLCHDV.js → chunk-LATYBJ4T.js} +2 -2
  43. package/dist/bundle/{chunk-QBP7OMN5.js → chunk-LFLSV353.js} +2 -2
  44. package/dist/bundle/{chunk-HDY5X3WQ.js → chunk-LU4A2T7Y.js} +4 -4
  45. package/dist/bundle/{chunk-JRK73FOW.js → chunk-NENYWEXF.js} +1 -1
  46. package/dist/bundle/{chunk-2B5U4Z5H.js → chunk-NH6LZ3H3.js} +8 -13
  47. package/dist/bundle/{chunk-OV6PHTAY.js → chunk-NVNUUHT5.js} +17130 -2232
  48. package/dist/bundle/chunk-PIJUGF5F.js +392 -0
  49. package/dist/bundle/{chunk-7IXL4UFK.js → chunk-PX2KP4QE.js} +8 -8
  50. package/dist/bundle/{chunk-KRCCGWWS.js → chunk-QXOSPYM3.js} +1 -1
  51. package/dist/bundle/{chunk-PBN4RBHS.js → chunk-R2JKPHH5.js} +8 -8
  52. package/dist/bundle/{chunk-PDGXMKJS.js → chunk-R5RYPD23.js} +2 -2
  53. package/dist/bundle/{chunk-QJ6XW4DM.js → chunk-RJ7AS7UB.js} +6210 -1207
  54. package/dist/bundle/{chunk-35KYY65W.js → chunk-SOYOOU2D.js} +3 -3
  55. package/dist/bundle/{chunk-FDBINRWA.js → chunk-TJJ2XSJP.js} +5 -5
  56. package/dist/bundle/{chunk-O3UXNU3S.js → chunk-U6QD3J3F.js} +3 -3
  57. package/dist/bundle/{chunk-YJNUDHJD.js → chunk-UT5TQ6MD.js} +139 -35
  58. package/dist/bundle/{chunk-VYSUKHKL.js → chunk-VOTEB3AN.js} +1 -1
  59. package/dist/bundle/{chunk-IN3FVRPK.js → chunk-VS5LGSTM.js} +1 -1
  60. package/dist/bundle/{chunk-MJRSEUKG.js → chunk-VXOR76ZL.js} +13 -89
  61. package/dist/bundle/{chunk-CXQXVKUY.js → chunk-YIVY2WI3.js} +1 -1
  62. package/dist/bundle/{chunk-VLNKTMV7.js → chunk-YOJLIVGO.js} +959 -350
  63. package/dist/bundle/clidev.js +3 -3
  64. package/dist/bundle/command-contract-JMVMT5HT.js +28 -0
  65. package/dist/bundle/{decode-AMXUVKNY.js → decode-NXB5UKMO.js} +18 -16
  66. package/dist/bundle/{echarts-GJDMQ2AQ.js → echarts-DRDGGHJT.js} +2 -2
  67. package/dist/bundle/{embed-L4CRZ2XQ.js → embed-IKZ24BMC.js} +4 -4
  68. package/dist/bundle/{embedder-IBGV4M2K.js → embedder-GMQ24DOQ.js} +7 -7
  69. package/dist/bundle/{first-run-VTKC2IBV.js → first-run-MDD4SIUK.js} +8 -8
  70. package/dist/bundle/first-screen-376CXGXJ.js +26 -0
  71. package/dist/bundle/{instructions-YJECS4KN.js → instructions-EOQOXY6V.js} +1 -1
  72. package/dist/bundle/{mcp-OQBZXELQ.js → mcp-7HBLFGCW.js} +2 -2
  73. package/dist/bundle/mcp-KHUZOJO6.js +82 -0
  74. package/dist/bundle/{mcp-GBSAK3VW.js → mcp-MZHWJXAE.js} +38 -37
  75. package/dist/bundle/{node-NQG4EVZR.js → node-52WF2326.js} +2 -2
  76. package/dist/bundle/{node-sqlite-BR7F3BLB.js → node-sqlite-73Z4SFOA.js} +9 -3
  77. package/dist/bundle/{oauth-J7UAWNIK.js → oauth-EVTPAMZP.js} +5 -5
  78. package/dist/bundle/{open-BR47R5UE.js → open-46WZAPJ3.js} +3 -2
  79. package/dist/bundle/openai-GWRDAHDU.js +248 -0
  80. package/dist/bundle/{process-66I7RDPJ.js → process-YIQPKLZI.js} +1 -1
  81. package/dist/bundle/{program-EM4FKOCK.js → program-B3CY3FP7.js} +11346 -9559
  82. package/dist/bundle/{prompt-NE5JJ7UP.js → prompt-IVEYRLS5.js} +3 -3
  83. package/dist/bundle/{recognize-GC3YFVIA.js → recognize-WVEKHODM.js} +4 -2
  84. package/dist/bundle/{remote-QELOMKQM.js → remote-4K5VPMC7.js} +5 -5
  85. package/dist/bundle/{rerank-BH6TZ2SP.js → rerank-V24UJZYJ.js} +5 -5
  86. package/dist/bundle/{serve-WWLRNDT2.js → serve-PJWSOV7F.js} +7 -7
  87. package/dist/bundle/server-2ZN7KZHZ.js +40 -0
  88. package/dist/bundle/server-5VYM7CCF.js +53 -0
  89. package/dist/bundle/{state-2BEGXAMO.js → state-ZPYGECVP.js} +4 -4
  90. package/dist/bundle/{store-AH6WZMCF.js → store-6JQCLPQF.js} +14 -9
  91. package/dist/bundle/store-maintenance-command-7XICIYHW.js +42 -0
  92. package/dist/version.d.ts +1 -1
  93. package/dist/version.js +1 -1
  94. package/docs/commands.md +37 -11
  95. package/docs/dev/reference-clis.md +1 -1
  96. package/docs/dev/skills/design-interview/SKILL.md +2 -2
  97. package/docs/dev/test-matrix.md +5 -1
  98. package/kit/dist/interview.js +1 -0
  99. package/kit/dist/new.js +8 -3
  100. package/package.json +3 -3
  101. package/src/program.test.ts +56 -0
  102. package/src/version.ts +1 -1
  103. package/dist/bundle/chunk-IDWW4TU2.js +0 -18
  104. package/dist/bundle/chunk-MUSYGFCY.js +0 -3556
  105. package/dist/bundle/chunk-O5EHUB2V.js +0 -2
  106. package/dist/bundle/command-contract-75VJ36U4.js +0 -29
  107. package/dist/bundle/first-screen-X5IJKBSU.js +0 -27
  108. package/dist/bundle/mcp-RDZGYPSY.js +0 -78
  109. package/dist/bundle/server-DE6NLNUF.js +0 -52
  110. package/dist/bundle/server-ZPSQKOAH.js +0 -39
  111. package/dist/bundle/store-maintenance-command-PBXX3IEV.js +0 -40
  112. /package/dist/bundle/{chunk-GOO67PDU.js → chunk-NL2DQPT7.js} +0 -0
@@ -0,0 +1,35 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ resolvePaths
5
+ } from "./chunk-IOJ2DTCY.js";
6
+ import {
7
+ __name
8
+ } from "./chunk-ZVVMGPBJ.js";
9
+
10
+ // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/store/path.js
11
+ import { userInfo } from "node:os";
12
+ import { isAbsolute, join, relative, resolve } from "node:path";
13
+ var wirecatDirectory = /* @__PURE__ */ __name((env = process.env, platform) => resolvePaths({ appName: "WireCat", prefix: "WIRECAT", env, ...platform ? { platform } : {} }).state, "wirecatDirectory");
14
+ var storePath = /* @__PURE__ */ __name((env = process.env) => env.MESSAGING_STORE ?? join(wirecatDirectory(env), "wirecat.db"), "storePath");
15
+ var accountHome = /* @__PURE__ */ __name(() => {
16
+ try {
17
+ return userInfo().homedir;
18
+ } catch {
19
+ return void 0;
20
+ }
21
+ }, "accountHome");
22
+ var refuseOwnerStoreInTests = /* @__PURE__ */ __name((file, env = process.env, home = accountHome()) => {
23
+ if (!env.VITEST || !home || file === ":memory:")
24
+ return;
25
+ const inside = relative(wirecatDirectory({ HOME: home, USERPROFILE: home }), resolve(file));
26
+ if (inside.startsWith("..") || isAbsolute(inside))
27
+ return;
28
+ throw new Error(`a test tried to open ${file}, in the owner's real WireCat folder; give it a MESSAGING_STORE or HOME of its own`);
29
+ }, "refuseOwnerStoreInTests");
30
+
31
+ export {
32
+ wirecatDirectory,
33
+ storePath,
34
+ refuseOwnerStoreInTests
35
+ };
@@ -8,12 +8,12 @@ import {
8
8
  ACCESS_SECONDS,
9
9
  REFRESH_SECONDS,
10
10
  readStored
11
- } from "./chunk-V3ZTQ24B.js";
11
+ } from "./chunk-6AW4DDK4.js";
12
12
  import {
13
13
  __name
14
14
  } from "./chunk-ZVVMGPBJ.js";
15
15
 
16
- // node_modules/.pnpm/@wirecat+cli-core@0.495.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_24cca5e5c8b0984f2f26e7d1ba6b6d47/node_modules/@wirecat/cli-core/dist/mcp/http/oauth.js
16
+ // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/mcp/http/oauth.js
17
17
  import { createHash, randomBytes, randomInt, timingSafeEqual } from "node:crypto";
18
18
  import { chmodSync, mkdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
19
19
  import { dirname } from "node:path";
@@ -57,7 +57,7 @@ var redirectAllowed = /* @__PURE__ */ __name((uri) => {
57
57
  return false;
58
58
  }
59
59
  }, "redirectAllowed");
60
- var ownerLogin = /* @__PURE__ */ __name(({ issuer, resource, file, appName, onCode, now = /* @__PURE__ */ __name(() => Date.now(), "now") }) => {
60
+ var ownerLogin = /* @__PURE__ */ __name(({ issuer, resource, file, appName, reaches = `your ${appName} data`, onCode, now = /* @__PURE__ */ __name(() => Date.now(), "now") }) => {
61
61
  const store = tokenFile(file);
62
62
  const codes = /* @__PURE__ */ new Map();
63
63
  let login = { value: "", expires: 0 };
@@ -153,7 +153,7 @@ var ownerLogin = /* @__PURE__ */ __name(({ issuer, resource, file, appName, onCo
153
153
  const hidden = ["response_type", "client_id", "redirect_uri", "code_challenge", "code_challenge_method", "state"].map((name) => `<input type="hidden" name="${name}" value="${escapeHtml(params.get(name) ?? "")}">`).join("");
154
154
  const who = escapeHtml(client.name ?? "an application");
155
155
  const target = new URL(params.get("redirect_uri") ?? "");
156
- const html = `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${escapeHtml(appName)} login</title><style>body{font:16px system-ui,sans-serif;max-width:28rem;margin:3rem auto;padding:0 1rem;color:#1d2430}input[type=text]{font:20px ui-monospace,monospace;letter-spacing:.1em;width:100%;padding:.5rem;margin:.5rem 0 1rem;box-sizing:border-box}button{font:inherit;padding:.5rem 1rem}.error{color:#b42318}</style></head><body><h1>${escapeHtml(appName)}</h1><p>An app that calls itself <strong>${who}</strong> asks to reach your messages through <code>${escapeHtml(appName)} mcp --http</code>.</p><p>After you allow it, the login goes to <strong>${escapeHtml(target.host)}</strong>. Allow only if that is the app you are connecting, such as chatgpt.com or claude.ai.</p><p>Type the code shown in WireCat Desktop, or in the terminal where the server runs. If you did not start this login, close this page.</p>${message ? `<p class="error">${escapeHtml(message)}</p>` : ""}<form method="post" action="${escapeHtml(`${base}/authorize`)}">${hidden}<label>Login code<input type="text" name="login_code" autocomplete="off" autofocus required></label><button type="submit">Allow</button></form></body></html>`;
156
+ const html = `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${escapeHtml(appName)} login</title><style>body{font:16px system-ui,sans-serif;max-width:28rem;margin:3rem auto;padding:0 1rem;color:#1d2430}input[type=text]{font:20px ui-monospace,monospace;letter-spacing:.1em;width:100%;padding:.5rem;margin:.5rem 0 1rem;box-sizing:border-box}button{font:inherit;padding:.5rem 1rem}.error{color:#b42318}</style></head><body><h1>${escapeHtml(appName)}</h1><p>An app that calls itself <strong>${who}</strong> asks to reach ${escapeHtml(reaches)} through <code>${escapeHtml(appName)} mcp serve --http</code>.</p><p>After you allow it, the login goes to <strong>${escapeHtml(target.host)}</strong>. Allow only if that is the app you are connecting, such as chatgpt.com or claude.ai.</p><p>Type the code shown in WireCat Desktop, or in the terminal where the server runs. If you did not start this login, close this page.</p>${message ? `<p class="error">${escapeHtml(message)}</p>` : ""}<form method="post" action="${escapeHtml(`${base}/authorize`)}">${hidden}<label>Login code<input type="text" name="login_code" autocomplete="off" autofocus required></label><button type="submit">Allow</button></form></body></html>`;
157
157
  return new Response(html, {
158
158
  status: message ? 400 : 200,
159
159
  headers: {
@@ -5,15 +5,15 @@ import {
5
5
  readLock,
6
6
  releaseLock,
7
7
  takeLock
8
- } from "./chunk-RUKDZEID.js";
8
+ } from "./chunk-DZLHY4IA.js";
9
9
  import {
10
10
  __name
11
11
  } from "./chunk-ZVVMGPBJ.js";
12
12
 
13
- // node_modules/.pnpm/@wirecat+cli-core@0.495.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_24cca5e5c8b0984f2f26e7d1ba6b6d47/node_modules/@wirecat/cli-core/dist/mcp/http/state.js
13
+ // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/mcp/http/state.js
14
14
  import { existsSync as existsSync2, readFileSync as readFileSync2 } from "node:fs";
15
15
 
16
- // node_modules/.pnpm/@wirecat+cli-core@0.495.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_24cca5e5c8b0984f2f26e7d1ba6b6d47/node_modules/@wirecat/cli-core/dist/mcp/http/activity.js
16
+ // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/mcp/http/activity.js
17
17
  import { randomBytes } from "node:crypto";
18
18
  import { chmodSync, existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
19
19
  import { dirname } from "node:path";
@@ -86,7 +86,7 @@ var activityRecorder = /* @__PURE__ */ __name((path, now = Date.now) => {
86
86
  };
87
87
  }, "activityRecorder");
88
88
 
89
- // node_modules/.pnpm/@wirecat+cli-core@0.495.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_24cca5e5c8b0984f2f26e7d1ba6b6d47/node_modules/@wirecat/cli-core/dist/mcp/http/state.js
89
+ // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/mcp/http/state.js
90
90
  var ACCESS_SECONDS = 60 * 60;
91
91
  var REFRESH_SECONDS = 30 * 24 * 60 * 60;
92
92
  var readStored = /* @__PURE__ */ __name((path) => existsSync2(path) ? JSON.parse(readFileSync2(path, "utf8")) : { clients: [], tokens: [] }, "readStored");
@@ -2,7 +2,7 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  CliError
5
- } from "./chunk-EFHLQXG6.js";
5
+ } from "./chunk-IOJ2DTCY.js";
6
6
  import {
7
7
  importFrom
8
8
  } from "./chunk-Y5E2WNWB.js";
@@ -10,10 +10,10 @@ import {
10
10
  __name
11
11
  } from "./chunk-ZVVMGPBJ.js";
12
12
 
13
- // node_modules/.pnpm/@wirecat+cli-core@0.495.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_24cca5e5c8b0984f2f26e7d1ba6b6d47/node_modules/@wirecat/cli-core/dist/speech/recognize.js
13
+ // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/speech/recognize.js
14
14
  import { createRequire } from "node:module";
15
15
 
16
- // node_modules/.pnpm/@wirecat+cli-core@0.495.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_24cca5e5c8b0984f2f26e7d1ba6b6d47/node_modules/@wirecat/cli-core/dist/speech/ogg-limit.js
16
+ // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/speech/ogg-limit.js
17
17
  var invalid = /* @__PURE__ */ __name(() => new CliError("validation_error", "local transcription needs a complete mono or stereo Ogg Opus recording"), "invalid");
18
18
  var checkOggDuration = /* @__PURE__ */ __name((bytes) => {
19
19
  const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
@@ -70,7 +70,7 @@ var checkOggDuration = /* @__PURE__ */ __name((bytes) => {
70
70
  throw invalid();
71
71
  }, "checkOggDuration");
72
72
 
73
- // node_modules/.pnpm/@wirecat+cli-core@0.495.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_24cca5e5c8b0984f2f26e7d1ba6b6d47/node_modules/@wirecat/cli-core/dist/speech/recognize.js
73
+ // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/speech/recognize.js
74
74
  var SAMPLE_RATE = 16e3;
75
75
  var LEAD = SAMPLE_RATE / 2;
76
76
  var toModelRate = /* @__PURE__ */ __name((samples, rate) => {
@@ -94,10 +94,9 @@ var decodeOgg = /* @__PURE__ */ __name(async (bytes) => {
94
94
  await decoder.ready;
95
95
  try {
96
96
  const { channelData, sampleRate, samplesDecoded } = await decoder.decodeFile(bytes);
97
- const samples = channelData[0];
98
- if (!samples || samplesDecoded === 0)
97
+ if (!channelData[0] || samplesDecoded === 0)
99
98
  throw new Error("no Ogg Opus audio in it");
100
- return { samples, rate: sampleRate };
99
+ return channelData.map((samples) => ({ samples, rate: sampleRate }));
101
100
  } finally {
102
101
  decoder.free();
103
102
  }
@@ -120,6 +119,37 @@ var detector = /* @__PURE__ */ __name((vadModel) => ({
120
119
  debug: 0,
121
120
  bufferSizeInSeconds: 30
122
121
  }), "detector");
122
+ var cut = /* @__PURE__ */ __name((vad, pcm, each) => {
123
+ vad.reset();
124
+ const last = Math.max(0, pcm.length - LEAD);
125
+ const drain = /* @__PURE__ */ __name(() => {
126
+ for (; !vad.isEmpty(); vad.pop()) {
127
+ const { start, samples } = vad.front();
128
+ each({
129
+ start: Math.min(last, Math.max(0, start - LEAD)) / SAMPLE_RATE,
130
+ end: Math.min(last, Math.max(0, start + samples.length - LEAD)) / SAMPLE_RATE,
131
+ samples
132
+ });
133
+ }
134
+ }, "drain");
135
+ for (let i = 0; i + WINDOW <= pcm.length; i += WINDOW) {
136
+ vad.acceptWaveform(pcm.subarray(i, i + WINDOW));
137
+ drain();
138
+ }
139
+ vad.flush();
140
+ drain();
141
+ }, "cut");
142
+ var openSpeechCutter = /* @__PURE__ */ __name((vadModel) => {
143
+ const vad = loadSherpa().createVad(detector(vadModel));
144
+ return {
145
+ cut: /* @__PURE__ */ __name((pcm) => {
146
+ const spans = [];
147
+ cut(vad, pcm, ({ start, end }) => spans.push({ start, end }));
148
+ return spans;
149
+ }, "cut"),
150
+ free: /* @__PURE__ */ __name(() => vad.free(), "free")
151
+ };
152
+ }, "openSpeechCutter");
123
153
  var loaded;
124
154
  var loadSherpa = /* @__PURE__ */ __name(() => {
125
155
  if (loaded)
@@ -156,24 +186,18 @@ var openRecognizer = /* @__PURE__ */ __name((model, path, vadModel) => {
156
186
  stream.free();
157
187
  }
158
188
  }, "piece");
189
+ const pieces = /* @__PURE__ */ __name((pcm) => {
190
+ const heard = [];
191
+ cut(vad, pcm, ({ start, end, samples }) => {
192
+ const text = piece(samples);
193
+ if (text)
194
+ heard.push({ start, end, text });
195
+ });
196
+ return heard;
197
+ }, "pieces");
159
198
  return {
160
- recognize: /* @__PURE__ */ __name((pcm) => {
161
- vad.reset();
162
- const parts = [];
163
- const drain = /* @__PURE__ */ __name(() => {
164
- while (!vad.isEmpty()) {
165
- parts.push(piece(vad.front().samples));
166
- vad.pop();
167
- }
168
- }, "drain");
169
- for (let i = 0; i + WINDOW <= pcm.length; i += WINDOW) {
170
- vad.acceptWaveform(pcm.subarray(i, i + WINDOW));
171
- drain();
172
- }
173
- vad.flush();
174
- drain();
175
- return parts.filter(Boolean).join(" ");
176
- }, "recognize"),
199
+ recognize: /* @__PURE__ */ __name((pcm) => pieces(pcm).map(({ text }) => text).join(" "), "recognize"),
200
+ pieces,
177
201
  free: /* @__PURE__ */ __name(() => {
178
202
  vad.free();
179
203
  engine.free();
@@ -186,6 +210,7 @@ export {
186
210
  toModelRate,
187
211
  decodeOgg,
188
212
  detector,
213
+ openSpeechCutter,
189
214
  loadSherpa,
190
215
  openRecognizer
191
216
  };
@@ -527,7 +527,7 @@ var require_cross_spawn = __commonJS({
527
527
  }
528
528
  });
529
529
 
530
- // node_modules/.pnpm/@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/executable.js
530
+ // node_modules/.pnpm/@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/executable.js
531
531
  import { existsSync } from "node:fs";
532
532
  import { win32 } from "node:path";
533
533
  var variable = /* @__PURE__ */ __name((env, name) => Object.entries(env).find(([key]) => key.toUpperCase() === name)?.[1], "variable");
@@ -4,7 +4,7 @@ import {
4
4
  executableEnvironment,
5
5
  executableOnPath,
6
6
  require_cross_spawn
7
- } from "./chunk-MFS52LTZ.js";
7
+ } from "./chunk-7Z4HR6GO.js";
8
8
  import {
9
9
  loadConfigFile,
10
10
  number,
@@ -12,15 +12,13 @@ import {
12
12
  optional,
13
13
  saveConfigFile,
14
14
  string
15
- } from "./chunk-EFHLQXG6.js";
15
+ } from "./chunk-IOJ2DTCY.js";
16
16
  import {
17
17
  __name,
18
18
  __toESM
19
19
  } from "./chunk-ZVVMGPBJ.js";
20
20
 
21
- // node_modules/.pnpm/@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/update/index.js
22
- var import_cross_spawn = __toESM(require_cross_spawn(), 1);
23
- import { existsSync } from "node:fs";
21
+ // node_modules/.pnpm/@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/installer.js
24
22
  var installerOf = /* @__PURE__ */ __name((scriptPath) => {
25
23
  const path = scriptPath.replaceAll("\\", "/");
26
24
  if (path.includes("/_npx/"))
@@ -33,6 +31,10 @@ var installerOf = /* @__PURE__ */ __name((scriptPath) => {
33
31
  return "npm";
34
32
  return path.includes("/dist/") ? "checkout" : "unknown";
35
33
  }, "installerOf");
34
+
35
+ // node_modules/.pnpm/@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/update/index.js
36
+ var import_cross_spawn = __toESM(require_cross_spawn(), 1);
37
+ import { existsSync } from "node:fs";
36
38
  var updateCommand = /* @__PURE__ */ __name((installer, packageName) => {
37
39
  const target = `${packageName}@latest`;
38
40
  switch (installer) {
@@ -3,28 +3,28 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  installerOf,
5
5
  updateCommand
6
- } from "./chunk-E42W72PQ.js";
7
- import {
8
- DEFAULT_STEMMERS,
9
- LANGUAGES
10
- } from "./chunk-PBN4RBHS.js";
6
+ } from "./chunk-AS2PJNQ2.js";
11
7
  import {
12
8
  QUESTIONS,
13
9
  readSetupAnswers,
14
10
  unanswered,
15
11
  writeSetupAnswers
16
- } from "./chunk-O3UXNU3S.js";
12
+ } from "./chunk-U6QD3J3F.js";
13
+ import {
14
+ DEFAULT_STEMMERS,
15
+ LANGUAGES
16
+ } from "./chunk-R2JKPHH5.js";
17
17
  import {
18
18
  sharedConfigPath
19
- } from "./chunk-FDBINRWA.js";
19
+ } from "./chunk-TJJ2XSJP.js";
20
20
  import {
21
21
  storePath
22
- } from "./chunk-IDWW4TU2.js";
22
+ } from "./chunk-62JRF2JA.js";
23
23
  import {
24
24
  __name
25
25
  } from "./chunk-ZVVMGPBJ.js";
26
26
 
27
- // node_modules/.pnpm/@wirecat+cli-core@0.495.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_24cca5e5c8b0984f2f26e7d1ba6b6d47/node_modules/@wirecat/cli-core/dist/cli/first-run.js
27
+ // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/cli/first-run.js
28
28
  import { spawnSync } from "node:child_process";
29
29
  import { accessSync, constants, realpathSync } from "node:fs";
30
30
  import { delimiter, join } from "node:path";
@@ -82,7 +82,7 @@ var suggested = /* @__PURE__ */ __name((env, contentLanguages) => {
82
82
  return (own.length ? own : LANGUAGES.filter(({ code }) => code === "en" || code === system)).map(({ name }) => name);
83
83
  }, "suggested");
84
84
  var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLanguages }) => {
85
- const { openStore } = await import("./store-AH6WZMCF.js");
85
+ const { openStore } = await import("./store-6JQCLPQF.js");
86
86
  const store = await openStore({ env });
87
87
  let rebuild = false;
88
88
  try {
@@ -111,8 +111,8 @@ var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLang
111
111
  if (!rebuild)
112
112
  return;
113
113
  const [{ openCache }, { buildStems }] = await Promise.all([
114
- import("./open-BR47R5UE.js"),
115
- import("./store-maintenance-command-PBXX3IEV.js")
114
+ import("./open-46WZAPJ3.js"),
115
+ import("./store-maintenance-command-7XICIYHW.js")
116
116
  ]);
117
117
  const database = await openCache(storePath(env));
118
118
  try {
@@ -124,7 +124,7 @@ var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLang
124
124
  var askTools = /* @__PURE__ */ __name(async (run) => {
125
125
  const { command, env, io } = run;
126
126
  const installed = run.installed ?? ((name) => onPath(name, env));
127
- const { WIRECAT_TOOLS } = await import("./first-screen-X5IJKBSU.js");
127
+ const { WIRECAT_TOOLS } = await import("./first-screen-376CXGXJ.js");
128
128
  const others = WIRECAT_TOOLS.filter((tool) => tool.command !== command);
129
129
  const missing = others.filter((tool) => !installed(tool.command));
130
130
  io.say("Other WireCat tools \u2014 they share this store, so one search finds everything:");
@@ -197,7 +197,7 @@ var setupAtStart = /* @__PURE__ */ __name(async (start) => {
197
197
  contentLanguages: start.contentLanguages,
198
198
  all: start.path[0] === "setup",
199
199
  io: {
200
- ask: /* @__PURE__ */ __name(async (prompt) => (await import("./prompt-NE5JJ7UP.js")).readSecret(prompt, { input, echo: true }), "ask"),
200
+ ask: /* @__PURE__ */ __name(async (prompt) => (await import("./prompt-IVEYRLS5.js")).readSecret(prompt, { input, echo: true }), "ask"),
201
201
  say: /* @__PURE__ */ __name((text) => process.stderr.write(`${text}
202
202
  `), "say")
203
203
  }
@@ -12,13 +12,13 @@ import {
12
12
  registerPrompts,
13
13
  stdinFieldOf,
14
14
  syncsFirst
15
- } from "./chunk-ERKR3VJ5.js";
15
+ } from "./chunk-BWBZCYUN.js";
16
16
  import {
17
17
  mcpUrlOf
18
- } from "./chunk-JAOGZMKQ.js";
18
+ } from "./chunk-GUFPQZUA.js";
19
19
  import {
20
20
  answeredWire
21
- } from "./chunk-IN3FVRPK.js";
21
+ } from "./chunk-VS5LGSTM.js";
22
22
  import {
23
23
  BinaryResource,
24
24
  Picture,
@@ -39,20 +39,21 @@ import {
39
39
  tool,
40
40
  toolKey,
41
41
  toolsFromCommands
42
- } from "./chunk-YJNUDHJD.js";
42
+ } from "./chunk-UT5TQ6MD.js";
43
43
  import {
44
44
  agentJson,
45
45
  skillResource
46
- } from "./chunk-4LURWBVV.js";
46
+ } from "./chunk-HYTHTSJP.js";
47
47
  import {
48
48
  StdioServerTransport,
49
49
  callerOf,
50
+ callingAgent,
50
51
  serveStdio
51
- } from "./chunk-IBBN7Z3A.js";
52
+ } from "./chunk-F34HGYWF.js";
52
53
  import {
53
54
  connectedFor,
54
55
  guardFor
55
- } from "./chunk-L5WWMP5M.js";
56
+ } from "./chunk-IZKXJJ7V.js";
56
57
  import {
57
58
  capability,
58
59
  dateWindow,
@@ -61,51 +62,51 @@ import {
61
62
  servicesFor,
62
63
  storedDeps,
63
64
  wholeList
64
- } from "./chunk-FZZIU4B7.js";
65
+ } from "./chunk-5SAF3XOL.js";
65
66
  import {
66
67
  instructions
67
- } from "./chunk-ERGB4NJA.js";
68
+ } from "./chunk-G45R7M42.js";
68
69
  import {
69
70
  McpServer,
70
71
  ResourceTemplate
71
72
  } from "./chunk-5D4AEUVA.js";
72
73
  import {
73
74
  mcpHttpMarker
74
- } from "./chunk-V3ZTQ24B.js";
75
- import {
76
- openStore,
77
- pdfPreviewLimits
78
- } from "./chunk-OV6PHTAY.js";
75
+ } from "./chunk-6AW4DDK4.js";
79
76
  import {
80
77
  findCommand
81
- } from "./chunk-IGHEW777.js";
78
+ } from "./chunk-BM5ZCDPQ.js";
82
79
  import {
83
80
  DEFAULT_OUTPUT_BYTES,
84
81
  changesAuthorityAt,
85
82
  describeProgram,
86
83
  environmentOf,
87
- fetchesOnlyAt,
88
84
  itemOf,
89
85
  judgedTargets,
90
86
  levelFor,
91
87
  readKeysForCommand,
92
88
  readOnlyLockOf,
89
+ readsOverMcpAt,
93
90
  recalledAccount,
94
91
  rootOf2 as rootOf,
95
92
  sealed,
96
93
  snakeKeys,
97
94
  typedCommand
98
- } from "./chunk-QJ6XW4DM.js";
95
+ } from "./chunk-RJ7AS7UB.js";
99
96
  import {
100
97
  isCliFailure,
101
98
  withCaller
102
- } from "./chunk-MJRSEUKG.js";
99
+ } from "./chunk-VXOR76ZL.js";
100
+ import {
101
+ openStore,
102
+ pdfPreviewLimits
103
+ } from "./chunk-NVNUUHT5.js";
103
104
  import {
104
105
  timezoneOf
105
- } from "./chunk-VLNKTMV7.js";
106
+ } from "./chunk-YOJLIVGO.js";
106
107
  import {
107
108
  warmEmbedders
108
- } from "./chunk-QKWRL4OD.js";
109
+ } from "./chunk-DQIBGCF3.js";
109
110
  import {
110
111
  CliError,
111
112
  description,
@@ -123,15 +124,15 @@ import {
123
124
  strictObject,
124
125
  string,
125
126
  visibleControls
126
- } from "./chunk-EFHLQXG6.js";
127
+ } from "./chunk-IOJ2DTCY.js";
127
128
  import {
128
129
  __name
129
130
  } from "./chunk-ZVVMGPBJ.js";
130
131
 
131
- // node_modules/.pnpm/@wirecat+cli-core@0.495.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_24cca5e5c8b0984f2f26e7d1ba6b6d47/node_modules/@wirecat/cli-core/dist/mcp/server.js
132
+ // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/mcp/server.js
132
133
  import { randomUUID } from "node:crypto";
133
134
 
134
- // node_modules/.pnpm/@wirecat+cli-core@0.495.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_24cca5e5c8b0984f2f26e7d1ba6b6d47/node_modules/@wirecat/cli-core/dist/mcp/agent-log.js
135
+ // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/mcp/agent-log.js
135
136
  var agentLog = /* @__PURE__ */ __name((open) => {
136
137
  let held;
137
138
  return {
@@ -150,7 +151,7 @@ var agentLog = /* @__PURE__ */ __name((open) => {
150
151
  };
151
152
  }, "agentLog");
152
153
 
153
- // node_modules/.pnpm/@wirecat+cli-core@0.495.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_24cca5e5c8b0984f2f26e7d1ba6b6d47/node_modules/@wirecat/cli-core/dist/mcp/resources.js
154
+ // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/mcp/resources.js
154
155
  var LISTED = 100;
155
156
  var registerResources = /* @__PURE__ */ __name((server, session, { command, name, limit, recorded, withStore, messenger, guard, assertRead }) => {
156
157
  server.registerResource("chat", new ResourceTemplate(`${command}://chat/{id}`, {
@@ -188,7 +189,7 @@ var registerResources = /* @__PURE__ */ __name((server, session, { command, name
188
189
  });
189
190
  }, "registerResources");
190
191
 
191
- // node_modules/.pnpm/@wirecat+cli-core@0.495.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_24cca5e5c8b0984f2f26e7d1ba6b6d47/node_modules/@wirecat/cli-core/dist/mcp/session.js
192
+ // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/mcp/session.js
192
193
  var HARMLESS = /* @__PURE__ */ new Set(["validation_error", "not_found", "permission_error", "confirmation_required", "rate_limited"]);
193
194
  var harmless = /* @__PURE__ */ __name((code) => HARMLESS.has(code), "harmless");
194
195
  var MessengerSession = class {
@@ -263,7 +264,7 @@ var MessengerSession = class {
263
264
  }
264
265
  };
265
266
 
266
- // node_modules/.pnpm/@wirecat+cli-core@0.495.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_24cca5e5c8b0984f2f26e7d1ba6b6d47/node_modules/@wirecat/cli-core/dist/mcp/tools/attachments.js
267
+ // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/mcp/tools/attachments.js
267
268
  var attachmentsTools = /* @__PURE__ */ __name((messenger) => {
268
269
  const _command = messenger.app.command;
269
270
  return {
@@ -317,7 +318,7 @@ var attachmentsTools = /* @__PURE__ */ __name((messenger) => {
317
318
  };
318
319
  }, "attachmentsTools");
319
320
 
320
- // node_modules/.pnpm/@wirecat+cli-core@0.495.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_24cca5e5c8b0984f2f26e7d1ba6b6d47/node_modules/@wirecat/cli-core/dist/mcp/tools/messages-photo.js
321
+ // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/mcp/tools/messages-photo.js
321
322
  var PHOTO_LIMIT = 512 * 1024;
322
323
  var IMAGE_TYPES = [
323
324
  ["image/jpeg", (b) => b[0] === 255 && b[1] === 216 && b[2] === 255],
@@ -371,7 +372,7 @@ var readUpTo = /* @__PURE__ */ __name(async (file, limit, saveIt) => {
371
372
  return new Uint8Array(Buffer.concat(chunks));
372
373
  }, "readUpTo");
373
374
 
374
- // node_modules/.pnpm/@wirecat+cli-core@0.495.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_24cca5e5c8b0984f2f26e7d1ba6b6d47/node_modules/@wirecat/cli-core/dist/mcp/tools/stats.js
375
+ // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/mcp/tools/stats.js
375
376
  var statsTools = /* @__PURE__ */ __name((messenger) => ({
376
377
  stats_charts: tool({
377
378
  title: "A chart from a chat's statistics",
@@ -408,14 +409,14 @@ var statsTools = /* @__PURE__ */ __name((messenger) => ({
408
409
  })
409
410
  }), "statsTools");
410
411
 
411
- // node_modules/.pnpm/@wirecat+cli-core@0.495.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_24cca5e5c8b0984f2f26e7d1ba6b6d47/node_modules/@wirecat/cli-core/dist/mcp/tools.js
412
+ // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/mcp/tools.js
412
413
  var pictureTools = /* @__PURE__ */ __name((messenger) => Object.fromEntries(Object.entries({
413
414
  ...messagesPhotoTools(messenger),
414
415
  ...attachmentsTools(messenger),
415
416
  ...statsTools(messenger)
416
417
  }).map(([name, definition]) => [name, { ...definition, input: strictObject(definition.input.entries) }])), "pictureTools");
417
418
 
418
- // node_modules/.pnpm/@wirecat+cli-core@0.495.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_24cca5e5c8b0984f2f26e7d1ba6b6d47/node_modules/@wirecat/cli-core/dist/mcp/server.js
419
+ // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/mcp/server.js
419
420
  var PER_RUN = /* @__PURE__ */ new Set([
420
421
  "streams",
421
422
  "stdin",
@@ -485,7 +486,7 @@ var createServer = /* @__PURE__ */ __name((command, context, messenger, sessionO
485
486
  readOnly: readOnlyLockOf(app, context.env) !== void 0,
486
487
  keyOf,
487
488
  authority,
488
- fetchOnly: fetchesOnlyAt(root),
489
+ fetchOnly: readsOverMcpAt(root),
489
490
  offline: true,
490
491
  stdin
491
492
  }).map((one) => "sync_first" in one.input.entries && !syncAllowed(one.path) ? {
@@ -533,10 +534,10 @@ var createServer = /* @__PURE__ */ __name((command, context, messenger, sessionO
533
534
  });
534
535
  const skill = messenger.skill ? skillResource(app, messenger.skill) : void 0;
535
536
  const log = agentLog(() => openStore({ env: context.env, command: app.command, version: app.version }));
536
- const audit = /* @__PURE__ */ __name(async (call) => {
537
+ const audit = /* @__PURE__ */ __name(async (call, caller) => {
537
538
  if (!recalledAccount(app, provider, settings.profile, context.env))
538
539
  return;
539
- await log.record({ actor: { bot: `${app.command}-mcp` }, ...call });
540
+ await log.record({ actor: { bot: callingAgent(`${app.command}-mcp`, caller) }, ...call });
540
541
  }, "audit");
541
542
  const targets = judgedTargets(root);
542
543
  const passed = Object.fromEntries(Object.entries(environment).filter(([key]) => !PER_RUN.has(key)));
@@ -608,7 +609,7 @@ var createServer = /* @__PURE__ */ __name((command, context, messenger, sessionO
608
609
  ...outcomeOf(result),
609
610
  startedAt,
610
611
  finishedAt: Date.now()
611
- }).catch(() => void 0);
612
+ }, caller).catch(() => void 0);
612
613
  return result;
613
614
  }, "run")
614
615
  }), "asCommand");
@@ -739,12 +740,13 @@ var serveOverStdio = /* @__PURE__ */ __name(async (command, context, messenger,
739
740
  }, "serveOverStdio");
740
741
  var serveOverHttpUntilStopped = /* @__PURE__ */ __name(async (command, context, messenger, options, http) => {
741
742
  const { session, embedders, build, log } = createServer(command, context, messenger, options);
742
- const { serveOverHttp } = await import("./serve-WWLRNDT2.js");
743
+ const { serveOverHttp } = await import("./serve-PJWSOV7F.js");
743
744
  const appName = messenger.app.command;
744
745
  const appEnvPrefix = messenger.app.envPrefix;
745
746
  const listening = await serveOverHttp(build, {
746
747
  ...http,
747
748
  appName,
749
+ reaches: "your messages",
748
750
  // In the background its log is a file; the code goes only to the lock that `mcp server status` reads.
749
751
  onCode: /* @__PURE__ */ __name((code, expires) => context.renderer.note(context.env[mcpHttpMarker(appEnvPrefix)] === void 0 ? `login code for a new browser app: ${code} (until ${expires.toTimeString().slice(0, 5)}; a new one after each login)` : `a new login code for a browser app: \`${appName} ${context.settings.profile} mcp server status\``), "onCode"),
750
752
  onError: /* @__PURE__ */ __name((error) => context.renderer.note(`mcp: ${error.message}`), "onError")
@@ -1,54 +1,22 @@
1
1
  import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
- ENTITIES
5
- } from "./chunk-MUSYGFCY.js";
6
- import {
7
- annotate,
4
+ answerEntitySchema,
5
+ answerProjectionSchema,
8
6
  answerSchema,
9
7
  describeOptions,
10
8
  keyForCommand,
11
9
  metaOf
12
- } from "./chunk-QJ6XW4DM.js";
10
+ } from "./chunk-RJ7AS7UB.js";
13
11
  import {
14
12
  CliError,
15
13
  jsonSchemaOf
16
- } from "./chunk-EFHLQXG6.js";
14
+ } from "./chunk-IOJ2DTCY.js";
17
15
  import {
18
16
  __name
19
17
  } from "./chunk-ZVVMGPBJ.js";
20
18
 
21
- // node_modules/.pnpm/@wirecat+cli-core@0.495.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_24cca5e5c8b0984f2f26e7d1ba6b6d47/node_modules/@wirecat/cli-core/dist/cli/answer-entity.js
22
- var schemas = /* @__PURE__ */ new WeakMap();
23
- var answerEntity = /* @__PURE__ */ __name((command, name, schema, options = {}) => {
24
- if (Object.hasOwn(ENTITIES, name))
25
- throw new Error(`${name} is a shared entity; use its existing schema`);
26
- if (!/^[a-z][a-z0-9_]*$/.test(name))
27
- throw new Error("an answer entity needs a lowercase name");
28
- if (!("entries" in schema) && schema.type !== "union")
29
- throw new Error("an answer entity needs an object schema or a union of object schemas");
30
- if (options.project && !("entries" in options.project) && options.project.type !== "union")
31
- throw new Error("projection needs an object schema or a union of object schemas");
32
- schemas.set(command, { name, schema, ...options });
33
- return annotate(command, { output: { entity: name } });
34
- }, "answerEntity");
35
- var answerEntitySchema = /* @__PURE__ */ __name((command) => {
36
- const output = command && metaOf(command).output;
37
- if (!output)
38
- return void 0;
39
- const name = output.view ? `${output.entity}.${output.view}` : output.entity;
40
- const shared = ENTITIES[name];
41
- if (shared)
42
- return shared;
43
- const own = schemas.get(command);
44
- return own?.name === name ? own.schema : void 0;
45
- }, "answerEntitySchema");
46
- var answerProjectionSchema = /* @__PURE__ */ __name((command) => {
47
- const own = command && schemas.get(command);
48
- return own && metaOf(command).output?.entity === own.name ? own.project : void 0;
49
- }, "answerProjectionSchema");
50
-
51
- // node_modules/.pnpm/@wirecat+cli-core@0.495.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_24cca5e5c8b0984f2f26e7d1ba6b6d47/node_modules/@wirecat/cli-core/dist/cli/command-contract.js
19
+ // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/cli/command-contract.js
52
20
  var SCHEMA_DIALECT = "https://json-schema.org/draft/2020-12/schema";
53
21
  var outputOf = /* @__PURE__ */ __name((command) => {
54
22
  const entity = answerEntitySchema(command);
@@ -153,9 +121,6 @@ var commandContract = /* @__PURE__ */ __name((command) => {
153
121
  }, "commandContract");
154
122
 
155
123
  export {
156
- answerEntity,
157
- answerEntitySchema,
158
- answerProjectionSchema,
159
124
  SCHEMA_DIALECT,
160
125
  outputOf,
161
126
  commandPathOf,