@wirecat/bitrix24-cli 0.3.0 → 0.5.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 (255) hide show
  1. package/CHANGELOG.md +130 -0
  2. package/README.md +84 -9
  3. package/dist/api-keys.d.ts +36 -9
  4. package/dist/api-keys.d.ts.map +1 -1
  5. package/dist/api-keys.js +139 -19
  6. package/dist/api-keys.js.map +1 -1
  7. package/dist/bin/b24.js +2 -2
  8. package/dist/bitrix/errors.js +1 -1
  9. package/dist/bitrix/errors.js.map +1 -1
  10. package/dist/bitrix/methods.d.ts.map +1 -1
  11. package/dist/bitrix/methods.js +7 -3
  12. package/dist/bitrix/methods.js.map +1 -1
  13. package/dist/bitrix/transport.d.ts +4 -7
  14. package/dist/bitrix/transport.d.ts.map +1 -1
  15. package/dist/bitrix/transport.js +29 -19
  16. package/dist/bitrix/transport.js.map +1 -1
  17. package/dist/body.d.ts +14 -0
  18. package/dist/body.d.ts.map +1 -0
  19. package/dist/body.js +44 -0
  20. package/dist/body.js.map +1 -0
  21. package/dist/bundle/{chunk-QIPTIUMJ.js → all-profiles-CANIDIDS.js} +12 -7
  22. package/dist/bundle/{anthropic-RHRAVHC2.js → anthropic-JUJB4DCF.js} +5 -5
  23. package/dist/bundle/{app-server-QIT6S7AZ.js → app-server-3V5Z4PTK.js} +68 -54
  24. package/dist/bundle/b24.js +18 -12
  25. package/dist/bundle/{bun-H6RSODZ3.js → bun-LKMV5TY7.js} +2 -2
  26. package/dist/bundle/{bun-sqlite-BO4LTQHX.js → bun-sqlite-S56EF74S.js} +3 -3
  27. package/dist/bundle/{chunk-D5S6QV6R.js → chunk-2I4KWS3H.js} +6 -6
  28. package/dist/bundle/chunk-36PO5NWY.js +147 -0
  29. package/dist/bundle/{chunk-ZIAQPTUS.js → chunk-42F7Q7V6.js} +3 -3
  30. package/dist/bundle/{chunk-6WY72XVQ.js → chunk-4D3K6GZW.js} +18 -4
  31. package/dist/bundle/chunk-5D4MJQ6X.js +22 -0
  32. package/dist/bundle/chunk-5JOPERVF.js +84 -0
  33. package/dist/bundle/chunk-6A4UPWDC.js +15 -0
  34. package/dist/bundle/{chunk-P33NDCDI.js → chunk-6MGWIZG4.js} +1 -1
  35. package/dist/bundle/{chunk-ZDQQCXFG.js → chunk-6YJTNZ7U.js} +13 -13
  36. package/dist/bundle/{chunk-MBDK4YXG.js → chunk-7FBFJ6B4.js} +4 -2
  37. package/dist/bundle/chunk-7VCMOTQP.js +55 -0
  38. package/dist/bundle/{chunk-P364PLIK.js → chunk-A5IMMGYU.js} +36 -34
  39. package/dist/bundle/{chunk-45AKJVKV.js → chunk-ASEHTBNK.js} +1 -1
  40. package/dist/bundle/{chunk-HGL63O5V.js → chunk-B6LPJYPQ.js} +2 -2
  41. package/dist/bundle/{chunk-LSPIOT6Z.js → chunk-BHEE2K6C.js} +7 -7
  42. package/dist/bundle/chunk-BYZQBE63.js +971 -0
  43. package/dist/bundle/{program-H3TGGRQ6.js → chunk-COKGNTDQ.js} +15761 -16685
  44. package/dist/bundle/{chunk-XJXONOB5.js → chunk-DVFYRQGE.js} +1 -1
  45. package/dist/bundle/{chunk-FLUEXJ4X.js → chunk-DVSIBZ3G.js} +1 -1
  46. package/dist/bundle/chunk-EJEIXC6Y.js +273 -0
  47. package/dist/bundle/chunk-EYTGCM44.js +130 -0
  48. package/dist/bundle/{chunk-IRV2PCQ2.js → chunk-EYYOKT23.js} +26 -26
  49. package/dist/bundle/{chunk-PH5FZX6E.js → chunk-FCWPIWSR.js} +2 -2
  50. package/dist/bundle/{chunk-YZ5LHE5Q.js → chunk-FSWRMQWX.js} +2 -2
  51. package/dist/bundle/{chunk-ADLS6FVG.js → chunk-FXBHOCJK.js} +1 -1
  52. package/dist/bundle/chunk-G5MW6RCM.js +723 -0
  53. package/dist/bundle/{chunk-VEWWAGTD.js → chunk-GLTKRLFT.js} +8 -8
  54. package/dist/bundle/chunk-GUUZQ7NE.js +581 -0
  55. package/dist/bundle/{chunk-QSNROIJL.js → chunk-H6RIPOOI.js} +42 -9
  56. package/dist/bundle/{chunk-H2ADPPSH.js → chunk-HGFNC4CR.js} +1819 -597
  57. package/dist/bundle/{chunk-7GRZAKBB.js → chunk-IERYD2N2.js} +6 -6
  58. package/dist/bundle/{chunk-N6FLBXZS.js → chunk-IGCLMEMB.js} +3 -3
  59. package/dist/bundle/{chunk-U5ACMCAQ.js → chunk-J7WCSZ2Q.js} +411 -919
  60. package/dist/bundle/{chunk-W5YAO5G5.js → chunk-JZYHQ4HB.js} +9 -4
  61. package/dist/bundle/{chunk-EVYSBZ3I.js → chunk-K4QM3X5F.js} +4 -4
  62. package/dist/bundle/{chunk-DTXERR44.js → chunk-KFSMY7SZ.js} +2 -2
  63. package/dist/bundle/{chunk-LRGYKOCP.js → chunk-KPEDH5T4.js} +1 -1
  64. package/dist/bundle/{chunk-XRFJWHY5.js → chunk-KUY7LII2.js} +4 -4
  65. package/dist/bundle/{chunk-QC53QBNC.js → chunk-LFXDHLFR.js} +3 -3
  66. package/dist/bundle/{chunk-CNNEA2M4.js → chunk-LGLT4JB6.js} +3 -3
  67. package/dist/bundle/{chunk-QGMDQ2PM.js → chunk-LM4OOBAW.js} +3 -3
  68. package/dist/bundle/chunk-M74BSKMA.js +234 -0
  69. package/dist/bundle/{chunk-2KCZ7BKW.js → chunk-MMMT6ORT.js} +11 -11
  70. package/dist/bundle/{chunk-WII44RXN.js → chunk-NGYD6QTE.js} +2 -2
  71. package/dist/bundle/{chunk-FOTREPNS.js → chunk-NO6QOPVT.js} +10 -19
  72. package/dist/bundle/chunk-O6XC7DZI.js +804 -0
  73. package/dist/bundle/chunk-OE3NFB53.js +64 -0
  74. package/dist/bundle/{chunk-XD4FRDSL.js → chunk-OUMFNB34.js} +13 -149
  75. package/dist/bundle/{chunk-ZGZT5S6B.js → chunk-P2RQTNVJ.js} +806 -850
  76. package/dist/bundle/{chunk-RRJNNPR4.js → chunk-PBIBGIZ7.js} +1 -1
  77. package/dist/bundle/{chunk-EXOOKUEA.js → chunk-Q6VQHTRW.js} +2 -2
  78. package/dist/bundle/{chunk-TE3FR6MI.js → chunk-QHBCNVUG.js} +5 -5
  79. package/dist/bundle/{chunk-SGRYYE4X.js → chunk-QNOXAQ6Y.js} +4 -4
  80. package/dist/bundle/{chunk-QQXH2OPB.js → chunk-R5F2O5GX.js} +15 -272
  81. package/dist/bundle/{chunk-SFRNX2TI.js → chunk-R5PBSKJL.js} +1 -1
  82. package/dist/bundle/{chunk-OTD2ZRXD.js → chunk-RS2BARUU.js} +4 -4
  83. package/dist/bundle/chunk-TG3DSPT5.js +14 -0
  84. package/dist/bundle/{chunk-BCF7P4FZ.js → chunk-U22JMKUO.js} +6 -125
  85. package/dist/bundle/chunk-U66Q5TVK.js +106 -0
  86. package/dist/bundle/{chunk-QMPN6WKD.js → chunk-UCHMQWON.js} +211 -89
  87. package/dist/bundle/{chunk-POC3V3AO.js → chunk-VMJS7FJZ.js} +526 -467
  88. package/dist/bundle/{chunk-FZL7F5NR.js → chunk-VMVAQHDC.js} +77 -615
  89. package/dist/bundle/{chunk-K3UIB6ZF.js → chunk-WWMCJFMT.js} +2 -2
  90. package/dist/bundle/{chunk-CXL33BFL.js → chunk-XTA5TN3H.js} +1 -1
  91. package/dist/bundle/{chunk-WTPMJYMD.js → chunk-XUHHBEA7.js} +652 -131
  92. package/dist/bundle/{chunk-WKRQ44EH.js → chunk-YDZHO4LT.js} +13 -13
  93. package/dist/bundle/{chunk-2SNUMZ7S.js → chunk-ZKINZFIT.js} +6 -6
  94. package/dist/bundle/{chunk-HAXNUIGQ.js → chunk-ZSQXSIFQ.js} +89 -39
  95. package/dist/bundle/{chunk-YYO7D2MO.js → chunk-ZZEHDIEG.js} +58 -54
  96. package/dist/bundle/command-contract-OQV6H7SR.js +36 -0
  97. package/dist/bundle/{decode-5ZPLTYV6.js → decode-QSTBX4MG.js} +3 -3
  98. package/dist/bundle/{echarts-J6LAPIX7.js → echarts-JZELFH2N.js} +2 -2
  99. package/dist/bundle/{embed-YG5LDHME.js → embed-4RIW2LVH.js} +4 -4
  100. package/dist/bundle/{embedder-7FNUA5OZ.js → embedder-SW7DTWSL.js} +7 -7
  101. package/dist/bundle/{first-run-JPZNWIJN.js → first-run-7AISOSOM.js} +8 -8
  102. package/dist/bundle/first-screen-NMHNFZ2B.js +34 -0
  103. package/dist/bundle/{instructions-AXWTQHMR.js → instructions-BZE5YUGG.js} +1 -1
  104. package/dist/bundle/{mcp-7F46P6AM.js → mcp-SDWHDJTY.js} +2 -2
  105. package/dist/bundle/{node-P4E63KXA.js → node-KM3CUABH.js} +9 -9
  106. package/dist/bundle/{node-CWKAIOEM.js → node-LTKZIO4U.js} +2 -2
  107. package/dist/bundle/{node-sqlite-LSEKVRDA.js → node-sqlite-HQ5PN2RH.js} +4 -4
  108. package/dist/bundle/{oauth-THYNLRLD.js → oauth-UH6FOZQL.js} +5 -5
  109. package/dist/bundle/{open-E47QYKFC.js → open-TSUP3XGL.js} +3 -3
  110. package/dist/bundle/{openai-EWSGC3BC.js → openai-GVEE52E3.js} +14 -14
  111. package/dist/bundle/{process-WKTEA3WE.js → process-AGXY76ZE.js} +1 -1
  112. package/dist/bundle/program-BI4A4HFJ.js +2247 -0
  113. package/dist/bundle/{prompt-CAQ7QR3U.js → prompt-NRSUY7FA.js} +3 -3
  114. package/dist/bundle/{recognize-6KGHNZC3.js → recognize-NPDPQ6PJ.js} +2 -2
  115. package/dist/bundle/{remote-3UO2WDC3.js → remote-HFASMVLB.js} +5 -5
  116. package/dist/bundle/{rerank-2JVDPZBX.js → rerank-TL6Z6F7K.js} +5 -5
  117. package/dist/bundle/{chunk-VL6SPMZV.js → serve-VB4DHDZQ.js} +8 -6
  118. package/dist/bundle/server-T5EDRPJI.js +68 -0
  119. package/dist/bundle/{chunk-ZEW4P6AH.js → server-Z6MW6C37.js} +50 -14
  120. package/dist/bundle/source-4IGO5J7E.js +237 -0
  121. package/dist/bundle/sqlite-runtime-YS4POY3W.js +17 -0
  122. package/dist/bundle/{state-7NH5G4XJ.js → state-ISZVVZGR.js} +4 -4
  123. package/dist/bundle/store-IZJBAKJV.js +58 -0
  124. package/dist/bundle/{store-7O4JQD2Z.js → store-L76MSQC3.js} +17 -12
  125. package/dist/bundle/store-PBTIB7BD.js +207 -0
  126. package/dist/bundle/store-maintenance-command-YFKII7TF.js +58 -0
  127. package/dist/bundle/writer-3O5EYMFE.js +214 -0
  128. package/dist/commands/api.d.ts.map +1 -1
  129. package/dist/commands/api.js +81 -30
  130. package/dist/commands/api.js.map +1 -1
  131. package/dist/commands/crm-shared.d.ts +4 -0
  132. package/dist/commands/crm-shared.d.ts.map +1 -0
  133. package/dist/commands/crm-shared.js +94 -0
  134. package/dist/commands/crm-shared.js.map +1 -0
  135. package/dist/commands/crm-writes.d.ts +0 -1
  136. package/dist/commands/crm-writes.d.ts.map +1 -1
  137. package/dist/commands/crm-writes.js +43 -88
  138. package/dist/commands/crm-writes.js.map +1 -1
  139. package/dist/commands/crm.d.ts.map +1 -1
  140. package/dist/commands/crm.js +30 -48
  141. package/dist/commands/crm.js.map +1 -1
  142. package/dist/commands/session.d.ts.map +1 -1
  143. package/dist/commands/session.js +1 -0
  144. package/dist/commands/session.js.map +1 -1
  145. package/dist/commands/write.d.ts +6 -6
  146. package/dist/commands/write.d.ts.map +1 -1
  147. package/dist/commands/write.js +11 -18
  148. package/dist/commands/write.js.map +1 -1
  149. package/dist/config.d.ts +0 -5
  150. package/dist/config.d.ts.map +1 -1
  151. package/dist/config.js +6 -8
  152. package/dist/config.js.map +1 -1
  153. package/dist/crm/capabilities.d.ts +7 -0
  154. package/dist/crm/capabilities.d.ts.map +1 -0
  155. package/dist/crm/capabilities.js +7 -0
  156. package/dist/crm/capabilities.js.map +1 -0
  157. package/dist/crm/conditions.d.ts +1 -1
  158. package/dist/crm/conditions.d.ts.map +1 -1
  159. package/dist/crm/conditions.js +4 -6
  160. package/dist/crm/conditions.js.map +1 -1
  161. package/dist/crm/custom-query.d.ts +19 -0
  162. package/dist/crm/custom-query.d.ts.map +1 -0
  163. package/dist/crm/custom-query.js +79 -0
  164. package/dist/crm/custom-query.js.map +1 -0
  165. package/dist/crm/deal.d.ts +4 -27
  166. package/dist/crm/deal.d.ts.map +1 -1
  167. package/dist/crm/deal.js +15 -48
  168. package/dist/crm/deal.js.map +1 -1
  169. package/dist/crm/fields.d.ts +20 -0
  170. package/dist/crm/fields.d.ts.map +1 -0
  171. package/dist/crm/fields.js +78 -0
  172. package/dist/crm/fields.js.map +1 -0
  173. package/dist/crm/items.d.ts +7 -1
  174. package/dist/crm/items.d.ts.map +1 -1
  175. package/dist/crm/items.js +21 -18
  176. package/dist/crm/items.js.map +1 -1
  177. package/dist/crm/lead.d.ts +5 -36
  178. package/dist/crm/lead.d.ts.map +1 -1
  179. package/dist/crm/lead.js +15 -61
  180. package/dist/crm/lead.js.map +1 -1
  181. package/dist/crm/organization.d.ts +1 -0
  182. package/dist/crm/organization.d.ts.map +1 -1
  183. package/dist/crm/person.d.ts +1 -0
  184. package/dist/crm/person.d.ts.map +1 -1
  185. package/dist/crm/pipelines.d.ts +5 -0
  186. package/dist/crm/pipelines.d.ts.map +1 -0
  187. package/dist/crm/pipelines.js +54 -0
  188. package/dist/crm/pipelines.js.map +1 -0
  189. package/dist/crm/product.d.ts.map +1 -1
  190. package/dist/crm/product.js +2 -2
  191. package/dist/crm/product.js.map +1 -1
  192. package/dist/crm/rest3-fields.d.ts +3 -0
  193. package/dist/crm/rest3-fields.d.ts.map +1 -0
  194. package/dist/crm/rest3-fields.js +38 -0
  195. package/dist/crm/rest3-fields.js.map +1 -0
  196. package/dist/crm/source.d.ts +15 -0
  197. package/dist/crm/source.d.ts.map +1 -0
  198. package/dist/crm/source.js +122 -0
  199. package/dist/crm/source.js.map +1 -0
  200. package/dist/crm/user.d.ts.map +1 -1
  201. package/dist/crm/user.js +2 -2
  202. package/dist/crm/user.js.map +1 -1
  203. package/dist/crm/values.d.ts +26 -5
  204. package/dist/crm/values.d.ts.map +1 -1
  205. package/dist/crm/values.js +40 -5
  206. package/dist/crm/values.js.map +1 -1
  207. package/dist/crm/writer.d.ts +9 -0
  208. package/dist/crm/writer.d.ts.map +1 -0
  209. package/dist/crm/writer.js +119 -0
  210. package/dist/crm/writer.js.map +1 -0
  211. package/dist/program.d.ts.map +1 -1
  212. package/dist/program.js +53 -5
  213. package/dist/program.js.map +1 -1
  214. package/dist/reasons.d.ts.map +1 -1
  215. package/dist/reasons.js +6 -1
  216. package/dist/reasons.js.map +1 -1
  217. package/dist/store.d.ts +15 -0
  218. package/dist/store.d.ts.map +1 -0
  219. package/dist/store.js +33 -0
  220. package/dist/store.js.map +1 -0
  221. package/dist/version.d.ts +1 -1
  222. package/dist/version.js +1 -1
  223. package/package.json +4 -6
  224. package/skills/bitrix24-cli/SKILL.md +16 -10
  225. package/dist/bundle/all-profiles-QJ444GSX.js +0 -24
  226. package/dist/bundle/chunk-XNHSPHUN.js +0 -48
  227. package/dist/bundle/command-contract-OKQOE6G4.js +0 -30
  228. package/dist/bundle/first-screen-VQM4MTS7.js +0 -28
  229. package/dist/bundle/mcp-5RSWNTHS.js +0 -160
  230. package/dist/bundle/mcp-J5R5A65I.js +0 -87
  231. package/dist/bundle/serve-ES7AG5IK.js +0 -19
  232. package/dist/bundle/server-5LE5LNUQ.js +0 -45
  233. package/dist/bundle/server-BU4VBM6S.js +0 -58
  234. package/dist/bundle/store-maintenance-command-UDVGEY2D.js +0 -47
  235. package/dist/commands/doctor.d.ts +0 -77
  236. package/dist/commands/doctor.d.ts.map +0 -1
  237. package/dist/commands/doctor.js +0 -74
  238. package/dist/commands/doctor.js.map +0 -1
  239. package/dist/commands/mcp.d.ts +0 -3
  240. package/dist/commands/mcp.d.ts.map +0 -1
  241. package/dist/commands/mcp.js +0 -97
  242. package/dist/commands/mcp.js.map +0 -1
  243. package/dist/crm/pipeline.d.ts +0 -17
  244. package/dist/crm/pipeline.d.ts.map +0 -1
  245. package/dist/crm/pipeline.js +0 -42
  246. package/dist/crm/pipeline.js.map +0 -1
  247. package/dist/crm/stage.d.ts +0 -20
  248. package/dist/crm/stage.d.ts.map +0 -1
  249. package/dist/crm/stage.js +0 -65
  250. package/dist/crm/stage.js.map +0 -1
  251. package/dist/mcp.d.ts +0 -29
  252. package/dist/mcp.d.ts.map +0 -1
  253. package/dist/mcp.js +0 -99
  254. package/dist/mcp.js.map +0 -1
  255. /package/dist/bundle/{chunk-4PDYYS5K.js → chunk-ZQ3GWKDQ.js} +0 -0
