@wirecat/mail-cli 0.33.0 → 0.35.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 (153) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +4 -1
  3. package/contracts/wirecat.json +54 -4
  4. package/dist/bin/mail.js +2 -2
  5. package/dist/bundle/agent-KWLCQCSC.js +39 -0
  6. package/dist/bundle/{all-profiles-W3CGXEEJ.js → all-profiles-6BDSMVOO.js} +63 -21
  7. package/dist/bundle/{anthropic-UMDO5AKP.js → anthropic-C3XUXUCJ.js} +8 -8
  8. package/dist/bundle/{app-server-4SICQ5RP.js → app-server-GUHDK4OR.js} +82 -64
  9. package/dist/bundle/{bun-QVVCH4MJ.js → bun-FN7AM4AG.js} +2 -2
  10. package/dist/bundle/{bun-sqlite-CHD4AIUK.js → bun-sqlite-56IVBF22.js} +6 -6
  11. package/dist/bundle/{chunk-HFFHL7SV.js → chunk-2B67TUIF.js} +101 -69
  12. package/dist/bundle/{chunk-OOYIPK4F.js → chunk-2UNQTKRH.js} +1 -1
  13. package/dist/bundle/{chunk-LXUHYDNE.js → chunk-3ACF6TIV.js} +1 -1
  14. package/dist/bundle/chunk-3EV2B7KZ.js +726 -0
  15. package/dist/bundle/chunk-3KAJCOJP.js +109 -0
  16. package/dist/bundle/{chunk-2BFXHCZW.js → chunk-3WAZKCDF.js} +2 -2
  17. package/dist/bundle/{chunk-LKGJMM6W.js → chunk-46SBNO67.js} +12 -63
  18. package/dist/bundle/{chunk-LB5FTCPZ.js → chunk-4IASS7NQ.js} +128 -10
  19. package/dist/bundle/chunk-4U5ODZO7.js +360 -0
  20. package/dist/bundle/{chunk-QN423PC6.js → chunk-5WYBI35N.js} +3 -3
  21. package/dist/bundle/{chunk-GZYICXO4.js → chunk-5XQI7WCJ.js} +1 -1
  22. package/dist/bundle/{chunk-JUYUWMTG.js → chunk-635AFLZO.js} +4 -4
  23. package/dist/bundle/{chunk-2P44S7XK.js → chunk-6B4WZVLN.js} +36 -28
  24. package/dist/bundle/{chunk-47YNANPZ.js → chunk-6Q5THDNW.js} +3 -3
  25. package/dist/bundle/chunk-6VARUB3J.js +787 -0
  26. package/dist/bundle/{chunk-BRRHYXUP.js → chunk-7FXZKQAC.js} +87 -76
  27. package/dist/bundle/{chunk-EW3JFV7J.js → chunk-7JVKQ6NM.js} +4 -4
  28. package/dist/bundle/{chunk-OWAJN74H.js → chunk-7KMI47AP.js} +106 -257
  29. package/dist/bundle/{chunk-BF73DBAA.js → chunk-7PXAUMK5.js} +30 -15
  30. package/dist/bundle/{chunk-UX76GMQM.js → chunk-7YMLEWTX.js} +43 -64
  31. package/dist/bundle/{chunk-2L6D54BR.js → chunk-AISQNKT7.js} +8 -8
  32. package/dist/bundle/chunk-AV2ZJ4WX.js +7 -0
  33. package/dist/bundle/{chunk-OFMYFFEF.js → chunk-AXKIXVQA.js} +991 -1609
  34. package/dist/bundle/{chunk-UAV74EY4.js → chunk-CDGVYQXG.js} +1 -1
  35. package/dist/bundle/{chunk-RXUVXAMM.js → chunk-CFQQTDSA.js} +1 -1
  36. package/dist/bundle/chunk-CMGZXBJW.js +259 -0
  37. package/dist/bundle/{chunk-H46MANPR.js → chunk-DD2P67NP.js} +3 -3
  38. package/dist/bundle/{chunk-IBIFX2LK.js → chunk-DFHUJTP5.js} +2 -2
  39. package/dist/bundle/{chunk-DI74RP6R.js → chunk-DREU6TN6.js} +31 -85
  40. package/dist/bundle/{chunk-XQXYAOBV.js → chunk-DZHEVVXA.js} +53 -33
  41. package/dist/bundle/{chunk-LFBD6RTX.js → chunk-E6HSSKRX.js} +4 -4
  42. package/dist/bundle/{chunk-UYZDH5LK.js → chunk-EHAXFDDP.js} +1 -1
  43. package/dist/bundle/chunk-EU4J6GCJ.js +52 -0
  44. package/dist/bundle/{chunk-CHNNKHLL.js → chunk-EX4Z7CCO.js} +4051 -2788
  45. package/dist/bundle/chunk-G662S2M4.js +559 -0
  46. package/dist/bundle/{chunk-XN5KH24X.js → chunk-GG634DR3.js} +5 -5
  47. package/dist/bundle/{chunk-FSMCXQH2.js → chunk-GU3PYIV2.js} +2 -2
  48. package/dist/bundle/{chunk-SW7YGW3T.js → chunk-HF5QWKK2.js} +18 -8
  49. package/dist/bundle/chunk-HJDIMVFW.js +108 -0
  50. package/dist/bundle/chunk-HKWZG7CZ.js +334 -0
  51. package/dist/bundle/{chunk-BI5P7JWM.js → chunk-HM6AMYHR.js} +2 -2
  52. package/dist/bundle/{chunk-35AH33VJ.js → chunk-HVXOA4FO.js} +1 -1
  53. package/dist/bundle/{chunk-LXAX6AZU.js → chunk-I3QZCQJT.js} +6 -6
  54. package/dist/bundle/{chunk-I3UAD4EI.js → chunk-ILEKGH44.js} +68 -59
  55. package/dist/bundle/{chunk-SDWYOYGN.js → chunk-J5ULUTWE.js} +4 -4
  56. package/dist/bundle/{chunk-TK77DCE5.js → chunk-L4RCWRWS.js} +1 -1
  57. package/dist/bundle/chunk-MCJYJIH5.js +192 -0
  58. package/dist/bundle/{chunk-S6CHYNFE.js → chunk-NEDS4ORI.js} +2 -2
  59. package/dist/bundle/{chunk-QO7BK4WD.js → chunk-ODQCRZX5.js} +35 -12
  60. package/dist/bundle/chunk-OO4OKMNB.js +80 -0
  61. package/dist/bundle/{chunk-JCQ47WR4.js → chunk-OOQFBRNR.js} +144 -10
  62. package/dist/bundle/{chunk-LACMDMDI.js → chunk-OTP2HJ67.js} +9 -9
  63. package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
  64. package/dist/bundle/{chunk-AEKWEYIG.js → chunk-PQDQCCGG.js} +19 -19
  65. package/dist/bundle/{chunk-BZY5W35X.js → chunk-Q5U2HIBJ.js} +7 -7
  66. package/dist/bundle/{chunk-74BYHR44.js → chunk-QFMKCU42.js} +3738 -3415
  67. package/dist/bundle/{chunk-SYUIAMVA.js → chunk-QYCMB7JY.js} +373 -533
  68. package/dist/bundle/{chunk-KLLT572M.js → chunk-RBV2AM52.js} +2 -100
  69. package/dist/bundle/{chunk-6VCQ4CTK.js → chunk-RJNKM3CQ.js} +1 -1
  70. package/dist/bundle/{chunk-6IS4BEN4.js → chunk-RQHWSNX4.js} +4 -4
  71. package/dist/bundle/chunk-RQJGX7F7.js +170 -0
  72. package/dist/bundle/{chunk-RENCSP47.js → chunk-TARNPINT.js} +3 -3
  73. package/dist/bundle/chunk-TP2BCK2Z.js +721 -0
  74. package/dist/bundle/{chunk-MJ7DUSHT.js → chunk-TP766H4O.js} +18 -14
  75. package/dist/bundle/{chunk-2X344EUT.js → chunk-UHGKN5US.js} +8 -8
  76. package/dist/bundle/{chunk-L3MKFI3Y.js → chunk-UWDRU3R6.js} +2 -2
  77. package/dist/bundle/chunk-V4O47JV6.js +72 -0
  78. package/dist/bundle/{chunk-CIG4UVP6.js → chunk-W4JYGMTU.js} +14 -13
  79. package/dist/bundle/{chunk-JADBHKBP.js → chunk-W7ICCFG5.js} +1 -1
  80. package/dist/bundle/{chunk-MNJ3BMPZ.js → chunk-WDEVKKAD.js} +3 -3
  81. package/dist/bundle/{chunk-TBZLGT7R.js → chunk-WZKM5I7B.js} +23 -119
  82. package/dist/bundle/{chunk-MT7T5N2N.js → chunk-XKKYRMGG.js} +4 -4
  83. package/dist/bundle/chunk-XQNKAM26.js +338 -0
  84. package/dist/bundle/{chunk-UWF3SSRL.js → chunk-YA44BG3N.js} +58 -9
  85. package/dist/bundle/{chunk-Y2P2LC5R.js → chunk-YCIWSKOH.js} +9 -9
  86. package/dist/bundle/{chunk-7OYZU5SP.js → chunk-YQTRKNZQ.js} +4 -4
  87. package/dist/bundle/chunk-YRAJFTFU.js +353 -0
  88. package/dist/bundle/chunk-YTI533XF.js +29 -0
  89. package/dist/bundle/{chunk-UG2QDGAH.js → chunk-ZMYRPMAJ.js} +1 -1
  90. package/dist/bundle/{chunk-CZ6ZXDSO.js → chunk-ZX7HZDD6.js} +182 -562
  91. package/dist/bundle/{chunk-IPSLQX64.js → chunk-ZYEU35MB.js} +2 -2
  92. package/dist/bundle/command-contract-D5UXWHMS.js +39 -0
  93. package/dist/bundle/{command-server-entry-G2ZHCN5J.js → command-server-entry-TPJ47FYS.js} +28 -25
  94. package/dist/bundle/decode-XHUASXQK.js +296 -0
  95. package/dist/bundle/{dispatch-RHIK22OA.js → dispatch-MQZHGGVP.js} +8 -8
  96. package/dist/bundle/{dist-X5G2IMYG.js → dist-BAE4IQ52.js} +34 -29
  97. package/dist/bundle/dist-PAKDDIBT.js +191 -0
  98. package/dist/bundle/{echarts-UZJ6AREV.js → echarts-U7Z2PKIG.js} +2 -2
  99. package/dist/bundle/{embed-FEXLUH3T.js → embed-W7GPB6EI.js} +6 -6
  100. package/dist/bundle/{embedder-NHQARKFJ.js → embedder-T72XLFQ5.js} +9 -9
  101. package/dist/bundle/{failure-7DIA4OET.js → failure-MP6VKL5Y.js} +2 -2
  102. package/dist/bundle/{first-run-PS5NR2QG.js → first-run-C44TJXRI.js} +12 -12
  103. package/dist/bundle/first-screen-IESI7DAU.js +39 -0
  104. package/dist/bundle/{instructions-SDDUBGH4.js → instructions-WGMWQNPP.js} +1 -1
  105. package/dist/bundle/mail.js +12 -12
  106. package/dist/bundle/{mcp-GN4FTJX5.js → mcp-YGOAUNC3.js} +2 -2
  107. package/dist/bundle/meeting-combined-XGZBSWIQ.js +24 -0
  108. package/dist/bundle/meeting-model-QVHLD4WI.js +24 -0
  109. package/dist/bundle/meeting-semantic-QKQHUHXX.js +21 -0
  110. package/dist/bundle/{node-ELCNUOCE.js → node-WANDMJJQ.js} +2 -2
  111. package/dist/bundle/{node-sqlite-2E5MKZMH.js → node-sqlite-NM5XA4DR.js} +7 -7
  112. package/dist/bundle/{oauth-JGPEIY3M.js → oauth-6E63ELEE.js} +8 -8
  113. package/dist/bundle/{open-6DEMCZAB.js → open-5542RTLE.js} +5 -5
  114. package/dist/bundle/{openai-IVKDU5AH.js → openai-NOYNPFB5.js} +28 -26
  115. package/dist/bundle/{process-67DAKAAQ.js → process-7AEXXSBX.js} +1 -1
  116. package/dist/bundle/{program-ESJDQMAJ.js → program-VMA5CGNR.js} +5712 -3640
  117. package/dist/bundle/{prompt-ZBWOT5KG.js → prompt-WYYO4AJL.js} +5 -5
  118. package/dist/bundle/{recognize-UUBH2DOH.js → recognize-UGCCOMAS.js} +4 -4
  119. package/dist/bundle/{remote-UYTNWNOB.js → remote-VZS6BNQB.js} +9 -9
  120. package/dist/bundle/{rerank-X2633CQN.js → rerank-O46D5GJ2.js} +7 -7
  121. package/dist/bundle/{serve-CP7Q4OVW.js → serve-QAAF2LCW.js} +10 -10
  122. package/dist/bundle/server-456MYK3X.js +84 -0
  123. package/dist/bundle/{server-I7MXRSAG.js → server-Q3PUZLLX.js} +77 -58
  124. package/dist/bundle/{sqlite-runtime-BX55LI5G.js → sqlite-runtime-EQBCDO2U.js} +6 -6
  125. package/dist/bundle/{state-LLNJQXFH.js → state-XIOHYXCR.js} +6 -6
  126. package/dist/bundle/{store-N27XI3VV.js → store-OXJZZUR7.js} +34 -17
  127. package/dist/bundle/{store-K4KU5N75.js → store-VJBL5XKR.js} +30 -20
  128. package/dist/bundle/store-maintenance-command-D7XYIX52.js +71 -0
  129. package/dist/bundle/surface-N7LK7PKN.js +70 -0
  130. package/dist/commands/read.d.ts +2 -2
  131. package/dist/commands/read.d.ts.map +1 -1
  132. package/dist/commands/read.js +5 -4
  133. package/dist/commands/read.js.map +1 -1
  134. package/dist/commands/sync.d.ts +2 -1
  135. package/dist/commands/sync.d.ts.map +1 -1
  136. package/dist/commands/sync.js +16 -9
  137. package/dist/commands/sync.js.map +1 -1
  138. package/dist/config.d.ts +6 -0
  139. package/dist/config.d.ts.map +1 -1
  140. package/dist/config.js +16 -1
  141. package/dist/config.js.map +1 -1
  142. package/dist/identity.d.ts.map +1 -1
  143. package/dist/identity.js +2 -2
  144. package/dist/identity.js.map +1 -1
  145. package/dist/version.d.ts +1 -1
  146. package/dist/version.js +1 -1
  147. package/package.json +3 -3
  148. package/dist/bundle/chunk-BDCC2J2Z.js +0 -2
  149. package/dist/bundle/command-contract-NRNQAFFE.js +0 -36
  150. package/dist/bundle/decode-U6V6D6XH.js +0 -162
  151. package/dist/bundle/first-screen-C2WTLOG2.js +0 -34
  152. package/dist/bundle/server-QGTMJ7SF.js +0 -67
  153. package/dist/bundle/store-maintenance-command-VPAFQCNA.js +0 -58
