@wirecat/drive-cli 0.68.0 → 0.69.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 (124) hide show
  1. package/dist/bin/drive.js +2 -2
  2. package/dist/bundle/{all-profiles-BU6XUFUP.js → all-profiles-B4A737YW.js} +20 -30
  3. package/dist/bundle/{anthropic-ZP5B7S2Z.js → anthropic-RZGPDESM.js} +3 -3
  4. package/dist/bundle/{app-server-EB4DH6T7.js → app-server-OWEW7DY5.js} +47 -63
  5. package/dist/bundle/{bun-PWMM6L45.js → bun-V5QLYBZU.js} +2 -2
  6. package/dist/bundle/{bun-sqlite-6VPR2SVC.js → bun-sqlite-KHLHXXGH.js} +4 -4
  7. package/dist/bundle/{chunk-7TNQZKRD.js → chunk-22SH77TG.js} +65 -64
  8. package/dist/bundle/{chunk-MLSXHTUB.js → chunk-25FT44S3.js} +1480 -464
  9. package/dist/bundle/{chunk-5G2BY4B6.js → chunk-2DS2TDGW.js} +29 -28
  10. package/dist/bundle/{chunk-PGPHEC2X.js → chunk-2Q4CB4EI.js} +1 -1
  11. package/dist/bundle/{chunk-74NCZKRW.js → chunk-2VFAXC6O.js} +13 -13
  12. package/dist/bundle/{chunk-NV75QPML.js → chunk-376ZGVUZ.js} +4 -4
  13. package/dist/bundle/{chunk-6WAC2LOS.js → chunk-3RLRJHAI.js} +1558 -928
  14. package/dist/bundle/{chunk-QVJMFZFW.js → chunk-3URYKAJP.js} +1 -1
  15. package/dist/bundle/{chunk-UYBLNGZ2.js → chunk-3YKAFLXY.js} +1 -1
  16. package/dist/bundle/{chunk-CMWFYZ45.js → chunk-4J5GJJ2I.js} +1 -1
  17. package/dist/bundle/{chunk-QKY24RWV.js → chunk-4YECZ6CN.js} +11 -11
  18. package/dist/bundle/{chunk-FAMXUI2X.js → chunk-4ZFO2CVH.js} +4 -4
  19. package/dist/bundle/{chunk-IVOG6T6P.js → chunk-533XOW74.js} +2 -2
  20. package/dist/bundle/{chunk-Q6BD6RUH.js → chunk-5B5NOAIA.js} +100 -55
  21. package/dist/bundle/{chunk-MW46BLWH.js → chunk-5SJZDEIO.js} +2 -0
  22. package/dist/bundle/{chunk-CVAJMRRD.js → chunk-6D44YQ5X.js} +5 -5
  23. package/dist/bundle/{chunk-EOC7RHJ2.js → chunk-6EL5AVXX.js} +3 -5
  24. package/dist/bundle/{chunk-TI2OANJZ.js → chunk-6XNTELM5.js} +1 -1
  25. package/dist/bundle/{chunk-WUFZGPXX.js → chunk-AD7VI3XU.js} +6 -6
  26. package/dist/bundle/{chunk-YUGTJBV3.js → chunk-AMQGKMLZ.js} +2 -2
  27. package/dist/bundle/{chunk-SOS4U2RF.js → chunk-BBJVV4E2.js} +24 -25
  28. package/dist/bundle/{chunk-JMZQBRRZ.js → chunk-BVVXYZSU.js} +5 -5
  29. package/dist/bundle/{chunk-AIEMFRBU.js → chunk-CAQ5GW3A.js} +1 -1
  30. package/dist/bundle/{chunk-PWIEOATY.js → chunk-CDSB7WVG.js} +323 -12
  31. package/dist/bundle/{chunk-KPKIHJIT.js → chunk-CU6RATZH.js} +3 -3
  32. package/dist/bundle/{chunk-43NEDPXB.js → chunk-CZ4UEXCE.js} +4 -4
  33. package/dist/bundle/{chunk-UFPRP7MG.js → chunk-E7URRFBB.js} +7 -7
  34. package/dist/bundle/{chunk-YYIWPH53.js → chunk-EL2E3ABX.js} +12 -12
  35. package/dist/bundle/{chunk-MWCPKUU4.js → chunk-EWUQIUTB.js} +4 -4
  36. package/dist/bundle/{chunk-7A77GYCE.js → chunk-F5UUJU6R.js} +2 -2
  37. package/dist/bundle/{chunk-O7T3WGCV.js → chunk-GHFBT2ZM.js} +4 -4
  38. package/dist/bundle/{chunk-7BXVI7XF.js → chunk-GK6KXBL6.js} +1 -1
  39. package/dist/bundle/{chunk-5W65QTYS.js → chunk-GTDCP5OG.js} +3 -3
  40. package/dist/bundle/{chunk-GTLXBAJV.js → chunk-HEBZCKMU.js} +1669 -662
  41. package/dist/bundle/{chunk-AXYG2DDY.js → chunk-I55XYREN.js} +636 -227
  42. package/dist/bundle/{chunk-UUQJVKPB.js → chunk-IQ2QU2X6.js} +1608 -1096
  43. package/dist/bundle/{chunk-ULNN3LCY.js → chunk-KUQDBWPU.js} +40 -32
  44. package/dist/bundle/{chunk-6QR7NKMG.js → chunk-L342KHIZ.js} +105 -1
  45. package/dist/bundle/{chunk-DYLYH7VE.js → chunk-LRCSDAYK.js} +3 -3
  46. package/dist/bundle/{chunk-QTRYJZL7.js → chunk-LUZRVBQR.js} +4 -4
  47. package/dist/bundle/{chunk-PJ3FKBXG.js → chunk-MHXZ62CU.js} +1 -1
  48. package/dist/bundle/{chunk-WGX4DZPW.js → chunk-N4ACIIQB.js} +2 -2
  49. package/dist/bundle/{chunk-DU23ET2O.js → chunk-NVDR72GP.js} +19 -19
  50. package/dist/bundle/{chunk-F7KAMSXA.js → chunk-O6PD7RZY.js} +2 -2
  51. package/dist/bundle/{chunk-JZ3MT7IE.js → chunk-OOIAJRKQ.js} +1 -1
  52. package/dist/bundle/{chunk-ZVQDOKDY.js → chunk-OUM4ZO53.js} +1 -1
  53. package/dist/bundle/{chunk-ZSVMZH5O.js → chunk-PB6NWKH3.js} +2 -2
  54. package/dist/bundle/{chunk-EEE4H2PA.js → chunk-QJGFQRTL.js} +10 -10
  55. package/dist/bundle/chunk-RLGQMMYE.js +707 -0
  56. package/dist/bundle/{chunk-CRIEW4FP.js → chunk-RWQ7T4Y5.js} +2 -2
  57. package/dist/bundle/{chunk-EXWZCI5G.js → chunk-SEJBS7SI.js} +1 -1
  58. package/dist/bundle/{chunk-CK2SQ2CE.js → chunk-SY2HLH5R.js} +32 -19
  59. package/dist/bundle/{chunk-6HFZZ2PW.js → chunk-SYUXKV2E.js} +1 -1
  60. package/dist/bundle/{chunk-ZAIE3G5I.js → chunk-T4FMXDDV.js} +2 -2
  61. package/dist/bundle/{chunk-U52QE4QV.js → chunk-T6X6EZ5N.js} +3 -3
  62. package/dist/bundle/{chunk-Z5BMYI2V.js → chunk-TZ75K6R7.js} +6 -6
  63. package/dist/bundle/{chunk-D4MVEOU2.js → chunk-U3RXH6RY.js} +1 -1
  64. package/dist/bundle/{chunk-QRSPFCRY.js → chunk-V4FMN5A6.js} +16 -16
  65. package/dist/bundle/{chunk-QWGEOQHA.js → chunk-VUPWDCYV.js} +1 -1
  66. package/dist/bundle/{chunk-WCNTDETD.js → chunk-WNMPIRRF.js} +98 -6
  67. package/dist/bundle/{chunk-RT5NT62B.js → chunk-WOUIHZRI.js} +13 -15
  68. package/dist/bundle/{chunk-UIKVP23D.js → chunk-WQOGHND4.js} +1 -1
  69. package/dist/bundle/{chunk-2VYEGKQ3.js → chunk-XUHQ7DVT.js} +1 -1
  70. package/dist/bundle/{chunk-DIZBJLPM.js → chunk-XVH3WZSZ.js} +45 -55
  71. package/dist/bundle/{chunk-MOKEB656.js → chunk-ZBYKCVSV.js} +1 -1
  72. package/dist/bundle/{chunk-BXHFJTU5.js → chunk-ZUG67442.js} +2 -2
  73. package/dist/bundle/{cli-L7P36YUH.js → cli-BS4L3HAP.js} +100 -70
  74. package/dist/bundle/{command-contract-EYFGMKIG.js → command-contract-HYURWSD6.js} +16 -17
  75. package/dist/bundle/{command-server-entry-H3VGPOLJ.js → command-server-entry-CJ2CV7ZV.js} +23 -24
  76. package/dist/bundle/{decode-JEU6JWCV.js → decode-E2NM5SSM.js} +3 -3
  77. package/dist/bundle/drive.js +4 -4
  78. package/dist/bundle/{echarts-SDZA2SWG.js → echarts-QIXLXS3G.js} +2 -2
  79. package/dist/bundle/{embed-WUKOASQG.js → embed-YNZW5X6M.js} +4 -4
  80. package/dist/bundle/{embedder-UBRAXRDZ.js → embedder-LRC2PKTS.js} +7 -7
  81. package/dist/bundle/{entry-C4NUQFTF.js → entry-2IMSWRJU.js} +7 -7
  82. package/dist/bundle/{first-run-PKHBS7B4.js → first-run-7CPHQDM5.js} +7 -7
  83. package/dist/bundle/first-screen-OKZ7GMFR.js +38 -0
  84. package/dist/bundle/{google-XXHSMTVK.js → google-WDKDBDD4.js} +15 -15
  85. package/dist/bundle/{google-api-SQQ4BSNR.js → google-api-7JDZDCWE.js} +52 -53
  86. package/dist/bundle/{grants-2U4JVT6O.js → grants-AU25GWKF.js} +57 -58
  87. package/dist/bundle/{identity-SRL6RSU2.js → identity-E43WKN5F.js} +1 -1
  88. package/dist/bundle/{instructions-7T6JJIFS.js → instructions-MD2RZT5Z.js} +1 -1
  89. package/dist/bundle/{login-N243GGEE.js → login-RBDJPQAG.js} +57 -58
  90. package/dist/bundle/{node-BZDMUFTW.js → node-IEVT2FSJ.js} +2 -2
  91. package/dist/bundle/{node-sqlite-SZQCCMV2.js → node-sqlite-IENH4TRX.js} +5 -5
  92. package/dist/bundle/{oauth-CMAFXX6A.js → oauth-3JGSN47Z.js} +5 -5
  93. package/dist/bundle/{open-RVTPKDA3.js → open-TZ5H7NYM.js} +3 -3
  94. package/dist/bundle/{openai-6NN63BMH.js → openai-XF2KB7W2.js} +14 -14
  95. package/dist/bundle/{process-756VBE7E.js → process-6Q23D3TO.js} +1 -1
  96. package/dist/bundle/{program-B4QBJYB5.js → program-D5XWOHV5.js} +86 -89
  97. package/dist/bundle/{prompt-HGP2DSRW.js → prompt-KUC5D4GX.js} +3 -3
  98. package/dist/bundle/{recognize-26SHB7HI.js → recognize-DPFW7HO3.js} +2 -2
  99. package/dist/bundle/{remote-Z4PWHZ5N.js → remote-MODTSUNH.js} +8 -8
  100. package/dist/bundle/{rerank-QHJZJK3Q.js → rerank-JK7SERLE.js} +5 -5
  101. package/dist/bundle/{serve-MYJW5IEM.js → serve-BV2WHZLW.js} +7 -7
  102. package/dist/bundle/server-6YDI4Y36.js +72 -0
  103. package/dist/bundle/{server-XFW3V7CR.js → server-N3WPEU7Z.js} +45 -44
  104. package/dist/bundle/{services-IQG2RVTO.js → services-SV6CFUCS.js} +42 -27
  105. package/dist/bundle/{sqlite-runtime-X4GB5PBV.js → sqlite-runtime-RZ5PLZVQ.js} +4 -4
  106. package/dist/bundle/{state-ATQK2X3W.js → state-RAZIREVG.js} +4 -4
  107. package/dist/bundle/{store-QUBUPK6F.js → store-2DLGLYS6.js} +18 -14
  108. package/dist/bundle/{store-MEHEUOJH.js → store-DQKJKX2G.js} +12 -12
  109. package/dist/bundle/store-maintenance-command-UJ5F5L4H.js +64 -0
  110. package/dist/bundle/tokens-LY3WML55.js +110 -0
  111. package/dist/policy.d.ts +1 -1
  112. package/dist/policy.d.ts.map +1 -1
  113. package/dist/policy.js +3 -3
  114. package/dist/policy.js.map +1 -1
  115. package/dist/version.d.ts +1 -1
  116. package/dist/version.js +1 -1
  117. package/package.json +2 -2
  118. package/dist/bundle/chunk-2UHQVRH2.js +0 -1235
  119. package/dist/bundle/chunk-J5LXL435.js +0 -1316
  120. package/dist/bundle/chunk-R5FTCNLJ.js +0 -76
  121. package/dist/bundle/first-screen-QOVOM4BF.js +0 -39
  122. package/dist/bundle/server-HBZPIHDX.js +0 -74
  123. package/dist/bundle/store-maintenance-command-33ULVDWY.js +0 -65
  124. package/dist/bundle/tokens-A2GP4F34.js +0 -111
@@ -1,5 +1,9 @@
1
1
  import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ modelSettingsShape,
