@wirecat/zoom-cli 0.56.0 → 0.58.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 (147) hide show
  1. package/README.md +1 -1
  2. package/dist/bin/zm.js +35 -5
  3. package/dist/bundle/all-profiles-RS5IWIGR.js +25 -0
  4. package/dist/bundle/answer-policy-R7VZMCGE.js +96 -0
  5. package/dist/bundle/anthropic-5QHQR4WF.js +70 -0
  6. package/dist/bundle/app-server-7LANSZGE.js +232 -0
  7. package/dist/bundle/bun-O6RL6LRQ.js +169 -0
  8. package/dist/bundle/bun-sqlite-PEJM6CS4.js +69 -0
  9. package/dist/bundle/chunk-24DLFGES.js +97 -0
  10. package/dist/bundle/chunk-27P22POE.js +1109 -0
  11. package/dist/bundle/chunk-3SCTDFNO.js +3398 -0
  12. package/dist/bundle/chunk-3SERIWJD.js +36139 -0
  13. package/dist/bundle/chunk-4AURKUDZ.js +60 -0
  14. package/dist/bundle/chunk-4NGLRHWO.js +24 -0
  15. package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
  16. package/dist/bundle/chunk-5DVW77VC.js +789 -0
  17. package/dist/bundle/chunk-6CYLVFXM.js +9 -0
  18. package/dist/bundle/chunk-6FL25KC5.js +264 -0
  19. package/dist/bundle/chunk-7D2CD3E3.js +193 -0
  20. package/dist/bundle/chunk-7GVNQOV6.js +17 -0
  21. package/dist/bundle/chunk-7H3ZRDLW.js +630 -0
  22. package/dist/bundle/chunk-7Z4ANTAK.js +1095 -0
  23. package/dist/bundle/chunk-A6323R5P.js +22 -0
  24. package/dist/bundle/chunk-ADLS6FVG.js +24600 -0
  25. package/dist/bundle/chunk-AIXLOMH4.js +63 -0
  26. package/dist/bundle/chunk-AQDWGJZT.js +188 -0
  27. package/dist/bundle/chunk-B32SF7J3.js +18 -0
  28. package/dist/bundle/chunk-BAQLQIMI.js +1938 -0
  29. package/dist/bundle/chunk-BGILD4CI.js +1109 -0
  30. package/dist/bundle/chunk-BXZ6WSVF.js +100 -0
  31. package/dist/bundle/chunk-CTGI4ES2.js +138 -0
  32. package/dist/bundle/chunk-CVIKKIGE.js +76 -0
  33. package/dist/bundle/chunk-DDYR6DYL.js +78 -0
  34. package/dist/bundle/chunk-DFDN6AUB.js +21 -0
  35. package/dist/bundle/chunk-DP5DX45H.js +151 -0
  36. package/dist/bundle/chunk-DXKVEOSS.js +53 -0
  37. package/dist/bundle/chunk-DXZTLB24.js +120 -0
  38. package/dist/bundle/chunk-G27MRA24.js +82 -0
  39. package/dist/bundle/chunk-HTQTIKWP.js +928 -0
  40. package/dist/bundle/chunk-IYAGQXED.js +433 -0
  41. package/dist/bundle/chunk-K76WFW4I.js +124 -0
  42. package/dist/bundle/chunk-KVHRHBLY.js +884 -0
  43. package/dist/bundle/chunk-L2UIJDWB.js +31 -0
  44. package/dist/bundle/chunk-L3VS3H34.js +482 -0
  45. package/dist/bundle/chunk-MBT7GP7K.js +1970 -0
  46. package/dist/bundle/chunk-MFS52LTZ.js +570 -0
  47. package/dist/bundle/chunk-MMT46EN4.js +29 -0
  48. package/dist/bundle/chunk-MNUTWGSA.js +6094 -0
  49. package/dist/bundle/chunk-N7GAQ27N.js +82 -0
  50. package/dist/bundle/chunk-NDXAZB5Z.js +409 -0
  51. package/dist/bundle/chunk-NOKFJJPA.js +1028 -0
  52. package/dist/bundle/chunk-NW7IMGRR.js +6848 -0
  53. package/dist/bundle/chunk-O5EHUB2V.js +2 -0
  54. package/dist/bundle/chunk-OBZWUNO4.js +160 -0
  55. package/dist/bundle/chunk-PACC5N6T.js +240 -0
  56. package/dist/bundle/chunk-PF25S7L4.js +422 -0
  57. package/dist/bundle/chunk-PKTFZAXG.js +48 -0
  58. package/dist/bundle/chunk-PNBEREOU.js +35626 -0
  59. package/dist/bundle/chunk-POOGFSRA.js +385 -0
  60. package/dist/bundle/chunk-PP3JGQQE.js +3517 -0
  61. package/dist/bundle/chunk-Q2Z3VCM4.js +2 -0
  62. package/dist/bundle/chunk-QCFHL4ES.js +45 -0
  63. package/dist/bundle/chunk-QFGBMS67.js +492 -0
  64. package/dist/bundle/chunk-RUP467ZX.js +948 -0
  65. package/dist/bundle/chunk-RXDIG23Z.js +166 -0
  66. package/dist/bundle/chunk-SIA7HJE2.js +8192 -0
  67. package/dist/bundle/chunk-SL3SXQZ5.js +100 -0
  68. package/dist/bundle/chunk-SV5L36WK.js +19 -0
  69. package/dist/bundle/chunk-T6AAM7UT.js +846 -0
  70. package/dist/bundle/chunk-U6QW67SU.js +18673 -0
  71. package/dist/bundle/chunk-UKR7KH3H.js +288 -0
  72. package/dist/bundle/chunk-UOFOMU3T.js +836 -0
  73. package/dist/bundle/chunk-URO44C5T.js +3570 -0
  74. package/dist/bundle/chunk-UXM7I35J.js +281 -0
  75. package/dist/bundle/chunk-UYJUTZTT.js +73 -0
  76. package/dist/bundle/chunk-VOAVOK4I.js +1146 -0
  77. package/dist/bundle/chunk-VSUY7PDW.js +192 -0
  78. package/dist/bundle/chunk-VYUSEJE4.js +98 -0
  79. package/dist/bundle/chunk-XFCSPOLZ.js +25 -0
  80. package/dist/bundle/chunk-XT7XVPEM.js +538 -0
  81. package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
  82. package/dist/bundle/chunk-YIFIY7ZE.js +58 -0
  83. package/dist/bundle/chunk-YIMI6O7R.js +5292 -0
  84. package/dist/bundle/chunk-YJRMMZI5.js +275 -0
  85. package/dist/bundle/chunk-YSHSCBPM.js +2315 -0
  86. package/dist/bundle/chunk-ZC5UXEIH.js +215 -0
  87. package/dist/bundle/chunk-ZHXIXDH5.js +161 -0
  88. package/dist/bundle/chunk-ZTOAAYFV.js +122 -0
  89. package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
  90. package/dist/bundle/cli-IQTASP44.js +831 -0
  91. package/dist/bundle/command-contract-WHZPF7NA.js +38 -0
  92. package/dist/bundle/config-IP5SGHKN.js +79 -0
  93. package/dist/bundle/dist-WT73DF46.js +136 -0
  94. package/dist/bundle/dist-XUFQCJXW.js +7577 -0
  95. package/dist/bundle/echarts-LD3AI55P.js +42501 -0
  96. package/dist/bundle/embed-XEMH4LNX.js +35 -0
  97. package/dist/bundle/embedder-ZCYKSKAE.js +108 -0
  98. package/dist/bundle/first-run-LGYDLIUM.js +23 -0
  99. package/dist/bundle/first-screen-LYQKPNF4.js +36 -0
  100. package/dist/bundle/folders-5ZBUQHAM.js +13 -0
  101. package/dist/bundle/instructions-RZMSW3OC.js +11 -0
  102. package/dist/bundle/main-NKY3JGXY.js +130 -0
  103. package/dist/bundle/mcp-7OXUHLTO.js +189 -0
  104. package/dist/bundle/mcp-OQBZXELQ.js +165 -0
  105. package/dist/bundle/mcp-VISEXTVC.js +92 -0
  106. package/dist/bundle/meetings-XPBHVZAU.js +215 -0
  107. package/dist/bundle/node-P4E63KXA.js +2340 -0
  108. package/dist/bundle/node-TLZSIHIJ.js +21 -0
  109. package/dist/bundle/node-ZRLYQL7J.js +176 -0
  110. package/dist/bundle/node-sqlite-BBEDYBWO.js +45 -0
  111. package/dist/bundle/oauth-UHVRGKZU.js +17 -0
  112. package/dist/bundle/open-J4FCAUAJ.js +19 -0
  113. package/dist/bundle/output-file-SXV2ANW7.js +63 -0
  114. package/dist/bundle/process-LL77573L.js +91 -0
  115. package/dist/bundle/program-EPMIJCGA.js +5845 -0
  116. package/dist/bundle/prompt-LUUMQTMY.js +12 -0
  117. package/dist/bundle/recognize-EMHQX4XF.js +190 -0
  118. package/dist/bundle/remote-ZXS6D7VB.js +26 -0
  119. package/dist/bundle/rerank-WP7RKZNB.js +49 -0
  120. package/dist/bundle/run-log-GS2L66G6.js +111 -0
  121. package/dist/bundle/serve-L6KLLXK2.js +19 -0
  122. package/dist/bundle/server-NOFYENP5.js +53 -0
  123. package/dist/bundle/server-P5TXAPBY.js +66 -0
  124. package/dist/bundle/services-SPOEWVK3.js +330 -0
  125. package/dist/bundle/speech-6OBAKMND.js +44 -0
  126. package/dist/bundle/state-HN5EJKXQ.js +33 -0
  127. package/dist/bundle/store-LEU3M6IN.js +124 -0
  128. package/dist/bundle/store-ZP2URKET.js +141 -0
  129. package/dist/bundle/store-connection-I53XZ2TS.js +76 -0
  130. package/dist/bundle/store-maintenance-command-PSCHEHHY.js +54 -0
  131. package/dist/bundle/streaming-AK6Q2ZGQ.js +15 -0
  132. package/dist/bundle/tokens-CCM3D4ZT.js +17 -0
  133. package/dist/bundle/zm.js +8 -0
  134. package/dist/contract-overrides.d.ts.map +1 -1
  135. package/dist/contract-overrides.js +29 -17
  136. package/dist/contract-overrides.js.map +1 -1
  137. package/dist/mcp-command.d.ts +3 -2
  138. package/dist/mcp-command.d.ts.map +1 -1
  139. package/dist/mcp-command.js +62 -10
  140. package/dist/mcp-command.js.map +1 -1
  141. package/dist/program-bindings.d.ts.map +1 -1
  142. package/dist/program-bindings.js +1 -0
  143. package/dist/program-bindings.js.map +1 -1
  144. package/dist/version.d.ts +1 -1
  145. package/dist/version.js +1 -1
  146. package/package.json +7 -5
  147. package/skills/zoom-cli/SKILL.md +2 -0