@@ -1,74 +1,37 @@
1
1
  import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
- UNTRUSTED,
5
- UNTRUSTED_NEUTRAL,
6
- agentArguments,
7
- agentJson,
8
4
  commandAvailability
9
- } from "./chunk-OWAJN74H.js";
5
+ } from "./chunk-EU4J6GCJ.js";
10
6
  import {
11
- failureContext
12
- } from "./chunk-LB5FTCPZ.js";
7
+ lentConnection
8
+ } from "./chunk-XQNKAM26.js";
13
9
  import {
14
- callerOf
15
- } from "./chunk-KLLT572M.js";
10
+ QUERY_ARGUMENT
11
+ } from "./chunk-3EV2B7KZ.js";
16
12
  import {
17
- QUERY_ARGUMENT,
18
- lentConnection,
19
- onlineDeps,
20
- refuseLacking,
21
- servicesFor,
22
- storeModeDeps
23
- } from "./chunk-74BYHR44.js";
24
- import {
25
- MAX_BUFFERED_INPUT
26
- } from "./chunk-S6CHYNFE.js";
27
- import {
28
- DEFAULT_OUTPUT_BYTES,
29
- ENTITIES,
30
- LOCAL_WRITE,
31
- REMOTE_WRITE,
32
- answerSchema,
33
13
  changesMessenger,
34
- flatten,
35
- judgedAnswer,
36
- judgedEffects,
37
- listOf,
38
- refuseStoreChange,
39
- sealed,
40
- startRecording
41
- } from "./chunk-SYUIAMVA.js";
14
+ flatten
15
+ } from "./chunk-QYCMB7JY.js";
42
16
  import {
43
17
  authorityAllowed,
44
- botApiAllowed,
45
- fetchesAt,
46
- keyForCommand,
47
- levelFor,
48
- readKeysForCommand
49
- } from "./chunk-SW7YGW3T.js";
18
+ botApiAllowed
19
+ } from "./chunk-HF5QWKK2.js";
50
20
  import {
51
- currentCaller,
52
- keepsSuccess,
53
- runContextOf,
54
- withCaller
55
- } from "./chunk-2X344EUT.js";
21
+ currentCaller
22
+ } from "./chunk-UHGKN5US.js";
56
23
  import {
57
24
  enclosingTraceId,
58
25
  inRun,
59
26
  newRunId,
60
27
  traceOf
61
- } from "./chunk-XQXYAOBV.js";
28
+ } from "./chunk-DZHEVVXA.js";
62
29
  import {
63
30
  queryDescription
64
- } from "./chunk-OFMYFFEF.js";
65
- import {
66
- storeDamaged
67
- } from "./chunk-L3MKFI3Y.js";
31
+ } from "./chunk-AXKIXVQA.js";
68
32
  import {
69
- captureStreams,
70
- traceIdOf
71
- } from "./chunk-BRRHYXUP.js";
33
+ captureStreams
34
+ } from "./chunk-7FXZKQAC.js";
72
35
  import {
73
36
  COMPACT_FLAG,
74
37
  SNAKE_CASE,
@@ -79,13 +42,7 @@ import {
79
42
  errorObjectOf,
80
43
  integer,
81
44
  isoDate,
82
- itemEnvelopeSchema,
83
- listEnvelopeSchema,
84
45
  literal,
85
- looseObject,
86
- maxLength,
87
- maxValue,
88
- mcpErrorResult,
89
46
  minLength,
90
47
  minValue,
91
48
  number,
@@ -96,30 +53,25 @@ import {
96
53
  pipe,
97
54
  record,
98
55
  regex,
99
- safeParse,
100
56
  strictObject,
101
57
  string,
102
- summarize,
103
58
  text,
104
- toJsonSchema,
105
- toStandardJsonSchema,
106
59
  union,
107
60
  unknown,
108
61
  word,
109
62
  writes
110
- } from "./chunk-UWF3SSRL.js";
63
+ } from "./chunk-YA44BG3N.js";
111
64
  import {
112
- CliError,
113
- errorCodes
114
- } from "./chunk-BI5P7JWM.js";
65
+ CliError
66
+ } from "./chunk-HM6AMYHR.js";
115
67
  import {
116
68
  __name
117
69
  } from "./chunk-ZVVMGPBJ.js";
