@wirecat/cli-template 0.8.0 → 0.10.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 (125) hide show
  1. package/.github/workflows/ci.yml +3 -3
  2. package/.github/workflows/release.yml +63 -0
  3. package/.gitleaks.toml +18 -0
  4. package/AGENTS.md +9 -15
  5. package/CHANGELOG.md +87 -1
  6. package/README.md +4 -3
  7. package/bin/release +5 -3
  8. package/contracts/plan.json +2 -2
  9. package/dist/bin/clidev.js +34 -12
  10. package/dist/bundle/all-profiles-XHC7BG3P.js +24 -0
  11. package/dist/bundle/anthropic-N6B3ZZHQ.js +70 -0
  12. package/dist/bundle/bun-HUJLS7KP.js +169 -0
  13. package/dist/bundle/bun-sqlite-OWFO2TVR.js +69 -0
  14. package/dist/bundle/chunk-222FANS2.js +161 -0
  15. package/dist/bundle/chunk-2CFBHYFA.js +884 -0
  16. package/dist/bundle/chunk-2KQZ24GI.js +82 -0
  17. package/dist/bundle/chunk-2TBVT4SZ.js +31 -0
  18. package/dist/bundle/chunk-437W3Z2M.js +76 -0
  19. package/dist/bundle/chunk-4QRLPOJ7.js +18 -0
  20. package/dist/bundle/chunk-54AJONOM.js +54 -0
  21. package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
  22. package/dist/bundle/chunk-6CBWO7OF.js +73 -0
  23. package/dist/bundle/chunk-75LVQQEK.js +35782 -0
  24. package/dist/bundle/chunk-7RB76E2L.js +264 -0
  25. package/dist/bundle/chunk-7RXBN7HP.js +63 -0
  26. package/dist/bundle/chunk-ABP7FDMJ.js +122 -0
  27. package/dist/bundle/chunk-ADLS6FVG.js +24600 -0
  28. package/dist/bundle/chunk-AP7QKYBG.js +3531 -0
  29. package/dist/bundle/chunk-ASMH7JWZ.js +288 -0
  30. package/dist/bundle/chunk-B4EED2RF.js +100 -0
  31. package/dist/bundle/chunk-B4LM2B6F.js +1900 -0
  32. package/dist/bundle/chunk-BDSDQCV4.js +281 -0
  33. package/dist/bundle/chunk-DFDN6AUB.js +21 -0
  34. package/dist/bundle/chunk-DMCN22H6.js +35 -0
  35. package/dist/bundle/chunk-E42W72PQ.js +151 -0
  36. package/dist/bundle/chunk-EFHLQXG6.js +5104 -0
  37. package/dist/bundle/chunk-FIHDGZIB.js +34352 -0
  38. package/dist/bundle/chunk-FWVKHD2L.js +48 -0
  39. package/dist/bundle/chunk-FXS3X76A.js +193 -0
  40. package/dist/bundle/chunk-HTQTIKWP.js +928 -0
  41. package/dist/bundle/chunk-IJ3IA7EK.js +24 -0
  42. package/dist/bundle/chunk-JEBSORH7.js +3379 -0
  43. package/dist/bundle/chunk-JTTW5ZKF.js +45 -0
  44. package/dist/bundle/chunk-LSEF4QC3.js +3075 -0
  45. package/dist/bundle/chunk-LY7GS2YI.js +58 -0
  46. package/dist/bundle/chunk-MFS52LTZ.js +570 -0
  47. package/dist/bundle/chunk-MNSD5BX2.js +78 -0
  48. package/dist/bundle/chunk-MTGLJCAZ.js +24 -0
  49. package/dist/bundle/chunk-MZVV2JZT.js +744 -0
  50. package/dist/bundle/chunk-NE3NSB5O.js +8341 -0
  51. package/dist/bundle/chunk-NTLPDH76.js +440 -0
  52. package/dist/bundle/chunk-O3PBQVAB.js +447 -0
  53. package/dist/bundle/chunk-O5EHUB2V.js +2 -0
  54. package/dist/bundle/chunk-O5LMDQTO.js +82 -0
  55. package/dist/bundle/chunk-OPJ24VGH.js +1028 -0
  56. package/dist/bundle/chunk-OPPMGPFW.js +164 -0
  57. package/dist/bundle/chunk-QGNNMPUB.js +158 -0
  58. package/dist/bundle/chunk-QVJLOUQB.js +2 -0
  59. package/dist/bundle/chunk-S57AMKLX.js +6848 -0
  60. package/dist/bundle/chunk-TARN7CHN.js +215 -0
  61. package/dist/bundle/chunk-TJLGI3N6.js +1095 -0
  62. package/dist/bundle/chunk-VMTM46FH.js +7532 -0
  63. package/dist/bundle/chunk-W2IDKBNB.js +2315 -0
  64. package/dist/bundle/chunk-XFXBXQBS.js +630 -0
  65. package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
  66. package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
  67. package/dist/bundle/clidev.js +22 -0
  68. package/dist/bundle/command-contract-PEM3S634.js +29 -0
  69. package/dist/bundle/dist-ESHIQU4M.js +7577 -0
  70. package/dist/bundle/echarts-2QGL2JP5.js +42501 -0
  71. package/dist/bundle/embed-HHAAGHA6.js +35 -0
  72. package/dist/bundle/embedder-W2OGVVYH.js +108 -0
  73. package/dist/bundle/first-run-WCJUDUBU.js +23 -0
  74. package/dist/bundle/first-screen-U4DFUKUC.js +27 -0
  75. package/dist/bundle/instructions-OTZHT6NV.js +9 -0
  76. package/dist/bundle/mcp-OQBZXELQ.js +165 -0
  77. package/dist/bundle/mcp-VVF6J7SQ.js +151 -0
  78. package/dist/bundle/mcp-Y7VCIZ2J.js +78 -0
  79. package/dist/bundle/node-P4E63KXA.js +2340 -0
  80. package/dist/bundle/node-SYD4GX5O.js +176 -0
  81. package/dist/bundle/node-TLZSIHIJ.js +21 -0
  82. package/dist/bundle/node-sqlite-X2DGRFOZ.js +45 -0
  83. package/dist/bundle/oauth-42M34GQ5.js +17 -0
  84. package/dist/bundle/open-SWXRCDLN.js +19 -0
  85. package/dist/bundle/process-KAFGXZ7Q.js +91 -0
  86. package/dist/bundle/program-EHR4G7VN.js +16967 -0
  87. package/dist/bundle/prompt-ZQTMHRGX.js +12 -0
  88. package/dist/bundle/recognize-TTED4SE3.js +190 -0
  89. package/dist/bundle/remote-C37XJ4BP.js +26 -0
  90. package/dist/bundle/rerank-APFZAMQL.js +49 -0
  91. package/dist/bundle/serve-DDPIHDVZ.js +19 -0
  92. package/dist/bundle/server-L5GNG7KC.js +793 -0
  93. package/dist/bundle/server-LKVYA2AE.js +39 -0
  94. package/dist/bundle/state-WWPPHERF.js +33 -0
  95. package/dist/bundle/store-H6UIA4PK.js +120 -0
  96. package/dist/bundle/store-maintenance-command-EYBT64A2.js +40 -0
  97. package/dist/commands/mcp.d.ts.map +1 -1
  98. package/dist/commands/mcp.js +45 -30
  99. package/dist/commands/mcp.js.map +1 -1
  100. package/dist/version.d.ts +1 -1
  101. package/dist/version.d.ts.map +1 -1
  102. package/dist/version.js +1 -1
  103. package/dist/version.js.map +1 -1
  104. package/docs/commands.md +38 -22
  105. package/docs/dev/TESTING.md +14 -3
  106. package/docs/dev/reference-clis.md +17 -9
  107. package/docs/dev/skills/release/SKILL.md +9 -6
  108. package/docs/dev/skills/release/fresh-audit.md +4 -0
  109. package/docs/dev/test-matrix.md +10 -11
  110. package/docs/security.md +4 -0
  111. package/docs/usage.md +7 -6
  112. package/kit/dist/new.js +17 -2
  113. package/package.json +7 -5
  114. package/scripts/audit.sh +5 -3
  115. package/scripts/smoke-bundle.ts +63 -0
  116. package/scripts/test-matrix-untested.ts +4 -10
  117. package/scripts/version-level.test.ts +17 -1
  118. package/scripts/version-level.ts +35 -7
  119. package/skills/clidev-cli/SKILL.md +8 -0
  120. package/src/commands/mcp.ts +54 -33
  121. package/src/mcp-http.test.ts +20 -13
  122. package/src/mcp.test.ts +3 -3
  123. package/src/program.test.ts +8 -2
  124. package/src/roots.test.ts +2 -7
  125. package/src/version.ts +1 -1