5
+ resolveModelSettings
6
+ } from "./chunk-F5UUJU6R.js";
3
7
  import {
4
8
  currentCaller,
5
9
  endpointTemplate,
@@ -9,58 +13,29 @@ import {
9
13
  providerErrorKey,
10
14
  renderEvent,
11
15
  runContextOf
12
- } from "./chunk-WUFZGPXX.js";
13
- import {
14
- CEILING_KEY,
15
- COMMAND_PATH_KEY,
16
- DEFAULT_HISTORY_LIMITS,
17
- DEFAULT_RERANK_MODEL,
18
- HISTORY_MAX_DAYS,
19
- IMAGE_MODELS,
20
- LEVELS,
21
- RERANK_MODELS,
22
- RESOURCES,
23
- RESOURCE_KEY,
24
- WEIGHTS,
25
- agenda,
26
- assertOverridesTighten,
27
- attachment,
28
- closeSuggestion,
29
- conversation,
30
- hitFile,
31
- keyForCommand,
32
- layerPermissions,
33
- parseDuration,
34
- permissionOverrides,
35
- progressOf,
36
- runBudget,
37
- stopWrites,
38
- tagging,
39
- task,
40
- withWriteScope
41
- } from "./chunk-J5LXL435.js";
42
- import {
43
- modelSettingsShape,
44
- resolveModelSettings
45
- } from "./chunk-7A77GYCE.js";
16
+ } from "./chunk-AD7VI3XU.js";
46
17
  import {
47
18
  permissionCeiling
48
- } from "./chunk-KPKIHJIT.js";
19
+ } from "./chunk-CU6RATZH.js";
49
20
  import {
50
21
  ancestorValue,
51
22
  envName,
52
23
  readOnlyLockOf,
53
24
  readOnlyRefusal
54
- } from "./chunk-MOKEB656.js";
25
+ } from "./chunk-ZBYKCVSV.js";
55
26
  import {
56
27
  carries
57
- } from "./chunk-UIKVP23D.js";
28
+ } from "./chunk-WQOGHND4.js";
58
29
  import {
59
30
  endpoint
60
- } from "./chunk-6QR7NKMG.js";
31
+ } from "./chunk-L342KHIZ.js";
61
32
  import {
62
33
  note
63
- } from "./chunk-IVOG6T6P.js";
34
+ } from "./chunk-533XOW74.js";
35
+ import {
36
+ filesPresent,
37
+ sharedModelsDirectory
38
+ } from "./chunk-GTDCP5OG.js";
64
39
  import {
65
40
  BUSINESS_KINDS,
66
41
  CATEGORIES,
@@ -89,6 +64,7 @@ import {
89
64
  RELATION_KINDS,
90
65
  RUNS_SIZE_LIMIT_MB,
91
66
  STANDINGS,
67
+ TAG_TYPES,
92
68
  TASK_KINDS,
93
69
  TASK_ORIGINS,
94
70
  TASK_STATES,
@@ -135,7 +111,7 @@ import {
135
111
  typedCommand,
136
112
  untrusted,
137
113
  useAsProcessRun
138
- } from "./chunk-AXYG2DDY.js";
114
+ } from "./chunk-I55XYREN.js";
139
115
  import {
140
116
  FIELD_TYPES,
141
117
  QUERY_BACKENDS,
@@ -144,13 +120,16 @@ import {
144
120
  import {
145
121
  isCliFailure,
146
122
  storeDamaged
147
- } from "./chunk-UYBLNGZ2.js";
123
+ } from "./chunk-3YKAFLXY.js";
148
124
  import {
149
- sharedConfigPath
150
- } from "./chunk-PWIEOATY.js";
125
+ readSharedSection,
126
+ repairConfigText,
127
+ sharedConfigPath,
128
+ writeSharedSection
129
+ } from "./chunk-CDSB7WVG.js";
151
130
  import {
152
131
  storePath
153
- } from "./chunk-CRIEW4FP.js";
132
+ } from "./chunk-RWQ7T4Y5.js";
154
133
  import {
155
134
  configFilePath,
156
135
  createRecordLog,
@@ -161,7 +140,7 @@ import {
161
140
  resolvePaths,
162
141
  saveConfigFile,
163
142
  writeSecurely
164
- } from "./chunk-MW46BLWH.js";
143
+ } from "./chunk-5SJZDEIO.js";
165
144
  import {
166
145
  EXIT_CODES,
167
146
  GENERIC_FAILURE,
@@ -183,6 +162,7 @@ import {
183
162
  check,
184
163
  defineSteps,
185
164
  effectsSchema,
165
+ getDotPath,
186
166
  integer,
187
167
  isoDate,
188
168
  isoTime,
@@ -214,6 +194,7 @@ import {
214
194
  regex,
215
195
  safeInteger,
216
196
  safeParse,
197
+ startsWith,
217
198
  stepOf,
218
199
  strictObject,
219
200
  string,
@@ -221,11 +202,13 @@ import {
221
202
  union,
222
203
  unknown,
223
204
  unwrap,
205
+ url,
224
206
  variant,
225
207
  writes
226
208
  } from "./chunk-JRFKCYMW.js";
227
209
  import {
228
- CliError
210
+ CliError,
211
+ isCliError
229
212
  } from "./chunk-EA2OB75T.js";
230
213
  import {
231
214
  __name
@@ -251,8 +234,8 @@ var snake = /* @__PURE__ */ __name((name) => name.replace(/[A-Z]/g, (letter) =>
251
234
  var stepTargets = /* @__PURE__ */ __name((root) => {
252
235
  const found = /* @__PURE__ */ new Map();
253
236
  const optionName = /* @__PURE__ */ __name((option) => snake((option.long ?? option.attributeName()).replace(/^--/, "")), "optionName");
254
- const visit2 = /* @__PURE__ */ __name((command, parents, above) => {
255
- const path2 = [...parents, command.name()];
237
+ const visit2 = /* @__PURE__ */ __name((command, parents2, above) => {
238
+ const path2 = [...parents2, command.name()];
256
239
  const options = [...above, ...command.options];
257
240
  const { effects } = metaOf(command);
258
241
  found.set(path2.join(" "), {
@@ -274,8 +257,8 @@ var describeAlone = /* @__PURE__ */ __name((command, known) => {
274
257
  }
275
258
  return found;
276
259
  }, "describeAlone");
277
- var describe = /* @__PURE__ */ __name((command, cli, parents, above, known) => {
278
- const path2 = [...parents, command.name()];
260
+ var describe = /* @__PURE__ */ __name((command, cli, parents2, above, known) => {
261
+ const path2 = [...parents2, command.name()];
279
262
  const args = command.registeredArguments.map(describeArgument);
280
263
  const options = describeOptions(command);
281
264
  const { origin = "handwritten", query, mcp, offline, ...meta } = metaOf(command);
@@ -4035,7 +4018,458 @@ var refuseJoinedPath = /* @__PURE__ */ __name((root, args, prefix = []) => {
4035
4018
  }
4036
4019
  }, "refuseJoinedPath");
4037
4020
 
4038
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/contact-activity.js
4021
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/sends/permissions.js
4022
+ var LEVELS = ["deny", "readonly", "ask", "allow"];
4023
+ var DANGEROUS = /* @__PURE__ */ new Set(["messages.delete", "bot.messages.delete", "topics.delete", "chats.delete", "chats.clear"]);
4024
+ var skipFlagFor = /* @__PURE__ */ __name((key) => DANGEROUS.has(key) ? "--allow-dangerous" : "--yes", "skipFlagFor");
4025
+ var DEFAULT_PERMISSIONS = {
4026
+ // Owner, 2026-11-14: deleting a message does not ask; a profile that wants the question sets `ask`.
4027
+ "messages.delete": "allow",
4028
+ "account.sessions.end": "ask",
4029
+ "bot.messages.delete": "allow",
4030
+ "topics.enable": "ask",
4031
+ "topics.delete": "ask",
4032
+ "chats.delete": "ask",
4033
+ "chats.clear": "ask",
4034
+ // Owner, 2026-11-14 (replaces NEED-568): a rule the owner enabled may send; `deny` stops every automatic reply.
4035
+ "replies.send": "allow",
4036
+ // NEED-1662: an agent that changes settings, schedules or recipients could lift its own limits; the owner opts in.
4037
+ "mcp.authority": "deny",
4038
+ // NEED-1663: writes no level stopped before, so MCP could not offer them; over MCP `ask` goes ahead.
4039
+ "store.backup": "ask",
4040
+ "store.restore": "ask",
4041
+ "store.migrate": "ask",
4042
+ "store.repair": "ask",
4043
+ "store.reset": "ask",
4044
+ "store.import": "ask",
4045
+ "store.clear": "ask",
4046
+ "store.decrypt": "ask",
4047
+ "store.copies.delete": "ask",
4048
+ "store.recover.run": "ask",
4049
+ "server.start": "ask",
4050
+ "server.stop": "ask",
4051
+ "server.restart": "ask",
4052
+ "models.download": "ask",
4053
+ // NEED-2357.f: many MCP clients (ChatGPT) cannot answer a question, and a switch deletes nothing; kept as a key so a
4054
+ // profile can still deny it.
4055
+ "models.set": "allow",
4056
+ "models.add": "ask",
4057
+ "images.models.download": "ask",
4058
+ "schedule.run": "ask",
4059
+ "schedule.exec": "ask",
4060
+ "doctor.reports.create": "ask",
4061
+ // A meeting changed on the service reaches its invitees: asked first, as zoom's `remote-meetings` was.
4062
+ "meetings.create": "ask",
4063
+ "meetings.update": "ask",
4064
+ "meetings.cancel": "ask"
4065
+ };
4066
+ var KEYED_UNDER_HOUSEKEEPING = new Set(Object.keys(DEFAULT_PERMISSIONS).filter((key) => /^(store|server|models|images|schedule|doctor)\./.test(key)));
4067
+ var AUTHORITY_KEY = "mcp.authority";
4068
+ var authorityAllowed = /* @__PURE__ */ __name((levels) => {
4069
+ const { level: level2 } = levelFor(levels, AUTHORITY_KEY);
4070
+ return level2 === "allow" || level2 === "ask";
4071
+ }, "authorityAllowed");
4072
+ var BOT_API_KEY = "bot.api";
4073
+ var isBotApi = /* @__PURE__ */ __name((path2) => path2[0] === "bot" && path2[1] === "api", "isBotApi");
4074
+ var botApiAllowed = /* @__PURE__ */ __name((levels) => {
4075
+ const { level: level2 } = levelFor(levels, BOT_API_KEY, { ...DEFAULT_PERMISSIONS, [BOT_API_KEY]: "deny" });
4076
+ return level2 === "allow" || level2 === "ask";
4077
+ }, "botApiAllowed");
4078
+ var RESOURCES = [
4079
+ "messages",
4080
+ "drafts",
4081
+ "reactions",
4082
+ "polls",
4083
+ "topics",
4084
+ "chats",
4085
+ "contacts",
4086
+ "account",
4087
+ "bot",
4088
+ "conversations",
4089
+ "tags",
4090
+ "mentions",
4091
+ "search",
4092
+ "searches",
4093
+ "tasks",
4094
+ "replies",
4095
+ "attachments",
4096
+ "stats",
4097
+ "store",
4098
+ "metadata",
4099
+ "mcp",
4100
+ "server",
4101
+ "models",
4102
+ "schedule",
4103
+ "doctor",
4104
+ "images"
4105
+ ];
4106
+ var layerPermissions = /* @__PURE__ */ __name((layers) => {
4107
+ const levels = {};
4108
+ const sources = {};
4109
+ for (const [from, layer] of layers) {
4110
+ const nearer = Object.keys(levels);
4111
+ for (const [key, level2] of Object.entries(layer ?? {})) {
4112
+ if (nearer.some((named3) => key === named3 || key.startsWith(`${named3}.`)))
4113
+ continue;
4114
+ levels[key] = level2;
4115
+ sources[key] = from;
4116
+ }
4117
+ }
4118
+ return { levels, sources };
4119
+ }, "layerPermissions");
4120
+ var CEILING_KEY = "*";
4121
+ var STORE_ONLY_KEYS = /* @__PURE__ */ new Set([
4122
+ "attachments.extract",
4123
+ "conversations.embeddings",
4124
+ "conversations.links",
4125
+ "messages.server-search",
4126
+ "messages.sync-first",
4127
+ "metadata.sync",
4128
+ "stats.contacts.top.sync-first",
4129
+ "stats.messages.counters.sync",
4130
+ "stats.messages.show.sync-first",
4131
+ "stats.messages.top.sync-first",
4132
+ "store.gaps.repair"
4133
+ ]);
4134
+ var FETCH_KEYS = new Set([...STORE_ONLY_KEYS].filter((key) => !["attachments.extract", "conversations.embeddings", "conversations.links"].includes(key)));
4135
+ var fetchesUnder = /* @__PURE__ */ __name((level2, key) => level2 === "readonly" && FETCH_KEYS.has(key), "fetchesUnder");
4136
+ var fetchesAt = /* @__PURE__ */ __name((level2) => level2 === "allow" || level2 === "readonly", "fetchesAt");
4137
+ var stops = /* @__PURE__ */ __name((level2, key) => level2 === "deny" || level2 === "readonly" && !FETCH_KEYS.has(key), "stops");
4138
+ var ALLOWED = { level: "allow", key: null };
4139
+ var ORDER = { deny: 0, readonly: 1, ask: 2, allow: 3 };
4140
+ var nearest = /* @__PURE__ */ __name((levels, key) => {
4141
+ for (let parts = key.split("."); parts.length > 0; parts = parts.slice(0, -1)) {
4142
+ const named3 = parts.join(".");
4143
+ const level2 = levels[named3];
4144
+ if (level2)
4145
+ return { level: level2, key: named3, depth: parts.length };
4146
+ }
4147
+ return void 0;
4148
+ }, "nearest");
4149
+ var levelFor = /* @__PURE__ */ __name((permissions, key, defaults = DEFAULT_PERMISSIONS) => {
4150
+ const found = profileLevel(permissions, key, defaults);
4151
+ const ceiling = permissions[CEILING_KEY];
4152
+ return ceiling && ORDER[ceiling] < ORDER[found.level] ? { level: ceiling, key: CEILING_KEY } : found;
4153
+ }, "levelFor");
4154
+ var profileLevel = /* @__PURE__ */ __name((permissions, key, defaults) => {
4155
+ const own = nearest(permissions, key);
4156
+ const builtIn = nearest(defaults, key);
4157
+ if (!builtIn || own && own.depth >= builtIn.depth)
4158
+ return own ? { level: own.level, key: own.key } : ALLOWED;
4159
+ if (!own || ORDER[builtIn.level] <= ORDER[own.level])
4160
+ return { level: builtIn.level, key: builtIn.key };
4161
+ return { level: own.level, key: own.key };
4162
+ }, "profileLevel");
4163
+ var CHAT_KEYS = {
4164
+ settings: "chats.update",
4165
+ "requests.accept": "chats.requests.confirm",
4166
+ "requests.decline": "chats.requests.reject",
4167
+ "link.create": "chats.links.create",
4168
+ "link.reset": "chats.links.reset",
4169
+ "link.revoke": "chats.links.remove",
4170
+ "link.update": "chats.links.update"
4171
+ };
4172
+ var ACCOUNT_KEYS = {
4173
+ "contact-add": "contacts.add",
4174
+ "contact-remove": "contacts.remove",
4175
+ "contact-import": "contacts.import",
4176
+ "contact-rename": "contacts.rename",
4177
+ "contact-block": "contacts.block",
4178
+ "contact-unblock": "contacts.unblock",
4179
+ profile: "account.update",
4180
+ "folder-create": "chats.folders.create",
4181
+ "folder-update": "chats.folders.update",
4182
+ "folder-delete": "chats.folders.delete",
4183
+ "folder-order": "chats.folders.order",
4184
+ "folder-join": "chats.folders.join",
4185
+ "sessions-end": "account.sessions.end",
4186
+ "chat-mute": "chats.mute",
4187
+ "chat-unmute": "chats.unmute",
4188
+ "chat-archive": "chats.archive",
4189
+ "chat-unarchive": "chats.unarchive",
4190
+ "chat-pin": "chats.pin",
4191
+ "chat-unpin": "chats.unpin",
4192
+ "chat-mark-unread": "chats.mark-unread",
4193
+ "message-star": "messages.star",
4194
+ "message-unstar": "messages.unstar",
4195
+ // A mail CLI names its own key on every write; these only answer `keyForWrite` when one is left out.
4196
+ "message-flag": "messages.update",
4197
+ "message-move": "messages.move",
4198
+ "message-copy": "messages.copy",
4199
+ "message-delete": "messages.trash",
4200
+ "message-restore": "messages.restore",
4201
+ privacy: "account.privacy.set"
4202
+ };
4203
+ var KIND_KEYS = {
4204
+ message: "messages.send",
4205
+ forward: "messages.forward",
4206
+ edit: "messages.edit",
4207
+ pin: "messages.pin",
4208
+ reaction: "reactions",
4209
+ read: "chats.mark-read",
4210
+ delete: "messages.delete"
4211
+ };
4212
+ var keyForWrite = /* @__PURE__ */ __name((kind2, action2) => {
4213
+ if (kind2 === "chat")
4214
+ return CHAT_KEYS[action2] ?? `chats.${action2 ?? "update"}`;
4215
+ if (kind2 === "account") {
4216
+ const key = ACCOUNT_KEYS[action2];
4217
+ if (!key)
4218
+ throw new Error(`an account change without a known action: ${action2}`);
4219
+ return key;
4220
+ }
4221
+ return KIND_KEYS[kind2];
4222
+ }, "keyForWrite");
4223
+ var writeOfKey = /* @__PURE__ */ __name((key) => {
4224
+ const account2 = Object.entries(ACCOUNT_KEYS).find(([, named3]) => named3 === key)?.[0];
4225
+ if (account2)
4226
+ return { kind: "account", action: account2 };
4227
+ const kind2 = Object.entries(KIND_KEYS).find(([, named3]) => named3 === key || key.startsWith(`${named3}.`))?.[0];
4228
+ if (kind2)
4229
+ return { kind: kind2 };
4230
+ if (key === "messages.unpin")
4231
+ return { kind: "pin" };
4232
+ if (key.startsWith("chats.")) {
4233
+ const action2 = Object.entries(CHAT_KEYS).find(([, named3]) => named3 === key)?.[0] ?? key.slice("chats.".length);
4234
+ return { kind: "chat", action: action2 };
4235
+ }
4236
+ return {};
4237
+ }, "writeOfKey");
4238
+ var NAMED_WRITE_KEYS = [
4239
+ "drafts",
4240
+ "store.gaps.repair",
4241
+ "messages.sync-first",
4242
+ "messages.server-search",
4243
+ "messages.press",
4244
+ "chats.start",
4245
+ "chats.app",
4246
+ "stats.messages.counters.sync",
4247
+ "stats.messages.show.sync-first",
4248
+ "stats.messages.top.sync-first",
4249
+ "stats.contacts.top.sync-first",
4250
+ "account.sessions.list",
4251
+ "attachments.extract",
4252
+ "attachments.move",
4253
+ "attachments.update",
4254
+ "bot.callbacks.answer",
4255
+ "bot.chats.action",
4256
+ "bot.chats.admins.add",
4257
+ "bot.chats.admins.remove",
4258
+ "bot.chats.leave",
4259
+ "bot.chats.members.remove",
4260
+ "bot.chats.moderate",
4261
+ "bot.messages.delete",
4262
+ "bot.messages.edit",
4263
+ "bot.messages.pin",
4264
+ "bot.messages.send",
4265
+ "bot.messages.unpin",
4266
+ "chats.admins.add",
4267
+ "chats.admins.remove",
4268
+ "chats.links.create",
4269
+ "chats.links.reset",
4270
+ "chats.links.remove",
4271
+ "chats.links.update",
4272
+ "chats.members.add",
4273
+ "chats.members.remove",
4274
+ "chats.moderate",
4275
+ "conversations.embeddings",
4276
+ "conversations.links",
4277
+ "polls.close",
4278
+ "polls.create",
4279
+ "polls.vote",
4280
+ "searches.clear",
4281
+ "searches.create",
4282
+ "searches.delete",
4283
+ "contacts.aliases.set",
4284
+ "contacts.aliases.remove",
4285
+ "contacts.notes.add",
4286
+ "contacts.notes.edit",
4287
+ "contacts.notes.remove",
4288
+ "tags.rebuild",
4289
+ "metadata.sync",
4290
+ "mentions.rebuild",
4291
+ "mentions.confirm",
4292
+ "mentions.reject",
4293
+ "tags.add",
4294
+ "tags.remove",
4295
+ "tasks.acknowledge",
4296
+ "tasks.add",
4297
+ "tasks.claim",
4298
+ "tasks.close",
4299
+ "tasks.duplicates.defer",
4300
+ "tasks.duplicates.reject",
4301
+ "tasks.link",
4302
+ "tasks.merge",
4303
+ "tasks.update",
4304
+ "tasks.release",
4305
+ "tasks.scan",
4306
+ "tasks.unmerge",
4307
+ "topics.create",
4308
+ "topics.edit",
4309
+ "topics.enable"
4310
+ ];
4311
+ var WRITE_KEYS = [
4312
+ .../* @__PURE__ */ new Set([
4313
+ ...NAMED_WRITE_KEYS,
4314
+ ...Object.keys(DEFAULT_PERMISSIONS),
4315
+ ...Object.values(KIND_KEYS),
4316
+ ...Object.values(ACCOUNT_KEYS),
4317
+ ...Object.values(CHAT_KEYS)
4318
+ ])
4319
+ ];
4320
+ var HOUSEKEEPING = /* @__PURE__ */ new Set([
4321
+ "help",
4322
+ "guide",
4323
+ "config",
4324
+ "session",
4325
+ "doctor",
4326
+ "commands",
4327
+ "complete",
4328
+ "upgrade",
4329
+ "skill",
4330
+ "models",
4331
+ "server",
4332
+ // What a schedule runs is checked by its own key when it runs; an agent runs read-only.
4333
+ "schedule",
4334
+ "runs",
4335
+ "sends",
4336
+ "recipients",
4337
+ "flood",
4338
+ "mcp",
4339
+ // Its commands read the rules or flip the pause switch; what a rule sends is checked as `replies.send`.
4340
+ "replies"
4341
+ ]);
4342
+ var BOT_HOUSEKEEPING = /* @__PURE__ */ new Set(["auth", "list", "sends", "recipients", "mcp"]);
4343
+ var STORE_MAINTENANCE = /* @__PURE__ */ new Set(["info", "check", "copies"]);
4344
+ var SHOW_MESSAGES = /* @__PURE__ */ new Set(["inbox", "review", "watch", "serve", "store", "conversations", "projects"]);
4345
+ var readKeysForCommand = /* @__PURE__ */ __name((path2) => {
4346
+ if (path2[0] === "bot")
4347
+ return readKeysForCommand(path2.slice(1)).map((key2) => `bot.${key2}`);
4348
+ const key = keyForCommand(path2);
4349
+ if (!key)
4350
+ return [];
4351
+ if (path2[0] === "attachments" && path2[1] === "download")
4352
+ return [key, "messages", "chats"];
4353
+ if (path2[0] === "attachments" && (path2[1] === "extract" || path2[1] === "show"))
4354
+ return [key, "messages"];
4355
+ if (path2[0] === "store" && path2[1] === "gaps" && path2[2] === "repair")
4356
+ return [key, "messages"];
4357
+ if (path2[0] === "store" && ["reset", "clear", "decrypt"].includes(path2[1] ?? ""))
4358
+ return [key, "messages"];
4359
+ if (key === "store.recover.run")
4360
+ return [key, "messages"];
4361
+ if (path2[0] === "search") {
4362
+ if (path2[1] === "notes")
4363
+ return [key];
4364
+ if (path2[1] === "topics")
4365
+ return [key, "topics"];
4366
+ if (path2[1] === "conversations")
4367
+ return [key, "messages", "conversations"];
4368
+ return [key, "messages"];
4369
+ }
4370
+ if (path2[0] !== "stats")
4371
+ return [key];
4372
+ const resource = path2[1] === "charts" ? "chats" : path2[1];
4373
+ return [
4374
+ .../* @__PURE__ */ new Set([
4375
+ key,
4376
+ "messages",
4377
+ ...["chats", "contacts", "tasks"].includes(resource ?? "") ? [resource] : []
4378
+ ])
4379
+ ];
4380
+ }, "readKeysForCommand");
4381
+ var keyForCommand = /* @__PURE__ */ __name((path2) => {
4382
+ if (path2.length === 0)
4383
+ return null;
4384
+ const [top, next] = path2;
4385
+ if (top === "bot") {
4386
+ if (next === void 0 || BOT_HOUSEKEEPING.has(next))
4387
+ return null;
4388
+ const inner = keyForCommand(path2.slice(1));
4389
+ return `bot.${inner ?? path2.slice(1).join(".")}`;
4390
+ }
4391
+ if (KEYED_UNDER_HOUSEKEEPING.has(path2.join(".")))
4392
+ return path2.join(".");
4393
+ if (top === void 0 || HOUSEKEEPING.has(top) || top === "search" && next === "runs")
4394
+ return null;
4395
+ if (top === "images" && next === "models")
4396
+ return null;
4397
+ if (top === "attachments" && (next === "check" || next === "jobs"))
4398
+ return null;
4399
+ if (top === "attachments" && next === "download")
4400
+ return "messages";
4401
+ if (top === "store" && next !== void 0 && STORE_MAINTENANCE.has(next))
4402
+ return null;
4403
+ if (top === "conversations" && next === "links")
4404
+ return path2[2] === "rebuild" ? "conversations.links.rebuild" : "conversations.links";
4405
+ if (top === "conversations" && (next === "embeddings" || next === "embed") || top === "images" && next === "embed" || top === "conversations" && next === "rebuild")
4406
+ return "conversations.embeddings";
4407
+ if (top === "attachments" && next === "list" || top === "chats" && next === "documents")
4408
+ return "messages";
4409
+ if (top === "mentions")
4410
+ return next === "rebuild" || next === "confirm" || next === "reject" ? `mentions.${next}` : "messages";
4411
+ if (top === "store" && (next === "gaps" || next === "jobs"))
4412
+ return path2.join(".");
4413
+ if (SHOW_MESSAGES.has(top) || top === "contacts" && (next === "context" || next === "prepare" || next === "events"))
4414
+ return "messages";
4415
+ if (RESOURCES.includes(top))
4416
+ return path2.join(".");
4417
+ return void 0;
4418
+ }, "keyForCommand");
4419
+ var RESOURCE_KEY = new RegExp(`^(${RESOURCES.join("|")})(\\.[a-z][a-z-]*)*$`);
4420
+ var COMMAND_PATH_KEY = /^[a-z][a-z-]*(\.[a-zA-Z][a-zA-Z-]*)*$/;
4421
+ var permissionOverrides = /* @__PURE__ */ __name((entries = [], shape = RESOURCE_KEY) => {
4422
+ const levels = {};
4423
+ const example = shape === RESOURCE_KEY ? "messages.send=allow" : "api=readonly";
4424
+ for (const entry of entries) {
4425
+ const [key = "", level2 = "", extra] = entry.split("=");
4426
+ if (!shape.test(key) || !LEVELS.includes(level2) || extra !== void 0)
4427
+ throw new CliError("validation_error", `--permission takes a command path and level, e.g. ${example} (deny, readonly, ask, allow)`);
4428
+ levels[key] = level2;
4429
+ }
4430
+ return levels;
4431
+ }, "permissionOverrides");
4432
+ var assertOverridesTighten = /* @__PURE__ */ __name((overrides, profile, defaults = DEFAULT_PERMISSIONS) => {
4433
+ for (const [key, level2] of Object.entries(overrides)) {
4434
+ const under = Object.keys(profile).filter((named3) => named3.startsWith(`${key}.`));
4435
+ const lifted = [key, ...under].find((named3) => ORDER[level2] > ORDER[levelFor(profile, named3, defaults).level]);
4436
+ if (lifted !== void 0)
4437
+ throw new CliError("validation_error", `--permission ${key}=${level2} would loosen ${lifted} from ${levelFor(profile, lifted, defaults).level}; it only tightens \u2014 change the profile's permissions to loosen it`, { key, lifted });
4438
+ }
4439
+ }, "assertOverridesTighten");
4440
+ var assertRetentionEvidenceRead = /* @__PURE__ */ __name((permissions) => {
4441
+ for (const permission of ["stats.chats.retention", "chats"]) {
4442
+ if (levelFor(permissions, permission).level === "deny")
4443
+ throw new CliError("permission_error", `profile denies ${permission}`, { permission });
4444
+ }
4445
+ }, "assertRetentionEvidenceRead");
4446
+
4447
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/botcheck/reasons.js
4448
+ var WEIGHTS = {
4449
+ bot: 3,
4450
+ scam: 3,
4451
+ fake: 3,
4452
+ deleted: 1,
4453
+ no_photo: 1,
4454
+ no_username: 1,
4455
+ odd_name: 1,
4456
+ never_wrote: 1,
4457
+ link_first: 2,
4458
+ burst_join: 1,
4459
+ mass_invited: 1,
4460
+ new_account: 2,
4461
+ no_bio: 1,
4462
+ same_text: 2,
4463
+ photo_recent: 1,
4464
+ cas_banned: 3,
4465
+ lols_banned: 3,
4466
+ lols_scammer: 3
4467
+ };
4468
+ var LINK = /https?:\/\/|t\.me\/|www\./i;
4469
+ var DIGITS = /\d{5,}/;
4470
+ var oddName = /* @__PURE__ */ __name((name) => !name?.trim() || DIGITS.test(name) || LINK.test(name), "oddName");
4471
+
4472
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/contact-activity.js
4039
4473
  var linkedIdentity = strictObject({
4040
4474
  provider: text,
4041
4475
  id,
@@ -4090,7 +4524,7 @@ var contactCheck = strictObject({
4090
4524
  checked_at: time
4091
4525
  });
4092
4526
 
4093
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/member.js
4527
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/member.js
4094
4528
  var member = strictObject({
4095
4529
  id,
4096
4530
  name: nullable(text),
@@ -4113,7 +4547,7 @@ var member = strictObject({
4113
4547
  check: optional(record(string(), unknown()))
4114
4548
  });
4115
4549
 
4116
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/chat.js
4550
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/chat.js
4117
4551
  var setting = optional(nullable(boolean()));
4118
4552
  var chat = strictObject({
4119
4553
  ref: reference,
@@ -4154,7 +4588,52 @@ var chat = strictObject({
4154
4588
  members: optional(array(member))
4155
4589
  });
4156
4590
 
4157
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/message.js
4591
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/attachment.js
4592
+ var attachment = strictObject({
4593
+ /** The message it came with, as a locator; absent inside that message. */
4594
+ message: optional(reference),
4595
+ /** Lower-cased: `photo`, `video`, `file`, `voice`… */
4596
+ kind: text,
4597
+ /** Its place among the message's attachments, from 1, as `attachments show --attachment` takes it. */
4598
+ position: optional(count),
4599
+ url: optional(text),
4600
+ name: optional(text),
4601
+ title: optional(text),
4602
+ mime: optional(text),
4603
+ size: optional(count),
4604
+ width: optional(count),
4605
+ height: optional(count),
4606
+ /** Seconds, for audio and video. */
4607
+ duration: optional(number()),
4608
+ /** The text read out of it; how it was read is `extraction`. */
4609
+ text: optional(text),
4610
+ extraction: optional(strictObject({ origin: text, extractor: text, chars: count, error: optional(text) })),
4611
+ local_path: optional(text),
4612
+ /** A shared contact card (`kind: "contact"`); the phone is the whole number as the sender put it. */
4613
+ contact: optional(strictObject({
4614
+ name: text,
4615
+ first_name: optional(text),
4616
+ last_name: optional(text),
4617
+ phone: optional(text),
4618
+ user_id: optional(id)
4619
+ })),
4620
+ /** A bot's keyboard under the message, row by row; `messages press` presses one. */
4621
+ buttons: optional(array(array(strictObject({
4622
+ kind: picklist(["callback", "link", "message", "chat", "contact", "location", "app", "clipboard", "other"]),
4623
+ text,
4624
+ url: optional(text)
4625
+ }))))
4626
+ });
4627
+ var hitFile = strictObject({
4628
+ position: count,
4629
+ kind: text,
4630
+ name: optional(text),
4631
+ size: optional(count),
4632
+ /** The saved copy on this computer, once `messages download` fetched it; absent until then. */
4633
+ local_path: optional(text)
4634
+ });
4635
+
4636
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/message.js
4158
4637
  var quoted = strictObject({
4159
4638
  id,
4160
4639
  sender_id: nullable(id),
@@ -4273,7 +4752,7 @@ var message = strictObject({
4273
4752
  provider_metadata: providerMetadata
4274
4753
  });
4275
4754
 
4276
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/recorded-meeting.js
4755
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/recorded-meeting.js
4277
4756
  var recordedMeeting = strictObject({
4278
4757
  ref: reference,
4279
4758
  meeting_id: count,
@@ -4286,7 +4765,7 @@ var recordedMeeting = strictObject({
4286
4765
  people: array(reference)
4287
4766
  });
4288
4767
 
4289
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/contact-context.js
4768
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/contact-context.js
4290
4769
  var contextPerson = strictObject({ ...linkedPerson.entries, provider: text, id });
4291
4770
  var contextMessage = strictObject({
4292
4771
  locator: reference,
@@ -4492,7 +4971,7 @@ var contactPreparation = strictObject({
4492
4971
  })
4493
4972
  });
4494
4973
 
4495
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/deal.js
4974
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/deal.js
4496
4975
  var nullableText = nullable(text);
4497
4976
  var party = strictObject({ ref: reference, name: nullableText, owner: boolean() });
4498
4977
  var outcome = picklist(["open", "won", "lost"]);
@@ -4603,7 +5082,7 @@ var stage = strictObject({
4603
5082
  untrusted
4604
5083
  });
4605
5084
 
4606
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/business-context.js
5085
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/business-context.js
4607
5086
  var nullableText2 = nullable(text);
4608
5087
  var day2 = nullable(pipe(string(), regex(/^\d{4}-\d{2}-\d{2}$/)));
4609
5088
  var standing = picklist(STANDINGS);
@@ -4777,7 +5256,7 @@ var dealBrief = strictObject({
4777
5256
  not_read: coverage2.entries.not_read
4778
5257
  });
4779
5258
 
4780
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/list-results.js
5259
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/list-results.js
4781
5260
  var botProfile = strictObject({
4782
5261
  name: text,
4783
5262
  token: text,
@@ -4901,7 +5380,7 @@ var stickerInventory = strictObject({
4901
5380
  url: optional(nullable(text))
4902
5381
  });
4903
5382
 
4904
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/batch-result.js
5383
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/batch-result.js
4905
5384
  var actionableError = objectWithRest({
4906
5385
  code: text,
4907
5386
  message: text,
@@ -4918,7 +5397,7 @@ var batchResult = strictObject({
4918
5397
  max_error_percent: count
4919
5398
  });
4920
5399
 
4921
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/conversation-preparation.js
5400
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/conversation-preparation.js
4922
5401
  var conversationBuild = strictObject({
4923
5402
  chat: id,
4924
5403
  messages: count,
@@ -4943,13 +5422,29 @@ var catchUpPreparation = strictObject({
4943
5422
  prepared: optional(conversationPreparation)
4944
5423
  });
4945
5424
 
4946
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/services/backfill-jobs.js
5425
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/backfill-jobs.js
4947
5426
  import { spawn } from "node:child_process";
4948
5427
  import { randomBytes } from "node:crypto";
4949
5428
  import { closeSync, existsSync, mkdirSync, openSync, readdirSync, readFileSync, realpathSync, rmSync } from "node:fs";
4950
5429
  import { dirname, join } from "node:path";
4951
5430
 
4952
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/runs/record-log.js
5431
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/background/checkpoints.js
5432
+ var progressOf = /* @__PURE__ */ __name((input) => {
5433
+ const total = input.total ?? null;
5434
+ const updated = input.updatedAt ?? null;
5435
+ return {
5436
+ job: input.job,
5437
+ profile: input.profile,
5438
+ done: input.done,
5439
+ total,
5440
+ remaining: total === null ? null : Math.max(0, total - input.done),
5441
+ state: input.complete ?? (total !== null && input.done >= total) ? "complete" : "partial",
5442
+ updated_at: updated,
5443
+ cursor_age_ms: updated === null ? null : Math.max(0, (input.now ?? /* @__PURE__ */ new Date()).getTime() - Date.parse(updated))
5444
+ };
5445
+ }, "progressOf");
5446
+
5447
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/runs/record-log.js
4953
5448
  var recordLogFor = /* @__PURE__ */ __name((to, app, { traceId, command } = {}) => {
4954
5449
  const run = currentRun();
4955
5450
  const trace = traceId ?? run.traceId;
@@ -4963,7 +5458,7 @@ var recordLogFor = /* @__PURE__ */ __name((to, app, { traceId, command } = {}) =
4963
5458
  }));
4964
5459
  }, "recordLogFor");
4965
5460
 
4966
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/services/backfill-jobs.js
5461
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/backfill-jobs.js
4967
5462
  var JOB_STATES = ["running", "done", "partial", "failed", "cancelled", "died"];
4968
5463
  var spawnDetached = /* @__PURE__ */ __name((argv, env, log) => {
4969
5464
  const out = openSync(log, "a", 384);
@@ -5118,7 +5613,7 @@ var startArchiveJob = /* @__PURE__ */ __name((app, env, profile, input, spawnJob
5118
5613
  return { job: id6, pid, chat: input.chat, log };
5119
5614
  }, "startArchiveJob");
5120
5615
 
5121
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/job.js
5616
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/job.js
5122
5617
  var problem = strictObject({ code: text, message: text });
5123
5618
  var job = strictObject({
5124
5619
  id,
@@ -5141,7 +5636,7 @@ var job = strictObject({
5141
5636
  error: optional(problem)
5142
5637
  });
5143
5638
 
5144
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/extraction-report.js
5639
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/extraction-report.js
5145
5640
  var extractionItem = strictObject({
5146
5641
  ref: reference,
5147
5642
  attachment: count,
@@ -5174,7 +5669,7 @@ var extractionReport = strictObject({
5174
5669
  cursor: optional(text)
5175
5670
  });
5176
5671
 
5177
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/message-transfer.js
5672
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/message-transfer.js
5178
5673
  var savedMessageFile = strictObject({
5179
5674
  kind: text,
5180
5675
  path: text,
@@ -5261,7 +5756,7 @@ var messageSyncAll = strictObject({
5261
5756
  var messageSyncStarted = strictObject({ job: id, pid: count, chat: text, log: text });
5262
5757
  var messageSync = union([messageSyncEstimate, messageSyncChat, messageSyncAll, messageSyncStarted]);
5263
5758
 
5264
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/store-records.js
5759
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/store-records.js
5265
5760
  var range = strictObject({ from: number(), to: number() });
5266
5761
  var storeChatStatus = strictObject({
5267
5762
  chat_id: id,
@@ -5359,7 +5854,7 @@ var storeJobRetry = union([
5359
5854
  ]);
5360
5855
  var storeJobClear = strictObject({ cleared: array(id) });
5361
5856
 
5362
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/account.js
5857
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/account.js
5363
5858
  var account = strictObject({
5364
5859
  provider: text,
5365
5860
  id,
@@ -5369,7 +5864,7 @@ var account = strictObject({
5369
5864
  scope: optional(picklist(["personal", "work"]))
5370
5865
  });
5371
5866
 
5372
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/account-session.js
5867
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/account-session.js
5373
5868
  var accountSession = strictObject({
5374
5869
  current: boolean(),
5375
5870
  client: nullable(text),
@@ -5379,7 +5874,7 @@ var accountSession = strictObject({
5379
5874
  created_at: optional(nullable(time))
5380
5875
  });
5381
5876
 
5382
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/account-change.js
5877
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/account-change.js
5383
5878
  var accountChange = strictObject({ operation_id: id, account: omit(account, ["provider", "scope"]) });
5384
5879
  var endedAccountSessions = strictObject({ operation_id: id, sessions: array(accountSession) });
5385
5880
  var audience = picklist(["everyone", "contacts", "nobody"]);
@@ -5408,7 +5903,7 @@ var accountRemoval = strictObject({
5408
5903
  kept: array(strictObject({ kind: removalKind, target: text, reason: text }))
5409
5904
  });
5410
5905
 
5411
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/account-profile.js
5906
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/account-profile.js
5412
5907
  var accountProfile = strictObject({
5413
5908
  profile: id,
5414
5909
  current: boolean(),
@@ -5420,7 +5915,7 @@ var accountProfile = strictObject({
5420
5915
  bot: optional(literal(true))
5421
5916
  });
5422
5917
 
5423
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/counter-reading.js
5918
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/counter-reading.js
5424
5919
  var milliseconds = pipe(number(), minValue(0));
5425
5920
  var counterReading = strictObject({
5426
5921
  counter: picklist(["views", "reactions", "comments"]),
@@ -5432,7 +5927,7 @@ var counterReading = strictObject({
5432
5927
  });
5433
5928
  var selection = record(string(), unknown());
5434
5929
 
5435
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/admin-report.js
5930
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/admin-report.js
5436
5931
  var adminRow = strictObject({
5437
5932
  ref: reference,
5438
5933
  /** What `stats * evidence` takes: a person id, a stay or a message locator. */
@@ -5485,11 +5980,143 @@ var adminReport = strictObject({
5485
5980
  rows: array(adminRow)
5486
5981
  });
5487
5982
 
5488
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/analysis-consent.js
5983
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/task.js
5984
+ var closeSuggestion = strictObject({
5985
+ as: picklist(["done", "dismissed"]),
5986
+ /** The agent's name. */
5987
+ by: text,
5988
+ /** 0–1, as the agent rated it. */
5989
+ certainty: number(),
5990
+ reason: nullable(text),
5991
+ at: time
5992
+ });
5993
+ var task = strictObject({
5994
+ ref: reference,
5995
+ id,
5996
+ /** The readable key: `Q-15` for a task found in a message from now on, `IN1A2B3C4D-17` before, `HRB-12` in a project. */
5997
+ key: optional(nullable(text)),
5998
+ title: nullable(text),
5999
+ description: optional(nullable(text)),
6000
+ kind: picklist(TASK_TYPES),
6001
+ state: picklist(TASK_STATES),
6002
+ origin: optional(picklist(TASK_ORIGINS)),
6003
+ project: optional(nullable(text)),
6004
+ /** The project's key and name, as `tasks counts` names it. */
6005
+ project_key: optional(nullable(text)),
6006
+ project_name: optional(nullable(text)),
6007
+ /** Who added it: the owner, or an agent by its bot name. */
6008
+ created_by: optional(nullable(strictObject({ type: picklist(["person", "bot"]), id, name: nullable(text), owner: boolean() }))),
6009
+ account: optional(text),
6010
+ /** The chat it came from, as a `chat:` reference. */
6011
+ chat: optional(nullable(reference)),
6012
+ /** The message it came from. */
6013
+ source_message: optional(nullable(reference)),
6014
+ /** `<service>:<id>`, its id in an outside service, such as `avito:4512345678`. */
6015
+ external_id: optional(nullable(text)),
6016
+ /** The http or https page it is about, such as an Avito ad. */
6017
+ source_url: optional(nullable(text)),
6018
+ /** 0 to 1, higher first; `priority_label` reads it as low, medium, high or critical. */
6019
+ priority: optional(nullable(number())),
6020
+ priority_label: optional(nullable(picklist(PRIORITY_LABELS))),
6021
+ /** The agent working on it, apart from its assignees and its claim. */
6022
+ agent: optional(nullable(text)),
6023
+ /** Give it back with `--revision` to refuse a write made on a stale copy. */
6024
+ revision: optional(number()),
6025
+ assignments: optional(array(strictObject({ to: reference, role: picklist(["assignee", "reviewer", "watcher"]) }))),
6026
+ /** Open work whose blocked-by tasks are all done. */
6027
+ ready: optional(boolean()),
6028
+ /** The blocked-by tasks not done yet: open (any open state), dismissed, or unavailable. */
6029
+ blocked_by: optional(array(strictObject({ task: reference, state: picklist(["open", "dismissed", "unavailable"]) }))),
6030
+ parent: optional(nullable(reference)),
6031
+ due_at: optional(nullable(time)),
6032
+ closed_at: optional(nullable(time)),
6033
+ reason: optional(nullable(text)),
6034
+ /** One name from the category list (`tasks categories`). */
6035
+ category: optional(nullable(text)),
6036
+ /** Who works on it now, and until when; null when nobody does. */
6037
+ claimed_by: optional(nullable(text)),
6038
+ claimed_until: optional(nullable(time)),
6039
+ /** The close an agent would make, waiting on the owner: `tasks close` confirms it, `tasks reject` refuses it. */
6040
+ close_suggestion: optional(nullable(closeSuggestion)),
6041
+ created_at: time,
6042
+ updated_at: optional(time)
6043
+ });
6044
+
6045
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/agenda.js
6046
+ var agendaChat = strictObject({
6047
+ chat: reference,
6048
+ title: nullable(text),
6049
+ kind: picklist(["dialog", "group", "channel", "saved", "unknown"]),
6050
+ /** The newest message, never its text; `null` while it is not stored. */
6051
+ last_message: nullable(reference),
6052
+ last_message_at: time,
6053
+ /** `null` when the newest message is not stored, or the messenger did not say who sent it. */
6054
+ last_from_owner: nullable(boolean()),
6055
+ /** Open tasks whose source is in this chat. */
6056
+ open_tasks: array(id),
6057
+ /** `unknown` means nothing ever fetched the chat's history; `partial` that the store holds only part of it. */
6058
+ completeness: strictObject({
6059
+ state: picklist(["complete", "partial", "unknown"]),
6060
+ up_to_date: nullable(boolean()),
6061
+ gaps: boolean(),
6062
+ reaches_start: boolean(),
6063
+ fetched_at: nullable(time)
6064
+ }),
6065
+ /** What the store holds of the chat: the count and the span, never the text. */
6066
+ held: strictObject({ messages: number(), oldest_at: nullable(time), newest_at: nullable(time) })
6067
+ });
6068
+ var agenda = strictObject({
6069
+ at: time,
6070
+ account: text,
6071
+ stored_at: nullable(time),
6072
+ /** The store saved nothing for a day: a chat may look quiet only because nothing was synced. */
6073
+ stale: boolean(),
6074
+ tasks: array(strictObject({
6075
+ id,
6076
+ key: text,
6077
+ title: nullable(text),
6078
+ kind: picklist(TASK_TYPES),
6079
+ category: nullable(text),
6080
+ /** The message or note it came from. */
6081
+ source: nullable(reference),
6082
+ due_at: nullable(time),
6083
+ next_check_at: nullable(time),
6084
+ /** Who works on it now; only the asker's own claims are listed unless the query names claimed:. */
6085
+ claimed_by: nullable(text),
6086
+ claimed_until: nullable(time),
6087
+ /** An agent's close waiting on the owner: `tasks close` confirms it, `tasks reject` refuses it. */
6088
+ close_suggestion: nullable(closeSuggestion),
6089
+ created_at: time,
6090
+ reasons: array(picklist(["overdue", "due", "check", "unplanned", "close-suggested"]))
6091
+ })),
6092
+ /** Someone else wrote last, and the owner has not answered. */
6093
+ owed: array(agendaChat),
6094
+ /** The owner wrote last, and nobody answered. */
6095
+ waiting: array(agendaChat),
6096
+ /** The chat list says these moved and their newest message is not stored: read them first. */
6097
+ unsynced: array(agendaChat),
6098
+ /** Open tasks someone else does: what they owe the owner, oldest first. */
6099
+ assigned: array(strictObject({
6100
+ id,
6101
+ key: text,
6102
+ title: nullable(text),
6103
+ kind: picklist(TASK_TYPES),
6104
+ category: nullable(text),
6105
+ source: nullable(reference),
6106
+ due_at: nullable(time),
6107
+ created_at: time,
6108
+ /** `person:<id>`, each one who does it. */
6109
+ assignees: array(reference)
6110
+ })),
6111
+ /** Open tasks carry these categories, which the list no longer holds: move them, or put the category back. */
6112
+ unlisted_categories: array(strictObject({ name: text, open_tasks: number() }))
6113
+ });
6114
+
6115
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/analysis-consent.js
5489
6116
  var analysisConsent = strictObject({ chat: id, provider: text, at: time });
5490
6117
  var analysisConsentRevocation = strictObject({ revoked: boolean() });
5491
6118
 
5492
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/attachment-results.js
6119
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/attachment-results.js
5493
6120
  var fingerprint = pipe(text, regex(/^[a-f0-9]{64}$/));
5494
6121
  var attachmentBytes = strictObject({
5495
6122
  ref: reference,
@@ -5520,7 +6147,7 @@ var attachmentTextChange = strictObject({
5520
6147
  text: optional(text)
5521
6148
  });
5522
6149
 
5523
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/chart.js
6150
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/chart.js
5524
6151
  var chart = strictObject({
5525
6152
  version: literal(1),
5526
6153
  kind: picklist(["bar", "line", "grouped-bar"]),
@@ -5535,7 +6162,7 @@ var chart = strictObject({
5535
6162
  file: optional(strictObject({ path: text, format: picklist(["svg", "png"]), width: count, height: count }))
5536
6163
  });
5537
6164
 
5538
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/folder.js
6165
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/folder.js
5539
6166
  var named = strictObject({
5540
6167
  id,
5541
6168
  title: nullable(text),
@@ -5558,7 +6185,7 @@ var folder = strictObject({
5558
6185
  excluded_chats: optional(array(named))
5559
6186
  });
5560
6187
 
5561
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/invite-link.js
6188
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/invite-link.js
5562
6189
  var inviteLink = strictObject({
5563
6190
  link: text,
5564
6191
  /** Who joins by it asks first, and an admin lets them in. */
@@ -5574,7 +6201,7 @@ var inviteLink = strictObject({
5574
6201
  joined_count: optional(count)
5575
6202
  });
5576
6203
 
5577
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/chat-admin.js
6204
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/chat-admin.js
5578
6205
  var operated = { operation_id: id, chat_id: id };
5579
6206
  var group = strictObject({
5580
6207
  ...omit(chat, ["ref", "provider", "account", "invite_link", "members"]).entries,
@@ -5654,7 +6281,7 @@ var chatFolderOrder = strictObject({
5654
6281
  folders: array(strictObject({ id, title: text }))
5655
6282
  });
5656
6283
 
5657
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/chat-change.js
6284
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/chat-change.js
5658
6285
  var operated2 = { operation_id: id, chat_id: id };
5659
6286
  var chatRemoval = strictObject(operated2);
5660
6287
  var chatMuting = strictObject({
@@ -5665,7 +6292,7 @@ var chatArchive = strictObject({ ...operated2, archived: boolean() });
5665
6292
  var chatPin = strictObject({ ...operated2, pinned: boolean() });
5666
6293
  var chatUnread = strictObject({ ...operated2, unread: literal(true) });
5667
6294
 
5668
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/chat-event.js
6295
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/chat-event.js
5669
6296
  var who = strictObject({ id: nullable(id), name: nullable(text), username: optional(nullable(text)) });
5670
6297
  var chatEvent = strictObject({
5671
6298
  chat_id: id,
@@ -5682,7 +6309,7 @@ var chatEvent = strictObject({
5682
6309
  before: optional(strictObject({ name: nullable(text), username: nullable(text) }))
5683
6310
  });
5684
6311
 
5685
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/chat-metadata.js
6312
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/chat-metadata.js
5686
6313
  var chatMetadata = strictObject({
5687
6314
  chat_id: id,
5688
6315
  title: nullable(text),
@@ -5697,7 +6324,7 @@ var chatMetadataRefresh = strictObject({
5697
6324
  has_more: boolean()
5698
6325
  });
5699
6326
 
5700
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/chat-moderation.js
6327
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/chat-moderation.js
5701
6328
  var action = picklist(["report", "delete", "remove"]);
5702
6329
  var level = picklist(["deny", "readonly", "ask", "allow"]);
5703
6330
  var chatRules = strictObject({
@@ -5734,7 +6361,7 @@ var chatModeration = strictObject({
5734
6361
  }))
5735
6362
  });
5736
6363
 
5737
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/chat-stats.js
6364
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/chat-stats.js
5738
6365
  var optionalCount = optional(count);
5739
6366
  var minutes = nullable(number());
5740
6367
  var chatStats = strictObject({
@@ -5810,7 +6437,7 @@ var taskStats = strictObject({
5810
6437
  }))
5811
6438
  });
5812
6439
 
5813
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/chat-tracking.js
6440
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/chat-tracking.js
5814
6441
  var memberCount = strictObject({
5815
6442
  day: pipe(text, isoDate()),
5816
6443
  participants: nullable(count),
@@ -5833,7 +6460,7 @@ var chatTracking = strictObject({
5833
6460
  tracked: boolean()
5834
6461
  });
5835
6462
 
5836
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/contact-read.js
6463
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/contact-read.js
5837
6464
  var contactLookup = strictObject({ id, name: nullable(text), username: nullable(text) });
5838
6465
  var contactSync = strictObject({ added: count, changed: count, known: count });
5839
6466
  var profileFields = {
@@ -5871,7 +6498,7 @@ var profileFields = {
5871
6498
  }))
5872
6499
  };
5873
6500
 
5874
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/contact.js
6501
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/contact.js
5875
6502
  var contact = strictObject({
5876
6503
  ref: reference,
5877
6504
  id,
@@ -5902,7 +6529,7 @@ var contact = strictObject({
5902
6529
  notes: optional(array(strictObject({ id, text, revision: count, created_at: time, updated_at: time })))
5903
6530
  });
5904
6531
 
5905
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/contact-note.js
6532
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/contact-note.js
5906
6533
  var contactNote = strictObject({
5907
6534
  id,
5908
6535
  /** The contact, as a `contact:` reference. */
@@ -5914,13 +6541,28 @@ var contactNote = strictObject({
5914
6541
  updated_at: time
5915
6542
  });
5916
6543
 
5917
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/contact-write.js
6544
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/contact-write.js
5918
6545
  var addressBookPerson = strictObject({ id, name: nullable(text), username: nullable(text) });
5919
6546
  var contactUpdate = strictObject({ operation_id: id, person: addressBookPerson });
5920
6547
  var contactStateChange = strictObject({ operation_id: id, person_id: id });
5921
6548
  var contactImport = strictObject({ operation_id: id, sent: count, recognised: array(addressBookPerson) });
5922
6549
 
5923
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/conversation-results.js
6550
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/conversation.js
6551
+ var conversation = strictObject({
6552
+ id,
6553
+ chat: reference,
6554
+ /** The message it starts with. */
6555
+ first_message: reference,
6556
+ started_at: time,
6557
+ ended_at: time,
6558
+ messages_count: count,
6559
+ /** How many people wrote in it. */
6560
+ senders_count: count,
6561
+ built_at: time,
6562
+ rules_version: count
6563
+ });
6564
+
6565
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/conversation-results.js
5924
6566
  var conversationDetails = union([
5925
6567
  strictObject({ ...conversation.entries, messages: array(message) }),
5926
6568
  message
@@ -6010,7 +6652,7 @@ var conversationHit = strictObject({
6010
6652
  stale: boolean()
6011
6653
  });
6012
6654
 
6013
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/counters.js
6655
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/counters.js
6014
6656
  var counters = strictObject({
6015
6657
  cutoff: time,
6016
6658
  max_age_ms: milliseconds,
@@ -6040,7 +6682,7 @@ var counterRefresh = strictObject({
6040
6682
  complete: optional(boolean())
6041
6683
  });
6042
6684
 
6043
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/document.js
6685
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/document.js
6044
6686
  var document = strictObject({
6045
6687
  ref: reference,
6046
6688
  id,
@@ -6055,7 +6697,7 @@ var document = strictObject({
6055
6697
  owners: optional(array(text))
6056
6698
  });
6057
6699
 
6058
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/document-link.js
6700
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/document-link.js
6059
6701
  var documentLink = strictObject({
6060
6702
  ref: reference,
6061
6703
  url: text,
@@ -6066,7 +6708,7 @@ var documentLink = strictObject({
6066
6708
  sender: strictObject({ id: nullable(id), name: nullable(text) })
6067
6709
  });
6068
6710
 
6069
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/evidence.js
6711
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/evidence.js
6070
6712
  var evidenceMessage = pick(message, ["ref", "chat_title", "timestamp", "sender_name", "text"]);
6071
6713
  var contribution = strictObject({
6072
6714
  message: evidenceMessage,
@@ -6096,7 +6738,7 @@ var retentionStay = strictObject({
6096
6738
  });
6097
6739
  var evidence = union([contribution, retentionStay]);
6098
6740
 
6099
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/fact.js
6741
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/fact.js
6100
6742
  var fact = strictObject({
6101
6743
  ref: reference,
6102
6744
  id,
@@ -6127,7 +6769,7 @@ var fact = strictObject({
6127
6769
  updated_at: time
6128
6770
  });
6129
6771
 
6130
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/hit.js
6772
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/hit.js
6131
6773
  var hit = strictObject({
6132
6774
  kind: picklist(["message", "mail", "note", "document", "event", "meeting", "deal", "lead", ...BUSINESS_KINDS]),
6133
6775
  ref: reference,
@@ -6175,7 +6817,7 @@ var hit = strictObject({
6175
6817
  untrusted
6176
6818
  });
6177
6819
 
6178
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/identity.js
6820
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/identity.js
6179
6821
  var identity = strictObject({
6180
6822
  ref: reference,
6181
6823
  provider: text,
@@ -6191,7 +6833,7 @@ var identity = strictObject({
6191
6833
  person: optional(nullable(reference))
6192
6834
  });
6193
6835
 
6194
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/image-embedding.js
6836
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/image-embedding.js
6195
6837
  var imageEmbedding = strictObject({
6196
6838
  model: text,
6197
6839
  embedded: count,
@@ -6200,7 +6842,7 @@ var imageEmbedding = strictObject({
6200
6842
  more: boolean()
6201
6843
  });
6202
6844
 
6203
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/join-request.js
6845
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/join-request.js
6204
6846
  var joinRequest = strictObject({
6205
6847
  person_id: id,
6206
6848
  name: nullable(text),
@@ -6211,7 +6853,7 @@ var joinRequest = strictObject({
6211
6853
  about: optional(text)
6212
6854
  });
6213
6855
 
6214
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/poll-vote.js
6856
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/poll-vote.js
6215
6857
  var pollVote = strictObject({
6216
6858
  person_id: id,
6217
6859
  name: nullable(text),
@@ -6221,7 +6863,7 @@ var pollVote = strictObject({
6221
6863
  voted_at: time
6222
6864
  });
6223
6865
 
6224
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/listener.js
6866
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/listener.js
6225
6867
  var reactions = unwrap(unwrap(message.entries.reactions));
6226
6868
  var observation = strictObject({
6227
6869
  value: pipe(number(), minValue(0)),
@@ -6263,7 +6905,7 @@ var serveSummary = strictObject({
6263
6905
  tasks: optional(strictObject({ added: count, closed: count, review: count }))
6264
6906
  });
6265
6907
 
6266
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/mail-counts.js
6908
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/mail-counts.js
6267
6909
  var mailCounts = strictObject({
6268
6910
  by: picklist(["day", "week", "sender"]),
6269
6911
  received: count,
@@ -6278,7 +6920,7 @@ var mailCounts = strictObject({
6278
6920
  }))
6279
6921
  });
6280
6922
 
6281
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/mail-findings.js
6923
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/mail-findings.js
6282
6924
  var evidence2 = strictObject({ reference, fingerprint: text });
6283
6925
  var base = { id, evidence: array(evidence2) };
6284
6926
  var finding = variant("kind", [
@@ -6422,7 +7064,7 @@ var mailFindings = strictObject({
6422
7064
  receipt: nullable(strictObject({ preview_fingerprint: text, accepted: array(id), items: array(outcome2) }))
6423
7065
  });
6424
7066
 
6425
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/media-archive.js
7067
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/media-archive.js
6426
7068
  var mediaArchive = strictObject({
6427
7069
  directory: text,
6428
7070
  chats: count,
@@ -6454,7 +7096,7 @@ var mediaArchiveTimer = union([
6454
7096
  strictObject({ ...timer, action: picklist(["install", "start", "stop", "uninstall"]) })
6455
7097
  ]);
6456
7098
 
6457
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/meeting-preparation-parts.js
7099
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/meeting-preparation-parts.js
6458
7100
  var preparationId = pipe(string(), minLength(1));
6459
7101
  var preparationCount = pipe(number(), integer(), minValue(0));
6460
7102
  var preparationTime = nullable(isoTime);
@@ -6546,7 +7188,7 @@ var preparationMeeting = strictObject({
6546
7188
  updated_at: isoTime
6547
7189
  });
6548
7190
 
6549
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/meeting-evidence.js
7191
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/meeting-evidence.js
6550
7192
  var meetingEvidence = preparationEvidence;
6551
7193
  var meetingPersonContext = strictObject({
6552
7194
  person: strictObject({ uid: string(), name: nullable(string()) }),
@@ -6568,7 +7210,7 @@ var meetingPersonContext = strictObject({
6568
7210
  })
6569
7211
  });
6570
7212
 
6571
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/meeting-findings.js
7213
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/meeting-findings.js
6572
7214
  var evidence3 = strictObject({ reference, fingerprint: text });
6573
7215
  var base2 = { id, project: reference, evidence: array(evidence3) };
6574
7216
  var finding2 = variant("kind", [
@@ -6606,7 +7248,7 @@ var meetingFindings = strictObject({
6606
7248
  receipt: nullable(strictObject({ preview_fingerprint: text, accepted: array(id), items: array(outcome3) }))
6607
7249
  });
6608
7250
 
6609
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/meeting-communications.js
7251
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/meeting-communications.js
6610
7252
  var communicationCoverage = strictObject({
6611
7253
  read_usage: strictObject({ reads: preparationCount, charged_bytes: preparationCount, reserved_bytes: preparationCount, remaining_bytes: preparationCount }),
6612
7254
  query: string(),
@@ -6651,7 +7293,7 @@ var preparationCommunications = strictObject({
6651
7293
  }))
6652
7294
  });
6653
7295
 
6654
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/meeting-preparation.js
7296
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/meeting-preparation.js
6655
7297
  var meetingPreparation = strictObject({
6656
7298
  communications: optional(preparationCommunications),
6657
7299
  schema_version: literal(1),
@@ -6764,7 +7406,7 @@ var meetingPreparation = strictObject({
6764
7406
  })
6765
7407
  });
6766
7408
 
6767
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/meeting-project-candidates.js
7409
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/meeting-project-candidates.js
6768
7410
  var count3 = pipe(number(), integer(), minValue(0));
6769
7411
  var id3 = pipe(string(), minLength(1));
6770
7412
  var text3 = string();
@@ -6828,7 +7470,7 @@ var meetingProjectCandidates = strictObject({
6828
7470
  })
6829
7471
  });
6830
7472
 
6831
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/meeting-series-inventory.js
7473
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/meeting-series-inventory.js
6832
7474
  var count4 = pipe(number(), integer(), minValue(0));
6833
7475
  var id4 = pipe(string(), minLength(1), maxLength(1e3));
6834
7476
  var meetingSeriesInventory = strictObject({
@@ -6858,7 +7500,7 @@ var meetingSeriesInventory = strictObject({
6858
7500
  })
6859
7501
  });
6860
7502
 
6861
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/meeting-task-proposal.js
7503
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/meeting-task-proposal.js
6862
7504
  var text4 = string();
6863
7505
  var id5 = pipe(number(), integer(), minValue(1));
6864
7506
  var revision = picklist(["current", "superseded"]);
@@ -6875,7 +7517,7 @@ var meetingTaskProposal = strictObject({
6875
7517
  persistence: literal("proposal-only")
6876
7518
  });
6877
7519
 
6878
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/memory.js
7520
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/memory.js
6879
7521
  var memory = strictObject({
6880
7522
  ref: reference,
6881
7523
  id,
@@ -6903,7 +7545,7 @@ var memory = strictObject({
6903
7545
  updated_at: time
6904
7546
  });
6905
7547
 
6906
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/mention.js
7548
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/mention.js
6907
7549
  var kind = picklist(["phone", "email", "url", "document", "person-name", "place"]);
6908
7550
  var status = picklist(["found", "linked", "proposed", "dismissed"]);
6909
7551
  var mention = strictObject({
@@ -6947,13 +7589,13 @@ var mentionRebuild = strictObject({
6947
7589
  mentions: count
6948
7590
  });
6949
7591
 
6950
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/message-change.js
7592
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/message-change.js
6951
7593
  var operated3 = { operation_id: id, chat_id: id };
6952
7594
  var messagePin = strictObject({ ...operated3, message_id: id, pinned: boolean() });
6953
7595
  var messageStar = strictObject({ ...operated3, message_id: id, starred: boolean() });
6954
7596
  var messageDeletion = strictObject({ ...operated3, deleted: array(id), for_everyone: boolean() });
6955
7597
 
6956
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/message-read.js
7598
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/message-read.js
6957
7599
  var messageTranscript = strictObject({
6958
7600
  message_id: id,
6959
7601
  text,
@@ -7011,7 +7653,7 @@ var evidencePacket = strictObject({
7011
7653
  }))
7012
7654
  });
7013
7655
 
7014
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/message-context.js
7656
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/message-context.js
7015
7657
  var messageThread = strictObject({
7016
7658
  ref: reference,
7017
7659
  chat: id,
@@ -7028,7 +7670,7 @@ var messageThread = strictObject({
7028
7670
  });
7029
7671
  var messageContext = union([message, messageThread]);
7030
7672
 
7031
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/message-counts.js
7673
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/message-counts.js
7032
7674
  var messageCounts = strictObject({
7033
7675
  by: picklist(["chat", "sender", "day", "hour"]),
7034
7676
  total: count,
@@ -7041,7 +7683,7 @@ var messageCounts = strictObject({
7041
7683
  }))
7042
7684
  });
7043
7685
 
7044
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/message-link.js
7686
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/message-link.js
7045
7687
  var messageLink = strictObject({
7046
7688
  ref: reference,
7047
7689
  url: nullable(text),
@@ -7058,7 +7700,7 @@ var messageLink = strictObject({
7058
7700
  })))
7059
7701
  });
7060
7702
 
7061
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/message-write.js
7703
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/message-write.js
7062
7704
  var messageWrite = strictObject({
7063
7705
  operation_id: id,
7064
7706
  message,
@@ -7073,7 +7715,7 @@ var draftWrite = strictObject({
7073
7715
  });
7074
7716
  var messageSend = union([messageWrite, draftWrite]);
7075
7717
 
7076
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/model.js
7718
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/model.js
7077
7719
  var model = strictObject({
7078
7720
  id,
7079
7721
  kind: picklist(["audio", "text", "image", "reranker"]),
@@ -7108,7 +7750,7 @@ var chosenModel = strictObject({
7108
7750
  estimate_seconds: nullable(count)
7109
7751
  });
7110
7752
 
7111
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/model-key.js
7753
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/model-key.js
7112
7754
  var source = picklist(["environment", "keyring", "file"]);
7113
7755
  var modelKey = strictObject({
7114
7756
  provider: text,
@@ -7118,7 +7760,7 @@ var modelKey = strictObject({
7118
7760
  var storedModelKey = strictObject({ ...omit(modelKey, ["removed"]).entries, stored: source });
7119
7761
  var removedModelKey = strictObject({ ...omit(modelKey, ["stored"]).entries, removed: array(source) });
7120
7762
 
7121
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/official-stats.js
7763
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/official-stats.js
7122
7764
  var versus = strictObject({ current: number(), previous: number() });
7123
7765
  var person = { person_ref: reference, name: nullable(text) };
7124
7766
  var graph = strictObject({
@@ -7152,14 +7794,14 @@ var officialStats = strictObject({
7152
7794
  graphs: record(string(), union([graph, strictObject({ error: text })]))
7153
7795
  });
7154
7796
 
7155
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/person.js
7797
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/person.js
7156
7798
  var person2 = strictObject({
7157
7799
  ref: reference,
7158
7800
  name: nullable(text),
7159
7801
  identities: optional(array(identity))
7160
7802
  });
7161
7803
 
7162
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/poll.js
7804
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/poll.js
7163
7805
  var poll = strictObject({
7164
7806
  chat_id: id,
7165
7807
  message_id: id,
@@ -7175,11 +7817,11 @@ var poll = strictObject({
7175
7817
  });
7176
7818
  var pollChange = strictObject({ operation_id: id, poll });
7177
7819
 
7178
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/private-contact.js
7820
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/private-contact.js
7179
7821
  var contactAlias = strictObject({ person_id: id, alias: nullable(text) });
7180
7822
  var contactNoteRemoval = strictObject({ id, person_id: id, removed: boolean() });
7181
7823
 
7182
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/ranking.js
7824
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/ranking.js
7183
7825
  var figures = record(string(), number());
7184
7826
  var freshness = picklist(["fresh", "stale", "partial", "unknown"]);
7185
7827
  var rankingRow = strictObject({
@@ -7226,7 +7868,7 @@ var ranking = strictObject({
7226
7868
  rows: array(rankingRow)
7227
7869
  });
7228
7870
 
7229
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/reaction.js
7871
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/reaction.js
7230
7872
  var reaction = strictObject({
7231
7873
  person: strictObject({ id, name: nullable(text), username: nullable(text) }),
7232
7874
  /** The emoji, or `custom:<id>` for a custom one. */
@@ -7234,7 +7876,7 @@ var reaction = strictObject({
7234
7876
  reacted_at: time
7235
7877
  });
7236
7878
 
7237
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/reaction-change.js
7879
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/reaction-change.js
7238
7880
  var reactionChange = strictObject({
7239
7881
  operation_id: id,
7240
7882
  chat_id: id,
@@ -7242,7 +7884,7 @@ var reactionChange = strictObject({
7242
7884
  reaction: nullable(text)
7243
7885
  });
7244
7886
 
7245
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/recipient.js
7887
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/recipient.js
7246
7888
  var recipient = strictObject({ id, title: nullable(text), partner_id: optional(id), added_at: time });
7247
7889
  var recipientAdded = strictObject({ id, title: nullable(text), added: boolean() });
7248
7890
  var recipientRemoved = strictObject({ id, title: nullable(text), removed: boolean() });
@@ -7253,7 +7895,7 @@ var recipientChange = strictObject({
7253
7895
  ...partial(recipientOff).entries
7254
7896
  });
7255
7897
 
7256
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/recorded-run.js
7898
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/recorded-run.js
7257
7899
  var events = array(record(string(), unknown()));
7258
7900
  var recordedRun = strictObject({
7259
7901
  run_id: id,
@@ -7325,7 +7967,7 @@ var runHit = strictObject({
7325
7967
  });
7326
7968
  var runLocation = strictObject({ path: text });
7327
7969
 
7328
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/relationship.js
7970
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/relationship.js
7329
7971
  var relationship = strictObject({
7330
7972
  id,
7331
7973
  from: reference,
@@ -7352,7 +7994,7 @@ var relationship = strictObject({
7352
7994
  created_at: time
7353
7995
  });
7354
7996
 
7355
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/reply-stats.js
7997
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/reply-stats.js
7356
7998
  var milliseconds2 = nullable(pipe(number(), minValue(0)));
7357
7999
  var figures2 = { replies: count, median_ms: milliseconds2, p90_ms: milliseconds2, mean_ms: milliseconds2 };
7358
8000
  var responseTimes = strictObject({
@@ -7369,7 +8011,7 @@ var waitingChats = strictObject({
7369
8011
  by_kind: strictObject({ private: count, group: count })
7370
8012
  });
7371
8013
 
7372
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/retention.js
8014
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/retention.js
7373
8015
  var retentionCohort = strictObject({
7374
8016
  /** The first day of the joining day or week. */
7375
8017
  cohort: text,
@@ -7417,7 +8059,7 @@ var retention = strictObject({
7417
8059
  rows: array(retentionCohort)
7418
8060
  });
7419
8061
 
7420
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/saved-search.js
8062
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/saved-search.js
7421
8063
  var savedSearch = strictObject({
7422
8064
  id,
7423
8065
  /** `null` for a run in the history. */
@@ -7434,7 +8076,7 @@ var savedSearch = strictObject({
7434
8076
  });
7435
8077
  var searchHistoryClear = strictObject({ cleared: count });
7436
8078
 
7437
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/send-attempt.js
8079
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/send-attempt.js
7438
8080
  var sendAttempt = strictObject({
7439
8081
  at: time,
7440
8082
  profile: text,
@@ -7462,7 +8104,7 @@ var sendAttempt = strictObject({
7462
8104
  error_code: optional(text)
7463
8105
  });
7464
8106
 
7465
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/store-maintenance.js
8107
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/store-maintenance.js
7466
8108
  var absent = strictObject({ path: text, exists: literal(false) });
7467
8109
  var schema = strictObject({ version: count, min_compatible: count, writable: boolean(), speaks: count });
7468
8110
  var infoSchema = strictObject({
@@ -7692,7 +8334,7 @@ var storeRepair = union([
7692
8334
  ]);
7693
8335
  var storeCopyRemoval = strictObject({ path: text, deleted: strictObject({ name: text, rows: count }) });
7694
8336
 
7695
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/store-table.js
8337
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/store-table.js
7696
8338
  var TABLE_KINDS = ["data", "search_index", "search_index_part", "internal"];
7697
8339
  var storeTable = strictObject({
7698
8340
  name: text,
@@ -7701,7 +8343,7 @@ var storeTable = strictObject({
7701
8343
  bytes: optional(nullable(count))
7702
8344
  });
7703
8345
 
7704
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/tag-change.js
8346
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/tag-change.js
7705
8347
  var tagTarget = variant("type", [
7706
8348
  strictObject({ type: literal("chat"), chat_id: id }),
7707
8349
  strictObject({ type: literal("contact"), person_id: id }),
@@ -7732,7 +8374,20 @@ var automaticTags = strictObject({
7732
8374
  dry_run: boolean()
7733
8375
  });
7734
8376
 
7735
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/task-pair.js
8377
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/tagging.js
8378
+ var tagging = strictObject({
8379
+ tag: text,
8380
+ type: picklist(TAG_TYPES),
8381
+ /** What carries it: a `chat:`, `contact:` or `msg:` reference. */
8382
+ target: reference,
8383
+ /** The chat's title or the person's name, as the store holds it. */
8384
+ name: nullable(text),
8385
+ /** Who claims it: `manual` the owner, `auto` the keyword rules; both when both do. */
8386
+ sources: array(picklist(["manual", "auto"])),
8387
+ created_at: time
8388
+ });
8389
+
8390
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/task-pair.js
7736
8391
  var side = strictObject({ ref: reference, key: text, title: text, status: text });
7737
8392
  var taskPair = strictObject({
7738
8393
  task: nullable(side),
@@ -7755,7 +8410,7 @@ var taskPair = strictObject({
7755
8410
  created_at: time
7756
8411
  });
7757
8412
 
7758
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/task-results.js
8413
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/task-results.js
7759
8414
  var nullableTime = nullable(time);
7760
8415
  var link = strictObject({
7761
8416
  id,
@@ -7929,7 +8584,7 @@ var taskReview = strictObject({
7929
8584
  untrusted
7930
8585
  });
7931
8586
 
7932
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/template.js
8587
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/template.js
7933
8588
  var template = strictObject({
7934
8589
  key: text,
7935
8590
  channel: picklist(["telegram", "email", "text"]),
@@ -7941,7 +8596,7 @@ var template = strictObject({
7941
8596
  updated_by: nullable(text)
7942
8597
  });
7943
8598
 
7944
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/topic.js
8599
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/topic.js
7945
8600
  var topic = strictObject({
7946
8601
  id,
7947
8602
  title: text,
@@ -7955,7 +8610,7 @@ var topic = strictObject({
7955
8610
  untrusted
7956
8611
  });
7957
8612
 
7958
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/entities/index.js
8613
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/index.js
7959
8614
  var ENTITIES = {
7960
8615
  sync_progress: progress,
7961
8616
  deal,
@@ -8250,7 +8905,7 @@ var entityDefinitions = /* @__PURE__ */ __name(() => Object.fromEntries(Object.e
8250
8905
  return [name, definition];
8251
8906
  })), "entityDefinitions");
8252
8907
 
8253
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/answer-entity.js
8908
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/answer-entity.js
8254
8909
  var schemas = /* @__PURE__ */ new WeakMap();
8255
8910
  var answerEntity = /* @__PURE__ */ __name((command, name, schema2, options = {}) => {
8256
8911
  if (Object.hasOwn(ENTITIES, name))
@@ -8284,7 +8939,7 @@ var answerRow = /* @__PURE__ */ __name((command) => {
8284
8939
  return own && metaOf(command).output?.entity === own.name ? own.row : void 0;
8285
8940
  }, "answerRow");
8286
8941
 
8287
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/project-status-rows.js
8942
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/project-status-rows.js
8288
8943
  var where = [{ field: "ref" }];
8289
8944
  var who2 = { field: ["who.owner", "who.name"], tag: "you" };
8290
8945
  var ON_CHAT_ROW = /* @__PURE__ */ new Set(["reply-next", "coverage"]);
@@ -8376,7 +9031,7 @@ var STATUS_ROWS = {
8376
9031
  "status.failed": { columns: [{ field: "signal" }], text: ["why"] }
8377
9032
  };
8378
9033
 
8379
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/compact.js
9034
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/compact.js
8380
9035
  var TEXT_CHARS = 400;
8381
9036
  var sender = { field: ["sender_is_me", "sender_name"], tag: "me" };
8382
9037
  var messageRow = {
@@ -8744,7 +9399,7 @@ var compactText = /* @__PURE__ */ __name((body, shape, options, rowsOf = rowsOfE
8744
9399
  return lines.concat(footerOf(body)).join("\n");
8745
9400
  }, "compactText");
8746
9401
 
8747
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/result-fields.js
9402
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/result-fields.js
8748
9403
  var named2 = /* @__PURE__ */ __name((work) => {
8749
9404
  try {
8750
9405
  return work();
@@ -8771,7 +9426,7 @@ var projectFields2 = /* @__PURE__ */ __name((value, fields) => named2(() => {
8771
9426
  return projectFields(value, fields);
8772
9427
  }), "projectFields");
8773
9428
 
8774
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/runs/log-events.js
9429
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/runs/log-events.js
8775
9430
  var CORE_LOG_EVENTS = defineLogEvents([
8776
9431
  { id: "provider.request", meaning: "a request went to the messenger", keys: ["operation"] },
8777
9432
  { id: "provider.response", meaning: "the messenger answered the request, or it failed", keys: ["operation"] },
@@ -8809,7 +9464,7 @@ var DIAGNOSTIC_LOG_EVENTS = {
8809
9464
  progress: "sync.progress"
8810
9465
  };
8811
9466
 
8812
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/runs/recording.js
9467
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/runs/recording.js
8813
9468
  var recorded = /* @__PURE__ */ __name(async (options, body) => {
8814
9469
  const recording = startRecording(options);
8815
9470
  try {
@@ -9024,7 +9679,7 @@ var partialOutcome = /* @__PURE__ */ __name((answer) => {
9024
9679
  return void 0;
9025
9680
  }, "partialOutcome");
9026
9681
 
9027
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/command-server-request.js
9682
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/command-server-request.js
9028
9683
  import { AsyncLocalStorage } from "node:async_hooks";
9029
9684
  var requests = new AsyncLocalStorage();
9030
9685
  var inCommandServerRequest = /* @__PURE__ */ __name((request, work) => requests.run(request, work), "inCommandServerRequest");
@@ -9039,7 +9694,113 @@ var exitCodeSet = /* @__PURE__ */ __name(() => {
9039
9694
  return direct;
9040
9695
  }, "exitCodeSet");
9041
9696
 
9042
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/deadline.js
9697
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/sends/guarded.js
9698
+ import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
9699
+ var sentIds = /* @__PURE__ */ __name((typed2, message2) => ({
9700
+ messageId: message2.id,
9701
+ ...message2.chatId && message2.chatId !== typed2 ? { resultChatId: message2.chatId } : {}
9702
+ }), "sentIds");
9703
+ var current = new AsyncLocalStorage2();
9704
+ var writesInFlight = new AsyncLocalStorage2();
9705
+ var parents = /* @__PURE__ */ new WeakMap();
9706
+ var stopped = /* @__PURE__ */ new WeakMap();
9707
+ var scopesFor = /* @__PURE__ */ __name((scope = writesInFlight.getStore()) => {
9708
+ const result = [];
9709
+ for (let at2 = scope; at2; at2 = parents.get(at2))
9710
+ result.push(at2);
9711
+ return result;
9712
+ }, "scopesFor");
9713
+ var withWriteScope = /* @__PURE__ */ __name((scope, body) => {
9714
+ const parent = writesInFlight.getStore();
9715
+ if (parent && parent !== scope)
9716
+ parents.set(scope, parent);
9717
+ return writesInFlight.run(scope, body);
9718
+ }, "withWriteScope");
9719
+ var stopWrites = /* @__PURE__ */ __name((scope, reason) => {
9720
+ stopped.set(scope, reason);
9721
+ for (const write of scope)
9722
+ write.cut();
9723
+ }, "stopWrites");
9724
+ var refuseStopped = /* @__PURE__ */ __name((scopes3) => {
9725
+ for (const scope of scopes3)
9726
+ if (stopped.has(scope))
9727
+ throw stopped.get(scope);
9728
+ }, "refuseStopped");
9729
+ var currentOperation = /* @__PURE__ */ __name(() => current.getStore(), "currentOperation");
9730
+ var guardedWrite = /* @__PURE__ */ __name(async (guard, attempt, act, settled2 = () => ({}), prepare) => {
9731
+ const scopes3 = scopesFor();
9732
+ refuseStopped(scopes3);
9733
+ try {
9734
+ await guard.ask?.(attempt);
9735
+ refuseStopped(scopes3);
9736
+ if (guard.reserve) {
9737
+ guard.check(attempt, { reserve: false });
9738
+ await guard.reserve(attempt);
9739
+ } else
9740
+ guard.check(attempt);
9741
+ } catch (error) {
9742
+ guard.record({ ...attempt, outcome: "refused", errorCode: codeOf(error) });
9743
+ throw error;
9744
+ }
9745
+ try {
9746
+ refuseStopped(scopes3);
9747
+ } catch (error) {
9748
+ guard.record({ ...attempt, outcome: "failed", errorCode: codeOf(error) });
9749
+ throw error;
9750
+ }
9751
+ let recorded2 = false;
9752
+ const once = /* @__PURE__ */ __name((entry) => {
9753
+ if (recorded2)
9754
+ return;
9755
+ recorded2 = true;
9756
+ guard.record(entry);
9757
+ }, "once");
9758
+ let cancelled = false;
9759
+ const flight = {
9760
+ operationId: attempt.operationId,
9761
+ preparing: prepare !== void 0,
9762
+ cut: /* @__PURE__ */ __name(() => {
9763
+ cancelled = true;
9764
+ once({
9765
+ ...attempt,
9766
+ outcome: flight.preparing ? "failed" : "outcome_unknown",
9767
+ errorCode: flight.preparing ? "timeout" : "outcome_unknown"
9768
+ });
9769
+ }, "cut")
9770
+ };
9771
+ for (const scope of scopes3)
9772
+ scope.add(flight);
9773
+ try {
9774
+ if (prepare !== void 0)
9775
+ await prepare();
9776
+ if (cancelled)
9777
+ throw new CliError("timeout", "the command ended before sending; nothing was sent", { sent: false });
9778
+ flight.preparing = false;
9779
+ const done = await current.run(attempt.operationId, act);
9780
+ if (cancelled)
9781
+ throw new CliError("outcome_unknown", "the command ended with a write in flight; check its result before continuing", { operation_id: attempt.operationId });
9782
+ once({ ...attempt, ...settled2(done), outcome: "sent" });
9783
+ return done;
9784
+ } catch (error) {
9785
+ const code = codeOf(error);
9786
+ once({ ...attempt, outcome: code === "outcome_unknown" ? "outcome_unknown" : "failed", errorCode: code });
9787
+ if (code === "outcome_unknown" && error instanceof Error)
9788
+ throw new CliError("outcome_unknown", error.message, {
9789
+ ...error.details,
9790
+ operation_id: attempt.operationId,
9791
+ retryable: false
9792
+ });
9793
+ if (flight.preparing && isCliError(error) && error.details.sent === void 0)
9794
+ throw new CliError(error.code, error.message, { ...error.details, sent: false });
9795
+ throw error;
9796
+ } finally {
9797
+ for (const scope of scopes3)
9798
+ scope.delete(flight);
9799
+ }
9800
+ }, "guardedWrite");
9801
+ var codeOf = /* @__PURE__ */ __name((error) => typeof error?.code === "string" ? error.code : "unknown", "codeOf");
9802
+
9803
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/deadline.js
9043
9804
  var withDeadline = /* @__PURE__ */ __name(async (ms2, closeables, body) => {
9044
9805
  if (ms2 === void 0)
9045
9806
  return body();
@@ -9065,7 +9826,7 @@ var withDeadline = /* @__PURE__ */ __name(async (ms2, closeables, body) => {
9065
9826
  }
9066
9827
  }, "withDeadline");
9067
9828
 
9068
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/execution.js
9829
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/execution.js
9069
9830
  var DEFAULT_COMMAND_MS = 3e4;
9070
9831
  var DEFAULT_COOPERATIVE_MS = 5 * 6e4;
9071
9832
  var DEFAULT_SYNC_MS = 15 * 6e4;
@@ -9248,7 +10009,7 @@ var withAbort = /* @__PURE__ */ __name(async (signal, body) => {
9248
10009
  }
9249
10010
  }, "withAbort");
9250
10011
 
9251
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/profile.js
10012
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/profile.js
9252
10013
  var asFirstWord = /* @__PURE__ */ __name((profile) => `${profile} `, "asFirstWord");
9253
10014
  var PLAIN_NAME = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
9254
10015
  var isProfileName = /* @__PURE__ */ __name((word) => PLAIN_NAME.test(word), "isProfileName");
@@ -9274,12 +10035,12 @@ var takesProfile = /* @__PURE__ */ __name((command) => {
9274
10035
  return top !== void 0 && !PROFILE_FREE.has(top.name());
9275
10036
  }, "takesProfile");
9276
10037
  var commandWords = /* @__PURE__ */ __name((program2) => /* @__PURE__ */ new Set(["help", ...program2.commands.flatMap((command) => [command.name(), ...command.aliases()])]), "commandWords");
9277
- var liftProfile = /* @__PURE__ */ __name((argv, words, valued = /* @__PURE__ */ new Set()) => {
10038
+ var liftProfile = /* @__PURE__ */ __name((argv, words2, valued = /* @__PURE__ */ new Set()) => {
9278
10039
  let at2 = 0;
9279
10040
  while (argv[at2]?.startsWith("-") && argv[at2] !== "--")
9280
10041
  at2 += valued.has(argv[at2]) ? 2 : 1;
9281
10042
  const first2 = argv[at2];
9282
- if (first2 === void 0 || first2.startsWith("-") || words.has(first2))
10043
+ if (first2 === void 0 || first2.startsWith("-") || words2.has(first2))
9283
10044
  return { rest: argv };
9284
10045
  return { profile: first2, rest: [...argv.slice(0, at2), ...argv.slice(at2 + 1)] };
9285
10046
  }, "liftProfile");
@@ -9302,9 +10063,9 @@ var runGroup = /* @__PURE__ */ __name((app, env, word) => {
9302
10063
  return { name: lock, from: LOCK, locked: true };
9303
10064
  }, "runGroup");
9304
10065
  var valuedOptions = /* @__PURE__ */ __name((program2) => new Set(program2.options.filter((option) => option.required).flatMap((option) => [option.long, option.short].filter((flag2) => flag2 !== void 0))), "valuedOptions");
9305
- var refuseCommandName = /* @__PURE__ */ __name((profile, words, command) => {
9306
- if (words.has(profile)) {
9307
- throw new CliError("validation_error", `"${profile}" is a command, so \`${command} ${profile} \u2026\` would always mean the command and never this profile. Pick a name that is not one of: ` + [...words].sort().join(", "));
10066
+ var refuseCommandName = /* @__PURE__ */ __name((profile, words2, command) => {
10067
+ if (words2.has(profile)) {
10068
+ throw new CliError("validation_error", `"${profile}" is a command, so \`${command} ${profile} \u2026\` would always mean the command and never this profile. Pick a name that is not one of: ` + [...words2].sort().join(", "));
9308
10069
  }
9309
10070
  }, "refuseCommandName");
9310
10071
  var rootOf = /* @__PURE__ */ __name((command) => {
@@ -9335,13 +10096,13 @@ var sampleCommand = /* @__PURE__ */ __name((commands) => {
9335
10096
  return void 0;
9336
10097
  }, "sampleCommand");
9337
10098
 
9338
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/analysis/settings.js
10099
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/analysis/settings.js
9339
10100
  var model2 = pipe(string(), trim(), minLength(1), maxLength(200));
9340
- var url = pipe(string(), check(endpoint, "use an HTTP/S endpoint without credentials, query or fragment"));
10101
+ var url2 = pipe(string(), check(endpoint, "use an HTTP/S endpoint without credentials, query or fragment"));
9341
10102
  var AI_FIELDS = {
9342
10103
  embeddingProvider: optional(picklist(["local", "openai"])),
9343
10104
  embeddingModel: optional(model2),
9344
- embeddingBaseUrl: optional(url),
10105
+ embeddingBaseUrl: optional(url2),
9345
10106
  embeddingDims: optional(pipe(number(), integer(), minValue(1), maxValue(65536))),
9346
10107
  models: optional(modelSettingsShape)
9347
10108
  };
@@ -9379,19 +10140,310 @@ var resolveAISettings = /* @__PURE__ */ __name((prefix, layers, env) => {
9379
10140
  };
9380
10141
  }, "resolveAISettings");
9381
10142
 
9382
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/bot/registry.js
9383
- import { existsSync as existsSync2, readdirSync as readdirSync2, readFileSync as readFileSync2 } from "node:fs";
10143
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/duration.js
10144
+ var DURATION = /^(\d+)(ms|s|m|h|d)$/;
10145
+ var UNIT_MS = { ms: 1, s: 1e3, m: 6e4, h: 36e5, d: 864e5 };
10146
+ var parseDuration = /* @__PURE__ */ __name((value, source2) => {
10147
+ const match = DURATION.exec(value.trim());
10148
+ if (!match?.[1] || !match[2]) {
10149
+ throw new CliError("validation_error", `${source2} takes a duration with a unit \u2014 500ms, 30s, 2m, 4h or 1d \u2014 not "${value}"`);
10150
+ }
10151
+ const ms2 = Number(match[1]) * (UNIT_MS[match[2]] ?? 0);
10152
+ if (ms2 <= 0)
10153
+ throw new CliError("validation_error", `${source2} has to be more than zero, and "${value}" is not`);
10154
+ return ms2;
10155
+ }, "parseDuration");
10156
+
10157
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/embeddings/models.js
10158
+ import { existsSync as existsSync2 } from "node:fs";
9384
10159
  import { join as join2 } from "node:path";
9385
- var botsDirectory = /* @__PURE__ */ __name((app, env = process.env) => join2(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "bots"), "botsDirectory");
10160
+ var huggingFace = /* @__PURE__ */ __name((repository, commit) => (name) => `https://huggingface.co/${repository}/resolve/${commit}/${name}`, "huggingFace");
10161
+ var e5 = huggingFace("Xenova/multilingual-e5-small", "761b726dd34fb83930e26aab4e9ac3899aa1fa78");
10162
+ var e5Large = huggingFace("Xenova/multilingual-e5-large", "00fc3aeb3dbb95842de2ac1961d33c6319acf57b");
10163
+ var gemma = huggingFace("onnx-community/embeddinggemma-300m-ONNX", "5090578d9565bb06545b4552f76e6bc2c93e4a66");
10164
+ var TEXT_MODELS = [
10165
+ {
10166
+ id: "e5-small",
10167
+ title: "multilingual-e5-small, 8-bit",
10168
+ size: "small",
10169
+ languages: "about 100 languages, Russian and English among them",
10170
+ licence: "MIT",
10171
+ dims: 384,
10172
+ maxTokens: 512,
10173
+ // 100k-message corpus, one 8-thread session on Ryzen AI 9 HX 470: 31–32 chunks/s.
10174
+ chunksPerSecond: 31,
10175
+ pooling: "mean",
10176
+ prefix: { query: "query: ", passage: "passage: " },
10177
+ onnx: "onnx/model_quantized.onnx",
10178
+ files: [
10179
+ {
10180
+ name: "onnx/model_quantized.onnx",
10181
+ url: e5("onnx/model_quantized.onnx"),
10182
+ sha256: "f80102d3f2a1229f387d3c81909990d8945513e347b0eab049f7de3c6f98c193",
10183
+ bytes: 118308185
10184
+ },
10185
+ {
10186
+ name: "tokenizer.json",
10187
+ url: e5("tokenizer.json"),
10188
+ sha256: "0b44a9d7b51c3c62626640cda0e2c2f70fdacdc25bbbd68038369d14ebdf4c39",
10189
+ bytes: 17082730
10190
+ },
10191
+ {
10192
+ name: "tokenizer_config.json",
10193
+ url: e5("tokenizer_config.json"),
10194
+ sha256: "a1d6bc8734a6f635dc158508bef000f8e2e5a759c7d92f984b2c86e5ff53425b",
10195
+ bytes: 443
10196
+ }
10197
+ ]
10198
+ },
10199
+ {
10200
+ id: "embeddinggemma",
10201
+ title: "EmbeddingGemma 300M, 4-bit",
10202
+ size: "medium",
10203
+ languages: "over 100 languages \u2014 the best of the two on chat, about seven times slower",
10204
+ licence: "Gemma Terms of Use",
10205
+ terms: "https://ai.google.dev/gemma/terms",
10206
+ // Gemma Terms of Use §3.1: every copy carries this notice and the use restrictions of §3.2.
10207
+ notice: "Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms. Its use is restricted by the Gemma Prohibited Use Policy: https://ai.google.dev/gemma/prohibited_use_policy",
10208
+ dims: 768,
10209
+ maxTokens: 2048,
10210
+ // 2026-11-08, 1,200-character chunks, 8 threads on the Ryzen AI 9 HX 470: 8.3 chunks/s against e5-small's 52.7, so
10211
+ // 5 on the scale e5-small's 31 sets. It was 2, which held a memo sync to 39 chunks.
10212
+ chunksPerSecond: 5,
10213
+ pooling: "sentence_embedding",
10214
+ prefix: { query: "task: search result | query: ", passage: "title: none | text: " },
10215
+ onnx: "onnx/model_q4.onnx",
10216
+ externalData: "onnx/model_q4.onnx_data",
10217
+ files: [
10218
+ {
10219
+ name: "onnx/model_q4.onnx",
10220
+ url: gemma("onnx/model_q4.onnx"),
10221
+ sha256: "ad1dfee81a70f7944b9b9d1cc6e48075b832881cf33fab2f2b248be78f3f0043",
10222
+ bytes: 519322
10223
+ },
10224
+ {
10225
+ name: "onnx/model_q4.onnx_data",
10226
+ url: gemma("onnx/model_q4.onnx_data"),
10227
+ sha256: "599962c3143b040de2dd05e5975be3e9091dd067cacc6a8f7186e3203bab9e02",
10228
+ bytes: 196725760
10229
+ },
10230
+ {
10231
+ name: "tokenizer.json",
10232
+ url: gemma("tokenizer.json"),
10233
+ sha256: "4dda02faaf32bc91031dc8c88457ac272b00c1016cc679757d1c441b248b9c47",
10234
+ bytes: 20323312
10235
+ },
10236
+ {
10237
+ name: "tokenizer_config.json",
10238
+ url: gemma("tokenizer_config.json"),
10239
+ sha256: "3ca953eea6c3c9fcda9cf3df22949ff18b216f7c74bd6459230f3f1013953f3a",
10240
+ bytes: 1156830
10241
+ }
10242
+ ]
10243
+ },
10244
+ {
10245
+ id: "e5-large",
10246
+ title: "multilingual-e5-large, 8-bit",
10247
+ size: "large",
10248
+ languages: "about 100 languages, Russian and English among them \u2014 reads better than e5-small, several times slower",
10249
+ licence: "MIT",
10250
+ dims: 1024,
10251
+ maxTokens: 512,
10252
+ // 2026-11-07, one 8-thread session on the Ryzen AI 9 HX 470 while other benchmarks ran: 3.4 chunks/s.
10253
+ chunksPerSecond: 4,
10254
+ pooling: "mean",
10255
+ prefix: { query: "query: ", passage: "passage: " },
10256
+ onnx: "onnx/model_quantized.onnx",
10257
+ files: [
10258
+ {
10259
+ name: "onnx/model_quantized.onnx",
10260
+ url: e5Large("onnx/model_quantized.onnx"),
10261
+ sha256: "0a8d65db9a36f810ba5da15249f13145fcdc7890e6656f1fd38cd8b7c4db1fca",
10262
+ bytes: 561768762
10263
+ },
10264
+ {
10265
+ name: "tokenizer.json",
10266
+ url: e5Large("tokenizer.json"),
10267
+ sha256: "62c24cdc13d4c9952d63718d6c9fa4c287974249e16b7ade6d5a85e7bbb75626",
10268
+ bytes: 17082660
10269
+ },
10270
+ {
10271
+ name: "tokenizer_config.json",
10272
+ url: e5Large("tokenizer_config.json"),
10273
+ sha256: "efb5c0d09722e5fe59a462cd2a9976ee216d55b037597d997cd3fe833216da15",
10274
+ bytes: 418
10275
+ }
10276
+ ]
10277
+ }
10278
+ ];
10279
+ var DEFAULT_TEXT_MODEL = "embeddinggemma";
10280
+ var PREVIOUS_DEFAULT_TEXT_MODEL = "e5-small";
10281
+ var SECTION = "text_models";
10282
+ var slug = pipe(string(), regex(/^[a-z0-9][a-z0-9._-]{0,62}$/, "is not a model id: a-z, 0-9, . _ -"));
10283
+ var words = pipe(string(), trim(), minLength(1), maxLength(300));
10284
+ var fileName = pipe(string(), check((name) => /^[\w.-]+(\/[\w.-]+)*$/.test(name) && !name.split("/").some((part) => part === ".." || part === "."), "is not a file inside the model's folder"));
10285
+ var modelFile = strictObject({
10286
+ name: fileName,
10287
+ url: pipe(string(), url(), startsWith("https://", "has to be an https address")),
10288
+ sha256: pipe(string(), regex(/^[0-9a-f]{64}$/, "has to be a sha256 in hex")),
10289
+ bytes: pipe(number(), integer(), minValue(1))
10290
+ });
10291
+ var CustomTextModelShape = pipe(strictObject({
10292
+ id: slug,
10293
+ title: words,
10294
+ languages: words,
10295
+ licence: words,
10296
+ terms: optional(pipe(string(), url())),
10297
+ dims: pipe(number(), integer(), minValue(1), maxValue(8192)),
10298
+ maxTokens: pipe(number(), integer(), minValue(16), maxValue(32768)),
10299
+ chunksPerSecond: optional(pipe(number(), minValue(0.01))),
10300
+ pooling: picklist(["mean", "sentence_embedding"]),
10301
+ prefix: strictObject({
10302
+ query: pipe(string(), maxLength(200)),
10303
+ passage: pipe(string(), maxLength(200))
10304
+ }),
10305
+ onnx: fileName,
10306
+ externalData: optional(fileName),
10307
+ files: pipe(array(modelFile), minLength(1), maxLength(16))
10308
+ }), check((model3) => !TEXT_MODELS.some((one) => one.id === model3.id), "takes the id of a model this version ships; choose another"), check((model3) => {
10309
+ const names = model3.files.map(({ name }) => name);
10310
+ return [model3.onnx, model3.externalData, "tokenizer.json", "tokenizer_config.json"].every((name) => name === void 0 || names.includes(name));
10311
+ }, "has to list its onnx file, its external data and tokenizer.json and tokenizer_config.json among files"));
10312
+ var TextModelsSection = strictObject({
10313
+ use: optional(slug),
10314
+ custom: optional(array(CustomTextModelShape))
10315
+ });
10316
+ var textModelsFile = /* @__PURE__ */ __name((env = process.env) => sharedConfigPath(storePath(env), env), "textModelsFile");
10317
+ var readTextModelsSection = /* @__PURE__ */ __name((env = process.env) => {
10318
+ const path2 = textModelsFile(env);
10319
+ const section2 = readSharedSection(path2, SECTION);
10320
+ if (section2 === void 0)
10321
+ return {};
10322
+ const checked = safeParse(TextModelsSection, section2);
10323
+ if (!checked.success) {
10324
+ const issue = checked.issues[0];
10325
+ const at2 = issue ? getDotPath(issue) : null;
10326
+ throw new CliError("configuration_error", `${path2}: ${SECTION}${at2 ? `.${at2}` : ""} ${issue?.message ?? "is not valid"}`);
10327
+ }
10328
+ const ids = checked.output.custom?.map(({ id: id6 }) => id6) ?? [];
10329
+ const twice = ids.find((id6, at2) => ids.indexOf(id6) !== at2);
10330
+ if (twice)
10331
+ throw new CliError("configuration_error", `${path2}: ${SECTION}.custom names ${twice} twice`);
10332
+ return checked.output;
10333
+ }, "readTextModelsSection");
10334
+ var writeTextModelsSection = /* @__PURE__ */ __name((section2, env = process.env) => writeSharedSection(textModelsFile(env), SECTION, section2.use === void 0 && !section2.custom?.length ? void 0 : section2), "writeTextModelsSection");
10335
+ var textModels = /* @__PURE__ */ __name((env = process.env) => [
10336
+ ...TEXT_MODELS,
10337
+ ...(readTextModelsSection(env).custom ?? []).map((model3) => ({ ...model3, custom: true }))
10338
+ ], "textModels");
10339
+ var textModel = /* @__PURE__ */ __name((id6, env = process.env) => {
10340
+ const known = textModels(env);
10341
+ const found = known.find((model3) => model3.id === id6);
10342
+ if (!found) {
10343
+ throw new CliError("validation_error", `no text model ${id6} \u2014 one of: ${known.map((model3) => model3.id).join(", ")}`);
10344
+ }
10345
+ return found;
10346
+ }, "textModel");
10347
+ var downloaded = /* @__PURE__ */ __name((id6, env) => {
10348
+ const model3 = TEXT_MODELS.find((one) => one.id === id6);
10349
+ const directory = sharedModelsDirectory("text", env);
10350
+ return model3 !== void 0 && filesPresent(model3.files.map((file) => [file, join2(directory, model3.id, file.name)]));
10351
+ }, "downloaded");
10352
+ var chosenTextModel = /* @__PURE__ */ __name((env = process.env) => {
10353
+ const use = readTextModelsSection(env).use;
10354
+ if (use !== void 0)
10355
+ return { id: use, from: "chosen" };
10356
+ const kept = !downloaded(DEFAULT_TEXT_MODEL, env) && existsSync2(join2(sharedModelsDirectory("text", env), PREVIOUS_DEFAULT_TEXT_MODEL));
10357
+ return { id: kept ? PREVIOUS_DEFAULT_TEXT_MODEL : DEFAULT_TEXT_MODEL, from: "default" };
10358
+ }, "chosenTextModel");
10359
+ var mmarco = huggingFace("cross-encoder/mmarco-mMiniLMv2-L12-H384-v1", "1427fd652930e4ba29e8149678df786c240d8825");
10360
+ var bge = huggingFace("onnx-community/bge-reranker-v2-m3-ONNX", "6f5ff65298512715a1e669753bc754d2bc8f367b");
10361
+ var RERANK_MODELS = [
10362
+ {
10363
+ id: "mmarco",
10364
+ title: "mMARCO mMiniLMv2-L12 cross-encoder, 8-bit",
10365
+ languages: "about 100 languages, Russian and English among them",
10366
+ licence: "Apache-2.0",
10367
+ maxTokens: 512,
10368
+ // The x86 name is the quantizer's target; WebAssembly and native ONNX Runtime both run it on any processor.
10369
+ onnx: "onnx/model_quint8_avx2.onnx",
10370
+ files: [
10371
+ {
10372
+ name: "onnx/model_quint8_avx2.onnx",
10373
+ url: mmarco("onnx/model_quint8_avx2.onnx"),
10374
+ sha256: "6c2513767fb63d008a4377bef7a7a3555433d9436342bb53e35a3a72ffc52d4b",
10375
+ bytes: 118620016
10376
+ },
10377
+ {
10378
+ name: "tokenizer.json",
10379
+ url: mmarco("tokenizer.json"),
10380
+ sha256: "62c24cdc13d4c9952d63718d6c9fa4c287974249e16b7ade6d5a85e7bbb75626",
10381
+ bytes: 17082660
10382
+ },
10383
+ {
10384
+ name: "tokenizer_config.json",
10385
+ url: mmarco("tokenizer_config.json"),
10386
+ sha256: "e7fbfbfa6347b4e414c1cee50d142e2c2f9a895dad68b068ae83a8b564c3837e",
10387
+ bytes: 435
10388
+ }
10389
+ ]
10390
+ },
10391
+ {
10392
+ id: "bge-reranker-v2-m3",
10393
+ title: "BGE reranker v2 m3, 8-bit",
10394
+ languages: "over 100 languages \u2014 better than mmarco in the benchmark, about seven times slower",
10395
+ licence: "Apache-2.0 (BAAI's; the ONNX export declares none)",
10396
+ maxTokens: 512,
10397
+ onnx: "onnx/model_quantized.onnx",
10398
+ files: [
10399
+ {
10400
+ name: "onnx/model_quantized.onnx",
10401
+ url: bge("onnx/model_quantized.onnx"),
10402
+ sha256: "912fc1215c2dbff6499700534bd8d31253af01573861abbfc43afd1fab6cce5d",
10403
+ bytes: 570727094
10404
+ },
10405
+ {
10406
+ name: "tokenizer.json",
10407
+ url: bge("tokenizer.json"),
10408
+ sha256: "8bf8afbfd11306bd872018c53bfdf2e160a56f8edbcf49933324404791c148d3",
10409
+ bytes: 17082900
10410
+ },
10411
+ {
10412
+ name: "tokenizer_config.json",
10413
+ url: bge("tokenizer_config.json"),
10414
+ sha256: "b87c8703482b0300d3da30e201519aa641f6a450f5eb5bf1e624afbf70c74d80",
10415
+ bytes: 1203
10416
+ }
10417
+ ]
10418
+ }
10419
+ ];
10420
+ var DEFAULT_RERANK_MODEL = "mmarco";
10421
+ var rerankModel = /* @__PURE__ */ __name((id6) => {
10422
+ const found = RERANK_MODELS.find((model3) => model3.id === id6);
10423
+ if (!found) {
10424
+ throw new CliError("validation_error", `no reranker ${id6} \u2014 one of: ${RERANK_MODELS.map((model3) => model3.id).join(", ")}`);
10425
+ }
10426
+ return found;
10427
+ }, "rerankModel");
10428
+ var vectorModelKey = /* @__PURE__ */ __name((model3) => {
10429
+ const weights = model3.custom ? model3.files.find(({ name }) => name === model3.onnx)?.sha256.slice(0, 12) : void 0;
10430
+ return `local:${model3.id}${weights ? `@${weights}` : ""}:${model3.dims}`;
10431
+ }, "vectorModelKey");
10432
+ var meaningFloor = /* @__PURE__ */ __name((key) => key === "local:e5-small:384" ? 0.8 : 0, "meaningFloor");
10433
+
10434
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/bot/registry.js
10435
+ import { existsSync as existsSync3, readdirSync as readdirSync2, readFileSync as readFileSync2 } from "node:fs";
10436
+ import { join as join3 } from "node:path";
10437
+ var botsDirectory = /* @__PURE__ */ __name((app, env = process.env) => join3(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "bots"), "botsDirectory");
9386
10438
  var botFiles = /* @__PURE__ */ __name((app, profile, env = process.env) => {
9387
10439
  const directory = botsDirectory(app, env);
9388
10440
  return {
9389
- registry: join2(directory, `${profile}.json`),
9390
- recipients: join2(directory, "recipients", `${profile}.json`),
9391
- journal: join2(directory, "sends", `${profile}.jsonl`),
9392
- updates: join2(directory, "updates", `${profile}.json`),
9393
- presses: join2(directory, "presses", `${profile}.json`),
9394
- checks: join2(directory, "checks", `${profile}.json`)
10441
+ registry: join3(directory, `${profile}.json`),
10442
+ recipients: join3(directory, "recipients", `${profile}.json`),
10443
+ journal: join3(directory, "sends", `${profile}.jsonl`),
10444
+ updates: join3(directory, "updates", `${profile}.json`),
10445
+ presses: join3(directory, "presses", `${profile}.json`),
10446
+ checks: join3(directory, "checks", `${profile}.json`)
9395
10447
  };
9396
10448
  }, "botFiles");
9397
10449
  var ChatRegistry = class {
@@ -9418,7 +10470,7 @@ var ChatRegistry = class {
9418
10470
  }
9419
10471
  /** Makes this bot known to `bot list` before it has seen any chat. */
9420
10472
  touch() {
9421
- if (!existsSync2(this.#path))
10473
+ if (!existsSync3(this.#path))
9422
10474
  writeSecurely(this.#path, `${JSON.stringify({ chats: [] }, null, 2)}
9423
10475
  `, 384);
9424
10476
  }
@@ -9447,7 +10499,7 @@ var ChatRegistry = class {
9447
10499
  this.#write({ ...this.#read(), chats: [...byId.values()] });
9448
10500
  }
9449
10501
  #read() {
9450
- if (!existsSync2(this.#path))
10502
+ if (!existsSync3(this.#path))
9451
10503
  return {};
9452
10504
  try {
9453
10505
  const parsed = JSON.parse(readFileSync2(this.#path, "utf8"));
@@ -9463,256 +10515,13 @@ var ChatRegistry = class {
9463
10515
  };
9464
10516
  var registryProfiles = /* @__PURE__ */ __name((app, env = process.env) => {
9465
10517
  const directory = botsDirectory(app, env);
9466
- if (!existsSync2(directory))
10518
+ if (!existsSync3(directory))
9467
10519
  return [];
9468
10520
  return readdirSync2(directory, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".json")).map((entry) => entry.name).map((name) => name.slice(0, -".json".length));
9469
10521
  }, "registryProfiles");
9470
10522
 
9471
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/config-issues.js
10523
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/config-issues.js
9472
10524
  import { readFileSync as readFileSync3 } from "node:fs";
9473
-
9474
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/config-repair.js
9475
- var REPAIR_WORDS = {
9476
- byte_order_mark: "an invisible byte-order mark at the start",
9477
- comment: "a comment, which JSON does not allow",
9478
- trailing_comma: "a comma before a closing bracket",
9479
- missing_comma: "a missing comma",
9480
- unquoted_key: "a key without double quotes",
9481
- single_quotes: "text in single quotes",
9482
- missing_closer: "the file stops before its closing brackets \u2014 whatever followed this line was already lost"
9483
- };
9484
- var GiveUp = class {
9485
- static {
9486
- __name(this, "GiveUp");
9487
- }
9488
- at;
9489
- why;
9490
- constructor(at2, why) {
9491
- this.at = at2;
9492
- this.why = why;
9493
- }
9494
- };
9495
- var NUMBER = /^-?(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?/;
9496
- var LITERAL = /^(true|false|null)/;
9497
- var KEY = /^[A-Za-z_$][\w$.-]*/;
9498
- var ENDS_VALUE = /^[\s,\]}/]?$/;
9499
- var repairConfigText = /* @__PURE__ */ __name((text5) => {
9500
- try {
9501
- JSON.parse(text5);
9502
- return { state: "valid" };
9503
- } catch {
9504
- }
9505
- const fixes = [];
9506
- const lineAt = /* @__PURE__ */ __name((offset) => text5.slice(0, offset).split("\n").length, "lineAt");
9507
- const fix = /* @__PURE__ */ __name((kind2, offset) => fixes.push({ kind: kind2, line: lineAt(offset) }), "fix");
9508
- const giveUp = /* @__PURE__ */ __name((why, offset = at2) => {
9509
- throw new GiveUp(offset, why);
9510
- }, "giveUp");
9511
- let at2 = 0;
9512
- let truncated = false;
9513
- let last = "open";
9514
- let lastEnd = 0;
9515
- const previous = /* @__PURE__ */ __name(() => last, "previous");
9516
- const skip = /* @__PURE__ */ __name(() => {
9517
- for (; ; ) {
9518
- while (/\s/.test(text5[at2] ?? ""))
9519
- at2++;
9520
- if (text5.startsWith("//", at2)) {
9521
- fix("comment", at2);
9522
- while (at2 < text5.length && text5[at2] !== "\n")
9523
- at2++;
9524
- } else if (text5.startsWith("/*", at2)) {
9525
- const end = text5.indexOf("*/", at2 + 2);
9526
- if (end < 0)
9527
- giveUp("a /* comment is never closed");
9528
- fix("comment", at2);
9529
- at2 = end + 2;
9530
- } else
9531
- return;
9532
- }
9533
- }, "skip");
9534
- const string2 = /* @__PURE__ */ __name(() => {
9535
- const quote = text5[at2];
9536
- const start = at2;
9537
- if (quote === "'")
9538
- fix("single_quotes", at2);
9539
- at2++;
9540
- let body = "";
9541
- for (; ; ) {
9542
- if (at2 >= text5.length)
9543
- giveUp("the file stops inside a quoted text", start);
9544
- const char = text5[at2];
9545
- if (char === quote)
9546
- break;
9547
- if (text5.charCodeAt(at2) < 32)
9548
- giveUp("a line break inside a quoted text");
9549
- if (char === "\\") {
9550
- const next = text5[at2 + 1] ?? "";
9551
- if (quote === "'" && next === "'")
9552
- body += "'";
9553
- else if (/^["\\/bfnrt]$/.test(next))
9554
- body += `\\${next}`;
9555
- else if (next === "u" && /^[0-9a-fA-F]{4}$/.test(text5.slice(at2 + 2, at2 + 6))) {
9556
- body += text5.slice(at2, at2 + 6);
9557
- at2 += 4;
9558
- } else
9559
- giveUp("an escape JSON has no meaning for");
9560
- at2 += 2;
9561
- continue;
9562
- }
9563
- body += char === '"' ? '\\"' : char;
9564
- at2++;
9565
- }
9566
- at2++;
9567
- return JSON.parse(`"${body}"`);
9568
- }, "string");
9569
- const key = /* @__PURE__ */ __name(() => {
9570
- const char = text5[at2] ?? "";
9571
- if (char === '"' || char === "'")
9572
- return string2();
9573
- const word = KEY.exec(text5.slice(at2))?.[0];
9574
- if (!word)
9575
- return giveUp("something other than a key where a key should be");
9576
- fix("unquoted_key", at2);
9577
- at2 += word.length;
9578
- return word;
9579
- }, "key");
9580
- const scalar = /* @__PURE__ */ __name(() => {
9581
- const char = text5[at2] ?? "";
9582
- if (char === '"' || char === "'")
9583
- return { json: JSON.stringify(string2()) };
9584
- const word = (NUMBER.exec(text5.slice(at2)) ?? LITERAL.exec(text5.slice(at2)))?.[0];
9585
- if (!word || !ENDS_VALUE.test(text5[at2 + word.length] ?? ""))
9586
- return giveUp("a value that is not JSON \u2014 text needs quotes, and only true, false and null go without");
9587
- if (at2 + word.length === text5.length && NUMBER.test(word))
9588
- giveUp("the file stops inside a number");
9589
- at2 += word.length;
9590
- return { json: word };
9591
- }, "scalar");
9592
- const members = /* @__PURE__ */ __name((close, one) => {
9593
- const out = [];
9594
- at2++;
9595
- last = "open";
9596
- let comma = -1;
9597
- for (; ; ) {
9598
- skip();
9599
- if (truncated)
9600
- return out;
9601
- if (at2 >= text5.length) {
9602
- if (previous() === "close")
9603
- giveUp("the file stops after a closing bracket, so which brackets are missing has two readings");
9604
- if (previous() === "comma")
9605
- fix("trailing_comma", comma);
9606
- fix("missing_closer", text5.length);
9607
- truncated = true;
9608
- return out;
9609
- }
9610
- const char = text5[at2];
9611
- if (char === close) {
9612
- if (previous() === "comma")
9613
- fix("trailing_comma", comma);
9614
- at2++;
9615
- last = "close";
9616
- return out;
9617
- }
9618
- if (char === "}" || char === "]")
9619
- giveUp(`a ${char} where ${close} should close`);
9620
- if (char === ",") {
9621
- if (previous() !== "value" && previous() !== "close")
9622
- giveUp("a comma with nothing before it");
9623
- comma = at2;
9624
- at2++;
9625
- last = "comma";
9626
- continue;
9627
- }
9628
- if (previous() === "value" || previous() === "close") {
9629
- if (lineAt(at2) === lineAt(lastEnd))
9630
- giveUp("two entries on one line with no comma between them");
9631
- fix("missing_comma", lastEnd);
9632
- }
9633
- out.push(one());
9634
- }
9635
- }, "members");
9636
- const value = /* @__PURE__ */ __name(() => {
9637
- const char = text5[at2] ?? "";
9638
- let node;
9639
- if (char === "{") {
9640
- const seen = /* @__PURE__ */ new Set();
9641
- node = {
9642
- object: members("}", () => {
9643
- const start = at2;
9644
- const name = key();
9645
- if (seen.has(name))
9646
- giveUp("a key appears twice in one object", start);
9647
- seen.add(name);
9648
- skip();
9649
- if (at2 >= text5.length)
9650
- giveUp("the file stops after a key, before its value");
9651
- if (text5[at2] !== ":")
9652
- giveUp("a key with no colon after it");
9653
- at2++;
9654
- skip();
9655
- if (at2 >= text5.length)
9656
- giveUp("the file stops after a key, before its value");
9657
- return [name, value()];
9658
- })
9659
- };
9660
- } else if (char === "[") {
9661
- node = {
9662
- array: members("]", () => {
9663
- return value();
9664
- })
9665
- };
9666
- } else
9667
- node = scalar();
9668
- if (!truncated) {
9669
- last = "json" in node ? "value" : "close";
9670
- lastEnd = at2;
9671
- }
9672
- return node;
9673
- }, "value");
9674
- try {
9675
- if (text5.includes("\0") || text5.includes(String.fromCharCode(65533)))
9676
- giveUp("the file is not text", 0);
9677
- if (text5.charCodeAt(0) === 65279) {
9678
- fix("byte_order_mark", 0);
9679
- at2 = 1;
9680
- }
9681
- skip();
9682
- if (text5[at2] !== "{")
9683
- giveUp(at2 >= text5.length ? "the file is empty" : "the file does not start with {");
9684
- const root = value();
9685
- skip();
9686
- if (at2 < text5.length)
9687
- giveUp("more text after the closing }");
9688
- const repaired = `${serialise(root, "")}
9689
- `;
9690
- JSON.parse(repaired);
9691
- return { state: "repaired", text: repaired, fixes };
9692
- } catch (error) {
9693
- if (!(error instanceof GiveUp))
9694
- throw error;
9695
- const before = text5.slice(0, error.at).split("\n");
9696
- return {
9697
- state: "refused",
9698
- line: before.length,
9699
- column: (before.at(-1)?.length ?? 0) + 1,
9700
- why: error.why
9701
- };
9702
- }
9703
- }, "repairConfigText");
9704
- var serialise = /* @__PURE__ */ __name((node, indent) => {
9705
- if ("json" in node)
9706
- return node.json;
9707
- const inner = `${indent} `;
9708
- const parts = "object" in node ? node.object.map(([name, item]) => `${inner}${JSON.stringify(name)}: ${serialise(item, inner)}`) : node.array.map((item) => `${inner}${serialise(item, inner)}`);
9709
- const [open, close] = "object" in node ? ["{", "}"] : ["[", "]"];
9710
- return parts.length === 0 ? `${open}${close}` : `${open}
9711
- ${parts.join(",\n")}
9712
- ${indent}${close}`;
9713
- }, "serialise");
9714
-
9715
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/config-issues.js
9716
10525
  var isNode = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value), "isNode");
9717
10526
  var SECTIONS = ["personal", "bot"];
9718
10527
  var SHELL_SAFE = /^[A-Za-z0-9_.:@-]*$/;
@@ -9819,8 +10628,8 @@ var failureOffset = /* @__PURE__ */ __name((text5) => {
9819
10628
  value();
9820
10629
  space();
9821
10630
  return at2;
9822
- } catch (stopped) {
9823
- return typeof stopped === "number" ? stopped : at2;
10631
+ } catch (stopped2) {
10632
+ return typeof stopped2 === "number" ? stopped2 : at2;
9824
10633
  }
9825
10634
  }, "failureOffset");
9826
10635
  var parseConfigText = /* @__PURE__ */ __name((text5, file) => {
@@ -10007,20 +10816,20 @@ var readConfigFile = /* @__PURE__ */ __name((path2) => {
10007
10816
  return "issue" in parsed ? { issue: publicIssue(parsed.issue) } : parsed;
10008
10817
  }, "readConfigFile");
10009
10818
 
10010
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/default-config.js
10011
- import { existsSync as existsSync3, linkSync, mkdirSync as mkdirSync2, mkdtempSync, rmSync as rmSync2, writeFileSync } from "node:fs";
10012
- import { dirname as dirname2, join as join3 } from "node:path";
10819
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/default-config.js
10820
+ import { existsSync as existsSync4, linkSync, mkdirSync as mkdirSync2, mkdtempSync, rmSync as rmSync2, writeFileSync } from "node:fs";
10821
+ import { dirname as dirname2, join as join4 } from "node:path";
10013
10822
  var DEFAULT_CONFIG = {
10014
10823
  defaults: { limit: 20, keep_runs_for_days: 30, sends_per_hour: 30, update_check: true, skill_hint: true },
10015
10824
  profiles: {}
10016
10825
  };
10017
10826
  function ensureDefaultConfig(path2, config = DEFAULT_CONFIG) {
10018
- if (existsSync3(path2))
10827
+ if (existsSync4(path2))
10019
10828
  return;
10020
10829
  const directory = dirname2(path2);
10021
10830
  mkdirSync2(directory, { recursive: true, mode: 448 });
10022
- const temporary = mkdtempSync(join3(directory, ".config-"));
10023
- const candidate = join3(temporary, "config.json");
10831
+ const temporary = mkdtempSync(join4(directory, ".config-"));
10832
+ const candidate = join4(temporary, "config.json");
10024
10833
  try {
10025
10834
  writeFileSync(candidate, `${JSON.stringify(config, null, 2)}
10026
10835
  `, { flag: "wx", mode: 384 });
@@ -10036,10 +10845,10 @@ function ensureDefaultConfig(path2, config = DEFAULT_CONFIG) {
10036
10845
  }
10037
10846
  __name(ensureDefaultConfig, "ensureDefaultConfig");
10038
10847
 
10039
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/messenger/accounts.js
10040
- import { existsSync as existsSync4, readdirSync as readdirSync3, readFileSync as readFileSync4 } from "node:fs";
10041
- import { join as join4 } from "node:path";
10042
- var accountFileFor = /* @__PURE__ */ __name((app, profile, env) => join4(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "accounts", `${profile}.json`), "accountFileFor");
10848
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/messenger/accounts.js
10849
+ import { existsSync as existsSync5, readdirSync as readdirSync3, readFileSync as readFileSync4 } from "node:fs";
10850
+ import { join as join5 } from "node:path";
10851
+ var accountFileFor = /* @__PURE__ */ __name((app, profile, env) => join5(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "accounts", `${profile}.json`), "accountFileFor");
10043
10852
  var rememberAccount = /* @__PURE__ */ __name((app, profile, id6, env) => writeSecurely(accountFileFor(app, profile, env), `${JSON.stringify({ account: id6 })}
10044
10853
  `, 384), "rememberAccount");
10045
10854
  var recalledAccount = /* @__PURE__ */ __name((app, provider, profile, env) => {
@@ -10051,14 +10860,14 @@ var recalledAccount = /* @__PURE__ */ __name((app, provider, profile, env) => {
10051
10860
  }
10052
10861
  }, "recalledAccount");
10053
10862
  var profilesWithAccounts = /* @__PURE__ */ __name((app, env) => {
10054
- const dir = join4(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "accounts");
10055
- if (!existsSync4(dir))
10863
+ const dir = join5(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "accounts");
10864
+ if (!existsSync5(dir))
10056
10865
  return [];
10057
10866
  return readdirSync3(dir).filter((name) => name.endsWith(".json")).map((name) => name.slice(0, -".json".length));
10058
10867
  }, "profilesWithAccounts");
10059
10868
  var profilesHere = /* @__PURE__ */ __name((app, configured, env) => [.../* @__PURE__ */ new Set([...configured, ...profilesWithAccounts(app, env)])].sort(), "profilesHere");
10060
10869
 
10061
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/setting-defaults.js
10870
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/setting-defaults.js
10062
10871
  var isNode2 = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value), "isNode");
10063
10872
  var parentOf = /* @__PURE__ */ __name((config, key) => {
10064
10873
  const path2 = key.split(".");
@@ -10091,8 +10900,57 @@ var settingRows = /* @__PURE__ */ __name((raw, declared) => declared.map((settin
10091
10900
  };
10092
10901
  }), "settingRows");
10093
10902
 
10094
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/settings.js
10095
- import { existsSync as existsSync5 } from "node:fs";
10903
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/settings.js
10904
+ import { existsSync as existsSync6 } from "node:fs";
10905
+
10906
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/services/history-limits.js
10907
+ var HISTORY_MAX_DAYS = 1095;
10908
+ var DEFAULT_HISTORY_LIMITS = { dialogDays: 1095, groupDays: 365, groupMembersMax: 50 };
10909
+ var DAY_MS = 24 * 60 * 60 * 1e3;
10910
+ var historyWindow = /* @__PURE__ */ __name((shape, limits, now) => {
10911
+ const group2 = shape !== void 0 && shape.kind !== "dialog" && shape.kind !== "saved";
10912
+ if (group2 && (shape.participantsCount ?? 0) > limits.groupMembersMax)
10913
+ return { skip: "group_too_large", members: shape.participantsCount ?? 0 };
10914
+ const days = group2 ? limits.groupDays : limits.dialogDays;
10915
+ return { keepFrom: now - Math.min(days, HISTORY_MAX_DAYS) * DAY_MS };
10916
+ }, "historyWindow");
10917
+ var limitBatch = /* @__PURE__ */ __name((batch, shapes, included, limits, now = Date.now()) => {
10918
+ const skipped = /* @__PURE__ */ new Map();
10919
+ if (!batch.messages?.length)
10920
+ return { batch, skipped };
10921
+ const named3 = new Map((batch.chats ?? []).map((chat2) => [chat2.id, chat2]));
10922
+ const windows = /* @__PURE__ */ new Map();
10923
+ const windowOf = /* @__PURE__ */ __name((chatId) => {
10924
+ if (!windows.has(chatId)) {
10925
+ const chat2 = named3.get(chatId);
10926
+ const shape = chat2 ? { kind: chat2.kind, participantsCount: chat2.participantsCount ?? null } : shapes(chatId);
10927
+ windows.set(chatId, included(chatId) ? void 0 : historyWindow(shape, limits, now));
10928
+ }
10929
+ return windows.get(chatId);
10930
+ }, "windowOf");
10931
+ const messages = batch.messages.filter((message2) => {
10932
+ const window = windowOf(message2.chatId);
10933
+ if (window === void 0)
10934
+ return true;
10935
+ const at2 = Date.parse(message2.timestamp);
10936
+ if ("keepFrom" in window && !(at2 < window.keepFrom))
10937
+ return true;
10938
+ const reason = "skip" in window ? window.skip : "older_than_window";
10939
+ const held = skipped.get(message2.chatId);
10940
+ const iso = new Date(at2).toISOString();
10941
+ skipped.set(message2.chatId, {
10942
+ reason,
10943
+ messages: (held?.messages ?? 0) + 1,
10944
+ oldestAt: held && held.oldestAt < iso ? held.oldestAt : iso,
10945
+ newestAt: held && held.newestAt > iso ? held.newestAt : iso,
10946
+ ..."skip" in window ? { members: window.members } : { keptFrom: new Date(window.keepFrom).toISOString() }
10947
+ });
10948
+ return false;
10949
+ });
10950
+ return { batch: { ...batch, messages }, skipped };
10951
+ }, "limitBatch");
10952
+
10953
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/settings.js
10096
10954
  var DEFAULT_LIMIT = DEFAULT_CONFIG.defaults.limit;
10097
10955
  var DEFAULT_KEEP_RUNS_FOR_DAYS = DEFAULT_CONFIG.defaults.keep_runs_for_days;
10098
10956
  var DEFAULT_SENDS_PER_HOUR = DEFAULT_CONFIG.defaults.sends_per_hour;
@@ -10245,8 +11103,8 @@ var NoProfileHere = class extends CliError {
10245
11103
  this.app = app;
10246
11104
  }
10247
11105
  /** `words`: the command that was typed, without its arguments, so the suggestion runs as written. */
10248
- withoutSetup(words) {
10249
- const command = words ? `${this.app.command} personal ${words}` : `${this.app.command} personal \u2026`;
11106
+ withoutSetup(words2) {
11107
+ const command = words2 ? `${this.app.command} personal ${words2}` : `${this.app.command} personal \u2026`;
10250
11108
  return new CliError("validation_error", `name a profile: there is none on this computer yet \u2014 any name works, such as \`${command}\` (or set ${envName(this.app, "PROFILE")})`, { profiles: [] });
10251
11109
  }
10252
11110
  };
@@ -10454,7 +11312,7 @@ var settingsFor = /* @__PURE__ */ __name((app, extension = {}) => {
10454
11312
  updateCheck: updateCheck.value,
10455
11313
  skillHint: skillHint.value,
10456
11314
  configPath,
10457
- configFound: existsSync5(configPath),
11315
+ configFound: existsSync6(configPath),
10458
11316
  configuredProfiles: namedProfiles(config),
10459
11317
  profilesHere: profilesOf(config, env),
10460
11318
  accountProfiles: accountsOf(config, env, bots),
@@ -10618,7 +11476,50 @@ var given = /* @__PURE__ */ __name((value) => {
10618
11476
  return trimmed === void 0 || trimmed === "" ? void 0 : trimmed;
10619
11477
  }, "given");
10620
11478
 
10621
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/output-detail.js
11479
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/background/budget.js
11480
+ var DEADLINE_MARGIN_MS = 5e3;
11481
+ var DEADLINE_MARGIN_SHARE = 0.15;
11482
+ var DEFAULT_REQUEST_MS = 2e3;
11483
+ var deadlineMargin = /* @__PURE__ */ __name((deadline) => Math.max(DEADLINE_MARGIN_MS, deadline.ms * DEADLINE_MARGIN_SHARE), "deadlineMargin");
11484
+ var requestsFor = /* @__PURE__ */ __name((deadline, requestMs = DEFAULT_REQUEST_MS) => deadline === void 0 ? null : Math.max(1, Math.floor((deadline.ms - deadlineMargin(deadline)) / requestMs)), "requestsFor");
11485
+ var runBudget = /* @__PURE__ */ __name(({ requests: requests2, deadline, requestMs, signal, now = Date.now } = {}) => {
11486
+ const fits = requestsFor(deadline, requestMs);
11487
+ const limit = fits === null ? requests2 ?? null : Math.min(fits, requests2 ?? fits);
11488
+ const margin = deadline ? deadlineMargin(deadline) : 0;
11489
+ let used = 0;
11490
+ let stopped2 = null;
11491
+ let last;
11492
+ let slowest = 0;
11493
+ return {
11494
+ take() {
11495
+ if (stopped2)
11496
+ return stopped2;
11497
+ const at2 = now();
11498
+ if (last !== void 0)
11499
+ slowest = Math.max(slowest, at2 - last);
11500
+ if (signal?.aborted)
11501
+ stopped2 = "cancelled";
11502
+ else if (limit !== null && used >= limit)
11503
+ stopped2 = "requests";
11504
+ else if (deadline && at2 + margin + slowest >= deadline.endsAt)
11505
+ stopped2 = "deadline";
11506
+ if (stopped2)
11507
+ return stopped2;
11508
+ used += 1;
11509
+ last = at2;
11510
+ return null;
11511
+ },
11512
+ get used() {
11513
+ return used;
11514
+ },
11515
+ limit,
11516
+ get stopped() {
11517
+ return stopped2;
11518
+ }
11519
+ };
11520
+ }, "runBudget");
11521
+
11522
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/output-detail.js
10622
11523
  var RARELY_SET = ["editedAt", "replyTo", "forwardedFrom", "reactions"];
10623
11524
  var BRIEF = ["locator", "chatTitle", "timestamp", "senderName", "excerpt", "score"];
10624
11525
  var SNAKE_BRIEF = ["ref", "chat_title", "timestamp", "sender_name", "excerpt", "score"];
@@ -10654,7 +11555,7 @@ var atDetail = /* @__PURE__ */ __name((value, detail = "default") => {
10654
11555
  return value;
10655
11556
  }, "atDetail");
10656
11557
 
10657
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/output.js
11558
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/output.js
10658
11559
  var refuseCompact = /* @__PURE__ */ __name(({ json, jsonl, fields, hitDetail }) => {
10659
11560
  const other = jsonl ? "--jsonl" : fields !== void 0 ? "--json=\u2026" : json ? "--json" : hitDetail === "brief" ? "--brief" : "";
10660
11561
  if (other)
@@ -10718,7 +11619,7 @@ var silence = /* @__PURE__ */ __name((renderer) => ({
10718
11619
  }, "warn")
10719
11620
  }), "silence");
10720
11621
 
10721
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/context.js
11622
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/context.js
10722
11623
  var runBudgetOf = /* @__PURE__ */ __name((command, requests2) => {
10723
11624
  const { deadline, signal, app } = environmentOf(command);
10724
11625
  const now = deadline?.();
@@ -10852,13 +11753,13 @@ var inCommandRun = /* @__PURE__ */ __name((command, body) => {
10852
11753
  return baseContext(command, (flags, options) => resolveSettings(flags, { ...options, needsProfile: false })).run(body);
10853
11754
  }, "inCommandRun");
10854
11755
  var commandPath = /* @__PURE__ */ __name((command) => {
10855
- const words = [];
10856
- for (let current = command; current?.parent; current = current.parent)
10857
- words.unshift(current.name());
10858
- return words.join(" ");
11756
+ const words2 = [];
11757
+ for (let current2 = command; current2?.parent; current2 = current2.parent)
11758
+ words2.unshift(current2.name());
11759
+ return words2.join(" ");
10859
11760
  }, "commandPath");
10860
11761
 
10861
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/effects.js
11762
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/effects.js
10862
11763
  var REMOTE_READ = { remote: "read", local: "read" };
10863
11764
  var FETCH = { remote: "read", local: "write" };
10864
11765
  var REMOTE_WRITE = { remote: "write", local: "write" };
@@ -10923,7 +11824,12 @@ var changesStore = /* @__PURE__ */ __name((command) => {
10923
11824
  STORE_WRITES.add(command);
10924
11825
  return command;
10925
11826
  }, "changesStore");
10926
- var savesFiles = /* @__PURE__ */ __name((command) => command.name() === "download" || [...command.options.map((option) => option.attributeName()), ...command.registeredArguments.map((one) => one.name())].map((name) => name.toLowerCase()).some((name) => name === "dir" || name.endsWith("dir") || name === "output"), "savesFiles");
11827
+ var OWNER_FILES = /* @__PURE__ */ new WeakSet();
11828
+ var writesOwnerFiles = /* @__PURE__ */ __name((command) => {
11829
+ OWNER_FILES.add(command);
11830
+ return command;
11831
+ }, "writesOwnerFiles");
11832
+ var savesFiles = /* @__PURE__ */ __name((command) => OWNER_FILES.has(command) || command.name() === "download" || [...command.options.map((option) => option.attributeName()), ...command.registeredArguments.map((one) => one.name())].map((name) => name.toLowerCase()).some((name) => name === "dir" || name.endsWith("dir") || name === "output"), "savesFiles");
10927
11833
  var fetchesOnly = /* @__PURE__ */ __name((command) => {
10928
11834
  const effects = metaOf(command).effects;
10929
11835
  return effects?.remote === "read" && effects.local === "write" && !STORE_WRITES.has(command) && !changesAuthority(command) && !OTHER_SERVICE.has(command) && !savesFiles(command);
@@ -10948,7 +11854,7 @@ var writesFileNow = /* @__PURE__ */ __name((command) => {
10948
11854
  const option = FILE_OPTION.get(command);
10949
11855
  return option === void 0 || command.opts()[option] !== void 0;
10950
11856
  }, "writesFileNow");
10951
- var readsOverMcp = /* @__PURE__ */ __name((command) => fetchesOnly(command) || FILE_OPTION.has(command), "readsOverMcp");
11857
+ var readsOverMcp = /* @__PURE__ */ __name((command) => fetchesOnly(command) && !LOGIN.has(command) || FILE_OPTION.has(command), "readsOverMcp");
10952
11858
  var readsOverMcpAt = /* @__PURE__ */ __name((root) => (path2) => {
10953
11859
  let at2 = root;
10954
11860
  for (const word of path2)
@@ -10968,10 +11874,10 @@ var refuseStoreChange = /* @__PURE__ */ __name((app, env) => {
10968
11874
  throw readOnlyRefusal(lock, storeChangeRefusal(app));
10969
11875
  }, "refuseStoreChange");
10970
11876
  var pathOf2 = /* @__PURE__ */ __name((command) => {
10971
- const words = [];
11877
+ const words2 = [];
10972
11878
  for (let at2 = command; at2.parent; at2 = at2.parent)
10973
- words.unshift(at2.name());
10974
- return words;
11879
+ words2.unshift(at2.name());
11880
+ return words2;
10975
11881
  }, "pathOf");
10976
11882
  var changesMessenger = /* @__PURE__ */ __name((command) => {
10977
11883
  const { path: path2, effects, lifetime, reaches } = "path" in command ? command : { path: pathOf2(command), ...metaOf(command) };
@@ -11005,7 +11911,61 @@ var refuseUnderReadOnly = /* @__PURE__ */ __name((command, what) => {
11005
11911
  throw readOnlyRefusal(lock, what);
11006
11912
  }, "refuseUnderReadOnly");
11007
11913
 
11008
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/steps.js
11914
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/images/picture/models.js
11915
+ import { join as join6 } from "node:path";
11916
+ var clip = /* @__PURE__ */ __name((name) => `https://huggingface.co/Xenova/clip-vit-base-patch32/resolve/d15189d7028b43f1d3e65039190477f6af591c2a/${name}`, "clip");
11917
+ var IMAGE_MODELS = [
11918
+ {
11919
+ id: "clip-b32",
11920
+ title: "CLIP ViT-B/32, 8-bit",
11921
+ languages: "English only: translate a query before searching",
11922
+ licence: "MIT",
11923
+ dims: 512,
11924
+ key: "local:clip-b32:512",
11925
+ maxTokens: 77,
11926
+ vision: "onnx/vision_model_quantized.onnx",
11927
+ text: "onnx/text_model_quantized.onnx",
11928
+ files: [
11929
+ {
11930
+ name: "onnx/vision_model_quantized.onnx",
11931
+ url: clip("onnx/vision_model_quantized.onnx"),
11932
+ sha256: "583fd1110a514667812fee7d684952aaf82a99b959760c8d7dca7e0ab9839299",
11933
+ bytes: 89117001
11934
+ },
11935
+ {
11936
+ name: "onnx/text_model_quantized.onnx",
11937
+ url: clip("onnx/text_model_quantized.onnx"),
11938
+ sha256: "73baab855d406190da9faa498cfedf65f15cf309f4cc7385b7b032e6d08e5c3a",
11939
+ bytes: 64504507
11940
+ },
11941
+ {
11942
+ name: "tokenizer.json",
11943
+ url: clip("tokenizer.json"),
11944
+ sha256: "f7f3b7af117d467b58374797691a6438d3e6b9e9cef800dfd5dced7f697a90cd",
11945
+ bytes: 2224119
11946
+ },
11947
+ {
11948
+ name: "tokenizer_config.json",
11949
+ url: clip("tokenizer_config.json"),
11950
+ sha256: "60ba2912bc6344c94bc16bbdec27fa1209409167b6f2fdf3cfe9e65462ea3967",
11951
+ bytes: 775
11952
+ }
11953
+ ]
11954
+ }
11955
+ ];
11956
+ var DEFAULT_IMAGE_MODEL = "clip-b32";
11957
+ var imageModel = /* @__PURE__ */ __name((id6) => {
11958
+ const found = IMAGE_MODELS.find((model3) => model3.id === id6);
11959
+ if (!found) {
11960
+ throw new CliError("validation_error", `no image model ${id6} \u2014 one of: ${IMAGE_MODELS.map((model3) => model3.id).join(", ")}`);
11961
+ }
11962
+ return found;
11963
+ }, "imageModel");
11964
+ var imageModelsDirectory = /* @__PURE__ */ __name((env = process.env) => sharedModelsDirectory("image", env), "imageModelsDirectory");
11965
+ var placedImage = /* @__PURE__ */ __name((model3, directory) => model3.files.map((file) => [file, join6(directory, model3.id, file.name)]), "placedImage");
11966
+ var isImageModelInstalled = /* @__PURE__ */ __name((model3, directory) => filesPresent(placedImage(model3, directory)), "isImageModelInstalled");
11967
+
11968
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/steps.js
11009
11969
  var STEPS2 = defineSteps([
11010
11970
  ...STEPS,
11011
11971
  {
@@ -11242,10 +12202,10 @@ var nextStep = /* @__PURE__ */ __name((id6, input) => {
11242
12202
  const args = Object.fromEntries(Object.entries(input.args ?? {}).filter(([, value]) => value !== void 0));
11243
12203
  return stepOf(definition, { ...input, args });
11244
12204
  }, "nextStep");
11245
- var lineOf = /* @__PURE__ */ __name((command, words) => {
12205
+ var lineOf = /* @__PURE__ */ __name((command, words2) => {
11246
12206
  const root = rootOf2(command);
11247
12207
  const profile = root.getOptionValue("profile");
11248
- return typedCommand(root.name(), words, typeof profile === "string" && profile !== "" ? profile : void 0);
12208
+ return typedCommand(root.name(), words2, typeof profile === "string" && profile !== "" ? profile : void 0);
11249
12209
  }, "lineOf");
11250
12210
  var rootOf2 = /* @__PURE__ */ __name((command) => {
11251
12211
  let root = command;
@@ -11295,7 +12255,7 @@ var stepLine = /* @__PURE__ */ __name((root, step2) => {
11295
12255
  ].join(" ");
11296
12256
  }, "stepLine");
11297
12257
 
11298
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/output-budget.js
12258
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/output-budget.js
11299
12259
  var SOFT_OUTPUT_BYTES = 256 * 1024;
11300
12260
  var CARRIED = ["json", "compact", "offline", "timeout", "full", "brief", "maxOutputBytes"];
11301
12261
  var NOT_WITH_COMPACT = /* @__PURE__ */ new Set(["json", "brief"]);
@@ -11321,10 +12281,10 @@ var declaresRow = /* @__PURE__ */ __name((command) => {
11321
12281
  return rowShapeOf(command, rows2 && entityRows(rows2)) !== GENERIC_ROW;
11322
12282
  }, "declaresRow");
11323
12283
  var pathOf3 = /* @__PURE__ */ __name((command) => {
11324
- const words = [];
12284
+ const words2 = [];
11325
12285
  for (let at2 = command; at2.parent; at2 = at2.parent)
11326
- words.unshift(at2.name());
11327
- return words.join(" ");
12286
+ words2.unshift(at2.name());
12287
+ return words2.join(" ");
11328
12288
  }, "pathOf");
11329
12289
  var step = /* @__PURE__ */ __name((command, id6, args, why) => ({
11330
12290
  kind: "command",
@@ -11353,7 +12313,7 @@ var largeAnswerSteps = /* @__PURE__ */ __name((command) => {
11353
12313
  return args ? compactStep(command, args, "the answer is large as JSON; one line per item keeps every ref") : [];
11354
12314
  }, "largeAnswerSteps");
11355
12315
 
11356
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/provider-refs.js
12316
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/provider-refs.js
11357
12317
  var HIDDEN = /* @__PURE__ */ new Set(["providerRef", "provider_ref"]);
11358
12318
  var withoutProviderRefs = /* @__PURE__ */ __name((value) => strip(value), "withoutProviderRefs");
11359
12319
  var strip = /* @__PURE__ */ __name((value) => {
@@ -11367,7 +12327,7 @@ var strip = /* @__PURE__ */ __name((value) => {
11367
12327
  return Object.fromEntries(Object.entries(value).flatMap(([key, inner]) => HIDDEN.has(key) ? [] : [[key, strip(inner)]]));
11368
12328
  }, "strip");
11369
12329
 
11370
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/untrusted-marks.js
12330
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/untrusted-marks.js
11371
12331
  var OPEN = "\u27E6";
11372
12332
  var CLOSE = "\u27E7";
11373
12333
  var untrustedMarkOf = /* @__PURE__ */ __name((app, env) => {
@@ -11451,7 +12411,7 @@ var withFieldsMarked = /* @__PURE__ */ __name((value, fields, mark, id6) => {
11451
12411
  return result;
11452
12412
  }, "withFieldsMarked");
11453
12413
 
11454
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/envelope.js
12414
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/envelope.js
11455
12415
  var answerSchema = /* @__PURE__ */ __name((item = unknown()) => union([listEnvelopeSchema(item), itemEnvelopeSchema(item)]), "answerSchema");
11456
12416
  var capped2 = /* @__PURE__ */ __name((steps) => steps.length > 0 ? { next: steps.slice(0, MAX_NEXT_STEPS) } : {}, "capped");
11457
12417
  var listOf = /* @__PURE__ */ __name((command, input) => {
@@ -11628,9 +12588,37 @@ export {
11628
12588
  sharedCommand,
11629
12589
  customizeSharedCommand,
11630
12590
  refuseJoinedPath,
12591
+ LEVELS,
12592
+ skipFlagFor,
12593
+ DEFAULT_PERMISSIONS,
12594
+ KEYED_UNDER_HOUSEKEEPING,
12595
+ AUTHORITY_KEY,
12596
+ authorityAllowed,
12597
+ BOT_API_KEY,
12598
+ isBotApi,
12599
+ botApiAllowed,
12600
+ layerPermissions,
12601
+ CEILING_KEY,
12602
+ STORE_ONLY_KEYS,
12603
+ fetchesUnder,
12604
+ fetchesAt,
12605
+ stops,
12606
+ levelFor,
12607
+ keyForWrite,
12608
+ writeOfKey,
12609
+ WRITE_KEYS,
12610
+ readKeysForCommand,
12611
+ keyForCommand,
12612
+ assertRetentionEvidenceRead,
11631
12613
  accountSession,
11632
12614
  accountProfile,
12615
+ task,
12616
+ agenda,
11633
12617
  analysisConsent,
12618
+ attachment,
12619
+ WEIGHTS,
12620
+ LINK,
12621
+ oddName,
11634
12622
  member,
11635
12623
  chat,
11636
12624
  message,
@@ -11643,6 +12631,7 @@ export {
11643
12631
  chatEvent,
11644
12632
  contact,
11645
12633
  contactNote,
12634
+ conversation,
11646
12635
  documentLink,
11647
12636
  recordLogFor,
11648
12637
  spawnDetached,
@@ -11684,6 +12673,7 @@ export {
11684
12673
  sendAttempt,
11685
12674
  progress,
11686
12675
  storeTable,
12676
+ tagging,
11687
12677
  template,
11688
12678
  topic,
11689
12679
  ENTITIES,
@@ -11710,6 +12700,10 @@ export {
11710
12700
  inCommandServerRequest,
11711
12701
  commandServerRequest,
11712
12702
  exitCodeSet,
12703
+ sentIds,
12704
+ currentOperation,
12705
+ guardedWrite,
12706
+ codeOf,
11713
12707
  withDeadline,
11714
12708
  DEFAULT_COMMAND_MS,
11715
12709
  DEFAULT_COOPERATIVE_MS,
@@ -11735,12 +12729,27 @@ export {
11735
12729
  AI_ENTRIES,
11736
12730
  AI_SETTING_KEYS,
11737
12731
  resolveAISettings,
12732
+ parseDuration,
12733
+ DEFAULT_TEXT_MODEL,
12734
+ PREVIOUS_DEFAULT_TEXT_MODEL,
12735
+ CustomTextModelShape,
12736
+ textModelsFile,
12737
+ readTextModelsSection,
12738
+ writeTextModelsSection,
12739
+ textModels,
12740
+ textModel,
12741
+ chosenTextModel,
12742
+ RERANK_MODELS,
12743
+ DEFAULT_RERANK_MODEL,
12744
+ rerankModel,
12745
+ vectorModelKey,
12746
+ meaningFloor,
12747
+ historyWindow,
12748
+ limitBatch,
11738
12749
  botsDirectory,
11739
12750
  botFiles,
11740
12751
  ChatRegistry,
11741
12752
  registryProfiles,
11742
- REPAIR_WORDS,
11743
- repairConfigText,
11744
12753
  permissionIssues,
11745
12754
  settingPathOf,
11746
12755
  withoutPath,
@@ -11777,6 +12786,12 @@ export {
11777
12786
  outputFor,
11778
12787
  baseContext,
11779
12788
  inCommandRun,
12789
+ IMAGE_MODELS,
12790
+ DEFAULT_IMAGE_MODEL,
12791
+ imageModel,
12792
+ imageModelsDirectory,
12793
+ placedImage,
12794
+ isImageModelInstalled,
11780
12795
  REMOTE_READ,
11781
12796
  FETCH,
11782
12797
  REMOTE_WRITE,
@@ -11797,6 +12812,7 @@ export {
11797
12812
  narrowsUnderLock,
11798
12813
  admittedUnderLock,
11799
12814
  changesStore,
12815
+ writesOwnerFiles,
11800
12816
  fetchesOnly,
11801
12817
  fetchesOnlyAt,
11802
12818
  writesFileOnlyWith,