118
70
 
119
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/mcp/agent.js
71
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/mcp/agent.js
120
72
  import { Readable } from "node:stream";
121
73
 
122
- // node_modules/.pnpm/@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/lint.js
74
+ // node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/lint.js
123
75
  var LINT_SEVERITIES = ["high", "medium", "low"];
124
76
  var lintRuleSchema = strictObject({
125
77
  id: word,
@@ -265,7 +217,7 @@ var overrideSchema = strictObject({
265
217
  });
266
218
  var overridesSchema = array(overrideSchema);
267
219
 
268
- // node_modules/.pnpm/@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/audit.js
220
+ // node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/audit.js
269
221
  var auditRuleSchema = strictObject({ id: word, severity: picklist(LINT_SEVERITIES), summary: text });
270
222
  var defineAuditRules = /* @__PURE__ */ __name((input) => parseRegistry("audit rules", array(auditRuleSchema), input, (rules) => duplicates(rules.map((rule) => rule.id)).map((id) => `"${id}" is listed twice`)), "defineAuditRules");
271
223
  var AUDIT_RULES = defineAuditRules([
@@ -320,17 +272,20 @@ var parityGroupSchema = strictObject({
320
272
  absent: optional(word),
321
273
  /** The one CLI that has the path or flag by design; every other CLI compared must lack it. */
322
274
  only: optional(word),
275
+ /** The one CLI whose value (a summary, a value name) differs by design; every other CLI compared must agree. */
276
+ differs: optional(word),
323
277
  reason: pipe(text, minLength(10, "say why, in a sentence")),
324
278
  /** Warns from 14 days before and fails 14 days after, as a lint override does. */
325
279
  review_after: optional(pipe(string(), isoDate("a date, YYYY-MM-DD")))
326
280
  }))
327
281
  });
282
+ var kindOf = /* @__PURE__ */ __name((entry) => ["absent", "only", "differs"].filter((one) => entry[one] !== void 0), "kindOf");
328
283
  var defineParityGroups = /* @__PURE__ */ __name((input) => parseRegistry("parity groups", array(parityGroupSchema), input, (groups) => [
329
284
  ...duplicates(groups.map((group) => group.name)).map((name) => `"${name}" is listed twice`),
330
285
  ...groups.flatMap((group) => [
331
286
  ...duplicates(group.differences.map((entry) => `${entry.rule} ${entry.target}`)).map((both) => `${group.name}: "${both}" is listed twice`),
332
- ...group.differences.filter((entry) => (entry.absent || entry.only) && entry.expected).map((entry) => `${group.name}: "${entry.target}" has \`${entry.absent ? "absent" : "only"}\`, which measures the values itself; drop \`expected\``),
333
- ...group.differences.filter((entry) => entry.absent && entry.only).map((entry) => `${group.name}: "${entry.target}" has both \`absent\` and \`only\`; keep one`)
287
+ ...group.differences.filter((entry) => kindOf(entry).length === 1 && entry.expected).map((entry) => `${group.name}: "${entry.target}" has \`${kindOf(entry)[0]}\`, which measures the values itself; drop \`expected\``),
288
+ ...group.differences.filter((entry) => kindOf(entry).length > 1).map((entry) => `${group.name}: "${entry.target}" has ${kindOf(entry).map((one) => `\`${one}\``).join(" and ")}; keep one`)
334
289
  ])
335
290
  ]), "defineParityGroups");
336
291
  var MEMO_HAS_NO_PROFILES = [
@@ -345,6 +300,12 @@ var MEMO_HAS_NO_PROFILES = [
345
300
  absent: "memo",
346
301
  reason: "memo has no profiles: it reads other CLIs' stores and selects their accounts with --source and --account (https://github.com/WireCatLabs/cli-base/issues/390)"
347
302
  }));
303
+ var MEMO_MCP_SUMMARIES = ["mcp", "mcp serve"].map((path) => ({
304
+ rule: "same-path-contract",
305
+ target: `${path}: summary`,
306
+ differs: "memo",
307
+ reason: "memo has no profiles, so its mcp commands serve memo's commands rather than a profile's"
308
+ }));
348
309
  var MEMO_DOCTOR_DEEP = {
349
310
  rule: "same-path-contract",
350
311
  target: "doctor --deep",
@@ -375,7 +336,7 @@ var PARITY_GROUPS = defineParityGroups([
375
336
  name: "all",
376
337
  members: ["tg", "max", "memo", "drive", "zm", "wa"],
377
338
  covers: ["commands", "doctor", "skill", "mcp", "upgrade", "search", "notes", "meetings"],
378
- differences: [...MEMO_HAS_NO_PROFILES, MEMO_DOCTOR_DEEP]
339
+ differences: [...MEMO_HAS_NO_PROFILES, ...MEMO_MCP_SUMMARIES, MEMO_DOCTOR_DEEP]
379
340
  },
380
341
  // mail's `search messages` is cli-core's mail search, not the messengers' command: --complete took their 20-odd
381
342
  // differences as inherited (https://github.com/WireCatLabs/cli-base/issues/390). mail is compared everywhere else
@@ -384,7 +345,7 @@ var PARITY_GROUPS = defineParityGroups([
384
345
  name: "mail-shared",
385
346
  members: ["tg", "max", "memo", "drive", "zm", "wa", "mail"],
386
347
  covers: ["commands", "doctor", "skill", "mcp", "upgrade", "notes", "meetings"],
387
- differences: [...MEMO_HAS_NO_PROFILES, MEMO_DOCTOR_DEEP]
348
+ differences: [...MEMO_HAS_NO_PROFILES, ...MEMO_MCP_SUMMARIES, MEMO_DOCTOR_DEEP]
388
349
  },
389
350
  // gcal is compared on what it already shares with every CLI; doctor, mcp, search and skill wait until the published
390
351
  // CLIs agree there (https://github.com/WireCatLabs/cli-base/issues/390), then gcal moves back into "all".
@@ -396,14 +357,58 @@ var PARITY_GROUPS = defineParityGroups([
396
357
  },
397
358
  // bitrix24-cli's search is cli-core's CRM `search all`, and beeline-cli's and asterisk-cli's meetings take call
398
359
  // recordings, not zoom-cli's: they are compared on the root commands every CLI shares, the way gcal and mail are.
399
- // notion-cli joins here until its documents commands ship; then it moves next to drive.
360
+ // amo-cli, hubspot-cli and attio-cli share them too, and their CRM commands are compared with b24 in `crm` below.
361
+ // wordpress-cli shares only these roots: it is the first content CLI, so its posts commands have no group yet.
362
+ // notion-cli joins here until its documents commands ship; then it moves next to drive. ydisk joins here too: in "all"
363
+ // its search and notes differ from the messengers' and memo's as drive's do, and a documents group of drive, notion
364
+ // and ydisk differs in 39 paths (session, folders browse, summaries; measured on the published CLIs 2026-11-17).
400
365
  {
401
366
  name: "shared-roots",
402
- members: ["tg", "max", "memo", "drive", "zm", "wa", "b24", "beeline", "pbx", "notion"],
367
+ members: [
368
+ "tg",
369
+ "max",
370
+ "memo",
371
+ "drive",
372
+ "zm",
373
+ "wa",
374
+ "b24",
375
+ "beeline",
376
+ "pbx",
377
+ "notion",
378
+ "amo",
379
+ "hubspot",
380
+ "attio",
381
+ "ydisk",
382
+ "wordpress"
383
+ ],
403
384
  covers: ["commands", "doctor", "skill", "mcp", "upgrade"],
404
- differences: [...MEMO_HAS_NO_PROFILES, MEMO_DOCTOR_DEEP]
385
+ differences: [...MEMO_HAS_NO_PROFILES, ...MEMO_MCP_SUMMARIES, MEMO_DOCTOR_DEEP]
386
+ },
387
+ // The CRM CLIs on cli-core's shared CRM commands. amo-cli (amoCRM and Kommo) is not on npm yet and hubspot-cli is
388
+ // not in the family packages, so `audit --family` skips them, as beeline. Only b24 and hubspot have `leads` (amoCRM
389
+ // has no lead apart from a deal), only b24 has `products` (amo leaves them for later) and `deals delete` (amoCRM's
390
+ // API v4 cannot delete a lead, https://www.amocrm.ru/developers/content/crm_platform/leads-api), and hubspot writes
391
+ // no deals yet; a list of roots does not compare presence, so these need no difference. `people`, `organizations`,
392
+ // `users`, `api` and `session` join once b24's released tree is on cli-core's shared people and organizations
393
+ // commands: measured against b24 0.23.0 on 2026-11-16 they differ in options, outputs and summaries.
394
+ {
395
+ name: "crm",
396
+ members: ["b24", "amo", "hubspot", "attio"],
397
+ covers: ["deals", "sync", "search", "store", "schedule", "account"],
398
+ differences: [
399
+ {
400
+ rule: "same-path-contract",
401
+ target: "schedule: summary",
402
+ differs: "hubspot",
403
+ reason: "cli-core cuts the summary to a fixed width after it puts in the CLI's name (src/cli/help/commands-text.ts), so hubspot's longer name ends it a word earlier than b24's and amo's",
404
+ review_after: "2026-12-01"
405
+ }
406
+ ]
405
407
  }
406
408
  ]);
409
+ var SHARED_DIFFERENCES = [
410
+ ...new Map(PARITY_GROUPS.flatMap((group) => group.differences).filter((entry) => entry.rule === "same-entity-schema" || entry.rule === "same-error-reason").map((entry) => [`${entry.rule} ${entry.target}`, entry])).values()
411
+ ];
407
412
  var requiredRootSchema = strictObject({ path: pipe(array(segment), minLength(1)), meaning: text });
408
413
  var defineRequiredRoots = /* @__PURE__ */ __name((input) => parseRegistry("required roots", array(requiredRootSchema), input, (roots2) => duplicates(roots2.map((root) => root.path.join(" "))).map((path) => `"${path}" is listed twice`)), "defineRequiredRoots");
409
414
  var REQUIRED_ROOTS = defineRequiredRoots([
@@ -415,7 +420,7 @@ var REQUIRED_ROOTS = defineRequiredRoots([
415
420
  { path: ["upgrade"], meaning: "updates the CLI" }
416
421
  ]);
417
422
 
418
- // node_modules/.pnpm/@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/fields.js
423
+ // node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/fields.js
419
424
  var fieldRuleSchema = strictObject({ id: word, rule: text });
420
425
  var defineFieldRules = /* @__PURE__ */ __name((input) => parseRegistry("output field rules", array(fieldRuleSchema), input, (rules) => duplicates(rules.map((rule) => rule.id)).map((id) => `"${id}" is listed twice`)), "defineFieldRules");
421
426
  var FIELD_RULES = defineFieldRules([
@@ -431,7 +436,7 @@ var FIELD_RULES = defineFieldRules([
431
436
  }
432
437
  ]);
433
438
 
434
- // node_modules/.pnpm/@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/identifiers.js
439
+ // node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/identifiers.js
435
440
  var key = pipe(string(), regex(SNAKE_CASE, "a snake_case key"));
436
441
  var identifierSchema = strictObject({ key, meaning: text, replaces: optional(array(key)) });
437
442
  var defineIdentifiers = /* @__PURE__ */ __name((input) => parseRegistry("identifiers", array(identifierSchema), input, (identifiers) => {
@@ -453,7 +458,7 @@ var IDENTIFIERS = defineIdentifiers([
453
458
  { key: "trace_id", meaning: "the distributed trace a run belongs to, from `traceparent`" }
454
459
  ]);
455
460
 
456
- // node_modules/.pnpm/@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-account.js
461
+ // node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-account.js
457
462
  var ACCOUNT_FLAGS = [
458
463
  {
459
464
  name: "--client-id",
@@ -490,7 +495,7 @@ var ACCOUNT_FLAGS = [
490
495
  { name: "--hide-phone", role: "output", type: "switch", meaning: "leave the phone number out of the answer" }
491
496
  ];
492
497
 
493
- // node_modules/.pnpm/@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-calendar.js
498
+ // node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-calendar.js
494
499
  var CALENDAR_FLAGS = [
495
500
  { name: "--end-time", value: "<time>", role: "value", type: "time", meaning: "when it ends" },
496
501
  {
@@ -522,6 +527,13 @@ var CALENDAR_FLAGS = [
522
527
  type: "string",
523
528
  meaning: "one of the service's own settings, such as a meeting's waiting room; repeat it for more"
524
529
  },
530
+ {
531
+ name: "--conference",
532
+ value: "<service>",
533
+ role: "value",
534
+ type: "string",
535
+ meaning: "the video meeting service that gives the event a new meeting link, such as google-meet"
536
+ },
525
537
  {
526
538
  name: "--id",
527
539
  value: "<id>",
@@ -571,8 +583,40 @@ var CALENDAR_FLAGS = [
571
583
  }
572
584
  ];
573
585
 
574
- // node_modules/.pnpm/@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-crm.js
586
+ // node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-content.js
587
+ var CONTENT_FLAGS = [
588
+ { name: "--slug", value: "<slug>", role: "value", type: "string", meaning: "the last part of its web address" },
589
+ {
590
+ name: "--tags",
591
+ value: "<ids>",
592
+ role: "value",
593
+ type: "list",
594
+ meaning: "its tags and categories, by comma-separated ids; replaces the ones it has"
595
+ },
596
+ {
597
+ name: "--replace-body",
598
+ role: "mode",
599
+ type: "switch",
600
+ meaning: "write the new text over a body the tool cannot fully read back, losing what it could not show"
601
+ }
602
+ ];
603
+
604
+ // node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-crm.js
575
605
  var CRM_FLAGS = [
606
+ {
607
+ name: "--email",
608
+ value: "<address>",
609
+ role: "value",
610
+ type: "string",
611
+ meaning: "an e-mail address to give it; repeat it for more"
612
+ },
613
+ {
614
+ name: "--phone",
615
+ value: "<phone>",
616
+ role: "value",
617
+ type: "string",
618
+ meaning: "a phone number to give it, in international form starting with +; repeat it for more"
619
+ },
576
620
  {
577
621
  name: "--pipeline",
578
622
  value: "<pipeline>",
@@ -721,7 +765,7 @@ var CRM_FLAGS = [
721
765
  }
722
766
  ];
723
767
 
724
- // node_modules/.pnpm/@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-how.js
768
+ // node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-how.js
725
769
  var HOW_FLAGS = [
726
770
  {
727
771
  name: "--limit",
@@ -1101,13 +1145,7 @@ var HOW_FLAGS = [
1101
1145
  type: "string",
1102
1146
  meaning: "a person whose reply counts as an answer; repeat it for more"
1103
1147
  },
1104
- {
1105
- name: "--browser",
1106
- value: "<program>",
1107
- role: "mode",
1108
- type: "string",
1109
- meaning: "the browser program to open for sign-in"
1110
- },
1148
+ { name: "--browser", value: "<program>", role: "mode", type: "string", meaning: "the browser to open for sign-in" },
1111
1149
  {
1112
1150
  name: "--credential-storage",
1113
1151
  value: "<storage>",
@@ -1116,6 +1154,8 @@ var HOW_FLAGS = [
1116
1154
  meaning: "where a sign-in is kept: keyring, which falls back to a private file by itself, or file (WC-SECR-4)"
1117
1155
  },
1118
1156
  { name: "--checkpoint", value: "<file>", role: "mode", type: "path", meaning: "keep resume progress in this file" },
1157
+ { name: "--site", value: "<address>", role: "mode", type: "string", meaning: "the owner's site a sign-in is for" },
1158
+ { name: "--login", value: "<name>", role: "mode", type: "string", meaning: "the user name a password is for" },
1119
1159
  {
1120
1160
  name: "--expected-event-id",
1121
1161
  value: "<id>",
@@ -1718,7 +1758,7 @@ var HOW_FLAGS = [
1718
1758
  }
1719
1759
  ];
1720
1760
 
1721
- // node_modules/.pnpm/@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-knowledge.js
1761
+ // node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-knowledge.js
1722
1762
  var KNOWLEDGE_FLAGS = [
1723
1763
  {
1724
1764
  name: "--accept-terms",
@@ -1753,10 +1793,31 @@ var KNOWLEDGE_FLAGS = [
1753
1793
  type: "count",
1754
1794
  meaning: "at most this many characters read",
1755
1795
  unit: "characters"
1796
+ },
1797
+ {
1798
+ name: "--tab",
1799
+ value: "<id>",
1800
+ role: "target",
1801
+ type: "id",
1802
+ meaning: "one tab of a document, by its id: only its text is read"
1803
+ },
1804
+ {
1805
+ name: "--tag",
1806
+ value: "<name>",
1807
+ role: "target",
1808
+ type: "string",
1809
+ meaning: "a tag, by its name or an alias: only what carries it is read"
1810
+ },
1811
+ {
1812
+ name: "--matching",
1813
+ value: "<query>",
1814
+ role: "target",
1815
+ type: "string",
1816
+ meaning: "every stored thing a search with this query finds, in its query language; the command acts on each"
1756
1817
  }
1757
1818
  ];
1758
1819
 
1759
- // node_modules/.pnpm/@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-mail.js
1820
+ // node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-mail.js
1760
1821
  var MAIL_FLAGS = [
1761
1822
  {
1762
1823
  name: "--cc",
@@ -1786,7 +1847,7 @@ var MAIL_FLAGS = [
1786
1847
  }
1787
1848
  ];
1788
1849
 
1789
- // node_modules/.pnpm/@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-privacy.js
1850
+ // node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-privacy.js
1790
1851
  var PRIVACY_FLAGS = [
1791
1852
  {
1792
1853
  name: "--about-text",
@@ -1847,7 +1908,7 @@ var PRIVACY_FLAGS = [
1847
1908
  { name: "--read-receipts", value: "<on|off>", role: "value", type: "choice", meaning: "send read receipts" }
1848
1909
  ];
1849
1910
 
1850
- // node_modules/.pnpm/@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-schedule.js
1911
+ // node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-schedule.js
1851
1912
  var SCHEDULE_FLAGS = [
1852
1913
  {
1853
1914
  name: "--locale",
@@ -1880,7 +1941,7 @@ var SCHEDULE_FLAGS = [
1880
1941
  }
1881
1942
  ];
1882
1943
 
1883
- // node_modules/.pnpm/@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-what.js
1944
+ // node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-what.js
1884
1945
  var WHAT_FLAGS = [
1885
1946
  {
1886
1947
  name: "--analysis-provider",
@@ -2877,7 +2938,7 @@ var WHAT_FLAGS = [
2877
2938
  }
2878
2939
  ];
2879
2940
 
2880
- // node_modules/.pnpm/@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/vocabulary.js
2941
+ // node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/vocabulary.js
2881
2942
  var FLAG_TYPES = [
2882
2943
  "switch",
2883
2944
  "count",
@@ -3007,6 +3068,10 @@ var verbs = [
3007
3068
  ["export", "write from the store to a file"],
3008
3069
  ["import", "bring a file or list the user gives into the store or the messenger, once"],
3009
3070
  ["download", "save a file from the source to this machine"],
3071
+ ["upload", "put a file from this machine on the source"],
3072
+ ["publish", "open a thing to anyone who has its public link"],
3073
+ ["unpublish", "close a thing's public link"],
3074
+ ["stale", "mark a saved memory as out of date, keeping it"],
3010
3075
  ["transcribe", "turn speech into text"],
3011
3076
  ["extract", "read the text inside files already on this machine into the store"],
3012
3077
  ["migrate", "bring a file up to this build's schema"],
@@ -3103,6 +3168,8 @@ var collections = [
3103
3168
  ["messages", "posts in a messenger chat, or emails"],
3104
3169
  ["drafts", "e-mails saved in a mailbox's Drafts folder, written and not sent"],
3105
3170
  ["polls", "polls in a chat"],
3171
+ ["posts", "posts and pages on a site or blog the owner publishes"],
3172
+ ["channels", "the sites and social accounts the owner publishes posts on"],
3106
3173
  ["reactions", "reactions to a message"],
3107
3174
  ["recipients", "who a message goes to"],
3108
3175
  ["replies", "the automatic replies of a profile"],
@@ -3149,7 +3216,13 @@ var collections = [
3149
3216
  ["transactions", "money that moved in or out of a wallet, as the bank or the owner recorded it"],
3150
3217
  ["splits", "parts of one transaction, each with its own amount and category"],
3151
3218
  ["users", "people who work in the owner's account at a service, such as a CRM's employees"],
3219
+ ["issues", "work items in an issue tracker, each in a team, a workflow state and maybe a project"],
3220
+ ["teams", "groups in a tracker that own issues, states and labels"],
3221
+ ["states", "the workflow steps a tracker team moves its issues through, each of a type such as started"],
3222
+ ["labels", "a tracker's shared labels on issues, kept by the tracker and not by the owner"],
3152
3223
  ["fields", "a record type's field definitions: code, label, type and options, such as a CRM's custom fields"],
3224
+ ["activities", "a CRM's calls, e-mails, meetings, to-dos and comments on its records"],
3225
+ ["changes", "what changed in a copied source over a time: records added, moved, closed or reassigned"],
3153
3226
  [
3154
3227
  "identities",
3155
3228
  "ways to reach a person or an organization: an account in one messenger or mailbox, an e-mail address, a phone"
@@ -3162,6 +3235,7 @@ var collections = [
3162
3235
  ["files", "files in the source, such as Google Drive, read and changed there"],
3163
3236
  ["comments", "comments people left on a thing in the source: a channel post or a file"],
3164
3237
  ["meetings", "stored meetings, from Zoom or another provider"],
3238
+ ["calls", "phone calls a phone system recorded, stored as meetings with their transcripts"],
3165
3239
  ["calendars", "calendars of an account, each synced or not"],
3166
3240
  ["events", "calendar entries: meetings, appointments and other things on a calendar"],
3167
3241
  ["people", "persons the owner deals with, such as the attendees of events"],
@@ -3214,6 +3288,10 @@ var singulars = [
3214
3288
  ["privacy", "who may find, see, call or add the account"],
3215
3289
  ["metadata", "a profile's cached source attributes"],
3216
3290
  ["auth", "the credentials a bot profile uses: its token and the secrets beside it"],
3291
+ [
3292
+ "scheduled",
3293
+ "a chat's messages the messenger will send later; their ids are their own, never the ids of sent messages"
3294
+ ],
3217
3295
  [
3218
3296
  "schedule",
3219
3297
  "a profile's timers the owner saved, each running a command of this tool or an agent; the tool's own background work is jobs"
@@ -3221,6 +3299,7 @@ var singulars = [
3221
3299
  ];
3222
3300
  var views = [
3223
3301
  ["tree", "the parent and child hierarchy of stored sources"],
3302
+ ["stats", "a thing's own numbers, such as a post's views, as read at each sync"],
3224
3303
  ["logs", "the log of a running process"],
3225
3304
  ["events", "what happened in a thing over time"],
3226
3305
  ["scheduled", "what is scheduled to happen"],
@@ -3233,6 +3312,7 @@ var views = [
3233
3312
  ["transcript", "the text of speech: a voice message or a meeting recording"],
3234
3313
  ["evidence", "the stored messages or lines a result or a reference rests on"],
3235
3314
  ["passage", "a cited transcript line with bounded surrounding lines from the same revision"],
3315
+ ["invitation", "the text that invites people to a meeting: how to join it and when"],
3236
3316
  ["agenda", "what needs a look today"],
3237
3317
  ["busy", "when calendars or people are taken, without what takes them"],
3238
3318
  ["categories", "the categories a thing takes, with what each means"],
@@ -3292,11 +3372,12 @@ var VOCABULARY = defineVocabulary({
3292
3372
  ...MAIL_FLAGS,
3293
3373
  ...KNOWLEDGE_FLAGS,
3294
3374
  ...CRM_FLAGS,
3295
- ...SCHEDULE_FLAGS
3375
+ ...SCHEDULE_FLAGS,
3376
+ ...CONTENT_FLAGS
3296
3377
  ]
3297
3378
  });
3298
3379
 
3299
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/mcp/agent.js
3380
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/mcp/agent.js
3300
3381
  var TYPES = new Map(VOCABULARY.flags.map((flag) => [flag.name, flag.type]));
3301
3382
  var snake = /* @__PURE__ */ __name((name) => name.replaceAll("|", "_or_").replace(/[^a-z0-9]+/gi, "_"), "snake");
3302
3383
  var longOf = /* @__PURE__ */ __name((option) => option.flags.match(/--[a-z0-9][a-z0-9-]*/)?.[0], "longOf");
@@ -3467,7 +3548,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
3467
3548
  const { argv, stdin } = argvOf(info, input, ctx.profile, ctx.stdin);
3468
3549
  const lend = ctx.connection;
3469
3550
  let borrowed;
3470
- let answered2 = false;
3551
+ let answered = false;
3471
3552
  let result;
3472
3553
  let failure;
3473
3554
  const streams = captureStreams();
@@ -3489,7 +3570,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
3489
3570
  answer: /* @__PURE__ */ __name(() => null, "answer"),
3490
3571
  agent: {
3491
3572
  result: /* @__PURE__ */ __name((value) => {
3492
- answered2 = true;
3573
+ answered = true;
3493
3574
  result = value;
3494
3575
  }, "result"),
3495
3576
  failure: /* @__PURE__ */ __name((object2) => {
@@ -3511,7 +3592,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
3511
3592
  }));
3512
3593
  if (failure)
3513
3594
  return { error: failure };
3514
- if (answered2)
3595
+ if (answered)
3515
3596
  return { result };
3516
3597
  if (code !== 0)
3517
3598
  throw new CliError("invalid_response", `the command exited with ${code} and said nothing`);
@@ -3523,468 +3604,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
3523
3604
  }
3524
3605
  }, "runCommandForAgent");
3525
3606
 
3526
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/mcp/tool.js
3527
- var limit = optional(pipe(number(), integer(), minValue(1), maxValue(100), description("how many")));
3528
- var page = optional(pipe(number(), integer(), minValue(1), description("which page, from 1")));
3529
- var message = pipe(
3530
- string(),
3531
- maxLength(256),
3532
- // biome-ignore lint/suspicious/noControlCharactersInRegex: refusing them is the point
3533
- regex(/^[^\s\x00-\x1F\x7F-\x9F]+$/, "a message id has no spaces or control characters"),
3534
- description("message id")
3535
- );
3536
- var READ = { readOnlyHint: true, destructiveHint: false, openWorldHint: true };
3537
- var WRITE = {
3538
- readOnlyHint: false,
3539
- destructiveHint: true,
3540
- idempotentHint: false,
3541
- openWorldHint: true
3542
- };
3543
- var tool = /* @__PURE__ */ __name((definition) => definition, "tool");
3544
- var chatOf = /* @__PURE__ */ __name((messenger) => pipe(string(), minLength(1), description(messenger.chatArgument)), "chatOf");
3545
- var tierOf = /* @__PURE__ */ __name((key2, definition, messenger) => {
3546
- if (definition.annotations.readOnlyHint === true)
3547
- return "read";
3548
- if (/^admin|_admin/.test(key2))
3549
- return "admin";
3550
- if (/delete|ban|kick|remove|purge|block/.test(key2))
3551
- return "destructive";
3552
- if (/draft/.test(key2))
3553
- return "draft";
3554
- if (key2 === "messages_pin" && messenger?.quietPins === false)
3555
- return "write-public";
3556
- if (/mark_read|mark_unread|read_mark|archive|mute|pin|tag|note|label|folder|alias|save|_(un)?star$/.test(key2))
3557
- return "write-private";
3558
- return "write-public";
3559
- }, "tierOf");
3560
- var effectsOf = /* @__PURE__ */ __name((definition) => {
3561
- if (definition.effects)
3562
- return definition.effects;
3563
- const { readOnlyHint, openWorldHint } = definition.annotations;
3564
- if (readOnlyHint === true)
3565
- return { remote: openWorldHint === false ? "none" : "read", local: "read" };
3566
- return openWorldHint === false ? LOCAL_WRITE : REMOTE_WRITE;
3567
- }, "effectsOf");
3568
- var outcomeOf = /* @__PURE__ */ __name((result) => {
3569
- if (!result.isError)
3570
- return { status: "ok" };
3571
- const code = result.structuredContent?.error?.code;
3572
- const error = typeof code === "string" ? code : "generic_failure";
3573
- return { status: error === "permission_error" ? "refused" : "failed", error };
3574
- }, "outcomeOf");
3575
- var commandOf = /* @__PURE__ */ __name((name, definition) => definition.command ?? name.replaceAll("_", " "), "commandOf");
3576
- var toolKey = /* @__PURE__ */ __name((name, definition) => definition.key !== void 0 ? definition.key : keyForCommand(commandOf(name, definition).split(" ")), "toolKey");
3577
- var inputOf = /* @__PURE__ */ __name((definition, syncAllowed) => strictObject(syncAllowed || !("sync_first" in definition.input.entries) ? definition.input.entries : Object.fromEntries(Object.entries(definition.input.entries).filter(([name]) => !["sync_first", "sync_time", "max_chats", "max_messages"].includes(name)))), "inputOf");
3578
- var syncAllowedFor = /* @__PURE__ */ __name((key2, defaults) => {
3579
- const permissions = defaults.settings.permissions ?? {};
3580
- const shared = defaults.syncAllowed ?? fetchesAt(levelFor(permissions, "messages.sync-first").level);
3581
- return shared && (!key2.startsWith("stats_") || fetchesAt(levelFor(permissions, `${key2.replaceAll("_", ".")}.sync-first`).level));
3582
- }, "syncAllowedFor");
3583
- var entryRunner = /* @__PURE__ */ __name((registration) => {
3584
- const run = callRunner(registration);
3585
- const { log } = registration;
3586
- return async (key2, definition, args, ctx) => {
3587
- const startedAt = Date.now();
3588
- const command = `mcp ${commandOf(key2, definition)}`;
3589
- const traceId = traceIdOf(ctx?.mcpReq?._meta?.traceparent);
3590
- const app = registration.messenger?.app;
3591
- const caller = registration.callers ? callerOf(ctx, key2, registration.callers) : currentCaller();
3592
- const env = registration.defaults.env ?? process.env;
3593
- const settings = registration.defaults.settings;
3594
- const recording = key2 !== "runs_search" && settings.keepFailedRuns !== false && app?.appName ? startRecording({
3595
- app,
3596
- command,
3597
- ...settings.profile === void 0 ? {} : { profile: settings.profile },
3598
- env,
3599
- record: keepsSuccess({ record: settings.record ?? true, fromFlag: false, env, caller }),
3600
- keepFailed: true,
3601
- trace: false,
3602
- format: "json",
3603
- context: runContextOf({ bin: app.command, command, env, caller }),
3604
- ...settings.keepRunsForDays === void 0 ? {} : { keepDays: settings.keepRunsForDays },
3605
- ...settings.keepSuccessfulRunsForDays === void 0 ? {} : { keepSuccessDays: settings.keepSuccessfulRunsForDays },
3606
- ...settings.runsSizeLimitMb === void 0 ? {} : { maxBytes: settings.runsSizeLimitMb * 1024 * 1024 },
3607
- ...traceId === void 0 ? {} : { traceId }
3608
- }) : void 0;
3609
- const profile = registration.defaults.settings.profile;
3610
- const scope = {
3611
- runId: recording?.runId ?? newRunId(new Date(startedAt), command),
3612
- command,
3613
- startedAt,
3614
- ...profile === void 0 ? {} : { profile },
3615
- ...traceId === void 0 ? {} : { traceId },
3616
- ...recording ? { events: recording.events } : {}
3617
- };
3618
- const work = /* @__PURE__ */ __name(() => inRun(scope, () => {
3619
- const input = inputOf(definition, syncAllowedFor(key2, registration.defaults));
3620
- const parsed = safeParse(input, args);
3621
- return parsed.success ? run(key2, definition, parsed.output, ctx) : failed(new CliError("validation_error", `${commandOf(key2, definition)}: ${summarize(parsed.issues)}`, {
3622
- arguments: toJsonSchema(input)
3623
- }), app?.errors);
3624
- }), "work");
3625
- const result = await (caller ? withCaller(caller, work) : work());
3626
- if (recording) {
3627
- if (result.isError) {
3628
- const error = result.structuredContent?.error;
3629
- const code = error?.code && errorCodes.includes(error.code) ? error.code : void 0;
3630
- await recording.fail(code ? new CliError(code, "MCP operation failed") : new Error("MCP operation failed")).catch(() => void 0);
3631
- } else
3632
- await recording.succeed(result.structuredContent).catch(() => void 0);
3633
- }
3634
- await log?.({
3635
- tool: key2,
3636
- tier: tierOf(key2, definition, registration.messenger),
3637
- ...outcomeOf(result),
3638
- startedAt,
3639
- finishedAt: Date.now()
3640
- }, caller)?.catch(() => void 0);
3641
- return result;
3642
- };
3643
- }, "entryRunner");
3644
- var callRunner = /* @__PURE__ */ __name(({ messenger, session, withStore, withServices, defaults, around, targets }) => {
3645
- const where = {
3646
- profile: defaults.settings.profile,
3647
- env: defaults.env,
3648
- pictures: defaults.settings.pictureSearch,
3649
- reranker: defaults.settings.searchReranker
3650
- };
3651
- return async (key2, definition, args, ctx) => {
3652
- const path = commandOf(key2, definition).split(" ");
3653
- const run = `mcp ${path.join(" ")}`;
3654
- try {
3655
- const execute = /* @__PURE__ */ __name(async () => {
3656
- const syncAllowed = syncAllowedFor(key2, defaults);
3657
- if (Buffer.byteLength(JSON.stringify(args)) > MAX_BUFFERED_INPUT)
3658
- throw new CliError("validation_error", "tool arguments exceed the buffered input limit", {
3659
- reason: "input.too-large",
3660
- max_bytes: MAX_BUFFERED_INPUT,
3661
- retryable: false
3662
- });
3663
- definition.check?.(args);
3664
- if (definition.changesStore)
3665
- refuseStoreChange(messenger.app, defaults.env);
3666
- refuseLacking(messenger, path);
3667
- for (const permission of readKeysForCommand(path)) {
3668
- if (levelFor(defaults.settings.permissions ?? {}, permission).level === "deny")
3669
- throw new CliError("permission_error", `profile denies ${permission}`, { permission });
3670
- }
3671
- if (args.sync_first && !syncAllowed)
3672
- throw new CliError("permission_error", "messages.sync-first is not allowed by this profile");
3673
- if (definition.custom) {
3674
- const result2 = await definition.custom(args, { ...defaults, signal: ctx.mcpReq.signal }, ctx);
3675
- return answered(result2, definition.outputLimit?.(args, defaults), targets);
3676
- }
3677
- if (definition.local)
3678
- return answered(await definition.local(args, defaults), definition.outputLimit?.(args, defaults), targets);
3679
- const { online, stored: local, served } = definition;
3680
- const stored = local && (!definition.storedWhen || definition.storedWhen(args)) ? local : void 0;
3681
- const result = stored ? await withStore((store, account) => stored(store, account, args, { ...defaults, signal: ctx.mcpReq.signal }, (work) => session.use(run, work)), {
3682
- name: run
3683
- }) : served && withServices ? await withServices((services, connect) => served(services, args, defaults, connect), { name: run }) : served && messenger.history === "store" ? await withStore((store, account) => served(servicesFor({
3684
- ...storeModeDeps(messenger, store, account, defaults.guard),
3685
- ...where,
3686
- embedders: defaults.embedders
3687
- }), args, defaults, (work) => session.use(run, async (adapter, release) => {
3688
- try {
3689
- return await work(adapter);
3690
- } finally {
3691
- await release();
3692
- }
3693
- })), { name: run }) : served ? await session.use(run, (adapter, release) => served(servicesFor(onlineDeps(messenger, adapter, defaults.guard, where)), args, defaults, (work) => (async () => {
3694
- try {
3695
- return await work(adapter);
3696
- } finally {
3697
- await release();
3698
- }
3699
- })())) : await session.use(run, (adapter, release) => online(adapter, args, { ...defaults, release }));
3700
- return answered(result, definition.outputLimit?.(args, defaults), targets);
3701
- }, "execute");
3702
- return around ? await around(key2, definition, execute) : await execute();
3703
- } catch (error) {
3704
- return failed(error, messenger?.app?.errors, effectsOf(definition));
3705
- }
3706
- };
3707
- }, "callRunner");
3708
- var outputSchemaOf = /* @__PURE__ */ __name((definition) => {
3709
- if (!definition.output)
3710
- return looseObject({});
3711
- const entity = ENTITIES[definition.output.entity];
3712
- return definition.output.list ? listEnvelopeSchema(entity) : itemEnvelopeSchema(entity);
3713
- }, "outputSchemaOf");
3714
- var Picture = class {
3715
- static {
3716
- __name(this, "Picture");
3717
- }
3718
- bytes;
3719
- mimeType;
3720
- about;
3721
- constructor(bytes, mimeType, about) {
3722
- this.bytes = bytes;
3723
- this.mimeType = mimeType;
3724
- this.about = about;
3725
- }
3726
- };
3727
- var BinaryResource = class {
3728
- static {
3729
- __name(this, "BinaryResource");
3730
- }
3731
- base64;
3732
- mimeType;
3733
- uri;
3734
- about;
3735
- constructor(base64, mimeType, uri, about) {
3736
- this.base64 = base64;
3737
- this.mimeType = mimeType;
3738
- this.uri = uri;
3739
- this.about = about;
3740
- }
3741
- };
3742
- var answered = /* @__PURE__ */ __name((answer, maxBytes = DEFAULT_OUTPUT_BYTES, targets) => {
3743
- const bounded = /* @__PURE__ */ __name((result) => {
3744
- if (maxBytes !== 0 && Buffer.byteLength(JSON.stringify(result.content)) > maxBytes)
3745
- throw new CliError("invalid_response", "tool output exceeds its byte limit \u2014 reduce limit or use a narrower request", { reason: "output.too-large", max_bytes: maxBytes, retryable: false });
3746
- return result;
3747
- }, "bounded");
3748
- if (answer === null || Array.isArray(answer) || typeof answer !== "object")
3749
- throw new CliError("invalid_response", "tool result must be an object", { retryable: false });
3750
- const objectBody = /* @__PURE__ */ __name((value) => {
3751
- const serialized = JSON.parse(agentJson(value));
3752
- if (serialized === null || Array.isArray(serialized) || typeof serialized !== "object")
3753
- throw new CliError("invalid_response", "serialized tool result must be an object", { retryable: false });
3754
- return serialized;
3755
- }, "objectBody");
3756
- if (answer instanceof BinaryResource) {
3757
- const about = sealed(answer.about);
3758
- return bounded({
3759
- structuredContent: objectBody(about),
3760
- content: [
3761
- { type: "resource", resource: { uri: answer.uri, mimeType: answer.mimeType, blob: answer.base64 } },
3762
- { type: "text", text: agentJson(about) }
3763
- ]
3764
- });
3765
- }
3766
- if (answer instanceof Picture) {
3767
- const about = sealed(answer.about);
3768
- return bounded({
3769
- structuredContent: objectBody(about),
3770
- content: [
3771
- { type: "image", data: Buffer.from(answer.bytes).toString("base64"), mimeType: answer.mimeType },
3772
- { type: "text", text: agentJson(about) }
3773
- ]
3774
- });
3775
- }
3776
- const body = objectBody(sealed(targets ? judgedAnswer(answer, targets) : answer));
3777
- return bounded({ content: [{ type: "text", text: JSON.stringify(body) }], structuredContent: body });
3778
- }, "answered");
3779
- var failed = /* @__PURE__ */ __name((error, errors, effects) => {
3780
- const judged = judgedEffects(effects);
3781
- const context = { ...failureContext(errors), ...judged ? { effects: judged } : {} };
3782
- return mcpErrorResult(JSON.parse(agentJson(errorObjectOf(storeDamaged(error), context))));
3783
- }, "failed");
3784
-
3785
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/mcp/surface.js
3786
- import { randomUUID } from "node:crypto";
3787
- var MATCHES = 8;
3788
- var ANSWER = answerSchema();
3789
- var agentAnswer = /* @__PURE__ */ __name((prefix, writes2) => {
3790
- const meta = pipe(looseObject({}), description(`run facts; ${prefix}_tools_search shows the full answer`));
3791
- const next = optional(pipe(array(looseObject({})), description("steps to run next: command and args")));
3792
- return looseObject(writes2 ? { item: optional(unknown()), next, meta } : {
3793
- items: optional(array(unknown())),
3794
- item: optional(unknown()),
3795
- page: optional(looseObject({ has_more: boolean() })),
3796
- next,
3797
- missing: optional(array(looseObject({ field: string(), why: string() }))),
3798
- meta
3799
- });
3800
- }, "agentAnswer");
3801
- var listedAs = /* @__PURE__ */ __name((prefix, writes2) => {
3802
- const checked = toStandardJsonSchema(ANSWER);
3803
- const shown = toStandardJsonSchema(agentAnswer(prefix, writes2))["~standard"].jsonSchema;
3804
- return { "~standard": { ...checked["~standard"], jsonSchema: shown } };
3805
- }, "listedAs");
3806
- var normal = /* @__PURE__ */ __name((command) => command.trim().toLowerCase().split(/[\s_-]+/).join(" "), "normal");
3807
- var STOP_WORDS = new Set("a an the to of in on at by for from with into out about and or but is are be been was were it its this that these those which who whom whose what when where how do does did can could should would will my our your their his her them they we you i one some any all each every another other".split(" "));
3808
- var wordsOf = /* @__PURE__ */ __name((text3) => text3.toLowerCase().split(/[^\p{L}\p{N}]+/u).filter(Boolean), "wordsOf");
3809
- var stem = /* @__PURE__ */ __name((word2) => {
3810
- const bare = word2.replace(/'s$/u, "");
3811
- if (bare.length > 4 && bare.endsWith("ies"))
3812
- return `${bare.slice(0, -3)}y`;
3813
- for (const ending of ["ing", "ed", "es", "s"])
3814
- if (bare.length - ending.length >= 3 && bare.endsWith(ending))
3815
- return bare.slice(0, -ending.length);
3816
- return bare;
3817
- }, "stem");
3818
- var sameWord = /* @__PURE__ */ __name((asked, known) => {
3819
- if (asked === known)
3820
- return true;
3821
- const [short, long] = asked.length <= known.length ? [asked, known] : [known, asked];
3822
- return short.length >= 3 && long.startsWith(short);
3823
- }, "sameWord");
3824
- var fieldsOf2 = /* @__PURE__ */ __name((command, one) => [
3825
- [4, [...wordsOf(command), ...(one.aliases ?? []).flatMap(wordsOf)]],
3826
- [2, wordsOf(one.title)],
3827
- [1, [...wordsOf(one.description), ...(one.keywords ?? []).flatMap(wordsOf), ...Object.keys(one.input.entries)]]
3828
- ].map(([weight, words]) => [weight, [...new Set(words.map(stem))]]), "fieldsOf");
3829
- var search = /* @__PURE__ */ __name((commands, query) => {
3830
- const named = normal(query);
3831
- const all = Object.entries(commands);
3832
- if (!named)
3833
- return all.map((entry) => entry).sort((a, b) => a[0].localeCompare(b[0]));
3834
- const words = [
3835
- ...new Set(wordsOf(query).filter((word2) => word2.length > 1 && !STOP_WORDS.has(word2)).map(stem))
3836
- ];
3837
- return all.map((entry) => {
3838
- const fields = fieldsOf2(entry[0], entry[1]);
3839
- const weights = words.map((word2) => fields.reduce((best, [weight, known]) => known.some((one) => sameWord(word2, one)) ? Math.max(best, weight) : best, 0));
3840
- const matched = weights.filter((weight) => weight > 0).length;
3841
- const exact = normal(entry[0]) === named || (entry[1].aliases ?? []).some((alias) => normal(alias) === named);
3842
- return { entry, matched, rank: (exact ? 1e3 : 0) + matched * 10 + weights.reduce((a, b) => a + b, 0) };
3843
- }).filter(({ matched, rank }) => matched > 0 || rank >= 1e3).sort((a, b) => b.rank - a.rank || a.entry[0].localeCompare(b.entry[0])).map(({ entry }) => entry);
3844
- }, "search");
3845
- var nearest = /* @__PURE__ */ __name((commands, asked) => {
3846
- const words = normal(asked).split(" ");
3847
- return Object.keys(commands).map((one) => ({ one, shared: words.filter((word2) => normal(one).split(" ").includes(word2)).length })).filter(({ shared }) => shared > 0).sort((a, b) => b.shared - a.shared).slice(0, 3).map(({ one }) => one);
3848
- }, "nearest");
3849
- var runnableOnly = /* @__PURE__ */ __name((result, offered) => {
3850
- const body = result.structuredContent;
3851
- if (result.isError || !Array.isArray(body?.next))
3852
- return result;
3853
- const next = body.next.filter((step) => step.command === void 0 || offered(step.command));
3854
- const { next: _, ...rest } = body;
3855
- const kept = next.length > 0 ? { ...rest, next } : rest;
3856
- return {
3857
- ...result,
3858
- structuredContent: kept,
3859
- content: result.content.map((part) => part.type === "text" ? { ...part, text: JSON.stringify(kept) } : part)
3860
- };
3861
- }, "runnableOnly");
3862
- var takesNothing = /* @__PURE__ */ __name((one) => Object.values(one.input.entries).every((entry) => entry.type === "optional"), "takesNothing");
3863
- var sampleOf = /* @__PURE__ */ __name((commands) => {
3864
- const reading = Object.entries(commands).filter(([, one]) => !one.writes);
3865
- const bare = reading.filter(([, one]) => takesNothing(one));
3866
- return bare.find(([command]) => command.endsWith(" list"))?.[0] ?? bare[0]?.[0] ?? reading[0]?.[0] ?? Object.keys(commands)[0] ?? "";
3867
- }, "sampleOf");
3868
- var registerCommands = /* @__PURE__ */ __name((server, prefix, commands, errors, withheld, isMessenger) => {
3869
- const byNormal = new Map(Object.keys(commands).map((command) => [normal(command), command]));
3870
- const messenger = isMessenger ?? Object.keys(commands).some((command) => command.split(" ")[0] === "messages");
3871
- const tasks = messenger ? '"unread", "send message", "chat members"' : '"list", "show", "change a setting"';
3872
- const sample = messenger ? "messages list" : sampleOf(commands);
3873
- const untrusted = messenger ? UNTRUSTED : UNTRUSTED_NEUTRAL;
3874
- server.registerTool(`${prefix}_tools_search`, {
3875
- outputSchema: toStandardJsonSchema(looseObject({})),
3876
- title: "Find a command",
3877
- description: `Find the command for a task \u2014 ${tasks} \u2014 before calling ${prefix}_read or ${prefix}_write with it. Each match gives its command, whether it writes, its arguments and the shape of its answer. With no words, lists every command and title, without arguments.`,
3878
- inputSchema: toStandardJsonSchema(strictObject({ query: optional(pipe(string(), description("words that describe the task"))) })),
3879
- annotations: { ...READ, openWorldHint: false, idempotentHint: true }
3880
- }, async ({ query }) => {
3881
- const found = search(commands, query ?? "");
3882
- const items = query?.trim() ? found.slice(0, MATCHES).map(([command, one]) => ({
3883
- command,
3884
- title: one.title,
3885
- description: one.description,
3886
- writes: one.writes,
3887
- availability: one.availability?.() ?? { available: true },
3888
- arguments: toJsonSchema(one.input),
3889
- output: toJsonSchema(one.output ?? ANSWER)
3890
- })) : found.map(([command, one]) => ({
3891
- command,
3892
- title: one.title,
3893
- writes: one.writes,
3894
- availability: one.availability?.() ?? { available: true }
3895
- }));
3896
- const { next: _paging, ...list } = listOf(`${prefix}_tools_search`, {
3897
- items,
3898
- limit: Math.max(items.length, query?.trim() ? MATCHES : 1),
3899
- has_more: found.length > items.length
3900
- });
3901
- return answered(list);
3902
- });
3903
- const callers = {
3904
- env: process.env,
3905
- client: /* @__PURE__ */ __name(() => server.server.getClientVersion(), "client"),
3906
- connectionId: randomUUID()
3907
- };
3908
- const runner = /* @__PURE__ */ __name((writing) => async ({ command: asked, arguments: given }, ctx) => {
3909
- try {
3910
- const command = byNormal.get(normal(asked));
3911
- const one = command === void 0 ? void 0 : commands[command];
3912
- if (command === void 0 || !one) {
3913
- withheld?.(normal(asked));
3914
- const near = nearest(commands, asked);
3915
- throw new CliError("validation_error", `no command "${asked}" here${near.length ? ` \u2014 did you mean ${near.map((name) => `"${name}"`).join(", ")}?` : ""}; ${prefix}_tools_search finds one`);
3916
- }
3917
- if (one.writes !== writing)
3918
- throw new CliError("validation_error", `"${command}" ${writing ? "only reads" : "writes"}: call it with ${prefix}_${writing ? "read" : "write"}`);
3919
- const args = writing ? agentArguments(given ?? {}) : given ?? {};
3920
- const caller = currentCaller() ?? callerOf(ctx, command.replace(/[ -]/g, "_"), callers);
3921
- if (one.checked)
3922
- return runnableOnly(await withCaller(caller, () => one.run(args, ctx)), (named) => byNormal.has(normal(named)));
3923
- const parsed = safeParse(strictObject(one.input.entries), args);
3924
- if (!parsed.success)
3925
- throw new CliError("validation_error", `${command}: ${summarize(parsed.issues)}`, {
3926
- arguments: toJsonSchema(one.input)
3927
- });
3928
- return runnableOnly(await withCaller(caller, () => one.run(parsed.output, ctx)), (named) => byNormal.has(normal(named)));
3929
- } catch (error) {
3930
- return failed(error, errors);
3931
- }
3932
- }, "runner");
3933
- const call = strictObject({
3934
- command: pipe(string(), minLength(1), description(`a command ${prefix}_tools_search returned: "${sample}"`)),
3935
- arguments: optional(pipe(record(string(), unknown()), description("that command's arguments")))
3936
- });
3937
- server.registerTool(`${prefix}_read`, {
3938
- outputSchema: listedAs(prefix, false),
3939
- title: "Run a reading command",
3940
- description: `Run one command that only reads, with the arguments ${prefix}_tools_search showed. ${untrusted}`,
3941
- inputSchema: toStandardJsonSchema(call),
3942
- annotations: READ
3943
- }, runner(false));
3944
- if (Object.values(commands).some((one) => one.writes))
3945
- server.registerTool(`${prefix}_write`, {
3946
- outputSchema: listedAs(prefix, true),
3947
- title: "Run a writing command",
3948
- description: `Run one command that changes something \u2014 ${messenger ? "sends, edits, deletes, joins" : "creates, edits, deletes"} \u2014 with the arguments ${prefix}_tools_search showed. ${untrusted}`,
3949
- inputSchema: toStandardJsonSchema(call),
3950
- annotations: WRITE
3951
- }, runner(true));
3952
- }, "registerCommands");
3953
- var surfaceCommands = /* @__PURE__ */ __name((tools, registration) => {
3954
- const run = entryRunner(registration);
3955
- return Object.fromEntries(Object.entries(tools).map(([key2, definition]) => [
3956
- commandOf(key2, definition),
3957
- {
3958
- title: definition.title,
3959
- description: definition.description,
3960
- writes: definition.annotations.readOnlyHint !== true,
3961
- input: inputOf(definition, syncAllowedFor(key2, registration.defaults)),
3962
- ...definition.output ? { output: outputSchemaOf(definition) } : {},
3963
- checked: true,
3964
- run: /* @__PURE__ */ __name((args, ctx) => run(key2, definition, args, ctx), "run")
3965
- }
3966
- ]));
3967
- }, "surfaceCommands");
3968
- var outputOf = /* @__PURE__ */ __name(({ entity, view }) => answerSchema(ENTITIES[view ? `${entity}.${view}` : entity] ?? unknown()), "outputOf");
3969
-
3970
3607
  export {
3971
3608
  toolsFromCommands,
3972
- runCommandForAgent,
3973
- message,
3974
- READ,
3975
- WRITE,
3976
- tool,
3977
- chatOf,
3978
- tierOf,
3979
- outcomeOf,
3980
- commandOf,
3981
- toolKey,
3982
- Picture,
3983
- BinaryResource,
3984
- answered,
3985
- failed,
3986
- normal,
3987
- registerCommands,
3988
- surfaceCommands,
3989
- outputOf
3609
+ runCommandForAgent
3990
3610
  };