@@ -1,26 +1,60 @@
1
1
  import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
5
+ LOG_ATTRIBUTES,
6
+ RUNS_SIZE_LIMIT_MB,
7
+ childTrace,
8
+ currentRun,
9
+ enclosingTraceId,
10
+ envName,
11
+ inRun,
12
+ logAttributes,
13
+ newRunId,
14
+ progressOf,
15
+ readOnlyLockOf,
16
+ readOnlyRefusal,
17
+ runBudget,
18
+ runsDirFor,
19
+ snakeLogger,
20
+ startRun,
21
+ stopWrites,
22
+ traceOf,
23
+ typedCommand,
24
+ useAsProcessRun,
25
+ withWriteScope
26
+ } from "./chunk-G5MW6RCM.js";
3
27
  import {
4
28
  currentCaller,
5
29
  endpointTemplate,
6
30
  errorDetailOf,
7
31
  framesOf,
8
- isCliFailure,
9
32
  keepsSuccess,
10
33
  providerErrorKey,
11
34
  renderEvent,
12
35
  runContextOf
13
- } from "./chunk-FOTREPNS.js";
36
+ } from "./chunk-NO6QOPVT.js";
37
+ import {
38
+ isCliFailure
39
+ } from "./chunk-5D4MJQ6X.js";
14
40
  import {
15
41
  permissionCeiling
16
- } from "./chunk-CNNEA2M4.js";
42
+ } from "./chunk-LGLT4JB6.js";
17
43
  import {
18
44
  carries
19
- } from "./chunk-XJXONOB5.js";
45
+ } from "./chunk-DVFYRQGE.js";
20
46
  import {
21
47
  filesPresent,
22
48
  sharedModelsDirectory
23
- } from "./chunk-SGRYYE4X.js";
49
+ } from "./chunk-QNOXAQ6Y.js";
50
+ import {
51
+ note
52
+ } from "./chunk-OE3NFB53.js";
53
+ import {
54
+ fieldsOf,
55
+ projectFields,
56
+ resolveOutput
57
+ } from "./chunk-36PO5NWY.js";
24
58
  import {
25
59
  CEILING_KEY,
26
60
  COMMAND_PATH_KEY,
@@ -28,13 +62,10 @@ import {
28
62
  RESOURCES,
29
63
  RESOURCE_KEY,
30
64
  assertOverridesTighten,
31
- fieldsOf,
32
65
  keyForCommand,
33
66
  layerPermissions,
34
- permissionOverrides,
35
- projectFields,
36
- resolveOutput
37
- } from "./chunk-XD4FRDSL.js";
67
+ permissionOverrides
68
+ } from "./chunk-OUMFNB34.js";
38
69
  import {
39
70
  FACT_STATUSES,
40
71
  LINK_KINDS,
@@ -61,23 +92,25 @@ import {
61
92
  text,
62
93
  time,
63
94
  untrusted
64
- } from "./chunk-P364PLIK.js";
95
+ } from "./chunk-A5IMMGYU.js";
65
96
  import {
66
97
  sharedConfigPath
67
- } from "./chunk-TE3FR6MI.js";
98
+ } from "./chunk-QHBCNVUG.js";
68
99
  import {
69
100
  storePath
70
- } from "./chunk-DTXERR44.js";
101
+ } from "./chunk-KFSMY7SZ.js";
71
102
  import {
72
- FACT_TYPES,
73
- FIELD_TYPES,
74
103
  INVOICE_DIRECTIONS,
75
- MEETING_RESULT_ENTITIES,
76
104
  MONEY_DIRECTIONS,
77
105
  ORDER_PURPOSES,
78
106
  ORDER_STATUSES,
107
+ TAG_TYPES
108
+ } from "./chunk-5JOPERVF.js";
109
+ import {
110
+ FACT_TYPES,
111
+ FIELD_TYPES,
112
+ MEETING_RESULT_ENTITIES,
79
113
  QUERY_BACKENDS,
80
- TAG_TYPES,
81
114
  describeQuery,
82
115
  event,
83
116
  meeting,
@@ -93,7 +126,7 @@ import {
93
126
  meetingStats,
94
127
  meetingSummary,
95
128
  meetingTranscript
96
- } from "./chunk-ZGZT5S6B.js";
129
+ } from "./chunk-P2RQTNVJ.js";
97
130
  import {
98
131
  COMPACT_FLAG,
99
132
  CliError,
@@ -110,7 +143,6 @@ import {
110
143
  exitCodeOfAnswer,
111
144
  getDotPath,
112
145
  integer,
113
- isCliError,
114
146
  isoDate,
115
147
  isoTime,
116
148
  itemEnvelopeSchema,
@@ -147,7 +179,6 @@ import {
147
179
  stepOf,
148
180
  strictObject,
149
181
  string,
150
- traceIdOf,
151
182
  trim,
152
183
  union,
153
184
  unknown,
@@ -156,23 +187,12 @@ import {
156
187
  visibleControls,
157
188
  writeSecurely,
158
189
  writes
159
- } from "./chunk-IRV2PCQ2.js";
190
+ } from "./chunk-EYYOKT23.js";
160
191
  import {
161
192
  __name
162
193
  } from "./chunk-ZVVMGPBJ.js";
163
194
 
164
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/ports/app.js
165
- var envName = /* @__PURE__ */ __name((app, name) => `${app.envPrefix}_${name}`, "envName");
166
- var readOnlyLockOf = /* @__PURE__ */ __name((app, env) => {
167
- const name = envName(app, "READ_ONLY");
168
- const value = env[name];
169
- return value === void 0 || value.trim() === "" || value === "0" ? void 0 : name;
170
- }, "readOnlyLockOf");
171
- var mailHolderVariable = /* @__PURE__ */ __name((app) => envName(app, "MAIL_HOLDER"), "mailHolderVariable");
172
- var MESSENGER_CHANGE_REFUSAL = "send, react, change chats or change the account";
173
- var readOnlyRefusal = /* @__PURE__ */ __name((lock, what) => new CliError("permission_error", `this process is read-only (${lock}) \u2014 it cannot ${what}`), "readOnlyRefusal");
174
-
175
- // node_modules/.pnpm/@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/commands/registry.js
195
+ // node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/commands/registry.js
176
196
  var labels = /* @__PURE__ */ new WeakMap();
177
197
  var annotate = /* @__PURE__ */ __name((command, meta) => {
178
198
  labels.set(command, { ...labels.get(command), ...meta });
@@ -192,8 +212,8 @@ var snake = /* @__PURE__ */ __name((name) => name.replace(/[A-Z]/g, (letter) =>
192
212
  var stepTargets = /* @__PURE__ */ __name((root) => {
193
213
  const found = /* @__PURE__ */ new Map();
194
214
  const optionName = /* @__PURE__ */ __name((option) => snake((option.long ?? option.attributeName()).replace(/^--/, "")), "optionName");
195
- const visit2 = /* @__PURE__ */ __name((command, parents2, above) => {
196
- const path2 = [...parents2, command.name()];
215
+ const visit2 = /* @__PURE__ */ __name((command, parents, above) => {
216
+ const path2 = [...parents, command.name()];
197
217
  const options = [...above, ...command.options];
198
218
  const { effects } = metaOf(command);
199
219
  found.set(path2.join(" "), {
@@ -215,8 +235,8 @@ var describeAlone = /* @__PURE__ */ __name((command, known) => {
215
235
  }
216
236
  return found;
217
237
  }, "describeAlone");
218
- var describe = /* @__PURE__ */ __name((command, cli, parents2, above, known) => {
219
- const path2 = [...parents2, command.name()];
238
+ var describe = /* @__PURE__ */ __name((command, cli, parents, above, known) => {
239
+ const path2 = [...parents, command.name()];
220
240
  const args = command.registeredArguments.map(describeArgument);
221
241
  const options = describeOptions(command);
222
242
  const { origin = "handwritten", query, mcp, offline, ...meta } = metaOf(command);
@@ -3673,7 +3693,7 @@ __name(useColor, "useColor");
3673
3693
  // node_modules/.pnpm/commander@15.0.0/node_modules/commander/index.js
3674
3694
  var program = new Command();
3675
3695
 
3676
- // node_modules/.pnpm/@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/commands/document.js
3696
+ // node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/commands/document.js
3677
3697
  var argumentInfoSchema = object({
3678
3698
  name: string(),
3679
3699
  required: boolean(),
@@ -3747,7 +3767,7 @@ var commandsDocumentSchema = strictObject({
3747
3767
  exit_codes: record(string(), pipe(number(), integer()))
3748
3768
  });
3749
3769
 
3750
- // node_modules/.pnpm/@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/commands/contracts.js
3770
+ // node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/commands/contracts.js
3751
3771
  import { isDeepStrictEqual } from "node:util";
3752
3772
  var protectedCommands = /* @__PURE__ */ new WeakMap();
3753
3773
  var hidden = /* @__PURE__ */ __name((command) => Boolean(command._hidden), "hidden");
@@ -3856,7 +3876,7 @@ var sharedCommand = /* @__PURE__ */ __name((factory) => (...args) => {
3856
3876
  return result;
3857
3877
  }, "sharedCommand");
3858
3878
 
3859
- // node_modules/.pnpm/@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/commands/index.js
3879
+ // node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/commands/index.js
3860
3880
  var refuseJoinedPath = /* @__PURE__ */ __name((root, args, prefix = []) => {
3861
3881
  let command = root;
3862
3882
  const path2 = [];
@@ -3874,113 +3894,7 @@ var refuseJoinedPath = /* @__PURE__ */ __name((root, args, prefix = []) => {
3874
3894
  }
3875
3895
  }, "refuseJoinedPath");
3876
3896
 
3877
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/sends/guarded.js
3878
- import { AsyncLocalStorage } from "node:async_hooks";
3879
- var sentIds = /* @__PURE__ */ __name((typed2, message2) => ({
3880
- messageId: message2.id,
3881
- ...message2.chatId && message2.chatId !== typed2 ? { resultChatId: message2.chatId } : {}
3882
- }), "sentIds");
3883
- var current = new AsyncLocalStorage();
3884
- var writesInFlight = new AsyncLocalStorage();
3885
- var parents = /* @__PURE__ */ new WeakMap();
3886
- var stopped = /* @__PURE__ */ new WeakMap();
3887
- var scopesFor = /* @__PURE__ */ __name((scope = writesInFlight.getStore()) => {
3888
- const result = [];
3889
- for (let at2 = scope; at2; at2 = parents.get(at2))
3890
- result.push(at2);
3891
- return result;
3892
- }, "scopesFor");
3893
- var withWriteScope = /* @__PURE__ */ __name((scope, body) => {
3894
- const parent = writesInFlight.getStore();
3895
- if (parent && parent !== scope)
3896
- parents.set(scope, parent);
3897
- return writesInFlight.run(scope, body);
3898
- }, "withWriteScope");
3899
- var stopWrites = /* @__PURE__ */ __name((scope, reason) => {
3900
- stopped.set(scope, reason);
3901
- for (const write of scope)
3902
- write.cut();
3903
- }, "stopWrites");
3904
- var refuseStopped = /* @__PURE__ */ __name((scopes3) => {
3905
- for (const scope of scopes3)
3906
- if (stopped.has(scope))
3907
- throw stopped.get(scope);
3908
- }, "refuseStopped");
3909
- var currentOperation = /* @__PURE__ */ __name(() => current.getStore(), "currentOperation");
3910
- var guardedWrite = /* @__PURE__ */ __name(async (guard, attempt, act, settled2 = () => ({}), prepare) => {
3911
- const scopes3 = scopesFor();
3912
- refuseStopped(scopes3);
3913
- try {
3914
- await guard.ask?.(attempt);
3915
- refuseStopped(scopes3);
3916
- if (guard.reserve) {
3917
- guard.check(attempt, { reserve: false });
3918
- await guard.reserve(attempt);
3919
- } else
3920
- guard.check(attempt);
3921
- } catch (error) {
3922
- guard.record({ ...attempt, outcome: "refused", errorCode: codeOf(error) });
3923
- throw error;
3924
- }
3925
- try {
3926
- refuseStopped(scopes3);
3927
- } catch (error) {
3928
- guard.record({ ...attempt, outcome: "failed", errorCode: codeOf(error) });
3929
- throw error;
3930
- }
3931
- let recorded2 = false;
3932
- const once = /* @__PURE__ */ __name((entry) => {
3933
- if (recorded2)
3934
- return;
3935
- recorded2 = true;
3936
- guard.record(entry);
3937
- }, "once");
3938
- let cancelled = false;
3939
- const flight = {
3940
- operationId: attempt.operationId,
3941
- preparing: prepare !== void 0,
3942
- cut: /* @__PURE__ */ __name(() => {
3943
- cancelled = true;
3944
- once({
3945
- ...attempt,
3946
- outcome: flight.preparing ? "failed" : "outcome_unknown",
3947
- errorCode: flight.preparing ? "timeout" : "outcome_unknown"
3948
- });
3949
- }, "cut")
3950
- };
3951
- for (const scope of scopes3)
3952
- scope.add(flight);
3953
- try {
3954
- if (prepare !== void 0)
3955
- await prepare();
3956
- if (cancelled)
3957
- throw new CliError("timeout", "the command ended before sending; nothing was sent", { sent: false });
3958
- flight.preparing = false;
3959
- const done = await current.run(attempt.operationId, act);
3960
- if (cancelled)
3961
- throw new CliError("outcome_unknown", "the command ended with a write in flight; check its result before continuing", { operation_id: attempt.operationId });
3962
- once({ ...attempt, ...settled2(done), outcome: "sent" });
3963
- return done;
3964
- } catch (error) {
3965
- const code = codeOf(error);
3966
- once({ ...attempt, outcome: code === "outcome_unknown" ? "outcome_unknown" : "failed", errorCode: code });
3967
- if (code === "outcome_unknown" && error instanceof Error)
3968
- throw new CliError("outcome_unknown", error.message, {
3969
- ...error.details,
3970
- operation_id: attempt.operationId,
3971
- retryable: false
3972
- });
3973
- if (flight.preparing && isCliError(error) && error.details.sent === void 0)
3974
- throw new CliError(error.code, error.message, { ...error.details, sent: false });
3975
- throw error;
3976
- } finally {
3977
- for (const scope of scopes3)
3978
- scope.delete(flight);
3979
- }
3980
- }, "guardedWrite");
3981
- var codeOf = /* @__PURE__ */ __name((error) => typeof error?.code === "string" ? error.code : "unknown", "codeOf");
3982
-
3983
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/cli/execution.js
3897
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/execution.js
3984
3898
  var DEFAULT_COMMAND_MS = 3e4;
3985
3899
  var DEFAULT_COOPERATIVE_MS = 5 * 6e4;
3986
3900
  var DEFAULT_SYNC_MS = 15 * 6e4;
@@ -4163,7 +4077,7 @@ var withAbort = /* @__PURE__ */ __name(async (signal, body) => {
4163
4077
  }
4164
4078
  }, "withAbort");
4165
4079
 
4166
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/cli/messenger/accounts.js
4080
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/messenger/accounts.js
4167
4081
  import { existsSync, readdirSync, readFileSync } from "node:fs";
4168
4082
  import { join } from "node:path";
4169
4083
  var accountFileFor = /* @__PURE__ */ __name((app, profile, env) => join(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "accounts", `${profile}.json`), "accountFileFor");
@@ -4185,7 +4099,7 @@ var profilesWithAccounts = /* @__PURE__ */ __name((app, env) => {
4185
4099
  }, "profilesWithAccounts");
4186
4100
  var profilesHere = /* @__PURE__ */ __name((app, configured, env) => [.../* @__PURE__ */ new Set([...configured, ...profilesWithAccounts(app, env)])].sort(), "profilesHere");
4187
4101
 
4188
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/runs/log-events.js
4102
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/runs/log-events.js
4189
4103
  var CORE_LOG_EVENTS = defineLogEvents([
4190
4104
  { id: "provider.request", meaning: "a request went to the messenger", keys: ["operation"] },
4191
4105
  { id: "provider.response", meaning: "the messenger answered the request, or it failed", keys: ["operation"] },
@@ -4219,487 +4133,7 @@ var DIAGNOSTIC_LOG_EVENTS = {
4219
4133
  cache: "cache.answered"
4220
4134
  };
4221
4135
 
4222
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/runs/log-keys.js
4223
- var snake2 = /* @__PURE__ */ __name((key) => key.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`), "snake");
4224
- var camel = /* @__PURE__ */ __name((key) => key.replace(/_([a-z0-9])/g, (_, letter) => letter.toUpperCase()), "camel");
4225
- var renamed = /* @__PURE__ */ __name((record2, name) => Object.fromEntries(Object.entries(record2).map(([key, value]) => [name(key), value])), "renamed");
4226
- var logAttributes = /* @__PURE__ */ __name((event2) => renamed(event2, snake2), "logAttributes");
4227
- var fromLogAttributes = /* @__PURE__ */ __name((attributes) => renamed(attributes, camel), "fromLogAttributes");
4228
- var snakeLogger = /* @__PURE__ */ __name((logger) => ({
4229
- debug: /* @__PURE__ */ __name((event2, message2) => logger.debug(logAttributes(event2), message2), "debug"),
4230
- info: /* @__PURE__ */ __name((event2, message2) => logger.info(logAttributes(event2), message2), "info"),
4231
- warn: /* @__PURE__ */ __name((event2, message2) => logger.warn(logAttributes(event2), message2), "warn"),
4232
- error: /* @__PURE__ */ __name((event2, message2) => logger.error(logAttributes(event2), message2), "error")
4233
- }), "snakeLogger");
4234
-
4235
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/runs/run.js
4236
- import { randomUUID } from "node:crypto";
4237
- import { appendFileSync, mkdirSync, readdirSync as readdirSync2, readFileSync as readFileSync2, rmSync, statSync, writeFileSync } from "node:fs";
4238
- import { userInfo } from "node:os";
4239
- import { join as join2, sep } from "node:path";
4240
-
4241
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/runs/log-attributes.js
4242
- var diagnostic = {
4243
- event: true,
4244
- operation: true,
4245
- opcode: true,
4246
- seq: true,
4247
- status: true,
4248
- method: true,
4249
- endpointTemplate: true,
4250
- bytes: true,
4251
- ids: true,
4252
- counts: true,
4253
- durationMs: true,
4254
- outcome: true,
4255
- errorCode: true,
4256
- providerError: true,
4257
- level: true,
4258
- transport: true,
4259
- attempt: true,
4260
- waitMs: true,
4261
- code: true,
4262
- detail: true,
4263
- reason: true,
4264
- ageMs: true
4265
- };
4266
- var send = {
4267
- profile: true,
4268
- chatId: true,
4269
- outcome: true,
4270
- kind: true,
4271
- action: true,
4272
- people: true,
4273
- messageId: true,
4274
- key: true,
4275
- count: true,
4276
- forEveryone: true,
4277
- sendId: true,
4278
- operationId: true,
4279
- parentOperationId: true,
4280
- replyTo: true,
4281
- threadId: true,
4282
- sendAs: true,
4283
- resultChatId: true,
4284
- length: true,
4285
- attachments: true,
4286
- scheduledFor: true,
4287
- notify: true,
4288
- origin: true,
4289
- reservation: true,
4290
- errorCode: true
4291
- };
4292
- var background = [
4293
- "job",
4294
- "pid",
4295
- "schedule",
4296
- "exitCode",
4297
- "tool",
4298
- "tier",
4299
- "actorType",
4300
- "actorId",
4301
- "agent",
4302
- "targetType",
4303
- "targetId"
4304
- ];
4305
- var crash = ["errorClass", "frames"];
4306
- var dropped = ["dropped"];
4307
- var LOG_ATTRIBUTES = [
4308
- ...new Set([...Object.keys(diagnostic), ...Object.keys(send), ...background, ...crash, ...dropped].map((key) => Object.keys(logAttributes({ [key]: true }))[0]))
4309
- ].sort();
4310
-
4311
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/runs/run.js
4312
- var KEEP_RUNS_FOR_DAYS = 30;
4313
- var KEEP_SUCCESSFUL_RUNS_FOR_DAYS = 7;
4314
- var RUNS_SIZE_LIMIT_MB = 200;
4315
- var runsDirFor = /* @__PURE__ */ __name((app, env = process.env) => join2(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "runs"), "runsDirFor");
4316
- var startRun = /* @__PURE__ */ __name((options) => {
4317
- const now = options.now ?? (() => /* @__PURE__ */ new Date());
4318
- const startedAt = options.startedAt ?? now();
4319
- const id6 = options.runId ?? newRunId(startedAt, options.command);
4320
- const dir = join2(options.runsDir, day(startedAt), id6);
4321
- pruneRuns(options.runsDir, {
4322
- keepDays: options.keepDays ?? KEEP_RUNS_FOR_DAYS,
4323
- keepSuccessDays: options.keepSuccessDays ?? KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
4324
- maxBytes: options.maxBytes ?? RUNS_SIZE_LIMIT_MB * 1024 * 1024,
4325
- now: startedAt
4326
- });
4327
- refuseRealStateInTests(dir);
4328
- const metadata = {
4329
- runId: id6,
4330
- command: options.command,
4331
- ...options.profile === void 0 ? {} : { profile: options.profile },
4332
- startedAt: startedAt.toISOString(),
4333
- status: "running",
4334
- cliVersion: options.cliVersion,
4335
- runtime: runtime(),
4336
- platform: process.platform,
4337
- arch: process.arch,
4338
- ...options.traceId === void 0 ? {} : { traceId: options.traceId },
4339
- ...options.context
4340
- };
4341
- let file;
4342
- const opened = /* @__PURE__ */ __name(() => {
4343
- if (file)
4344
- return file;
4345
- mkdirSync(dir, { recursive: true, mode: 448 });
4346
- const events2 = join2(dir, "events.jsonl");
4347
- writeFileSync(events2, "", { flag: "a", mode: 384 });
4348
- file = snakeLogger(createRecordLog({
4349
- to: events2,
4350
- runId: id6,
4351
- command: options.command,
4352
- resource: { service: options.service, version: options.cliVersion },
4353
- allow: LOG_ATTRIBUTES,
4354
- ...options.traceId === void 0 ? {} : { traceId: options.traceId },
4355
- ...options.onError === void 0 ? {} : { onError: options.onError }
4356
- }));
4357
- writeRunFile(dir, metadata);
4358
- return file;
4359
- }, "opened");
4360
- if (!options.lazy)
4361
- opened();
4362
- let finished = false;
4363
- const operations = /* @__PURE__ */ new Set();
4364
- const codes = /* @__PURE__ */ new Set();
4365
- const noted = /* @__PURE__ */ __name((level2) => (event2, message2) => {
4366
- const { operation, errorCode, error_code, code } = event2;
4367
- if (typeof operation === "string")
4368
- operations.add(operation);
4369
- for (const value of [errorCode, error_code, code])
4370
- if (typeof value === "string")
4371
- codes.add(value);
4372
- if (finished)
4373
- return;
4374
- opened()[level2](event2, message2);
4375
- }, "noted");
4376
- const logger = { debug: noted("debug"), info: noted("info"), warn: noted("warn"), error: noted("error") };
4377
- return {
4378
- id: id6,
4379
- dir,
4380
- logger,
4381
- finish: /* @__PURE__ */ __name(async (status2, extra = {}) => {
4382
- if (finished)
4383
- return;
4384
- finished = true;
4385
- const completedAt = now();
4386
- const final = {
4387
- ...metadata,
4388
- ...extra,
4389
- status: status2,
4390
- completedAt: completedAt.toISOString(),
4391
- durationMs: completedAt.getTime() - startedAt.getTime(),
4392
- operations: [...operations].sort(),
4393
- codes: [...codes].sort()
4394
- };
4395
- if (file || status2 !== "success") {
4396
- opened();
4397
- writeRunFile(dir, final);
4398
- return;
4399
- }
4400
- try {
4401
- mkdirSync(join2(dir, ".."), { recursive: true, mode: 448 });
4402
- appendIndex(join2(dir, ".."), runFileOf(final));
4403
- } catch (error) {
4404
- options.onError?.(error);
4405
- }
4406
- }, "finish")
4407
- };
4408
- }, "startRun");
4409
- var refuseRealStateInTests = /* @__PURE__ */ __name((dir, env = process.env) => {
4410
- if (env.VITEST === void 0)
4411
- return;
4412
- let home;
4413
- try {
4414
- home = userInfo().homedir;
4415
- } catch {
4416
- return;
4417
- }
4418
- if (dir.startsWith(join2(home, ".local", "share") + sep))
4419
- throw new Error(`a test opened a run in the real data folder: ${dir}`);
4420
- }, "refuseRealStateInTests");
4421
- var runtime = /* @__PURE__ */ __name(() => {
4422
- const bun = process.versions.bun;
4423
- return bun ? `bun ${bun}` : `node ${process.versions.node}`;
4424
- }, "runtime");
4425
- var newRunId = /* @__PURE__ */ __name((startedAt, command) => {
4426
- const stamp = startedAt.toISOString().replace(/[-:]/g, "").replace(/\.\d+Z$/, "Z");
4427
- const slug = command.replace(/[^a-z0-9]+/gi, "-").toLowerCase();
4428
- return `${stamp}-${slug}-${randomUUID().slice(0, 6)}`;
4429
- }, "newRunId");
4430
- var INDEX = "index.jsonl";
4431
- var appendIndex = /* @__PURE__ */ __name((dayDir, written) => {
4432
- appendFileSync(join2(dayDir, INDEX), `${JSON.stringify(written)}
4433
- `, { mode: 384 });
4434
- }, "appendIndex");
4435
- var writeRunFile = /* @__PURE__ */ __name((dir, metadata) => {
4436
- const written = runFileOf(metadata);
4437
- writeSecurely(join2(dir, "run.json"), `${JSON.stringify(written, null, 2)}
4438
- `, 384);
4439
- try {
4440
- appendIndex(join2(dir, ".."), written);
4441
- } catch {
4442
- }
4443
- }, "writeRunFile");
4444
- var matchesListFilter = /* @__PURE__ */ __name((run, filter) => (filter.runId === void 0 || run.runId === filter.runId) && (filter.command === void 0 || run.command === filter.command) && (filter.profile === void 0 || run.profile === filter.profile) && (filter.status === void 0 || run.status === filter.status) && (filter.errorCode === void 0 || run.errorCode === filter.errorCode), "matchesListFilter");
4445
- var listRuns = /* @__PURE__ */ __name((runsDir, { since, atLeast = Number.POSITIVE_INFINITY, filter = {} } = {}) => {
4446
- const first2 = since === void 0 ? void 0 : day(new Date(since));
4447
- const runs = [];
4448
- for (const date of days(runsDir).sort().reverse()) {
4449
- if (first2 !== void 0 && date < first2 || runs.length >= atLeast)
4450
- break;
4451
- for (const metadata of runsOfDay(join2(runsDir, date))) {
4452
- if (matchesListFilter(metadata, filter))
4453
- runs.push(metadata);
4454
- }
4455
- }
4456
- return runs;
4457
- }, "listRuns");
4458
- var indexedRuns = /* @__PURE__ */ __name((dayDir) => {
4459
- const latest = /* @__PURE__ */ new Map();
4460
- let raw = "";
4461
- try {
4462
- raw = readFileSync2(join2(dayDir, INDEX), "utf8");
4463
- } catch {
4464
- }
4465
- for (const line of raw.split("\n")) {
4466
- if (line.trim() === "")
4467
- continue;
4468
- try {
4469
- const metadata = metadataOf(JSON.parse(line));
4470
- if (typeof metadata.runId === "string")
4471
- latest.set(metadata.runId, metadata);
4472
- } catch {
4473
- }
4474
- }
4475
- return latest;
4476
- }, "indexedRuns");
4477
- var runsOfDay = /* @__PURE__ */ __name((dayDir) => {
4478
- const latest = indexedRuns(dayDir);
4479
- for (const entry of safeReaddir(dayDir)) {
4480
- if (entry === INDEX || entry.startsWith(".") || latest.has(entry))
4481
- continue;
4482
- const metadata = readRun(join2(dayDir, entry));
4483
- if (metadata)
4484
- latest.set(metadata.runId, metadata);
4485
- }
4486
- return [...latest.values()].sort((a, b) => a.runId < b.runId ? 1 : a.runId > b.runId ? -1 : 0);
4487
- }, "runsOfDay");
4488
- var findRun = /* @__PURE__ */ __name((runsDir, id6) => {
4489
- const stamped = /^(\d{4})(\d{2})(\d{2})T/.exec(id6);
4490
- const likely = stamped ? [`${stamped[1]}-${stamped[2]}-${stamped[3]}`] : [];
4491
- const dates = [.../* @__PURE__ */ new Set([...likely, ...days(runsDir)])];
4492
- for (const date of dates) {
4493
- const dir = join2(runsDir, date, id6);
4494
- const metadata = readRun(dir);
4495
- if (metadata)
4496
- return { dir, metadata };
4497
- }
4498
- for (const date of dates) {
4499
- const metadata = indexedRuns(join2(runsDir, date)).get(id6);
4500
- if (metadata)
4501
- return { dir: join2(runsDir, date, id6), metadata };
4502
- }
4503
- return void 0;
4504
- }, "findRun");
4505
- var readEvents = /* @__PURE__ */ __name((dir) => {
4506
- let raw;
4507
- try {
4508
- raw = readFileSync2(join2(dir, "events.jsonl"), "utf8");
4509
- } catch {
4510
- return [];
4511
- }
4512
- const events2 = [];
4513
- for (const line of raw.split("\n")) {
4514
- if (line.trim() === "")
4515
- continue;
4516
- try {
4517
- const parsed = JSON.parse(line);
4518
- if (parsed !== null && typeof parsed === "object")
4519
- events2.push(eventOf(parsed));
4520
- } catch {
4521
- }
4522
- }
4523
- return events2;
4524
- }, "readEvents");
4525
- var eventOf = /* @__PURE__ */ __name((line) => {
4526
- const { attributes, time: time2, severity } = line;
4527
- if (attributes === null || typeof attributes !== "object")
4528
- return logAttributes(line);
4529
- return { time: time2, severity, ...logAttributes(attributes) };
4530
- }, "eventOf");
4531
- var pruneRuns = /* @__PURE__ */ __name((runsDir, { keepDays, keepSuccessDays = keepDays, maxBytes, now }) => {
4532
- const cutoff = day(new Date(now.getTime() - keepDays * DAY_MS));
4533
- const successCutoff = day(new Date(now.getTime() - Math.min(keepSuccessDays, keepDays) * DAY_MS));
4534
- let removed = 0;
4535
- for (const date of days(runsDir)) {
4536
- if (date >= cutoff) {
4537
- if (date < successCutoff)
4538
- dropSuccesses(join2(runsDir, date));
4539
- continue;
4540
- }
4541
- try {
4542
- rmSync(join2(runsDir, date), { recursive: true, force: true });
4543
- removed += 1;
4544
- } catch {
4545
- }
4546
- }
4547
- if (maxBytes !== void 0)
4548
- removed += fitSize(runsDir, maxBytes, now);
4549
- return removed;
4550
- }, "pruneRuns");
4551
- var DAY_MS = 24 * 60 * 60 * 1e3;
4552
- var SUCCESSES_DROPPED = ".successes-dropped";
4553
- var SIZE_CHECKED = ".size-checked";
4554
- var dropSuccesses = /* @__PURE__ */ __name((dayDir) => {
4555
- const marker = join2(dayDir, SUCCESSES_DROPPED);
4556
- try {
4557
- statSync(marker);
4558
- return;
4559
- } catch {
4560
- }
4561
- try {
4562
- const kept = [];
4563
- for (const [id6, metadata] of indexedRuns(dayDir)) {
4564
- if (metadata.status === "success")
4565
- rmSync(join2(dayDir, id6), { recursive: true, force: true });
4566
- else
4567
- kept.push(JSON.stringify(runFileOf(metadata)));
4568
- }
4569
- for (const entry of safeReaddir(dayDir)) {
4570
- if (entry === INDEX || entry.startsWith("."))
4571
- continue;
4572
- if (readRun(join2(dayDir, entry))?.status === "success")
4573
- rmSync(join2(dayDir, entry), { recursive: true, force: true });
4574
- }
4575
- writeSecurely(join2(dayDir, INDEX), kept.map((line) => `${line}
4576
- `).join(""), 384);
4577
- writeFileSync(marker, "", { mode: 384 });
4578
- } catch {
4579
- }
4580
- }, "dropSuccesses");
4581
- var sizeOf = /* @__PURE__ */ __name((path2) => {
4582
- let total = 0;
4583
- for (const entry of safeReaddir(path2)) {
4584
- const full = join2(path2, entry);
4585
- try {
4586
- const stat = statSync(full);
4587
- total += stat.isDirectory() ? sizeOf(full) : stat.size;
4588
- } catch {
4589
- }
4590
- }
4591
- return total;
4592
- }, "sizeOf");
4593
- var fitSize = /* @__PURE__ */ __name((runsDir, maxBytes, now) => {
4594
- const stamp = join2(runsDir, SIZE_CHECKED);
4595
- const today = day(now);
4596
- try {
4597
- if (readFileSync2(stamp, "utf8").trim() === today)
4598
- return 0;
4599
- } catch {
4600
- }
4601
- const dates = days(runsDir).sort();
4602
- const sizes = new Map(dates.map((date) => [date, sizeOf(join2(runsDir, date))]));
4603
- let total = [...sizes.values()].reduce((sum, size) => sum + size, 0);
4604
- let removed = 0;
4605
- for (const date of dates) {
4606
- if (total <= maxBytes || date === today)
4607
- break;
4608
- dropSuccesses(join2(runsDir, date));
4609
- const after = sizeOf(join2(runsDir, date));
4610
- total -= (sizes.get(date) ?? 0) - after;
4611
- sizes.set(date, after);
4612
- }
4613
- for (const date of dates) {
4614
- if (total <= maxBytes || date === today)
4615
- break;
4616
- try {
4617
- rmSync(join2(runsDir, date), { recursive: true, force: true });
4618
- total -= sizes.get(date) ?? 0;
4619
- removed += 1;
4620
- } catch {
4621
- }
4622
- }
4623
- try {
4624
- mkdirSync(runsDir, { recursive: true, mode: 448 });
4625
- writeFileSync(stamp, today, { mode: 384 });
4626
- } catch {
4627
- }
4628
- return removed;
4629
- }, "fitSize");
4630
- var day = /* @__PURE__ */ __name((date) => date.toISOString().slice(0, 10), "day");
4631
- var days = /* @__PURE__ */ __name((runsDir) => safeReaddir(runsDir).filter((entry) => /^\d{4}-\d{2}-\d{2}$/.test(entry)), "days");
4632
- var readRun = /* @__PURE__ */ __name((dir) => {
4633
- try {
4634
- return metadataOf(JSON.parse(readFileSync2(join2(dir, "run.json"), "utf8")));
4635
- } catch {
4636
- return void 0;
4637
- }
4638
- }, "readRun");
4639
- var safeReaddir = /* @__PURE__ */ __name((dir) => {
4640
- try {
4641
- return readdirSync2(dir);
4642
- } catch {
4643
- return [];
4644
- }
4645
- }, "safeReaddir");
4646
- var runFileOf = /* @__PURE__ */ __name(({ partial: partial2, ...metadata }) => ({
4647
- ...logAttributes(metadata),
4648
- ...partial2 ? { partial: { ...logAttributes(partial2), failures: partial2.failures.map((failure) => logAttributes(failure)) } } : {}
4649
- }), "runFileOf");
4650
- var metadataOf = /* @__PURE__ */ __name((parsed) => {
4651
- const { partial: partial2, ...metadata } = fromLogAttributes(parsed);
4652
- if (partial2 === null || typeof partial2 !== "object")
4653
- return metadata;
4654
- const { failures, ...rest } = fromLogAttributes(partial2);
4655
- return {
4656
- ...metadata,
4657
- partial: {
4658
- ...rest,
4659
- failures: Array.isArray(failures) ? failures.map((failure) => fromLogAttributes(failure)) : []
4660
- }
4661
- };
4662
- }, "metadataOf");
4663
-
4664
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/runs/scope.js
4665
- import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
4666
- import { randomBytes } from "node:crypto";
4667
- var scopes = new AsyncLocalStorage2();
4668
- var processScope;
4669
- var currentRun = /* @__PURE__ */ __name(() => {
4670
- const scope = scopes.getStore();
4671
- if (scope)
4672
- return scope;
4673
- processScope ??= {
4674
- runId: newRunId(/* @__PURE__ */ new Date(), "process"),
4675
- command: "",
4676
- startedAt: Date.now(),
4677
- ...traceOf(process.env)
4678
- };
4679
- return processScope;
4680
- }, "currentRun");
4681
- var inRun = /* @__PURE__ */ __name((scope, body) => scopes.run(scope, body), "inRun");
4682
- var runEvent = /* @__PURE__ */ __name((event2) => scopes.getStore()?.events?.(event2), "runEvent");
4683
- var typedCommand = /* @__PURE__ */ __name((tool, words, profile = currentRun().profile) => [tool, profile, words].filter((part) => part !== void 0 && part !== "").join(" "), "typedCommand");
4684
- var useAsProcessRun = /* @__PURE__ */ __name((scope) => {
4685
- processScope = scope;
4686
- }, "useAsProcessRun");
4687
- var processRun = /* @__PURE__ */ __name(() => processScope, "processRun");
4688
- var enclosingTraceId = /* @__PURE__ */ __name(() => scopes.getStore()?.traceId, "enclosingTraceId");
4689
- var traceOf = /* @__PURE__ */ __name((env) => {
4690
- const traceId = traceIdOf(env.TRACEPARENT);
4691
- return traceId === void 0 ? {} : { traceId };
4692
- }, "traceOf");
4693
- var childTrace = /* @__PURE__ */ __name(() => {
4694
- const hex = /* @__PURE__ */ __name((bytes) => randomBytes(bytes).toString("hex"), "hex");
4695
- const traceId = hex(16);
4696
- return { traceId, traceparent: `00-${traceId}-${hex(8)}-01` };
4697
- }, "childTrace");
4698
- var attempts = new AsyncLocalStorage2();
4699
- var withAttempt = /* @__PURE__ */ __name((attempt, work) => attempts.run(attempt, work), "withAttempt");
4700
- var currentAttempt = /* @__PURE__ */ __name(() => attempts.getStore(), "currentAttempt");
4701
-
4702
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/runs/recording.js
4136
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/runs/recording.js
4703
4137
  var recorded = /* @__PURE__ */ __name(async (options, body) => {
4704
4138
  const recording = startRecording(options);
4705
4139
  try {
@@ -4818,13 +4252,13 @@ var EVENT_BYTES_AT_MOST = 1024 * 1024;
4818
4252
  var capped = /* @__PURE__ */ __name(() => {
4819
4253
  let lines = 0;
4820
4254
  let bytes = 0;
4821
- let dropped2 = 0;
4255
+ let dropped = 0;
4822
4256
  const byOperation = {};
4823
4257
  return {
4824
4258
  log: /* @__PURE__ */ __name((run, event2) => {
4825
4259
  const size = JSON.stringify(logAttributes(event2)).length + 200;
4826
4260
  if (lines >= EVENTS_AT_MOST || bytes + size > EVENT_BYTES_AT_MOST) {
4827
- dropped2 += 1;
4261
+ dropped += 1;
4828
4262
  const operation = "operation" in event2 && event2.operation ? event2.operation : event2.event;
4829
4263
  byOperation[operation] = (byOperation[operation] ?? 0) + 1;
4830
4264
  return;
@@ -4834,10 +4268,10 @@ var capped = /* @__PURE__ */ __name(() => {
4834
4268
  logEvent(run, event2);
4835
4269
  }, "log"),
4836
4270
  close: /* @__PURE__ */ __name((run) => {
4837
- if (dropped2 > 0)
4838
- run.logger.warn({ event: "events.dropped", dropped: dropped2, counts: byOperation });
4271
+ if (dropped > 0)
4272
+ run.logger.warn({ event: "events.dropped", dropped, counts: byOperation });
4839
4273
  }, "close"),
4840
- dropped: /* @__PURE__ */ __name(() => dropped2 > 0 ? { eventsDropped: dropped2 } : {}, "dropped")
4274
+ dropped: /* @__PURE__ */ __name(() => dropped > 0 ? { eventsDropped: dropped } : {}, "dropped")
4841
4275
  };
4842
4276
  }, "capped");
4843
4277
  var logEvent = /* @__PURE__ */ __name((run, event2) => {
@@ -4884,7 +4318,7 @@ var partialOutcome = /* @__PURE__ */ __name((answer) => {
4884
4318
  return void 0;
4885
4319
  }, "partialOutcome");
4886
4320
 
4887
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/cli/deadline.js
4321
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/deadline.js
4888
4322
  var withDeadline = /* @__PURE__ */ __name(async (ms2, closeables, body) => {
4889
4323
  if (ms2 === void 0)
4890
4324
  return body();
@@ -4910,7 +4344,7 @@ var withDeadline = /* @__PURE__ */ __name(async (ms2, closeables, body) => {
4910
4344
  }
4911
4345
  }, "withDeadline");
4912
4346
 
4913
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/cli/profile.js
4347
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/profile.js
4914
4348
  var asFirstWord = /* @__PURE__ */ __name((profile) => `${profile} `, "asFirstWord");
4915
4349
  var PLAIN_NAME = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
4916
4350
  var isProfileName = /* @__PURE__ */ __name((word) => PLAIN_NAME.test(word), "isProfileName");
@@ -4979,10 +4413,10 @@ var sampleCommand = /* @__PURE__ */ __name((commands) => {
4979
4413
  return void 0;
4980
4414
  }, "sampleCommand");
4981
4415
 
4982
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/cli/settings.js
4416
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/settings.js
4983
4417
  import { existsSync as existsSync4 } from "node:fs";
4984
4418
 
4985
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/models/endpoint.js
4419
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/models/endpoint.js
4986
4420
  var endpoint = /* @__PURE__ */ __name((value) => {
4987
4421
  try {
4988
4422
  const url2 = new URL(value);
@@ -4992,7 +4426,7 @@ var endpoint = /* @__PURE__ */ __name((value) => {
4992
4426
  }
4993
4427
  }, "endpoint");
4994
4428
 
4995
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/models/settings.js
4429
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/models/settings.js
4996
4430
  var MODEL_FIELDS = ["provider", "model", "base_url"];
4997
4431
  var modelSettingsShape = record(pipe(string(), regex(/^[a-z][a-z0-9-]*$/)), strictObject({
4998
4432
  provider: optional(picklist(["off", "openai", "anthropic"])),
@@ -5061,7 +4495,7 @@ var modelTarget = /* @__PURE__ */ __name((settings, purpose) => {
5061
4495
  };
5062
4496
  }, "modelTarget");
5063
4497
 
5064
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/analysis/settings.js
4498
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/analysis/settings.js
5065
4499
  var model = pipe(string(), trim(), minLength(1), maxLength(200));
5066
4500
  var url = pipe(string(), check(endpoint, "use an HTTP/S endpoint without credentials, query or fragment"));
5067
4501
  var AI_FIELDS = {
@@ -5105,7 +4539,7 @@ var resolveAISettings = /* @__PURE__ */ __name((prefix, layers, env) => {
5105
4539
  };
5106
4540
  }, "resolveAISettings");
5107
4541
 
5108
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/domain/duration.js
4542
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/domain/duration.js
5109
4543
  var DURATION = /^(\d+)(ms|s|m|h|d)$/;
5110
4544
  var UNIT_MS = { ms: 1, s: 1e3, m: 6e4, h: 36e5, d: 864e5 };
5111
4545
  var parseDuration = /* @__PURE__ */ __name((value, source2) => {
@@ -5119,7 +4553,7 @@ var parseDuration = /* @__PURE__ */ __name((value, source2) => {
5119
4553
  return ms2;
5120
4554
  }, "parseDuration");
5121
4555
 
5122
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/embeddings/models.js
4556
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/embeddings/models.js
5123
4557
  var huggingFace = /* @__PURE__ */ __name((repository, commit) => (name) => `https://huggingface.co/${repository}/resolve/${commit}/${name}`, "huggingFace");
5124
4558
  var e5 = huggingFace("Xenova/multilingual-e5-small", "761b726dd34fb83930e26aab4e9ac3899aa1fa78");
5125
4559
  var gemma = huggingFace("onnx-community/embeddinggemma-300m-ONNX", "5090578d9565bb06545b4552f76e6bc2c93e4a66");
@@ -5278,16 +4712,16 @@ var rerankModel = /* @__PURE__ */ __name((id6) => {
5278
4712
  var vectorModelKey = /* @__PURE__ */ __name((model3) => `local:${model3.id}:${model3.dims}`, "vectorModelKey");
5279
4713
  var meaningFloor = /* @__PURE__ */ __name((key) => key === "local:e5-small:384" ? 0.8 : 0, "meaningFloor");
5280
4714
 
5281
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/services/history-limits.js
4715
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/history-limits.js
5282
4716
  var HISTORY_MAX_DAYS = 1095;
5283
4717
  var DEFAULT_HISTORY_LIMITS = { dialogDays: 1095, groupDays: 365, groupMembersMax: 50 };
5284
- var DAY_MS2 = 24 * 60 * 60 * 1e3;
4718
+ var DAY_MS = 24 * 60 * 60 * 1e3;
5285
4719
  var historyWindow = /* @__PURE__ */ __name((shape, limits, now) => {
5286
4720
  const group2 = shape !== void 0 && shape.kind !== "dialog" && shape.kind !== "saved";
5287
4721
  if (group2 && (shape.participantsCount ?? 0) > limits.groupMembersMax)
5288
4722
  return { skip: "group_too_large", members: shape.participantsCount ?? 0 };
5289
- const days2 = group2 ? limits.groupDays : limits.dialogDays;
5290
- return { keepFrom: now - Math.min(days2, HISTORY_MAX_DAYS) * DAY_MS2 };
4723
+ const days = group2 ? limits.groupDays : limits.dialogDays;
4724
+ return { keepFrom: now - Math.min(days, HISTORY_MAX_DAYS) * DAY_MS };
5291
4725
  }, "historyWindow");
5292
4726
  var limitBatch = /* @__PURE__ */ __name((batch, shapes, included, limits, now = Date.now()) => {
5293
4727
  const skipped = /* @__PURE__ */ new Map();
@@ -5325,19 +4759,19 @@ var limitBatch = /* @__PURE__ */ __name((batch, shapes, included, limits, now =
5325
4759
  return { batch: { ...batch, messages }, skipped };
5326
4760
  }, "limitBatch");
5327
4761
 
5328
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/cli/bot/registry.js
5329
- import { existsSync as existsSync2, readdirSync as readdirSync3, readFileSync as readFileSync3 } from "node:fs";
5330
- import { join as join3 } from "node:path";
5331
- var botsDirectory = /* @__PURE__ */ __name((app, env = process.env) => join3(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "bots"), "botsDirectory");
4762
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/bot/registry.js
4763
+ import { existsSync as existsSync2, readdirSync as readdirSync2, readFileSync as readFileSync2 } from "node:fs";
4764
+ import { join as join2 } from "node:path";
4765
+ var botsDirectory = /* @__PURE__ */ __name((app, env = process.env) => join2(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "bots"), "botsDirectory");
5332
4766
  var botFiles = /* @__PURE__ */ __name((app, profile, env = process.env) => {
5333
4767
  const directory = botsDirectory(app, env);
5334
4768
  return {
5335
- registry: join3(directory, `${profile}.json`),
5336
- recipients: join3(directory, "recipients", `${profile}.json`),
5337
- journal: join3(directory, "sends", `${profile}.jsonl`),
5338
- updates: join3(directory, "updates", `${profile}.json`),
5339
- presses: join3(directory, "presses", `${profile}.json`),
5340
- checks: join3(directory, "checks", `${profile}.json`)
4769
+ registry: join2(directory, `${profile}.json`),
4770
+ recipients: join2(directory, "recipients", `${profile}.json`),
4771
+ journal: join2(directory, "sends", `${profile}.jsonl`),
4772
+ updates: join2(directory, "updates", `${profile}.json`),
4773
+ presses: join2(directory, "presses", `${profile}.json`),
4774
+ checks: join2(directory, "checks", `${profile}.json`)
5341
4775
  };
5342
4776
  }, "botFiles");
5343
4777
  var ChatRegistry = class {
@@ -5396,7 +4830,7 @@ var ChatRegistry = class {
5396
4830
  if (!existsSync2(this.#path))
5397
4831
  return {};
5398
4832
  try {
5399
- const parsed = JSON.parse(readFileSync3(this.#path, "utf8"));
4833
+ const parsed = JSON.parse(readFileSync2(this.#path, "utf8"));
5400
4834
  return parsed && typeof parsed === "object" ? parsed : {};
5401
4835
  } catch {
5402
4836
  return {};
@@ -5411,13 +4845,13 @@ var registryProfiles = /* @__PURE__ */ __name((app, env = process.env) => {
5411
4845
  const directory = botsDirectory(app, env);
5412
4846
  if (!existsSync2(directory))
5413
4847
  return [];
5414
- return readdirSync3(directory, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".json")).map((entry) => entry.name).map((name) => name.slice(0, -".json".length));
4848
+ return readdirSync2(directory, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".json")).map((entry) => entry.name).map((name) => name.slice(0, -".json".length));
5415
4849
  }, "registryProfiles");
5416
4850
 
5417
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/cli/config-issues.js
5418
- import { readFileSync as readFileSync4 } from "node:fs";
4851
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/config-issues.js
4852
+ import { readFileSync as readFileSync3 } from "node:fs";
5419
4853
 
5420
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/cli/config-repair.js
4854
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/config-repair.js
5421
4855
  var REPAIR_WORDS = {
5422
4856
  byte_order_mark: "an invisible byte-order mark at the start",
5423
4857
  comment: "a comment, which JSON does not allow",
@@ -5658,7 +5092,7 @@ ${parts.join(",\n")}
5658
5092
  ${indent}${close}`;
5659
5093
  }, "serialise");
5660
5094
 
5661
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/cli/config-issues.js
5095
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/config-issues.js
5662
5096
  var isNode = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value), "isNode");
5663
5097
  var SECTIONS = ["personal", "bot"];
5664
5098
  var SHELL_SAFE = /^[A-Za-z0-9_.:@-]*$/;
@@ -5765,8 +5199,8 @@ var failureOffset = /* @__PURE__ */ __name((text5) => {
5765
5199
  value();
5766
5200
  space();
5767
5201
  return at2;
5768
- } catch (stopped2) {
5769
- return typeof stopped2 === "number" ? stopped2 : at2;
5202
+ } catch (stopped) {
5203
+ return typeof stopped === "number" ? stopped : at2;
5770
5204
  }
5771
5205
  }, "failureOffset");
5772
5206
  var parseConfigText = /* @__PURE__ */ __name((text5, file) => {
@@ -5837,7 +5271,7 @@ var schemaIssues = /* @__PURE__ */ __name((raw, schema2, context2) => {
5837
5271
  return [...found.values()];
5838
5272
  }
5839
5273
  }, "schemaIssues");
5840
- var scopes2 = /* @__PURE__ */ __name((raw) => {
5274
+ var scopes = /* @__PURE__ */ __name((raw) => {
5841
5275
  if (!isNode(raw))
5842
5276
  return [];
5843
5277
  const out = [];
@@ -5859,7 +5293,7 @@ var scopes2 = /* @__PURE__ */ __name((raw) => {
5859
5293
  addSection([name], raw[name]);
5860
5294
  return out;
5861
5295
  }, "scopes");
5862
- var savedPermissionKeys = /* @__PURE__ */ __name((raw) => scopes2(raw).flatMap(([path2, scope]) => isNode(scope.permissions) ? Object.keys(scope.permissions).map((key) => ({ key, at: [...path2, "permissions", key] })) : []), "savedPermissionKeys");
5296
+ var savedPermissionKeys = /* @__PURE__ */ __name((raw) => scopes(raw).flatMap(([path2, scope]) => isNode(scope.permissions) ? Object.keys(scope.permissions).map((key) => ({ key, at: [...path2, "permissions", key] })) : []), "savedPermissionKeys");
5863
5297
  var permissionIssues = /* @__PURE__ */ __name((saved, known, context2) => saved.filter(({ key }) => !known.has(key)).map(({ at: at2 }) => locate("unknown_permission", at2, context2, (key) => `${key} names no command`)), "permissionIssues");
5864
5298
  var pathId = /* @__PURE__ */ __name((path2) => path2.join("\0"), "pathId");
5865
5299
  var prune = /* @__PURE__ */ __name((raw, paths) => {
@@ -5932,7 +5366,7 @@ var checkConfigText = /* @__PURE__ */ __name((text5, { file, tool, schema: schem
5932
5366
  var wholeFile = /* @__PURE__ */ __name((file, what) => ({ kind: "invalid_value", file, what }), "wholeFile");
5933
5367
  var readConfigText = /* @__PURE__ */ __name((path2) => {
5934
5368
  try {
5935
- return { text: readFileSync4(path2, "utf8") };
5369
+ return { text: readFileSync3(path2, "utf8") };
5936
5370
  } catch (error) {
5937
5371
  const code = error.code;
5938
5372
  if (code === "ENOENT")
@@ -5952,9 +5386,9 @@ var readConfigFile = /* @__PURE__ */ __name((path2) => {
5952
5386
  return "issue" in parsed ? { issue: publicIssue(parsed.issue) } : parsed;
5953
5387
  }, "readConfigFile");
5954
5388
 
5955
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/cli/default-config.js
5956
- import { existsSync as existsSync3, linkSync, mkdirSync as mkdirSync2, mkdtempSync, rmSync as rmSync2, writeFileSync as writeFileSync2 } from "node:fs";
5957
- import { dirname, join as join4 } from "node:path";
5389
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/default-config.js
5390
+ import { existsSync as existsSync3, linkSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
5391
+ import { dirname, join as join3 } from "node:path";
5958
5392
  var DEFAULT_CONFIG = {
5959
5393
  defaults: { limit: 20, keep_runs_for_days: 30, sends_per_hour: 30, update_check: true, skill_hint: true },
5960
5394
  profiles: {}
@@ -5963,11 +5397,11 @@ function ensureDefaultConfig(path2, config = DEFAULT_CONFIG) {
5963
5397
  if (existsSync3(path2))
5964
5398
  return;
5965
5399
  const directory = dirname(path2);
5966
- mkdirSync2(directory, { recursive: true, mode: 448 });
5967
- const temporary = mkdtempSync(join4(directory, ".config-"));
5968
- const candidate = join4(temporary, "config.json");
5400
+ mkdirSync(directory, { recursive: true, mode: 448 });
5401
+ const temporary = mkdtempSync(join3(directory, ".config-"));
5402
+ const candidate = join3(temporary, "config.json");
5969
5403
  try {
5970
- writeFileSync2(candidate, `${JSON.stringify(config, null, 2)}
5404
+ writeFileSync(candidate, `${JSON.stringify(config, null, 2)}
5971
5405
  `, { flag: "wx", mode: 384 });
5972
5406
  try {
5973
5407
  linkSync(candidate, path2);
@@ -5976,12 +5410,12 @@ function ensureDefaultConfig(path2, config = DEFAULT_CONFIG) {
5976
5410
  throw error;
5977
5411
  }
5978
5412
  } finally {
5979
- rmSync2(temporary, { recursive: true, force: true });
5413
+ rmSync(temporary, { recursive: true, force: true });
5980
5414
  }
5981
5415
  }
5982
5416
  __name(ensureDefaultConfig, "ensureDefaultConfig");
5983
5417
 
5984
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/cli/setting-defaults.js
5418
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/setting-defaults.js
5985
5419
  var isNode2 = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value), "isNode");
5986
5420
  var parentOf = /* @__PURE__ */ __name((config, key) => {
5987
5421
  const path2 = key.split(".");
@@ -6003,7 +5437,7 @@ var withSettingDefaults = /* @__PURE__ */ __name((raw, declared) => {
6003
5437
  return { config, added };
6004
5438
  }, "withSettingDefaults");
6005
5439
 
6006
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/cli/settings.js
5440
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/settings.js
6007
5441
  var DEFAULT_LIMIT = DEFAULT_CONFIG.defaults.limit;
6008
5442
  var DEFAULT_KEEP_RUNS_FOR_DAYS = DEFAULT_CONFIG.defaults.keep_runs_for_days;
6009
5443
  var DEFAULT_SENDS_PER_HOUR = DEFAULT_CONFIG.defaults.sends_per_hour;
@@ -6513,7 +5947,17 @@ var given = /* @__PURE__ */ __name((value) => {
6513
5947
  return trimmed === void 0 || trimmed === "" ? void 0 : trimmed;
6514
5948
  }, "given");
6515
5949
 
6516
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/cli/context.js
5950
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/context.js
5951
+ var runBudgetOf = /* @__PURE__ */ __name((command, requests) => {
5952
+ const { deadline, signal, app } = environmentOf(command);
5953
+ const now = deadline?.();
5954
+ return runBudget({
5955
+ ...requests === void 0 ? {} : { requests },
5956
+ ...app?.requestMs === void 0 ? {} : { requestMs: app.requestMs },
5957
+ ...now ? { deadline: now } : {},
5958
+ ...signal ? { signal } : {}
5959
+ });
5960
+ }, "runBudgetOf");
6517
5961
  var setExitCode = /* @__PURE__ */ __name((command, code) => {
6518
5962
  const slot = environmentOf(command).exit;
6519
5963
  if (slot)
@@ -6526,6 +5970,10 @@ var provide = /* @__PURE__ */ __name((program2, environment) => {
6526
5970
  environments.set(program2, environment);
6527
5971
  }, "provide");
6528
5972
  var environmentOf = /* @__PURE__ */ __name((command) => environments.get(rootOf(command)) ?? {}, "environmentOf");
5973
+ var withAgentLevels = /* @__PURE__ */ __name((command, flags) => {
5974
+ const overrides = environmentOf(command).agent?.overrides ?? [];
5975
+ return overrides.length > 0 ? { ...flags, permission: [...overrides, ...flags.permission ?? []] } : flags;
5976
+ }, "withAgentLevels");
6529
5977
  var secretInputOf = /* @__PURE__ */ __name((command) => {
6530
5978
  const { stdin, stderr } = environmentOf(command);
6531
5979
  return { ...stdin ? { input: stdin } : {}, ...stderr ? { output: stderr } : {} };
@@ -6552,9 +6000,7 @@ var outputFor = /* @__PURE__ */ __name((command) => {
6552
6000
  var baseContext = /* @__PURE__ */ __name((command, resolveSettings) => {
6553
6001
  const environment = environmentOf(command);
6554
6002
  const env = environment.env ?? process.env;
6555
- const flags = command.optsWithGlobals();
6556
- const overrides = environment.agent?.overrides ?? [];
6557
- const settings = resolveSettings(overrides.length > 0 ? { ...flags, permission: [...overrides, ...flags.permission ?? []] } : flags, { env });
6003
+ const settings = resolveSettings(withAgentLevels(command, command.optsWithGlobals()), { env });
6558
6004
  const { renderer, format, color, streams, compact, full } = resolveOutput({
6559
6005
  ...settings,
6560
6006
  env,
@@ -6619,14 +6065,21 @@ var baseContext = /* @__PURE__ */ __name((command, resolveSettings) => {
6619
6065
  }, "track")
6620
6066
  };
6621
6067
  }, "baseContext");
6068
+ var inCommandRun = /* @__PURE__ */ __name((command, body) => {
6069
+ const { resolveSettings } = environmentOf(command);
6070
+ if (!resolveSettings)
6071
+ return body(() => {
6072
+ });
6073
+ return baseContext(command, (flags, options) => resolveSettings(flags, { ...options, needsProfile: false })).run(body);
6074
+ }, "inCommandRun");
6622
6075
  var commandPath = /* @__PURE__ */ __name((command) => {
6623
6076
  const words = [];
6624
- for (let current2 = command; current2?.parent; current2 = current2.parent)
6625
- words.unshift(current2.name());
6077
+ for (let current = command; current?.parent; current = current.parent)
6078
+ words.unshift(current.name());
6626
6079
  return words.join(" ");
6627
6080
  }, "commandPath");
6628
6081
 
6629
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/cli/effects.js
6082
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/effects.js
6630
6083
  var REMOTE_READ = { remote: "read", local: "read" };
6631
6084
  var FETCH = { remote: "read", local: "write" };
6632
6085
  var REMOTE_WRITE = { remote: "write", local: "write" };
@@ -6750,7 +6203,7 @@ var refuseUnderReadOnly = /* @__PURE__ */ __name((command, what) => {
6750
6203
  throw readOnlyRefusal(lock, what);
6751
6204
  }, "refuseUnderReadOnly");
6752
6205
 
6753
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/account.js
6206
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/account.js
6754
6207
  var account = strictObject({
6755
6208
  provider: text,
6756
6209
  id,
@@ -6760,7 +6213,7 @@ var account = strictObject({
6760
6213
  scope: optional(picklist(["personal", "work"]))
6761
6214
  });
6762
6215
 
6763
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/account-session.js
6216
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/account-session.js
6764
6217
  var accountSession = strictObject({
6765
6218
  current: boolean(),
6766
6219
  client: nullable(text),
@@ -6770,7 +6223,7 @@ var accountSession = strictObject({
6770
6223
  created_at: optional(nullable(time))
6771
6224
  });
6772
6225
 
6773
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/account-change.js
6226
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/account-change.js
6774
6227
  var accountChange = strictObject({ operation_id: id, account: omit(account, ["provider", "scope"]) });
6775
6228
  var endedAccountSessions = strictObject({ operation_id: id, sessions: array(accountSession) });
6776
6229
  var audience = picklist(["everyone", "contacts", "nobody"]);
@@ -6788,7 +6241,7 @@ var accountPrivacy = strictObject({
6788
6241
  });
6789
6242
  var accountPrivacyChange = strictObject({ operation_id: id, privacy: accountPrivacy });
6790
6243
 
6791
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/account-profile.js
6244
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/account-profile.js
6792
6245
  var accountProfile = strictObject({
6793
6246
  profile: id,
6794
6247
  current: boolean(),
@@ -6800,7 +6253,7 @@ var accountProfile = strictObject({
6800
6253
  bot: optional(literal(true))
6801
6254
  });
6802
6255
 
6803
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/counter-reading.js
6256
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/counter-reading.js
6804
6257
  var milliseconds = pipe(number(), minValue(0));
6805
6258
  var counterReading = strictObject({
6806
6259
  counter: picklist(["views", "reactions", "comments"]),
@@ -6812,7 +6265,7 @@ var counterReading = strictObject({
6812
6265
  });
6813
6266
  var selection = record(string(), unknown());
6814
6267
 
6815
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/admin-report.js
6268
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/admin-report.js
6816
6269
  var adminRow = strictObject({
6817
6270
  ref: reference,
6818
6271
  /** What `stats * evidence` takes: a person id, a stay or a message locator. */
@@ -6865,7 +6318,7 @@ var adminReport = strictObject({
6865
6318
  rows: array(adminRow)
6866
6319
  });
6867
6320
 
6868
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/task.js
6321
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/task.js
6869
6322
  var closeSuggestion = strictObject({
6870
6323
  as: picklist(["done", "dismissed"]),
6871
6324
  /** The agent's name. */
@@ -6927,7 +6380,7 @@ var task = strictObject({
6927
6380
  updated_at: optional(time)
6928
6381
  });
6929
6382
 
6930
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/agenda.js
6383
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/agenda.js
6931
6384
  var agendaChat = strictObject({
6932
6385
  chat: reference,
6933
6386
  title: nullable(text),
@@ -6997,11 +6450,11 @@ var agenda = strictObject({
6997
6450
  unlisted_categories: array(strictObject({ name: text, open_tasks: number() }))
6998
6451
  });
6999
6452
 
7000
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/analysis-consent.js
6453
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/analysis-consent.js
7001
6454
  var analysisConsent = strictObject({ chat: id, provider: text, at: time });
7002
6455
  var analysisConsentRevocation = strictObject({ revoked: boolean() });
7003
6456
 
7004
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/attachment.js
6457
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/attachment.js
7005
6458
  var attachment = strictObject({
7006
6459
  /** The message it came with, as a locator; absent inside that message. */
7007
6460
  message: optional(reference),
@@ -7039,7 +6492,7 @@ var attachment = strictObject({
7039
6492
  });
7040
6493
  var hitFile = strictObject({ position: count, kind: text, name: optional(text), size: optional(count) });
7041
6494
 
7042
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/batch-result.js
6495
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/batch-result.js
7043
6496
  var actionableError = objectWithRest({
7044
6497
  code: text,
7045
6498
  message: text,
@@ -7056,7 +6509,7 @@ var batchResult = strictObject({
7056
6509
  max_error_percent: count
7057
6510
  });
7058
6511
 
7059
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/extraction-report.js
6512
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/extraction-report.js
7060
6513
  var extractionItem = strictObject({
7061
6514
  ref: reference,
7062
6515
  attachment: count,
@@ -7089,7 +6542,7 @@ var extractionReport = strictObject({
7089
6542
  cursor: optional(text)
7090
6543
  });
7091
6544
 
7092
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/attachment-results.js
6545
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/attachment-results.js
7093
6546
  var fingerprint = pipe(text, regex(/^[a-f0-9]{64}$/));
7094
6547
  var attachmentBytes = strictObject({
7095
6548
  ref: reference,
@@ -7117,7 +6570,7 @@ var attachmentTextChange = strictObject({
7117
6570
  replaced: nullable(picklist(["extracted", "agent"]))
7118
6571
  });
7119
6572
 
7120
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/chart.js
6573
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/chart.js
7121
6574
  var chart = strictObject({
7122
6575
  version: literal(1),
7123
6576
  kind: picklist(["bar", "line", "grouped-bar"]),
@@ -7132,7 +6585,7 @@ var chart = strictObject({
7132
6585
  file: optional(strictObject({ path: text, format: picklist(["svg", "png"]), width: count, height: count }))
7133
6586
  });
7134
6587
 
7135
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/member.js
6588
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/member.js
7136
6589
  var member = strictObject({
7137
6590
  id,
7138
6591
  name: nullable(text),
@@ -7155,7 +6608,7 @@ var member = strictObject({
7155
6608
  check: optional(record(string(), unknown()))
7156
6609
  });
7157
6610
 
7158
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/chat.js
6611
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/chat.js
7159
6612
  var setting = optional(nullable(boolean()));
7160
6613
  var chat = strictObject({
7161
6614
  ref: reference,
@@ -7196,7 +6649,7 @@ var chat = strictObject({
7196
6649
  members: optional(array(member))
7197
6650
  });
7198
6651
 
7199
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/folder.js
6652
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/folder.js
7200
6653
  var named = strictObject({
7201
6654
  id,
7202
6655
  title: nullable(text),
@@ -7219,7 +6672,7 @@ var folder = strictObject({
7219
6672
  excluded_chats: optional(array(named))
7220
6673
  });
7221
6674
 
7222
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/invite-link.js
6675
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/invite-link.js
7223
6676
  var inviteLink = strictObject({
7224
6677
  link: text,
7225
6678
  /** Who joins by it asks first, and an admin lets them in. */
@@ -7235,7 +6688,7 @@ var inviteLink = strictObject({
7235
6688
  joined_count: optional(count)
7236
6689
  });
7237
6690
 
7238
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/chat-admin.js
6691
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/chat-admin.js
7239
6692
  var operated = { operation_id: id, chat_id: id };
7240
6693
  var group = strictObject({
7241
6694
  ...omit(chat, ["ref", "provider", "account", "invite_link", "members"]).entries,
@@ -7315,7 +6768,7 @@ var chatFolderOrder = strictObject({
7315
6768
  folders: array(strictObject({ id, title: text }))
7316
6769
  });
7317
6770
 
7318
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/chat-change.js
6771
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/chat-change.js
7319
6772
  var operated2 = { operation_id: id, chat_id: id };
7320
6773
  var chatRemoval = strictObject(operated2);
7321
6774
  var chatMuting = strictObject({
@@ -7326,7 +6779,7 @@ var chatArchive = strictObject({ ...operated2, archived: boolean() });
7326
6779
  var chatPin = strictObject({ ...operated2, pinned: boolean() });
7327
6780
  var chatUnread = strictObject({ ...operated2, unread: literal(true) });
7328
6781
 
7329
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/chat-event.js
6782
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/chat-event.js
7330
6783
  var who = strictObject({ id: nullable(id), name: nullable(text), username: optional(nullable(text)) });
7331
6784
  var chatEvent = strictObject({
7332
6785
  chat_id: id,
@@ -7343,7 +6796,7 @@ var chatEvent = strictObject({
7343
6796
  before: optional(strictObject({ name: nullable(text), username: nullable(text) }))
7344
6797
  });
7345
6798
 
7346
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/chat-metadata.js
6799
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/chat-metadata.js
7347
6800
  var chatMetadata = strictObject({
7348
6801
  chat_id: id,
7349
6802
  title: nullable(text),
@@ -7358,7 +6811,7 @@ var chatMetadataRefresh = strictObject({
7358
6811
  has_more: boolean()
7359
6812
  });
7360
6813
 
7361
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/chat-moderation.js
6814
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/chat-moderation.js
7362
6815
  var action = picklist(["report", "delete", "remove"]);
7363
6816
  var level = picklist(["deny", "readonly", "ask", "allow"]);
7364
6817
  var chatRules = strictObject({
@@ -7395,7 +6848,7 @@ var chatModeration = strictObject({
7395
6848
  }))
7396
6849
  });
7397
6850
 
7398
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/chat-stats.js
6851
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/chat-stats.js
7399
6852
  var optionalCount = optional(count);
7400
6853
  var minutes = nullable(number());
7401
6854
  var chatStats = strictObject({
@@ -7469,7 +6922,7 @@ var taskStats = strictObject({
7469
6922
  }))
7470
6923
  });
7471
6924
 
7472
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/chat-tracking.js
6925
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/chat-tracking.js
7473
6926
  var memberCount = strictObject({
7474
6927
  day: pipe(text, isoDate()),
7475
6928
  participants: nullable(count),
@@ -7492,7 +6945,7 @@ var chatTracking = strictObject({
7492
6945
  tracked: boolean()
7493
6946
  });
7494
6947
 
7495
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/contact-read.js
6948
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/contact-read.js
7496
6949
  var contactLookup = strictObject({ id, name: nullable(text), username: nullable(text) });
7497
6950
  var contactSync = strictObject({ added: count, changed: count, known: count });
7498
6951
  var profileFields = {
@@ -7530,7 +6983,7 @@ var profileFields = {
7530
6983
  }))
7531
6984
  };
7532
6985
 
7533
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/contact.js
6986
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/contact.js
7534
6987
  var contact = strictObject({
7535
6988
  ref: reference,
7536
6989
  id,
@@ -7561,7 +7014,7 @@ var contact = strictObject({
7561
7014
  notes: optional(array(strictObject({ id, text, revision: count, created_at: time, updated_at: time })))
7562
7015
  });
7563
7016
 
7564
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/botcheck/reasons.js
7017
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/botcheck/reasons.js
7565
7018
  var WEIGHTS = {
7566
7019
  bot: 3,
7567
7020
  scam: 3,
@@ -7586,7 +7039,7 @@ var LINK = /https?:\/\/|t\.me\/|www\./i;
7586
7039
  var DIGITS = /\d{5,}/;
7587
7040
  var oddName = /* @__PURE__ */ __name((name) => !name?.trim() || DIGITS.test(name) || LINK.test(name), "oddName");
7588
7041
 
7589
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/contact-activity.js
7042
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/contact-activity.js
7590
7043
  var linkedIdentity = strictObject({
7591
7044
  provider: text,
7592
7045
  id,
@@ -7627,7 +7080,7 @@ var contactCheck = strictObject({
7627
7080
  checked_at: time
7628
7081
  });
7629
7082
 
7630
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/message.js
7083
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/message.js
7631
7084
  var quoted = strictObject({
7632
7085
  id,
7633
7086
  sender_id: nullable(id),
@@ -7746,7 +7199,7 @@ var message = strictObject({
7746
7199
  provider_metadata: providerMetadata
7747
7200
  });
7748
7201
 
7749
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/contact-context.js
7202
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/contact-context.js
7750
7203
  var contextPerson = strictObject({ ...linkedPerson.entries, provider: text, id });
7751
7204
  var contextMessage = strictObject({
7752
7205
  locator: reference,
@@ -7944,7 +7397,7 @@ var contactPreparation = strictObject({
7944
7397
  })
7945
7398
  });
7946
7399
 
7947
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/contact-note.js
7400
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/contact-note.js
7948
7401
  var contactNote = strictObject({
7949
7402
  id,
7950
7403
  /** The contact, as a `contact:` reference. */
@@ -7956,13 +7409,13 @@ var contactNote = strictObject({
7956
7409
  updated_at: time
7957
7410
  });
7958
7411
 
7959
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/contact-write.js
7412
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/contact-write.js
7960
7413
  var addressBookPerson = strictObject({ id, name: nullable(text), username: nullable(text) });
7961
7414
  var contactUpdate = strictObject({ operation_id: id, person: addressBookPerson });
7962
7415
  var contactStateChange = strictObject({ operation_id: id, person_id: id });
7963
7416
  var contactImport = strictObject({ operation_id: id, sent: count, recognised: array(addressBookPerson) });
7964
7417
 
7965
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/conversation.js
7418
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/conversation.js
7966
7419
  var conversation = strictObject({
7967
7420
  id,
7968
7421
  chat: reference,
@@ -7977,7 +7430,7 @@ var conversation = strictObject({
7977
7430
  rules_version: count
7978
7431
  });
7979
7432
 
7980
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/conversation-preparation.js
7433
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/conversation-preparation.js
7981
7434
  var conversationBuild = strictObject({
7982
7435
  chat: id,
7983
7436
  messages: count,
@@ -8002,7 +7455,7 @@ var catchUpPreparation = strictObject({
8002
7455
  prepared: optional(conversationPreparation)
8003
7456
  });
8004
7457
 
8005
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/conversation-results.js
7458
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/conversation-results.js
8006
7459
  var conversationDetails = union([
8007
7460
  strictObject({ ...conversation.entries, messages: array(message) }),
8008
7461
  message
@@ -8092,7 +7545,7 @@ var conversationHit = strictObject({
8092
7545
  stale: boolean()
8093
7546
  });
8094
7547
 
8095
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/counters.js
7548
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/counters.js
8096
7549
  var counters = strictObject({
8097
7550
  cutoff: time,
8098
7551
  max_age_ms: milliseconds,
@@ -8122,7 +7575,94 @@ var counterRefresh = strictObject({
8122
7575
  complete: optional(boolean())
8123
7576
  });
8124
7577
 
8125
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/document.js
7578
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/deal.js
7579
+ var nullableText = nullable(text);
7580
+ var party = strictObject({ ref: reference, name: nullableText, owner: boolean() });
7581
+ var outcome = picklist(["open", "won", "lost"]);
7582
+ var crmAccount = nullable(strictObject({ provider: text, account: text }));
7583
+ var day = nullable(pipe(string(), regex(/^\d{4}-\d{2}-\d{2}$/)));
7584
+ var deal = strictObject({
7585
+ id,
7586
+ ref: reference,
7587
+ kind: picklist(["deal", "lead"]),
7588
+ title: text,
7589
+ /** One line with the stage, amount and status. */
7590
+ summary: text,
7591
+ pipeline: reference,
7592
+ pipeline_name: text,
7593
+ stage: text,
7594
+ status: outcome,
7595
+ organization: nullable(party),
7596
+ currency: nullableText,
7597
+ amount: nullableText,
7598
+ close_date: day,
7599
+ closed_date: day,
7600
+ closed_reason: nullableText,
7601
+ rank: nullable(number()),
7602
+ /** A lead's deal, once it became one. */
7603
+ deal: nullable(reference),
7604
+ /** The CRM account it is a copy from; `null` for the owner's own. */
7605
+ account: crmAccount,
7606
+ external_id: nullableText,
7607
+ /** A CRM copy's assignee, the identity `<account>/user/<id>`. */
7608
+ assignee: nullableText,
7609
+ /** A CRM copy's own fields by code; a list field's value is its option's label, `option_id` its id. */
7610
+ provider_metadata: record(string(), strictObject({
7611
+ label: nullable(string()),
7612
+ value: unknown(),
7613
+ option_id: optional(union([string(), array(string())]))
7614
+ })),
7615
+ people: array(strictObject({ ...party.entries, role: picklist(["owner", "contact", "decision-maker"]) })),
7616
+ author: strictObject({
7617
+ type: picklist(["person", "bot"]),
7618
+ id,
7619
+ name: nullableText,
7620
+ kind: nullable(picklist(["agent", "rule"]))
7621
+ }),
7622
+ model: nullableText,
7623
+ source: text,
7624
+ reason: nullableText,
7625
+ evidence: array(reference),
7626
+ project: nullable(reference),
7627
+ project_name: nullableText,
7628
+ created_at: time,
7629
+ updated_at: time,
7630
+ untrusted
7631
+ });
7632
+ var lead = deal;
7633
+ var pipelineStage = strictObject({
7634
+ name: text,
7635
+ position: count,
7636
+ outcome,
7637
+ external_id: nullableText,
7638
+ /** Open deals or leads in it now. */
7639
+ open: count,
7640
+ /** With a funnel: rows that got this far, and the share of them that reached the next stage. */
7641
+ reached: optional(count),
7642
+ conversion: optional(nullable(number()))
7643
+ });
7644
+ var pipeline = strictObject({
7645
+ id,
7646
+ ref: reference,
7647
+ name: text,
7648
+ kind: picklist(["deal", "lead"]),
7649
+ account: crmAccount,
7650
+ external_id: nullableText,
7651
+ stages: array(pipelineStage),
7652
+ created_at: time,
7653
+ totals: optional(strictObject({ items: count, open: count, won: count, lost: count, win_rate: nullable(number()) })),
7654
+ since: optional(day),
7655
+ untrusted
7656
+ });
7657
+ var stage = strictObject({
7658
+ ...pipelineStage.entries,
7659
+ pipeline: reference,
7660
+ pipeline_name: text,
7661
+ kind: picklist(["deal", "lead"]),
7662
+ untrusted
7663
+ });
7664
+
7665
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/document.js
8126
7666
  var document = strictObject({
8127
7667
  ref: reference,
8128
7668
  id,
@@ -8137,7 +7677,7 @@ var document = strictObject({
8137
7677
  owners: optional(array(text))
8138
7678
  });
8139
7679
 
8140
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/document-link.js
7680
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/document-link.js
8141
7681
  var documentLink = strictObject({
8142
7682
  ref: reference,
8143
7683
  url: text,
@@ -8148,7 +7688,7 @@ var documentLink = strictObject({
8148
7688
  sender: strictObject({ id: nullable(id), name: nullable(text) })
8149
7689
  });
8150
7690
 
8151
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/evidence.js
7691
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/evidence.js
8152
7692
  var evidenceMessage = pick(message, ["ref", "chat_title", "timestamp", "sender_name", "text"]);
8153
7693
  var contribution = strictObject({
8154
7694
  message: evidenceMessage,
@@ -8178,7 +7718,7 @@ var retentionStay = strictObject({
8178
7718
  });
8179
7719
  var evidence = union([contribution, retentionStay]);
8180
7720
 
8181
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/fact.js
7721
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/fact.js
8182
7722
  var fact = strictObject({
8183
7723
  ref: reference,
8184
7724
  id,
@@ -8208,9 +7748,9 @@ var fact = strictObject({
8208
7748
  updated_at: time
8209
7749
  });
8210
7750
 
8211
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/hit.js
7751
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/hit.js
8212
7752
  var hit = strictObject({
8213
- kind: picklist(["message", "mail", "note", "document", "event", "meeting"]),
7753
+ kind: picklist(["message", "mail", "note", "document", "event", "meeting", "deal", "lead"]),
8214
7754
  ref: reference,
8215
7755
  provider: text,
8216
7756
  url: optional(text),
@@ -8246,7 +7786,7 @@ var hit = strictObject({
8246
7786
  untrusted
8247
7787
  });
8248
7788
 
8249
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/identity.js
7789
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/identity.js
8250
7790
  var identity = strictObject({
8251
7791
  ref: reference,
8252
7792
  provider: text,
@@ -8259,7 +7799,7 @@ var identity = strictObject({
8259
7799
  person: optional(nullable(reference))
8260
7800
  });
8261
7801
 
8262
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/image-embedding.js
7802
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/image-embedding.js
8263
7803
  var imageEmbedding = strictObject({
8264
7804
  model: text,
8265
7805
  embedded: count,
@@ -8268,29 +7808,13 @@ var imageEmbedding = strictObject({
8268
7808
  more: boolean()
8269
7809
  });
8270
7810
 
8271
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/services/backfill-jobs.js
7811
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/backfill-jobs.js
8272
7812
  import { spawn } from "node:child_process";
8273
- import { randomBytes as randomBytes2 } from "node:crypto";
8274
- import { closeSync, existsSync as existsSync5, mkdirSync as mkdirSync3, openSync, readdirSync as readdirSync4, readFileSync as readFileSync5, realpathSync, rmSync as rmSync3 } from "node:fs";
8275
- import { dirname as dirname2, join as join5 } from "node:path";
8276
-
8277
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/background/checkpoints.js
8278
- var progressOf = /* @__PURE__ */ __name((input) => {
8279
- const total = input.total ?? null;
8280
- const updated = input.updatedAt ?? null;
8281
- return {
8282
- job: input.job,
8283
- profile: input.profile,
8284
- done: input.done,
8285
- total,
8286
- remaining: total === null ? null : Math.max(0, total - input.done),
8287
- state: input.complete ?? (total !== null && input.done >= total) ? "complete" : "partial",
8288
- updated_at: updated,
8289
- cursor_age_ms: updated === null ? null : Math.max(0, (input.now ?? /* @__PURE__ */ new Date()).getTime() - Date.parse(updated))
8290
- };
8291
- }, "progressOf");
7813
+ import { randomBytes } from "node:crypto";
7814
+ import { closeSync, existsSync as existsSync5, mkdirSync as mkdirSync2, openSync, readdirSync as readdirSync3, readFileSync as readFileSync4, realpathSync, rmSync as rmSync2 } from "node:fs";
7815
+ import { dirname as dirname2, join as join4 } from "node:path";
8292
7816
 
8293
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/runs/record-log.js
7817
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/runs/record-log.js
8294
7818
  var recordLogFor = /* @__PURE__ */ __name((to, app, { traceId, command } = {}) => {
8295
7819
  const run = currentRun();
8296
7820
  const trace = traceId ?? run.traceId;
@@ -8304,7 +7828,7 @@ var recordLogFor = /* @__PURE__ */ __name((to, app, { traceId, command } = {}) =
8304
7828
  }));
8305
7829
  }, "recordLogFor");
8306
7830
 
8307
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/services/backfill-jobs.js
7831
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/backfill-jobs.js
8308
7832
  var JOB_STATES = ["running", "done", "partial", "failed", "cancelled", "died"];
8309
7833
  var spawnDetached = /* @__PURE__ */ __name((argv, env, log) => {
8310
7834
  const out = openSync(log, "a", 384);
@@ -8320,10 +7844,10 @@ var spawnDetached = /* @__PURE__ */ __name((argv, env, log) => {
8320
7844
  closeSync(out);
8321
7845
  }
8322
7846
  }, "spawnDetached");
8323
- var jobsDir = /* @__PURE__ */ __name((app, env) => join5(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "backfill"), "jobsDir");
8324
- var jobPath = /* @__PURE__ */ __name((dir, id6) => join5(dir, `${id6}.json`), "jobPath");
7847
+ var jobsDir = /* @__PURE__ */ __name((app, env) => join4(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "backfill"), "jobsDir");
7848
+ var jobPath = /* @__PURE__ */ __name((dir, id6) => join4(dir, `${id6}.json`), "jobPath");
8325
7849
  var saveJob = /* @__PURE__ */ __name((dir, job2) => {
8326
- mkdirSync3(dir, { recursive: true, mode: 448 });
7850
+ mkdirSync2(dir, { recursive: true, mode: 448 });
8327
7851
  writeSecurely(jobPath(dir, job2.id), `${JSON.stringify(job2, null, 2)}
8328
7852
  `, 384);
8329
7853
  }, "saveJob");
@@ -8331,12 +7855,12 @@ var readJob = /* @__PURE__ */ __name((dir, id6) => {
8331
7855
  if (!/^[\w-]+$/.test(id6) || !existsSync5(jobPath(dir, id6)))
8332
7856
  return void 0;
8333
7857
  try {
8334
- return JSON.parse(readFileSync5(jobPath(dir, id6), "utf8"));
7858
+ return JSON.parse(readFileSync4(jobPath(dir, id6), "utf8"));
8335
7859
  } catch {
8336
7860
  return void 0;
8337
7861
  }
8338
7862
  }, "readJob");
8339
- var recordsPath = /* @__PURE__ */ __name((dir, id6) => join5(dir, `${id6}.jsonl`), "recordsPath");
7863
+ var recordsPath = /* @__PURE__ */ __name((dir, id6) => join4(dir, `${id6}.jsonl`), "recordsPath");
8340
7864
  var tracedJob = /* @__PURE__ */ __name((env) => {
8341
7865
  const trace = childTrace();
8342
7866
  return { env: { ...env, TRACEPARENT: trace.traceparent }, traceId: trace.traceId };
@@ -8354,11 +7878,11 @@ var finishJob = /* @__PURE__ */ __name((app, dir, id6, change) => {
8354
7878
  const job2 = readJob(dir, id6);
8355
7879
  if (!job2)
8356
7880
  return;
8357
- const outcome3 = stateOf(job2);
7881
+ const outcome4 = stateOf(job2);
8358
7882
  recordLogFor(recordsPath(dir, id6), app, job2.traceId ? { traceId: job2.traceId } : {})[job2.error ? "error" : "info"]({
8359
7883
  event: "job.exit",
8360
7884
  job: id6,
8361
- outcome: outcome3,
7885
+ outcome: outcome4,
8362
7886
  ...job2.error ? { errorCode: job2.error.code } : {}
8363
7887
  });
8364
7888
  }, "finishJob");
@@ -8368,12 +7892,12 @@ var updateJob = /* @__PURE__ */ __name((dir, id6, change) => {
8368
7892
  saveJob(dir, { ...job2, ...change });
8369
7893
  }, "updateJob");
8370
7894
  var removeJob = /* @__PURE__ */ __name((dir, job2) => {
8371
- rmSync3(jobPath(dir, job2.id), { force: true });
8372
- rmSync3(recordsPath(dir, job2.id), { force: true });
7895
+ rmSync2(jobPath(dir, job2.id), { force: true });
7896
+ rmSync2(recordsPath(dir, job2.id), { force: true });
8373
7897
  if (dirname2(job2.log) === dir)
8374
- rmSync3(job2.log, { force: true });
7898
+ rmSync2(job2.log, { force: true });
8375
7899
  }, "removeJob");
8376
- var listJobs = /* @__PURE__ */ __name((dir) => existsSync5(dir) ? readdirSync4(dir).filter((name) => name.endsWith(".json")).flatMap((name) => readJob(dir, name.slice(0, -".json".length)) ?? []).sort((a, b) => b.startedAt.localeCompare(a.startedAt)) : [], "listJobs");
7900
+ var listJobs = /* @__PURE__ */ __name((dir) => existsSync5(dir) ? readdirSync3(dir).filter((name) => name.endsWith(".json")).flatMap((name) => readJob(dir, name.slice(0, -".json".length)) ?? []).sort((a, b) => b.startedAt.localeCompare(a.startedAt)) : [], "listJobs");
8377
7901
  var jobDetails = /* @__PURE__ */ __name((job2) => ({
8378
7902
  job: job2.id,
8379
7903
  profile: job2.profile,
@@ -8437,9 +7961,9 @@ var startArchiveJob = /* @__PURE__ */ __name((app, env, profile, input, spawnJob
8437
7961
  if (running)
8438
7962
  throw new CliError("validation_error", `job ${running.id} already works on this chat; inspect store jobs show first`);
8439
7963
  const startedAt = (/* @__PURE__ */ new Date()).toISOString();
8440
- const id6 = `${startedAt.replace(/[-:]/g, "").slice(0, 15)}-${randomBytes2(3).toString("hex")}`;
8441
- mkdirSync3(dir, { recursive: true, mode: 448 });
8442
- const log = join5(dir, `${id6}.log`);
7964
+ const id6 = `${startedAt.replace(/[-:]/g, "").slice(0, 15)}-${randomBytes(3).toString("hex")}`;
7965
+ mkdirSync2(dir, { recursive: true, mode: 448 });
7966
+ const log = join4(dir, `${id6}.log`);
8443
7967
  const job2 = {
8444
7968
  id: id6,
8445
7969
  chat: input.chat,
@@ -8459,7 +7983,7 @@ var startArchiveJob = /* @__PURE__ */ __name((app, env, profile, input, spawnJob
8459
7983
  return { job: id6, pid, chat: input.chat, log };
8460
7984
  }, "startArchiveJob");
8461
7985
 
8462
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/job.js
7986
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/job.js
8463
7987
  var problem = strictObject({ code: text, message: text });
8464
7988
  var job = strictObject({
8465
7989
  id,
@@ -8482,7 +8006,7 @@ var job = strictObject({
8482
8006
  error: optional(problem)
8483
8007
  });
8484
8008
 
8485
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/join-request.js
8009
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/join-request.js
8486
8010
  var joinRequest = strictObject({
8487
8011
  person_id: id,
8488
8012
  name: nullable(text),
@@ -8493,7 +8017,7 @@ var joinRequest = strictObject({
8493
8017
  about: optional(text)
8494
8018
  });
8495
8019
 
8496
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/list-results.js
8020
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/list-results.js
8497
8021
  var botProfile = strictObject({
8498
8022
  name: text,
8499
8023
  token: text,
@@ -8524,6 +8048,10 @@ var scheduledJob = strictObject({
8524
8048
  name: text,
8525
8049
  kind: picklist(["command", "agent"]),
8526
8050
  when: text,
8051
+ /** When a finished run shows a desktop notice: `always`, `failures` or `never`; the default is shown, not left out. */
8052
+ notify: optional(picklist(["always", "failures", "never"])),
8053
+ /** Where a run's result is sent after it: `telegram-bot:<profile>/<chat>` or `email:<profile>/<address>`. */
8054
+ deliver_to: optional(array(text)),
8527
8055
  last: nullable(strictObject({
8528
8056
  at: time,
8529
8057
  exit_code: number(),
@@ -8535,7 +8063,19 @@ var scheduledJob = strictObject({
8535
8063
  failures: optional(number()),
8536
8064
  cost_usd: optional(number()),
8537
8065
  /** The last time a run did not start, and why: the day's cost cap, or too little new mail. */
8538
- skipped: optional(strictObject({ at: time, why: text }))
8066
+ skipped: optional(strictObject({
8067
+ at: time,
8068
+ why: text,
8069
+ /** A dotted id for `why`, so a client can translate it: `cost.day-cap`, `mail.none-new`, `mail.below-threshold`. */
8070
+ reason: optional(pipe(text, regex(/^[a-z][a-z0-9-]*(\.[a-z][a-z0-9-]*)+$/)))
8071
+ })),
8072
+ /** How the run's result went along each route; `reason` a dotted id, `error` the sending CLI's code and reason id. */
8073
+ deliveries: optional(array(strictObject({
8074
+ to: text,
8075
+ ok: boolean(),
8076
+ reason: optional(pipe(text, regex(/^[a-z][a-z0-9-]*(\.[a-z][a-z0-9-]*)+$/))),
8077
+ error: optional(text)
8078
+ })))
8539
8079
  })),
8540
8080
  /** Agent schedules: what today's runs cost, in US dollars. */
8541
8081
  spent_today_usd: optional(number()),
@@ -8570,7 +8110,7 @@ var stickerInventory = strictObject({
8570
8110
  url: optional(nullable(text))
8571
8111
  });
8572
8112
 
8573
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/poll-vote.js
8113
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/poll-vote.js
8574
8114
  var pollVote = strictObject({
8575
8115
  person_id: id,
8576
8116
  name: nullable(text),
@@ -8580,7 +8120,7 @@ var pollVote = strictObject({
8580
8120
  voted_at: time
8581
8121
  });
8582
8122
 
8583
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/listener.js
8123
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/listener.js
8584
8124
  var reactions = unwrap(unwrap(message.entries.reactions));
8585
8125
  var observation = strictObject({
8586
8126
  value: pipe(number(), minValue(0)),
@@ -8622,7 +8162,7 @@ var serveSummary = strictObject({
8622
8162
  tasks: optional(strictObject({ added: count, closed: count, review: count }))
8623
8163
  });
8624
8164
 
8625
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/mail-counts.js
8165
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/mail-counts.js
8626
8166
  var mailCounts = strictObject({
8627
8167
  by: picklist(["day", "week", "sender"]),
8628
8168
  received: count,
@@ -8637,7 +8177,7 @@ var mailCounts = strictObject({
8637
8177
  }))
8638
8178
  });
8639
8179
 
8640
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/mail-findings.js
8180
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/mail-findings.js
8641
8181
  var evidence2 = strictObject({ reference, fingerprint: text });
8642
8182
  var base = { id, evidence: array(evidence2) };
8643
8183
  var finding = variant("kind", [
@@ -8761,7 +8301,7 @@ var finding = variant("kind", [
8761
8301
  reason: text
8762
8302
  })
8763
8303
  ]);
8764
- var outcome = strictObject({
8304
+ var outcome2 = strictObject({
8765
8305
  id,
8766
8306
  fingerprint: text,
8767
8307
  status: picklist(["accepted", "rejected"]),
@@ -8777,11 +8317,11 @@ var mailFindings = strictObject({
8777
8317
  author,
8778
8318
  decided_by: nullable(strictObject({ type: picklist(["person", "bot"]), id })),
8779
8319
  decided_at: nullable(time),
8780
- previous: array(outcome),
8781
- receipt: nullable(strictObject({ preview_fingerprint: text, accepted: array(id), items: array(outcome) }))
8320
+ previous: array(outcome2),
8321
+ receipt: nullable(strictObject({ preview_fingerprint: text, accepted: array(id), items: array(outcome2) }))
8782
8322
  });
8783
8323
 
8784
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/media-archive.js
8324
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/media-archive.js
8785
8325
  var mediaArchive = strictObject({
8786
8326
  directory: text,
8787
8327
  chats: count,
@@ -8813,7 +8353,7 @@ var mediaArchiveTimer = union([
8813
8353
  strictObject({ ...timer, action: picklist(["install", "start", "stop", "uninstall"]) })
8814
8354
  ]);
8815
8355
 
8816
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/meeting-preparation-parts.js
8356
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/meeting-preparation-parts.js
8817
8357
  var preparationId = pipe(string(), minLength(1));
8818
8358
  var preparationCount = pipe(number(), integer(), minValue(0));
8819
8359
  var preparationTime = nullable(isoTime);
@@ -8905,7 +8445,7 @@ var preparationMeeting = strictObject({
8905
8445
  updated_at: isoTime
8906
8446
  });
8907
8447
 
8908
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/meeting-evidence.js
8448
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/meeting-evidence.js
8909
8449
  var meetingEvidence = preparationEvidence;
8910
8450
  var meetingPersonContext = strictObject({
8911
8451
  person: strictObject({ uid: string(), name: nullable(string()) }),
@@ -8927,7 +8467,7 @@ var meetingPersonContext = strictObject({
8927
8467
  })
8928
8468
  });
8929
8469
 
8930
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/meeting-findings.js
8470
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/meeting-findings.js
8931
8471
  var evidence3 = strictObject({ reference, fingerprint: text });
8932
8472
  var base2 = { id, project: reference, evidence: array(evidence3) };
8933
8473
  var finding2 = variant("kind", [
@@ -8945,7 +8485,7 @@ var finding2 = variant("kind", [
8945
8485
  assignee_evidence: optional(array(reference))
8946
8486
  })
8947
8487
  ]);
8948
- var outcome2 = strictObject({
8488
+ var outcome3 = strictObject({
8949
8489
  id,
8950
8490
  fingerprint: text,
8951
8491
  status: picklist(["accepted", "rejected"]),
@@ -8961,11 +8501,11 @@ var meetingFindings = strictObject({
8961
8501
  author,
8962
8502
  decided_by: nullable(strictObject({ type: picklist(["person", "bot"]), id })),
8963
8503
  decided_at: nullable(time),
8964
- previous: array(outcome2),
8965
- receipt: nullable(strictObject({ preview_fingerprint: text, accepted: array(id), items: array(outcome2) }))
8504
+ previous: array(outcome3),
8505
+ receipt: nullable(strictObject({ preview_fingerprint: text, accepted: array(id), items: array(outcome3) }))
8966
8506
  });
8967
8507
 
8968
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/meeting-communications.js
8508
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/meeting-communications.js
8969
8509
  var communicationCoverage = strictObject({
8970
8510
  read_usage: strictObject({ reads: preparationCount, charged_bytes: preparationCount, reserved_bytes: preparationCount, remaining_bytes: preparationCount }),
8971
8511
  query: string(),
@@ -9010,7 +8550,7 @@ var preparationCommunications = strictObject({
9010
8550
  }))
9011
8551
  });
9012
8552
 
9013
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/meeting-preparation.js
8553
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/meeting-preparation.js
9014
8554
  var meetingPreparation = strictObject({
9015
8555
  communications: optional(preparationCommunications),
9016
8556
  schema_version: literal(1),
@@ -9123,7 +8663,7 @@ var meetingPreparation = strictObject({
9123
8663
  })
9124
8664
  });
9125
8665
 
9126
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/meeting-project-candidates.js
8666
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/meeting-project-candidates.js
9127
8667
  var count4 = pipe(number(), integer(), minValue(0));
9128
8668
  var id3 = pipe(string(), minLength(1));
9129
8669
  var text3 = string();
@@ -9187,7 +8727,7 @@ var meetingProjectCandidates = strictObject({
9187
8727
  })
9188
8728
  });
9189
8729
 
9190
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/meeting-series-inventory.js
8730
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/meeting-series-inventory.js
9191
8731
  var count5 = pipe(number(), integer(), minValue(0));
9192
8732
  var id4 = pipe(string(), minLength(1), maxLength(1e3));
9193
8733
  var meetingSeriesInventory = strictObject({
@@ -9217,7 +8757,7 @@ var meetingSeriesInventory = strictObject({
9217
8757
  })
9218
8758
  });
9219
8759
 
9220
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/meeting-task-proposal.js
8760
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/meeting-task-proposal.js
9221
8761
  var text4 = string();
9222
8762
  var id5 = pipe(number(), integer(), minValue(1));
9223
8763
  var revision = picklist(["current", "superseded"]);
@@ -9234,7 +8774,7 @@ var meetingTaskProposal = strictObject({
9234
8774
  persistence: literal("proposal-only")
9235
8775
  });
9236
8776
 
9237
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/memory.js
8777
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/memory.js
9238
8778
  var memory = strictObject({
9239
8779
  ref: reference,
9240
8780
  id,
@@ -9261,7 +8801,7 @@ var memory = strictObject({
9261
8801
  updated_at: time
9262
8802
  });
9263
8803
 
9264
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/mention.js
8804
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/mention.js
9265
8805
  var kind = picklist(["phone", "email", "url", "document", "person-name", "place"]);
9266
8806
  var status = picklist(["found", "linked", "dismissed"]);
9267
8807
  var mention = strictObject({
@@ -9304,13 +8844,13 @@ var mentionRebuild = strictObject({
9304
8844
  mentions: count
9305
8845
  });
9306
8846
 
9307
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/message-change.js
8847
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/message-change.js
9308
8848
  var operated3 = { operation_id: id, chat_id: id };
9309
8849
  var messagePin = strictObject({ ...operated3, message_id: id, pinned: boolean() });
9310
8850
  var messageStar = strictObject({ ...operated3, message_id: id, starred: boolean() });
9311
8851
  var messageDeletion = strictObject({ ...operated3, deleted: array(id), for_everyone: boolean() });
9312
8852
 
9313
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/message-read.js
8853
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/message-read.js
9314
8854
  var messageTranscript = strictObject({
9315
8855
  message_id: id,
9316
8856
  text,
@@ -9368,7 +8908,7 @@ var evidencePacket = strictObject({
9368
8908
  }))
9369
8909
  });
9370
8910
 
9371
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/message-context.js
8911
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/message-context.js
9372
8912
  var messageThread = strictObject({
9373
8913
  ref: reference,
9374
8914
  chat: id,
@@ -9385,7 +8925,7 @@ var messageThread = strictObject({
9385
8925
  });
9386
8926
  var messageContext = union([message, messageThread]);
9387
8927
 
9388
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/message-counts.js
8928
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/message-counts.js
9389
8929
  var messageCounts = strictObject({
9390
8930
  by: picklist(["chat", "sender", "day", "hour"]),
9391
8931
  total: count,
@@ -9398,7 +8938,7 @@ var messageCounts = strictObject({
9398
8938
  }))
9399
8939
  });
9400
8940
 
9401
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/message-link.js
8941
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/message-link.js
9402
8942
  var messageLink = strictObject({
9403
8943
  ref: reference,
9404
8944
  url: nullable(text),
@@ -9415,7 +8955,7 @@ var messageLink = strictObject({
9415
8955
  })))
9416
8956
  });
9417
8957
 
9418
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/message-transfer.js
8958
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/message-transfer.js
9419
8959
  var savedMessageFile = strictObject({
9420
8960
  kind: text,
9421
8961
  path: text,
@@ -9502,7 +9042,7 @@ var messageSyncAll = strictObject({
9502
9042
  var messageSyncStarted = strictObject({ job: id, pid: count, chat: text, log: text });
9503
9043
  var messageSync = union([messageSyncEstimate, messageSyncChat, messageSyncAll, messageSyncStarted]);
9504
9044
 
9505
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/message-write.js
9045
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/message-write.js
9506
9046
  var messageWrite = strictObject({
9507
9047
  operation_id: id,
9508
9048
  message,
@@ -9517,7 +9057,7 @@ var draftWrite = strictObject({
9517
9057
  });
9518
9058
  var messageSend = union([messageWrite, draftWrite]);
9519
9059
 
9520
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/model.js
9060
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/model.js
9521
9061
  var model2 = strictObject({
9522
9062
  id,
9523
9063
  kind: picklist(["audio", "text", "image", "reranker"]),
@@ -9534,7 +9074,7 @@ var model2 = strictObject({
9534
9074
  path: text
9535
9075
  });
9536
9076
 
9537
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/model-key.js
9077
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/model-key.js
9538
9078
  var source = picklist(["environment", "keyring", "file"]);
9539
9079
  var modelKey = strictObject({
9540
9080
  provider: text,
@@ -9544,48 +9084,7 @@ var modelKey = strictObject({
9544
9084
  var storedModelKey = strictObject({ ...omit(modelKey, ["removed"]).entries, stored: source });
9545
9085
  var removedModelKey = strictObject({ ...omit(modelKey, ["stored"]).entries, removed: array(source) });
9546
9086
 
9547
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/note.js
9548
- var link = {
9549
- target_text: nullable(text),
9550
- kind: text,
9551
- anchor: nullable(text)
9552
- };
9553
- var note = strictObject({
9554
- ref: reference,
9555
- kind: optional(picklist(["note", "document"])),
9556
- provider: optional(text),
9557
- account: optional(text),
9558
- url: optional(text),
9559
- id,
9560
- source: picklist(["file", "internal"]),
9561
- folder_id: nullable(id),
9562
- path: nullable(text),
9563
- title: nullable(text),
9564
- text,
9565
- /** Raises on every edit; `notes edit --revision` takes it, so an edit made meanwhile is refused, not lost. */
9566
- revision: count,
9567
- /** A file's front matter as parsed, keys as the file writes them; null for a note without it. */
9568
- front_matter: nullable(record(string(), unknown())),
9569
- /** The hash of a file's bytes when last imported; null for a note written here. */
9570
- content_hash: nullable(text),
9571
- /** The file the note was exported to, where that is known; null otherwise. */
9572
- export_path: nullable(text),
9573
- created_at: time,
9574
- /** When the store's copy last changed. */
9575
- updated_at: time,
9576
- deleted_at: optional(nullable(time)),
9577
- tags: optional(array(text)),
9578
- /** The first line holding a word of a search. */
9579
- excerpt: optional(text),
9580
- /** Which halves of a search found it. */
9581
- found_by: optional(array(picklist(["title", "words", "meaning"]))),
9582
- /** What the note links to; `to` is null while the name written matches nothing stored. */
9583
- links: optional(array(strictObject({ to: nullable(reference), ...link }))),
9584
- /** The notes and messages that link to it. */
9585
- backlinks: optional(array(strictObject({ from: reference, ...link })))
9586
- });
9587
-
9588
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/official-stats.js
9087
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/official-stats.js
9589
9088
  var versus = strictObject({ current: number(), previous: number() });
9590
9089
  var person = { person_ref: reference, name: nullable(text) };
9591
9090
  var graph = strictObject({
@@ -9619,14 +9118,14 @@ var officialStats = strictObject({
9619
9118
  graphs: record(string(), union([graph, strictObject({ error: text })]))
9620
9119
  });
9621
9120
 
9622
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/person.js
9121
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/person.js
9623
9122
  var person2 = strictObject({
9624
9123
  ref: reference,
9625
9124
  name: nullable(text),
9626
9125
  identities: optional(array(identity))
9627
9126
  });
9628
9127
 
9629
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/poll.js
9128
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/poll.js
9630
9129
  var poll = strictObject({
9631
9130
  chat_id: id,
9632
9131
  message_id: id,
@@ -9642,11 +9141,11 @@ var poll = strictObject({
9642
9141
  });
9643
9142
  var pollChange = strictObject({ operation_id: id, poll });
9644
9143
 
9645
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/private-contact.js
9144
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/private-contact.js
9646
9145
  var contactAlias = strictObject({ person_id: id, alias: nullable(text) });
9647
9146
  var contactNoteRemoval = strictObject({ id, person_id: id, removed: boolean() });
9648
9147
 
9649
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/ranking.js
9148
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/ranking.js
9650
9149
  var figures = record(string(), number());
9651
9150
  var freshness = picklist(["fresh", "stale", "partial", "unknown"]);
9652
9151
  var rankingRow = strictObject({
@@ -9693,7 +9192,7 @@ var ranking = strictObject({
9693
9192
  rows: array(rankingRow)
9694
9193
  });
9695
9194
 
9696
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/reaction.js
9195
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/reaction.js
9697
9196
  var reaction = strictObject({
9698
9197
  person: strictObject({ id, name: nullable(text), username: nullable(text) }),
9699
9198
  /** The emoji, or `custom:<id>` for a custom one. */
@@ -9701,7 +9200,7 @@ var reaction = strictObject({
9701
9200
  reacted_at: time
9702
9201
  });
9703
9202
 
9704
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/reaction-change.js
9203
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/reaction-change.js
9705
9204
  var reactionChange = strictObject({
9706
9205
  operation_id: id,
9707
9206
  chat_id: id,
@@ -9709,7 +9208,7 @@ var reactionChange = strictObject({
9709
9208
  reaction: nullable(text)
9710
9209
  });
9711
9210
 
9712
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/recipient.js
9211
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/recipient.js
9713
9212
  var recipient = strictObject({ id, title: nullable(text), partner_id: optional(id), added_at: time });
9714
9213
  var recipientAdded = strictObject({ id, title: nullable(text), added: boolean() });
9715
9214
  var recipientRemoved = strictObject({ id, title: nullable(text), removed: boolean() });
@@ -9720,7 +9219,7 @@ var recipientChange = strictObject({
9720
9219
  ...partial(recipientOff).entries
9721
9220
  });
9722
9221
 
9723
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/recorded-run.js
9222
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/recorded-run.js
9724
9223
  var events = array(record(string(), unknown()));
9725
9224
  var recordedRun = strictObject({
9726
9225
  run_id: id,
@@ -9792,7 +9291,7 @@ var runHit = strictObject({
9792
9291
  });
9793
9292
  var runLocation = strictObject({ path: text });
9794
9293
 
9795
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/relationship.js
9294
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/relationship.js
9796
9295
  var relationship = strictObject({
9797
9296
  id,
9798
9297
  from: reference,
@@ -9809,7 +9308,7 @@ var relationship = strictObject({
9809
9308
  created_at: time
9810
9309
  });
9811
9310
 
9812
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/reply-stats.js
9311
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/reply-stats.js
9813
9312
  var milliseconds2 = nullable(pipe(number(), minValue(0)));
9814
9313
  var figures2 = { replies: count, median_ms: milliseconds2, p90_ms: milliseconds2, mean_ms: milliseconds2 };
9815
9314
  var responseTimes = strictObject({
@@ -9826,7 +9325,7 @@ var waitingChats = strictObject({
9826
9325
  by_kind: strictObject({ private: count, group: count })
9827
9326
  });
9828
9327
 
9829
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/retention.js
9328
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/retention.js
9830
9329
  var retentionCohort = strictObject({
9831
9330
  /** The first day of the joining day or week. */
9832
9331
  cohort: text,
@@ -9874,7 +9373,7 @@ var retention = strictObject({
9874
9373
  rows: array(retentionCohort)
9875
9374
  });
9876
9375
 
9877
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/saved-search.js
9376
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/saved-search.js
9878
9377
  var savedSearch = strictObject({
9879
9378
  id,
9880
9379
  /** `null` for a run in the history. */
@@ -9891,7 +9390,7 @@ var savedSearch = strictObject({
9891
9390
  });
9892
9391
  var searchHistoryClear = strictObject({ cleared: count });
9893
9392
 
9894
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/send-attempt.js
9393
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/send-attempt.js
9895
9394
  var sendAttempt = strictObject({
9896
9395
  at: time,
9897
9396
  profile: text,
@@ -9919,7 +9418,7 @@ var sendAttempt = strictObject({
9919
9418
  error_code: optional(text)
9920
9419
  });
9921
9420
 
9922
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/store-maintenance.js
9421
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/store-maintenance.js
9923
9422
  var absent = strictObject({ path: text, exists: literal(false) });
9924
9423
  var schema = strictObject({ version: count, min_compatible: count, writable: boolean(), speaks: count });
9925
9424
  var infoSchema = strictObject({
@@ -10074,12 +9573,25 @@ var storeBackup = strictObject({
10074
9573
  encrypted: optional(literal(true))
10075
9574
  });
10076
9575
  var storeDecrypt = strictObject({ path: text, from: text, bytes: count });
10077
- var storeRestore = strictObject({
10078
- path: text,
10079
- restored_from: text,
10080
- kept_at: nullable(text),
10081
- schema: count
10082
- });
9576
+ var storeRestore = union([
9577
+ strictObject({
9578
+ path: text,
9579
+ restored_from: text,
9580
+ kept_at: nullable(text),
9581
+ schema: count
9582
+ }),
9583
+ /** From a rollback copy: its tables put back in place, the store returned to `schema` from `was`. */
9584
+ strictObject({
9585
+ path: text,
9586
+ restored_from: text,
9587
+ rolled_back: literal(true),
9588
+ schema: count,
9589
+ was: count,
9590
+ tables: array(strictObject({ table: text, rows: count })),
9591
+ rebuilt: array(text),
9592
+ foreign_key_violations: count
9593
+ })
9594
+ ]);
10083
9595
  var storeReset = union([
10084
9596
  strictObject({ ...absent.entries, reset: literal(false) }),
10085
9597
  strictObject({
@@ -10127,7 +9639,7 @@ var storeRepair = union([
10127
9639
  ]);
10128
9640
  var storeCopyRemoval = strictObject({ path: text, deleted: strictObject({ name: text, rows: count }) });
10129
9641
 
10130
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/store-records.js
9642
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/store-records.js
10131
9643
  var range = strictObject({ from: number(), to: number() });
10132
9644
  var storeChatStatus = strictObject({
10133
9645
  chat_id: id,
@@ -10225,7 +9737,7 @@ var storeJobRetry = union([
10225
9737
  ]);
10226
9738
  var storeJobClear = strictObject({ cleared: array(id) });
10227
9739
 
10228
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/store-table.js
9740
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/store-table.js
10229
9741
  var TABLE_KINDS = ["data", "search_index", "search_index_part", "internal"];
10230
9742
  var storeTable = strictObject({
10231
9743
  name: text,
@@ -10234,7 +9746,7 @@ var storeTable = strictObject({
10234
9746
  bytes: optional(nullable(count))
10235
9747
  });
10236
9748
 
10237
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/tag-change.js
9749
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/tag-change.js
10238
9750
  var tagTarget = variant("type", [
10239
9751
  strictObject({ type: literal("chat"), chat_id: id }),
10240
9752
  strictObject({ type: literal("contact"), person_id: id }),
@@ -10265,7 +9777,7 @@ var automaticTags = strictObject({
10265
9777
  dry_run: boolean()
10266
9778
  });
10267
9779
 
10268
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/tagging.js
9780
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/tagging.js
10269
9781
  var tagging = strictObject({
10270
9782
  tag: text,
10271
9783
  type: picklist(TAG_TYPES),
@@ -10278,7 +9790,7 @@ var tagging = strictObject({
10278
9790
  created_at: time
10279
9791
  });
10280
9792
 
10281
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/task-pair.js
9793
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/task-pair.js
10282
9794
  var side = strictObject({ ref: reference, key: text, title: text, status: text });
10283
9795
  var taskPair = strictObject({
10284
9796
  task: nullable(side),
@@ -10301,9 +9813,9 @@ var taskPair = strictObject({
10301
9813
  created_at: time
10302
9814
  });
10303
9815
 
10304
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/task-results.js
9816
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/task-results.js
10305
9817
  var nullableTime = nullable(time);
10306
- var link2 = strictObject({
9818
+ var link = strictObject({
10307
9819
  id,
10308
9820
  from: reference,
10309
9821
  to: nullable(reference),
@@ -10353,8 +9865,8 @@ var taskCard = strictObject({
10353
9865
  assignments: array(strictObject({ to: reference, role: picklist(["assignee", "reviewer", "watcher"]) })),
10354
9866
  created_at: time,
10355
9867
  updated_at: time,
10356
- links: array(link2),
10357
- linked_from: array(link2)
9868
+ links: array(link),
9869
+ linked_from: array(link)
10358
9870
  });
10359
9871
  var taskView = strictObject({
10360
9872
  id,
@@ -10475,7 +9987,7 @@ var taskReview = strictObject({
10475
9987
  untrusted
10476
9988
  });
10477
9989
 
10478
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/topic.js
9990
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/topic.js
10479
9991
  var topic = strictObject({
10480
9992
  id,
10481
9993
  title: text,
@@ -10489,9 +10001,13 @@ var topic = strictObject({
10489
10001
  untrusted
10490
10002
  });
10491
10003
 
10492
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/entities/index.js
10004
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/entities/index.js
10493
10005
  var ENTITIES = {
10494
10006
  sync_progress: progress,
10007
+ deal,
10008
+ lead,
10009
+ pipeline,
10010
+ stage,
10495
10011
  ...MEETING_RESULT_ENTITIES,
10496
10012
  message,
10497
10013
  message_context: messageContext,
@@ -10771,7 +10287,7 @@ var entityDefinitions = /* @__PURE__ */ __name(() => Object.fromEntries(Object.e
10771
10287
  return [name, definition];
10772
10288
  })), "entityDefinitions");
10773
10289
 
10774
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/cli/answer-entity.js
10290
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/answer-entity.js
10775
10291
  var schemas = /* @__PURE__ */ new WeakMap();
10776
10292
  var answerEntity = /* @__PURE__ */ __name((command, name, schema2, options = {}) => {
10777
10293
  if (Object.hasOwn(ENTITIES, name))
@@ -10805,8 +10321,8 @@ var answerRow = /* @__PURE__ */ __name((command) => {
10805
10321
  return own && metaOf(command).output?.entity === own.name ? own.row : void 0;
10806
10322
  }, "answerRow");
10807
10323
 
10808
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/images/picture/models.js
10809
- import { join as join6 } from "node:path";
10324
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/images/picture/models.js
10325
+ import { join as join5 } from "node:path";
10810
10326
  var clip = /* @__PURE__ */ __name((name) => `https://huggingface.co/Xenova/clip-vit-base-patch32/resolve/d15189d7028b43f1d3e65039190477f6af591c2a/${name}`, "clip");
10811
10327
  var IMAGE_MODELS = [
10812
10328
  {
@@ -10856,10 +10372,10 @@ var imageModel = /* @__PURE__ */ __name((id6) => {
10856
10372
  return found;
10857
10373
  }, "imageModel");
10858
10374
  var imageModelsDirectory = /* @__PURE__ */ __name((env = process.env) => sharedModelsDirectory("image", env), "imageModelsDirectory");
10859
- var placedImage = /* @__PURE__ */ __name((model3, directory) => model3.files.map((file) => [file, join6(directory, model3.id, file.name)]), "placedImage");
10375
+ var placedImage = /* @__PURE__ */ __name((model3, directory) => model3.files.map((file) => [file, join5(directory, model3.id, file.name)]), "placedImage");
10860
10376
  var isImageModelInstalled = /* @__PURE__ */ __name((model3, directory) => filesPresent(placedImage(model3, directory)), "isImageModelInstalled");
10861
10377
 
10862
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/cli/steps.js
10378
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/steps.js
10863
10379
  var STEPS2 = defineSteps([
10864
10380
  ...STEPS,
10865
10381
  {
@@ -11140,7 +10656,7 @@ var stepLine = /* @__PURE__ */ __name((root, step2) => {
11140
10656
  ].join(" ");
11141
10657
  }, "stepLine");
11142
10658
 
11143
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/cli/project-status-rows.js
10659
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/project-status-rows.js
11144
10660
  var where = [{ field: "ref" }];
11145
10661
  var who2 = { field: ["who.owner", "who.name"], tag: "you" };
11146
10662
  var ON_CHAT_ROW = /* @__PURE__ */ new Set(["reply-next", "coverage"]);
@@ -11232,7 +10748,7 @@ var STATUS_ROWS = {
11232
10748
  "status.failed": { columns: [{ field: "signal" }], text: ["why"] }
11233
10749
  };
11234
10750
 
11235
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/cli/compact.js
10751
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/compact.js
11236
10752
  var TEXT_CHARS = 400;
11237
10753
  var sender = { field: ["sender_is_me", "sender_name"], tag: "me" };
11238
10754
  var messageRow = {
@@ -11474,8 +10990,8 @@ var dayColumn = /* @__PURE__ */ __name((rows2, shape, hoisted) => {
11474
10990
  const dates = rows2.map(({ cells }) => cells[index]?.date);
11475
10991
  if (dates.some((one) => one === void 0))
11476
10992
  return -1;
11477
- const days2 = dates;
11478
- return ordered(days2) && new Set(days2).size * 3 <= days2.length ? index : -1;
10993
+ const days = dates;
10994
+ return ordered(days) && new Set(days).size * 3 <= days.length ? index : -1;
11479
10995
  }, "dayColumn");
11480
10996
  var rowsOfItems = /* @__PURE__ */ __name((items, shape, clock, chars) => {
11481
10997
  const dates = [];
@@ -11598,11 +11114,11 @@ var compactText = /* @__PURE__ */ __name((body, shape, options, rowsOf = rowsOfE
11598
11114
  return lines.concat(footerOf(body)).join("\n");
11599
11115
  }, "compactText");
11600
11116
 
11601
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/cli/output-budget.js
11117
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/output-budget.js
11602
11118
  var SOFT_OUTPUT_BYTES = 256 * 1024;
11603
11119
  var CARRIED = ["json", "compact", "offline", "timeout", "full", "brief", "maxOutputBytes"];
11604
11120
  var NOT_WITH_COMPACT = /* @__PURE__ */ new Set(["json", "brief"]);
11605
- var snake3 = /* @__PURE__ */ __name((name) => name.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`), "snake");
11121
+ var snake2 = /* @__PURE__ */ __name((name) => name.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`), "snake");
11606
11122
  var typed = /* @__PURE__ */ __name((command, key) => command.getOptionValueSource(key) === "cli", "typed");
11607
11123
  var typedArgs = /* @__PURE__ */ __name((command) => {
11608
11124
  const root = rootOf2(command);
@@ -11615,8 +11131,8 @@ var typedArgs = /* @__PURE__ */ __name((command) => {
11615
11131
  const word = Array.isArray(value) ? value.join(" ") : value;
11616
11132
  return word === void 0 || word === "" ? [] : [[argument.name(), word]];
11617
11133
  });
11618
- const own = command.options.map((option) => option.attributeName()).filter((key) => typed(command, key)).map((key) => [snake3(key), command.getOptionValue(key)]);
11619
- const global = CARRIED.filter((key) => typed(root, key)).map((key) => [snake3(key), root.getOptionValue(key)]);
11134
+ const own = command.options.map((option) => option.attributeName()).filter((key) => typed(command, key)).map((key) => [snake2(key), command.getOptionValue(key)]);
11135
+ const global = CARRIED.filter((key) => typed(root, key)).map((key) => [snake2(key), root.getOptionValue(key)]);
11620
11136
  return Object.fromEntries([...positional, ...own, ...global]);
11621
11137
  }, "typedArgs");
11622
11138
  var declaresRow = /* @__PURE__ */ __name((command) => {
@@ -11656,7 +11172,7 @@ var largeAnswerSteps = /* @__PURE__ */ __name((command) => {
11656
11172
  return args ? compactStep(command, args, "the answer is large as JSON; one line per item keeps every ref") : [];
11657
11173
  }, "largeAnswerSteps");
11658
11174
 
11659
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/cli/provider-refs.js
11175
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/provider-refs.js
11660
11176
  var HIDDEN = /* @__PURE__ */ new Set(["providerRef", "provider_ref"]);
11661
11177
  var withoutProviderRefs = /* @__PURE__ */ __name((value) => strip(value), "withoutProviderRefs");
11662
11178
  var strip = /* @__PURE__ */ __name((value) => {
@@ -11670,7 +11186,7 @@ var strip = /* @__PURE__ */ __name((value) => {
11670
11186
  return Object.fromEntries(Object.entries(value).flatMap(([key, inner]) => HIDDEN.has(key) ? [] : [[key, strip(inner)]]));
11671
11187
  }, "strip");
11672
11188
 
11673
- // node_modules/.pnpm/@wirecat+cli-core@0.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/node_modules/@wirecat/cli-core/dist/cli/envelope.js
11189
+ // node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/envelope.js
11674
11190
  var answerSchema = /* @__PURE__ */ __name((item = unknown()) => union([listEnvelopeSchema(item), itemEnvelopeSchema(item)]), "answerSchema");
11675
11191
  var capped2 = /* @__PURE__ */ __name((steps) => steps.length > 0 ? { next: steps.slice(0, MAX_NEXT_STEPS) } : {}, "capped");
11676
11192
  var listOf = /* @__PURE__ */ __name((command, input) => {
@@ -11713,7 +11229,7 @@ var itemOf = /* @__PURE__ */ __name((item, { next = [], missing, meta } = {}) =>
11713
11229
  };
11714
11230
  return body;
11715
11231
  }, "itemOf");
11716
- var snake4 = /* @__PURE__ */ __name((key) => key.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`), "snake");
11232
+ var snake3 = /* @__PURE__ */ __name((key) => key.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`), "snake");
11717
11233
  var snakeKeysKeeping = /* @__PURE__ */ __name((verbatim) => {
11718
11234
  const kept = new Set(verbatim);
11719
11235
  const convert = /* @__PURE__ */ __name((value) => {
@@ -11724,7 +11240,7 @@ var snakeKeysKeeping = /* @__PURE__ */ __name((verbatim) => {
11724
11240
  return Object.fromEntries(Object.entries(value).flatMap(([key, inner]) => {
11725
11241
  if (inner === void 0)
11726
11242
  return [];
11727
- const name = snake4(key);
11243
+ const name = snake3(key);
11728
11244
  return [[name, kept.has(key) || kept.has(name) ? inner : convert(inner)]];
11729
11245
  }));
11730
11246
  }, "convert");
@@ -11837,31 +11353,6 @@ export {
11837
11353
  scheduledJob,
11838
11354
  callRecord,
11839
11355
  stickerInventory,
11840
- envName,
11841
- readOnlyLockOf,
11842
- mailHolderVariable,
11843
- MESSENGER_CHANGE_REFUSAL,
11844
- readOnlyRefusal,
11845
- logAttributes,
11846
- fromLogAttributes,
11847
- LOG_ATTRIBUTES,
11848
- runsDirFor,
11849
- runtime,
11850
- newRunId,
11851
- listRuns,
11852
- findRun,
11853
- readEvents,
11854
- currentRun,
11855
- inRun,
11856
- runEvent,
11857
- typedCommand,
11858
- useAsProcessRun,
11859
- processRun,
11860
- enclosingTraceId,
11861
- traceOf,
11862
- childTrace,
11863
- withAttempt,
11864
- currentAttempt,
11865
11356
  recordLogFor,
11866
11357
  spawnDetached,
11867
11358
  jobsDir,
@@ -11899,10 +11390,6 @@ export {
11899
11390
  recorded,
11900
11391
  startRecording,
11901
11392
  wasSettled,
11902
- sentIds,
11903
- currentOperation,
11904
- guardedWrite,
11905
- codeOf,
11906
11393
  DEFAULT_COMMAND_MS,
11907
11394
  DEFAULT_COOPERATIVE_MS,
11908
11395
  DEFAULT_SYNC_MS,
@@ -11949,12 +11436,15 @@ export {
11949
11436
  NoProfileHere,
11950
11437
  fromFile,
11951
11438
  settingsFor,
11439
+ runBudgetOf,
11952
11440
  setExitCode,
11953
11441
  provide,
11954
11442
  environmentOf,
11443
+ withAgentLevels,
11955
11444
  secretInputOf,
11956
11445
  outputFor,
11957
11446
  baseContext,
11447
+ inCommandRun,
11958
11448
  REMOTE_READ,
11959
11449
  FETCH,
11960
11450
  REMOTE_WRITE,
@@ -11996,6 +11486,7 @@ export {
11996
11486
  oddName,
11997
11487
  contactNote,
11998
11488
  conversation,
11489
+ deal,
11999
11490
  documentLink,
12000
11491
  joinRequest,
12001
11492
  pollVote,
@@ -12038,6 +11529,7 @@ export {
12038
11529
  answerSchema,
12039
11530
  listOf,
12040
11531
  itemOf,
11532
+ snakeKeysKeeping,
12041
11533
  snakeKeys,
12042
11534
  judgedAnswer,
12043
11535
  metaNow,