@@ -0,0 +1,3531 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ WEIGHTS,
5
+ agenda,
6
+ attachment,
7
+ author,
8
+ childTrace,
9
+ closeSuggestion,
10
+ conversation,
11
+ count,
12
+ envName,
13
+ id,
14
+ note,
15
+ organization,
16
+ project,
17
+ providerMetadata,
18
+ recordLogFor,
19
+ reminder,
20
+ storeTable,
21
+ tagging,
22
+ task,
23
+ text,
24
+ time,
25
+ untrusted
26
+ } from "./chunk-VMTM46FH.js";
27
+ import {
28
+ carries
29
+ } from "./chunk-7RXBN7HP.js";
30
+ import {
31
+ FACT_STATUSES,
32
+ FACT_TYPES,
33
+ LINK_KINDS,
34
+ LINK_SOURCES,
35
+ MEETING_RESULT_ENTITIES,
36
+ MEMORY_KINDS,
37
+ MEMORY_SCOPES,
38
+ MEMORY_STATUSES,
39
+ RELATION_KINDS,
40
+ TASK_KINDS,
41
+ TASK_ORIGINS,
42
+ TASK_STATES,
43
+ TASK_TYPES,
44
+ TASK_VERDICTS,
45
+ WORK_TASK_TYPES,
46
+ event,
47
+ meeting,
48
+ meetingDetails,
49
+ meetingHit,
50
+ meetingLink,
51
+ meetingParticipants,
52
+ meetingPassage,
53
+ meetingProjectEvidence,
54
+ meetingReview,
55
+ meetingSpeaker,
56
+ meetingStats,
57
+ meetingSummary,
58
+ meetingTranscript
59
+ } from "./chunk-LSEF4QC3.js";
60
+ import {
61
+ CliError,
62
+ array,
63
+ boolean,
64
+ integer,
65
+ isoDate,
66
+ isoTime,
67
+ jsonSchemaOf,
68
+ literal,
69
+ maxLength,
70
+ minLength,
71
+ minValue,
72
+ null_,
73
+ nullable,
74
+ number,
75
+ objectWithRest,
76
+ omit,
77
+ optional,
78
+ pageSchema,
79
+ partial,
80
+ pick,
81
+ picklist,
82
+ pipe,
83
+ record,
84
+ reference,
85
+ regex,
86
+ resolvePaths,
87
+ safeInteger,
88
+ strictObject,
89
+ string,
90
+ union,
91
+ unknown,
92
+ unwrap,
93
+ variant,
94
+ writeSecurely
95
+ } from "./chunk-EFHLQXG6.js";
96
+ import {
97
+ __name
98
+ } from "./chunk-ZVVMGPBJ.js";
99
+
100
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/member.js
101
+ var member = strictObject({
102
+ id,
103
+ name: nullable(text),
104
+ username: nullable(text),
105
+ role: optional(picklist(["owner", "admin", "member"])),
106
+ /** `null` when their privacy hides it. */
107
+ last_seen_at: optional(nullable(time)),
108
+ registered_at: optional(nullable(time)),
109
+ joined_at: optional(nullable(time)),
110
+ /** Who added them or whose invite they used. */
111
+ invited_by: optional(nullable(id)),
112
+ is_bot: optional(boolean()),
113
+ deleted: optional(boolean()),
114
+ flagged: optional(picklist(["scam", "fake"])),
115
+ has_photo: optional(boolean()),
116
+ /** `chats members check`: how much they look like a bot — a hint, never a verdict. */
117
+ score: optional(count),
118
+ reasons: optional(array(text)),
119
+ /** `chats members check --deep`: the whole person check, as `contacts check` answers it. */
120
+ check: optional(record(string(), unknown()))
121
+ });
122
+
123
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/chat.js
124
+ var setting = optional(nullable(boolean()));
125
+ var chat = strictObject({
126
+ ref: reference,
127
+ id,
128
+ provider: optional(text),
129
+ account: optional(text),
130
+ title: nullable(text),
131
+ kind: picklist(["dialog", "group", "channel", "saved", "unknown"]),
132
+ unread_count: nullable(count),
133
+ unread_mentions: optional(count),
134
+ last_message_at: nullable(time),
135
+ participants_count: nullable(count),
136
+ muted: optional(boolean()),
137
+ /** When the mute ends; absent with `muted` true is for good. */
138
+ muted_until: optional(time),
139
+ archived: optional(boolean()),
140
+ /** The owner marked it unread, whatever `unread_count` says. */
141
+ marked_unread: optional(boolean()),
142
+ membership_state: optional(picklist(["joined", "left", "public", "imported", "archived", "external"])),
143
+ parent_chat_id: optional(id),
144
+ scope: optional(picklist(["personal", "work"])),
145
+ provider_metadata: providerMetadata,
146
+ /** `chats show`, a group or channel: what it says about itself. */
147
+ description: optional(nullable(text)),
148
+ invite_link: optional(nullable(text)),
149
+ settings: optional(strictObject({
150
+ all_can_pin: setting,
151
+ only_admins_add: setting,
152
+ only_admins_call: setting,
153
+ only_owner_edits_info: setting,
154
+ members_see_link: setting,
155
+ join_approval: setting,
156
+ only_admins_send: setting,
157
+ only_admins_edit_info: setting,
158
+ disappearing_seconds: optional(nullable(count))
159
+ })),
160
+ /** `chats show`: absent when no roster is known; an empty list is a known empty roster. */
161
+ members: optional(array(member))
162
+ });
163
+
164
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/list-results.js
165
+ var botProfile = strictObject({
166
+ name: text,
167
+ token: text,
168
+ bot: optional(text),
169
+ id: optional(id),
170
+ problem: optional(text)
171
+ });
172
+ var botSeenChat = strictObject({
173
+ ...partial(omit(chat, ["ref", "provider", "account", "description", "invite_link", "settings", "members"])).entries,
174
+ id,
175
+ parent_chat_id: optional(nullable(id)),
176
+ muted_until: optional(nullable(time)),
177
+ first_seen_at: optional(time),
178
+ last_seen_at: optional(time)
179
+ });
180
+ var botAdmin = strictObject({
181
+ id,
182
+ name: nullable(text),
183
+ username: nullable(text),
184
+ role: picklist(["owner", "admin"]),
185
+ rights: array(picklist(["read", "members", "admins", "info", "pin", "link", "post", "edit", "delete"])),
186
+ title: nullable(text)
187
+ });
188
+ var botMenuEntry = strictObject({ name: text, description: nullable(text) });
189
+ var botWebhook = strictObject({ url: text, types: optional(array(text)) });
190
+ var scheduledJob = strictObject({
191
+ name: text,
192
+ kind: picklist(["command", "agent"]),
193
+ when: text,
194
+ last: nullable(strictObject({
195
+ at: time,
196
+ exit_code: number(),
197
+ output: text,
198
+ trace_id: optional(text),
199
+ reason: optional(text),
200
+ error_code: optional(text),
201
+ failing_since: optional(time),
202
+ failures: optional(number())
203
+ }))
204
+ });
205
+ var botTemplate = strictObject({
206
+ name: nullable(text),
207
+ status: nullable(text),
208
+ language: nullable(text),
209
+ category: nullable(text)
210
+ });
211
+ var callRecord = strictObject({
212
+ id,
213
+ chat_id: nullable(id),
214
+ caller_id: nullable(id),
215
+ direction: picklist(["incoming", "outgoing"]),
216
+ outcome: picklist(["answered", "missed", "declined"]),
217
+ kind: picklist(["audio", "video"]),
218
+ at: time,
219
+ duration_seconds: nullable(number())
220
+ });
221
+ var stickerInventory = strictObject({
222
+ id,
223
+ title: optional(text),
224
+ count: optional(number()),
225
+ link: optional(nullable(text)),
226
+ set_id: optional(nullable(id)),
227
+ emoji: optional(array(text)),
228
+ url: optional(nullable(text))
229
+ });
230
+
231
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/batch-result.js
232
+ var actionableError = objectWithRest({
233
+ code: text,
234
+ message: text,
235
+ retryable: boolean(),
236
+ retry_after_ms: optional(number())
237
+ }, unknown());
238
+ var batchResult = strictObject({
239
+ attempted: count,
240
+ succeeded: count,
241
+ failed: count,
242
+ error_rate: number(),
243
+ failures: array(strictObject({ id, stage: text, error: actionableError, attachment: optional(count) })),
244
+ stop_reason: optional(picklist(["rate_limited", "authentication", "error_rate", "cancelled"])),
245
+ max_error_percent: count
246
+ });
247
+
248
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/conversation-preparation.js
249
+ var conversationBuild = strictObject({
250
+ chat: id,
251
+ messages: count,
252
+ links: count,
253
+ conversations: count,
254
+ built_at: time,
255
+ rules_version: count
256
+ });
257
+ var chatEmbedding = strictObject({ chat: id, model: text, embedded: count, skipped: count });
258
+ var conversationPreparation = strictObject({
259
+ model: text,
260
+ model_available: boolean(),
261
+ built: array(conversationBuild),
262
+ embedded: array(chatEmbedding),
263
+ left: array(strictObject({ chat: id, needs: picklist(["build", "embed"]) })),
264
+ /** Messages given their own vector, which `search messages --discover` reads, and how many still lack one. */
265
+ messages: optional(strictObject({ embedded: count, left: count }))
266
+ });
267
+ var catchUpPreparation = strictObject({
268
+ complete: boolean(),
269
+ reason: optional(picklist(["message_bound", "time_or_abort_bound", "preparation_failed", "pending"])),
270
+ prepared: optional(conversationPreparation)
271
+ });
272
+
273
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/services/backfill-jobs.js
274
+ import { spawn } from "node:child_process";
275
+ import { randomBytes } from "node:crypto";
276
+ import { closeSync, existsSync, mkdirSync, openSync, readdirSync, readFileSync, realpathSync, rmSync } from "node:fs";
277
+ import { dirname, join } from "node:path";
278
+
279
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/background/checkpoints.js
280
+ var progressOf = /* @__PURE__ */ __name((input) => {
281
+ const total = input.total ?? null;
282
+ const updated = input.updatedAt ?? null;
283
+ return {
284
+ job: input.job,
285
+ profile: input.profile,
286
+ done: input.done,
287
+ total,
288
+ remaining: total === null ? null : Math.max(0, total - input.done),
289
+ state: input.complete ?? (total !== null && input.done >= total) ? "complete" : "partial",
290
+ updated_at: updated,
291
+ cursor_age_ms: updated === null ? null : Math.max(0, (input.now ?? /* @__PURE__ */ new Date()).getTime() - Date.parse(updated))
292
+ };
293
+ }, "progressOf");
294
+
295
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/services/backfill-jobs.js
296
+ var JOB_STATES = ["running", "done", "partial", "failed", "cancelled", "died"];
297
+ var spawnDetached = /* @__PURE__ */ __name((argv, env, log) => {
298
+ const out = openSync(log, "a", 384);
299
+ try {
300
+ const child = spawn(process.execPath, [realpathSync(process.argv[1] ?? ""), ...argv], {
301
+ detached: true,
302
+ stdio: ["ignore", out, out],
303
+ env
304
+ });
305
+ child.unref();
306
+ return child.pid ?? 0;
307
+ } finally {
308
+ closeSync(out);
309
+ }
310
+ }, "spawnDetached");
311
+ var jobsDir = /* @__PURE__ */ __name((app, env) => join(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "backfill"), "jobsDir");
312
+ var jobPath = /* @__PURE__ */ __name((dir, id6) => join(dir, `${id6}.json`), "jobPath");
313
+ var saveJob = /* @__PURE__ */ __name((dir, job2) => {
314
+ mkdirSync(dir, { recursive: true, mode: 448 });
315
+ writeSecurely(jobPath(dir, job2.id), `${JSON.stringify(job2, null, 2)}
316
+ `, 384);
317
+ }, "saveJob");
318
+ var readJob = /* @__PURE__ */ __name((dir, id6) => {
319
+ if (!/^[\w-]+$/.test(id6) || !existsSync(jobPath(dir, id6)))
320
+ return void 0;
321
+ try {
322
+ return JSON.parse(readFileSync(jobPath(dir, id6), "utf8"));
323
+ } catch {
324
+ return void 0;
325
+ }
326
+ }, "readJob");
327
+ var recordsPath = /* @__PURE__ */ __name((dir, id6) => join(dir, `${id6}.jsonl`), "recordsPath");
328
+ var tracedJob = /* @__PURE__ */ __name((env) => {
329
+ const trace = childTrace();
330
+ return { env: { ...env, TRACEPARENT: trace.traceparent }, traceId: trace.traceId };
331
+ }, "tracedJob");
332
+ var jobStarted = /* @__PURE__ */ __name((app, dir, job2) => {
333
+ saveJob(dir, job2);
334
+ recordLogFor(recordsPath(dir, job2.id), app, job2.traceId ? { traceId: job2.traceId } : {}).info({
335
+ event: "job.start",
336
+ job: job2.id,
337
+ pid: job2.pid
338
+ });
339
+ }, "jobStarted");
340
+ var finishJob = /* @__PURE__ */ __name((app, dir, id6, change) => {
341
+ updateJob(dir, id6, change);
342
+ const job2 = readJob(dir, id6);
343
+ if (!job2)
344
+ return;
345
+ const outcome2 = stateOf(job2);
346
+ recordLogFor(recordsPath(dir, id6), app, job2.traceId ? { traceId: job2.traceId } : {})[job2.error ? "error" : "info"]({
347
+ event: "job.exit",
348
+ job: id6,
349
+ outcome: outcome2,
350
+ ...job2.error ? { errorCode: job2.error.code } : {}
351
+ });
352
+ }, "finishJob");
353
+ var updateJob = /* @__PURE__ */ __name((dir, id6, change) => {
354
+ const job2 = readJob(dir, id6);
355
+ if (job2)
356
+ saveJob(dir, { ...job2, ...change });
357
+ }, "updateJob");
358
+ var removeJob = /* @__PURE__ */ __name((dir, job2) => {
359
+ rmSync(jobPath(dir, job2.id), { force: true });
360
+ rmSync(recordsPath(dir, job2.id), { force: true });
361
+ if (dirname(job2.log) === dir)
362
+ rmSync(job2.log, { force: true });
363
+ }, "removeJob");
364
+ var listJobs = /* @__PURE__ */ __name((dir) => existsSync(dir) ? readdirSync(dir).filter((name) => name.endsWith(".json")).flatMap((name) => readJob(dir, name.slice(0, -".json".length)) ?? []).sort((a, b) => b.startedAt.localeCompare(a.startedAt)) : [], "listJobs");
365
+ var jobDetails = /* @__PURE__ */ __name((job2) => ({
366
+ job: job2.id,
367
+ profile: job2.profile,
368
+ chat: job2.chat,
369
+ state: stateOf(job2),
370
+ pid: job2.pid,
371
+ startedAt: job2.startedAt,
372
+ ...job2.finishedAt ? { finishedAt: job2.finishedAt } : {},
373
+ fetched: Number(job2.result?.fetched ?? job2.progress?.fetched ?? 0),
374
+ ...job2.limit === void 0 ? {} : { messageLimit: job2.limit },
375
+ ...job2.pageSize === void 0 ? {} : { pageSize: job2.pageSize },
376
+ ...job2.last === void 0 ? {} : { last: job2.last },
377
+ ...job2.result ? {
378
+ complete: job2.result.complete === true,
379
+ ...job2.result.issue ? { issue: job2.result.issue } : {},
380
+ ...job2.result.batch ? { batch: job2.result.batch } : {},
381
+ ...job2.result.resume ? { resume: job2.result.resume } : {}
382
+ } : {},
383
+ ...job2.error ? { error: job2.error } : {},
384
+ progress: progressOf({
385
+ job: job2.id,
386
+ profile: job2.profile,
387
+ done: Number(job2.result?.fetched ?? job2.progress?.fetched ?? 0),
388
+ ...job2.limit === void 0 ? {} : { total: job2.limit },
389
+ complete: job2.result?.complete === true,
390
+ ...job2.progress?.at ?? job2.finishedAt ? { updatedAt: job2.progress?.at ?? job2.finishedAt } : {}
391
+ })
392
+ }), "jobDetails");
393
+ var jobItem = /* @__PURE__ */ __name((job2) => {
394
+ const issue = job2.result?.issue;
395
+ return {
396
+ id: job2.id,
397
+ chat: job2.chat,
398
+ state: stateOf(job2),
399
+ pid: job2.pid,
400
+ started_at: job2.startedAt,
401
+ ...job2.finishedAt ? { finished_at: job2.finishedAt } : {},
402
+ fetched: Number(job2.result?.fetched ?? job2.progress?.fetched ?? 0),
403
+ ...job2.limit === void 0 ? {} : { message_limit: job2.limit },
404
+ ...job2.pageSize === void 0 ? {} : { page_size: job2.pageSize },
405
+ ...job2.last === void 0 ? {} : { last: job2.last },
406
+ ...job2.result ? { complete: job2.result.complete === true } : {},
407
+ ...issue ? { issue: { code: String(issue.code), message: String(issue.message) } } : {},
408
+ ...job2.error ? { error: { code: job2.error.code, message: job2.error.message } } : {}
409
+ };
410
+ }, "jobItem");
411
+ var stateOf = /* @__PURE__ */ __name((job2) => {
412
+ if (job2.finishedAt !== void 0) {
413
+ if (job2.cancelRequestedAt)
414
+ return "cancelled";
415
+ return job2.error ? "failed" : job2.result?.batch || job2.result?.issue ? "partial" : "done";
416
+ }
417
+ if (isJob(job2))
418
+ return "running";
419
+ return job2.cancelRequestedAt ? "cancelled" : "died";
420
+ }, "stateOf");
421
+ var isJob = /* @__PURE__ */ __name((job2) => carries(job2.pid, `_BACKFILL_JOB=${job2.id}`), "isJob");
422
+ var startArchiveJob = /* @__PURE__ */ __name((app, env, profile, input, spawnJob = spawnDetached) => {
423
+ const dir = jobsDir(app, env);
424
+ const running = listJobs(dir).find((job3) => job3.profile === profile && job3.chat === input.chat && stateOf(job3) === "running");
425
+ if (running)
426
+ throw new CliError("validation_error", `job ${running.id} already works on this chat; inspect store jobs show first`);
427
+ const startedAt = (/* @__PURE__ */ new Date()).toISOString();
428
+ const id6 = `${startedAt.replace(/[-:]/g, "").slice(0, 15)}-${randomBytes(3).toString("hex")}`;
429
+ mkdirSync(dir, { recursive: true, mode: 448 });
430
+ const log = join(dir, `${id6}.log`);
431
+ const job2 = {
432
+ id: id6,
433
+ chat: input.chat,
434
+ profile,
435
+ pid: 0,
436
+ startedAt,
437
+ limit: input.limit,
438
+ pageSize: input.pageSize,
439
+ argv: input.argv,
440
+ log
441
+ };
442
+ saveJob(dir, job2);
443
+ const { [envName(app, "TIMEOUT")]: _timeout, ...inherited } = env;
444
+ const traced = tracedJob({ ...inherited, [envName(app, "PROFILE")]: profile, [envName(app, "BACKFILL_JOB")]: id6 });
445
+ const pid = spawnJob(input.argv, traced.env, log);
446
+ jobStarted(app, dir, { ...job2, pid, traceId: traced.traceId });
447
+ return { job: id6, pid, chat: input.chat, log };
448
+ }, "startArchiveJob");
449
+
450
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/job.js
451
+ var problem = strictObject({ code: text, message: text });
452
+ var job = strictObject({
453
+ id,
454
+ /** The chat as the sync was given it. */
455
+ chat: text,
456
+ state: picklist(JOB_STATES),
457
+ pid: count,
458
+ started_at: time,
459
+ finished_at: optional(time),
460
+ /** Messages fetched so far, or in all once it finished. */
461
+ fetched: count,
462
+ /** The `--limit` the sync was started with: how many messages it may fetch. */
463
+ message_limit: optional(count),
464
+ page_size: optional(count),
465
+ last: optional(count),
466
+ /** Whether the sync reached its window; set once it finished. */
467
+ complete: optional(boolean()),
468
+ /** Why a partial job stopped short; `store jobs retry` resumes it. */
469
+ issue: optional(problem),
470
+ error: optional(problem)
471
+ });
472
+
473
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/message.js
474
+ var quoted = strictObject({
475
+ id,
476
+ sender_id: nullable(id),
477
+ sender_name: nullable(text),
478
+ timestamp: nullable(time),
479
+ text,
480
+ attachments: array(attachment),
481
+ outgoing: nullable(boolean())
482
+ });
483
+ var mailPerson = strictObject({ name: nullable(text), address: text, ref: nullable(reference) });
484
+ var message = strictObject({
485
+ /** The message's locator. */
486
+ ref: reference,
487
+ id,
488
+ provider: optional(text),
489
+ account: optional(text),
490
+ chat_id: id,
491
+ chat_title: optional(nullable(text)),
492
+ sender_id: nullable(id),
493
+ sender_name: nullable(text),
494
+ sender_username: optional(text),
495
+ sender_is_chat: optional(boolean()),
496
+ mentions: optional(array(id)),
497
+ /** When it was sent. */
498
+ timestamp: time,
499
+ edited_at: nullable(time),
500
+ text,
501
+ /** What a voice message says, once heard. */
502
+ transcript: optional(text),
503
+ /** In a window of messages around one, the one asked for. */
504
+ anchor: optional(boolean()),
505
+ /** A stretch of the text, transcript, file name or file text around what a search matched. */
506
+ excerpt: optional(text),
507
+ /** `picture`: the picture search lane found it by what the picture shows; it follows the text hits. */
508
+ matched_in: optional(picklist(["text", "transcript", "filename", "file", "context", "picture"])),
509
+ score: optional(number()),
510
+ /**
511
+ * `corrected`: a query word matched only a spelling speech recognition garbled in a voice note's transcript,
512
+ * listed in `corrections`. `words` and `beginnings`: what a discovery search matched.
513
+ */
514
+ match: optional(picklist(["words", "beginnings", "corrected"])),
515
+ corrections: optional(array(strictObject({ from: text, to: array(text) }))),
516
+ /** Where a search found it: the local archive, the messenger's server, or both. */
517
+ found_in: optional(picklist(["archive", "server", "both"])),
518
+ /** A discovery search's partial match: how much of the question it covers, and which words it lacks. */
519
+ discovery: optional(strictObject({
520
+ coverage: number(),
521
+ matched_terms: array(text),
522
+ missing_terms: array(text),
523
+ parent: optional(reference),
524
+ /** Present when meaning was searched too: which of the two lists found it. */
525
+ found_by: optional(array(picklist(["words", "meaning"]))),
526
+ /** Present when the reranker read it: its own score, higher is better. It ordered the first hits with `score`. */
527
+ reranker_score: optional(number())
528
+ })),
529
+ /** The messages around a search hit, or its thread, oldest first; the hit itself is among them. */
530
+ context: optional(array(strictObject({ ref: reference, timestamp: time, sender_name: nullable(text), text }))),
531
+ outgoing: nullable(boolean()),
532
+ attachments: array(attachment),
533
+ reply_to: nullable(quoted),
534
+ /** The id a reply answers, also when the provider sent no copy of that message. */
535
+ reply_to_id: optional(id),
536
+ forwarded_from: nullable(quoted),
537
+ thread_id: optional(id),
538
+ thread_root_id: optional(id),
539
+ reactions: optional(nullable(strictObject({
540
+ counts: array(strictObject({ reaction: text, count })),
541
+ mine: nullable(text),
542
+ total: count
543
+ }))),
544
+ scheduled_for: optional(time),
545
+ /** The owner starred it; only where the messenger has stars, and only when set. */
546
+ starred: optional(literal(true)),
547
+ /** The owner's own message in a one-to-one chat: `delivered`, or `read` once opened; absent when no receipt came. */
548
+ delivery: optional(picklist(["delivered", "read"])),
549
+ email: optional(strictObject({
550
+ subject: nullable(text),
551
+ from: nullable(mailPerson),
552
+ to: array(mailPerson),
553
+ cc: array(mailPerson),
554
+ bcc: array(mailPerson),
555
+ /** The mail header Reply-To; `reply_to` is the quoted message a chat reply answers. */
556
+ reply_addresses: array(mailPerson),
557
+ labels: array(text),
558
+ /** The thread as a `chat:` reference. */
559
+ thread: reference,
560
+ read: nullable(boolean()),
561
+ flagged: nullable(boolean()),
562
+ /** How much the sender's mail looks like spam, a scam or a robot (memo's score), and why; absent when unscored. */
563
+ sender_score: optional(strictObject({ score: number(), signals: array(text), demoted: optional(literal(true)) }))
564
+ })),
565
+ provider_metadata: providerMetadata
566
+ });
567
+
568
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/extraction-report.js
569
+ var extractionItem = strictObject({
570
+ ref: reference,
571
+ attachment: count,
572
+ kind: text,
573
+ name: nullable(text),
574
+ status: picklist(["extracted", "needs-agent", "unreadable", "engine-missing", "too-large", "missing"]),
575
+ extractor: optional(text),
576
+ chars: optional(count),
577
+ local_path: optional(text),
578
+ pages: optional(count),
579
+ ocr_pages: optional(count),
580
+ error: optional(text),
581
+ issue: optional(actionableError)
582
+ });
583
+ var extractionSummary = strictObject({
584
+ extracted: count,
585
+ failed: count,
586
+ needs_agent: count,
587
+ complete: boolean(),
588
+ batch: optional(batchResult)
589
+ });
590
+ var extractionReport = strictObject({
591
+ ...extractionSummary.entries,
592
+ items: array(extractionItem),
593
+ unchanged: count,
594
+ not_downloaded: count,
595
+ unsupported: count,
596
+ /** Reader package names, such as unpdf or @napi-rs/canvas. */
597
+ engines_missing: array(text),
598
+ cursor: optional(text)
599
+ });
600
+
601
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/message-transfer.js
602
+ var savedMessageFile = strictObject({
603
+ kind: text,
604
+ path: text,
605
+ bytes: count,
606
+ existing: optional(literal(true))
607
+ });
608
+ var files = array(savedMessageFile);
609
+ var messageDownload = union([
610
+ strictObject({
611
+ files,
612
+ extraction: optional(extractionReport),
613
+ complete: optional(literal(false)),
614
+ batch: optional(batchResult)
615
+ }),
616
+ strictObject({
617
+ files,
618
+ chat: nullable(id),
619
+ saved: count,
620
+ existing: count,
621
+ complete: boolean(),
622
+ batch: optional(batchResult),
623
+ stopped: optional(literal(true)),
624
+ extraction: optional(extractionSummary)
625
+ })
626
+ ]);
627
+ var historyRange = strictObject({ from: number(), to: number() });
628
+ var messageSyncEstimate = strictObject({
629
+ chat: id,
630
+ held: count,
631
+ ranges: array(historyRange),
632
+ missing: nullable(count),
633
+ requests: nullable(count),
634
+ runs: nullable(count),
635
+ seconds: nullable(count)
636
+ });
637
+ var tasks = optional(strictObject({
638
+ added: count,
639
+ closed: count,
640
+ review: count,
641
+ held: optional(count),
642
+ held_chats: optional(count)
643
+ }));
644
+ var messageSyncChat = strictObject({
645
+ issue: optional(actionableError),
646
+ resume: optional(strictObject({ before: optional(text) })),
647
+ prepared: optional(catchUpPreparation),
648
+ window_complete: optional(boolean()),
649
+ requests: optional(count),
650
+ chat: nullable(id),
651
+ fetched: count,
652
+ complete: boolean(),
653
+ ranges: array(historyRange),
654
+ reached_since: optional(literal(true)),
655
+ reached_last: optional(literal(true)),
656
+ stopped: optional(literal(true)),
657
+ tasks
658
+ });
659
+ var messageSyncAll = strictObject({
660
+ batch: optional(batchResult),
661
+ chats: count,
662
+ fetched: count,
663
+ complete: boolean(),
664
+ stopped: optional(literal(true)),
665
+ items: array(strictObject({
666
+ chat: id,
667
+ title: nullable(text),
668
+ fetched: count,
669
+ complete: boolean(),
670
+ current: optional(literal(true)),
671
+ stopped: optional(literal(true)),
672
+ error: optional(text),
673
+ issue: optional(actionableError)
674
+ })),
675
+ tasks
676
+ });
677
+ var messageSyncStarted = strictObject({ job: id, pid: count, chat: text, log: text });
678
+ var messageSync = union([messageSyncEstimate, messageSyncChat, messageSyncAll, messageSyncStarted]);
679
+
680
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/store-records.js
681
+ var range = strictObject({ from: number(), to: number() });
682
+ var storeChatStatus = strictObject({
683
+ chat_id: id,
684
+ title: nullable(text),
685
+ kind: chat.entries.kind,
686
+ messages: count,
687
+ oldest_at: nullable(time),
688
+ newest_at: nullable(time),
689
+ last_stored_at: nullable(time),
690
+ held: array(range)
691
+ });
692
+ var storeClear = strictObject({
693
+ cleared: boolean(),
694
+ dry_run: optional(literal(true)),
695
+ chats: count,
696
+ messages: count,
697
+ left: array(strictObject({ id, title: nullable(text), messages: count }))
698
+ });
699
+ var storeExport = union([
700
+ message,
701
+ strictObject({
702
+ path: text,
703
+ format: picklist(["jsonl", "markdown"]),
704
+ count,
705
+ encrypted: optional(literal(true))
706
+ }),
707
+ strictObject({
708
+ path: text,
709
+ encrypted: optional(literal(true)),
710
+ chats: array(strictObject({ id, title: nullable(text), file: nullable(text), messages: count, deleted: count }))
711
+ })
712
+ ]);
713
+ var storeGapPlan = strictObject({
714
+ version: literal(1),
715
+ scope: literal("interior"),
716
+ account: strictObject({ provider: text, account: id }),
717
+ chat: id,
718
+ ordering: picklist(["id", "time"]),
719
+ held: array(range),
720
+ gaps: array(range),
721
+ unknown: strictObject({ older: boolean(), newer: literal(true) }),
722
+ fingerprint: text,
723
+ limits: strictObject({ max_gaps: count, limit: count, time_ms: count, page_size: count })
724
+ });
725
+ var storeGapRepair = union([
726
+ messageSyncStarted,
727
+ strictObject({
728
+ version: literal(1),
729
+ scope: literal("interior"),
730
+ chat: id,
731
+ before: storeGapPlan,
732
+ after: storeGapPlan,
733
+ repaired: array(range),
734
+ fetched: count,
735
+ requests: count,
736
+ complete: boolean(),
737
+ prepared: optional(catchUpPreparation),
738
+ stopped: optional(picklist(["bound", "partial_or_inaccessible", "fetch_failed"]))
739
+ })
740
+ ]);
741
+ var problem2 = objectWithRest({ code: text, message: text, retryable: optional(boolean()), retry_after_ms: optional(number()) }, unknown());
742
+ var progress = strictObject({
743
+ job: id,
744
+ profile: text,
745
+ done: count,
746
+ total: nullable(count),
747
+ remaining: nullable(count),
748
+ state: picklist(["partial", "complete"]),
749
+ updated_at: nullable(time),
750
+ cursor_age_ms: nullable(count)
751
+ });
752
+ var storeJobDetails = strictObject({
753
+ ...omit(job, ["id", "issue", "error"]).entries,
754
+ job: id,
755
+ profile: text,
756
+ issue: optional(problem2),
757
+ error: optional(problem2),
758
+ batch: optional(batchResult),
759
+ resume: optional(strictObject({ before: optional(text) })),
760
+ progress,
761
+ held: optional(array(range)),
762
+ log: text
763
+ });
764
+ var storeJobCancel = strictObject({ job: id, cancelled: literal(true) });
765
+ var storeJobRetry = union([
766
+ strictObject({ ...messageSyncStarted.entries, retried: id }),
767
+ strictObject({ retried: id, chat: text, error: strictObject({ code: text, message: text }) })
768
+ ]);
769
+ var storeJobClear = strictObject({ cleared: array(id) });
770
+
771
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/account.js
772
+ var account = strictObject({
773
+ provider: text,
774
+ id,
775
+ name: nullable(text),
776
+ username: nullable(text),
777
+ phone: optional(nullable(text)),
778
+ scope: optional(picklist(["personal", "work"]))
779
+ });
780
+
781
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/account-session.js
782
+ var accountSession = strictObject({
783
+ current: boolean(),
784
+ client: nullable(text),
785
+ device: nullable(text),
786
+ location: nullable(text),
787
+ last_active_at: nullable(time),
788
+ created_at: optional(nullable(time))
789
+ });
790
+
791
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/account-change.js
792
+ var accountChange = strictObject({ operation_id: id, account: omit(account, ["provider", "scope"]) });
793
+ var endedAccountSessions = strictObject({ operation_id: id, sessions: array(accountSession) });
794
+ var audience = picklist(["everyone", "contacts", "nobody"]);
795
+ var shownAudience = picklist(["everyone", "contacts", "nobody", "contacts_except"]);
796
+ var accountPrivacy = strictObject({
797
+ find_by_phone: optional(audience),
798
+ phone_number: optional(audience),
799
+ calls: optional(audience),
800
+ chat_invites: optional(audience),
801
+ hide_online: optional(boolean()),
802
+ read_receipts: optional(boolean()),
803
+ profile_photo: optional(shownAudience),
804
+ about: optional(shownAudience),
805
+ last_seen: optional(shownAudience)
806
+ });
807
+ var accountPrivacyChange = strictObject({ operation_id: id, privacy: accountPrivacy });
808
+
809
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/account-profile.js
810
+ var accountProfile = strictObject({
811
+ profile: id,
812
+ current: boolean(),
813
+ account: nullable(id),
814
+ name: nullable(text),
815
+ /** False for a profile with no session on this computer; absent when the messenger does not say. */
816
+ signed_in: optional(boolean())
817
+ });
818
+
819
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/counter-reading.js
820
+ var milliseconds = pipe(number(), minValue(0));
821
+ var counterReading = strictObject({
822
+ counter: picklist(["views", "reactions", "comments"]),
823
+ value: nullable(number()),
824
+ observed_at: nullable(time),
825
+ source: nullable(text),
826
+ age_ms: nullable(milliseconds),
827
+ freshness: picklist(["fresh", "stale", "unknown"])
828
+ });
829
+ var selection = record(string(), unknown());
830
+
831
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/admin-report.js
832
+ var adminRow = strictObject({
833
+ ref: reference,
834
+ /** What `stats * evidence` takes: a person id, a stay or a message locator. */
835
+ id,
836
+ status: picklist(["observed", "no-observed-answer", "partial", "unknown"]),
837
+ chat_ref: optional(reference),
838
+ person_ref: optional(reference),
839
+ identity_known: optional(boolean()),
840
+ questions: optional(count),
841
+ answered: optional(count),
842
+ median_ms: optional(nullable(milliseconds)),
843
+ p90_ms: optional(nullable(milliseconds)),
844
+ age_ms: optional(milliseconds),
845
+ joined_at: optional(time),
846
+ window_end: optional(time),
847
+ pending: optional(boolean()),
848
+ views: optional(count),
849
+ observed_replies: optional(count),
850
+ comment_snapshot: optional(nullable(count)),
851
+ counters: optional(array(counterReading)),
852
+ selection
853
+ });
854
+ var adminReport = strictObject({
855
+ report: picklist(["unanswered", "responses", "newcomers", "discussion"]),
856
+ cutoff: time,
857
+ /** Rows the report found; `rows` holds the first `--limit` of them. */
858
+ total: count,
859
+ summary: strictObject({
860
+ questions: count,
861
+ answered: count,
862
+ no_observed_answer: count,
863
+ excluded_future: count,
864
+ unknown_join: count,
865
+ missing_views: count
866
+ }),
867
+ quality: strictObject({
868
+ graph: strictObject({
869
+ unknown_links: count,
870
+ unknown_authors: count,
871
+ missing_parents: count,
872
+ cycles: count,
873
+ complete: boolean()
874
+ }),
875
+ archives: array(strictObject({ chat_ref: reference, state: text, fetched_at: nullable(time) })),
876
+ archives_total: count,
877
+ membership: text,
878
+ counter_freshness: text,
879
+ answerer_roles: text
880
+ }),
881
+ rows: array(adminRow)
882
+ });
883
+
884
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/analysis-consent.js
885
+ var analysisConsent = strictObject({ chat: id, provider: text, at: time });
886
+ var analysisConsentRevocation = strictObject({ revoked: boolean() });
887
+
888
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/attachment-results.js
889
+ var fingerprint = pipe(text, regex(/^[a-f0-9]{64}$/));
890
+ var attachmentBytes = strictObject({
891
+ ref: reference,
892
+ attachment: count,
893
+ name: nullable(text),
894
+ mime_type: text,
895
+ total_bytes: count,
896
+ sha256: fingerprint,
897
+ offset_bytes: count,
898
+ read_bytes: count,
899
+ next_offset_bytes: nullable(count),
900
+ complete: boolean(),
901
+ base64: optional(text),
902
+ pdf: optional(strictObject({ page: count, page_count: count, source_sha256: fingerprint, source_bytes: count }))
903
+ });
904
+ var attachmentExtraction = union([
905
+ strictObject({ ...omit(extractionReport, ["items"]).entries, files: array(extractionItem) }),
906
+ extractionItem
907
+ ]);
908
+ var attachmentTextChange = strictObject({
909
+ ref: reference,
910
+ attachment: count,
911
+ origin: literal("agent"),
912
+ chars: count,
913
+ replaced: nullable(picklist(["extracted", "agent"]))
914
+ });
915
+
916
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/chart.js
917
+ var chart = strictObject({
918
+ version: literal(1),
919
+ kind: picklist(["bar", "line", "grouped-bar"]),
920
+ title: text,
921
+ x: strictObject({ type: picklist(["day", "week"]), values: array(text) }),
922
+ series: array(strictObject({ name: text, values: array(nullable(number())) })),
923
+ unit: picklist(["messages", "people"]),
924
+ timezone: text,
925
+ /** Lower bounds: the store or the events did not hold the whole period. */
926
+ partial: boolean(),
927
+ reasons: array(picklist(["store-incomplete", "events-incomplete"])),
928
+ file: optional(strictObject({ path: text, format: picklist(["svg", "png"]), width: count, height: count }))
929
+ });
930
+
931
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/folder.js
932
+ var named = strictObject({
933
+ id,
934
+ title: nullable(text),
935
+ kind: nullable(picklist(["dialog", "group", "channel", "saved", "unknown"]))
936
+ });
937
+ var folder = strictObject({
938
+ id,
939
+ title: text,
940
+ /** Chats added by hand; a folder that selects chats by a rule of its own lists none. */
941
+ chat_ids: array(id),
942
+ emoji: optional(text),
943
+ /** Kinds of chat it takes by itself. */
944
+ include: optional(array(picklist(["contacts", "non-contacts", "groups", "channels", "bots"]))),
945
+ skip: optional(array(picklist(["muted", "read", "archived"]))),
946
+ excluded_chat_ids: optional(array(id)),
947
+ pinned_chat_ids: optional(array(id)),
948
+ /** `chats folders show`: the chats in it, pinned and left out, by name. */
949
+ chats: optional(array(named)),
950
+ pinned_chats: optional(array(named)),
951
+ excluded_chats: optional(array(named))
952
+ });
953
+
954
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/invite-link.js
955
+ var inviteLink = strictObject({
956
+ link: text,
957
+ /** Who joins by it asks first, and an admin lets them in. */
958
+ approval: boolean(),
959
+ /** `null` when it never expires. */
960
+ expires_at: nullable(time),
961
+ /** `null` for no limit. */
962
+ max_uses: nullable(count),
963
+ /** The group's own link; revoking it makes the messenger issue a new one. */
964
+ primary: optional(boolean()),
965
+ revoked: optional(boolean()),
966
+ pending_count: optional(count),
967
+ joined_count: optional(count)
968
+ });
969
+
970
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/chat-admin.js
971
+ var operated = { operation_id: id, chat_id: id };
972
+ var group = strictObject({
973
+ ...omit(chat, ["ref", "provider", "account", "invite_link", "members"]).entries,
974
+ parent_chat_id: optional(nullable(id)),
975
+ muted_until: optional(nullable(time)),
976
+ description: nullable(text),
977
+ link: nullable(text),
978
+ settings: strictObject({
979
+ ...unwrap(chat.entries.settings).entries,
980
+ all_can_pin: nullable(boolean()),
981
+ only_admins_add: nullable(boolean()),
982
+ only_admins_call: nullable(boolean()),
983
+ only_owner_edits_info: nullable(boolean()),
984
+ members_see_link: nullable(boolean())
985
+ })
986
+ });
987
+ var chatGroupChange = union([
988
+ strictObject({ operation_id: id, chat: group }),
989
+ strictObject({ operation_id: id, requested: literal(true) })
990
+ ]);
991
+ var chatInspection = strictObject({
992
+ kind: chat.entries.kind,
993
+ title: nullable(text),
994
+ id: nullable(id),
995
+ username: nullable(text),
996
+ participants_count: nullable(count),
997
+ description: nullable(text),
998
+ member: nullable(boolean()),
999
+ approval_needed: optional(boolean())
1000
+ });
1001
+ var chatSender = strictObject({
1002
+ id,
1003
+ title: text,
1004
+ kind: picklist(["self", "channel", "group"]),
1005
+ premium_required: boolean(),
1006
+ default: boolean()
1007
+ });
1008
+ var chatRead = strictObject({ ...operated, until: nullable(id), thread_id: optional(id) });
1009
+ var chatMembersFetch = strictObject({
1010
+ chat_id: id,
1011
+ joined: array(id),
1012
+ gone: array(id),
1013
+ changed: array(id),
1014
+ read: count,
1015
+ participants: nullable(count),
1016
+ complete: boolean(),
1017
+ more: boolean(),
1018
+ tracked: boolean()
1019
+ });
1020
+ var chatMembersChange = union([
1021
+ strictObject({ ...operated, added: array(id), not_added: array(id) }),
1022
+ strictObject({ ...operated, removed: array(id) })
1023
+ ]);
1024
+ var chatInvite = strictObject({ chat_id: id, title: nullable(text), link: text });
1025
+ var chatInviteChange = strictObject({
1026
+ ...operated,
1027
+ ...omit(inviteLink, ["pending_count", "joined_count"]).entries,
1028
+ pending: optional(count),
1029
+ joined: optional(count)
1030
+ });
1031
+ var chatRequestChange = union([
1032
+ strictObject({ ...operated, person_id: id, accepted: boolean(), already: boolean() }),
1033
+ strictObject({ chat_id: id, accepted: boolean(), counted: count, operation_id: optional(id) })
1034
+ ]);
1035
+ var chatAdminChange = strictObject({
1036
+ ...operated,
1037
+ person_id: id,
1038
+ rights: optional(array(picklist(["read", "members", "admins", "info", "pin", "link", "post", "edit", "delete"])))
1039
+ });
1040
+ var chatFolderChange = strictObject({
1041
+ operation_id: id,
1042
+ folder: omit(folder, ["chats", "pinned_chats", "excluded_chats"])
1043
+ });
1044
+ var chatFolderRemoval = strictObject({ operation_id: id, folder_id: id });
1045
+ var chatFolderOrder = strictObject({
1046
+ operation_id: id,
1047
+ folders: array(strictObject({ id, title: text }))
1048
+ });
1049
+
1050
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/chat-change.js
1051
+ var operated2 = { operation_id: id, chat_id: id };
1052
+ var chatRemoval = strictObject(operated2);
1053
+ var chatMuting = strictObject({
1054
+ ...operated2,
1055
+ muted_until: nullable(union([time, literal("forever")]))
1056
+ });
1057
+ var chatArchive = strictObject({ ...operated2, archived: boolean() });
1058
+ var chatPin = strictObject({ ...operated2, pinned: boolean() });
1059
+ var chatUnread = strictObject({ ...operated2, unread: literal(true) });
1060
+
1061
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/chat-event.js
1062
+ var who = strictObject({ id: nullable(id), name: nullable(text), username: optional(nullable(text)) });
1063
+ var chatEvent = strictObject({
1064
+ chat_id: id,
1065
+ time,
1066
+ /** `join`, `leave`, `add`, `remove`, `create`, `title`, `pin`, `profile`; a messenger may pass others through. */
1067
+ type: text,
1068
+ /** The service message that says so, where there is one. */
1069
+ message_id: optional(id),
1070
+ by: optional(who),
1071
+ people: array(who),
1072
+ /** `create` and `title` carry the chat's title. */
1073
+ title: optional(text),
1074
+ /** `profile`: the name and username seen before. */
1075
+ before: optional(strictObject({ name: nullable(text), username: nullable(text) }))
1076
+ });
1077
+
1078
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/chat-metadata.js
1079
+ var chatMetadata = strictObject({
1080
+ chat_id: id,
1081
+ title: nullable(text),
1082
+ username: nullable(text),
1083
+ description: nullable(text),
1084
+ fetched_at: time
1085
+ });
1086
+ var cachedChatMetadata = strictObject({ chat_id: id, metadata: nullable(chatMetadata) });
1087
+ var failedChatMetadata = strictObject({ chat_id: id, error: strictObject({ code: text, message: text }) });
1088
+ var chatMetadataRefresh = strictObject({
1089
+ chats: array(union([chatMetadata, failedChatMetadata])),
1090
+ has_more: boolean()
1091
+ });
1092
+
1093
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/chat-moderation.js
1094
+ var action = picklist(["report", "delete", "remove"]);
1095
+ var level = picklist(["deny", "readonly", "ask", "allow"]);
1096
+ var chatRules = strictObject({
1097
+ chat_id: id,
1098
+ title: nullable(text),
1099
+ file: text,
1100
+ saved: boolean(),
1101
+ rules: strictObject({
1102
+ title: nullable(text),
1103
+ trusted: array(id),
1104
+ blocked: array(id),
1105
+ blocked_names: array(text),
1106
+ links: action,
1107
+ invites: action,
1108
+ forwards: action,
1109
+ blocked_people: action,
1110
+ flood: strictObject({ messages: count, minutes: count, action }),
1111
+ new_account: strictObject({ days: count, action: picklist(["report", "remove"]) }),
1112
+ consent: strictObject({ delete: level, remove: level })
1113
+ })
1114
+ });
1115
+ var chatModeration = strictObject({
1116
+ chat_id: id,
1117
+ rows: array(strictObject({
1118
+ kind: picklist(["message", "member"]),
1119
+ rule: picklist(["blocked", "invites", "links", "forwards", "flood", "newAccount"]),
1120
+ person_id: id,
1121
+ person_name: nullable(text),
1122
+ message_id: optional(id),
1123
+ action,
1124
+ outcome: picklist(["reported", "done", "planned", "forbidden", "declined", "refused", "failed", "skipped"]),
1125
+ reason: optional(text),
1126
+ command: optional(text)
1127
+ }))
1128
+ });
1129
+
1130
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/chat-stats.js
1131
+ var optionalCount = optional(count);
1132
+ var minutes = nullable(number());
1133
+ var chatStats = strictObject({
1134
+ chat: reference,
1135
+ since: time,
1136
+ until: time,
1137
+ /** The store holds the chat whole and the messenger read every join and leave; otherwise lower bounds. */
1138
+ complete: boolean(),
1139
+ completeness: strictObject({
1140
+ state: picklist(["complete", "partial", "unknown"]),
1141
+ up_to_date: nullable(boolean()),
1142
+ gaps: boolean(),
1143
+ reaches_start: boolean(),
1144
+ fetched_at: nullable(time)
1145
+ }),
1146
+ messages: count,
1147
+ senders: count,
1148
+ replies: count,
1149
+ threads: count,
1150
+ reactions: count,
1151
+ views: optionalCount,
1152
+ forwards: optionalCount,
1153
+ comments: optionalCount,
1154
+ top_posts: array(strictObject({
1155
+ ref: reference,
1156
+ timestamp: time,
1157
+ reactions: count,
1158
+ views: optionalCount,
1159
+ forwards: optionalCount,
1160
+ comments: optionalCount
1161
+ })),
1162
+ questions: strictObject({
1163
+ asked: count,
1164
+ answered: count,
1165
+ median_minutes_to_answer: minutes,
1166
+ answered_by: picklist(["owner", "owner-and-admins"])
1167
+ }),
1168
+ member_counts: optional(array(strictObject({ day: text, participants: nullable(count), listed: count, complete: boolean() }))),
1169
+ /** Absent where joins and leaves were not asked, or not recorded for the chat yet (then `missing` says so). */
1170
+ members: optional(strictObject({
1171
+ joined: count,
1172
+ left: count,
1173
+ net: number(),
1174
+ wrote: count,
1175
+ median_minutes_to_first_message: minutes,
1176
+ /** The messenger stopped reading its history before `since`: the counts are lower bounds. */
1177
+ more: boolean()
1178
+ })),
1179
+ series: optional(array(strictObject({ key: text, messages: count, senders: count, joined: optionalCount, left: optionalCount })))
1180
+ });
1181
+ var taskStats = strictObject({
1182
+ /** Open tasks across every row. */
1183
+ open: count,
1184
+ rows: array(strictObject({
1185
+ chat: reference,
1186
+ open: count,
1187
+ oldest_open_at: nullable(time),
1188
+ median_close_ms: nullable(pipe(number(), minValue(0)))
1189
+ }))
1190
+ });
1191
+
1192
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/chat-tracking.js
1193
+ var memberCount = strictObject({
1194
+ day: pipe(text, isoDate()),
1195
+ participants: nullable(count),
1196
+ listed: count,
1197
+ complete: boolean()
1198
+ });
1199
+ var trackedChat = strictObject({
1200
+ chat_id: id,
1201
+ title: nullable(text),
1202
+ tracked_at: time,
1203
+ last_count: nullable(memberCount)
1204
+ });
1205
+ var trackedChatHistory = strictObject({
1206
+ chat_id: id,
1207
+ tracked_at: nullable(time),
1208
+ counts: array(memberCount)
1209
+ });
1210
+ var chatTracking = strictObject({
1211
+ chat_id: id,
1212
+ tracked: boolean()
1213
+ });
1214
+
1215
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/contact.js
1216
+ var contact = strictObject({
1217
+ ref: reference,
1218
+ id,
1219
+ name: nullable(text),
1220
+ username: nullable(text),
1221
+ alias: optional(nullable(text)),
1222
+ display_name: optional(nullable(text)),
1223
+ /** Whatever they wrote about themselves. */
1224
+ description: nullable(text),
1225
+ /** The newest message in a one-to-one chat with them. */
1226
+ last_messaged_at: nullable(time),
1227
+ /** For a source that knows it, such as a Zoom contact. */
1228
+ email: optional(nullable(text)),
1229
+ phones: optional(array(strictObject({ number: text, label: nullable(text) }))),
1230
+ /** `contacts show`: the chats shared with them. */
1231
+ chats: optional(array(pick(chat, ["ref", "id", "title", "kind", "last_message_at"]))),
1232
+ /** `contacts show --with-notes`: the owner's private notes about them. */
1233
+ notes: optional(array(strictObject({ id, text, revision: count, created_at: time, updated_at: time })))
1234
+ });
1235
+
1236
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/contact-activity.js
1237
+ var linkedIdentity = strictObject({
1238
+ provider: text,
1239
+ id,
1240
+ name: nullable(text),
1241
+ username: nullable(text),
1242
+ is_bot: nullable(boolean()),
1243
+ accounts: array(id),
1244
+ method: text,
1245
+ linked_by: text,
1246
+ linked_at: time
1247
+ });
1248
+ var linkedPerson = strictObject({ uid: id, name: nullable(text), identities: array(linkedIdentity) });
1249
+ var contactActivity = strictObject({
1250
+ at: time,
1251
+ subject: text,
1252
+ subject_id: count,
1253
+ role: text,
1254
+ scope: text,
1255
+ provider: nullable(text),
1256
+ account: nullable(text),
1257
+ chat_id: nullable(text),
1258
+ locator: nullable(text),
1259
+ project_id: nullable(count)
1260
+ });
1261
+ var botReason = picklist(Object.keys(WEIGHTS));
1262
+ var contactCheck = strictObject({
1263
+ person: strictObject({ id, name: nullable(text), username: nullable(text), provider: text }),
1264
+ score: count,
1265
+ reasons: array(strictObject({ reason: botReason, weight: count, source: text, detail: optional(text) })),
1266
+ registries: array(strictObject({
1267
+ name: picklist(["cas", "lols"]),
1268
+ answer: picklist(["listed", "clean", "unknown"]),
1269
+ checked_at: time,
1270
+ detail: optional(text),
1271
+ reasons: optional(array(picklist(["cas_banned", "lols_banned", "lols_scammer"])))
1272
+ })),
1273
+ unknown: array(botReason),
1274
+ checked_at: time
1275
+ });
1276
+
1277
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/contact-context.js
1278
+ var contextPerson = strictObject({ ...linkedPerson.entries, provider: text, id });
1279
+ var contextMessage = strictObject({
1280
+ locator: reference,
1281
+ provider: text,
1282
+ account: id,
1283
+ chat_id: id,
1284
+ chat_title: nullable(text),
1285
+ id,
1286
+ timestamp: time,
1287
+ sender_id: nullable(id),
1288
+ sender_name: nullable(text),
1289
+ outgoing: nullable(boolean()),
1290
+ text
1291
+ });
1292
+ var sharedChat = strictObject({
1293
+ provider: text,
1294
+ account: id,
1295
+ chat_id: id,
1296
+ title: nullable(text),
1297
+ kind: chat.entries.kind,
1298
+ last_message_at: nullable(time)
1299
+ });
1300
+ var contextEvent = strictObject({
1301
+ ref: reference,
1302
+ title: nullable(text),
1303
+ starts_at: nullable(time),
1304
+ ends_at: nullable(time),
1305
+ all_day: boolean(),
1306
+ location: nullable(text),
1307
+ status: nullable(text)
1308
+ });
1309
+ var context = strictObject({
1310
+ person: contextPerson,
1311
+ shared: array(sharedChat),
1312
+ last: strictObject({
1313
+ from_them: nullable(contextMessage),
1314
+ from_me: nullable(contextMessage),
1315
+ from_them_anywhere: nullable(contextMessage)
1316
+ }),
1317
+ recent: strictObject({ direct: array(contextMessage), groups: array(contextMessage) }),
1318
+ mentions: array(contextMessage),
1319
+ /** Calendar events they are invited to, one occurrence per series. */
1320
+ events: optional(strictObject({ upcoming: array(contextEvent), recent: array(contextEvent) })),
1321
+ limits: strictObject({ messages: count, bytes: count }),
1322
+ complete: boolean(),
1323
+ not_read: array(strictObject({
1324
+ provider: text,
1325
+ account: id,
1326
+ chat_id: id,
1327
+ title: nullable(text),
1328
+ reason: picklist(["not_fetched", "partial"])
1329
+ }))
1330
+ });
1331
+ var shortMessage = strictObject({ at: time, text, transcript: optional(text) });
1332
+ var identifiedMessage = strictObject({
1333
+ ...shortMessage.entries,
1334
+ id,
1335
+ locator: reference,
1336
+ sender_id: nullable(id),
1337
+ reply_to: nullable(id)
1338
+ });
1339
+ var counterObservation = strictObject({
1340
+ value: number(),
1341
+ observed_at: time,
1342
+ source: picklist(["remote_fetch", "remote_update"]),
1343
+ reactions: optional(message.entries.reactions.wrapped.wrapped)
1344
+ });
1345
+ var { reply_addresses: mailReplyTo, ...mailFields } = message.entries.email.wrapped.entries;
1346
+ var fullMessage = strictObject({
1347
+ ...pick(message, [
1348
+ "id",
1349
+ "chat_id",
1350
+ "chat_title",
1351
+ "excerpt",
1352
+ "sender_id",
1353
+ "sender_name",
1354
+ "sender_username",
1355
+ "mentions",
1356
+ "sender_is_chat",
1357
+ "timestamp",
1358
+ "edited_at",
1359
+ "text",
1360
+ "outgoing",
1361
+ "attachments",
1362
+ "reply_to",
1363
+ "reply_to_id",
1364
+ "forwarded_from",
1365
+ "thread_id",
1366
+ "thread_root_id",
1367
+ "scheduled_for",
1368
+ "provider_metadata",
1369
+ "delivery"
1370
+ ]).entries,
1371
+ reactions: nullable(message.entries.reactions.wrapped.wrapped),
1372
+ starred: optional(boolean()),
1373
+ email: optional(strictObject({ ...mailFields, reply_to: mailReplyTo })),
1374
+ counter_observations: optional(partial(strictObject({
1375
+ views: counterObservation,
1376
+ reactions: counterObservation,
1377
+ comments: counterObservation
1378
+ }))),
1379
+ ...shortMessage.entries,
1380
+ locator: reference
1381
+ });
1382
+ var contactMessages = strictObject({
1383
+ person: strictObject({ uid: id, provider: text, id, name: nullable(text) }),
1384
+ chats: array(strictObject({
1385
+ chat: pick(chat, ["id", "title", "kind"]),
1386
+ messages: array(union([shortMessage, identifiedMessage, fullMessage])),
1387
+ complete: boolean(),
1388
+ more: boolean()
1389
+ })),
1390
+ limits: strictObject({ messages: count })
1391
+ });
1392
+ var contactContext = union([context, contactMessages]);
1393
+ var coverage = strictObject({
1394
+ included: count,
1395
+ has_more: boolean(),
1396
+ cut_by: nullable(picklist(["limit", "bytes"]))
1397
+ });
1398
+ var meetingCue = strictObject({
1399
+ reference,
1400
+ fingerprint: text,
1401
+ transcript_id: count,
1402
+ content_hash: nullable(text),
1403
+ position: count,
1404
+ start_ms: count,
1405
+ end_ms: count,
1406
+ speaker_participant_id: nullable(count),
1407
+ speaker_name: nullable(text),
1408
+ text,
1409
+ revision: picklist(["current", "superseded"])
1410
+ });
1411
+ var contactPreparation = strictObject({
1412
+ ...context.entries,
1413
+ prepare: strictObject({
1414
+ waiting: array(strictObject({
1415
+ provider: text,
1416
+ account: id,
1417
+ chat_id: id,
1418
+ title: nullable(text),
1419
+ message: contextMessage,
1420
+ partial: boolean()
1421
+ })),
1422
+ tasks: array(strictObject({
1423
+ ref: reference,
1424
+ title: text,
1425
+ role: text,
1426
+ due_at: nullable(time),
1427
+ project: reference,
1428
+ source: nullable(reference),
1429
+ created_at: time
1430
+ })),
1431
+ facts: array(strictObject({
1432
+ ref: reference,
1433
+ type: text,
1434
+ statement: text,
1435
+ subject: nullable(reference),
1436
+ project: nullable(reference),
1437
+ updated_at: time
1438
+ })),
1439
+ notes: array(strictObject({ ref: reference, title: nullable(text), text, revision: count, updated_at: time })),
1440
+ meetings: array(strictObject({
1441
+ reference,
1442
+ cues: array(meetingCue),
1443
+ cue_coverage: strictObject({ included: count, omitted: nullable(count), has_more: boolean() })
1444
+ })),
1445
+ limits: strictObject({ items: count, bytes: count }),
1446
+ coverage: strictObject({
1447
+ waiting: strictObject({
1448
+ ...coverage.entries,
1449
+ rule: literal("their message is the newest the store holds in a one-to-one chat")
1450
+ }),
1451
+ tasks: strictObject({
1452
+ ...coverage.entries,
1453
+ selection: literal("open, assigned to them in any role"),
1454
+ accounts: array(text)
1455
+ }),
1456
+ facts: strictObject({
1457
+ ...coverage.entries,
1458
+ selection: literal("accepted, about them or a project they are a member of")
1459
+ }),
1460
+ notes: strictObject({
1461
+ ...coverage.entries,
1462
+ selection: literal("written by you, about them"),
1463
+ withheld: optional(literal("contacts.notes.list"))
1464
+ }),
1465
+ meetings: strictObject({
1466
+ ...coverage.entries,
1467
+ read: literal("every account of the store that saw them"),
1468
+ accounts: array(text),
1469
+ pending: count
1470
+ })
1471
+ })
1472
+ })
1473
+ });
1474
+
1475
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/contact-note.js
1476
+ var contactNote = strictObject({
1477
+ id,
1478
+ /** The contact, as a `contact:` reference. */
1479
+ contact: reference,
1480
+ text,
1481
+ /** Starts at 1; an edit names the revision it read. */
1482
+ revision: count,
1483
+ created_at: time,
1484
+ updated_at: time
1485
+ });
1486
+
1487
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/contact-read.js
1488
+ var contactLookup = strictObject({ id, name: nullable(text), username: nullable(text) });
1489
+ var contactSync = strictObject({ added: count, changed: count, known: count });
1490
+ var contactProfile = strictObject({
1491
+ id,
1492
+ name: nullable(text),
1493
+ usernames: array(text),
1494
+ bio: nullable(text),
1495
+ birthday: optional(nullable(text)),
1496
+ phone: optional(nullable(text)),
1497
+ flags: partial(strictObject({
1498
+ bot: boolean(),
1499
+ verified: boolean(),
1500
+ premium: boolean(),
1501
+ scam: boolean(),
1502
+ fake: boolean(),
1503
+ restricted: boolean(),
1504
+ deleted: boolean(),
1505
+ support: boolean()
1506
+ })),
1507
+ seen: optional(text),
1508
+ contact: optional(boolean()),
1509
+ mutual_contact: optional(boolean()),
1510
+ common_chats_count: optional(nullable(count)),
1511
+ registered: optional(nullable(strictObject({
1512
+ at: text,
1513
+ source: picklist(["telegram", "max", "estimate"]),
1514
+ precision: picklist(["day", "month"])
1515
+ }))),
1516
+ has_photo: optional(boolean()),
1517
+ chats: array(strictObject({
1518
+ id,
1519
+ title: nullable(text),
1520
+ kind: chat.entries.kind,
1521
+ their_messages: count,
1522
+ first_at: nullable(time),
1523
+ last_at: nullable(time),
1524
+ complete: boolean()
1525
+ })),
1526
+ aliases: array(strictObject({
1527
+ name: optional(text),
1528
+ username: optional(text),
1529
+ link: optional(text),
1530
+ first_seen_at: time,
1531
+ last_seen_at: time,
1532
+ source: picklist(["profile", "messages"])
1533
+ }))
1534
+ });
1535
+
1536
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/contact-write.js
1537
+ var addressBookPerson = strictObject({ id, name: nullable(text), username: nullable(text) });
1538
+ var contactUpdate = strictObject({ operation_id: id, person: addressBookPerson });
1539
+ var contactStateChange = strictObject({ operation_id: id, person_id: id });
1540
+ var contactImport = strictObject({ operation_id: id, sent: count, recognised: array(addressBookPerson) });
1541
+
1542
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/conversation-results.js
1543
+ var conversationDetails = union([
1544
+ strictObject({ ...conversation.entries, messages: array(message) }),
1545
+ message
1546
+ ]);
1547
+ var conversationBatchStatus = strictObject({
1548
+ chat: id,
1549
+ messages: count,
1550
+ characters: count,
1551
+ batches: count,
1552
+ tokens_estimate: count
1553
+ });
1554
+ var batchMessage = strictObject({
1555
+ id,
1556
+ at: time,
1557
+ sender: strictObject({ id: nullable(id), name: nullable(text) }),
1558
+ text,
1559
+ reply_to: optional(id),
1560
+ thread: optional(id),
1561
+ mentions: optional(array(id)),
1562
+ answer: boolean(),
1563
+ candidates: optional(array(strictObject({ parent: nullable(id), source: text, kind: text, confidence: number() })))
1564
+ });
1565
+ var conversationBatch = union([
1566
+ strictObject({ batch: null_() }),
1567
+ strictObject({
1568
+ batch: id,
1569
+ chat: id,
1570
+ messages: array(batchMessage),
1571
+ remaining: strictObject({ messages: count, characters: count })
1572
+ })
1573
+ ]);
1574
+ var analyzedConversation = strictObject({
1575
+ chat: id,
1576
+ model: text,
1577
+ batches: count,
1578
+ stored: count,
1579
+ tokens: count,
1580
+ reserved_tokens: count,
1581
+ max_tokens: count,
1582
+ stopped: picklist(["complete", "budget"]),
1583
+ remaining: conversationBatchStatus,
1584
+ built: optional(conversationBuild)
1585
+ });
1586
+ var conversationBuildResult = union([conversationBuild, conversationPreparation, analyzedConversation]);
1587
+ var conversationEmbedding = union([chatEmbedding, conversationPreparation]);
1588
+ var conversationChange = union([
1589
+ strictObject({ chat: id, stored: count }),
1590
+ strictObject({ chat: id, cleared: count })
1591
+ ]);
1592
+ var conversationReadiness = strictObject({
1593
+ chat: id,
1594
+ model: text,
1595
+ state: picklist(["ready", "stale", "partial", "words-only", "not-built"]),
1596
+ graph: nullable(strictObject({ built_at: time, rules_version: nullable(count), outdated_rules: boolean() })),
1597
+ pending: strictObject({ new: count, edited: count, deleted: count }),
1598
+ vectors: strictObject({ chunks: count, current: count, stale: count, missing: count })
1599
+ });
1600
+ var conversationEmbeddingStatus = strictObject({
1601
+ chat: id,
1602
+ model: text,
1603
+ chunks: count,
1604
+ embedded: count,
1605
+ left: count,
1606
+ estimate_seconds: nullable(number()),
1607
+ tokens_at_most: count,
1608
+ price_at_most: optional(strictObject({ usd: number(), read: text }))
1609
+ });
1610
+ var summary = strictObject({
1611
+ id,
1612
+ chat_id: id,
1613
+ first_message_id: id,
1614
+ first_at: time,
1615
+ last_at: time,
1616
+ message_count: count,
1617
+ senders: count,
1618
+ built_at: time,
1619
+ algorithm_version: count
1620
+ });
1621
+ var conversationHit = strictObject({
1622
+ source: optional(strictObject({ provider: text, account: id })),
1623
+ locator: optional(reference),
1624
+ summary,
1625
+ chunk: strictObject({ first_message_id: id, last_message_id: id }),
1626
+ score: nullable(number()),
1627
+ matched_in: optional(literal("context")),
1628
+ by: array(picklist(["meaning", "words"])),
1629
+ stale: boolean()
1630
+ });
1631
+
1632
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/counters.js
1633
+ var counters = strictObject({
1634
+ cutoff: time,
1635
+ max_age_ms: milliseconds,
1636
+ /** Pins exactly these messages for `counters refresh --selection`. */
1637
+ selection: strictObject({
1638
+ kind: literal("counter-targets"),
1639
+ version: literal(1),
1640
+ locators: array(reference)
1641
+ }),
1642
+ rows: array(strictObject({ ref: reference, counters: array(counterReading) }))
1643
+ });
1644
+ var counterRefresh = strictObject({
1645
+ dry_run: boolean(),
1646
+ targets: array(reference),
1647
+ counters: array(text),
1648
+ supported: array(text),
1649
+ unsupported: array(text),
1650
+ max_messages: count,
1651
+ time_ms: milliseconds,
1652
+ results: optional(array(strictObject({
1653
+ ref: reference,
1654
+ updated: array(text),
1655
+ missing: array(text),
1656
+ status: text
1657
+ }))),
1658
+ stopped: optional(text),
1659
+ complete: optional(boolean())
1660
+ });
1661
+
1662
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/document.js
1663
+ var document = strictObject({
1664
+ ref: reference,
1665
+ id,
1666
+ title: nullable(text),
1667
+ url: nullable(text),
1668
+ mime: optional(text),
1669
+ size: optional(count),
1670
+ /** When its source last changed it. */
1671
+ source_modified_at: nullable(time),
1672
+ /** When the store last read it; not the source's time. */
1673
+ stored_at: optional(nullable(time)),
1674
+ owners: optional(array(text))
1675
+ });
1676
+
1677
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/document-link.js
1678
+ var documentLink = strictObject({
1679
+ ref: reference,
1680
+ url: text,
1681
+ document_id: nullable(id),
1682
+ title: nullable(text),
1683
+ in_store: boolean(),
1684
+ sent_at: time,
1685
+ sender: strictObject({ id: nullable(id), name: nullable(text) })
1686
+ });
1687
+
1688
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/evidence.js
1689
+ var evidenceMessage = pick(message, ["ref", "chat_title", "timestamp", "sender_name", "text"]);
1690
+ var contribution = strictObject({
1691
+ message: evidenceMessage,
1692
+ related: optional(evidenceMessage),
1693
+ contribution: nullable(number()),
1694
+ counters: optional(array(counterReading))
1695
+ });
1696
+ var retentionStay = strictObject({
1697
+ person_ref: reference,
1698
+ joined_at: time,
1699
+ cohort: text,
1700
+ checkpoints: array(strictObject({
1701
+ checkpoint_ms: milliseconds,
1702
+ target_at: time,
1703
+ state: text,
1704
+ observed_at: nullable(time),
1705
+ lag_ms: nullable(milliseconds),
1706
+ complete: boolean()
1707
+ })),
1708
+ activity: strictObject({
1709
+ state: text,
1710
+ first_message_at: nullable(time),
1711
+ window_end: nullable(time),
1712
+ archive_covered: boolean()
1713
+ }),
1714
+ departure: strictObject({ after: nullable(time), at_or_before: nullable(time), early: text })
1715
+ });
1716
+ var evidence = union([contribution, retentionStay]);
1717
+
1718
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/fact.js
1719
+ var fact = strictObject({
1720
+ ref: reference,
1721
+ id,
1722
+ kind: picklist(FACT_TYPES),
1723
+ text,
1724
+ status: picklist(FACT_STATUSES),
1725
+ project: nullable(text),
1726
+ subject: nullable(reference),
1727
+ occurred_at: nullable(time),
1728
+ supersedes: nullable(reference),
1729
+ author,
1730
+ model: nullable(text),
1731
+ /** Who accepted it; `null` while it is proposed. */
1732
+ confirmed_by: optional(nullable(strictObject({ type: picklist(["person", "bot"]), id }))),
1733
+ scope: nullable(picklist(MEMORY_SCOPES)),
1734
+ /** Who recorded it: the owner, or an agent whose fact waits as proposed. */
1735
+ origin: picklist(["owner", "agent"]),
1736
+ evidence: array(reference),
1737
+ created_at: time,
1738
+ updated_at: time
1739
+ });
1740
+
1741
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/hit.js
1742
+ var hit = strictObject({
1743
+ kind: picklist(["message", "mail", "note", "document", "event", "meeting"]),
1744
+ ref: reference,
1745
+ provider: text,
1746
+ url: optional(text),
1747
+ /** The account it was found in; a note's folder id, or `internal` for a note written in memo. */
1748
+ account: text,
1749
+ /** The chat, the mail thread's subject, the note's, the event's or the meeting's title. */
1750
+ title: nullable(text),
1751
+ /** Null for a meeting whose start is unknown. */
1752
+ timestamp: nullable(time),
1753
+ excerpt: text,
1754
+ sender_name: optional(nullable(text)),
1755
+ /** The writer's `person:` reference, where the store has one. */
1756
+ sender_ref: optional(nullable(reference)),
1757
+ found_by: optional(array(picklist(["title", "words", "meaning"]))),
1758
+ /** How far into the meeting the passage is. */
1759
+ offset_ms: optional(nullable(count)),
1760
+ /** A meeting passage's place: its transcript, chat or summary. */
1761
+ scope: optional(picklist(["transcript", "chat", "summary"])),
1762
+ /** A meeting passage's stored line, so two passages of one meeting stay apart; `search meetings` gives the same. */
1763
+ id: optional(pipe(string(), minLength(1))),
1764
+ /** Absent on a note hit: the owner wrote it. */
1765
+ untrusted
1766
+ });
1767
+
1768
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/identity.js
1769
+ var identity = strictObject({
1770
+ ref: reference,
1771
+ provider: text,
1772
+ account: text,
1773
+ /** The messenger's own id for them. */
1774
+ id,
1775
+ name: nullable(text),
1776
+ username: nullable(text),
1777
+ /** The `person:` they are linked to, when one is. */
1778
+ person: optional(nullable(reference))
1779
+ });
1780
+
1781
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/image-embedding.js
1782
+ var imageEmbedding = strictObject({
1783
+ model: text,
1784
+ embedded: count,
1785
+ skipped: count,
1786
+ failed: count,
1787
+ more: boolean()
1788
+ });
1789
+
1790
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/join-request.js
1791
+ var joinRequest = strictObject({
1792
+ person_id: id,
1793
+ name: nullable(text),
1794
+ username: nullable(text),
1795
+ /** `null` where the messenger does not say. */
1796
+ requested_at: nullable(time),
1797
+ /** The note they sent with the request. */
1798
+ about: optional(text)
1799
+ });
1800
+
1801
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/poll-vote.js
1802
+ var pollVote = strictObject({
1803
+ person_id: id,
1804
+ name: nullable(text),
1805
+ username: nullable(text),
1806
+ /** Answer ids, as `polls show` prints them. */
1807
+ answers: array(id),
1808
+ voted_at: time
1809
+ });
1810
+
1811
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/listener.js
1812
+ var reactions = unwrap(unwrap(message.entries.reactions));
1813
+ var observation = strictObject({
1814
+ value: pipe(number(), minValue(0)),
1815
+ observed_at: time,
1816
+ source: picklist(["remote_fetch", "remote_update"]),
1817
+ reactions: optional(reactions)
1818
+ });
1819
+ var watchedMessage = strictObject({
1820
+ ...message.entries,
1821
+ starred: optional(boolean()),
1822
+ counter_observations: optional(partial(strictObject({ views: observation, reactions: observation, comments: observation })))
1823
+ });
1824
+ var target = { chat_id: id, chat_title: nullable(text), message_id: id };
1825
+ var messageEvent = variant("event", [
1826
+ strictObject({ event: picklist(["message", "edit"]), message: watchedMessage }),
1827
+ strictObject({ event: literal("delete"), ...target, chat_id: nullable(id) }),
1828
+ strictObject({ event: literal("reaction"), ...target, reactions, counter_observation: optional(observation) }),
1829
+ strictObject({ event: literal("vote"), ...target, vote: pollVote }),
1830
+ strictObject({
1831
+ event: literal("person_reaction"),
1832
+ ...target,
1833
+ reaction: strictObject({ person: member, own: boolean(), reaction: nullable(text), reacted_at: time })
1834
+ }),
1835
+ strictObject({ event: literal("star"), ...target, starred: boolean() }),
1836
+ strictObject({ event: literal("delivery"), ...target, delivery: unwrap(message.entries.delivery), at: time }),
1837
+ strictObject({ event: literal("chat_event"), chat_id: id, chat_title: nullable(text), change: chatEvent })
1838
+ ]);
1839
+ var watchItem = union([watchedMessage, messageEvent]);
1840
+ var totals = record(text, count);
1841
+ var serveSummary = strictObject({
1842
+ profile: text,
1843
+ started_at: time,
1844
+ stopped_at: time,
1845
+ kept: totals,
1846
+ replies: optional(strictObject({ sent: totals, skipped: totals, tasks: optional(totals) })),
1847
+ members: optional(strictObject({ fetched: count, failed: count })),
1848
+ stems: optional(strictObject({ stemmed: count })),
1849
+ tasks: optional(strictObject({ added: count, closed: count, review: count }))
1850
+ });
1851
+
1852
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/media-archive.js
1853
+ var mediaArchive = strictObject({
1854
+ directory: text,
1855
+ chats: count,
1856
+ saved: count,
1857
+ existing: count,
1858
+ complete: boolean()
1859
+ });
1860
+ var mediaArchiveCheck = strictObject({
1861
+ valid: boolean(),
1862
+ checked: count,
1863
+ files: array(strictObject({ path: text, valid: boolean(), archive_directory: optional(text) }))
1864
+ });
1865
+ var mediaArchiveMove = strictObject({
1866
+ directory: text,
1867
+ archive_directory: text,
1868
+ before_time: time,
1869
+ selected: count,
1870
+ selected_bytes: count,
1871
+ moved: count,
1872
+ moved_bytes: count,
1873
+ already_archived: count,
1874
+ undated: count,
1875
+ complete: boolean(),
1876
+ dry_run: boolean()
1877
+ });
1878
+ var timer = { name: text, installed: boolean(), service_path: text, timer_path: text };
1879
+ var mediaArchiveTimer = union([
1880
+ strictObject({ ...timer, active: boolean() }),
1881
+ strictObject({ ...timer, action: picklist(["install", "start", "stop", "uninstall"]) })
1882
+ ]);
1883
+
1884
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/meeting-preparation-parts.js
1885
+ var preparationId = pipe(string(), minLength(1));
1886
+ var preparationCount = pipe(number(), integer(), minValue(0));
1887
+ var preparationTime = nullable(isoTime);
1888
+ var text2 = nullable(string());
1889
+ var id2 = preparationId;
1890
+ var count2 = preparationCount;
1891
+ var page = /* @__PURE__ */ __name((item) => strictObject({ items: array(item), has_more: boolean() }), "page");
1892
+ var preparationUpcoming = strictObject({
1893
+ scope: strictObject({ provider: id2, account: id2 }),
1894
+ meeting_id: id2,
1895
+ kind: picklist(["single", "recurring", "unscheduled", "unknown"]),
1896
+ after: isoTime,
1897
+ until: isoTime,
1898
+ timezone: text2,
1899
+ verified_next: boolean(),
1900
+ candidate: nullable(strictObject({
1901
+ id: text2,
1902
+ start_at: preparationTime,
1903
+ end_at: preparationTime,
1904
+ status: picklist(["scheduled", "cancelled"]),
1905
+ verified: boolean()
1906
+ })),
1907
+ coverage: strictObject({
1908
+ schedule_complete: boolean(),
1909
+ inspected: count2,
1910
+ undated: count2,
1911
+ unverified: count2,
1912
+ cancelled: count2,
1913
+ simultaneous: count2,
1914
+ missing: array(picklist(["schedule-details", "occurrence-details"]))
1915
+ })
1916
+ });
1917
+ var preparationCue = strictObject({
1918
+ ref: reference,
1919
+ fingerprint: id2,
1920
+ transcript_id: id2,
1921
+ content_hash: text2,
1922
+ position: count2,
1923
+ offset_ms: count2,
1924
+ end_ms: count2,
1925
+ speaker_participant_id: nullable(id2),
1926
+ speaker_name: text2,
1927
+ text: string(),
1928
+ revision: picklist(["current", "superseded"])
1929
+ });
1930
+ var preparationEvidence = strictObject({
1931
+ schema_version: literal(1),
1932
+ kind: literal("meeting"),
1933
+ source: reference,
1934
+ fingerprint: id2,
1935
+ limits: strictObject({ cues: count2, bytes: count2, max_read_bytes: count2, max_transcript_pages: count2 }),
1936
+ content_bytes: count2,
1937
+ coverage: strictObject({
1938
+ provided: count2,
1939
+ included: count2,
1940
+ omitted: nullable(count2),
1941
+ provided_exact: boolean(),
1942
+ next_transcript_id: nullable(id2),
1943
+ next_reference: nullable(reference),
1944
+ transcript_pages: count2,
1945
+ skipped_unavailable: count2,
1946
+ has_more: boolean(),
1947
+ truncated_by: nullable(picklist(["cues", "bytes", "transcripts"])),
1948
+ input: literal("bounded-meeting-pages"),
1949
+ archive_completeness: literal("unknown")
1950
+ }),
1951
+ items: array(preparationCue)
1952
+ });
1953
+ var preparationContext = strictObject({
1954
+ participants: page(strictObject({ id: id2, identity_id: id2, display_name: text2, person_uid: nullable(id2) })),
1955
+ projects: page(strictObject({ ref: reference, key: id2, name: string(), link_id: id2 })),
1956
+ facts: page(strictObject({ ref: reference, type: id2, statement: string(), updated_at: isoTime })),
1957
+ tasks: page(strictObject({
1958
+ ref: reference,
1959
+ key: id2,
1960
+ title: string(),
1961
+ status: id2,
1962
+ priority: nullable(count2),
1963
+ source: nullable(reference)
1964
+ }))
1965
+ });
1966
+ var preparationMeeting = strictObject({
1967
+ id: id2,
1968
+ external_id: id2,
1969
+ title: text2,
1970
+ event_id: nullable(id2),
1971
+ started_at: preparationTime,
1972
+ ended_at: preparationTime,
1973
+ updated_at: isoTime
1974
+ });
1975
+
1976
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/meeting-evidence.js
1977
+ var meetingEvidence = preparationEvidence;
1978
+ var meetingPersonContext = strictObject({
1979
+ person: strictObject({ uid: string(), name: nullable(string()) }),
1980
+ items: array(strictObject({
1981
+ ref: reference,
1982
+ cues: array(preparationCue),
1983
+ cue_coverage: strictObject({ included: preparationCount, omitted: nullable(preparationCount), has_more: boolean() })
1984
+ })),
1985
+ limits: strictObject({ meetings: preparationCount, cues: preparationCount, bytes: preparationCount, scan_limit: preparationCount }),
1986
+ content_bytes: preparationCount,
1987
+ coverage: strictObject({
1988
+ involvements_scanned: preparationCount,
1989
+ scan_limit_reached: boolean(),
1990
+ pending: preparationCount,
1991
+ truncated_by: nullable(picklist(["meetings", "bytes"])),
1992
+ skipped_unavailable: preparationCount,
1993
+ complete: literal(false),
1994
+ input: literal("bounded-meeting-pages")
1995
+ })
1996
+ });
1997
+
1998
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/meeting-findings.js
1999
+ var evidence2 = strictObject({ reference, fingerprint: text });
2000
+ var base = { id, project: reference, evidence: array(evidence2) };
2001
+ var finding = variant("kind", [
2002
+ strictObject({ ...base, kind: literal("fact"), type: picklist(FACT_TYPES), statement: text }),
2003
+ strictObject({
2004
+ ...base,
2005
+ kind: literal("task"),
2006
+ type: picklist(WORK_TASK_TYPES),
2007
+ title: text,
2008
+ reason: text,
2009
+ commitment: picklist(["explicit", "inferred"]),
2010
+ due_at: optional(time),
2011
+ due_evidence: optional(array(reference)),
2012
+ assignee: optional(reference),
2013
+ assignee_evidence: optional(array(reference))
2014
+ })
2015
+ ]);
2016
+ var outcome = strictObject({
2017
+ id,
2018
+ fingerprint: text,
2019
+ status: picklist(["accepted", "rejected"]),
2020
+ reference: nullable(reference),
2021
+ reused: boolean()
2022
+ });
2023
+ var meetingFindings = strictObject({
2024
+ id,
2025
+ account: strictObject({ provider: text, account: text }),
2026
+ input: strictObject({ schema_version: literal(1), key: text, extractor: text, findings: array(finding) }),
2027
+ fingerprint: text,
2028
+ status: picklist(["proposed", "reviewed"]),
2029
+ author,
2030
+ decided_by: nullable(strictObject({ type: picklist(["person", "bot"]), id })),
2031
+ decided_at: nullable(time),
2032
+ previous: array(outcome),
2033
+ receipt: nullable(strictObject({ preview_fingerprint: text, accepted: array(id), items: array(outcome) }))
2034
+ });
2035
+
2036
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/meeting-communications.js
2037
+ var communicationCoverage = strictObject({
2038
+ read_usage: strictObject({ reads: preparationCount, charged_bytes: preparationCount, reserved_bytes: preparationCount, remaining_bytes: preparationCount }),
2039
+ query: string(),
2040
+ window: strictObject({ after: isoTime, before: isoTime }),
2041
+ selection: literal("explicit-host-grants/literal-words"),
2042
+ sources: array(strictObject({
2043
+ selection_id: preparationId,
2044
+ source: strictObject({
2045
+ kind: picklist(["message", "mail", "document"]),
2046
+ account_id: preparationId,
2047
+ provider: preparationId,
2048
+ account: preparationId
2049
+ }),
2050
+ state: picklist(["searched", "unavailable", "read-limited"]),
2051
+ index: picklist(["ready", "pending", "missing", "unknown"]),
2052
+ has_more: boolean(),
2053
+ has_undated: boolean(),
2054
+ completeness: literal("unknown"),
2055
+ consistency: literal("snapshot-per-page"),
2056
+ next_cursor: nullable(string()),
2057
+ restart_required: boolean(),
2058
+ output_limited: boolean(),
2059
+ read_bytes: nullable(preparationCount),
2060
+ issue: nullable(picklist(["not_found", "validation_error", "configuration_error"]))
2061
+ }))
2062
+ });
2063
+ var preparationCommunications = strictObject({
2064
+ coverage: communicationCoverage,
2065
+ items: array(strictObject({
2066
+ selection_id: preparationId,
2067
+ ref: reference,
2068
+ provider: preparationId,
2069
+ account: preparationId,
2070
+ title: nullable(string()),
2071
+ url: nullable(string()),
2072
+ text: string(),
2073
+ at: isoTime,
2074
+ updated_at: isoTime,
2075
+ revision: nullable(pipe(number(), safeInteger(), minValue(1))),
2076
+ time_kind: picklist(["sent", "source-modified", "stored-update"]),
2077
+ text_truncated: boolean()
2078
+ }))
2079
+ });
2080
+
2081
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/meeting-preparation.js
2082
+ var meetingPreparation = strictObject({
2083
+ communications: optional(preparationCommunications),
2084
+ schema_version: literal(1),
2085
+ kind: literal("meeting_preparation"),
2086
+ account_id: preparationId,
2087
+ upcoming: preparationUpcoming,
2088
+ series: nullable(strictObject({
2089
+ id: preparationId,
2090
+ external_id: preparationId,
2091
+ title: nullable(string()),
2092
+ event_series_id: nullable(preparationId),
2093
+ updated_at: isoTime
2094
+ })),
2095
+ history_window: strictObject({ after: isoTime, before: isoTime }),
2096
+ meetings: array(strictObject({
2097
+ ref: reference,
2098
+ meeting: preparationMeeting,
2099
+ evidence: preparationEvidence,
2100
+ context: preparationContext
2101
+ })),
2102
+ related: strictObject({
2103
+ anchors: array(reference),
2104
+ items: array(strictObject({
2105
+ ref: reference,
2106
+ meeting: preparationMeeting,
2107
+ evidence: preparationEvidence,
2108
+ shared_person: boolean(),
2109
+ shared_project: boolean()
2110
+ })),
2111
+ has_more: boolean(),
2112
+ output_limited: boolean(),
2113
+ selection: literal("explicit-person-links/confirmed-project-links")
2114
+ }),
2115
+ knowledge: optional(strictObject({
2116
+ anchors: array(reference),
2117
+ items: array(strictObject({
2118
+ ref: reference,
2119
+ type: picklist(["fact", "statement", "question", "decision", "promise"]),
2120
+ statement: string(),
2121
+ subject: nullable(reference),
2122
+ project: nullable(reference),
2123
+ updated_at: isoTime,
2124
+ shared_person: boolean(),
2125
+ shared_project: boolean()
2126
+ })),
2127
+ selection: literal("accepted-global-person/project-facts"),
2128
+ coverage: strictObject({
2129
+ has_more: boolean(),
2130
+ output_limited: boolean(),
2131
+ fact_evidence: literal("not-revalidated"),
2132
+ other_sources: picklist(["not-queried", "see-communications"])
2133
+ })
2134
+ })),
2135
+ notes: optional(strictObject({
2136
+ anchors: array(reference),
2137
+ items: array(strictObject({
2138
+ ref: reference,
2139
+ title: nullable(string()),
2140
+ text: string(),
2141
+ revision: pipe(number(), safeInteger(), minValue(1)),
2142
+ updated_at: isoTime,
2143
+ person: nullable(reference),
2144
+ project: nullable(reference),
2145
+ meeting: optional(nullable(reference))
2146
+ })),
2147
+ selection: picklist([
2148
+ "owner-written-global-person/project-notes",
2149
+ "owner-written-meeting/person/project-notes"
2150
+ ]),
2151
+ coverage: strictObject({
2152
+ has_more: boolean(),
2153
+ output_limited: boolean(),
2154
+ source_evidence: literal("not-revalidated"),
2155
+ other_sources: picklist(["not-queried", "see-communications"])
2156
+ })
2157
+ })),
2158
+ project_evidence: optional(strictObject({
2159
+ project: string(),
2160
+ query: string(),
2161
+ pages: array(meetingProjectEvidence),
2162
+ continuation: nullable(strictObject({
2163
+ command: literal("meetings projects evidence"),
2164
+ project: string(),
2165
+ query: string(),
2166
+ cursor: nullable(string()),
2167
+ limit: preparationCount,
2168
+ max_read_bytes: preparationCount
2169
+ })),
2170
+ coverage: strictObject({ page_limit: preparationCount, has_more: boolean(), output_limited: boolean() })
2171
+ })),
2172
+ limits: strictObject({ meetings: preparationCount, cues: preparationCount, context_limit: preparationCount, max_read_bytes: preparationCount, bytes: preparationCount }),
2173
+ coverage: strictObject({
2174
+ archive_completeness: literal("unknown"),
2175
+ consistency: literal("live-reads"),
2176
+ history_has_more: boolean(),
2177
+ has_undated: boolean(),
2178
+ skipped_unavailable: array(reference),
2179
+ output_limited: boolean(),
2180
+ context: literal("observed-participants/confirmed-projects/accepted-meeting-subject-facts/direct-source-tasks"),
2181
+ fact_evidence: literal("not-revalidated"),
2182
+ unqueried: array(picklist([
2183
+ "person-history",
2184
+ "project-wide-context",
2185
+ "person-nonmeeting-context",
2186
+ "project-nonmeeting-context",
2187
+ "project-alias-candidates",
2188
+ "other-person-nonmeeting-context",
2189
+ "other-project-nonmeeting-context"
2190
+ ]))
2191
+ })
2192
+ });
2193
+
2194
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/meeting-project-candidates.js
2195
+ var count3 = pipe(number(), integer(), minValue(0));
2196
+ var id3 = pipe(string(), minLength(1));
2197
+ var text3 = string();
2198
+ var meetingProjectCandidates = strictObject({
2199
+ schema_version: literal(1),
2200
+ kind: literal("meeting_project_candidates"),
2201
+ source: strictObject({ provider: text3, account: text3, account_id: id3, ref: reference }),
2202
+ input_fingerprint: id3,
2203
+ vocabulary_fingerprint: id3,
2204
+ association: literal("unconfirmed-literal-evidence"),
2205
+ items: array(strictObject({
2206
+ project: strictObject({ ref: reference, id: id3, name: text3, key: nullable(text3) }),
2207
+ matches: array(strictObject({
2208
+ term: strictObject({
2209
+ name: text3,
2210
+ kind: picklist(["canonical", "key", "alias"]),
2211
+ alias_id: optional(id3)
2212
+ }),
2213
+ ambiguous: boolean(),
2214
+ source: strictObject({
2215
+ kind: picklist(["metadata-title", "transcript"]),
2216
+ ref: reference,
2217
+ fingerprint: nullable(id3),
2218
+ revision: nullable(picklist(["current", "superseded"]))
2219
+ })
2220
+ })),
2221
+ omitted_matches: count3
2222
+ })),
2223
+ limits: strictObject({ limit: count3, max_projects: count3, max_vocabulary_read_bytes: count3, bytes: count3 }),
2224
+ coverage: strictObject({
2225
+ selection: literal("explicit-host-evidence/global-project-vocabulary"),
2226
+ source_evidence: literal("not-revalidated"),
2227
+ association: literal("unconfirmed-literal-evidence"),
2228
+ archive_completeness: literal("unknown"),
2229
+ omitted_matches: count3,
2230
+ candidates_total: count3,
2231
+ has_more: boolean(),
2232
+ output_limited: boolean(),
2233
+ matching: literal("unicode-normalized-literal-word-boundaries")
2234
+ }),
2235
+ evidence: strictObject({
2236
+ fingerprint: id3,
2237
+ limits: strictObject({ cues: count3, bytes: count3, max_read_bytes: count3, max_transcript_pages: count3 }),
2238
+ coverage: strictObject({
2239
+ provided: count3,
2240
+ included: count3,
2241
+ omitted: nullable(count3),
2242
+ provided_exact: boolean(),
2243
+ next_cursor: nullable(reference),
2244
+ next_transcript_id: nullable(id3),
2245
+ next_reference: nullable(reference),
2246
+ transcript_pages: count3,
2247
+ skipped_unavailable: count3,
2248
+ has_more: boolean(),
2249
+ truncated_by: nullable(picklist(["cues", "bytes", "transcripts"])),
2250
+ input: literal("bounded-meeting-pages"),
2251
+ archive_completeness: literal("unknown")
2252
+ }),
2253
+ consistency: literal("live-reads"),
2254
+ max_store_calls: literal(8)
2255
+ })
2256
+ });
2257
+
2258
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/meeting-series-inventory.js
2259
+ var count4 = pipe(number(), integer(), minValue(0));
2260
+ var id4 = pipe(string(), minLength(1), maxLength(1e3));
2261
+ var meetingSeriesInventory = strictObject({
2262
+ schema_version: literal(1),
2263
+ kind: literal("meeting_series_inventory"),
2264
+ scope: strictObject({ provider: id4, account: id4 }),
2265
+ after: isoTime,
2266
+ until: isoTime,
2267
+ items: array(strictObject({
2268
+ meeting_id: id4,
2269
+ title: nullable(pipe(string(), maxLength(8192))),
2270
+ kind: picklist(["single", "recurring", "unscheduled", "unknown"]),
2271
+ scheduled_start_at: nullable(isoTime)
2272
+ })),
2273
+ page: pageSchema,
2274
+ fingerprint: pipe(string(), minLength(1), maxLength(200)),
2275
+ limits: strictObject({ limit: count4, max_read_bytes: count4, bytes: count4 }),
2276
+ coverage: strictObject({
2277
+ selection: picklist(["provider-window", "provider-inventory"]),
2278
+ source_partial: boolean(),
2279
+ has_more: boolean(),
2280
+ undated: count4,
2281
+ date_hints_outside_window: count4,
2282
+ calendar_completeness: literal("unknown"),
2283
+ occurrence_proof: literal("not-read"),
2284
+ consistency: literal("live-provider-pages")
2285
+ })
2286
+ });
2287
+
2288
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/meeting-task-proposal.js
2289
+ var text4 = string();
2290
+ var id5 = pipe(number(), integer(), minValue(1));
2291
+ var revision = picklist(["current", "superseded"]);
2292
+ var meetingTaskProposal = strictObject({
2293
+ id: text4,
2294
+ source: reference,
2295
+ source_kind: literal("meeting"),
2296
+ group: reference,
2297
+ account_id: id5,
2298
+ kind: picklist(TASK_KINDS),
2299
+ preview: nullable(text4),
2300
+ revision: nullable(revision),
2301
+ applied: literal(false),
2302
+ persistence: literal("proposal-only")
2303
+ });
2304
+
2305
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/memory.js
2306
+ var memory = strictObject({
2307
+ ref: reference,
2308
+ id,
2309
+ kind: picklist(MEMORY_KINDS),
2310
+ text,
2311
+ subject: nullable(reference),
2312
+ author,
2313
+ model: nullable(text),
2314
+ confidence: nullable(number()),
2315
+ status: picklist(MEMORY_STATUSES),
2316
+ scope: picklist(MEMORY_SCOPES),
2317
+ supersedes: nullable(reference),
2318
+ evidence: array(reference),
2319
+ last_verified_at: nullable(time),
2320
+ created_at: time,
2321
+ updated_at: time
2322
+ });
2323
+
2324
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/mention.js
2325
+ var kind = picklist(["phone", "email", "url", "document", "person-name", "place"]);
2326
+ var status = picklist(["found", "linked", "dismissed"]);
2327
+ var mention = strictObject({
2328
+ id: count,
2329
+ kind,
2330
+ value: text,
2331
+ domain: nullable(text),
2332
+ confidence: number(),
2333
+ status,
2334
+ field: text,
2335
+ author: nullable(text),
2336
+ target: nullable(reference),
2337
+ sent_at: time,
2338
+ found_at: time,
2339
+ written: text,
2340
+ locator: reference
2341
+ });
2342
+ var mentionDetails = strictObject({
2343
+ ...mention.entries,
2344
+ before: text,
2345
+ after: text,
2346
+ same_value: count,
2347
+ candidates: array(reference)
2348
+ });
2349
+ var mentionDomain = strictObject({ domain: text, links: count, chats: count, first_at: time, last_at: time });
2350
+ var place = strictObject({ id: count, address: text, mentions: count });
2351
+ var mentionDecision = strictObject({
2352
+ kind,
2353
+ value: text,
2354
+ status,
2355
+ target: nullable(reference),
2356
+ mentions: count
2357
+ });
2358
+ var mentionRebuild = strictObject({
2359
+ messages: count,
2360
+ attachments: count,
2361
+ documents: count,
2362
+ notes: count,
2363
+ emails: count,
2364
+ mentions: count
2365
+ });
2366
+
2367
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/message-change.js
2368
+ var operated3 = { operation_id: id, chat_id: id };
2369
+ var messagePin = strictObject({ ...operated3, message_id: id, pinned: boolean() });
2370
+ var messageStar = strictObject({ ...operated3, message_id: id, starred: boolean() });
2371
+ var messageDeletion = strictObject({ ...operated3, deleted: array(id), for_everyone: boolean() });
2372
+
2373
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/message-read.js
2374
+ var messageTranscript = strictObject({
2375
+ message_id: id,
2376
+ text,
2377
+ pending: boolean(),
2378
+ via: text,
2379
+ model: optional(text)
2380
+ });
2381
+ var conversationLink = strictObject({
2382
+ parent_id: nullable(id),
2383
+ source: picklist(["provider", "rule", "agent"]),
2384
+ kind: text,
2385
+ confidence: number(),
2386
+ method: text,
2387
+ version: nullable(text),
2388
+ created_at: time,
2389
+ stale: boolean(),
2390
+ chosen: boolean()
2391
+ });
2392
+ var messageLinks = strictObject({
2393
+ chat: id,
2394
+ message: id,
2395
+ links: array(conversationLink),
2396
+ chain: array(id)
2397
+ });
2398
+ var fingerprint2 = pipe(text, regex(/^[a-f0-9]{64}$/));
2399
+ var evidencePacket = strictObject({
2400
+ schema_version: literal(1),
2401
+ id,
2402
+ kind: picklist(["chats", "news", "person"]),
2403
+ source: strictObject({ provider: text, account: id, chat: id }),
2404
+ fingerprint: fingerprint2,
2405
+ limits: strictObject({ messages: count, bytes: count }),
2406
+ content_bytes: count,
2407
+ coverage: strictObject({
2408
+ provided: count,
2409
+ included: count,
2410
+ omitted: count,
2411
+ has_more: boolean(),
2412
+ history: literal("unknown"),
2413
+ truncated_by: nullable(picklist(["messages", "bytes"]))
2414
+ }),
2415
+ items: array(strictObject({
2416
+ locator: reference,
2417
+ fingerprint: fingerprint2,
2418
+ timestamp: time,
2419
+ edited_at: nullable(time),
2420
+ sender_id: nullable(id),
2421
+ sender_name: nullable(text),
2422
+ sender_is_chat: boolean(),
2423
+ outgoing: nullable(boolean()),
2424
+ text,
2425
+ reply_to: nullable(reference),
2426
+ thread_id: nullable(id),
2427
+ attachment_kinds: array(text)
2428
+ }))
2429
+ });
2430
+
2431
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/message-context.js
2432
+ var messageThread = strictObject({
2433
+ ref: reference,
2434
+ chat: id,
2435
+ message: id,
2436
+ mode: picklist(["thread", "time"]),
2437
+ fallback: optional(picklist(["not_built", "not_stored", "not_linked"])),
2438
+ items: array(message),
2439
+ links: array(strictObject({ ...conversationLink.entries, message_id: id })),
2440
+ chain: array(id),
2441
+ stale: boolean(),
2442
+ built_at: nullable(time),
2443
+ stopped: array(picklist(["hops", "messages", "bytes", "time", "links", "cycle", "aborted", "thread"])),
2444
+ bounds: strictObject({ max_hops: count, max_messages: count, max_bytes: count, within_ms: count })
2445
+ });
2446
+ var messageContext = union([message, messageThread]);
2447
+
2448
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/message-counts.js
2449
+ var messageCounts = strictObject({
2450
+ by: picklist(["chat", "sender", "day", "hour"]),
2451
+ total: count,
2452
+ rows: array(strictObject({
2453
+ /** The chat or sender id, or the calendar day or hour. */
2454
+ key: text,
2455
+ ref: optional(reference),
2456
+ name: nullable(text),
2457
+ count
2458
+ }))
2459
+ });
2460
+
2461
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/message-link.js
2462
+ var messageLink = strictObject({
2463
+ ref: reference,
2464
+ url: nullable(text),
2465
+ access: picklist(["public", "restricted", "unknown", "unavailable"]),
2466
+ /** Why there is no link. */
2467
+ reason: nullable(picklist(["unsupported_chat", "unsupported_provider", "offline"]))
2468
+ });
2469
+
2470
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/message-write.js
2471
+ var messageWrite = strictObject({
2472
+ operation_id: id,
2473
+ message,
2474
+ /** An album's messages, in order; `message` is the first. Absent for a single message. */
2475
+ messages: optional(array(message)),
2476
+ scheduled_for: optional(time)
2477
+ });
2478
+ var draftWrite = strictObject({
2479
+ operation_id: id,
2480
+ chat_id: id,
2481
+ saved: literal(true)
2482
+ });
2483
+ var messageSend = union([messageWrite, draftWrite]);
2484
+
2485
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/model.js
2486
+ var model = strictObject({
2487
+ id,
2488
+ kind: picklist(["audio", "text", "image", "reranker"]),
2489
+ title: text,
2490
+ /** Which languages it reads, in words. */
2491
+ languages: text,
2492
+ licence: optional(text),
2493
+ /** What its files take on disk once downloaded. */
2494
+ size_bytes: count,
2495
+ downloaded: boolean(),
2496
+ /** The one used when no model is named. */
2497
+ default: boolean(),
2498
+ /** The folder its files are in once downloaded, so an agent can place them by hand. */
2499
+ path: text
2500
+ });
2501
+
2502
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/model-key.js
2503
+ var source = picklist(["environment", "keyring", "file"]);
2504
+ var modelKey = strictObject({
2505
+ provider: text,
2506
+ stored: optional(source),
2507
+ removed: optional(array(source))
2508
+ });
2509
+ var storedModelKey = strictObject({ ...omit(modelKey, ["removed"]).entries, stored: source });
2510
+ var removedModelKey = strictObject({ ...omit(modelKey, ["stored"]).entries, removed: array(source) });
2511
+
2512
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/official-stats.js
2513
+ var versus = strictObject({ current: number(), previous: number() });
2514
+ var person = { person_ref: reference, name: nullable(text) };
2515
+ var graph = strictObject({
2516
+ kind: text,
2517
+ x: strictObject({ type: picklist(["date", "time", "number"]), values: array(union([text, number()])) }),
2518
+ series: array(strictObject({ key: text, name: text, kind: text, values: array(number()) })),
2519
+ stacked: optional(boolean()),
2520
+ percentage: optional(boolean())
2521
+ });
2522
+ var officialStats = strictObject({
2523
+ chat_id: id,
2524
+ title: text,
2525
+ kind: picklist(["group", "channel"]),
2526
+ since: time,
2527
+ until: time,
2528
+ totals: record(string(), versus),
2529
+ top: optional(strictObject({
2530
+ posters: array(strictObject({ ...person, messages: count, average_chars: number() })),
2531
+ admins: array(strictObject({ ...person, deleted: count, removed: count, banned: count })),
2532
+ inviters: array(strictObject({ ...person, invited: count }))
2533
+ })),
2534
+ notifications: optional(strictObject({ enabled: count, total: count })),
2535
+ recent_posts: optional(array(strictObject({
2536
+ kind: picklist(["message", "story"]),
2537
+ id,
2538
+ views: count,
2539
+ forwards: count,
2540
+ reactions: count
2541
+ }))),
2542
+ /** A graph the messenger did not give is `{ error }`; the others still answer. */
2543
+ graphs: record(string(), union([graph, strictObject({ error: text })]))
2544
+ });
2545
+
2546
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/person.js
2547
+ var person2 = strictObject({
2548
+ ref: reference,
2549
+ name: nullable(text),
2550
+ identities: optional(array(identity))
2551
+ });
2552
+
2553
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/poll.js
2554
+ var poll = strictObject({
2555
+ chat_id: id,
2556
+ message_id: id,
2557
+ question: text,
2558
+ answers: array(strictObject({ id, text, voters: nullable(count), chosen: boolean() })),
2559
+ closed: boolean(),
2560
+ multiple: boolean(),
2561
+ anonymous: boolean(),
2562
+ voters: nullable(count),
2563
+ quiz: optional(boolean()),
2564
+ revote: optional(boolean()),
2565
+ creator: optional(boolean())
2566
+ });
2567
+ var pollChange = strictObject({ operation_id: id, poll });
2568
+
2569
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/private-contact.js
2570
+ var contactAlias = strictObject({ person_id: id, alias: nullable(text) });
2571
+ var contactNoteRemoval = strictObject({ id, person_id: id, removed: boolean() });
2572
+
2573
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/ranking.js
2574
+ var figures = record(string(), number());
2575
+ var freshness = picklist(["fresh", "stale", "partial", "unknown"]);
2576
+ var rankingRow = strictObject({
2577
+ rank: count,
2578
+ /** The message's locator, or the author's `contact:` reference. */
2579
+ ref: reference,
2580
+ /** The message or person id, as `stats * evidence` takes it. */
2581
+ id,
2582
+ chat_ref: optional(reference),
2583
+ name: nullable(text),
2584
+ /** A message's kind (`posts`, `comments`); null for authors. */
2585
+ kind: nullable(text),
2586
+ value: number(),
2587
+ components: record(string(), nullable(number())),
2588
+ messages: count,
2589
+ known_reactions: count,
2590
+ unknown_reactions: count,
2591
+ reactions: optional(array(strictObject({ reaction: string(), count }))),
2592
+ score: nullable(strictObject({ score: number(), normalized: figures, contributions: figures })),
2593
+ quality: strictObject({
2594
+ reactions: picklist(["known", "partial", "unknown"]),
2595
+ graph: picklist(["complete", "partial", "not_used"]),
2596
+ counter_freshness: freshness
2597
+ }),
2598
+ counters: optional(array(counterReading)),
2599
+ selection
2600
+ });
2601
+ var ranking = strictObject({
2602
+ target: picklist(["messages", "contacts"]),
2603
+ measure: text,
2604
+ order: picklist(["ascending", "descending"]),
2605
+ preset: nullable(text),
2606
+ weights: nullable(figures),
2607
+ min_messages: count,
2608
+ message_kind: text,
2609
+ /** Messages the query selected. */
2610
+ total: count,
2611
+ population: count,
2612
+ eligible: count,
2613
+ excluded: strictObject({ minimum: count, missing: count, unknown_sender: count, unknown_kind: count }),
2614
+ maxima: figures,
2615
+ counter_freshness: freshness,
2616
+ expanded_discussion_chats: optional(array(text)),
2617
+ rows: array(rankingRow)
2618
+ });
2619
+
2620
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/reaction-change.js
2621
+ var reactionChange = strictObject({
2622
+ operation_id: id,
2623
+ chat_id: id,
2624
+ message_id: id,
2625
+ reaction: nullable(text)
2626
+ });
2627
+
2628
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/recipient.js
2629
+ var recipient = strictObject({ id, title: nullable(text), partner_id: optional(id), added_at: time });
2630
+ var recipientAdded = strictObject({ id, title: nullable(text), added: boolean() });
2631
+ var recipientRemoved = strictObject({ id, title: nullable(text), removed: boolean() });
2632
+ var recipientOff = strictObject({ off: boolean(), was_on: boolean() });
2633
+ var recipientChange = strictObject({
2634
+ ...partial(recipientAdded).entries,
2635
+ ...partial(recipientRemoved).entries,
2636
+ ...partial(recipientOff).entries
2637
+ });
2638
+
2639
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/recorded-run.js
2640
+ var events = array(record(string(), unknown()));
2641
+ var recordedRun = strictObject({
2642
+ run_id: id,
2643
+ command: text,
2644
+ profile: optional(text),
2645
+ started_at: time,
2646
+ completed_at: optional(time),
2647
+ status: picklist(["success", "failed", "partial", "running"]),
2648
+ requests: optional(count),
2649
+ duration_ms: optional(count),
2650
+ cli_version: text,
2651
+ runtime: optional(text),
2652
+ platform: optional(text),
2653
+ arch: optional(text),
2654
+ error_code: optional(text),
2655
+ partial: optional(strictObject({
2656
+ failed: count,
2657
+ stop_reason: optional(text),
2658
+ failures: array(strictObject({ id: text, stage: text, error_code: text, attachment: optional(count) }))
2659
+ })),
2660
+ provider_error: optional(text),
2661
+ kept_because_failed: optional(boolean()),
2662
+ operations: optional(array(text)),
2663
+ codes: optional(array(text)),
2664
+ trace_id: optional(id),
2665
+ cli_command: optional(text),
2666
+ argv: optional(array(text)),
2667
+ unknown_command: optional(text),
2668
+ agent: optional(strictObject({
2669
+ kind: text,
2670
+ session_id: nullable(text),
2671
+ from_chat: optional(literal(true)),
2672
+ client: optional(strictObject({ name: text, version: optional(text), id: optional(text) }))
2673
+ })),
2674
+ via: optional(picklist(["cli", "mcp-stdio", "mcp-http", "desktop"])),
2675
+ mcp: optional(strictObject({
2676
+ tool: text,
2677
+ request_id: optional(text),
2678
+ connection_id: optional(text),
2679
+ proxied: optional(literal(true))
2680
+ })),
2681
+ events_dropped: optional(count),
2682
+ error: optional(strictObject({
2683
+ class: text,
2684
+ code: optional(text),
2685
+ reason: optional(text),
2686
+ message: optional(text),
2687
+ operation: optional(text),
2688
+ http: optional(strictObject({ method: optional(text), endpoint_template: optional(text), status: optional(count) })),
2689
+ provider: optional(strictObject({ key: optional(text), code: optional(number()) })),
2690
+ causes: optional(array(strictObject({ class: text, message: optional(text) }))),
2691
+ stack: optional(array(text))
2692
+ })),
2693
+ directory: optional(text),
2694
+ event_count: optional(count),
2695
+ events: optional(events),
2696
+ events_truncated: optional(boolean())
2697
+ });
2698
+ var runDetails = strictObject({
2699
+ ...omit(recordedRun, ["events_truncated"]).entries,
2700
+ directory: text,
2701
+ event_count: count,
2702
+ events
2703
+ });
2704
+ var runHit = strictObject({
2705
+ ...omit(recordedRun, ["directory", "event_count"]).entries,
2706
+ events,
2707
+ events_truncated: boolean()
2708
+ });
2709
+ var runLocation = strictObject({ path: text });
2710
+
2711
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/relationship.js
2712
+ var relationship = strictObject({
2713
+ id,
2714
+ from: reference,
2715
+ to: reference,
2716
+ kind: picklist(RELATION_KINDS),
2717
+ role: nullable(text),
2718
+ evidence: nullable(text),
2719
+ /** An agent's suggestion stays unconfirmed, and `weak`, until the owner confirms it. */
2720
+ confirmed: boolean(),
2721
+ provenance: nullable(text),
2722
+ confidence_category: picklist(["owner-confirmed", "weak"]),
2723
+ created_at: time
2724
+ });
2725
+
2726
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/retention.js
2727
+ var retentionCohort = strictObject({
2728
+ /** The first day of the joining day or week. */
2729
+ cohort: text,
2730
+ stays: count,
2731
+ checkpoints: array(strictObject({
2732
+ age_ms: milliseconds,
2733
+ eligible: count,
2734
+ observable: count,
2735
+ present: count,
2736
+ absent: count,
2737
+ unknown: count,
2738
+ pending: count,
2739
+ rate: nullable(number())
2740
+ })),
2741
+ activity: strictObject({ observed: count, no_observed: count, pending: count, archive_covered: count }),
2742
+ early_departure: strictObject({ observed: count, not_observed: count, unknown: count, pending: count }),
2743
+ selection
2744
+ });
2745
+ var retention = strictObject({
2746
+ chat_ref: reference,
2747
+ cutoff: time,
2748
+ since: time,
2749
+ until: time,
2750
+ checkpoints_ms: array(milliseconds),
2751
+ within_ms: milliseconds,
2752
+ by: picklist(["day", "week"]),
2753
+ timezone: text,
2754
+ /** Cohorts found; `rows` holds the first `--limit` of them. */
2755
+ total: count,
2756
+ unknown_join: count,
2757
+ eligible_stays: count,
2758
+ quality: strictObject({
2759
+ membership: text,
2760
+ tolerance_ms: milliseconds,
2761
+ archive: nullable(strictObject({
2762
+ state: text,
2763
+ up_to_date: nullable(boolean()),
2764
+ gaps: boolean(),
2765
+ reaches_start: boolean(),
2766
+ fetched_at: nullable(time)
2767
+ })),
2768
+ continuous_survival: boolean(),
2769
+ group_silent_rate: nullable(number())
2770
+ }),
2771
+ rows: array(retentionCohort)
2772
+ });
2773
+
2774
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/saved-search.js
2775
+ var savedSearch = strictObject({
2776
+ id,
2777
+ /** `null` for a run in the history. */
2778
+ name: nullable(text),
2779
+ command: picklist(["search", "stats", "message-top", "author-top", "admin-statistics", "meetings-search"]),
2780
+ /** The query and the options it runs with, as the command took them. */
2781
+ params: record(string(), unknown()),
2782
+ language: text,
2783
+ version: count,
2784
+ fields_version: count,
2785
+ created_at: time,
2786
+ last_run_at: nullable(time),
2787
+ runs: count
2788
+ });
2789
+ var searchHistoryClear = strictObject({ cleared: count });
2790
+
2791
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/send-attempt.js
2792
+ var sendAttempt = strictObject({
2793
+ at: time,
2794
+ profile: text,
2795
+ chat_id: nullable(id),
2796
+ outcome: picklist(["sent", "outcome_unknown", "refused", "failed", "reserved"]),
2797
+ kind: optional(picklist(["message", "reaction", "edit", "forward", "pin", "read", "delete", "chat", "account"])),
2798
+ action: optional(text),
2799
+ people: optional(count),
2800
+ message_id: optional(id),
2801
+ key: optional(text),
2802
+ count: optional(count),
2803
+ for_everyone: optional(boolean()),
2804
+ operation_id: optional(id),
2805
+ parent_operation_id: optional(id),
2806
+ reply_to: optional(id),
2807
+ thread_id: optional(id),
2808
+ send_as: optional(id),
2809
+ result_chat_id: optional(id),
2810
+ length: optional(count),
2811
+ attachments: optional(array(strictObject({ kind: picklist(["photo", "file", "video", "voice", "sticker"]), bytes: count }))),
2812
+ scheduled_for: optional(time),
2813
+ notify: optional(boolean()),
2814
+ origin: optional(text),
2815
+ reservation: optional(id),
2816
+ error_code: optional(text)
2817
+ });
2818
+
2819
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/store-maintenance.js
2820
+ var absent = strictObject({ path: text, exists: literal(false) });
2821
+ var schema = strictObject({ version: count, min_compatible: count, writable: boolean(), speaks: count });
2822
+ var infoSchema = strictObject({
2823
+ ...schema.entries,
2824
+ reason: picklist(["missing", "older", "current", "newer", "too_new"]),
2825
+ upgrade: nullable(strictObject({ version: count, min_compatible: count }))
2826
+ });
2827
+ var client = strictObject({ command: text, version: text, core: text, speaks: count, seen_at: time });
2828
+ var wordIndex = strictObject({
2829
+ watermark: count,
2830
+ filled_through: count,
2831
+ pending_normalization: count,
2832
+ ready: boolean(),
2833
+ terms_through: count,
2834
+ newest: count,
2835
+ terms_ready: boolean(),
2836
+ built_at: nullable(time)
2837
+ });
2838
+ var stemIndex = strictObject({
2839
+ watermark: count,
2840
+ filled_through: count,
2841
+ pending: count,
2842
+ built: nullable(text),
2843
+ wanted: text,
2844
+ ready: boolean(),
2845
+ cause: optional(picklist(["building", "stemmer_changed", "stemmer_unknown"])),
2846
+ built_at: nullable(time)
2847
+ });
2848
+ var readFailure = { path: text, exists: literal(true), opens: literal(false), error: text };
2849
+ var rows = partial(strictObject({
2850
+ accounts: count,
2851
+ chats: count,
2852
+ messages: count,
2853
+ emails: count,
2854
+ documents: count,
2855
+ meetings: count,
2856
+ events: count,
2857
+ attachments: count,
2858
+ identities: count
2859
+ }));
2860
+ var perAccount = { chats: count, messages: count, emails: count, documents: count, meetings: count };
2861
+ var contents = {
2862
+ by_provider: optional(array(strictObject({ provider: text, accounts: count, ...perAccount }))),
2863
+ by_chat_kind: optional(array(strictObject({ provider: text, kind: text, chats: count, messages: count }))),
2864
+ /** `name` is the one `account list` shows; the messenger's own id for the account is left out. */
2865
+ by_account: optional(array(strictObject({ provider: text, account_id: count, name: nullable(text), ...perAccount }))),
2866
+ /** Calendar years in UTC. */
2867
+ by_year: optional(array(strictObject({ provider: text, year: count, messages: count }))),
2868
+ /** `type` is what the file is attached to: a message, an email, a document… `bytes` counts the sizes known. */
2869
+ by_attachment_kind: optional(array(strictObject({ type: text, kind: text, count, bytes: count })))
2870
+ };
2871
+ var storeInfo = union([
2872
+ strictObject({ ...absent.entries, schema: infoSchema }),
2873
+ strictObject({ ...readFailure, schema: strictObject({ speaks: count }) }),
2874
+ strictObject({
2875
+ path: text,
2876
+ exists: literal(true),
2877
+ bytes: strictObject({ file: count, wal: count }),
2878
+ journal_mode: text,
2879
+ /** `free` pages hold nothing; a `VACUUM` would give them back. */
2880
+ pages: strictObject({ size: count, count, free: count }),
2881
+ migrations: array(strictObject({ version: count, min_compatible: count, applied_at: time })),
2882
+ /** From the marker a backup job leaves in `backups/last.json` beside the store; null without one. */
2883
+ backup: nullable(strictObject({ at: time, file: nullable(text), checked: nullable(text) })),
2884
+ schema: infoSchema,
2885
+ clients: array(client),
2886
+ rows,
2887
+ pending_normalization: nullable(count),
2888
+ word_index: nullable(wordIndex),
2889
+ stem_index: nullable(stemIndex),
2890
+ ...contents
2891
+ })
2892
+ ]);
2893
+ var storeCheck = union([
2894
+ strictObject({ ...absent.entries, ok: literal(true) }),
2895
+ strictObject({ ...readFailure, ok: literal(false) }),
2896
+ strictObject({
2897
+ path: text,
2898
+ exists: literal(true),
2899
+ opens: literal(true),
2900
+ ok: boolean(),
2901
+ checks: strictObject({
2902
+ schema: boolean(),
2903
+ integrity: boolean(),
2904
+ foreign_keys: boolean(),
2905
+ search_indexes: boolean(),
2906
+ vector_indexes: boolean(),
2907
+ disk: boolean()
2908
+ }),
2909
+ schema,
2910
+ integrity: array(text),
2911
+ foreign_key_violations: count,
2912
+ search_indexes: record(text, text),
2913
+ disk: strictObject({ free: count, needed: count }),
2914
+ pending_normalization: nullable(count),
2915
+ word_index: nullable(wordIndex),
2916
+ stem_index: nullable(stemIndex),
2917
+ chats_behind: array(strictObject({
2918
+ provider: text,
2919
+ account: text,
2920
+ chat: text,
2921
+ title: nullable(text),
2922
+ newest: time,
2923
+ held: nullable(time),
2924
+ refreshed: time
2925
+ })),
2926
+ orphan_pointers: array(strictObject({ table: text, pointer: text, type: text, count, known: boolean() })),
2927
+ conversations: array(strictObject({
2928
+ provider: text,
2929
+ account: text,
2930
+ chat: text,
2931
+ title: nullable(text),
2932
+ built_at: nullable(time),
2933
+ rules_version: nullable(count),
2934
+ current: boolean(),
2935
+ stale_agent_links: count
2936
+ })),
2937
+ vectors: nullable(strictObject({ models: record(text, count), unused: count })),
2938
+ vector_indexes: array(strictObject({
2939
+ model: text,
2940
+ dims: count,
2941
+ ready: boolean(),
2942
+ indexed: count,
2943
+ expected: count,
2944
+ missing: count,
2945
+ extra: count
2946
+ }))
2947
+ })
2948
+ ]);
2949
+ var indexed = { normalized: count, indexed: count, terms: count, stemmed: count, notes_indexed: count };
2950
+ var storeMigration = union([
2951
+ absent,
2952
+ strictObject({ path: text, exists: literal(true), from: count, to: count, ...indexed })
2953
+ ]);
2954
+ var storeReindex = union([
2955
+ absent,
2956
+ strictObject({
2957
+ path: text,
2958
+ exists: literal(true),
2959
+ ...indexed,
2960
+ file_texts: count,
2961
+ involvements: count,
2962
+ unused_vectors_dropped: count
2963
+ })
2964
+ ]);
2965
+ var storeBackup = strictObject({
2966
+ path: text,
2967
+ from: text,
2968
+ bytes: count,
2969
+ schema: count,
2970
+ rows: strictObject({ chats: count, messages: count }),
2971
+ encrypted: optional(literal(true))
2972
+ });
2973
+ var storeDecrypt = strictObject({ path: text, from: text, bytes: count });
2974
+ var storeRestore = strictObject({
2975
+ path: text,
2976
+ restored_from: text,
2977
+ kept_at: nullable(text),
2978
+ schema: count
2979
+ });
2980
+ var storeReset = union([
2981
+ strictObject({ ...absent.entries, reset: literal(false) }),
2982
+ strictObject({
2983
+ path: text,
2984
+ exists: literal(true),
2985
+ reset: literal(false),
2986
+ dry_run: literal(true),
2987
+ files: array(text),
2988
+ bytes: count,
2989
+ schema: count,
2990
+ tables: array(strictObject({ name: text, rows: count })),
2991
+ backup_first: boolean(),
2992
+ in_use: nullable(boolean())
2993
+ }),
2994
+ strictObject({
2995
+ path: text,
2996
+ exists: literal(true),
2997
+ reset: literal(true),
2998
+ backup: nullable(text),
2999
+ backed_up: nullable(strictObject({ schema: count, rows: partial(strictObject({ chats: count, messages: count })) })),
3000
+ schema: count
3001
+ })
3002
+ ]);
3003
+ var storeRepair = union([
3004
+ absent,
3005
+ strictObject({
3006
+ path: text,
3007
+ dry_run: boolean(),
3008
+ repaired: array(strictObject({
3009
+ table: text,
3010
+ action: picklist(["created", "columns-added", "rebuilt"]),
3011
+ columns_added: optional(array(text)),
3012
+ copy: optional(text),
3013
+ rows_in_copy: optional(count),
3014
+ rows_copied: optional(count),
3015
+ only_in_copy: optional(array(text)),
3016
+ dropped_from_copy: optional(array(text))
3017
+ })),
3018
+ indexes_created: array(text),
3019
+ triggers_created: array(text),
3020
+ mismatches: array(strictObject({ table: text, what: text })),
3021
+ foreign_key_violations: array(strictObject({ table: text, rows: count })),
3022
+ copies: array(strictObject({ name: text, rows: count }))
3023
+ })
3024
+ ]);
3025
+ var storeCopyRemoval = strictObject({ path: text, deleted: strictObject({ name: text, rows: count }) });
3026
+
3027
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/tag-change.js
3028
+ var tagTarget = variant("type", [
3029
+ strictObject({ type: literal("chat"), chat_id: id }),
3030
+ strictObject({ type: literal("contact"), person_id: id }),
3031
+ strictObject({ type: literal("message"), chat_id: id, message_id: id, locator: reference }),
3032
+ strictObject({ type: literal("task"), task_id: id })
3033
+ ]);
3034
+ var receipt = { target: tagTarget, unchanged: array(text) };
3035
+ var tagChange = union([
3036
+ strictObject({ ...receipt, added: array(text) }),
3037
+ strictObject({ ...receipt, removed: array(text) })
3038
+ ]);
3039
+ var automaticTags = strictObject({
3040
+ items: array(union([
3041
+ strictObject({
3042
+ chat_id: id,
3043
+ tags: array(strictObject({
3044
+ tag: text,
3045
+ score: number(),
3046
+ fields: array(picklist(["title", "username", "description"]))
3047
+ })),
3048
+ algorithm: text,
3049
+ fetched_at: nullable(time),
3050
+ source: picklist(["metadata", "stored-chat"])
3051
+ }),
3052
+ strictObject({ chat_id: id, error: strictObject({ code: text, message: text }) })
3053
+ ])),
3054
+ has_more: boolean(),
3055
+ dry_run: boolean()
3056
+ });
3057
+
3058
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/task-pair.js
3059
+ var side = strictObject({ ref: reference, key: text, title: text, status: text });
3060
+ var taskPair = strictObject({
3061
+ task: nullable(side),
3062
+ source: nullable(reference),
3063
+ other: side,
3064
+ score: number(),
3065
+ band: picklist(["likely", "maybe", "different"]),
3066
+ levels: strictObject({
3067
+ text: picklist(["high", "middle", "low"]),
3068
+ person: picklist(["same", "different", "unknown"]),
3069
+ amount: picklist(["equal", "different", "missing"]),
3070
+ category: picklist(["same", "different", "unknown"]),
3071
+ due: picklist(["near", "far", "missing"]),
3072
+ reply: picklist(["yes", "no"]),
3073
+ time: picklist(["near", "weeks", "far"])
3074
+ }),
3075
+ reasons: array(text),
3076
+ decision: picklist(["review", "unsure", "merged", "rejected", "unmerged", "attached", "new"]),
3077
+ decided_at: nullable(time),
3078
+ created_at: time
3079
+ });
3080
+
3081
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/task-results.js
3082
+ var nullableTime = nullable(time);
3083
+ var link = strictObject({
3084
+ id,
3085
+ from: reference,
3086
+ to: nullable(reference),
3087
+ kind: picklist(LINK_KINDS),
3088
+ anchor: nullable(text),
3089
+ origin: picklist(LINK_SOURCES),
3090
+ target_text: nullable(text),
3091
+ role: nullable(text),
3092
+ evidence: nullable(text),
3093
+ provenance: nullable(text),
3094
+ confirmed: boolean(),
3095
+ created_at: time
3096
+ });
3097
+ var taskCard = strictObject({
3098
+ id,
3099
+ ref: reference,
3100
+ key: text,
3101
+ project: reference,
3102
+ title: text,
3103
+ description: nullable(text),
3104
+ type: picklist(TASK_TYPES),
3105
+ status: picklist(TASK_STATES),
3106
+ priority: nullable(number()),
3107
+ parent: nullable(reference),
3108
+ source: nullable(text),
3109
+ due_at: nullableTime,
3110
+ next_check_at: nullableTime,
3111
+ closed_at: nullableTime,
3112
+ reason: nullable(text),
3113
+ verdict: nullable(picklist(TASK_VERDICTS)),
3114
+ category: nullable(text),
3115
+ claimed_by: nullable(text),
3116
+ claimed_until: nullableTime,
3117
+ close_certainty: nullable(number()),
3118
+ close_suggestion: nullable(closeSuggestion),
3119
+ assignments: array(strictObject({ to: reference, role: picklist(["assignee", "reviewer", "watcher"]) })),
3120
+ created_at: time,
3121
+ updated_at: time,
3122
+ links: array(link),
3123
+ linked_from: array(link)
3124
+ });
3125
+ var taskView = strictObject({
3126
+ id,
3127
+ source: text,
3128
+ source_kind: text,
3129
+ account: text,
3130
+ group: text,
3131
+ kind: picklist(TASK_KINDS),
3132
+ state: picklist(TASK_STATES),
3133
+ reason: optional(text),
3134
+ origin: picklist(TASK_ORIGINS),
3135
+ created_at: time,
3136
+ due_at: optional(time),
3137
+ closed_at: optional(time),
3138
+ closed_by: optional(picklist(TASK_ORIGINS)),
3139
+ key: optional(text),
3140
+ category: optional(text),
3141
+ claimed_by: optional(text),
3142
+ claimed_until: optional(time),
3143
+ message: nullable(strictObject({ sender_name: nullable(text), text, timestamp: time })),
3144
+ note: optional(nullable(strictObject({ id, title: nullable(text), text, updated_at: time })))
3145
+ });
3146
+ var taskCreated = strictObject({
3147
+ ...taskView.entries,
3148
+ created: boolean(),
3149
+ attached: optional(literal(true)),
3150
+ review: optional(count),
3151
+ follow_up_of: optional(taskPair.entries.other),
3152
+ card: optional(taskCard)
3153
+ });
3154
+ var taskClosed = strictObject({
3155
+ ...taskView.entries,
3156
+ close_certainty: nullable(number()),
3157
+ close_suggestion: nullable(closeSuggestion)
3158
+ });
3159
+ var taskLinks = union([
3160
+ strictObject({ ...taskCard.entries, review: optional(count) }),
3161
+ strictObject({
3162
+ relations: array(strictObject({
3163
+ id,
3164
+ from: reference,
3165
+ to: reference,
3166
+ kind: picklist(["blocked-by", "follow-up-of", "related-to", "duplicate-of", "discovered-from"])
3167
+ }))
3168
+ })
3169
+ ]);
3170
+ var taskSimilar = strictObject({
3171
+ ref: reference,
3172
+ key: text,
3173
+ title: text,
3174
+ status: text,
3175
+ created_at: time,
3176
+ found_by: array(picklist(["text", "person", "category", "reply"])),
3177
+ score: number(),
3178
+ band: taskPair.entries.band,
3179
+ levels: taskPair.entries.levels,
3180
+ reasons: array(text),
3181
+ text: strictObject({ shared_stems: count, all_stems: count, stems: number(), trigrams: number() })
3182
+ });
3183
+ var taskMerge = strictObject({ pair: taskPair, linked: count, review: count, task: taskCard });
3184
+ var taskUnmerge = strictObject({ pair: taskPair, task: taskCard });
3185
+ var taskCategories = strictObject({
3186
+ categories: array(strictObject({
3187
+ name: text,
3188
+ meaning: text,
3189
+ triggers: strictObject({ en: array(text), ru: array(text), es: array(text) })
3190
+ })),
3191
+ unlisted: array(strictObject({ name: text, open: count, total: count })),
3192
+ file: nullable(text)
3193
+ });
3194
+ var taskScan = strictObject({
3195
+ chat: text,
3196
+ messages: count,
3197
+ added: count,
3198
+ closed: count,
3199
+ review: count,
3200
+ held: optional(count),
3201
+ held_chats: optional(count),
3202
+ tasks: array(strictObject({ source: text, kind: picklist(TASK_KINDS), category: nullable(text) }))
3203
+ });
3204
+
3205
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/topic.js
3206
+ var topic = strictObject({
3207
+ id,
3208
+ title: text,
3209
+ closed: boolean(),
3210
+ pinned: boolean(),
3211
+ /** The General topic only, where the messenger says. */
3212
+ hidden: optional(boolean()),
3213
+ unread_count: nullable(count),
3214
+ last_message_at: nullable(time),
3215
+ created_at: nullable(time),
3216
+ untrusted
3217
+ });
3218
+
3219
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_9d12b0091b773232c527328da5835651/node_modules/@wirecat/cli-core/dist/entities/index.js
3220
+ var ENTITIES = {
3221
+ sync_progress: progress,
3222
+ ...MEETING_RESULT_ENTITIES,
3223
+ message,
3224
+ message_context: messageContext,
3225
+ message_download: messageDownload,
3226
+ message_sync: messageSync,
3227
+ "message.hit": strictObject({
3228
+ ...pick(message, [
3229
+ "ref",
3230
+ "chat_title",
3231
+ "timestamp",
3232
+ "sender_name",
3233
+ "excerpt",
3234
+ "matched_in",
3235
+ "score",
3236
+ "match",
3237
+ "corrections",
3238
+ "found_in",
3239
+ "discovery",
3240
+ "context",
3241
+ "email"
3242
+ ]).entries,
3243
+ untrusted
3244
+ }),
3245
+ "message.summary": pick(message, [
3246
+ "ref",
3247
+ "chat_id",
3248
+ "chat_title",
3249
+ "timestamp",
3250
+ "sender_name",
3251
+ "outgoing",
3252
+ "text",
3253
+ "transcript",
3254
+ "attachments"
3255
+ ]),
3256
+ message_link: messageLink,
3257
+ message_write: messageWrite,
3258
+ message_send: messageSend,
3259
+ message_pin: messagePin,
3260
+ message_star: messageStar,
3261
+ message_deletion: messageDeletion,
3262
+ message_transcript: messageTranscript,
3263
+ message_links: messageLinks,
3264
+ evidence_packet: evidencePacket,
3265
+ chat_metadata: cachedChatMetadata,
3266
+ chat_metadata_refresh: chatMetadataRefresh,
3267
+ chat,
3268
+ mention,
3269
+ "mention.details": mentionDetails,
3270
+ mention_domain: mentionDomain,
3271
+ mention_decision: mentionDecision,
3272
+ mention_rebuild: mentionRebuild,
3273
+ place,
3274
+ person: person2,
3275
+ identity,
3276
+ contact_context: contactContext,
3277
+ contact_preparation: contactPreparation,
3278
+ contact_activity: contactActivity,
3279
+ contact_check: contactCheck,
3280
+ linked_person: linkedPerson,
3281
+ contact,
3282
+ contact_note: contactNote,
3283
+ contact_lookup: contactLookup,
3284
+ contact_profile: contactProfile,
3285
+ contact_sync: contactSync,
3286
+ contact_update: contactUpdate,
3287
+ contact_state_change: contactStateChange,
3288
+ contact_import: contactImport,
3289
+ contact_alias: contactAlias,
3290
+ contact_note_removal: contactNoteRemoval,
3291
+ account,
3292
+ account_session: accountSession,
3293
+ account_change: accountChange,
3294
+ ended_account_sessions: endedAccountSessions,
3295
+ account_privacy: accountPrivacy,
3296
+ account_privacy_change: accountPrivacyChange,
3297
+ account_profile: accountProfile,
3298
+ organization,
3299
+ project,
3300
+ reminder,
3301
+ bot_profile: botProfile,
3302
+ bot_template: botTemplate,
3303
+ bot_seen_chat: botSeenChat,
3304
+ bot_admin: botAdmin,
3305
+ bot_menu_entry: botMenuEntry,
3306
+ bot_webhook: botWebhook,
3307
+ scheduled_job: scheduledJob,
3308
+ call_record: callRecord,
3309
+ sticker_inventory: stickerInventory,
3310
+ note,
3311
+ "note.hit": strictObject({
3312
+ ...pick(note, [
3313
+ "kind",
3314
+ "provider",
3315
+ "account",
3316
+ "url",
3317
+ "ref",
3318
+ "source",
3319
+ "folder_id",
3320
+ "path",
3321
+ "title",
3322
+ "updated_at",
3323
+ "excerpt",
3324
+ "found_by",
3325
+ "links"
3326
+ ]).entries,
3327
+ untrusted
3328
+ }),
3329
+ hit,
3330
+ document,
3331
+ document_link: documentLink,
3332
+ image_embedding: imageEmbedding,
3333
+ attachment,
3334
+ attachment_bytes: attachmentBytes,
3335
+ attachment_extraction: attachmentExtraction,
3336
+ attachment_text_change: attachmentTextChange,
3337
+ media_archive: mediaArchive,
3338
+ media_archive_check: mediaArchiveCheck,
3339
+ media_archive_move: mediaArchiveMove,
3340
+ media_archive_timer: mediaArchiveTimer,
3341
+ task,
3342
+ task_pair: taskPair,
3343
+ task_card: taskCard,
3344
+ task_created: taskCreated,
3345
+ task_closed: taskClosed,
3346
+ task_links: taskLinks,
3347
+ task_similar: taskSimilar,
3348
+ task_merge: taskMerge,
3349
+ task_unmerge: taskUnmerge,
3350
+ task_categories: taskCategories,
3351
+ task_scan: taskScan,
3352
+ fact,
3353
+ memory,
3354
+ meeting,
3355
+ meeting_details: meetingDetails,
3356
+ meeting_hit: meetingHit,
3357
+ meeting_series_inventory: meetingSeriesInventory,
3358
+ meeting_project_candidates: meetingProjectCandidates,
3359
+ meeting_project_evidence: meetingProjectEvidence,
3360
+ meeting_preparation: meetingPreparation,
3361
+ meeting_findings: meetingFindings,
3362
+ meeting_transcript: meetingTranscript,
3363
+ meeting_summary: meetingSummary,
3364
+ meeting_evidence: meetingEvidence,
3365
+ meeting_person_context: meetingPersonContext,
3366
+ event,
3367
+ meeting_review: meetingReview,
3368
+ meeting_link: meetingLink,
3369
+ meeting_stats: meetingStats,
3370
+ meeting_speaker: meetingSpeaker,
3371
+ meeting_participants: meetingParticipants,
3372
+ meeting_passage: meetingPassage,
3373
+ meeting_task_proposal: meetingTaskProposal,
3374
+ reference,
3375
+ relationship,
3376
+ recipient,
3377
+ recipient_change: recipientChange,
3378
+ "recipient_change.added": recipientAdded,
3379
+ "recipient_change.removed": recipientRemoved,
3380
+ "recipient_change.off": recipientOff,
3381
+ run: recordedRun,
3382
+ "run.details": runDetails,
3383
+ "run.hit": runHit,
3384
+ run_location: runLocation,
3385
+ tag_change: tagChange,
3386
+ automatic_tags: automaticTags,
3387
+ send_attempt: sendAttempt,
3388
+ tagging,
3389
+ "conversation.details": conversationDetails,
3390
+ conversation_build: conversationBuildResult,
3391
+ conversation_batch_status: conversationBatchStatus,
3392
+ conversation_batch: conversationBatch,
3393
+ conversation_change: conversationChange,
3394
+ conversation_readiness: conversationReadiness,
3395
+ conversation_embedding: conversationEmbedding,
3396
+ conversation_embedding_status: conversationEmbeddingStatus,
3397
+ conversation_preparation: conversationPreparation,
3398
+ conversation_hit: conversationHit,
3399
+ conversation,
3400
+ saved_search: savedSearch,
3401
+ search_history_clear: searchHistoryClear,
3402
+ watch_item: watchItem,
3403
+ serve_summary: serveSummary,
3404
+ job,
3405
+ store_chat_status: storeChatStatus,
3406
+ store_clear: storeClear,
3407
+ store_export: storeExport,
3408
+ store_gap_plan: storeGapPlan,
3409
+ store_gap_repair: storeGapRepair,
3410
+ store_job_details: storeJobDetails,
3411
+ store_job_cancel: storeJobCancel,
3412
+ store_job_retry: storeJobRetry,
3413
+ store_job_clear: storeJobClear,
3414
+ store_info: storeInfo,
3415
+ store_check: storeCheck,
3416
+ store_migration: storeMigration,
3417
+ store_reindex: storeReindex,
3418
+ store_backup: storeBackup,
3419
+ store_decrypt: storeDecrypt,
3420
+ store_restore: storeRestore,
3421
+ store_reset: storeReset,
3422
+ store_repair: storeRepair,
3423
+ store_copy_removal: storeCopyRemoval,
3424
+ store_table: storeTable,
3425
+ agenda,
3426
+ model,
3427
+ chat_group_change: chatGroupChange,
3428
+ chat_inspection: chatInspection,
3429
+ chat_sender: chatSender,
3430
+ chat_read: chatRead,
3431
+ chat_members_fetch: chatMembersFetch,
3432
+ chat_members_change: chatMembersChange,
3433
+ chat_invite: chatInvite,
3434
+ chat_invite_change: chatInviteChange,
3435
+ chat_request_change: chatRequestChange,
3436
+ chat_admin_change: chatAdminChange,
3437
+ chat_folder_change: chatFolderChange,
3438
+ chat_folder_removal: chatFolderRemoval,
3439
+ chat_folder_order: chatFolderOrder,
3440
+ chat_rules: chatRules,
3441
+ chat_moderation: chatModeration,
3442
+ model_key: modelKey,
3443
+ "model_key.stored": storedModelKey,
3444
+ "model_key.removed": removedModelKey,
3445
+ chat_event: chatEvent,
3446
+ chat_removal: chatRemoval,
3447
+ chat_muting: chatMuting,
3448
+ chat_archive: chatArchive,
3449
+ chat_pin: chatPin,
3450
+ chat_unread: chatUnread,
3451
+ invite_link: inviteLink,
3452
+ join_request: joinRequest,
3453
+ member,
3454
+ poll,
3455
+ poll_change: pollChange,
3456
+ poll_vote: pollVote,
3457
+ reaction_change: reactionChange,
3458
+ topic,
3459
+ folder,
3460
+ message_counts: messageCounts,
3461
+ ranking,
3462
+ admin_report: adminReport,
3463
+ analysis_consent: analysisConsent,
3464
+ analysis_consent_revocation: analysisConsentRevocation,
3465
+ retention,
3466
+ evidence,
3467
+ counters,
3468
+ counter_refresh: counterRefresh,
3469
+ official_stats: officialStats,
3470
+ chart,
3471
+ chat_stats: chatStats,
3472
+ tracked_chat: trackedChat,
3473
+ tracked_chat_history: trackedChatHistory,
3474
+ chat_tracking: chatTracking,
3475
+ task_stats: taskStats
3476
+ };
3477
+ var entityDefinitions = /* @__PURE__ */ __name(() => Object.fromEntries(Object.entries(ENTITIES).map(([name, schema2]) => {
3478
+ const { $schema: _, ...definition } = jsonSchemaOf(schema2);
3479
+ return [name, definition];
3480
+ })), "entityDefinitions");
3481
+
3482
+ export {
3483
+ member,
3484
+ chat,
3485
+ botProfile,
3486
+ botSeenChat,
3487
+ botAdmin,
3488
+ botMenuEntry,
3489
+ botWebhook,
3490
+ scheduledJob,
3491
+ callRecord,
3492
+ stickerInventory,
3493
+ spawnDetached,
3494
+ jobsDir,
3495
+ saveJob,
3496
+ readJob,
3497
+ tracedJob,
3498
+ jobStarted,
3499
+ finishJob,
3500
+ updateJob,
3501
+ removeJob,
3502
+ listJobs,
3503
+ jobDetails,
3504
+ jobItem,
3505
+ stateOf,
3506
+ startArchiveJob,
3507
+ job,
3508
+ message,
3509
+ accountSession,
3510
+ accountProfile,
3511
+ analysisConsent,
3512
+ folder,
3513
+ inviteLink,
3514
+ chatEvent,
3515
+ contact,
3516
+ contactNote,
3517
+ documentLink,
3518
+ joinRequest,
3519
+ pollVote,
3520
+ meetingPreparation,
3521
+ meetingProjectCandidates,
3522
+ meetingSeriesInventory,
3523
+ model,
3524
+ recipient,
3525
+ recordedRun,
3526
+ savedSearch,
3527
+ sendAttempt,
3528
+ topic,
3529
+ ENTITIES,
3530
+ entityDefinitions
3531
+ };