@wirecat/mail-cli 0.0.0-stage → 0.1.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 (226) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/LICENSE +204 -0
  3. package/README.md +141 -2
  4. package/dist/bin/mail.d.ts +3 -0
  5. package/dist/bin/mail.d.ts.map +1 -0
  6. package/dist/bin/mail.js +36 -0
  7. package/dist/bin/mail.js.map +1 -0
  8. package/dist/bundle/all-profiles-TKMBELRZ.js +286 -0
  9. package/dist/bundle/anthropic-7LMUAEIZ.js +72 -0
  10. package/dist/bundle/app-server-JGMIJDD4.js +229 -0
  11. package/dist/bundle/bun-XRO6XJHQ.js +169 -0
  12. package/dist/bundle/bun-sqlite-Z54LEHVM.js +71 -0
  13. package/dist/bundle/chunk-2LLNPNMB.js +24 -0
  14. package/dist/bundle/chunk-3E3WA2L6.js +1932 -0
  15. package/dist/bundle/chunk-3KEVLSNN.js +138 -0
  16. package/dist/bundle/chunk-3KOA73LS.js +3416 -0
  17. package/dist/bundle/chunk-4E7BN3TC.js +122 -0
  18. package/dist/bundle/chunk-4FEMINO2.js +409 -0
  19. package/dist/bundle/chunk-5BVIWP3S.js +71 -0
  20. package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
  21. package/dist/bundle/chunk-5NYMNSSO.js +264 -0
  22. package/dist/bundle/chunk-5WGEUDE4.js +27 -0
  23. package/dist/bundle/chunk-6MAZWSC3.js +132 -0
  24. package/dist/bundle/chunk-75CWWETH.js +379 -0
  25. package/dist/bundle/chunk-7SXGLT6T.js +444 -0
  26. package/dist/bundle/chunk-BTQX2ZSZ.js +288 -0
  27. package/dist/bundle/chunk-CEW6KIFA.js +1193 -0
  28. package/dist/bundle/chunk-CH6RXYAX.js +82 -0
  29. package/dist/bundle/chunk-D72URWJE.js +532 -0
  30. package/dist/bundle/chunk-DFDN6AUB.js +21 -0
  31. package/dist/bundle/chunk-EOEDICIE.js +6848 -0
  32. package/dist/bundle/chunk-F6D6PJ34.js +100 -0
  33. package/dist/bundle/chunk-FDCGTODC.js +78 -0
  34. package/dist/bundle/chunk-FZ5FXIG6.js +18 -0
  35. package/dist/bundle/chunk-GAH7N7HO.js +8181 -0
  36. package/dist/bundle/chunk-GK4M2SUP.js +195 -0
  37. package/dist/bundle/chunk-GN62YOT5.js +161 -0
  38. package/dist/bundle/chunk-GQQJOH7A.js +7050 -0
  39. package/dist/bundle/chunk-GWDCKUBI.js +781 -0
  40. package/dist/bundle/chunk-HTQTIKWP.js +928 -0
  41. package/dist/bundle/chunk-IK5TH3O7.js +217 -0
  42. package/dist/bundle/chunk-J3QXTBD2.js +2742 -0
  43. package/dist/bundle/chunk-J6MSJLIW.js +45 -0
  44. package/dist/bundle/chunk-JBBZCTTF.js +76 -0
  45. package/dist/bundle/chunk-JVMVLITS.js +260 -0
  46. package/dist/bundle/chunk-K4FVKPDQ.js +525 -0
  47. package/dist/bundle/chunk-KHTO2Q6E.js +886 -0
  48. package/dist/bundle/chunk-KM7Q67Z3.js +63 -0
  49. package/dist/bundle/chunk-LQ37ALDJ.js +2416 -0
  50. package/dist/bundle/chunk-MNOIRJEO.js +2315 -0
  51. package/dist/bundle/chunk-MS53RALV.js +168 -0
  52. package/dist/bundle/chunk-NK7EB63L.js +36225 -0
  53. package/dist/bundle/chunk-NPGVOZVK.js +2 -0
  54. package/dist/bundle/chunk-OTUOZ33L.js +82 -0
  55. package/dist/bundle/chunk-P7P5MNAU.js +46 -0
  56. package/dist/bundle/chunk-QLEUNU6G.js +537 -0
  57. package/dist/bundle/chunk-QQB7WT7R.js +216 -0
  58. package/dist/bundle/chunk-QX7RCLRS.js +23 -0
  59. package/dist/bundle/chunk-T6464KYA.js +35130 -0
  60. package/dist/bundle/chunk-TE5U5OAM.js +73 -0
  61. package/dist/bundle/chunk-TI6VBZKJ.js +166 -0
  62. package/dist/bundle/chunk-TQFCPUIM.js +53 -0
  63. package/dist/bundle/chunk-TVREDYX4.js +3574 -0
  64. package/dist/bundle/chunk-TWPDVUBR.js +106 -0
  65. package/dist/bundle/chunk-TWTATDM7.js +461 -0
  66. package/dist/bundle/chunk-UH4DDRHA.js +2989 -0
  67. package/dist/bundle/chunk-VEIZZRQ5.js +630 -0
  68. package/dist/bundle/chunk-WLFLBWNH.js +54 -0
  69. package/dist/bundle/chunk-WXAXYJJ7.js +486 -0
  70. package/dist/bundle/chunk-XQUUANA2.js +24600 -0
  71. package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
  72. package/dist/bundle/chunk-YO4CUH5E.js +33 -0
  73. package/dist/bundle/chunk-YPQQ5J4X.js +849 -0
  74. package/dist/bundle/chunk-Z34ICZA3.js +1028 -0
  75. package/dist/bundle/chunk-ZANYM66S.js +58 -0
  76. package/dist/bundle/chunk-ZD3WUGR2.js +142 -0
  77. package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
  78. package/dist/bundle/command-contract-WU434ZUL.js +34 -0
  79. package/dist/bundle/decode-YB3ZDTES.js +162 -0
  80. package/dist/bundle/dispatch-EUKKT3PD.js +411 -0
  81. package/dist/bundle/dist-A6GKSKFC.js +2072 -0
  82. package/dist/bundle/dist-X36THCOF.js +7577 -0
  83. package/dist/bundle/echarts-YNGCOYHW.js +42501 -0
  84. package/dist/bundle/embed-LWNHIRBQ.js +37 -0
  85. package/dist/bundle/embedder-2LYD3U37.js +110 -0
  86. package/dist/bundle/failure-OAIC5VAP.js +24 -0
  87. package/dist/bundle/first-run-N3HJKGU7.js +27 -0
  88. package/dist/bundle/first-screen-4U2DMV3G.js +32 -0
  89. package/dist/bundle/instructions-GJHHFV64.js +11 -0
  90. package/dist/bundle/mail.js +166 -0
  91. package/dist/bundle/mcp-L7SRVDRN.js +167 -0
  92. package/dist/bundle/node-GFOH6FKP.js +176 -0
  93. package/dist/bundle/node-KM3CUABH.js +2340 -0
  94. package/dist/bundle/node-TLZSIHIJ.js +21 -0
  95. package/dist/bundle/node-sqlite-NBXQXBIU.js +63 -0
  96. package/dist/bundle/oauth-56EFO5AQ.js +19 -0
  97. package/dist/bundle/open-2V7QZQJP.js +21 -0
  98. package/dist/bundle/openai-V3SVACVL.js +251 -0
  99. package/dist/bundle/process-XVDX4SPD.js +91 -0
  100. package/dist/bundle/program-ILID6EAT.js +35542 -0
  101. package/dist/bundle/prompt-YKWAI222.js +14 -0
  102. package/dist/bundle/recognize-PAR66KVM.js +25 -0
  103. package/dist/bundle/remote-CE43TKXC.js +28 -0
  104. package/dist/bundle/rerank-M7S7P2TW.js +51 -0
  105. package/dist/bundle/serve-ENPMIV6J.js +197 -0
  106. package/dist/bundle/server-JRTHUCVY.js +63 -0
  107. package/dist/bundle/server-MBEZLVKZ.js +189 -0
  108. package/dist/bundle/sqlite-runtime-HVGDHBJJ.js +18 -0
  109. package/dist/bundle/state-QZSOSKBD.js +35 -0
  110. package/dist/bundle/store-2BUX6LVX.js +124 -0
  111. package/dist/bundle/store-UJ7SNKXI.js +141 -0
  112. package/dist/bundle/store-maintenance-command-I7V5C44K.js +52 -0
  113. package/dist/commands/account.d.ts +3 -0
  114. package/dist/commands/account.d.ts.map +1 -0
  115. package/dist/commands/account.js +47 -0
  116. package/dist/commands/account.js.map +1 -0
  117. package/dist/commands/context.d.ts +41 -0
  118. package/dist/commands/context.d.ts.map +1 -0
  119. package/dist/commands/context.js +52 -0
  120. package/dist/commands/context.js.map +1 -0
  121. package/dist/commands/doctor.d.ts +77 -0
  122. package/dist/commands/doctor.d.ts.map +1 -0
  123. package/dist/commands/doctor.js +74 -0
  124. package/dist/commands/doctor.js.map +1 -0
  125. package/dist/commands/folders.d.ts +3 -0
  126. package/dist/commands/folders.d.ts.map +1 -0
  127. package/dist/commands/folders.js +36 -0
  128. package/dist/commands/folders.js.map +1 -0
  129. package/dist/commands/login.d.ts +5 -0
  130. package/dist/commands/login.d.ts.map +1 -0
  131. package/dist/commands/login.js +21 -0
  132. package/dist/commands/login.js.map +1 -0
  133. package/dist/commands/mailbox.d.ts +16 -0
  134. package/dist/commands/mailbox.d.ts.map +1 -0
  135. package/dist/commands/mailbox.js +54 -0
  136. package/dist/commands/mailbox.js.map +1 -0
  137. package/dist/commands/mcp.d.ts +3 -0
  138. package/dist/commands/mcp.d.ts.map +1 -0
  139. package/dist/commands/mcp.js +97 -0
  140. package/dist/commands/mcp.js.map +1 -0
  141. package/dist/commands/session.d.ts +3 -0
  142. package/dist/commands/session.d.ts.map +1 -0
  143. package/dist/commands/session.js +211 -0
  144. package/dist/commands/session.js.map +1 -0
  145. package/dist/commands/setup.d.ts +3 -0
  146. package/dist/commands/setup.d.ts.map +1 -0
  147. package/dist/commands/setup.js +156 -0
  148. package/dist/commands/setup.js.map +1 -0
  149. package/dist/commands/status.d.ts +3 -0
  150. package/dist/commands/status.d.ts.map +1 -0
  151. package/dist/commands/status.js +89 -0
  152. package/dist/commands/status.js.map +1 -0
  153. package/dist/commands/sync.d.ts +3 -0
  154. package/dist/commands/sync.d.ts.map +1 -0
  155. package/dist/commands/sync.js +190 -0
  156. package/dist/commands/sync.js.map +1 -0
  157. package/dist/config.d.ts +190 -0
  158. package/dist/config.d.ts.map +1 -0
  159. package/dist/config.js +46 -0
  160. package/dist/config.js.map +1 -0
  161. package/dist/discovery.d.ts +42 -0
  162. package/dist/discovery.d.ts.map +1 -0
  163. package/dist/discovery.js +179 -0
  164. package/dist/discovery.js.map +1 -0
  165. package/dist/identity.d.ts +5 -0
  166. package/dist/identity.d.ts.map +1 -0
  167. package/dist/identity.js +16 -0
  168. package/dist/identity.js.map +1 -0
  169. package/dist/index.d.ts +3 -0
  170. package/dist/index.d.ts.map +1 -0
  171. package/dist/index.js +3 -0
  172. package/dist/index.js.map +1 -0
  173. package/dist/mail/imap-errors.d.ts +4 -0
  174. package/dist/mail/imap-errors.d.ts.map +1 -0
  175. package/dist/mail/imap-errors.js +41 -0
  176. package/dist/mail/imap-errors.js.map +1 -0
  177. package/dist/mail/imap-messages.d.ts +18 -0
  178. package/dist/mail/imap-messages.d.ts.map +1 -0
  179. package/dist/mail/imap-messages.js +66 -0
  180. package/dist/mail/imap-messages.js.map +1 -0
  181. package/dist/mail/imap.d.ts +67 -0
  182. package/dist/mail/imap.d.ts.map +1 -0
  183. package/dist/mail/imap.js +348 -0
  184. package/dist/mail/imap.js.map +1 -0
  185. package/dist/mail/parse.d.ts +18 -0
  186. package/dist/mail/parse.d.ts.map +1 -0
  187. package/dist/mail/parse.js +31 -0
  188. package/dist/mail/parse.js.map +1 -0
  189. package/dist/mail/port.d.ts +50 -0
  190. package/dist/mail/port.d.ts.map +1 -0
  191. package/dist/mail/port.js +4 -0
  192. package/dist/mail/port.js.map +1 -0
  193. package/dist/mcp.d.ts +29 -0
  194. package/dist/mcp.d.ts.map +1 -0
  195. package/dist/mcp.js +98 -0
  196. package/dist/mcp.js.map +1 -0
  197. package/dist/profile.d.ts +16 -0
  198. package/dist/profile.d.ts.map +1 -0
  199. package/dist/profile.js +31 -0
  200. package/dist/profile.js.map +1 -0
  201. package/dist/program.d.ts +6 -0
  202. package/dist/program.d.ts.map +1 -0
  203. package/dist/program.js +52 -0
  204. package/dist/program.js.map +1 -0
  205. package/dist/providers.d.ts +53 -0
  206. package/dist/providers.d.ts.map +1 -0
  207. package/dist/providers.js +106 -0
  208. package/dist/providers.js.map +1 -0
  209. package/dist/secret.d.ts +30 -0
  210. package/dist/secret.d.ts.map +1 -0
  211. package/dist/secret.js +68 -0
  212. package/dist/secret.js.map +1 -0
  213. package/dist/store.d.ts +12 -0
  214. package/dist/store.d.ts.map +1 -0
  215. package/dist/store.js +25 -0
  216. package/dist/store.js.map +1 -0
  217. package/dist/sync.d.ts +26 -0
  218. package/dist/sync.d.ts.map +1 -0
  219. package/dist/sync.js +75 -0
  220. package/dist/sync.js.map +1 -0
  221. package/dist/version.d.ts +2 -0
  222. package/dist/version.d.ts.map +1 -0
  223. package/dist/version.js +2 -0
  224. package/dist/version.js.map +1 -0
  225. package/package.json +83 -4
  226. package/skills/mail-cli/SKILL.md +27 -0