@@ -0,0 +1,2 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
@@ -0,0 +1,160 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ botInstructions
5
+ } from "./chunk-4NGLRHWO.js";
6
+ import {
7
+ answered,
8
+ normal,
9
+ registerCommands,
10
+ runCommandForAgent,
11
+ toolsFromCommands
12
+ } from "./chunk-3SCTDFNO.js";
13
+ import {
14
+ agentJson,
15
+ skillResource
16
+ } from "./chunk-XT7XVPEM.js";
17
+ import {
18
+ callerOf,
19
+ serveStdio
20
+ } from "./chunk-7H3ZRDLW.js";
21
+ import {
22
+ McpServer
23
+ } from "./chunk-5D4AEUVA.js";
24
+ import {
25
+ wholeList
26
+ } from "./chunk-VOAVOK4I.js";
27
+ import {
28
+ changesMessenger,
29
+ flatten,
30
+ itemOf
31
+ } from "./chunk-MNUTWGSA.js";
32
+ import {
33
+ MESSENGER_CHANGE_REFUSAL,
34
+ readOnlyLockOf,
35
+ readOnlyRefusal
36
+ } from "./chunk-XFCSPOLZ.js";
37
+ import {
38
+ mcpErrorResult,
39
+ object
40
+ } from "./chunk-YIMI6O7R.js";
41
+ import {
42
+ __name
43
+ } from "./chunk-ZVVMGPBJ.js";
44
+
45
+ // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/mcp/bot/server.js
46
+ import { randomUUID } from "node:crypto";
47
+ var body = /* @__PURE__ */ __name((command, value) => Array.isArray(value) ? wholeList(`bot ${command}`, value) : value !== null && typeof value === "object" && ("item" in value || "items" in value) ? value : itemOf(value !== null && typeof value === "object" ? value : { value }), "body");
48
+ var createBotServer = /* @__PURE__ */ __name((options) => {
49
+ const { bot, program, settings, env } = options;
50
+ const command = bot.app.command;
51
+ const levels = options.levels ?? (() => settings.permissions);
52
+ const authority = /* @__PURE__ */ __name((path) => options.authority?.(path) === true || path[0] === "config" && (path[1] === "set" || path[1] === "unset"), "authority");
53
+ const catalogue = {
54
+ includeUnavailable: true,
55
+ levels: settings.permissions,
56
+ currentLevels: levels,
57
+ readOnly: readOnlyLockOf(bot.app, env) !== void 0,
58
+ ...options.keyOf ? { keyOf: options.keyOf } : {},
59
+ authority,
60
+ ...options.fetchOnly ? { fetchOnly: options.fetchOnly } : {},
61
+ offline: true,
62
+ // Another bot's copy is this bot's to read only where `read_other_bots` says so.
63
+ ...settings.readOtherBots ? {} : { omit: ["all_bots", "bots"] }
64
+ };
65
+ const tools = [
66
+ ...toolsFromCommands(program.commands, { ...catalogue, root: ["bot"] }),
67
+ ...toolsFromCommands(program.commands.filter((one) => one.path[0] === "config"), {
68
+ ...catalogue,
69
+ omit: ["bot", "personal", "defaults"]
70
+ })
71
+ ];
72
+ const writes = tools.filter((tool) => tool.writes && tool.availability?.().available !== false).map((tool) => tool.command);
73
+ const skill = options.skill ? skillResource(bot.app, options.skill) : void 0;
74
+ let queue = Promise.resolve();
75
+ const invoke = /* @__PURE__ */ __name((path, input, caller) => {
76
+ const next = queue.then(() => runCommandForAgent(program, path, path[0] === "config" ? { ...input, bot: true } : input, {
77
+ profile: settings.profile,
78
+ readOnly: readOnlyLockOf(bot.app, env) !== void 0,
79
+ env,
80
+ levels,
81
+ ...options.keyOf ? { keyOf: options.keyOf } : {},
82
+ authority,
83
+ ...caller ? { caller } : {}
84
+ }));
85
+ queue = next.catch(() => void 0);
86
+ return next;
87
+ }, "invoke");
88
+ const build = /* @__PURE__ */ __name(() => {
89
+ const callers = { env, client: /* @__PURE__ */ __name(() => server.server.getClientVersion(), "client"), connectionId: randomUUID() };
90
+ const server = new McpServer({ name: `${command}-bot-${settings.profile}`, version: bot.app.version }, {
91
+ instructions: botInstructions({
92
+ command,
93
+ name: bot.name ?? command,
94
+ profile: settings.profile,
95
+ writes,
96
+ ...skill ? { skill: skill.instruction } : {}
97
+ })
98
+ });
99
+ if (skill) {
100
+ const { uri, name, title, description, mimeType, read } = skill;
101
+ server.registerResource(name, uri, { title, description, mimeType }, read);
102
+ }
103
+ const commands = Object.fromEntries(tools.map((tool) => [
104
+ tool.command,
105
+ {
106
+ title: tool.title,
107
+ description: tool.description,
108
+ writes: tool.writes,
109
+ availability: tool.availability,
110
+ input: tool.input,
111
+ run: /* @__PURE__ */ __name(async (args, ctx) => {
112
+ const caller = callerOf(ctx, `${command}_${tool.command.replaceAll(" ", "_")}`, callers);
113
+ const answer = await invoke(tool.path, args, caller);
114
+ return "error" in answer ? mcpErrorResult(JSON.parse(agentJson(answer.error))) : answered(body(tool.command, answer.result));
115
+ }, "run")
116
+ }
117
+ ]));
118
+ commands.status = {
119
+ title: "This server's bot and profile",
120
+ description: "Which profile this server speaks for, where its bot token comes from, which bot it is, and which writing commands are on. Sends nothing.",
121
+ writes: false,
122
+ input: object({}),
123
+ run: /* @__PURE__ */ __name(async () => {
124
+ const auth = await invoke(["bot", "auth", "show"], {});
125
+ const shown = "error" in auth ? auth.error : auth.result?.item ?? auth.result;
126
+ return answered(itemOf({
127
+ profile: settings.profile,
128
+ kind: "bot",
129
+ auth: shown,
130
+ writes: tools.filter((tool) => tool.writes && tool.availability?.().available !== false).map((tool) => tool.command),
131
+ permissions: levels()
132
+ }));
133
+ }, "run")
134
+ };
135
+ registerCommands(server, `${command}_bot`, commands, void 0, (asked) => {
136
+ const lock = readOnlyLockOf(bot.app, env);
137
+ const one = flatten(program.commands).find((info) => info.path[0] === "bot" && normal(info.path.slice(1).join(" ")) === asked);
138
+ if (lock && one && changesMessenger(one))
139
+ throw readOnlyRefusal(lock, MESSENGER_CHANGE_REFUSAL);
140
+ }, bot.app.messenger);
141
+ return server;
142
+ }, "build");
143
+ return { build, tools, offered: tools.map((tool) => tool.command) };
144
+ }, "createBotServer");
145
+ var serveBotOverStdio = /* @__PURE__ */ __name(async (options, note) => {
146
+ const { build } = createBotServer(options);
147
+ const handle = serveStdio(build, { onerror: /* @__PURE__ */ __name((error) => note(`mcp: ${error.message}`), "onerror") });
148
+ await new Promise((resolve) => {
149
+ process.stdin.once("end", resolve);
150
+ process.stdin.once("close", resolve);
151
+ process.once("SIGINT", resolve);
152
+ process.once("SIGTERM", resolve);
153
+ });
154
+ await handle.close();
155
+ }, "serveBotOverStdio");
156
+
157
+ export {
158
+ createBotServer,
159
+ serveBotOverStdio
160
+ };
@@ -0,0 +1,240 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ QUERY_REASONS
5
+ } from "./chunk-UOFOMU3T.js";
6
+ import {
7
+ defineReasons
8
+ } from "./chunk-YIMI6O7R.js";
9
+ import {
10
+ __name
11
+ } from "./chunk-ZVVMGPBJ.js";
12
+
13
+ // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/errors/reasons.js
14
+ var validation = /* @__PURE__ */ __name((reason, message) => [reason, "validation_error", message], "validation");
15
+ var QUERY = [
16
+ ["query.aborted", "the search was stopped before it finished"],
17
+ ["query.conflict", "two parts of the query contradict each other"],
18
+ ["query.invalid-context", "the context size is out of range"],
19
+ ["query.invalid-limit", "the limit is out of range"],
20
+ ["query.invalid-scope", "the query selects no account"],
21
+ ["query.invalid-duration", "a duration in the query cannot be read"],
22
+ ["query.invalid-size", "a size in the query cannot be read"],
23
+ ["query.invalid-reference", "a reference in the query is not valid"],
24
+ ["query.invalid-tag", "a tag in the query is not valid"],
25
+ ["query.invalid-topic", "a topic in the query is not valid"],
26
+ ["query.topic-scope", "a topic needs its chat in the query"]
27
+ ].map(([reason, message]) => validation(reason, message));
28
+ var SIGN_IN = [
29
+ ["oauth.declined", "authentication_error", "the provider's consent was declined"],
30
+ ["oauth.timeout", "timeout", "the sign-in was not finished in time"],
31
+ ["oauth.mismatch", "authentication_error", "the pasted sign-in result belongs to another sign-in"],
32
+ ["oauth.missing", "authentication_error", "this profile is not signed in"],
33
+ ["oauth.locked", "provider_unavailable", "another process holds this sign-in's lock"],
34
+ ["oauth.no-response", "outcome_unknown", "the token request did not finish"],
35
+ ["oauth.unavailable", "provider_unavailable", "the provider's token endpoint is unavailable"],
36
+ ["oauth.expired", "authentication_error", "the provider refused the saved sign-in; sign in again"],
37
+ ["oauth.invalid-response", "invalid_response", "the provider's token response could not be used"],
38
+ ["oauth.failed", "authentication_error", "the provider returned no offline refresh token"],
39
+ ["oauth.revoke-failed", "outcome_unknown", "the provider did not confirm the revoke"],
40
+ ["oauth.invalid", "authentication_error", "the saved sign-in cannot be read"],
41
+ ["oauth.not-saved", "configuration_error", "the sign-in cannot be saved or read where it is kept"]
42
+ ];
43
+ var OTHERS = [
44
+ ["model.offline", "permission_error", "downloading a model needs the network; --offline was requested"],
45
+ [
46
+ "contract.unacknowledged-override",
47
+ "configuration_error",
48
+ "a shared command contract changed without an explicit override"
49
+ ],
50
+ validation("context.read-budget", "the selected context reads exceed their text or request allowance"),
51
+ validation("meeting-findings.stale", "meeting findings changed since they were read; stage a new batch"),
52
+ validation("meeting-findings.dedicated-review", "review meeting findings through the dedicated findings command"),
53
+ validation("evidence-findings.stale", "evidence findings changed since they were read; stage a new batch"),
54
+ validation("evidence-findings.dedicated-review", "review evidence findings through the dedicated findings command"),
55
+ validation("document.changed", "the document changed while it was read; nothing was saved"),
56
+ ["document.not-imported", "not_found", "the document is not imported in this source account"],
57
+ ["extraction.invalid-proposals", "invalid_response", "the model's memory proposals could not be used"],
58
+ validation("extraction.text-too-long", "the text is too long for memory extraction"),
59
+ validation("file.locked", "another process holds the file's lock"),
60
+ ["mail.source-failed", "provider_error", "the mail server refused or did not complete a request"],
61
+ ["mirror.partial", "provider_error", "some mirrored files were not synced"],
62
+ ["profile.wrong-account", "authentication_error", "the signed-in source account does not match this profile"],
63
+ validation("push.too-many-files", "the folder holds more files than one push takes"),
64
+ validation("push.unreadable", "the folder to push could not be read"),
65
+ validation("spreadsheet.unreadable", "the workbook could not be read"),
66
+ ["state.invalid", "configuration_error", "the saved sync state is unreadable or invalid; it is kept, not reset"],
67
+ ["sync.partial", "provider_error", "some calendars did not sync; the next sync retries them"],
68
+ validation("event.conflict", "the event changed at the provider since the last sync; sync and try again"),
69
+ validation("event.notify-required", "the event has other attendees; say whether to notify them"),
70
+ validation("event.repeat-invalid", "the repeat rule is outside the RFC 5545 subset the calendars take"),
71
+ validation("event.repeat-kind", "the series' rule holds a date or a time of the kind the event is leaving"),
72
+ ["busy.offline", "permission_error", "calendars busy asks the provider; --offline was given"],
73
+ validation("busy.no-calendars", "no calendar syncs and no person was named, so there is nobody to ask"),
74
+ validation("store.refused", "the local store refused the document text"),
75
+ ["store.not-writable", "permission_error", "the message store cannot be written from this process"],
76
+ [
77
+ "store.vector-extension-missing",
78
+ "configuration_error",
79
+ "the install has no sqlite-vec extension for this platform; reinstall the CLI"
80
+ ],
81
+ ["store.vector-extension-failed", "configuration_error", "the sqlite-vec extension did not load; reinstall the CLI"],
82
+ validation("store.vector-invalid", "a vector to store had a non-finite value"),
83
+ validation("catalog.scope-limit", "the selected catalog exceeds its entry limit"),
84
+ validation("evidence.row-too-large", "one evidence row is over its size limit"),
85
+ validation("index.not-ready", "the search index is still being built"),
86
+ validation("input.closed", "the input closed before the answer"),
87
+ validation("input.required", "the command needs an answer and cannot ask for one"),
88
+ validation("input.too-large", "the input is over its size limit"),
89
+ ["meeting-project.stale", "configuration_error", "the meeting's project changed meanwhile"],
90
+ validation("memory.evidence-required", "a memory needs its evidence"),
91
+ validation("memory.scope-required", "a memory needs its scope"),
92
+ ["model.not-downloaded", "not_found", "the model is not downloaded on this machine"],
93
+ validation("name.invalid", "the name is not valid"),
94
+ validation("output.choose-fields", "at a terminal, --json names the fields it prints"),
95
+ validation("output.one-object", "a report is one JSON object; --jsonl streams lists only"),
96
+ validation("output.unknown-field", "the answer has no field by that name"),
97
+ validation("name.taken", "the name is already used"),
98
+ validation("period.ambiguous", "the period can be read more than one way"),
99
+ validation("proposal.wrong-state", "the proposal is not in a state that allows this"),
100
+ validation("ranking.invalid", "the ranking is not valid"),
101
+ validation("selection.changed", "the stored selection changed meanwhile"),
102
+ validation("selection.invalid", "the selection is not valid"),
103
+ validation("search.kind", "the saved search belongs to another kind of search: messages or meetings"),
104
+ ["selection.out-of-scope", "permission_error", "the selection reaches outside what this profile may read"],
105
+ validation("stemmer.invalid", "the stemmer is not valid for that script"),
106
+ validation("stemmer.newer", "the stems were built by a newer tool"),
107
+ validation("stemmer.unknown", "the store asks for stemmers this tool does not know"),
108
+ validation("tag-review.over-budget", "the tag review is over its budget"),
109
+ validation("tag-review.required", "the tag needs the owner's review first"),
110
+ ["tag-review.stale", "configuration_error", "the tag review changed meanwhile"],
111
+ validation("tag.invalid", "the tag is not valid"),
112
+ validation("task.category-unknown", "the category is not in the task category list"),
113
+ validation("task.claimed", "someone else holds the task"),
114
+ validation("task.closed", "the task is already closed"),
115
+ validation("task.dependency-cycle", "the task would depend on itself"),
116
+ validation("task.duplicate-candidates", "open tasks may be the same job: attach to one, or add it as new"),
117
+ validation("task.certainty-required", "an agent closes a task with its certainty, 0 to 1"),
118
+ ["task.pair-decided", "permission_error", "the owner already decided the pair; an agent does not change it"],
119
+ validation("task.no-close-suggestion", "the task has no agent's close waiting on the owner"),
120
+ validation("task.merged", "the task was merged into another; use that one"),
121
+ validation("task.not-merged", "the task was not merged into another"),
122
+ ["upgrade.install-failed", "provider_error", "the installer failed; the old version stays"],
123
+ ["topic.owner-only", "permission_error", "only the owner may use this topic"],
124
+ ["vocabulary.alias-conflict", "configuration_error", "two vocabulary entries claim one alias"],
125
+ validation("vocabulary.consolidation-over-budget", "the selected tag dependencies exceed the preview budget"),
126
+ validation("vocabulary.over-byte-budget", "the vocabulary is over its size budget"),
127
+ validation("vocabulary.over-entry-budget", "the vocabulary has too many entries"),
128
+ ["vocabulary.stale", "configuration_error", "the vocabulary changed meanwhile"]
129
+ ];
130
+ var INPUT_FIELD_REASONS = defineReasons([
131
+ {
132
+ reason: "input.field-conflict",
133
+ code: "validation_error",
134
+ message: "the input fields conflict",
135
+ details: ["fields"]
136
+ },
137
+ {
138
+ reason: "input.field-unsupported",
139
+ code: "validation_error",
140
+ message: "the input field is not supported",
141
+ details: ["fields"]
142
+ }
143
+ ]);
144
+ var REASONS = defineReasons([
145
+ ...QUERY_REASONS,
146
+ ...INPUT_FIELD_REASONS,
147
+ ...[...QUERY, ...SIGN_IN, ...OTHERS].map(([reason, code, message]) => ({
148
+ reason,
149
+ code,
150
+ message,
151
+ details: reason === "vocabulary.consolidation-over-budget" ? ["table"] : []
152
+ }))
153
+ ]);
154
+ var DETAILS = [
155
+ "contracts",
156
+ "allowed",
157
+ "alternative",
158
+ "arguments",
159
+ "at",
160
+ "available",
161
+ "batch",
162
+ "budget",
163
+ "built",
164
+ "candidates",
165
+ "chat",
166
+ "chat_id",
167
+ "cli",
168
+ "complete",
169
+ "emitted_bytes",
170
+ "exact",
171
+ "forum",
172
+ "guide",
173
+ "hint",
174
+ "id",
175
+ "index",
176
+ "kind",
177
+ "limit",
178
+ "limit_source",
179
+ "max_bytes",
180
+ "model",
181
+ "name",
182
+ "operation_id",
183
+ "operation_ids",
184
+ "text_limit",
185
+ "store_refused_in",
186
+ "partial_output",
187
+ "path",
188
+ "permission",
189
+ "person_ids",
190
+ "previous_chat_id",
191
+ "profiles",
192
+ "provider_error",
193
+ "provider",
194
+ "recovery",
195
+ "reference",
196
+ "remembered",
197
+ "retry_at",
198
+ "runtime",
199
+ "saved",
200
+ "scheduled_for",
201
+ "script",
202
+ "sent",
203
+ "sent_count",
204
+ "settlement_failed",
205
+ "span",
206
+ "sqlite",
207
+ "stage",
208
+ "standing",
209
+ "state",
210
+ "stderr",
211
+ "term",
212
+ "total",
213
+ "upgraded",
214
+ "wanted"
215
+ ];
216
+ var SHARED = { reasons: REASONS, details: DETAILS };
217
+ var merged = /* @__PURE__ */ new WeakMap();
218
+ var failureContext = /* @__PURE__ */ __name((errors) => {
219
+ if (!errors)
220
+ return SHARED;
221
+ const known = merged.get(errors);
222
+ if (known)
223
+ return known;
224
+ const unnamed = (errors.details ?? []).filter((key) => !/^[a-z][a-z0-9]*(_[a-z0-9]+)*$/.test(key));
225
+ if (unnamed.length > 0)
226
+ throw new Error(`error details must be snake_case: ${unnamed.join(", ")}`);
227
+ const context = {
228
+ reasons: defineReasons([...REASONS, ...errors.reasons ?? []]),
229
+ details: [.../* @__PURE__ */ new Set([...DETAILS, ...errors.details ?? []])]
230
+ };
231
+ merged.set(errors, context);
232
+ return context;
233
+ }, "failureContext");
234
+
235
+ export {
236
+ INPUT_FIELD_REASONS,
237
+ REASONS,
238
+ DETAILS,
239
+ failureContext
240
+ };