@@ -0,0 +1,3416 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ UNTRUSTED,
5
+ UNTRUSTED_NEUTRAL,
6
+ agentArguments,
7
+ agentJson,
8
+ commandAvailability
9
+ } from "./chunk-K4FVKPDQ.js";
10
+ import {
11
+ failureContext
12
+ } from "./chunk-JVMVLITS.js";
13
+ import {
14
+ callerOf
15
+ } from "./chunk-VEIZZRQ5.js";
16
+ import {
17
+ lentConnection,
18
+ onlineDeps,
19
+ refuseLacking,
20
+ servicesFor,
21
+ storeModeDeps
22
+ } from "./chunk-T6464KYA.js";
23
+ import {
24
+ MAX_BUFFERED_INPUT
25
+ } from "./chunk-CH6RXYAX.js";
26
+ import {
27
+ ENTITIES
28
+ } from "./chunk-TVREDYX4.js";
29
+ import {
30
+ DEFAULT_OUTPUT_BYTES,
31
+ LOCAL_WRITE,
32
+ REMOTE_WRITE,
33
+ answerSchema,
34
+ changesMessenger,
35
+ enclosingTraceId,
36
+ flatten,
37
+ inRun,
38
+ judgedAnswer,
39
+ judgedEffects,
40
+ listOf,
41
+ newRunId,
42
+ refuseStoreChange,
43
+ sealed,
44
+ startRecording,
45
+ traceOf
46
+ } from "./chunk-GQQJOH7A.js";
47
+ import {
48
+ authorityAllowed,
49
+ botApiAllowed,
50
+ keyForCommand,
51
+ levelFor,
52
+ readKeysForCommand
53
+ } from "./chunk-QLEUNU6G.js";
54
+ import {
55
+ currentCaller,
56
+ keepsSuccess,
57
+ runContextOf,
58
+ withCaller
59
+ } from "./chunk-7SXGLT6T.js";
60
+ import {
61
+ captureStreams,
62
+ traceIdOf
63
+ } from "./chunk-J3QXTBD2.js";
64
+ import {
65
+ SNAKE_CASE,
66
+ array,
67
+ boolean,
68
+ description,
69
+ duplicates,
70
+ errorObjectOf,
71
+ integer,
72
+ isoDate,
73
+ itemEnvelopeSchema,
74
+ listEnvelopeSchema,
75
+ literal,
76
+ looseObject,
77
+ maxLength,
78
+ maxValue,
79
+ mcpErrorResult,
80
+ minLength,
81
+ minValue,
82
+ number,
83
+ object,
84
+ optional,
85
+ parseRegistry,
86
+ picklist,
87
+ pipe,
88
+ record,
89
+ regex,
90
+ safeParse,
91
+ strictObject,
92
+ string,
93
+ summarize,
94
+ text,
95
+ toJsonSchema,
96
+ toStandardJsonSchema,
97
+ union,
98
+ unknown,
99
+ word,
100
+ writes
101
+ } from "./chunk-LQ37ALDJ.js";
102
+ import {
103
+ CliError,
104
+ errorCodes
105
+ } from "./chunk-5BVIWP3S.js";
106
+ import {
107
+ __name
108
+ } from "./chunk-ZVVMGPBJ.js";
109
+
110
+ // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/mcp/agent.js
111
+ import { Readable } from "node:stream";
112
+
113
+ // node_modules/.pnpm/@wirecat+cli-base@0.68.1_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
114
+ var LINT_SEVERITIES = ["high", "medium", "low"];
115
+ var lintRuleSchema = strictObject({
116
+ id: word,
117
+ severity: picklist(LINT_SEVERITIES),
118
+ /** What the rule looks at; a violation's target names one of these. */
119
+ scope: picklist(["command", "group", "argument", "option", "flag", "key"]),
120
+ summary: text
121
+ });
122
+ var defineLintRules = /* @__PURE__ */ __name((input) => parseRegistry("lint rules", array(lintRuleSchema), input, (rules) => duplicates(rules.map((rule) => rule.id)).map((id) => `"${id}" is listed twice`)), "defineLintRules");
123
+ var LINT_RULES = defineLintRules([
124
+ {
125
+ id: "unknown-verb",
126
+ severity: "high",
127
+ scope: "command",
128
+ summary: "a command's last word is a verb or view noun from the vocabulary; a top-level one may be a root word; under search, a resource or all"
129
+ },
130
+ {
131
+ id: "unknown-resource",
132
+ severity: "medium",
133
+ scope: "group",
134
+ summary: "a group is a resource from the vocabulary (plural, or a registered singular) or a root word"
135
+ },
136
+ {
137
+ id: "flag-two-meanings",
138
+ severity: "high",
139
+ scope: "flag",
140
+ summary: "a flag takes the same kind of value in every command, and the one the vocabulary gives it"
141
+ },
142
+ { id: "missing-command-help", severity: "high", scope: "command", summary: "every command has a summary" },
143
+ {
144
+ id: "missing-command-effects",
145
+ severity: "high",
146
+ scope: "command",
147
+ summary: "every command that runs declares its effects: each leaf, and a group with an action of its own"
148
+ },
149
+ {
150
+ id: "command-help-too-long",
151
+ severity: "low",
152
+ scope: "command",
153
+ summary: "a summary is at most 80 characters"
154
+ },
155
+ {
156
+ id: "command-example-count",
157
+ severity: "medium",
158
+ scope: "command",
159
+ summary: "a leaf command has one to three examples; generated commands are exempt"
160
+ },
161
+ {
162
+ id: "faulty-help-example-parameters",
163
+ severity: "high",
164
+ scope: "command",
165
+ summary: "an example starts with the tool, runs its own command, and gives only arguments and options it takes"
166
+ },
167
+ { id: "missing-argument-help", severity: "high", scope: "argument", summary: "every argument is described" },
168
+ { id: "missing-option-help", severity: "high", scope: "option", summary: "every option is described" },
169
+ {
170
+ id: "key-casing",
171
+ severity: "high",
172
+ scope: "key",
173
+ summary: "every key of a registered JSON Schema and of the commands document is snake_case"
174
+ },
175
+ {
176
+ id: "filter-flag",
177
+ severity: "high",
178
+ scope: "option",
179
+ summary: "a command that changes nothing filters with its query, not with a flag named after a field of its entity"
180
+ },
181
+ {
182
+ id: "option-role",
183
+ severity: "high",
184
+ scope: "option",
185
+ summary: "every option has a role in the vocabulary; a filter has none, it is a query field"
186
+ },
187
+ {
188
+ id: "list-without-query",
189
+ severity: "medium",
190
+ scope: "command",
191
+ summary: "a list that answers with an entity takes a query over that entity's fields"
192
+ },
193
+ {
194
+ id: "query-example",
195
+ severity: "high",
196
+ scope: "command",
197
+ summary: "every query field's example, and every default term, parses and validates"
198
+ },
199
+ {
200
+ id: "nullable-list",
201
+ severity: "medium",
202
+ scope: "key",
203
+ summary: "a list in a registered JSON Schema is never null: known empty is `[]`, not known is absent"
204
+ },
205
+ {
206
+ id: "flag-synonym",
207
+ severity: "medium",
208
+ scope: "option",
209
+ summary: "an option is not another name for a vocabulary flag: `--max` and `--take` are `--limit`"
210
+ },
211
+ {
212
+ id: "identifier-name",
213
+ severity: "high",
214
+ scope: "key",
215
+ summary: "an identifier key is one from the glossary: `run_id`, never `execution_id` or `log_id`"
216
+ },
217
+ {
218
+ id: "log-attribute-key",
219
+ severity: "high",
220
+ scope: "key",
221
+ summary: "no log attribute key on the allow-list names message text, a token or a phone number"
222
+ },
223
+ {
224
+ id: "missing-run-log",
225
+ severity: "high",
226
+ scope: "group",
227
+ summary: "the CLI keeps a failed run and reads it back: `runs list`, `runs show`, global `--record` and `--no-record`"
228
+ }
229
+ ]);
230
+ var baselineSchema = array(text);
231
+ var overridesSchema = array(strictObject({
232
+ rule: word,
233
+ target: text,
234
+ reason: pipe(text, minLength(10, "say why, in a sentence")),
235
+ /** A GitHub handle or a team, `@octocat`. */
236
+ owner: pipe(string(), regex(/^@[\w.-]+(\/[\w.-]+)?$/, "a GitHub handle or team, such as @octocat")),
237
+ review_after: pipe(string(), isoDate("a date, YYYY-MM-DD"))
238
+ }));
239
+
240
+ // node_modules/.pnpm/@wirecat+cli-base@0.68.1_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
241
+ var auditRuleSchema = strictObject({ id: word, severity: picklist(LINT_SEVERITIES), summary: text });
242
+ 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");
243
+ var AUDIT_RULES = defineAuditRules([
244
+ {
245
+ id: "shared-command-contract",
246
+ severity: "high",
247
+ summary: "core-owned command definitions change only through exact, reasoned overrides"
248
+ },
249
+ {
250
+ id: "required-root",
251
+ severity: "high",
252
+ summary: "every CLI has the required root commands"
253
+ },
254
+ {
255
+ id: "same-path-contract",
256
+ severity: "high",
257
+ summary: "a command path two CLIs of a parity group share has the same options, value names, output and summary; a group that covers the whole tree has the same paths"
258
+ },
259
+ {
260
+ id: "same-flag-meaning",
261
+ severity: "high",
262
+ summary: "a flag takes the same kind of value in every CLI"
263
+ },
264
+ {
265
+ id: "same-entity-schema",
266
+ severity: "high",
267
+ summary: "an output entity two CLIs print has one JSON Schema"
268
+ },
269
+ {
270
+ id: "same-error-reason",
271
+ severity: "medium",
272
+ summary: "an error reason is not a shared reason under another name, and one reason id has one code"
273
+ }
274
+ ]);
275
+ var segment = pipe(string(), regex(/^[a-z][a-z0-9-]*$/, "a command word"));
276
+ var parityGroupSchema = strictObject({
277
+ name: word,
278
+ /** CLI names as `commands --json` prints them in `cli`. */
279
+ members: pipe(array(word), minLength(2)),
280
+ /** `tree` compares every path; otherwise the root words whose paths are compared. */
281
+ covers: union([literal("tree"), pipe(array(segment), minLength(1))]),
282
+ /** Permanent differences, each with its reason; they count against the override budget of the group. */
283
+ differences: array(strictObject({
284
+ rule: word,
285
+ /** `<clis> <path> <flag>`; with `absent`, only `<path> <flag>`: the CLI list is whoever else has it. */
286
+ target: text,
287
+ expected: optional(text),
288
+ /** The CLI that lacks the path or flag by design; the rest must agree, so other CLIs joining do not stale it. */
289
+ absent: optional(word),
290
+ reason: pipe(text, minLength(10, "say why, in a sentence"))
291
+ }))
292
+ });
293
+ var defineParityGroups = /* @__PURE__ */ __name((input) => parseRegistry("parity groups", array(parityGroupSchema), input, (groups) => [
294
+ ...duplicates(groups.map((group) => group.name)).map((name) => `"${name}" is listed twice`),
295
+ ...groups.flatMap((group) => [
296
+ ...duplicates(group.differences.map((entry) => `${entry.rule} ${entry.target}`)).map((both) => `${group.name}: "${both}" is listed twice`),
297
+ ...group.differences.filter((entry) => entry.absent && entry.expected).map((entry) => `${group.name}: "${entry.target}" has \`absent\`, which measures the values itself; drop \`expected\``)
298
+ ])
299
+ ]), "defineParityGroups");
300
+ var PARITY_GROUPS = defineParityGroups([
301
+ { name: "messengers", members: ["tg", "max"], covers: "tree", differences: [] },
302
+ {
303
+ name: "all",
304
+ members: ["tg", "max", "memo", "drive", "zm", "wa", "mail"],
305
+ covers: ["commands", "doctor", "skill", "mcp", "upgrade", "search", "notes", "meetings"],
306
+ differences: ["mcp serve", "mcp revoke", "mcp server start", "mcp server status", "mcp server stop"].map((path) => ({
307
+ rule: "same-path-contract",
308
+ target: `${path} --profiles`,
309
+ absent: "memo",
310
+ 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)"
311
+ }))
312
+ },
313
+ // gcal is compared on what it already shares with every CLI; doctor, mcp, search and skill wait until the published
314
+ // CLIs agree there (https://github.com/WireCatLabs/cli-base/issues/390), then gcal moves back into "all".
315
+ {
316
+ name: "gcal-shared",
317
+ members: ["tg", "max", "memo", "drive", "zm", "wa", "gcal"],
318
+ covers: ["commands", "upgrade", "notes", "meetings"],
319
+ differences: []
320
+ }
321
+ ]);
322
+ var requiredRootSchema = strictObject({ path: pipe(array(segment), minLength(1)), meaning: text });
323
+ 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");
324
+ var REQUIRED_ROOTS = defineRequiredRoots([
325
+ { path: ["commands"], meaning: "the command tree as JSON, what agents and this audit read" },
326
+ { path: ["doctor"], meaning: "checks this machine and the profile, and says what to fix" },
327
+ { path: ["skill", "show"], meaning: "prints the agent skill" },
328
+ { path: ["skill", "install"], meaning: "installs the agent skill" },
329
+ { path: ["mcp"], meaning: "the MCP server" },
330
+ { path: ["upgrade"], meaning: "updates the CLI" }
331
+ ]);
332
+
333
+ // node_modules/.pnpm/@wirecat+cli-base@0.68.1_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
334
+ var fieldRuleSchema = strictObject({ id: word, rule: text });
335
+ 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");
336
+ var FIELD_RULES = defineFieldRules([
337
+ { id: "envelope", rule: "every JSON answer is one object: a list `{items, page, \u2026}`, one thing `{item, \u2026}`" },
338
+ { id: "time", rule: "a time is an ISO 8601 string in UTC, ending in `Z`, never epoch milliseconds" },
339
+ { id: "duration", rule: "a length of time is a number of milliseconds in a key ending in `_ms`" },
340
+ { id: "ref", rule: "a stored thing is named by `ref`; a message's `ref` value is its locator" },
341
+ { id: "snake-case", rule: "keys are snake_case words, no abbreviations a reader has to decode" },
342
+ { id: "one-meaning", rule: "a key has one meaning and one type in every answer of every CLI" },
343
+ {
344
+ id: "absent-null",
345
+ rule: "absent: not asked for or not known; `null`: known to have no value; `[]`: known to be empty, never `null`; `0`: measured, never a stand-in for unknown"
346
+ }
347
+ ]);
348
+
349
+ // node_modules/.pnpm/@wirecat+cli-base@0.68.1_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
350
+ var key = pipe(string(), regex(SNAKE_CASE, "a snake_case key"));
351
+ var identifierSchema = strictObject({ key, meaning: text, replaces: optional(array(key)) });
352
+ var defineIdentifiers = /* @__PURE__ */ __name((input) => parseRegistry("identifiers", array(identifierSchema), input, (identifiers) => {
353
+ const keys = identifiers.map((entry) => entry.key);
354
+ const replaced = identifiers.flatMap((entry) => entry.replaces ?? []);
355
+ return [
356
+ ...duplicates([...keys, ...replaced]).map((name) => `"${name}" is listed twice`),
357
+ ...replaced.filter((name) => keys.includes(name)).map((name) => `"${name}" is both a key and replaced`)
358
+ ];
359
+ }), "defineIdentifiers");
360
+ var IDENTIFIERS = defineIdentifiers([
361
+ {
362
+ key: "run_id",
363
+ meaning: "one invocation of a command, what `runs show` opens",
364
+ replaces: ["execution_id", "invocation_id", "log_id", "diagnostic_id"]
365
+ },
366
+ { key: "operation_id", meaning: "one logical write attempt; a retry of it reuses the id", replaces: ["send_id"] },
367
+ { key: "request_id", meaning: "the provider's own reference for one request, as it sent it" },
368
+ { key: "trace_id", meaning: "the distributed trace a run belongs to, from `traceparent`" }
369
+ ]);
370
+
371
+ // node_modules/.pnpm/@wirecat+cli-base@0.68.1_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
372
+ var CALENDAR_FLAGS = [
373
+ { name: "--end-time", value: "<time>", role: "value", type: "time", meaning: "when it ends" },
374
+ {
375
+ name: "--start-date",
376
+ value: "<date>",
377
+ role: "value",
378
+ type: "time",
379
+ meaning: "the first day of something that lasts whole days, such as an all-day event"
380
+ },
381
+ {
382
+ name: "--end-date",
383
+ value: "<date>",
384
+ role: "value",
385
+ type: "time",
386
+ meaning: "the last day of something that lasts whole days, such as an all-day event"
387
+ },
388
+ { name: "--location", value: "<text>", role: "value", type: "string", meaning: "where it takes place" },
389
+ {
390
+ name: "--attendee",
391
+ value: "<email>",
392
+ role: "value",
393
+ type: "string",
394
+ meaning: "a person invited to the event, by email address; repeat it for more"
395
+ },
396
+ {
397
+ name: "--id",
398
+ value: "<id>",
399
+ role: "value",
400
+ type: "id",
401
+ meaning: "the id to create it with, chosen beforehand, so a retry finds it instead of making a second one"
402
+ },
403
+ {
404
+ name: "--calendar",
405
+ value: "<id>",
406
+ role: "target",
407
+ type: "id",
408
+ meaning: "the calendar it acts on, when the thing is on more than one"
409
+ },
410
+ {
411
+ name: "--repeat",
412
+ value: "<rule>",
413
+ role: "value",
414
+ type: "string",
415
+ meaning: "how it repeats, as an RFC 5545 rule such as FREQ=WEEKLY;BYDAY=MO;COUNT=10"
416
+ },
417
+ {
418
+ name: "--hours",
419
+ value: "<from-to>",
420
+ role: "target",
421
+ type: "string",
422
+ meaning: "the working hours of each day to look in, such as 09:00-17:00, in the owner's time zone"
423
+ },
424
+ {
425
+ name: "--series",
426
+ role: "target",
427
+ type: "switch",
428
+ meaning: "act on the whole repeating event, not only this occurrence"
429
+ },
430
+ {
431
+ name: "--following",
432
+ role: "target",
433
+ type: "switch",
434
+ meaning: "act on this occurrence and every later one of the repeating event"
435
+ },
436
+ {
437
+ name: "--to-calendar",
438
+ value: "<id>",
439
+ role: "target",
440
+ type: "id",
441
+ meaning: "the calendar it moves to, of the same account"
442
+ }
443
+ ];
444
+
445
+ // node_modules/.pnpm/@wirecat+cli-base@0.68.1_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
446
+ var HOW_FLAGS = [
447
+ {
448
+ name: "--limit",
449
+ value: "<n>",
450
+ role: "paging",
451
+ type: "count",
452
+ meaning: "how many items",
453
+ unit: "items",
454
+ replaces: ["--max", "--count", "--take", "--max-results", "--lines", "--limit-groups"]
455
+ },
456
+ {
457
+ name: "--page",
458
+ value: "<n>",
459
+ role: "paging",
460
+ type: "count",
461
+ meaning: "which page, from 1, where the source has no cursor"
462
+ },
463
+ {
464
+ name: "--page-size",
465
+ value: "<n>",
466
+ role: "paging",
467
+ type: "count",
468
+ meaning: "how many items one request to the source asks for",
469
+ unit: "items"
470
+ },
471
+ { name: "--all", role: "paging", type: "switch", meaning: "every item at once, instead of one page or one target" },
472
+ {
473
+ name: "--cursor",
474
+ value: "<cursor>",
475
+ role: "paging",
476
+ type: "cursor",
477
+ meaning: "continue from where the previous page ended",
478
+ replaces: ["--offset"]
479
+ },
480
+ { name: "--before-id", value: "<id>", role: "paging", type: "id", meaning: "read what came before this message id" },
481
+ { name: "--after-id", value: "<id>", role: "paging", type: "id", meaning: "read what came after this message id" },
482
+ {
483
+ name: "--chunk-bytes",
484
+ value: "<n>",
485
+ role: "paging",
486
+ type: "count",
487
+ meaning: "how many bytes one chunk returns",
488
+ unit: "bytes"
489
+ },
490
+ {
491
+ name: "--offset-bytes",
492
+ value: "<n>",
493
+ role: "paging",
494
+ type: "count",
495
+ meaning: "where the chunk starts, in bytes from 0",
496
+ unit: "bytes"
497
+ },
498
+ {
499
+ name: "--before-n",
500
+ value: "<n>",
501
+ role: "output",
502
+ type: "count",
503
+ meaning: "how many messages or transcript lines before it",
504
+ unit: "items"
505
+ },
506
+ {
507
+ name: "--after-n",
508
+ value: "<n>",
509
+ role: "output",
510
+ type: "count",
511
+ meaning: "how many messages or transcript lines after it",
512
+ unit: "items"
513
+ },
514
+ {
515
+ name: "--debug",
516
+ role: "output",
517
+ type: "switch",
518
+ meaning: "on failure, show the full error record: cause and stack"
519
+ },
520
+ {
521
+ name: "--agent-json",
522
+ role: "output",
523
+ type: "switch",
524
+ meaning: "JSON with control and direction characters made visible in strings and keys"
525
+ },
526
+ {
527
+ name: "--brief",
528
+ role: "output",
529
+ type: "switch",
530
+ meaning: "each item as its reference, title, time and excerpt only"
531
+ },
532
+ {
533
+ name: "--chart-kind",
534
+ value: "<messages|active|membership>",
535
+ role: "output",
536
+ type: "choice",
537
+ meaning: "what a chart draws"
538
+ },
539
+ {
540
+ name: "--checkpoints",
541
+ value: "<durations>",
542
+ role: "output",
543
+ type: "list",
544
+ meaning: "the ages to report on, comma-separated: 1d,7d,30d"
545
+ },
546
+ {
547
+ name: "--fields",
548
+ value: "<paths>",
549
+ role: "output",
550
+ type: "list",
551
+ meaning: "only these comma-separated fields of each item; list metadata stays"
552
+ },
553
+ { name: "--format", value: "<format>", role: "output", type: "choice", meaning: "the format of the file written" },
554
+ { name: "--full", role: "output", type: "switch", meaning: "each item with its whole text and every field" },
555
+ {
556
+ name: "--json",
557
+ role: "output",
558
+ type: "switch",
559
+ meaning: "machine-readable output: one JSON value on stdout, nothing else"
560
+ },
561
+ { name: "--jsonl", role: "output", type: "switch", meaning: "machine-readable output: one JSON object per line" },
562
+ {
563
+ name: "--output",
564
+ value: "<file>",
565
+ role: "output",
566
+ type: "path",
567
+ meaning: "the file to write",
568
+ replaces: ["--out"]
569
+ },
570
+ {
571
+ name: "--output-dir",
572
+ value: "<dir>",
573
+ role: "output",
574
+ type: "path",
575
+ meaning: "the folder to write into, created if missing",
576
+ replaces: ["--destination"]
577
+ },
578
+ {
579
+ name: "--problems",
580
+ role: "output",
581
+ type: "switch",
582
+ meaning: "only what went wrong: failures, warnings and crashes"
583
+ },
584
+ { name: "--quiet", role: "output", type: "switch", meaning: "no diagnostics on stderr" },
585
+ { name: "--show-phone", role: "output", type: "switch", meaning: "print the whole phone number" },
586
+ {
587
+ name: "--thread-within",
588
+ value: "<duration>",
589
+ role: "output",
590
+ type: "duration",
591
+ meaning: "messages within this long either side of the hit"
592
+ },
593
+ {
594
+ name: "--trace",
595
+ role: "output",
596
+ type: "switch",
597
+ meaning: "one line per request on stderr: ids and timings, never content"
598
+ },
599
+ { name: "--verbose", role: "output", type: "switch", meaning: "more detail in what is shown; repeat for more" },
600
+ { name: "--version", role: "output", type: "switch", meaning: "print the version number" },
601
+ { name: "--with-notes", role: "output", type: "switch", meaning: "include the owner's private notes" },
602
+ {
603
+ name: "--by",
604
+ value: "<group>",
605
+ role: "output",
606
+ type: "choice",
607
+ meaning: "what the answer counts or groups by: a field or a calendar unit"
608
+ },
609
+ {
610
+ name: "--context",
611
+ value: "<n>",
612
+ role: "output",
613
+ type: "count",
614
+ meaning: "how many messages before and after each hit",
615
+ unit: "messages"
616
+ },
617
+ {
618
+ name: "--events",
619
+ role: "output",
620
+ type: "switch",
621
+ meaning: "also print edits, deletions and other changes; every line names its event"
622
+ },
623
+ { name: "--all-versions", role: "output", type: "switch", meaning: "also the earlier versions a newer one replaced" },
624
+ { name: "--measure", value: "<name>", role: "sort", type: "choice", meaning: "the metric a ranking is ordered by" },
625
+ { name: "--newest", role: "sort", type: "switch", meaning: "newest first instead of best first" },
626
+ {
627
+ name: "--plain-order",
628
+ role: "sort",
629
+ type: "switch",
630
+ meaning: "best first by the words alone, without moving mail from suspicious senders down"
631
+ },
632
+ {
633
+ name: "--order",
634
+ value: "<recent|name>",
635
+ role: "sort",
636
+ type: "choice",
637
+ meaning: "the order of a list: most recent first, or by name"
638
+ },
639
+ { name: "--score", value: "<preset>", role: "sort", type: "choice", meaning: "the named ranking score preset" },
640
+ {
641
+ name: "--weights",
642
+ value: "<json>",
643
+ role: "sort",
644
+ type: "string",
645
+ meaning: "the ranking component weights, all of them"
646
+ },
647
+ {
648
+ name: "--meeting-inventory",
649
+ role: "mode",
650
+ type: "switch",
651
+ meaning: "expose read-only discovery of candidate series in the selected meeting account"
652
+ },
653
+ {
654
+ name: "--meeting-project-candidates",
655
+ role: "mode",
656
+ type: "switch",
657
+ meaning: "expose read-only project suggestions from selected meeting evidence and the global project vocabulary"
658
+ },
659
+ {
660
+ name: "--meeting-preparation",
661
+ role: "mode",
662
+ type: "switch",
663
+ meaning: "expose meeting preparation tools, including their remote schedule reads"
664
+ },
665
+ { name: "--dry-run", role: "mode", type: "switch", meaning: "judge and plan; do nothing", replaces: ["--estimate"] },
666
+ { name: "--accept-terms", role: "mode", type: "switch", meaning: "accept the model's licence terms" },
667
+ {
668
+ name: "--as-owner",
669
+ role: "mode",
670
+ type: "switch",
671
+ meaning: "record the action as the owner's although an agent's terminal runs the tool"
672
+ },
673
+ {
674
+ name: "--allow-any-file",
675
+ role: "mode",
676
+ type: "switch",
677
+ meaning: "send a file even from a credential folder or the tool's own folders"
678
+ },
679
+ {
680
+ name: "--allow-dangerous",
681
+ role: "mode",
682
+ type: "switch",
683
+ meaning: "go ahead without the question an ask level puts before a deletion"
684
+ },
685
+ {
686
+ name: "--allow-writes",
687
+ role: "mode",
688
+ type: "switch",
689
+ meaning: "permit writing: offer the profile's writing tools, or let a generic call change the source",
690
+ replaces: ["--allow-write"]
691
+ },
692
+ { name: "--as-file", role: "mode", type: "switch", meaning: "send every file as a plain file to download" },
693
+ { name: "--background", role: "mode", type: "switch", meaning: "run as a job that outlives this command" },
694
+ {
695
+ name: "--base-url",
696
+ value: "<url>",
697
+ role: "mode",
698
+ type: "string",
699
+ meaning: "the address of an OpenAI-compatible model API"
700
+ },
701
+ { name: "--dims", value: "<n>", role: "mode", type: "count", meaning: "the embedding vector size" },
702
+ {
703
+ name: "--discover",
704
+ role: "mode",
705
+ type: "switch",
706
+ meaning: "also find partial matches; the results are evidence, not answers"
707
+ },
708
+ {
709
+ name: "--encrypt",
710
+ role: "mode",
711
+ type: "switch",
712
+ meaning: "compress and encrypt with a password that is never kept"
713
+ },
714
+ { name: "--exact", role: "mode", type: "switch", meaning: "bare words and quotes match their exact form only" },
715
+ {
716
+ name: "--fingerprint",
717
+ value: "<hash>",
718
+ role: "mode",
719
+ type: "string",
720
+ meaning: "refuse if what it names has changed since it was read",
721
+ replaces: ["--expected"]
722
+ },
723
+ {
724
+ name: "--for-everyone",
725
+ role: "mode",
726
+ type: "switch",
727
+ meaning: "delete for everyone in the chat, not only for the owner"
728
+ },
729
+ { name: "--http", role: "mode", type: "switch", meaning: "serve over HTTP on 127.0.0.1" },
730
+ { name: "--language", value: "<lucene|legacy>", role: "mode", type: "choice", meaning: "the query language" },
731
+ { name: "--local", role: "mode", type: "switch", meaning: "use the model on this machine, never the source" },
732
+ {
733
+ name: "--max-age",
734
+ value: "<duration>",
735
+ role: "mode",
736
+ type: "duration",
737
+ meaning: "how old a stored snapshot may be and still count as fresh"
738
+ },
739
+ {
740
+ name: "--draft",
741
+ role: "mode",
742
+ type: "switch",
743
+ meaning: "save text for the owner to review and send, without sending a message"
744
+ },
745
+ { name: "--md", role: "mode", type: "switch", meaning: "the text is the messenger's Markdown" },
746
+ { name: "--no-backup", role: "mode", type: "switch", meaning: "do not back the file up before deleting it" },
747
+ { name: "--no-input", role: "mode", type: "switch", meaning: "never prompt or open an interactive login" },
748
+ { name: "--no-preview", role: "mode", type: "switch", meaning: "no preview card for a link in the text" },
749
+ {
750
+ name: "--no-record",
751
+ role: "mode",
752
+ type: "switch",
753
+ meaning: "do not keep this run, whatever the configuration says"
754
+ },
755
+ { name: "--no-registries", role: "mode", type: "switch", meaning: "do not ask the public ban lists" },
756
+ {
757
+ name: "--notify",
758
+ role: "mode",
759
+ type: "switch",
760
+ meaning: "tell the people it concerns about it: the chat's members, or an event's attendees"
761
+ },
762
+ { name: "--no-notify", role: "mode", type: "switch", meaning: "tell nobody about it" },
763
+ { name: "--offline", role: "mode", type: "switch", meaning: "answer from what was recorded and never connect" },
764
+ {
765
+ name: "--operation-id",
766
+ value: "<id>",
767
+ role: "mode",
768
+ type: "id",
769
+ meaning: "the write attempt this repeats, from an unknown outcome; a retry with it cannot write twice",
770
+ replaces: ["--send-id"]
771
+ },
772
+ { name: "--port", value: "<port>", role: "mode", type: "number", meaning: "the local port for --http" },
773
+ {
774
+ name: "--public-url",
775
+ value: "<url>",
776
+ role: "mode",
777
+ type: "string",
778
+ meaning: "the public https address of the tunnel"
779
+ },
780
+ {
781
+ name: "--record",
782
+ role: "mode",
783
+ type: "switch",
784
+ meaning: "keep this run, with the command as typed and secrets hidden; record_input false leaves the typed words out"
785
+ },
786
+ { name: "--regex", role: "mode", type: "switch", meaning: "the words are one regular expression" },
787
+ { name: "--silent", role: "mode", type: "switch", meaning: "deliver without a notification" },
788
+ { name: "--thread", role: "mode", type: "switch", meaning: "the stored reply chain instead of time neighbours" },
789
+ {
790
+ name: "--timezone",
791
+ value: "<zone>",
792
+ role: "mode",
793
+ type: "string",
794
+ meaning: "the IANA timezone dates and times are read in"
795
+ },
796
+ {
797
+ name: "--yes",
798
+ role: "mode",
799
+ type: "switch",
800
+ meaning: "go ahead with the write without asking or previewing first"
801
+ },
802
+ { name: "--allow-delete", role: "mode", type: "switch", meaning: "permit a call that deletes for good" },
803
+ {
804
+ name: "--allow-remote",
805
+ role: "mode",
806
+ type: "switch",
807
+ meaning: "consent to sending the stored data to the configured remote model"
808
+ },
809
+ {
810
+ name: "--answerer",
811
+ value: "<person>",
812
+ role: "mode",
813
+ type: "string",
814
+ meaning: "a person whose reply counts as an answer; repeat it for more"
815
+ },
816
+ {
817
+ name: "--browser",
818
+ value: "<program>",
819
+ role: "mode",
820
+ type: "string",
821
+ meaning: "the browser program to open for sign-in"
822
+ },
823
+ {
824
+ name: "--credential-storage",
825
+ value: "<storage>",
826
+ role: "mode",
827
+ type: "choice",
828
+ meaning: "where a sign-in is kept: keyring, which falls back to a private file by itself, or file (WC-SECR-4)"
829
+ },
830
+ { name: "--checkpoint", value: "<file>", role: "mode", type: "path", meaning: "keep resume progress in this file" },
831
+ {
832
+ name: "--expected-event-id",
833
+ value: "<id>",
834
+ role: "mode",
835
+ type: "id",
836
+ meaning: "refuse unless the linked event is still this one, or none"
837
+ },
838
+ {
839
+ name: "--expected-person",
840
+ value: "<uid>",
841
+ role: "mode",
842
+ type: "id",
843
+ meaning: "refuse unless the linked person is still this one, or none"
844
+ },
845
+ { name: "--html", role: "mode", type: "switch", meaning: "the text is HTML" },
846
+ {
847
+ name: "--idle",
848
+ value: "<duration>",
849
+ role: "mode",
850
+ type: "duration",
851
+ meaning: "stop after this long with nobody using it"
852
+ },
853
+ {
854
+ name: "--interactive",
855
+ role: "mode",
856
+ type: "switch",
857
+ meaning: "allow approving in a browser from an interactive terminal"
858
+ },
859
+ {
860
+ name: "--meeting-context",
861
+ role: "mode",
862
+ type: "switch",
863
+ meaning: "expose meeting evidence, person context and task proposal tools"
864
+ },
865
+ {
866
+ name: "--method",
867
+ value: "<method>",
868
+ role: "mode",
869
+ type: "choice",
870
+ meaning: "how to log in when there is no session"
871
+ },
872
+ {
873
+ name: "--model",
874
+ value: "<model>",
875
+ role: "mode",
876
+ type: "string",
877
+ meaning: "the model that does the work: a local model's id or the provider's model name"
878
+ },
879
+ {
880
+ name: "--models-dir",
881
+ value: "<dir>",
882
+ role: "mode",
883
+ type: "path",
884
+ meaning: "the folder installed models are read from"
885
+ },
886
+ {
887
+ name: "--no-browser",
888
+ role: "mode",
889
+ type: "switch",
890
+ meaning: "print the sign-in address instead of opening a browser"
891
+ },
892
+ { name: "--no-resume", role: "mode", type: "switch", meaning: "start over, keeping no resume state" },
893
+ {
894
+ name: "--no-serve",
895
+ role: "mode",
896
+ type: "switch",
897
+ meaning: "do not start the long-running process; use this command's own connection"
898
+ },
899
+ {
900
+ name: "--pause",
901
+ value: "<duration>",
902
+ role: "mode",
903
+ type: "duration",
904
+ meaning: "wait this long between requests to the source, to stay under its limits",
905
+ replaces: ["--interval"]
906
+ },
907
+ {
908
+ name: "--permission",
909
+ value: "<key=level>",
910
+ role: "mode",
911
+ type: "string",
912
+ meaning: "override one permission for this run; repeat it for more"
913
+ },
914
+ { name: "--read-only", role: "mode", type: "switch", meaning: "refuse every write, local and remote" },
915
+ {
916
+ name: "--append",
917
+ role: "mode",
918
+ type: "switch",
919
+ meaning: "keep existing entries and add the explicitly named one beside them"
920
+ },
921
+ { name: "--replace", role: "mode", type: "switch", meaning: "overwrite an existing one of the same name" },
922
+ {
923
+ name: "--rescan",
924
+ role: "mode",
925
+ type: "switch",
926
+ meaning: "list everything again, not only what changed since the last run"
927
+ },
928
+ { name: "--resume", role: "mode", type: "switch", meaning: "continue verified partial work from the last run" },
929
+ {
930
+ name: "--revision",
931
+ value: "<n>",
932
+ role: "mode",
933
+ type: "count",
934
+ meaning: "the revision read before this edit; a change made meanwhile refuses it"
935
+ },
936
+ {
937
+ name: "--secret-stdin",
938
+ role: "mode",
939
+ type: "switch",
940
+ meaning: "read a secret from a pipe, or ask for it; never from the command line"
941
+ },
942
+ {
943
+ name: "--semantic",
944
+ role: "mode",
945
+ type: "switch",
946
+ meaning: "expose read-only search by meaning, with an explicit query model"
947
+ },
948
+ {
949
+ name: "--serve",
950
+ role: "mode",
951
+ type: "switch",
952
+ meaning: "start the long-running process in the background when it is not running"
953
+ },
954
+ {
955
+ name: "--size",
956
+ value: "<n>",
957
+ role: "mode",
958
+ type: "count",
959
+ meaning: "how many messages in one batch",
960
+ unit: "messages"
961
+ },
962
+ {
963
+ name: "--unified-search",
964
+ role: "mode",
965
+ type: "switch",
966
+ meaning: "expose search across resources for the selected profile"
967
+ },
968
+ {
969
+ name: "--within",
970
+ value: "<duration>",
971
+ role: "mode",
972
+ type: "duration",
973
+ meaning: "the window after an event that counts"
974
+ },
975
+ {
976
+ name: "--grant",
977
+ value: "<scopes>",
978
+ role: "mode",
979
+ type: "list",
980
+ meaning: "also ask for these permissions at sign-in, comma-separated; the command lists them"
981
+ },
982
+ {
983
+ name: "--min-similarity",
984
+ value: "<n>",
985
+ role: "mode",
986
+ type: "number",
987
+ meaning: "how alike two names must be to count as a match, from 0 to 1"
988
+ },
989
+ { name: "--analyze", role: "action", type: "switch", meaning: "also analyze with the configured provider" },
990
+ {
991
+ name: "--agent",
992
+ value: "<agent>",
993
+ role: "action",
994
+ type: "choice",
995
+ meaning: "also install the agent skill for this agent after logging in"
996
+ },
997
+ {
998
+ name: "--catch-up",
999
+ role: "action",
1000
+ type: "switch",
1001
+ meaning: "prepare local search: after this run, or before a search reads it"
1002
+ },
1003
+ { name: "--extract", role: "action", type: "switch", meaning: "also read the text inside the files written" },
1004
+ {
1005
+ name: "--mark-read",
1006
+ role: "action",
1007
+ type: "switch",
1008
+ meaning: "also mark the chat read up to the newest message shown; the other person sees it"
1009
+ },
1010
+ { name: "--no-catch-up", role: "action", type: "switch", meaning: "skip local preparation after this run" },
1011
+ { name: "--retract", role: "action", type: "switch", meaning: "take the owner's vote back" },
1012
+ { name: "--revoke", role: "action", type: "switch", meaning: "forget every login given to a browser app" },
1013
+ { name: "--track", role: "action", type: "switch", meaning: "also do it daily while serve runs" },
1014
+ {
1015
+ name: "--transcribe",
1016
+ role: "action",
1017
+ type: "switch",
1018
+ meaning: "also transcribe voice messages not transcribed yet, on this machine"
1019
+ },
1020
+ { name: "--block", role: "action", type: "switch", meaning: "also keep them from coming back by the chat's link" },
1021
+ {
1022
+ name: "--check",
1023
+ role: "action",
1024
+ type: "switch",
1025
+ meaning: "also ask the source and say what it answers: a newer version, who a bot is, whether a login works"
1026
+ },
1027
+ { name: "--download", role: "action", type: "switch", meaning: "first download the files not downloaded yet" },
1028
+ { name: "--embed", role: "action", type: "switch", meaning: "also embed what is pending, for search by meaning" },
1029
+ {
1030
+ name: "--export",
1031
+ value: "<dir>",
1032
+ role: "action",
1033
+ type: "path",
1034
+ meaning: "also write it as a file, to this folder or the configured one"
1035
+ },
1036
+ { name: "--no-block", role: "action", type: "switch", meaning: "remove without keeping them from coming back" },
1037
+ { name: "--no-embed", role: "action", type: "switch", meaning: "skip embedding for search by meaning this run" },
1038
+ {
1039
+ name: "--no-mark-read",
1040
+ role: "action",
1041
+ type: "switch",
1042
+ meaning: "do not mark read, whatever the configuration says"
1043
+ },
1044
+ {
1045
+ name: "--ocr",
1046
+ role: "action",
1047
+ type: "switch",
1048
+ meaning: "also read the text in images and scanned PDFs with the configured OCR model"
1049
+ },
1050
+ {
1051
+ name: "--online",
1052
+ role: "action",
1053
+ type: "switch",
1054
+ meaning: "also connect once and read the account; sends nothing"
1055
+ },
1056
+ {
1057
+ name: "--sync-first",
1058
+ role: "action",
1059
+ type: "switch",
1060
+ meaning: "first bring what it reads up to date from the source",
1061
+ replaces: ["--refresh", "--refresh-metadata"]
1062
+ },
1063
+ {
1064
+ name: "--domain-age",
1065
+ role: "action",
1066
+ type: "switch",
1067
+ meaning: "also ask each domain's registry when it was registered; the registry learns the domain"
1068
+ },
1069
+ {
1070
+ name: "--retry-attachments",
1071
+ role: "action",
1072
+ type: "switch",
1073
+ meaning: "also reread the stored attachments whose text was not read before"
1074
+ },
1075
+ {
1076
+ name: "--meetings",
1077
+ value: "<n>",
1078
+ role: "budget",
1079
+ type: "count",
1080
+ meaning: "at most this many stored meeting occurrences in context",
1081
+ unit: "meetings"
1082
+ },
1083
+ {
1084
+ name: "--cues",
1085
+ value: "<n>",
1086
+ role: "budget",
1087
+ type: "count",
1088
+ meaning: "at most this many transcript cues per selected occurrence",
1089
+ unit: "cues"
1090
+ },
1091
+ {
1092
+ name: "--context-limit",
1093
+ value: "<n>",
1094
+ role: "budget",
1095
+ type: "count",
1096
+ meaning: "at most this many entries per context category",
1097
+ unit: "items"
1098
+ },
1099
+ {
1100
+ name: "--scan-limit",
1101
+ value: "<n>",
1102
+ role: "budget",
1103
+ type: "count",
1104
+ meaning: "at most this many stored candidates inspected for one bounded read",
1105
+ unit: "items"
1106
+ },
1107
+ {
1108
+ name: "--bytes",
1109
+ value: "<bytes>",
1110
+ role: "budget",
1111
+ type: "count",
1112
+ meaning: "at most this many bytes of included evidence content",
1113
+ unit: "bytes"
1114
+ },
1115
+ {
1116
+ name: "--max-read-bytes",
1117
+ value: "<bytes>",
1118
+ role: "budget",
1119
+ type: "count",
1120
+ meaning: "at most this many stored text bytes read for one bounded evidence window",
1121
+ unit: "bytes"
1122
+ },
1123
+ {
1124
+ name: "--depth",
1125
+ value: "<n>",
1126
+ role: "budget",
1127
+ type: "count",
1128
+ meaning: "maximum descendant depth in a hierarchy",
1129
+ unit: "levels"
1130
+ },
1131
+ { name: "--timeout", value: "<duration>", role: "budget", type: "duration", meaning: "give up after this long" },
1132
+ {
1133
+ name: "--catch-up-chunks",
1134
+ value: "<n>",
1135
+ role: "budget",
1136
+ type: "count",
1137
+ meaning: "at most this many chunks prepared after the run",
1138
+ unit: "chunks"
1139
+ },
1140
+ {
1141
+ name: "--catch-up-messages",
1142
+ value: "<n>",
1143
+ role: "budget",
1144
+ type: "count",
1145
+ meaning: "skip the graph rebuild above this many messages",
1146
+ unit: "messages"
1147
+ },
1148
+ {
1149
+ name: "--concurrency",
1150
+ value: "<n>",
1151
+ role: "budget",
1152
+ type: "count",
1153
+ meaning: "requests to the source at once",
1154
+ unit: "requests"
1155
+ },
1156
+ {
1157
+ name: "--deep",
1158
+ value: "<n>",
1159
+ role: "budget",
1160
+ type: "count",
1161
+ meaning: "also check the top n in full, one a second",
1162
+ unit: "people"
1163
+ },
1164
+ {
1165
+ name: "--max-actions",
1166
+ value: "<n>",
1167
+ role: "budget",
1168
+ type: "count",
1169
+ meaning: "at most this many actions in one run",
1170
+ unit: "actions"
1171
+ },
1172
+ {
1173
+ name: "--max-chats",
1174
+ value: "<n>",
1175
+ role: "budget",
1176
+ type: "count",
1177
+ meaning: "at most this many chats in one run",
1178
+ unit: "chats"
1179
+ },
1180
+ {
1181
+ name: "--max-chunks",
1182
+ value: "<n>",
1183
+ role: "budget",
1184
+ type: "count",
1185
+ meaning: "at most this many chunks in one run",
1186
+ unit: "chunks"
1187
+ },
1188
+ {
1189
+ name: "--max-gaps",
1190
+ value: "<n>",
1191
+ role: "budget",
1192
+ type: "count",
1193
+ meaning: "at most this many gaps repaired in one run",
1194
+ unit: "gaps"
1195
+ },
1196
+ {
1197
+ name: "--max-input-bytes",
1198
+ value: "<bytes>",
1199
+ role: "budget",
1200
+ type: "count",
1201
+ meaning: "at most this many bytes of buffered stdin",
1202
+ unit: "bytes"
1203
+ },
1204
+ {
1205
+ name: "--max-messages",
1206
+ value: "<n>",
1207
+ role: "budget",
1208
+ type: "count",
1209
+ meaning: "at most this many messages in one run",
1210
+ unit: "messages"
1211
+ },
1212
+ {
1213
+ name: "--max-replies",
1214
+ value: "<n>",
1215
+ role: "budget",
1216
+ type: "count",
1217
+ meaning: "at most this many replies read",
1218
+ unit: "replies"
1219
+ },
1220
+ {
1221
+ name: "--max-tokens",
1222
+ value: "<n>",
1223
+ role: "budget",
1224
+ type: "count",
1225
+ meaning: "at most this many model tokens in one run",
1226
+ unit: "tokens"
1227
+ },
1228
+ {
1229
+ name: "--thread-bytes",
1230
+ value: "<n>",
1231
+ role: "budget",
1232
+ type: "count",
1233
+ meaning: "at most this many bytes in each thread context",
1234
+ unit: "bytes"
1235
+ },
1236
+ {
1237
+ name: "--thread-hops",
1238
+ value: "<n>",
1239
+ role: "budget",
1240
+ type: "count",
1241
+ meaning: "at most this many links from the hit",
1242
+ unit: "links"
1243
+ },
1244
+ {
1245
+ name: "--thread-messages",
1246
+ value: "<n>",
1247
+ role: "budget",
1248
+ type: "count",
1249
+ meaning: "at most this many messages in each thread context",
1250
+ unit: "messages"
1251
+ },
1252
+ {
1253
+ name: "--catch-up-time",
1254
+ value: "<duration>",
1255
+ role: "budget",
1256
+ type: "duration",
1257
+ meaning: "how long local preparation after the run may take"
1258
+ },
1259
+ {
1260
+ name: "--max-bytes",
1261
+ value: "<bytes>",
1262
+ role: "budget",
1263
+ type: "count",
1264
+ meaning: "at most this many bytes of one file read or downloaded",
1265
+ unit: "bytes"
1266
+ },
1267
+ {
1268
+ name: "--max-comparisons",
1269
+ value: "<n>",
1270
+ role: "budget",
1271
+ type: "count",
1272
+ meaning: "at most this many name comparisons",
1273
+ unit: "comparisons"
1274
+ },
1275
+ {
1276
+ name: "--max-cost",
1277
+ value: "<usd>",
1278
+ role: "budget",
1279
+ type: "number",
1280
+ meaning: "stop a run that costs more than this",
1281
+ unit: "US dollars"
1282
+ },
1283
+ {
1284
+ name: "--max-duration",
1285
+ value: "<duration>",
1286
+ role: "budget",
1287
+ type: "duration",
1288
+ meaning: "the longest audio it takes on"
1289
+ },
1290
+ {
1291
+ name: "--max-entries",
1292
+ value: "<n>",
1293
+ role: "budget",
1294
+ type: "count",
1295
+ meaning: "at most this many entries read",
1296
+ unit: "entries"
1297
+ },
1298
+ {
1299
+ name: "--max-meetings",
1300
+ value: "<n>",
1301
+ role: "budget",
1302
+ type: "count",
1303
+ meaning: "at most this many meetings looked through, newest first",
1304
+ unit: "meetings"
1305
+ },
1306
+ {
1307
+ name: "--max-output-bytes",
1308
+ value: "<bytes>",
1309
+ role: "budget",
1310
+ type: "count",
1311
+ meaning: "at most this many bytes of machine output; 0 means no limit",
1312
+ unit: "bytes"
1313
+ },
1314
+ {
1315
+ name: "--max-pages",
1316
+ value: "<pages>",
1317
+ role: "budget",
1318
+ type: "count",
1319
+ meaning: "at most this many pages read from the source",
1320
+ unit: "pages",
1321
+ replaces: ["--budget"]
1322
+ },
1323
+ {
1324
+ name: "--max-rows",
1325
+ value: "<n>",
1326
+ role: "budget",
1327
+ type: "count",
1328
+ meaning: "at most this many transcript lines read",
1329
+ unit: "lines"
1330
+ },
1331
+ {
1332
+ name: "--max-segments",
1333
+ value: "<n>",
1334
+ role: "budget",
1335
+ type: "count",
1336
+ meaning: "at most this many recognized segments",
1337
+ unit: "segments"
1338
+ },
1339
+ {
1340
+ name: "--max-subscriber-buffer-bytes",
1341
+ value: "<bytes>",
1342
+ role: "budget",
1343
+ type: "count",
1344
+ meaning: "at most this many bytes buffered for one watcher before it is cut off; 0 means no limit",
1345
+ unit: "bytes"
1346
+ },
1347
+ {
1348
+ name: "--max-subscriber-total-buffer-bytes",
1349
+ value: "<bytes>",
1350
+ role: "budget",
1351
+ type: "count",
1352
+ meaning: "at most this many bytes buffered for all watchers together; 0 means no limit",
1353
+ unit: "bytes"
1354
+ },
1355
+ {
1356
+ name: "--max-text-bytes",
1357
+ value: "<bytes>",
1358
+ role: "budget",
1359
+ type: "count",
1360
+ meaning: "at most this many bytes of transcript text read",
1361
+ unit: "bytes"
1362
+ },
1363
+ {
1364
+ name: "--max-total-bytes",
1365
+ value: "<bytes>",
1366
+ role: "budget",
1367
+ type: "count",
1368
+ meaning: "at most this many bytes in all, checked before any write",
1369
+ unit: "bytes"
1370
+ },
1371
+ {
1372
+ name: "--max-transcript-pages",
1373
+ value: "<n>",
1374
+ role: "budget",
1375
+ type: "count",
1376
+ meaning: "at most this many transcript pages read",
1377
+ unit: "pages"
1378
+ },
1379
+ {
1380
+ name: "--repair-time",
1381
+ value: "<duration>",
1382
+ role: "budget",
1383
+ type: "duration",
1384
+ meaning: "how long a repair may take"
1385
+ },
1386
+ {
1387
+ name: "--server-time",
1388
+ value: "<duration>",
1389
+ role: "budget",
1390
+ type: "duration",
1391
+ meaning: "stop waiting for the server's answer after this long"
1392
+ },
1393
+ {
1394
+ name: "--sync-time",
1395
+ value: "<duration>",
1396
+ role: "budget",
1397
+ type: "duration",
1398
+ meaning: "stop fetching from the source after this long"
1399
+ },
1400
+ {
1401
+ name: "--threads",
1402
+ value: "<n>",
1403
+ role: "budget",
1404
+ type: "count",
1405
+ meaning: "threads on this machine, in all",
1406
+ unit: "threads"
1407
+ },
1408
+ {
1409
+ name: "--workers",
1410
+ value: "<n>",
1411
+ role: "budget",
1412
+ type: "count",
1413
+ meaning: "sessions in parallel on this machine, each with its own copy of the model",
1414
+ unit: "sessions"
1415
+ },
1416
+ {
1417
+ name: "--input",
1418
+ value: "<mode>",
1419
+ role: "mode",
1420
+ type: "choice",
1421
+ meaning: "how supplied cell values are parsed: literal values or provider-interpreted formulas and locale formats"
1422
+ },
1423
+ {
1424
+ name: "--render",
1425
+ value: "<mode>",
1426
+ role: "output",
1427
+ type: "choice",
1428
+ meaning: "how returned cell values are represented: formatted display values, unformatted values or formulas"
1429
+ }
1430
+ ];
1431
+
1432
+ // node_modules/.pnpm/@wirecat+cli-base@0.68.1_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
1433
+ var WHAT_FLAGS = [
1434
+ {
1435
+ name: "--analysis-provider",
1436
+ value: "<provider>",
1437
+ role: "mode",
1438
+ type: "choice",
1439
+ meaning: "who analyses the selected text: the calling agent or a configured model service"
1440
+ },
1441
+ {
1442
+ name: "--embedding-provider",
1443
+ value: "<provider>",
1444
+ role: "mode",
1445
+ type: "choice",
1446
+ meaning: "who computes embeddings: a local model or a configured remote model service"
1447
+ },
1448
+ {
1449
+ name: "--consent-provider",
1450
+ value: "<identity>",
1451
+ role: "target",
1452
+ type: "string",
1453
+ meaning: "the exact model-service identity whose recorded consent is being removed"
1454
+ },
1455
+ {
1456
+ name: "--claim",
1457
+ value: "<claim>",
1458
+ role: "target",
1459
+ type: "choice",
1460
+ meaning: "the ownership claim to remove from a tag: manual or auto"
1461
+ },
1462
+ {
1463
+ name: "--answer-model",
1464
+ value: "<model>",
1465
+ role: "target",
1466
+ type: "string",
1467
+ meaning: "remove only stored analysis answers made by this model; does not run a model"
1468
+ },
1469
+ {
1470
+ name: "--template-mode",
1471
+ value: "<mode>",
1472
+ role: "value",
1473
+ type: "choice",
1474
+ meaning: "the saved reply template's policy: fill-only or may-reword"
1475
+ },
1476
+ {
1477
+ name: "--disappear-after",
1478
+ value: "<duration|off>",
1479
+ role: "value",
1480
+ type: "duration",
1481
+ meaning: "how long a new chat message is kept after sending; off keeps messages"
1482
+ },
1483
+ {
1484
+ name: "--only-admins-edit-info",
1485
+ value: "<on|off>",
1486
+ role: "value",
1487
+ type: "choice",
1488
+ meaning: "only admins may change the chat's name, photo and description"
1489
+ },
1490
+ {
1491
+ name: "--only-admins-send",
1492
+ value: "<on|off>",
1493
+ role: "value",
1494
+ type: "choice",
1495
+ meaning: "only admins may send messages to the chat"
1496
+ },
1497
+ {
1498
+ name: "--remove-photo",
1499
+ role: "value",
1500
+ type: "switch",
1501
+ meaning: "remove the chat's photo; not with a replacement photo"
1502
+ },
1503
+ {
1504
+ name: "--sticker-file",
1505
+ value: "<file>",
1506
+ role: "value",
1507
+ type: "path",
1508
+ meaning: "a local sticker file to send as a message"
1509
+ },
1510
+ {
1511
+ name: "--target-store",
1512
+ value: "<file>",
1513
+ role: "target",
1514
+ type: "path",
1515
+ meaning: "explicit destination store file for checking or restoring selected annotations"
1516
+ },
1517
+ {
1518
+ name: "--bindings",
1519
+ value: "<file>",
1520
+ role: "target",
1521
+ type: "path",
1522
+ meaning: "JSON file mapping source typed references to explicitly selected destination references"
1523
+ },
1524
+ {
1525
+ name: "--context-source",
1526
+ value: "<id=cursor>",
1527
+ role: "scope",
1528
+ type: "string",
1529
+ meaning: "explicitly selected communications source, optionally with its scoped continuation cursor; repeat for more sources"
1530
+ },
1531
+ {
1532
+ name: "--context-query",
1533
+ value: "<words>",
1534
+ role: "query",
1535
+ type: "string",
1536
+ meaning: "literal words to find within the communications selected for preparation"
1537
+ },
1538
+ {
1539
+ name: "--alias",
1540
+ value: "<name>",
1541
+ role: "query",
1542
+ type: "string",
1543
+ meaning: "another name of the thing, searched as its own alternative beside its name; repeat for more"
1544
+ },
1545
+ {
1546
+ name: "--context-since-time",
1547
+ value: "<time>",
1548
+ role: "target",
1549
+ type: "time",
1550
+ meaning: "inclusive start of the selected communications window used for preparation"
1551
+ },
1552
+ {
1553
+ name: "--context-before-time",
1554
+ value: "<time>",
1555
+ role: "target",
1556
+ type: "time",
1557
+ meaning: "exclusive end of the selected communications window used for preparation"
1558
+ },
1559
+ {
1560
+ name: "--account",
1561
+ value: "<account>",
1562
+ role: "scope",
1563
+ type: "string",
1564
+ meaning: "the account to use; never assumed"
1565
+ },
1566
+ {
1567
+ name: "--provider",
1568
+ value: "<provider>",
1569
+ role: "scope",
1570
+ type: "choice",
1571
+ meaning: "read every account of this provider"
1572
+ },
1573
+ {
1574
+ name: "--source",
1575
+ value: "<accounts>",
1576
+ role: "scope",
1577
+ type: "list",
1578
+ meaning: "what to read: provider:account, a provider, a kind or group:<name>; comma-separated",
1579
+ replaces: ["--target-accounts"]
1580
+ },
1581
+ {
1582
+ name: "--all-bots",
1583
+ role: "scope",
1584
+ type: "switch",
1585
+ meaning: "also read every other bot's copy on this machine that the configuration allows"
1586
+ },
1587
+ {
1588
+ name: "--archive",
1589
+ value: "<dir>",
1590
+ role: "scope",
1591
+ type: "path",
1592
+ meaning: "also read the transcripts in this archive folder"
1593
+ },
1594
+ {
1595
+ name: "--backend",
1596
+ value: "<archive|server|both>",
1597
+ role: "scope",
1598
+ type: "choice",
1599
+ meaning: "where to search: the local archive, the source's server, or both"
1600
+ },
1601
+ {
1602
+ name: "--bots",
1603
+ value: "<profiles>",
1604
+ role: "scope",
1605
+ type: "list",
1606
+ meaning: "also read these bots' copies, comma-separated, each allowed by the configuration"
1607
+ },
1608
+ {
1609
+ name: "--only",
1610
+ value: "<resources>",
1611
+ role: "scope",
1612
+ type: "list",
1613
+ meaning: "only these resources, comma-separated"
1614
+ },
1615
+ {
1616
+ name: "--profile",
1617
+ value: "<name>",
1618
+ role: "scope",
1619
+ type: "string",
1620
+ meaning: "the profile to use, instead of the first word"
1621
+ },
1622
+ {
1623
+ name: "--profiles",
1624
+ value: "<names|all>",
1625
+ role: "scope",
1626
+ type: "list",
1627
+ meaning: "the profiles an MCP server serves, comma-separated, or all of them"
1628
+ },
1629
+ {
1630
+ name: "--history-since-time",
1631
+ value: "<time>",
1632
+ role: "target",
1633
+ type: "time",
1634
+ meaning: "inclusive start of the stored history window used for preparation"
1635
+ },
1636
+ {
1637
+ name: "--expected-fingerprint",
1638
+ value: "<hash>",
1639
+ role: "target",
1640
+ type: "string",
1641
+ meaning: "require what it reads to match this fingerprint from an earlier read",
1642
+ replaces: ["--if-sha256"]
1643
+ },
1644
+ { name: "--before-time", value: "<time>", role: "target", type: "time", meaning: "read what came before this time" },
1645
+ { name: "--after-time", value: "<time>", role: "target", type: "time", meaning: "read what came after this time" },
1646
+ { name: "--since-time", value: "<time>", role: "target", type: "time", meaning: "only what came since this time" },
1647
+ {
1648
+ name: "--until-time",
1649
+ value: "<time>",
1650
+ role: "target",
1651
+ type: "time",
1652
+ meaning: "only what came up to and including this time"
1653
+ },
1654
+ {
1655
+ name: "--batch",
1656
+ value: "<id>",
1657
+ role: "target",
1658
+ type: "id",
1659
+ meaning: "the batch to act on, by the id that listed it"
1660
+ },
1661
+ {
1662
+ name: "--component",
1663
+ value: "<name>",
1664
+ role: "target",
1665
+ type: "string",
1666
+ meaning: "the ranking component to read the evidence of"
1667
+ },
1668
+ {
1669
+ name: "--counters",
1670
+ value: "<names>",
1671
+ role: "target",
1672
+ type: "list",
1673
+ meaning: "the counters to read: views, reactions, comments"
1674
+ },
1675
+ { name: "--failed", role: "target", type: "switch", meaning: "every chat whose newest job failed or died" },
1676
+ { name: "--left", role: "target", type: "switch", meaning: "only the chats this account has left" },
1677
+ { name: "--others", role: "target", type: "switch", meaning: "every session but this one" },
1678
+ {
1679
+ name: "--saved",
1680
+ value: "<name|id>",
1681
+ role: "target",
1682
+ type: "string",
1683
+ meaning: "run a saved search, or an earlier run by its id"
1684
+ },
1685
+ {
1686
+ name: "--selection",
1687
+ value: "<json>",
1688
+ role: "target",
1689
+ type: "string",
1690
+ meaning: "the resolved ranking selection a drilldown returned"
1691
+ },
1692
+ {
1693
+ name: "--attachment",
1694
+ value: "<n>",
1695
+ role: "target",
1696
+ type: "count",
1697
+ meaning: "which file of the message, from 1; needed when it has more than one"
1698
+ },
1699
+ {
1700
+ name: "--bot",
1701
+ role: "target",
1702
+ type: "switch",
1703
+ meaning: "the bot section of the configuration, not the personal account's"
1704
+ },
1705
+ {
1706
+ name: "--chat",
1707
+ value: "<chat>",
1708
+ role: "target",
1709
+ type: "id",
1710
+ meaning: "the chat it acts on: its id or name; repeat it where several are taken"
1711
+ },
1712
+ {
1713
+ name: "--contact",
1714
+ value: "<person>",
1715
+ role: "target",
1716
+ type: "id",
1717
+ meaning: "a contact: their id, @username or name, as the store knows them"
1718
+ },
1719
+ { name: "--defaults", role: "target", type: "switch", meaning: "what every profile gets, not only this profile" },
1720
+ {
1721
+ name: "--file-ids",
1722
+ value: "<ids>",
1723
+ role: "target",
1724
+ type: "list",
1725
+ meaning: "only these files, by comma-separated ids"
1726
+ },
1727
+ {
1728
+ name: "--folder",
1729
+ value: "<folder>",
1730
+ role: "target",
1731
+ type: "string",
1732
+ meaning: "a notes folder, by its id or path; repeat it for more"
1733
+ },
1734
+ {
1735
+ name: "--for",
1736
+ value: "<agents>",
1737
+ role: "target",
1738
+ type: "list",
1739
+ meaning: "the agents to install for, comma-separated"
1740
+ },
1741
+ {
1742
+ name: "--from-dir",
1743
+ value: "<dir>",
1744
+ role: "target",
1745
+ type: "path",
1746
+ meaning: "match files in this folder, not its subfolders"
1747
+ },
1748
+ {
1749
+ name: "--last",
1750
+ value: "<n>",
1751
+ role: "target",
1752
+ type: "count",
1753
+ meaning: "stop once the newest n messages are held",
1754
+ unit: "messages"
1755
+ },
1756
+ { name: "--link", value: "<link>", role: "target", type: "string", meaning: "an invite link" },
1757
+ {
1758
+ name: "--lookback-days",
1759
+ value: "<days>",
1760
+ role: "target",
1761
+ type: "count",
1762
+ meaning: "look again at this many recent days, for what arrived late",
1763
+ unit: "days"
1764
+ },
1765
+ {
1766
+ name: "--meeting-id",
1767
+ value: "<id>",
1768
+ role: "target",
1769
+ type: "id",
1770
+ meaning: "one stored meeting selected for transcript search"
1771
+ },
1772
+ {
1773
+ name: "--identity-id",
1774
+ value: "<id>",
1775
+ role: "target",
1776
+ type: "id",
1777
+ meaning: "a stored participant identity whose meetings are selected; does not identify the speaker of a hit"
1778
+ },
1779
+ {
1780
+ name: "--person-id",
1781
+ value: "<id>",
1782
+ role: "target",
1783
+ type: "id",
1784
+ meaning: "a stored person whose linked participant identities select meetings"
1785
+ },
1786
+ {
1787
+ name: "--series-id",
1788
+ value: "<id>",
1789
+ role: "target",
1790
+ type: "id",
1791
+ meaning: "one stored recurring series selected for meeting search"
1792
+ },
1793
+ { name: "--meeting", value: "<id>", role: "target", type: "id", meaning: "a meeting, by its store id" },
1794
+ {
1795
+ name: "--message",
1796
+ value: "<message>",
1797
+ role: "target",
1798
+ type: "id",
1799
+ meaning: "a message: its id in --chat, or a msg: locator alone"
1800
+ },
1801
+ {
1802
+ name: "--new",
1803
+ role: "target",
1804
+ type: "switch",
1805
+ meaning: "only what is new since this command last ran, each once; for scheduled runs"
1806
+ },
1807
+ {
1808
+ name: "--note",
1809
+ value: "<reference>",
1810
+ role: "target",
1811
+ type: "string",
1812
+ meaning: "a note: note:<id>, or a file in a notes folder: document:<id>"
1813
+ },
1814
+ {
1815
+ name: "--occurrence-id",
1816
+ value: "<id>",
1817
+ role: "target",
1818
+ type: "id",
1819
+ meaning: "one occurrence of a recurring meeting"
1820
+ },
1821
+ { name: "--old-parent", value: "<id>", role: "target", type: "id", meaning: "the folder to take it out of, by id" },
1822
+ { name: "--only-missing", role: "target", type: "switch", meaning: "only what has none yet" },
1823
+ {
1824
+ name: "--organization",
1825
+ value: "<organization>",
1826
+ role: "target",
1827
+ type: "string",
1828
+ meaning: "an organization: its id or organization:<id>"
1829
+ },
1830
+ { name: "--parent", value: "<id>", role: "target", type: "id", meaning: "the folder or task it sits under, by id" },
1831
+ {
1832
+ name: "--participant-id",
1833
+ value: "<id>",
1834
+ role: "target",
1835
+ type: "id",
1836
+ meaning: "a participant of the meeting, by id"
1837
+ },
1838
+ { name: "--person", value: "<uid>", role: "target", type: "id", meaning: "a person, by their stored UID" },
1839
+ { name: "--personal", role: "target", type: "switch", meaning: "the personal-account section of the configuration" },
1840
+ {
1841
+ name: "--project",
1842
+ value: "<project>",
1843
+ role: "target",
1844
+ type: "string",
1845
+ meaning: "a project: its key or project:<id>"
1846
+ },
1847
+ {
1848
+ name: "--recheck-since-time",
1849
+ value: "<time>",
1850
+ role: "target",
1851
+ type: "time",
1852
+ meaning: "look again from this day, for what arrived late"
1853
+ },
1854
+ { name: "--run", value: "<id>", role: "target", type: "id", meaning: "the run it is about" },
1855
+ {
1856
+ name: "--target",
1857
+ value: "<ref>",
1858
+ role: "target",
1859
+ type: "string",
1860
+ meaning: "what it acts on, as a reference: msg:, chat:, person:, task:, \u2026"
1861
+ },
1862
+ {
1863
+ name: "--secret",
1864
+ value: "<name>",
1865
+ role: "target",
1866
+ type: "choice",
1867
+ meaning: "which secret beside a bot's token to keep, typed at a hidden prompt; never the secret itself"
1868
+ },
1869
+ {
1870
+ name: "--store-token",
1871
+ value: "<profile>",
1872
+ role: "action",
1873
+ type: "string",
1874
+ meaning: "keep a token an operation returns only in this bot profile's keyring; never print it"
1875
+ },
1876
+ { name: "--task", value: "<id>", role: "target", type: "id", meaning: "a task, by id" },
1877
+ { name: "--to", value: "<chat>", role: "target", type: "id", meaning: "the chat it goes to" },
1878
+ {
1879
+ name: "--topic-name",
1880
+ value: "<name>",
1881
+ role: "target",
1882
+ type: "string",
1883
+ meaning: "a stored meeting topic label, by name or alias"
1884
+ },
1885
+ { name: "--topic", value: "<id>", role: "target", type: "id", meaning: "the forum topic, in a chat that has topics" },
1886
+ { name: "--transcript-id", value: "<id>", role: "target", type: "id", meaning: "one transcript version, by id" },
1887
+ { name: "--until-id", value: "<id>", role: "target", type: "id", meaning: "up to and including this message id" },
1888
+ { name: "--uuid", value: "<uuid>", role: "target", type: "string", meaning: "one meeting occurrence, by its UUID" },
1889
+ {
1890
+ name: "--ignore",
1891
+ value: "<path>",
1892
+ role: "target",
1893
+ type: "path",
1894
+ meaning: "also skip this file or folder, a path or a glob; repeat it for more"
1895
+ },
1896
+ { name: "--subfolder", value: "<path>", role: "target", type: "path", meaning: "a subfolder inside --folder" },
1897
+ {
1898
+ name: "--into",
1899
+ value: "<id>",
1900
+ role: "target",
1901
+ type: "id",
1902
+ meaning: "the existing thing it goes into, instead of standing alone"
1903
+ },
1904
+ {
1905
+ name: "--all-in-chat",
1906
+ role: "target",
1907
+ type: "switch",
1908
+ meaning: "also every undecided place of the same value in its chat"
1909
+ },
1910
+ {
1911
+ name: "--due-within",
1912
+ value: "<duration>",
1913
+ role: "target",
1914
+ type: "duration",
1915
+ meaning: "what falls due within this long from now"
1916
+ },
1917
+ {
1918
+ name: "--unanswered",
1919
+ value: "<duration>",
1920
+ role: "target",
1921
+ type: "duration",
1922
+ meaning: "chats where someone else wrote last at least this long ago"
1923
+ },
1924
+ {
1925
+ name: "--waiting",
1926
+ value: "<duration>",
1927
+ role: "target",
1928
+ type: "duration",
1929
+ meaning: "chats where the owner wrote last and nobody answered for at least this long"
1930
+ },
1931
+ {
1932
+ name: "--at-time",
1933
+ value: "<time>",
1934
+ role: "value",
1935
+ type: "time",
1936
+ meaning: "do it at this time",
1937
+ replaces: ["--once"]
1938
+ },
1939
+ {
1940
+ name: "--add",
1941
+ value: "<chat>",
1942
+ role: "value",
1943
+ type: "id",
1944
+ meaning: "put this chat into the set being changed; repeat it for more"
1945
+ },
1946
+ { name: "--all-can-pin", value: "<on|off>", role: "value", type: "choice", meaning: "every member may pin messages" },
1947
+ { name: "--anonymous", role: "value", type: "switch", meaning: "nobody sees who voted for what" },
1948
+ {
1949
+ name: "--approval",
1950
+ role: "value",
1951
+ type: "switch",
1952
+ meaning: "who joins by the link asks first, and an admin lets them in"
1953
+ },
1954
+ { name: "--can", value: "<rights>", role: "value", type: "list", meaning: "what an admin may do, comma-separated" },
1955
+ { name: "--channel", role: "value", type: "switch", meaning: "a channel instead of a group" },
1956
+ {
1957
+ name: "--certainty",
1958
+ value: "<n>",
1959
+ role: "value",
1960
+ type: "number",
1961
+ meaning: "how sure the agent is, from 0 to 1; kept with what it wrote"
1962
+ },
1963
+ {
1964
+ name: "--closed",
1965
+ value: "<on|off>",
1966
+ role: "value",
1967
+ type: "choice",
1968
+ meaning: "close it to new messages, or reopen it"
1969
+ },
1970
+ { name: "--comment-to", value: "<post>", role: "value", type: "id", meaning: "comment on this channel post" },
1971
+ { name: "--description", value: "<text>", role: "value", type: "string", meaning: "the new description" },
1972
+ { name: "--expire-time", value: "<time>", role: "value", type: "time", meaning: "it stops working at this time" },
1973
+ { name: "--first-name", value: "<name>", role: "value", type: "string", meaning: "the account's first name" },
1974
+ { name: "--hidden", value: "<on|off>", role: "value", type: "choice", meaning: "hide it from the list, or show it" },
1975
+ { name: "--last-name", value: "<name>", role: "value", type: "string", meaning: "the account's last name" },
1976
+ {
1977
+ name: "--max-uses",
1978
+ value: "<n>",
1979
+ role: "value",
1980
+ type: "count",
1981
+ meaning: "at most this many people join by it",
1982
+ unit: "people"
1983
+ },
1984
+ {
1985
+ name: "--members-see-link",
1986
+ value: "<on|off>",
1987
+ role: "value",
1988
+ type: "choice",
1989
+ meaning: "members may see the invite link"
1990
+ },
1991
+ { name: "--multiple", role: "value", type: "switch", meaning: "people may pick several answers" },
1992
+ {
1993
+ name: "--only-admins-add",
1994
+ value: "<on|off>",
1995
+ role: "value",
1996
+ type: "choice",
1997
+ meaning: "only admins may add members"
1998
+ },
1999
+ {
2000
+ name: "--only-admins-call",
2001
+ value: "<on|off>",
2002
+ role: "value",
2003
+ type: "choice",
2004
+ meaning: "only admins may start a call"
2005
+ },
2006
+ {
2007
+ name: "--only-owner-edits-info",
2008
+ value: "<on|off>",
2009
+ role: "value",
2010
+ type: "choice",
2011
+ meaning: "only the owner may change the name and photo"
2012
+ },
2013
+ {
2014
+ name: "--photo",
2015
+ value: "<file>",
2016
+ role: "value",
2017
+ type: "path",
2018
+ meaning: "an image file: a profile or chat photo, or a photo to send"
2019
+ },
2020
+ {
2021
+ name: "--pinned",
2022
+ value: "<on|off>",
2023
+ role: "value",
2024
+ type: "choice",
2025
+ meaning: "pin it at the top of the list, or unpin it"
2026
+ },
2027
+ {
2028
+ name: "--remove",
2029
+ value: "<chat>",
2030
+ role: "value",
2031
+ type: "id",
2032
+ meaning: "take this chat out of the set being changed; repeat it for more"
2033
+ },
2034
+ {
2035
+ name: "--reply-to",
2036
+ value: "<message>",
2037
+ role: "value",
2038
+ type: "id",
2039
+ meaning: "answer this message in the same chat"
2040
+ },
2041
+ { name: "--revote", role: "value", type: "switch", meaning: "people may change their vote" },
2042
+ { name: "--send-as", value: "<id>", role: "value", type: "id", meaning: "send as this identity of the chat" },
2043
+ {
2044
+ name: "--voice",
2045
+ value: "<file>",
2046
+ role: "value",
2047
+ type: "path",
2048
+ meaning: "an Ogg Opus file sent as a voice message"
2049
+ },
2050
+ {
2051
+ name: "--about-text",
2052
+ value: "<who>",
2053
+ role: "value",
2054
+ type: "choice",
2055
+ meaning: "who sees the about text: everyone, contacts or nobody"
2056
+ },
2057
+ {
2058
+ name: "--calls",
2059
+ value: "<who>",
2060
+ role: "value",
2061
+ type: "choice",
2062
+ meaning: "whose calls ring: everyone, contacts or nobody"
2063
+ },
2064
+ {
2065
+ name: "--chat-invites",
2066
+ value: "<who>",
2067
+ role: "value",
2068
+ type: "choice",
2069
+ meaning: "who may add the account to groups and channels: everyone, contacts or nobody"
2070
+ },
2071
+ {
2072
+ name: "--find-by-phone",
2073
+ value: "<who>",
2074
+ role: "value",
2075
+ type: "choice",
2076
+ meaning: "who finds the account by its number: everyone, contacts or nobody"
2077
+ },
2078
+ {
2079
+ name: "--hide-online",
2080
+ value: "<on|off>",
2081
+ role: "value",
2082
+ type: "choice",
2083
+ meaning: "hide online status and last seen"
2084
+ },
2085
+ {
2086
+ name: "--last-seen",
2087
+ value: "<who>",
2088
+ role: "value",
2089
+ type: "choice",
2090
+ meaning: "who sees when the account was last online: everyone, contacts or nobody"
2091
+ },
2092
+ {
2093
+ name: "--phone-number",
2094
+ value: "<who>",
2095
+ role: "value",
2096
+ type: "choice",
2097
+ meaning: "who sees the number: everyone, contacts or nobody"
2098
+ },
2099
+ {
2100
+ name: "--profile-photo",
2101
+ value: "<who>",
2102
+ role: "value",
2103
+ type: "choice",
2104
+ meaning: "who sees the profile photo: everyone, contacts or nobody"
2105
+ },
2106
+ { name: "--read-receipts", value: "<on|off>", role: "value", type: "choice", meaning: "send read receipts" },
2107
+ {
2108
+ name: "--until",
2109
+ value: "<time>",
2110
+ role: "value",
2111
+ type: "time",
2112
+ meaning: "only until then: a local time, or a duration from now"
2113
+ },
2114
+ { name: "--agenda", value: "<text>", role: "value", type: "string", meaning: "the meeting's agenda" },
2115
+ {
2116
+ name: "--allow-chats",
2117
+ value: "<ids>",
2118
+ role: "value",
2119
+ type: "list",
2120
+ meaning: "the chats allowed, by comma-separated ids; empty clears",
2121
+ replaces: ["--chats"]
2122
+ },
2123
+ {
2124
+ name: "--allow-people",
2125
+ value: "<ids>",
2126
+ role: "value",
2127
+ type: "list",
2128
+ meaning: "the senders allowed, by comma-separated ids; empty clears",
2129
+ replaces: ["--people"]
2130
+ },
2131
+ {
2132
+ name: "--as",
2133
+ value: "<state>",
2134
+ role: "value",
2135
+ type: "choice",
2136
+ meaning: "how it is closed: done, or dismissed when it needs no answer"
2137
+ },
2138
+ { name: "--assignee", value: "<person...>", role: "value", type: "list", meaning: "who does it, by UID" },
2139
+ { name: "--at", value: "<hh:mm>", role: "value", type: "string", meaning: "every day at this local time" },
2140
+ { name: "--body", value: "<json>", role: "value", type: "string", meaning: "the request body, as JSON" },
2141
+ {
2142
+ name: "--caption-above",
2143
+ role: "value",
2144
+ type: "switch",
2145
+ meaning: "show the text above the photo or file, not below it"
2146
+ },
2147
+ {
2148
+ name: "--close-time",
2149
+ value: "<delay>",
2150
+ role: "value",
2151
+ type: "duration",
2152
+ meaning: "it closes by itself this long after sending"
2153
+ },
2154
+ {
2155
+ name: "--correct",
2156
+ value: "<n>",
2157
+ role: "value",
2158
+ type: "count",
2159
+ meaning: "with --quiz, the right answer's position, from 1"
2160
+ },
2161
+ {
2162
+ name: "--deny-chats",
2163
+ value: "<ids>",
2164
+ role: "value",
2165
+ type: "list",
2166
+ meaning: "the chats left out, by comma-separated ids; empty clears; deny wins",
2167
+ replaces: ["--not-chats"]
2168
+ },
2169
+ {
2170
+ name: "--deny-people",
2171
+ value: "<ids>",
2172
+ role: "value",
2173
+ type: "list",
2174
+ meaning: "the senders left out, by comma-separated ids; empty clears; deny wins",
2175
+ replaces: ["--not-people"]
2176
+ },
2177
+ { name: "--due", value: "<time>", role: "value", type: "time", meaning: "when it must be done" },
2178
+ {
2179
+ name: "--duration-minutes",
2180
+ value: "<minutes>",
2181
+ role: "value",
2182
+ type: "count",
2183
+ meaning: "how long the meeting lasts, in minutes",
2184
+ unit: "minutes"
2185
+ },
2186
+ { name: "--emoji", value: "<emoji>", role: "value", type: "string", meaning: "the icon" },
2187
+ {
2188
+ name: "--event-id",
2189
+ value: "<id>",
2190
+ role: "value",
2191
+ type: "id",
2192
+ meaning: "the stored calendar event it is linked to, or none to unlink"
2193
+ },
2194
+ { name: "--every", value: "<duration>", role: "value", type: "duration", meaning: "repeat this often" },
2195
+ {
2196
+ name: "--evidence",
2197
+ value: "<ref...>",
2198
+ role: "value",
2199
+ type: "list",
2200
+ meaning: "what shows it: msg:, note:, meeting:, person: or another reference"
2201
+ },
2202
+ {
2203
+ name: "--exclude-chat",
2204
+ value: "<chat>",
2205
+ role: "value",
2206
+ type: "id",
2207
+ meaning: "never show this chat in it; repeat it for more"
2208
+ },
2209
+ {
2210
+ name: "--file",
2211
+ value: "<file>",
2212
+ role: "value",
2213
+ type: "path",
2214
+ meaning: "a file to send with the message; the text becomes its caption"
2215
+ },
2216
+ {
2217
+ name: "--filename",
2218
+ value: "<name>",
2219
+ role: "value",
2220
+ type: "string",
2221
+ meaning: "the name others see for the file, instead of its name on disk"
2222
+ },
2223
+ {
2224
+ name: "--history",
2225
+ role: "value",
2226
+ type: "switch",
2227
+ meaning: "the people added also see the messages from before they came"
2228
+ },
2229
+ {
2230
+ name: "--include",
2231
+ value: "<kinds>",
2232
+ role: "value",
2233
+ type: "list",
2234
+ meaning: "every chat of these kinds, comma-separated"
2235
+ },
2236
+ {
2237
+ name: "--join-approval",
2238
+ value: "<on|off>",
2239
+ role: "value",
2240
+ type: "choice",
2241
+ meaning: "people ask to join the chat, and an admin lets them in"
2242
+ },
2243
+ {
2244
+ name: "--key",
2245
+ value: "<key>",
2246
+ role: "value",
2247
+ type: "string",
2248
+ meaning: "the short key, 3\u20134 letters and digits; made from the name when left out"
2249
+ },
2250
+ {
2251
+ name: "--kind",
2252
+ value: "<kind>",
2253
+ role: "value",
2254
+ type: "choice",
2255
+ meaning: "what kind of thing it is; the command lists the kinds"
2256
+ },
2257
+ { name: "--name", value: "<name>", role: "value", type: "string", meaning: "the name to give it" },
2258
+ { name: "--no-approval", role: "value", type: "switch", meaning: "anyone with the link joins at once" },
2259
+ {
2260
+ name: "--notification",
2261
+ value: "<text>",
2262
+ role: "value",
2263
+ type: "string",
2264
+ meaning: "a note only the person who pressed sees"
2265
+ },
2266
+ {
2267
+ name: "--params",
2268
+ value: "<json>",
2269
+ role: "value",
2270
+ type: "string",
2271
+ meaning: "the request's query and path parameters, as JSON"
2272
+ },
2273
+ { name: "--payload", value: "<json>", role: "value", type: "string", meaning: "the data of what to do, as JSON" },
2274
+ {
2275
+ name: "--pin",
2276
+ value: "<chat>",
2277
+ role: "value",
2278
+ type: "id",
2279
+ meaning: "pin this chat at the top of it; repeat it for more"
2280
+ },
2281
+ { name: "--priority", value: "<n>", role: "value", type: "count", meaning: "0 urgent \u2026 4 low" },
2282
+ { name: "--quiz", role: "value", type: "switch", meaning: "a quiz: one answer is right, and a vote is final" },
2283
+ {
2284
+ name: "--reason",
2285
+ value: "<text>",
2286
+ role: "value",
2287
+ type: "string",
2288
+ meaning: "why, in a few words; kept with it",
2289
+ replaces: ["--provenance"]
2290
+ },
2291
+ { name: "--remind-time", value: "<time>", role: "value", type: "time", meaning: "when to look at it again" },
2292
+ { name: "--role", value: "<role>", role: "value", type: "string", meaning: "the part it plays, in a word or two" },
2293
+ {
2294
+ name: "--scope",
2295
+ value: "<scope>",
2296
+ role: "value",
2297
+ type: "choice",
2298
+ meaning: "personal or work: which side of the owner's life it belongs to"
2299
+ },
2300
+ {
2301
+ name: "--solution",
2302
+ value: "<text>",
2303
+ role: "value",
2304
+ type: "string",
2305
+ meaning: "with --quiz, what people see once they answered"
2306
+ },
2307
+ {
2308
+ name: "--spoiler",
2309
+ role: "value",
2310
+ type: "switch",
2311
+ meaning: "hide the photo or video behind a spoiler until tapped"
2312
+ },
2313
+ {
2314
+ name: "--start",
2315
+ value: "<param>",
2316
+ role: "value",
2317
+ type: "string",
2318
+ meaning: "the start parameter the bot or app reads"
2319
+ },
2320
+ { name: "--start-time", value: "<time>", role: "value", type: "time", meaning: "when it starts" },
2321
+ { name: "--sticker", value: "<id>", role: "value", type: "id", meaning: "send this sticker, alone" },
2322
+ {
2323
+ name: "--subject",
2324
+ value: "<ref>",
2325
+ role: "value",
2326
+ type: "string",
2327
+ meaning: "what it is about, as a reference",
2328
+ replaces: ["--about"]
2329
+ },
2330
+ {
2331
+ name: "--supersedes",
2332
+ value: "<ref>",
2333
+ role: "value",
2334
+ type: "string",
2335
+ meaning: "the earlier one this replaces, as a reference"
2336
+ },
2337
+ { name: "--text", value: "<text>", role: "value", type: "string", meaning: "the text" },
2338
+ {
2339
+ name: "--text-file",
2340
+ value: "<path>",
2341
+ role: "value",
2342
+ type: "path",
2343
+ meaning: "read the text from this file; - reads stdin"
2344
+ },
2345
+ { name: "--title", value: "<title>", role: "value", type: "string", meaning: "the title or name to give it" },
2346
+ {
2347
+ name: "--type",
2348
+ value: "<type>",
2349
+ role: "value",
2350
+ type: "choice",
2351
+ meaning: "what type of thing it is; the command lists the types"
2352
+ },
2353
+ {
2354
+ name: "--types",
2355
+ value: "<types>",
2356
+ role: "value",
2357
+ type: "list",
2358
+ meaning: "the update types, comma-separated, in the messenger's words"
2359
+ },
2360
+ {
2361
+ name: "--occurred-time",
2362
+ value: "<time>",
2363
+ role: "value",
2364
+ type: "time",
2365
+ meaning: "when it happened",
2366
+ replaces: ["--occurred"]
2367
+ },
2368
+ { name: "--clear", role: "value", type: "switch", meaning: "unset it, instead of setting a new value" },
2369
+ {
2370
+ name: "--do",
2371
+ value: "<actions>",
2372
+ role: "value",
2373
+ type: "list",
2374
+ meaning: "what a rule does when it matches, comma-separated; the command lists the actions"
2375
+ },
2376
+ { name: "--sender", value: "<address>", role: "value", type: "string", meaning: "a sender, by email address" },
2377
+ {
2378
+ name: "--domain",
2379
+ value: "<domain>",
2380
+ role: "value",
2381
+ type: "string",
2382
+ meaning: "an internet domain, such as example.com"
2383
+ },
2384
+ { name: "--list-id", value: "<id>", role: "value", type: "id", meaning: "a mailing list, by its List-Id header" },
2385
+ {
2386
+ name: "--category",
2387
+ value: "<name>",
2388
+ role: "value",
2389
+ type: "choice",
2390
+ meaning: "what it is about; the command lists the categories"
2391
+ },
2392
+ {
2393
+ name: "--holder",
2394
+ value: "<name>",
2395
+ role: "value",
2396
+ type: "string",
2397
+ meaning: "who takes or holds a claim: a session or chat id; the command says its default"
2398
+ },
2399
+ {
2400
+ name: "--lease",
2401
+ value: "<duration>",
2402
+ role: "value",
2403
+ type: "duration",
2404
+ meaning: "how long a claim lasts before it lapses by itself; claiming again extends it"
2405
+ },
2406
+ {
2407
+ name: "--filter",
2408
+ value: "<query>",
2409
+ role: "query",
2410
+ type: "string",
2411
+ meaning: "a query every result must also match, beside the search's own words"
2412
+ },
2413
+ {
2414
+ name: "--values",
2415
+ value: "<json>",
2416
+ role: "value",
2417
+ type: "string",
2418
+ meaning: "cell values as JSON rows for an explicit range update or row append; not a list filter"
2419
+ }
2420
+ ];
2421
+
2422
+ // node_modules/.pnpm/@wirecat+cli-base@0.68.1_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
2423
+ var FLAG_TYPES = [
2424
+ "switch",
2425
+ "count",
2426
+ "number",
2427
+ "string",
2428
+ "id",
2429
+ "time",
2430
+ "duration",
2431
+ "choice",
2432
+ "list",
2433
+ "path",
2434
+ "cursor"
2435
+ ];
2436
+ var FLAG_ROLES = {
2437
+ paging: "which part of a long answer: how many, which page, where to continue",
2438
+ output: "how the answer is shaped or shown",
2439
+ sort: "the order of the answer",
2440
+ mode: "how the command runs, not what it reads",
2441
+ action: "does something extra besides the answer",
2442
+ budget: "how much time or work the command may spend",
2443
+ scope: "which accounts, providers or sources are read; never picked for you, so a flag and not a query field",
2444
+ target: "which thing or time window the command acts on, when that is not a list's filter",
2445
+ value: "sets a field on a write",
2446
+ query: "a query in the query language, beside a search's own words"
2447
+ };
2448
+ var verbSchema = strictObject({ word, meaning: text, replaces: optional(array(word)) });
2449
+ var nounSchema = strictObject({
2450
+ word,
2451
+ meaning: text,
2452
+ // A collection is named in the plural; a singular is what a profile has exactly one of.
2453
+ kind: picklist(["collection", "singular"]),
2454
+ replaces: optional(array(word))
2455
+ });
2456
+ var viewSchema = strictObject({ word, meaning: text });
2457
+ var rootSchema = strictObject({ word, meaning: text });
2458
+ var flagSchema = strictObject({
2459
+ name: pipe(string(), regex(/^--[a-z][a-z0-9]*(-[a-z0-9]+)*$/, "a long flag: --lower-case-words")),
2460
+ value: optional(pipe(string(), regex(/^<[a-z][a-z0-9-|=:]*(\.\.\.)?>$/, "a value name such as <n>"))),
2461
+ type: picklist(FLAG_TYPES),
2462
+ role: picklist(Object.keys(FLAG_ROLES)),
2463
+ meaning: text,
2464
+ unit: optional(text),
2465
+ /** Other names for the same flag, which `flag-synonym` refuses. */
2466
+ replaces: optional(array(pipe(string(), regex(/^--[a-z][a-z0-9]*(-[a-z0-9]+)*$/, "a long flag"))))
2467
+ });
2468
+ var vocabularySchema = strictObject({
2469
+ verbs: array(verbSchema),
2470
+ nouns: array(nounSchema),
2471
+ views: array(viewSchema),
2472
+ roots: array(rootSchema),
2473
+ flags: array(flagSchema)
2474
+ });
2475
+ var defineVocabulary = /* @__PURE__ */ __name((input) => parseRegistry("vocabulary", vocabularySchema, input, (vocabulary) => {
2476
+ const problems = [];
2477
+ const kinds = {
2478
+ verbs: vocabulary.verbs.map((entry) => entry.word),
2479
+ nouns: vocabulary.nouns.map((entry) => entry.word),
2480
+ views: vocabulary.views.map((entry) => entry.word),
2481
+ roots: vocabulary.roots.map((entry) => entry.word),
2482
+ flags: vocabulary.flags.map((entry) => entry.name)
2483
+ };
2484
+ for (const [kind, words] of Object.entries(kinds))
2485
+ for (const repeated of duplicates(words))
2486
+ problems.push(`${kind}: "${repeated}" is listed twice`);
2487
+ for (const flag of vocabulary.flags)
2488
+ if (flag.type === "switch" !== (flag.value === void 0))
2489
+ problems.push(`flags: ${flag.name} \u2014 a switch has no value name; every other type has one`);
2490
+ const verbs2 = new Set(kinds.verbs);
2491
+ for (const verb of vocabulary.verbs)
2492
+ for (const old of verb.replaces ?? [])
2493
+ if (verbs2.has(old))
2494
+ problems.push(`verbs: "${verb.word}" replaces "${old}", which is itself a verb`);
2495
+ const flags = new Set(kinds.flags);
2496
+ for (const flag of vocabulary.flags)
2497
+ for (const old of flag.replaces ?? [])
2498
+ if (flags.has(old))
2499
+ problems.push(`flags: ${flag.name} replaces ${old}, which is itself a flag`);
2500
+ return problems;
2501
+ }), "defineVocabulary");
2502
+ var verbs = [
2503
+ ["list", "show many"],
2504
+ ["show", "show one"],
2505
+ ["search", "find by text; the description says where it looks"],
2506
+ ["prepare", "assemble bounded cited context for a selected upcoming activity without applying findings"],
2507
+ ["related", "what is nearest in meaning to one thing, without a query"],
2508
+ ["info", "facts about a singular thing itself: where it is, its size, its version, its schema"],
2509
+ ["status", "how a thing stands right now"],
2510
+ ["check", "verify, and change nothing; the answer says what is wrong and how to fix it"],
2511
+ ["test", "run rules over what is already stored and say what they would have done, doing none of it"],
2512
+ ["apply", "run the owner's saved rules over what is already stored and change what they match; dry run unless --yes"],
2513
+ ["scan", "read stored messages for what a rule finds, such as tasks, and list it; records it only with --yes"],
2514
+ ["pause", "stop what a running process does for a profile, without stopping the process"],
2515
+ ["resume", "restart what pause stopped"],
2516
+ ["create", "make a thing"],
2517
+ ["delete", "destroy a thing"],
2518
+ ["add", "put an existing thing into a set"],
2519
+ ["remove", "take a thing out of a set"],
2520
+ ["clear", "empty a set"],
2521
+ ["update", "change a thing's fields"],
2522
+ ["set", "set one named key"],
2523
+ ["unset", "remove one named key"],
2524
+ ["insert", "put bounded rows, columns or cells before an explicit position, shifting later entries"],
2525
+ ["format", "change how selected cells are displayed without replacing their values"],
2526
+ ["rename", "change a thing's name only"],
2527
+ ["start", "start a running process, or a login session"],
2528
+ ["stop", "stop a running process"],
2529
+ ["restart", "stop and start a running process"],
2530
+ ["serve", "run a server in this process and answer its clients until stopped"],
2531
+ ["end", "end a login session"],
2532
+ ["revoke", "take back what was granted, so it stops working: a login, an invite link, a consent"],
2533
+ ["install", "install a system unit"],
2534
+ ["uninstall", "remove a system unit"],
2535
+ ["cancel", "stop a job or a pending thing"],
2536
+ [
2537
+ "sync",
2538
+ "bring the local store up to date from the source: only what changed, or the whole list where the source cannot say; a mirror syncs both ways"
2539
+ ],
2540
+ ["fetch", "one bounded pull of one named thing into the store, not a catch-up"],
2541
+ ["unsync", "stop syncing a thing; what the store already holds stays"],
2542
+ ["export", "write from the store to a file"],
2543
+ ["import", "bring a file or list the user gives into the store or the messenger, once"],
2544
+ ["download", "save a file from the source to this machine"],
2545
+ ["transcribe", "turn speech into text"],
2546
+ ["extract", "read the text inside files already on this machine into the store"],
2547
+ ["migrate", "bring a file up to this build's schema"],
2548
+ ["backup", "copy a file somewhere safe"],
2549
+ ["restore", "put a backup back in its place"],
2550
+ ["repair", "bring a file's tables to this build's shape without deleting anything"],
2551
+ [
2552
+ "rebuild",
2553
+ "compute again, from what the store already holds, what the tool derives from it, keeping the owner's decisions"
2554
+ ],
2555
+ // Only when someone asks, never from a matching name: WC-ACCT-11 in docs/standards/accounts.md.
2556
+ ["link", "record that two identities are one person"],
2557
+ ["unlink", "undo a link"],
2558
+ ["lookup", "ask the messenger who is behind a phone number"],
2559
+ [
2560
+ "inspect",
2561
+ "look at a source before taking anything from it: a chat link without joining, a mailbox without importing"
2562
+ ],
2563
+ ["send", "send a message"],
2564
+ ["edit", "change a sent message"],
2565
+ ["forward", "send an existing message on to another chat"],
2566
+ ["pin", "pin a message or chat"],
2567
+ ["unpin", "unpin a message or chat"],
2568
+ ["star", "mark a message so the owner finds it again; only the owner sees the star"],
2569
+ ["unstar", "take the owner's star off a message"],
2570
+ ["vote", "answer a poll"],
2571
+ ["answer", "reply to a button someone pressed under a bot's message"],
2572
+ ["respond", "answer an invitation: accept, tentatively accept or decline it"],
2573
+ ["press", "press a button under a bot's message; the bot sees who pressed it"],
2574
+ ["action", "show what a bot is doing in a chat, such as typing, for a few seconds"],
2575
+ ["watch", "follow new events as they come, and keep them"],
2576
+ ["close", "close a thing that stays: a poll, a task"],
2577
+ ["join", "join a chat"],
2578
+ ["leave", "leave a chat"],
2579
+ ["mute", "stop notifications from a chat for the owner; nobody in it is told"],
2580
+ ["unmute", "undo a mute"],
2581
+ ["block", "block a person"],
2582
+ ["unblock", "unblock a person"],
2583
+ ["mark-read", "mark a chat read; the other person sees it"],
2584
+ ["mark-unread", "mark a chat unread on the owner's own devices; nobody in it is told"],
2585
+ ["archive", "move a chat into the messenger's archive, out of the main chat list; nobody in it is told"],
2586
+ ["unarchive", "bring an archived chat back to the main chat list"],
2587
+ ["reset", "replace a thing; the old one stops working"],
2588
+ ["moderate", "apply a chat's rules: delete what breaks them, act on who broke them"],
2589
+ ["assign", "name the person responsible for work, with their task role"],
2590
+ ["reverse", "record that an accepted decision no longer holds, without replacing it"],
2591
+ ["invalidate", "mark a derived record whose supporting evidence no longer holds"],
2592
+ ["acknowledge", "record successful delivery using the exact receipt issued when the item was claimed"],
2593
+ ["confirm", "the owner accepts what an agent proposed"],
2594
+ ["reject", "the owner refuses what an agent proposed"],
2595
+ ["review", "list what waits for the owner's decision"],
2596
+ ["resolve", "settle one thing that waits for the owner's decision, with the owner's choice"],
2597
+ ["move", "move a thing to another place in the source: a file to a folder, an event to a calendar"],
2598
+ ["copy", "copy a file in the source"],
2599
+ ["run", "run a saved job once, now, as its timer would"],
2600
+ ["claim", "take a thing for a while so no other agent works it at once; the claim lapses by itself"],
2601
+ ["release", "give back what claim took, before it lapses"],
2602
+ ["merge", "fold a duplicate into the thing that stays; nothing is deleted"],
2603
+ ["unmerge", "undo a merge"],
2604
+ ["defer", "leave a decision undecided, for the owner"],
2605
+ ["embed", "compute the vectors a meaning search reads, for what is stored and has none"],
2606
+ ["decrypt", "write an unencrypted copy of a file sealed by the tool, using the supplied password"],
2607
+ ["retry", "start a fresh attempt at partial or failed work, retaining the previous attempt"]
2608
+ ];
2609
+ var replaces = {
2610
+ list: ["ls"],
2611
+ show: ["get", "view"],
2612
+ search: ["find", "query"],
2613
+ delete: ["rm", "trash"],
2614
+ create: ["mkdir"],
2615
+ update: ["plan"],
2616
+ set: ["configure"],
2617
+ sync: ["refresh"],
2618
+ check: ["audit", "preflight"],
2619
+ status: ["readiness"],
2620
+ confirm: ["accept", "approve"],
2621
+ reject: ["decline", "deny"]
2622
+ };
2623
+ var collections = [
2624
+ ["chats", "conversations in a messenger"],
2625
+ ["contacts", "identities in a messenger's contact list"],
2626
+ ["messages", "posts in a messenger chat, or emails"],
2627
+ ["polls", "polls in a chat"],
2628
+ ["reactions", "reactions to a message"],
2629
+ ["recipients", "who a message goes to"],
2630
+ ["replies", "the automatic replies of a profile"],
2631
+ ["sends", "messages waiting to be sent, or sent by this tool"],
2632
+ ["runs", "past runs of this tool"],
2633
+ ["topics", "forum topics in a group"],
2634
+ ["models", "local or remote models"],
2635
+ ["tags", "labels the owner puts on things"],
2636
+ ["searches", "the owner's saved searches"],
2637
+ ["copies", "tables kept aside by a repair"],
2638
+ ["tables", "the tables of the local store, with their kind, row count and size"],
2639
+ ["attachments", "files of stored messages"],
2640
+ ["tasks", "what waits on the owner"],
2641
+ ["members", "people in a chat"],
2642
+ ["admins", "administrators of a chat"],
2643
+ ["tracking", "the chats whose member lists are fetched daily"],
2644
+ ["documents", "files imported from Google Drive or Docs, or linked in a chat"],
2645
+ ["notes", "text the owner writes, or files from a notes folder"],
2646
+ ["projects", "the owner's work units with a task key"],
2647
+ [
2648
+ "annotations",
2649
+ "derived records attached to a selected entity, with explicit coverage of included and omitted facets"
2650
+ ],
2651
+ ["organizations", "companies, teams, families or communities"],
2652
+ [
2653
+ "identities",
2654
+ "ways to reach a person or an organization: an account in one messenger or mailbox, an e-mail address, a phone"
2655
+ ],
2656
+ ["facts", "what happened, with evidence"],
2657
+ ["memories", "what an agent concluded, with evidence and scope"],
2658
+ ["relationships", "confirmed or suggested links between people, organizations and projects"],
2659
+ ["sheets", "remote spreadsheets and their cell ranges, read or changed through a provider"],
2660
+ ["files", "files in the source, such as Google Drive, read and changed there"],
2661
+ ["comments", "comments people left on a thing in the source: a channel post or a file"],
2662
+ ["meetings", "stored meetings, from Zoom or another provider"],
2663
+ ["calendars", "calendars of an account, each synced or not"],
2664
+ ["events", "calendar entries: meetings, appointments and other things on a calendar"],
2665
+ ["people", "persons the owner deals with, such as the attendees of events"],
2666
+ ["recordings", "the files a provider recorded of a meeting"],
2667
+ ["jobs", "work this tool runs in the background or on a timer"],
2668
+ ["actions", "what an agent proposes to do; the owner confirms or rejects each"],
2669
+ ["agents", "the agents whose actions are recorded in the shared store"],
2670
+ ["reminders", "scheduled notices about stored work, claimed and acknowledged with delivery receipts"],
2671
+ ["key-documents", "selected source documents that a project keeps as its starting references"],
2672
+ ["answers", "evidence-grounded answers assembled from selected stored sources"],
2673
+ ["aliases", "other names of one thing"],
2674
+ ["mentions", "phones, e-mail addresses, links and documents found in stored text, each where it was written"],
2675
+ ["images", "pictures in stored messages, searched by what they show"],
2676
+ ["duplicates", "pairs of things that may be one, each waiting for a decision"],
2677
+ ["sessions", "devices and applications signed in to an account"],
2678
+ ["folders", "named groupings of chats or source files"],
2679
+ ["links", "stored or source-provided connections between selected things"],
2680
+ ["requests", "requests waiting for an explicit decision"],
2681
+ ["rules", "saved rules the owner applies to selected things"],
2682
+ ["conversations", "derived stretches of chat messages grouped by topic"],
2683
+ ["batches", "bounded work packets submitted or waiting for processing"],
2684
+ ["consents", "recorded permission to process selected data with a specified service"],
2685
+ ["embeddings", "vectors computed from stored content for similarity search"],
2686
+ ["reports", "saved reports about selected data or a tool's state"],
2687
+ ["keys", "credentials for a selected external service"],
2688
+ ["counters", "stored observations of source counts, with their freshness"],
2689
+ ["gaps", "ranges a source could contain that the local store does not hold"],
2690
+ ["callbacks", "button presses a bot received and may answer"],
2691
+ ["webhooks", "addresses a messenger pushes a bot's updates to"],
2692
+ ["templates", "messages a business has approved in advance, the only kind some messengers deliver late"],
2693
+ ["media", "files people sent, held by the messenger under an id"]
2694
+ ];
2695
+ var singulars = [
2696
+ ["session", "this tool's login"],
2697
+ ["account", "the messenger or mail account behind a profile"],
2698
+ ["mail", "the local email archive and its mailbox import, rules and cleanup operations"],
2699
+ ["config", "a profile's settings"],
2700
+ ["server", "the long-running process of a profile"],
2701
+ ["store", "the local SQLite database the tools share"],
2702
+ ["catalog", "stored source file and folder metadata and parent relationships"],
2703
+ ["skill", "the agent skill file of this tool"],
2704
+ ["cache", "max's per-profile cache"],
2705
+ ["flood", "what the messenger told this profile to hold off on"],
2706
+ ["vocabulary", "the owner's catalogue of canonical names, with their aliases"],
2707
+ ["api", "the source's own API, one command per operation"],
2708
+ ["privacy", "who may find, see, call or add the account"],
2709
+ ["metadata", "a profile's cached source attributes"],
2710
+ ["auth", "the credentials a bot profile uses: its token and the secrets beside it"]
2711
+ ];
2712
+ var views = [
2713
+ ["tree", "the parent and child hierarchy of stored sources"],
2714
+ ["logs", "the log of a running process"],
2715
+ ["events", "what happened in a thing over time"],
2716
+ ["scheduled", "what is scheduled to happen"],
2717
+ ["context", "what surrounds one thing"],
2718
+ ["path", "where a thing is on this machine"],
2719
+ ["config", "the configuration a thing needs"],
2720
+ ["history", "past uses of a thing"],
2721
+ ["top", "a ranked view under stats"],
2722
+ ["official", "the view the messenger itself computed, under stats"],
2723
+ ["transcript", "the text of speech: a voice message or a meeting recording"],
2724
+ ["evidence", "the stored messages or lines a result or a reference rests on"],
2725
+ ["passage", "a cited transcript line with bounded surrounding lines from the same revision"],
2726
+ ["agenda", "what needs a look today"],
2727
+ ["busy", "when calendars or people are taken, without what takes them"],
2728
+ ["categories", "the categories a thing takes, with what each means"],
2729
+ ["domains", "the internet domains links point to, most linked first"],
2730
+ ["places", "the street addresses confirmed as places, most mentioned first"],
2731
+ ["comments", "replies attached to a selected source item"],
2732
+ ["links", "links held for a selected thing"],
2733
+ ["voters", "people whose recorded votes are visible for a selected poll"],
2734
+ ["charts", "time series drawn from selected statistics, optionally rendered to a file"],
2735
+ ["newcomers", "members observed joining during the selected time window"],
2736
+ ["retention", "whether members of a selected cohort remain or return over time"],
2737
+ ["responses", "observed replies between participants and the time taken to answer"],
2738
+ ["discussion", "source posts compared by known views and observed discussion replies"],
2739
+ ["unanswered", "questions without an observed qualifying answer"],
2740
+ ["me", "the account a profile's token belongs to"],
2741
+ ["between", "the messages between two given messages of one chat"],
2742
+ ["app", "a bot's mini app: the address that opens it, signed in as the owner"]
2743
+ ];
2744
+ var roots = [
2745
+ ["batch", "run bounded explicitly registered reads with independent correlated answers"],
2746
+ ["inbox", "what waits across every chat"],
2747
+ ["review", "go through what needs the owner"],
2748
+ ["watch", "follow new events as they come"],
2749
+ ["serve", "the long-running process"],
2750
+ ["setup", "the guided first run: log in or link the account, then install the agent skill"],
2751
+ ["doctor", "check this machine's setup"],
2752
+ ["upgrade", "install a newer version of this tool"],
2753
+ ["commands", "the command tree as data"],
2754
+ ["guide", "scenarios: the commands for a common task, in order, and why each"],
2755
+ ["complete", "shell completion"],
2756
+ ["mcp", "the MCP server and its setup"],
2757
+ ["bot", "the profile's bot account"],
2758
+ ["stats", "statistics"],
2759
+ ["search", "searches across resources"]
2760
+ ];
2761
+ var VOCABULARY = defineVocabulary({
2762
+ verbs: verbs.map(([entry, meaning]) => ({
2763
+ word: entry,
2764
+ meaning,
2765
+ ...replaces[entry] ? { replaces: replaces[entry] } : {}
2766
+ })),
2767
+ nouns: [
2768
+ ...collections.map(([entry, meaning]) => ({ word: entry, meaning, kind: "collection" })),
2769
+ ...singulars.map(([entry, meaning]) => ({ word: entry, meaning, kind: "singular" }))
2770
+ ],
2771
+ views: views.map(([entry, meaning]) => ({ word: entry, meaning })),
2772
+ roots: roots.map(([entry, meaning]) => ({ word: entry, meaning })),
2773
+ flags: [...HOW_FLAGS, ...WHAT_FLAGS, ...CALENDAR_FLAGS]
2774
+ });
2775
+
2776
+ // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/mcp/agent.js
2777
+ var TYPES = new Map(VOCABULARY.flags.map((flag) => [flag.name, flag.type]));
2778
+ var snake = /* @__PURE__ */ __name((name) => name.replaceAll("|", "_or_").replace(/[^a-z0-9]+/gi, "_"), "snake");
2779
+ var longOf = /* @__PURE__ */ __name((option) => option.flags.match(/--[a-z0-9][a-z0-9-]*/)?.[0], "longOf");
2780
+ var text2 = /* @__PURE__ */ __name((description2) => pipe(
2781
+ string(),
2782
+ minLength(1),
2783
+ // `-` alone reads stdin, which is the MCP transport.
2784
+ regex(/^(?!-$)[\s\S]+$/, "a value, and not only -"),
2785
+ description(description2)
2786
+ ), "text");
2787
+ var optionKind = /* @__PURE__ */ __name((option, long) => {
2788
+ if (!option.takes_value)
2789
+ return "switch";
2790
+ if (option.choices)
2791
+ return "text";
2792
+ const type = TYPES.get(long);
2793
+ if (type === "count" || type === "number" || type === "list")
2794
+ return type;
2795
+ if (/<json>/.test(option.flags))
2796
+ return "json";
2797
+ if (Array.isArray(option.default))
2798
+ return "repeat";
2799
+ return /\.\.\.[>\]]/.test(option.flags) ? "variadic" : "text";
2800
+ }, "optionKind");
2801
+ var CLEARS = /\bempty clears\b/;
2802
+ var optionField = /* @__PURE__ */ __name((option, long, negated) => {
2803
+ const kind = optionKind(option, long);
2804
+ const about = negated ? `${option.description}; false: ${negated.description}` : option.description;
2805
+ const schema = kind === "switch" ? pipe(boolean(), description(about)) : option.choices ? pipe(picklist(option.choices), description(about)) : kind === "count" ? (
2806
+ // The command judges the range: `--thread-hops 0` is one, `--limit 0` is not.
2807
+ pipe(number(), integer(), minValue(0), description(about))
2808
+ ) : kind === "number" ? pipe(number(), description(about)) : kind === "list" || kind === "repeat" ? (
2809
+ // The command line takes `a,b` or the flag repeated; an agent may write one value, or a list.
2810
+ pipe(union([pipe(array(text2("one value")), minLength(1)), text2(about)]), description(about))
2811
+ ) : kind === "variadic" ? pipe(array(text2("one value")), minLength(1), description(about)) : kind === "json" ? (
2812
+ // A next step hands back the object an answer gave; the command takes it as JSON text.
2813
+ pipe(union([string(), record(string(), unknown())]), description(about))
2814
+ ) : CLEARS.test(about) ? pipe(string(), regex(/^(?!-$)/, "not only -"), description(about)) : text2(about);
2815
+ return {
2816
+ name: snake(long.slice(2)),
2817
+ required: option.mandatory,
2818
+ schema,
2819
+ positional: false,
2820
+ argv: /* @__PURE__ */ __name((value) => {
2821
+ if (kind === "switch")
2822
+ return value === true ? [long] : negated ? [`--no-${long.slice(2)}`] : [];
2823
+ if (kind === "variadic")
2824
+ return value.map((one) => `${long}=${String(one)}`);
2825
+ if (kind === "repeat")
2826
+ return (Array.isArray(value) ? value : [value]).map((one) => `${long}=${String(one)}`);
2827
+ if (kind === "list")
2828
+ return [`${long}=${Array.isArray(value) ? value.map(String).join(",") : String(value)}`];
2829
+ if (kind === "json")
2830
+ return [`${long}=${typeof value === "string" ? value : JSON.stringify(value)}`];
2831
+ return [`${long}=${String(value)}`];
2832
+ }, "argv")
2833
+ };
2834
+ }, "optionField");
2835
+ var argumentField = /* @__PURE__ */ __name((argument) => {
2836
+ const one = argument.choices ? pipe(picklist(argument.choices), description(argument.description)) : text2(argument.description || argument.name);
2837
+ return {
2838
+ name: snake(argument.name),
2839
+ required: argument.required,
2840
+ // A query is several words on the command line; an agent writes it as one string, which is one of them.
2841
+ schema: argument.variadic ? union([pipe(array(one), minLength(argument.required ? 1 : 0)), one]) : one,
2842
+ positional: true,
2843
+ argv: /* @__PURE__ */ __name((value) => Array.isArray(value) ? value.map(String) : [String(value)], "argv")
2844
+ };
2845
+ }, "argumentField");
2846
+ var OFFLINE = {
2847
+ name: "offline",
2848
+ required: false,
2849
+ schema: pipe(boolean(), description("answer from the copy on this machine only")),
2850
+ positional: false,
2851
+ argv: /* @__PURE__ */ __name((value) => value === true ? ["--offline"] : [], "argv")
2852
+ };
2853
+ var stdinField = /* @__PURE__ */ __name(({ name, description: description2, json }) => ({
2854
+ name,
2855
+ required: true,
2856
+ schema: json ? pipe(union([string(), record(string(), unknown())]), description(description2)) : pipe(string(), minLength(1), description(description2)),
2857
+ positional: false,
2858
+ stdin: true,
2859
+ argv: /* @__PURE__ */ __name(() => [], "argv")
2860
+ }), "stdinField");
2861
+ var fieldsOf = /* @__PURE__ */ __name((info, { omit = [], offline = false, stdin }) => {
2862
+ const fields = info.arguments.map(argumentField);
2863
+ const read = stdin?.(info.path);
2864
+ if (read)
2865
+ fields.push(stdinField(read));
2866
+ const switches = new Map(info.options.filter((one) => !one.takes_value).map((one) => [longOf(one), one]));
2867
+ for (const option of info.options) {
2868
+ const long = longOf(option);
2869
+ if (!long || option.mcp === false)
2870
+ continue;
2871
+ const positive = long.startsWith("--no-") ? switches.get(`--${long.slice(5)}`) : void 0;
2872
+ if (positive && positive.mcp !== false)
2873
+ continue;
2874
+ const field = optionField(option, long, option.takes_value ? void 0 : switches.get(`--no-${long.slice(2)}`));
2875
+ if (!fields.some((existing) => existing.name === field.name))
2876
+ fields.push(field);
2877
+ }
2878
+ if (offline && info.effects?.remote === "read" && info.offline !== false)
2879
+ fields.push(OFFLINE);
2880
+ return fields.filter((field) => !omit.includes(field.name));
2881
+ }, "fieldsOf");
2882
+ var schemaOf = /* @__PURE__ */ __name((fields) => object(Object.fromEntries(fields.map((field) => [field.name, field.required ? field.schema : optional(field.schema)]))), "schemaOf");
2883
+ var startsWith = /* @__PURE__ */ __name((path, prefix) => prefix.every((word2, at) => path[at] === word2), "startsWith");
2884
+ var toolsFromCommands = /* @__PURE__ */ __name((commands, options = {}) => {
2885
+ const { root = [], exclude = [], levels, keyOf, authority, readOnly = false, permissions } = options;
2886
+ return flatten(commands).filter((info) => (
2887
+ // A group is offered only when it runs on its own; without an action it only prints its help.
2888
+ (info.commands.length === 0 || info.runnable === true) && info.path.length > root.length && startsWith(info.path, root) && !exclude.some((skipped) => startsWith(info.path.slice(root.length), skipped)) && info.mcp !== false && info.lifetime === void 0 && (options.includeUnavailable === true || !(readOnly && (changesMessenger(info) || authority?.(info.path))) && (levels === void 0 && !(readOnly && permissions) ? true : commandAvailability(info, levels ?? {}, keyOf, authority, readOnly, true, permissions).available))
2889
+ )).map((info) => ({
2890
+ availability: /* @__PURE__ */ __name(() => commandAvailability(info, options.currentLevels?.() ?? levels ?? {}, keyOf, authority, readOnly, true, permissions), "availability"),
2891
+ command: info.path.slice(root.length).join(" "),
2892
+ path: info.path,
2893
+ title: info.summary ?? info.description,
2894
+ description: info.description,
2895
+ writes: writes(info.effects) && options.fetchOnly?.(info.path) !== true,
2896
+ input: schemaOf(fieldsOf(info, options)),
2897
+ ...info.output ? { output: info.output } : {}
2898
+ }));
2899
+ }, "toolsFromCommands");
2900
+ var argvOf = /* @__PURE__ */ __name((info, input, profile, stdin) => {
2901
+ const fields = fieldsOf(info, { offline: true, ...stdin ? { stdin } : {} });
2902
+ const known = new Map(fields.map((field) => [field.name, field]));
2903
+ for (const name of Object.keys(input))
2904
+ if (!known.has(name))
2905
+ throw new CliError("validation_error", `${info.path.join(" ")}: no argument "${name}"`);
2906
+ const options = [];
2907
+ const positionals = [];
2908
+ let given;
2909
+ for (const field of fields) {
2910
+ const value = input[field.name];
2911
+ if (value === void 0) {
2912
+ if (field.required)
2913
+ throw new CliError("validation_error", `${info.path.join(" ")}: "${field.name}" is required`);
2914
+ continue;
2915
+ }
2916
+ if (field.stdin)
2917
+ given = typeof value === "string" ? value : JSON.stringify(value);
2918
+ for (const token of field.argv(value))
2919
+ (field.positional ? positionals : options).push(token);
2920
+ }
2921
+ const argv = [profile, ...info.path, ...options, "--json", ...positionals.length > 0 ? ["--", ...positionals] : []];
2922
+ return given === void 0 ? { argv } : { argv, stdin: given };
2923
+ }, "argvOf");
2924
+ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx) => {
2925
+ try {
2926
+ const info = flatten(program.commands).find((one) => one.path.length === path.length && startsWith(one.path, path));
2927
+ if (!info || info.commands.length > 0 && info.runnable !== true)
2928
+ throw new CliError("validation_error", `no command "${path.join(" ")}" to run`);
2929
+ if (info.lifetime)
2930
+ throw new CliError("validation_error", `"${path.join(" ")}" runs until it is stopped; an agent call must return`);
2931
+ const levels = ctx.levels?.();
2932
+ const availability = (levels || ctx.readOnly || ctx.permissions) && commandAvailability(info, levels ?? {}, ctx.keyOf, ctx.authority, ctx.readOnly, true, ctx.permissions);
2933
+ if (availability && !availability.available)
2934
+ throw new CliError("permission_error", `${path.join(" ")}: ${availability.reason}`, {
2935
+ sent: false,
2936
+ ...availability.permission ? { permission: availability.permission } : {}
2937
+ });
2938
+ const { argv, stdin } = argvOf(info, input, ctx.profile, ctx.stdin);
2939
+ const lend = ctx.connection;
2940
+ let borrowed;
2941
+ let answered2 = false;
2942
+ let result;
2943
+ let failure;
2944
+ const streams = captureStreams();
2945
+ const command = `mcp ${path.join(" ")}`;
2946
+ const traceId = enclosingTraceId() ?? traceOf(ctx.env ?? {}).traceId;
2947
+ const scope = {
2948
+ runId: newRunId(/* @__PURE__ */ new Date(), command),
2949
+ command,
2950
+ startedAt: Date.now(),
2951
+ profile: ctx.profile,
2952
+ ...traceId === void 0 ? {} : { traceId }
2953
+ };
2954
+ const code = await inRun(scope, () => program.run(argv, {
2955
+ ...ctx.environment,
2956
+ streams,
2957
+ tty: false,
2958
+ ...ctx.env ? { env: ctx.env } : {},
2959
+ stdin: Readable.from(stdin === void 0 ? [] : [stdin]),
2960
+ answer: /* @__PURE__ */ __name(() => null, "answer"),
2961
+ agent: {
2962
+ result: /* @__PURE__ */ __name((value) => {
2963
+ answered2 = true;
2964
+ result = value;
2965
+ }, "result"),
2966
+ failure: /* @__PURE__ */ __name((object2) => {
2967
+ failure = object2;
2968
+ }, "failure"),
2969
+ ...ctx.overrides?.length ? { overrides: ctx.overrides } : {},
2970
+ authority: levels !== void 0 && authorityAllowed(levels),
2971
+ botApi: levels !== void 0 && botApiAllowed(levels),
2972
+ ...ctx.caller ?? currentCaller() ? { caller: ctx.caller ?? currentCaller() } : {}
2973
+ },
2974
+ // Opened only when the command asks: a read the store answers never connects.
2975
+ ...lend ? {
2976
+ relayed: {
2977
+ profile: ctx.profile,
2978
+ cwd: process.cwd(),
2979
+ connection: /* @__PURE__ */ __name(() => borrowed ??= lend().then((adapter) => lentConnection(adapter)), "connection")
2980
+ }
2981
+ } : {}
2982
+ }));
2983
+ if (failure)
2984
+ return { error: failure };
2985
+ if (answered2)
2986
+ return { result };
2987
+ if (code !== 0)
2988
+ throw new CliError("invalid_response", `the command exited with ${code} and said nothing`);
2989
+ if (streams.stdout.length > 0)
2990
+ throw new CliError("invalid_response", "the command printed its answer instead of handing it over \u2014 the CLI's run must pass its whole environment on");
2991
+ return { result: null };
2992
+ } catch (error) {
2993
+ return { error: errorObjectOf(error) };
2994
+ }
2995
+ }, "runCommandForAgent");
2996
+
2997
+ // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/mcp/tool.js
2998
+ var limit = optional(pipe(number(), integer(), minValue(1), maxValue(100), description("how many")));
2999
+ var page = optional(pipe(number(), integer(), minValue(1), description("which page, from 1")));
3000
+ var message = pipe(
3001
+ string(),
3002
+ maxLength(256),
3003
+ // biome-ignore lint/suspicious/noControlCharactersInRegex: refusing them is the point
3004
+ regex(/^[^\s\x00-\x1F\x7F-\x9F]+$/, "a message id has no spaces or control characters"),
3005
+ description("message id")
3006
+ );
3007
+ var READ = { readOnlyHint: true, destructiveHint: false, openWorldHint: true };
3008
+ var WRITE = {
3009
+ readOnlyHint: false,
3010
+ destructiveHint: true,
3011
+ idempotentHint: false,
3012
+ openWorldHint: true
3013
+ };
3014
+ var tool = /* @__PURE__ */ __name((definition) => definition, "tool");
3015
+ var chatOf = /* @__PURE__ */ __name((messenger) => pipe(string(), minLength(1), description(messenger.chatArgument)), "chatOf");
3016
+ var tierOf = /* @__PURE__ */ __name((key2, definition, messenger) => {
3017
+ if (definition.annotations.readOnlyHint === true)
3018
+ return "read";
3019
+ if (/^admin|_admin/.test(key2))
3020
+ return "admin";
3021
+ if (/delete|ban|kick|remove|purge|block/.test(key2))
3022
+ return "destructive";
3023
+ if (/draft/.test(key2))
3024
+ return "draft";
3025
+ if (key2 === "messages_pin" && messenger?.quietPins === false)
3026
+ return "write-public";
3027
+ if (/mark_read|mark_unread|read_mark|archive|mute|pin|tag|note|label|folder|alias|save|_(un)?star$/.test(key2))
3028
+ return "write-private";
3029
+ return "write-public";
3030
+ }, "tierOf");
3031
+ var effectsOf = /* @__PURE__ */ __name((definition) => {
3032
+ if (definition.effects)
3033
+ return definition.effects;
3034
+ const { readOnlyHint, openWorldHint } = definition.annotations;
3035
+ if (readOnlyHint === true)
3036
+ return { remote: openWorldHint === false ? "none" : "read", local: "read" };
3037
+ return openWorldHint === false ? LOCAL_WRITE : REMOTE_WRITE;
3038
+ }, "effectsOf");
3039
+ var outcomeOf = /* @__PURE__ */ __name((result) => {
3040
+ if (!result.isError)
3041
+ return { status: "ok" };
3042
+ const code = result.structuredContent?.error?.code;
3043
+ const error = typeof code === "string" ? code : "generic_failure";
3044
+ return { status: error === "permission_error" ? "refused" : "failed", error };
3045
+ }, "outcomeOf");
3046
+ var commandOf = /* @__PURE__ */ __name((name, definition) => definition.command ?? name.replaceAll("_", " "), "commandOf");
3047
+ var toolKey = /* @__PURE__ */ __name((name, definition) => definition.key !== void 0 ? definition.key : keyForCommand(commandOf(name, definition).split(" ")), "toolKey");
3048
+ 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");
3049
+ var syncAllowedFor = /* @__PURE__ */ __name((key2, defaults) => {
3050
+ const permissions = defaults.settings.permissions ?? {};
3051
+ const shared = defaults.syncAllowed ?? levelFor(permissions, "messages.sync-first").level === "allow";
3052
+ return shared && (!key2.startsWith("stats_") || levelFor(permissions, `${key2.replaceAll("_", ".")}.sync-first`).level === "allow");
3053
+ }, "syncAllowedFor");
3054
+ var entryRunner = /* @__PURE__ */ __name((registration) => {
3055
+ const run = callRunner(registration);
3056
+ const { log } = registration;
3057
+ return async (key2, definition, args, ctx) => {
3058
+ const startedAt = Date.now();
3059
+ const command = `mcp ${commandOf(key2, definition)}`;
3060
+ const traceId = traceIdOf(ctx?.mcpReq?._meta?.traceparent);
3061
+ const app = registration.messenger?.app;
3062
+ const caller = registration.callers ? callerOf(ctx, key2, registration.callers) : currentCaller();
3063
+ const env = registration.defaults.env ?? process.env;
3064
+ const settings = registration.defaults.settings;
3065
+ const recording = key2 !== "runs_search" && settings.keepFailedRuns !== false && app?.appName ? startRecording({
3066
+ app,
3067
+ command,
3068
+ ...settings.profile === void 0 ? {} : { profile: settings.profile },
3069
+ env,
3070
+ record: keepsSuccess({ record: settings.record ?? true, fromFlag: false, env, caller }),
3071
+ keepFailed: true,
3072
+ trace: false,
3073
+ format: "json",
3074
+ context: runContextOf({ bin: app.command, command, env, caller }),
3075
+ ...settings.keepRunsForDays === void 0 ? {} : { keepDays: settings.keepRunsForDays },
3076
+ ...settings.keepSuccessfulRunsForDays === void 0 ? {} : { keepSuccessDays: settings.keepSuccessfulRunsForDays },
3077
+ ...settings.runsSizeLimitMb === void 0 ? {} : { maxBytes: settings.runsSizeLimitMb * 1024 * 1024 },
3078
+ ...traceId === void 0 ? {} : { traceId }
3079
+ }) : void 0;
3080
+ const profile = registration.defaults.settings.profile;
3081
+ const scope = {
3082
+ runId: recording?.runId ?? newRunId(new Date(startedAt), command),
3083
+ command,
3084
+ startedAt,
3085
+ ...profile === void 0 ? {} : { profile },
3086
+ ...traceId === void 0 ? {} : { traceId },
3087
+ ...recording ? { events: recording.events } : {}
3088
+ };
3089
+ const work = /* @__PURE__ */ __name(() => inRun(scope, () => {
3090
+ const input = inputOf(definition, syncAllowedFor(key2, registration.defaults));
3091
+ const parsed = safeParse(input, args);
3092
+ return parsed.success ? run(key2, definition, parsed.output, ctx) : failed(new CliError("validation_error", `${commandOf(key2, definition)}: ${summarize(parsed.issues)}`, {
3093
+ arguments: toJsonSchema(input)
3094
+ }), app?.errors);
3095
+ }), "work");
3096
+ const result = await (caller ? withCaller(caller, work) : work());
3097
+ if (recording) {
3098
+ if (result.isError) {
3099
+ const error = result.structuredContent?.error;
3100
+ const code = error?.code && errorCodes.includes(error.code) ? error.code : void 0;
3101
+ await recording.fail(code ? new CliError(code, "MCP operation failed") : new Error("MCP operation failed")).catch(() => void 0);
3102
+ } else
3103
+ await recording.succeed(result.structuredContent).catch(() => void 0);
3104
+ }
3105
+ await log?.({
3106
+ tool: key2,
3107
+ tier: tierOf(key2, definition, registration.messenger),
3108
+ ...outcomeOf(result),
3109
+ startedAt,
3110
+ finishedAt: Date.now()
3111
+ })?.catch(() => void 0);
3112
+ return result;
3113
+ };
3114
+ }, "entryRunner");
3115
+ var callRunner = /* @__PURE__ */ __name(({ messenger, session, withStore, withServices, defaults, around, targets }) => {
3116
+ const where = {
3117
+ profile: defaults.settings.profile,
3118
+ env: defaults.env,
3119
+ pictures: defaults.settings.pictureSearch,
3120
+ reranker: defaults.settings.searchReranker
3121
+ };
3122
+ return async (key2, definition, args, ctx) => {
3123
+ const path = commandOf(key2, definition).split(" ");
3124
+ const run = `mcp ${path.join(" ")}`;
3125
+ try {
3126
+ const execute = /* @__PURE__ */ __name(async () => {
3127
+ const syncAllowed = syncAllowedFor(key2, defaults);
3128
+ if (Buffer.byteLength(JSON.stringify(args)) > MAX_BUFFERED_INPUT)
3129
+ throw new CliError("validation_error", "tool arguments exceed the buffered input limit", {
3130
+ reason: "input.too-large",
3131
+ max_bytes: MAX_BUFFERED_INPUT,
3132
+ retryable: false
3133
+ });
3134
+ definition.check?.(args);
3135
+ if (definition.changesStore)
3136
+ refuseStoreChange(messenger.app, defaults.env);
3137
+ refuseLacking(messenger, path);
3138
+ for (const permission of readKeysForCommand(path)) {
3139
+ if (levelFor(defaults.settings.permissions ?? {}, permission).level === "deny")
3140
+ throw new CliError("permission_error", `profile denies ${permission}`, { permission });
3141
+ }
3142
+ if (args.sync_first && !syncAllowed)
3143
+ throw new CliError("permission_error", "messages.sync-first is not allowed by this profile");
3144
+ if (definition.custom) {
3145
+ const result2 = await definition.custom(args, { ...defaults, signal: ctx.mcpReq.signal }, ctx);
3146
+ return answered(result2, definition.outputLimit?.(args, defaults), targets);
3147
+ }
3148
+ if (definition.local)
3149
+ return answered(await definition.local(args, defaults), definition.outputLimit?.(args, defaults), targets);
3150
+ const { online, stored: local, served } = definition;
3151
+ const stored = local && (!definition.storedWhen || definition.storedWhen(args)) ? local : void 0;
3152
+ const result = stored ? await withStore((store, account) => stored(store, account, args, { ...defaults, signal: ctx.mcpReq.signal }, (work) => session.use(run, work)), {
3153
+ name: run
3154
+ }) : served && withServices ? await withServices((services, connect) => served(services, args, defaults, connect), { name: run }) : served && messenger.history === "store" ? await withStore((store, account) => served(servicesFor({
3155
+ ...storeModeDeps(messenger, store, account, defaults.guard),
3156
+ ...where,
3157
+ embedders: defaults.embedders
3158
+ }), args, defaults, (work) => session.use(run, async (adapter, release) => {
3159
+ try {
3160
+ return await work(adapter);
3161
+ } finally {
3162
+ await release();
3163
+ }
3164
+ })), { name: run }) : served ? await session.use(run, (adapter, release) => served(servicesFor(onlineDeps(messenger, adapter, defaults.guard, where)), args, defaults, (work) => (async () => {
3165
+ try {
3166
+ return await work(adapter);
3167
+ } finally {
3168
+ await release();
3169
+ }
3170
+ })())) : await session.use(run, (adapter, release) => online(adapter, args, { ...defaults, release }));
3171
+ return answered(result, definition.outputLimit?.(args, defaults), targets);
3172
+ }, "execute");
3173
+ return around ? await around(key2, definition, execute) : await execute();
3174
+ } catch (error) {
3175
+ return failed(error, messenger?.app?.errors, effectsOf(definition));
3176
+ }
3177
+ };
3178
+ }, "callRunner");
3179
+ var outputSchemaOf = /* @__PURE__ */ __name((definition) => {
3180
+ if (!definition.output)
3181
+ return looseObject({});
3182
+ const entity = ENTITIES[definition.output.entity];
3183
+ return definition.output.list ? listEnvelopeSchema(entity) : itemEnvelopeSchema(entity);
3184
+ }, "outputSchemaOf");
3185
+ var Picture = class {
3186
+ static {
3187
+ __name(this, "Picture");
3188
+ }
3189
+ bytes;
3190
+ mimeType;
3191
+ about;
3192
+ constructor(bytes, mimeType, about) {
3193
+ this.bytes = bytes;
3194
+ this.mimeType = mimeType;
3195
+ this.about = about;
3196
+ }
3197
+ };
3198
+ var BinaryResource = class {
3199
+ static {
3200
+ __name(this, "BinaryResource");
3201
+ }
3202
+ base64;
3203
+ mimeType;
3204
+ uri;
3205
+ about;
3206
+ constructor(base64, mimeType, uri, about) {
3207
+ this.base64 = base64;
3208
+ this.mimeType = mimeType;
3209
+ this.uri = uri;
3210
+ this.about = about;
3211
+ }
3212
+ };
3213
+ var answered = /* @__PURE__ */ __name((answer, maxBytes = DEFAULT_OUTPUT_BYTES, targets) => {
3214
+ const bounded = /* @__PURE__ */ __name((result) => {
3215
+ if (maxBytes !== 0 && Buffer.byteLength(JSON.stringify(result)) > maxBytes)
3216
+ 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 });
3217
+ return result;
3218
+ }, "bounded");
3219
+ if (answer === null || Array.isArray(answer) || typeof answer !== "object")
3220
+ throw new CliError("invalid_response", "tool result must be an object", { retryable: false });
3221
+ const objectBody = /* @__PURE__ */ __name((value) => {
3222
+ const serialized = JSON.parse(agentJson(value));
3223
+ if (serialized === null || Array.isArray(serialized) || typeof serialized !== "object")
3224
+ throw new CliError("invalid_response", "serialized tool result must be an object", { retryable: false });
3225
+ return serialized;
3226
+ }, "objectBody");
3227
+ if (answer instanceof BinaryResource) {
3228
+ const about = sealed(answer.about);
3229
+ return bounded({
3230
+ structuredContent: objectBody(about),
3231
+ content: [
3232
+ { type: "resource", resource: { uri: answer.uri, mimeType: answer.mimeType, blob: answer.base64 } },
3233
+ { type: "text", text: agentJson(about) }
3234
+ ]
3235
+ });
3236
+ }
3237
+ if (answer instanceof Picture) {
3238
+ const about = sealed(answer.about);
3239
+ return bounded({
3240
+ structuredContent: objectBody(about),
3241
+ content: [
3242
+ { type: "image", data: Buffer.from(answer.bytes).toString("base64"), mimeType: answer.mimeType },
3243
+ { type: "text", text: agentJson(about) }
3244
+ ]
3245
+ });
3246
+ }
3247
+ const body = objectBody(sealed(targets ? judgedAnswer(answer, targets) : answer));
3248
+ return bounded({ content: [{ type: "text", text: JSON.stringify(body) }], structuredContent: body });
3249
+ }, "answered");
3250
+ var failed = /* @__PURE__ */ __name((error, errors, effects) => {
3251
+ const judged = judgedEffects(effects);
3252
+ const context = { ...failureContext(errors), ...judged ? { effects: judged } : {} };
3253
+ return mcpErrorResult(JSON.parse(agentJson(errorObjectOf(error, context))));
3254
+ }, "failed");
3255
+
3256
+ // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/mcp/surface.js
3257
+ import { randomUUID } from "node:crypto";
3258
+ var MATCHES = 8;
3259
+ var ANSWER = answerSchema();
3260
+ var normal = /* @__PURE__ */ __name((command) => command.trim().toLowerCase().split(/[\s_-]+/).join(" "), "normal");
3261
+ var haystack = /* @__PURE__ */ __name((command, one) => [command, one.title, one.description, ...Object.keys(one.input.entries)].join(" ").toLowerCase(), "haystack");
3262
+ var search = /* @__PURE__ */ __name((commands, query) => {
3263
+ const words = query.toLowerCase().split(/\s+/).filter(Boolean);
3264
+ return Object.entries(commands).filter(([command, one]) => words.every((word2) => haystack(command, one).includes(word2))).map((entry) => {
3265
+ const parts = entry[0].split(/[\s-]/);
3266
+ const exact = entry[0] === words.join(" ") ? 100 : 0;
3267
+ const whole = words.filter((word2) => parts.includes(word2)).length * 10;
3268
+ return { entry, rank: exact + whole + words.filter((word2) => entry[0].includes(word2)).length };
3269
+ }).sort((a, b) => b.rank - a.rank || a.entry[0].localeCompare(b.entry[0])).map(({ entry }) => entry);
3270
+ }, "search");
3271
+ var nearest = /* @__PURE__ */ __name((commands, asked) => {
3272
+ const words = normal(asked).split(" ");
3273
+ 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);
3274
+ }, "nearest");
3275
+ var runnableOnly = /* @__PURE__ */ __name((result, offered) => {
3276
+ const body = result.structuredContent;
3277
+ if (result.isError || !Array.isArray(body?.next))
3278
+ return result;
3279
+ const next = body.next.filter((step) => offered(step.command));
3280
+ const { next: _, ...rest } = body;
3281
+ const kept = next.length > 0 ? { ...rest, next } : rest;
3282
+ return {
3283
+ ...result,
3284
+ structuredContent: kept,
3285
+ content: result.content.map((part) => part.type === "text" ? { ...part, text: JSON.stringify(kept) } : part)
3286
+ };
3287
+ }, "runnableOnly");
3288
+ var takesNothing = /* @__PURE__ */ __name((one) => Object.values(one.input.entries).every((entry) => entry.type === "optional"), "takesNothing");
3289
+ var sampleOf = /* @__PURE__ */ __name((commands) => {
3290
+ const reading = Object.entries(commands).filter(([, one]) => !one.writes);
3291
+ const bare = reading.filter(([, one]) => takesNothing(one));
3292
+ return bare.find(([command]) => command.endsWith(" list"))?.[0] ?? bare[0]?.[0] ?? reading[0]?.[0] ?? Object.keys(commands)[0] ?? "";
3293
+ }, "sampleOf");
3294
+ var registerCommands = /* @__PURE__ */ __name((server, prefix, commands, errors, withheld, isMessenger) => {
3295
+ const byNormal = new Map(Object.keys(commands).map((command) => [normal(command), command]));
3296
+ const messenger = isMessenger ?? Object.keys(commands).some((command) => command.split(" ")[0] === "messages");
3297
+ const tasks = messenger ? '"unread", "send message", "chat members"' : '"list", "show", "change a setting"';
3298
+ const sample = messenger ? "messages list" : sampleOf(commands);
3299
+ const untrusted = messenger ? UNTRUSTED : UNTRUSTED_NEUTRAL;
3300
+ server.registerTool(`${prefix}_tools_search`, {
3301
+ outputSchema: toStandardJsonSchema(looseObject({})),
3302
+ title: "Find a command",
3303
+ 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.`,
3304
+ inputSchema: toStandardJsonSchema(strictObject({ query: optional(pipe(string(), description("words that describe the task"))) })),
3305
+ annotations: { ...READ, openWorldHint: false, idempotentHint: true }
3306
+ }, async ({ query }) => {
3307
+ const found = search(commands, query ?? "");
3308
+ const items = query?.trim() ? found.slice(0, MATCHES).map(([command, one]) => ({
3309
+ command,
3310
+ title: one.title,
3311
+ description: one.description,
3312
+ writes: one.writes,
3313
+ availability: one.availability?.() ?? { available: true },
3314
+ arguments: toJsonSchema(one.input),
3315
+ output: toJsonSchema(one.output ?? ANSWER)
3316
+ })) : found.map(([command, one]) => ({
3317
+ command,
3318
+ title: one.title,
3319
+ writes: one.writes,
3320
+ availability: one.availability?.() ?? { available: true }
3321
+ }));
3322
+ const { next: _paging, ...list } = listOf(`${prefix}_tools_search`, {
3323
+ items,
3324
+ limit: Math.max(items.length, query?.trim() ? MATCHES : 1),
3325
+ has_more: found.length > items.length
3326
+ });
3327
+ return answered(list);
3328
+ });
3329
+ const callers = {
3330
+ env: process.env,
3331
+ client: /* @__PURE__ */ __name(() => server.server.getClientVersion(), "client"),
3332
+ connectionId: randomUUID()
3333
+ };
3334
+ const runner = /* @__PURE__ */ __name((writing) => async ({ command: asked, arguments: given }, ctx) => {
3335
+ try {
3336
+ const command = byNormal.get(normal(asked));
3337
+ const one = command === void 0 ? void 0 : commands[command];
3338
+ if (command === void 0 || !one) {
3339
+ withheld?.(normal(asked));
3340
+ const near = nearest(commands, asked);
3341
+ 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`);
3342
+ }
3343
+ if (one.writes !== writing)
3344
+ throw new CliError("validation_error", `"${command}" ${writing ? "only reads" : "writes"}: call it with ${prefix}_${writing ? "read" : "write"}`);
3345
+ const args = writing ? agentArguments(given ?? {}) : given ?? {};
3346
+ const caller = currentCaller() ?? callerOf(ctx, command.replace(/[ -]/g, "_"), callers);
3347
+ if (one.checked)
3348
+ return runnableOnly(await withCaller(caller, () => one.run(args, ctx)), (named) => byNormal.has(normal(named)));
3349
+ const parsed = safeParse(strictObject(one.input.entries), args);
3350
+ if (!parsed.success)
3351
+ throw new CliError("validation_error", `${command}: ${summarize(parsed.issues)}`, {
3352
+ arguments: toJsonSchema(one.input)
3353
+ });
3354
+ return runnableOnly(await withCaller(caller, () => one.run(parsed.output, ctx)), (named) => byNormal.has(normal(named)));
3355
+ } catch (error) {
3356
+ return failed(error, errors);
3357
+ }
3358
+ }, "runner");
3359
+ const call = strictObject({
3360
+ command: pipe(string(), minLength(1), description(`a command ${prefix}_tools_search returned: "${sample}"`)),
3361
+ arguments: optional(pipe(record(string(), unknown()), description("that command's arguments")))
3362
+ });
3363
+ server.registerTool(`${prefix}_read`, {
3364
+ outputSchema: toStandardJsonSchema(ANSWER),
3365
+ title: "Run a reading command",
3366
+ description: `Run one command that only reads, with the arguments ${prefix}_tools_search showed. ${untrusted}`,
3367
+ inputSchema: toStandardJsonSchema(call),
3368
+ annotations: READ
3369
+ }, runner(false));
3370
+ if (Object.values(commands).some((one) => one.writes))
3371
+ server.registerTool(`${prefix}_write`, {
3372
+ outputSchema: toStandardJsonSchema(ANSWER),
3373
+ title: "Run a writing command",
3374
+ 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}`,
3375
+ inputSchema: toStandardJsonSchema(call),
3376
+ annotations: WRITE
3377
+ }, runner(true));
3378
+ }, "registerCommands");
3379
+ var surfaceCommands = /* @__PURE__ */ __name((tools, registration) => {
3380
+ const run = entryRunner(registration);
3381
+ return Object.fromEntries(Object.entries(tools).map(([key2, definition]) => [
3382
+ commandOf(key2, definition),
3383
+ {
3384
+ title: definition.title,
3385
+ description: definition.description,
3386
+ writes: definition.annotations.readOnlyHint !== true,
3387
+ input: inputOf(definition, syncAllowedFor(key2, registration.defaults)),
3388
+ ...definition.output ? { output: outputSchemaOf(definition) } : {},
3389
+ checked: true,
3390
+ run: /* @__PURE__ */ __name((args, ctx) => run(key2, definition, args, ctx), "run")
3391
+ }
3392
+ ]));
3393
+ }, "surfaceCommands");
3394
+ var outputOf = /* @__PURE__ */ __name(({ entity, view }) => answerSchema(ENTITIES[view ? `${entity}.${view}` : entity] ?? unknown()), "outputOf");
3395
+
3396
+ export {
3397
+ toolsFromCommands,
3398
+ runCommandForAgent,
3399
+ message,
3400
+ READ,
3401
+ WRITE,
3402
+ tool,
3403
+ chatOf,
3404
+ tierOf,
3405
+ outcomeOf,
3406
+ commandOf,
3407
+ toolKey,
3408
+ Picture,
3409
+ BinaryResource,
3410
+ answered,
3411
+ failed,
3412
+ normal,
3413
+ registerCommands,
3414
+ surfaceCommands,
3415
+ outputOf
3416
+ };