@wirecat/drive-cli 0.61.0 → 0.63.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 (152) hide show
  1. package/dist/bin/drive.js +2 -2
  2. package/dist/browse.d.ts +20 -0
  3. package/dist/browse.d.ts.map +1 -0
  4. package/dist/browse.js +146 -0
  5. package/dist/browse.js.map +1 -0
  6. package/dist/bundle/{all-profiles-H4L3Z5UM.js → all-profiles-GZJS3UKC.js} +13 -14
  7. package/dist/bundle/{anthropic-PPGFISVP.js → anthropic-RGV3WXX5.js} +9 -9
  8. package/dist/bundle/{app-server-YXVK2FUZ.js → app-server-AA2PJ7PV.js} +57 -55
  9. package/dist/bundle/{bun-DKZAL6ML.js → bun-OXZYIA3R.js} +2 -2
  10. package/dist/bundle/{bun-sqlite-MTZY36QK.js → bun-sqlite-D45NSDM3.js} +8 -8
  11. package/dist/bundle/{chunk-KV4267S4.js → chunk-27YUUGXQ.js} +1 -1
  12. package/dist/bundle/{chunk-6IBM4Z3V.js → chunk-2HF2MRXI.js} +1 -1
  13. package/dist/bundle/{chunk-HGOYQUT7.js → chunk-2NIC72HH.js} +4 -2
  14. package/dist/bundle/{chunk-XZBR2O63.js → chunk-2TDUGC5D.js} +1501 -781
  15. package/dist/bundle/{chunk-DEPMQHXQ.js → chunk-2TFXK3R4.js} +4 -4
  16. package/dist/bundle/{chunk-JVBLXSAA.js → chunk-33MGFUED.js} +652 -249
  17. package/dist/bundle/{chunk-S4YK6TTG.js → chunk-3BZRKLJ6.js} +13 -13
  18. package/dist/bundle/{chunk-6SUGANRJ.js → chunk-3HK5WMI5.js} +6 -6
  19. package/dist/bundle/{chunk-YWIU4HOT.js → chunk-3QINVLZI.js} +1 -1
  20. package/dist/bundle/{chunk-XYCCGGKN.js → chunk-44SBK6KB.js} +1207 -643
  21. package/dist/bundle/{chunk-LARQTWIL.js → chunk-4CIZWCXV.js} +1 -1
  22. package/dist/bundle/{chunk-WZ5XK74U.js → chunk-4OSSOWDM.js} +1 -1
  23. package/dist/bundle/{chunk-XGNC5OJG.js → chunk-4S4JMW6I.js} +1 -1
  24. package/dist/bundle/{chunk-WIU733D2.js → chunk-534OBX5Y.js} +1 -1
  25. package/dist/bundle/{chunk-UO2IUDVK.js → chunk-5PPL7JDM.js} +2 -2
  26. package/dist/bundle/{chunk-OFFA54TW.js → chunk-6EY46GAN.js} +2 -2
  27. package/dist/bundle/{chunk-RFRCOAWS.js → chunk-6KQJSFYF.js} +22 -22
  28. package/dist/bundle/{chunk-6DN4VPA7.js → chunk-6MQSQ4LX.js} +33 -31
  29. package/dist/bundle/{chunk-NIX2MWHZ.js → chunk-7EMQ26BA.js} +39 -25
  30. package/dist/bundle/{chunk-X2CXW4HM.js → chunk-ABYGSJZ4.js} +7 -7
  31. package/dist/bundle/{chunk-I26VL4W7.js → chunk-AEX37ETW.js} +2 -2
  32. package/dist/bundle/{chunk-36CWGEVX.js → chunk-BKYMKVHT.js} +2 -2
  33. package/dist/bundle/{chunk-3WZH3WV3.js → chunk-CE2TJBLP.js} +3 -3
  34. package/dist/bundle/{chunk-YMBFZA3H.js → chunk-DJ3SDJZY.js} +8 -8
  35. package/dist/bundle/{chunk-DXPOVLQC.js → chunk-DJHLVUL6.js} +227 -90
  36. package/dist/bundle/{chunk-VPDAH7PJ.js → chunk-E4SDKMBJ.js} +59 -1
  37. package/dist/bundle/{chunk-NZ2EIZLX.js → chunk-EOOGWUTP.js} +10 -10
  38. package/dist/bundle/{chunk-VYXVPYA3.js → chunk-FEZF3TII.js} +6 -6
  39. package/dist/bundle/{chunk-Q4XVBKX4.js → chunk-FRIJUILO.js} +3 -3
  40. package/dist/bundle/{chunk-OLPJRD4S.js → chunk-FUITWY7O.js} +1 -1
  41. package/dist/bundle/{chunk-AM4RIWOZ.js → chunk-HZZCEQTH.js} +18 -4
  42. package/dist/bundle/{chunk-2RJA4BQB.js → chunk-J24ZFCWM.js} +39 -26
  43. package/dist/bundle/{chunk-QSGT4ZH4.js → chunk-J4DIHPZ6.js} +1 -1
  44. package/dist/bundle/{chunk-ZHYRHERD.js → chunk-L37LMMRJ.js} +2 -2
  45. package/dist/bundle/{chunk-XLFJLZJL.js → chunk-LMAVCYLQ.js} +22 -14
  46. package/dist/bundle/{chunk-E6J5YH2N.js → chunk-LZEOQW7S.js} +36 -36
  47. package/dist/bundle/{chunk-FE5JJXKA.js → chunk-MOTRI3SY.js} +2 -2
  48. package/dist/bundle/{chunk-PJTX2MOI.js → chunk-ND6LLYGF.js} +98 -81
  49. package/dist/bundle/{chunk-3I2D5TK2.js → chunk-NEFSGCVA.js} +10 -10
  50. package/dist/bundle/{chunk-OGNOQDWB.js → chunk-O2XOX4HB.js} +34 -10
  51. package/dist/bundle/{chunk-DCBFNBEB.js → chunk-OD4U7GUY.js} +20 -20
  52. package/dist/bundle/{chunk-BXR7BKM3.js → chunk-OTROVC4E.js} +1 -1
  53. package/dist/bundle/{chunk-UKOYQC5O.js → chunk-OXY6SSZG.js} +184 -29
  54. package/dist/bundle/{chunk-ZMNYK3FC.js → chunk-PDCCYHCH.js} +5 -5
  55. package/dist/bundle/{chunk-J5UDQD5S.js → chunk-PO5RQQIG.js} +5 -5
  56. package/dist/bundle/{chunk-PY7LKNOS.js → chunk-Q5DJTRKV.js} +2 -2
  57. package/dist/bundle/{chunk-E5EXJ2XS.js → chunk-QCKZ3GAA.js} +4 -4
  58. package/dist/bundle/{chunk-3SJQNS72.js → chunk-RKELRWH7.js} +5 -5
  59. package/dist/bundle/{chunk-6Y2FWJZ4.js → chunk-S4RXABDR.js} +3 -3
  60. package/dist/bundle/{chunk-BQMIDYBA.js → chunk-SXM6MHRR.js} +12 -12
  61. package/dist/bundle/chunk-TF23BZW5.js +64 -0
  62. package/dist/bundle/{chunk-N2RLJTIW.js → chunk-TWUH22Z5.js} +4 -4
  63. package/dist/bundle/chunk-UPOSDTPT.js +87 -0
  64. package/dist/bundle/{chunk-J4HQVHMN.js → chunk-UQLWMGSD.js} +5 -5
  65. package/dist/bundle/{chunk-K7LS3NGM.js → chunk-V3NVXIQR.js} +736 -230
  66. package/dist/bundle/{chunk-TKGAYKXW.js → chunk-VAUMOZU5.js} +228 -66
  67. package/dist/bundle/{chunk-BF6TQMNB.js → chunk-VJEOGKAN.js} +8 -10
  68. package/dist/bundle/{chunk-XGMDWIUP.js → chunk-VKPCONDQ.js} +4 -4
  69. package/dist/bundle/{chunk-73WSULMI.js → chunk-WYGWWHZP.js} +2 -2
  70. package/dist/bundle/{chunk-5W56YMQS.js → chunk-XDC3TWTL.js} +60 -51
  71. package/dist/bundle/{chunk-5W7D5H2R.js → chunk-XIUDS3OK.js} +1 -1
  72. package/dist/bundle/{chunk-3UPIJ7DW.js → chunk-XNVFKMVR.js} +21868 -4533
  73. package/dist/bundle/{chunk-O5CUFS7T.js → chunk-XR6ESRU6.js} +2 -2
  74. package/dist/bundle/{chunk-EPCJUL6M.js → chunk-Y6GNA7HE.js} +3 -3
  75. package/dist/bundle/{chunk-67HS46KM.js → chunk-YGU6ULU5.js} +12 -12
  76. package/dist/bundle/{chunk-HFM653T3.js → chunk-YIP7ELON.js} +768 -131
  77. package/dist/bundle/{chunk-3252WXOL.js → chunk-YUWPNG7B.js} +1 -1
  78. package/dist/bundle/{chunk-QR5VQXQ5.js → chunk-Z42YYLTS.js} +59 -37
  79. package/dist/bundle/{chunk-AWN22PJK.js → chunk-Z5KC7XBR.js} +3 -3
  80. package/dist/bundle/{chunk-ECEYAQGN.js → chunk-ZM5J6ZMB.js} +4 -2
  81. package/dist/bundle/{chunk-YPF6OS37.js → chunk-ZMOUUOT2.js} +1 -1
  82. package/dist/bundle/{chunk-CACYL36O.js → chunk-ZOJU7ZFI.js} +8 -8
  83. package/dist/bundle/command-contract-BRW3AP44.js +38 -0
  84. package/dist/bundle/{decode-62A3HGPW.js → decode-G5YEIPNC.js} +8 -8
  85. package/dist/bundle/{dispatch-IE7PBEQC.js → dispatch-GEFIXA6X.js} +9 -9
  86. package/dist/bundle/drive.js +11 -11
  87. package/dist/bundle/{echarts-BGBPRGR5.js → echarts-W2CWHNXR.js} +2 -2
  88. package/dist/bundle/{embed-J3IBVV2V.js → embed-OBFFPVF4.js} +9 -9
  89. package/dist/bundle/{embedder-QFPMDRT2.js → embedder-NGCBQHIG.js} +12 -12
  90. package/dist/bundle/entry-ET6HGM7A.js +22 -0
  91. package/dist/bundle/{failure-BKOGBMIC.js → failure-GV77W3CD.js} +4 -4
  92. package/dist/bundle/first-run-JG52UZVO.js +30 -0
  93. package/dist/bundle/first-screen-CIL3GFAA.js +36 -0
  94. package/dist/bundle/{google-RXM2XEPD.js → google-CIWUVJ5C.js} +13 -13
  95. package/dist/bundle/{google-api-NC65BZO4.js → google-api-Z3NSTBBR.js} +56 -57
  96. package/dist/bundle/grants-3S4RL3WB.js +104 -0
  97. package/dist/bundle/{identity-PI6F2GWA.js → identity-OM6GFZ7T.js} +6 -6
  98. package/dist/bundle/{instructions-6LPDSKAD.js → instructions-YQBQSYSS.js} +1 -1
  99. package/dist/bundle/{login-HTY7GT2S.js → login-7RYSDVN3.js} +62 -63
  100. package/dist/bundle/{mcp-PPVOM4SE.js → mcp-GWDA3HOA.js} +2 -2
  101. package/dist/bundle/{node-IB246NCQ.js → node-IVU33RL7.js} +2 -2
  102. package/dist/bundle/{node-sqlite-G2Y5SFJM.js → node-sqlite-SIH5BEW2.js} +9 -9
  103. package/dist/bundle/oauth-PT4JEHLL.js +22 -0
  104. package/dist/bundle/{open-WD4GFSJD.js → open-IAO2SNII.js} +8 -8
  105. package/dist/bundle/{openai-QVM4PMY7.js → openai-SGOUBHXP.js} +17 -17
  106. package/dist/bundle/{process-SWPJGPQC.js → process-BPBMV3AT.js} +1 -1
  107. package/dist/bundle/{program-WHYFAMXR.js → program-MYKKJ4F6.js} +231 -87
  108. package/dist/bundle/prompt-3ZM64DCB.js +17 -0
  109. package/dist/bundle/{reasons-Q34DQWB6.js → reasons-57J2D77K.js} +5 -5
  110. package/dist/bundle/{recognize-DM3YWHSE.js → recognize-A5C5RPB3.js} +7 -7
  111. package/dist/bundle/{remote-KXVWRK7J.js → remote-VWYFLRGO.js} +10 -10
  112. package/dist/bundle/{rerank-TINXM3MY.js → rerank-4NGQWREA.js} +10 -10
  113. package/dist/bundle/{serve-IY2WL656.js → serve-Y6LQTFH5.js} +12 -12
  114. package/dist/bundle/{server-VPY3OWPC.js → server-6AUHIIUA.js} +43 -44
  115. package/dist/bundle/server-PFHI35HA.js +69 -0
  116. package/dist/bundle/{services-PXNBOCOC.js → services-2W4J7EMW.js} +47 -32
  117. package/dist/bundle/{sqlite-runtime-5ZK2CV7Y.js → sqlite-runtime-P6BBDX2H.js} +9 -9
  118. package/dist/bundle/{start-LDVCN3DK.js → start-AFFA3LKM.js} +9 -7
  119. package/dist/bundle/{state-3MKTT3VS.js → state-PXKKXR3R.js} +9 -9
  120. package/dist/bundle/{store-4VQOT5IJ.js → store-CN6JEUC4.js} +28 -18
  121. package/dist/bundle/{store-7M4MSUJV.js → store-IVV2BAGZ.js} +78 -28
  122. package/dist/bundle/store-maintenance-command-MSY2QNEH.js +59 -0
  123. package/dist/bundle/tokens-P4LPNUFW.js +102 -0
  124. package/dist/commands/config.d.ts.map +1 -1
  125. package/dist/commands/config.js +5 -1
  126. package/dist/commands/config.js.map +1 -1
  127. package/dist/commands/folders.d.ts +2 -1
  128. package/dist/commands/folders.d.ts.map +1 -1
  129. package/dist/commands/folders.js +16 -3
  130. package/dist/commands/folders.js.map +1 -1
  131. package/dist/program.js +1 -1
  132. package/dist/program.js.map +1 -1
  133. package/dist/tokens.d.ts.map +1 -1
  134. package/dist/tokens.js +15 -6
  135. package/dist/tokens.js.map +1 -1
  136. package/dist/version.d.ts +1 -1
  137. package/dist/version.js +1 -1
  138. package/package.json +3 -3
  139. package/dist/bundle/chunk-BCWUDTYQ.js +0 -22
  140. package/dist/bundle/chunk-W767AUNR.js +0 -132
  141. package/dist/bundle/chunk-WUP2MJDN.js +0 -42
  142. package/dist/bundle/command-contract-T3EO5AYD.js +0 -39
  143. package/dist/bundle/entry-YQSYER66.js +0 -22
  144. package/dist/bundle/first-run-ZIFPVZAI.js +0 -30
  145. package/dist/bundle/first-screen-L5U26EY7.js +0 -37
  146. package/dist/bundle/grants-SEWUYYH3.js +0 -105
  147. package/dist/bundle/oauth-MWBKBI4T.js +0 -22
  148. package/dist/bundle/prompt-OVYCGZB7.js +0 -17
  149. package/dist/bundle/server-EMWVVT2C.js +0 -70
  150. package/dist/bundle/store-maintenance-command-NRATYBWD.js +0 -60
  151. package/dist/bundle/tokens-XUKLM3SL.js +0 -103
  152. /package/dist/bundle/{chunk-LU3WKZBA.js → chunk-ZQ3GWKDQ.js} +0 -0
@@ -9,18 +9,18 @@ import {
9
9
  providerErrorKey,
10
10
  renderEvent,
11
11
  runContextOf
12
- } from "./chunk-BF6TQMNB.js";
12
+ } from "./chunk-VJEOGKAN.js";
13
13
  import {
14
14
  permissionCeiling
15
- } from "./chunk-XGMDWIUP.js";
15
+ } from "./chunk-VKPCONDQ.js";
16
16
  import {
17
17
  envName,
18
18
  readOnlyLockOf,
19
19
  readOnlyRefusal
20
- } from "./chunk-ECEYAQGN.js";
20
+ } from "./chunk-ZM5J6ZMB.js";
21
21
  import {
22
22
  carries
23
- } from "./chunk-WIU733D2.js";
23
+ } from "./chunk-534OBX5Y.js";
24
24
  import {
25
25
  CEILING_KEY,
26
26
  COMMAND_PATH_KEY,
@@ -62,42 +62,39 @@ import {
62
62
  typedCommand,
63
63
  useAsProcessRun,
64
64
  withWriteScope
65
- } from "./chunk-6DN4VPA7.js";
65
+ } from "./chunk-6MQSQ4LX.js";
66
66
  import {
67
- isCliFailure
68
- } from "./chunk-BCWUDTYQ.js";
69
- import {
70
- author,
71
- count,
72
- evidenceSource,
73
- id,
74
- note,
75
- organization,
76
- project,
77
- providerMetadata,
78
- reminder,
79
- text,
80
- time,
81
- untrusted
82
- } from "./chunk-W767AUNR.js";
67
+ note
68
+ } from "./chunk-TF23BZW5.js";
83
69
  import {
70
+ DEAL_ROLES,
84
71
  FACT_STATUSES,
85
72
  FACT_TYPES,
73
+ INVOICE_DIRECTIONS,
86
74
  LINK_KINDS,
87
75
  LINK_SOURCES,
88
76
  MEETING_RESULT_ENTITIES,
89
77
  MEMORY_KINDS,
90
78
  MEMORY_SCOPES,
91
79
  MEMORY_STATUSES,
80
+ MONEY_DIRECTIONS,
81
+ ORDER_PURPOSES,
82
+ ORDER_STATUSES,
92
83
  PRIORITY_LABELS,
93
84
  RELATION_KINDS,
85
+ STANDINGS,
94
86
  TASK_KINDS,
95
87
  TASK_ORIGINS,
96
88
  TASK_STATES,
97
89
  TASK_TYPES,
98
90
  TASK_VERDICTS,
99
91
  WORK_TASK_TYPES,
92
+ author,
93
+ count,
100
94
  event,
95
+ evidenceSource,
96
+ id,
97
+ markStoreDamaged,
101
98
  meeting,
102
99
  meetingCounts,
103
100
  meetingDetails,
@@ -110,19 +107,30 @@ import {
110
107
  meetingSpeaker,
111
108
  meetingStats,
112
109
  meetingSummary,
113
- meetingTranscript
114
- } from "./chunk-K7LS3NGM.js";
110
+ meetingTranscript,
111
+ organization,
112
+ project,
113
+ providerMetadata,
114
+ reminder,
115
+ text,
116
+ time,
117
+ untrusted
118
+ } from "./chunk-V3NVXIQR.js";
115
119
  import {
116
120
  FIELD_TYPES,
117
121
  QUERY_BACKENDS,
118
122
  describeQuery
119
- } from "./chunk-NZ2EIZLX.js";
123
+ } from "./chunk-EOOGWUTP.js";
124
+ import {
125
+ isCliFailure,
126
+ storeDamaged
127
+ } from "./chunk-E4SDKMBJ.js";
120
128
  import {
121
129
  sharedConfigPath
122
- } from "./chunk-X2CXW4HM.js";
130
+ } from "./chunk-ABYGSJZ4.js";
123
131
  import {
124
132
  storePath
125
- } from "./chunk-I26VL4W7.js";
133
+ } from "./chunk-AEX37ETW.js";
126
134
  import {
127
135
  configFilePath,
128
136
  createRecordLog,
@@ -133,19 +141,19 @@ import {
133
141
  resolvePaths,
134
142
  saveConfigFile,
135
143
  writeSecurely
136
- } from "./chunk-DCBFNBEB.js";
144
+ } from "./chunk-OD4U7GUY.js";
137
145
  import {
138
146
  EXIT_CODES,
139
147
  GENERIC_FAILURE,
140
148
  exitCodeOfAnswer
141
- } from "./chunk-J4HQVHMN.js";
149
+ } from "./chunk-UQLWMGSD.js";
142
150
  import {
143
151
  singleLine,
144
152
  visibleControls
145
- } from "./chunk-6IBM4Z3V.js";
153
+ } from "./chunk-2HF2MRXI.js";
146
154
  import {
147
155
  defineLogEvents
148
- } from "./chunk-OFFA54TW.js";
156
+ } from "./chunk-6EY46GAN.js";
149
157
  import {
150
158
  COMPACT_FLAG,
151
159
  MAX_NEXT_STEPS,
@@ -196,15 +204,15 @@ import {
196
204
  unwrap,
197
205
  variant,
198
206
  writes
199
- } from "./chunk-VYXVPYA3.js";
207
+ } from "./chunk-FEZF3TII.js";
200
208
  import {
201
209
  CliError
202
- } from "./chunk-WZ5XK74U.js";
210
+ } from "./chunk-4OSSOWDM.js";
203
211
  import {
204
212
  __name
205
213
  } from "./chunk-ZVVMGPBJ.js";
206
214
 
207
- // node_modules/.pnpm/@wirecat+cli-base@0.77.1_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
215
+ // 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
208
216
  var labels = /* @__PURE__ */ new WeakMap();
209
217
  var annotate = /* @__PURE__ */ __name((command, meta) => {
210
218
  labels.set(command, { ...labels.get(command), ...meta });
@@ -3705,7 +3713,7 @@ __name(useColor, "useColor");
3705
3713
  // node_modules/.pnpm/commander@15.0.0/node_modules/commander/index.js
3706
3714
  var program = new Command();
3707
3715
 
3708
- // node_modules/.pnpm/@wirecat+cli-base@0.77.1_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
3716
+ // 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
3709
3717
  import { isDeepStrictEqual } from "node:util";
3710
3718
  var protectedCommands = /* @__PURE__ */ new WeakMap();
3711
3719
  var hasSharedContract = /* @__PURE__ */ __name((command) => protectedCommands.has(command), "hasSharedContract");
@@ -3891,8 +3899,8 @@ var customizeSharedCommand = /* @__PURE__ */ __name((reference2, reason, build,
3891
3899
  }
3892
3900
  }, "adopt");
3893
3901
  adopt(reference2, command);
3894
- const ordered = /* @__PURE__ */ __name((records) => [...records].sort((a, b) => JSON.stringify([a.command, a.field]).localeCompare(JSON.stringify([b.command, b.field]))), "ordered");
3895
- if (!Array.isArray(expectedOverrides) || !same(ordered(edits), ordered(expectedOverrides)))
3902
+ const ordered2 = /* @__PURE__ */ __name((records) => [...records].sort((a, b) => JSON.stringify([a.command, a.field]).localeCompare(JSON.stringify([b.command, b.field]))), "ordered");
3903
+ if (!Array.isArray(expectedOverrides) || !same(ordered2(edits), ordered2(expectedOverrides)))
3896
3904
  throw new CliError("configuration_error", `provider shell ${command.name()} differs from its reviewed shared contract overrides; review Core and provider definitions before updating the explicit declarations`, { reason: "contract.unacknowledged-override", expected: expectedOverrides ?? null, actual: edits });
3897
3905
  for (const { command: own, record: record2 } of pending) {
3898
3906
  protectedCommands.set(own, record2);
@@ -3907,7 +3915,7 @@ var customizeSharedCommand = /* @__PURE__ */ __name((reference2, reason, build,
3907
3915
  return command;
3908
3916
  }, "customizeSharedCommand");
3909
3917
 
3910
- // node_modules/.pnpm/@wirecat+cli-base@0.77.1_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
3918
+ // 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
3911
3919
  var argumentInfoSchema = object({
3912
3920
  name: string(),
3913
3921
  required: boolean(),
@@ -3990,7 +3998,7 @@ var commandsDocument = /* @__PURE__ */ __name((root, about) => ({
3990
3998
  exit_codes: { ok: 0, internal_error: GENERIC_FAILURE, ...EXIT_CODES }
3991
3999
  }), "commandsDocument");
3992
4000
 
3993
- // node_modules/.pnpm/@wirecat+cli-base@0.77.1_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
4001
+ // 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
3994
4002
  var refuseJoinedPath = /* @__PURE__ */ __name((root, args, prefix = []) => {
3995
4003
  let command = root;
3996
4004
  const path2 = [];
@@ -4008,7 +4016,7 @@ var refuseJoinedPath = /* @__PURE__ */ __name((root, args, prefix = []) => {
4008
4016
  }
4009
4017
  }, "refuseJoinedPath");
4010
4018
 
4011
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/result-fields.js
4019
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/cli/result-fields.js
4012
4020
  var named = /* @__PURE__ */ __name((work) => {
4013
4021
  try {
4014
4022
  return work();
@@ -4035,7 +4043,7 @@ var projectFields2 = /* @__PURE__ */ __name((value, fields) => named(() => {
4035
4043
  return projectFields(value, fields);
4036
4044
  }), "projectFields");
4037
4045
 
4038
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/execution.js
4046
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/cli/execution.js
4039
4047
  var DEFAULT_COMMAND_MS = 3e4;
4040
4048
  var DEFAULT_COOPERATIVE_MS = 5 * 6e4;
4041
4049
  var DEFAULT_SYNC_MS = 15 * 6e4;
@@ -4218,7 +4226,7 @@ var withAbort = /* @__PURE__ */ __name(async (signal, body) => {
4218
4226
  }
4219
4227
  }, "withAbort");
4220
4228
 
4221
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/profile.js
4229
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/cli/profile.js
4222
4230
  var asFirstWord = /* @__PURE__ */ __name((profile) => `${profile} `, "asFirstWord");
4223
4231
  var PLAIN_NAME = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
4224
4232
  var isProfileName = /* @__PURE__ */ __name((word) => PLAIN_NAME.test(word), "isProfileName");
@@ -4287,7 +4295,7 @@ var sampleCommand = /* @__PURE__ */ __name((commands) => {
4287
4295
  return void 0;
4288
4296
  }, "sampleCommand");
4289
4297
 
4290
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/messenger/accounts.js
4298
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/cli/messenger/accounts.js
4291
4299
  import { existsSync, readdirSync, readFileSync } from "node:fs";
4292
4300
  import { join } from "node:path";
4293
4301
  var accountFileFor = /* @__PURE__ */ __name((app, profile, env) => join(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "accounts", `${profile}.json`), "accountFileFor");
@@ -4309,7 +4317,7 @@ var profilesWithAccounts = /* @__PURE__ */ __name((app, env) => {
4309
4317
  }, "profilesWithAccounts");
4310
4318
  var profilesHere = /* @__PURE__ */ __name((app, configured, env) => [.../* @__PURE__ */ new Set([...configured, ...profilesWithAccounts(app, env)])].sort(), "profilesHere");
4311
4319
 
4312
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/output-detail.js
4320
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/output-detail.js
4313
4321
  var RARELY_SET = ["editedAt", "replyTo", "forwardedFrom", "reactions"];
4314
4322
  var BRIEF = ["locator", "chatTitle", "timestamp", "senderName", "excerpt", "score"];
4315
4323
  var SNAKE_BRIEF = ["ref", "chat_title", "timestamp", "sender_name", "excerpt", "score"];
@@ -4345,7 +4353,7 @@ var atDetail = /* @__PURE__ */ __name((value, detail = "default") => {
4345
4353
  return value;
4346
4354
  }, "atDetail");
4347
4355
 
4348
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/output.js
4356
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/output.js
4349
4357
  var refuseCompact = /* @__PURE__ */ __name(({ json, jsonl, fields, hitDetail }) => {
4350
4358
  const other = jsonl ? "--jsonl" : fields !== void 0 ? "--json=\u2026" : json ? "--json" : hitDetail === "brief" ? "--brief" : "";
4351
4359
  if (other)
@@ -4409,7 +4417,7 @@ var silence = /* @__PURE__ */ __name((renderer) => ({
4409
4417
  }, "warn")
4410
4418
  }), "silence");
4411
4419
 
4412
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/runs/log-events.js
4420
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/runs/log-events.js
4413
4421
  var CORE_LOG_EVENTS = defineLogEvents([
4414
4422
  { id: "provider.request", meaning: "a request went to the messenger", keys: ["operation"] },
4415
4423
  { id: "provider.response", meaning: "the messenger answered the request, or it failed", keys: ["operation"] },
@@ -4443,7 +4451,7 @@ var DIAGNOSTIC_LOG_EVENTS = {
4443
4451
  cache: "cache.answered"
4444
4452
  };
4445
4453
 
4446
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/runs/recording.js
4454
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/runs/recording.js
4447
4455
  var recorded = /* @__PURE__ */ __name(async (options, body) => {
4448
4456
  const recording = startRecording(options);
4449
4457
  try {
@@ -4534,7 +4542,14 @@ var startRecording = /* @__PURE__ */ __name((options) => {
4534
4542
  ...partial2 ? { partial: partial2 } : {}
4535
4543
  });
4536
4544
  }, "succeed"),
4537
- fail: /* @__PURE__ */ __name(async (error) => {
4545
+ fail: /* @__PURE__ */ __name(async (thrown) => {
4546
+ const error = storeDamaged(thrown);
4547
+ markStoreDamaged(thrown, {
4548
+ store: storePath(options.env),
4549
+ command: `${options.app.command} ${options.command}`,
4550
+ version: options.app.version,
4551
+ runId
4552
+ });
4538
4553
  const failed = run ?? (held ? keep(open({ startedAt })) : void 0);
4539
4554
  if (failed) {
4540
4555
  if (!isCliFailure(error))
@@ -4549,8 +4564,8 @@ var startRecording = /* @__PURE__ */ __name((options) => {
4549
4564
  ...run ? {} : { keptBecauseFailed: true }
4550
4565
  });
4551
4566
  }
4552
- if (typeof error === "object" && error !== null)
4553
- settled.add(error);
4567
+ if (typeof thrown === "object" && thrown !== null)
4568
+ settled.add(thrown);
4554
4569
  }, "fail")
4555
4570
  };
4556
4571
  }, "startRecording");
@@ -4628,7 +4643,7 @@ var partialOutcome = /* @__PURE__ */ __name((answer) => {
4628
4643
  return void 0;
4629
4644
  }, "partialOutcome");
4630
4645
 
4631
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/deadline.js
4646
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/cli/deadline.js
4632
4647
  var withDeadline = /* @__PURE__ */ __name(async (ms2, closeables, body) => {
4633
4648
  if (ms2 === void 0)
4634
4649
  return body();
@@ -4654,10 +4669,10 @@ var withDeadline = /* @__PURE__ */ __name(async (ms2, closeables, body) => {
4654
4669
  }
4655
4670
  }, "withDeadline");
4656
4671
 
4657
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/settings.js
4658
- import { existsSync as existsSync3 } from "node:fs";
4672
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/cli/settings.js
4673
+ import { existsSync as existsSync4 } from "node:fs";
4659
4674
 
4660
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/models/endpoint.js
4675
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/models/endpoint.js
4661
4676
  var endpoint = /* @__PURE__ */ __name((value) => {
4662
4677
  try {
4663
4678
  const url2 = new URL(value);
@@ -4667,7 +4682,7 @@ var endpoint = /* @__PURE__ */ __name((value) => {
4667
4682
  }
4668
4683
  }, "endpoint");
4669
4684
 
4670
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/models/settings.js
4685
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/models/settings.js
4671
4686
  var MODEL_FIELDS = ["provider", "model", "base_url"];
4672
4687
  var modelSettingsShape = record(pipe(string(), regex(/^[a-z][a-z0-9-]*$/)), strictObject({
4673
4688
  provider: optional(picklist(["off", "openai", "anthropic"])),
@@ -4736,7 +4751,7 @@ var modelTarget = /* @__PURE__ */ __name((settings, purpose) => {
4736
4751
  };
4737
4752
  }, "modelTarget");
4738
4753
 
4739
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/analysis/settings.js
4754
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/analysis/settings.js
4740
4755
  var model = pipe(string(), trim(), minLength(1), maxLength(200));
4741
4756
  var url = pipe(string(), check(endpoint, "use an HTTP/S endpoint without credentials, query or fragment"));
4742
4757
  var AI_FIELDS = {
@@ -4780,10 +4795,99 @@ var resolveAISettings = /* @__PURE__ */ __name((prefix, layers, env) => {
4780
4795
  };
4781
4796
  }, "resolveAISettings");
4782
4797
 
4783
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/config-issues.js
4784
- import { readFileSync as readFileSync2 } from "node:fs";
4798
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/cli/bot/registry.js
4799
+ import { existsSync as existsSync2, readdirSync as readdirSync2, readFileSync as readFileSync2 } from "node:fs";
4800
+ import { join as join2 } from "node:path";
4801
+ var botsDirectory = /* @__PURE__ */ __name((app, env = process.env) => join2(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "bots"), "botsDirectory");
4802
+ var botFiles = /* @__PURE__ */ __name((app, profile, env = process.env) => {
4803
+ const directory = botsDirectory(app, env);
4804
+ return {
4805
+ registry: join2(directory, `${profile}.json`),
4806
+ recipients: join2(directory, "recipients", `${profile}.json`),
4807
+ journal: join2(directory, "sends", `${profile}.jsonl`),
4808
+ updates: join2(directory, "updates", `${profile}.json`),
4809
+ presses: join2(directory, "presses", `${profile}.json`),
4810
+ checks: join2(directory, "checks", `${profile}.json`)
4811
+ };
4812
+ }, "botFiles");
4813
+ var ChatRegistry = class {
4814
+ static {
4815
+ __name(this, "ChatRegistry");
4816
+ }
4817
+ #path;
4818
+ constructor(app, profile, env = process.env) {
4819
+ this.#path = botFiles(app, profile, env).registry;
4820
+ }
4821
+ list(filter = {}) {
4822
+ const { chats } = this.#read();
4823
+ return (Array.isArray(chats) ? chats : []).filter((chat2) => (filter.id === void 0 || chat2.id === filter.id) && (filter.kind === void 0 || chat2.kind === filter.kind) && (filter.title === void 0 || chat2.title?.toLocaleLowerCase() === filter.title?.toLocaleLowerCase()));
4824
+ }
4825
+ /** The bot's own user id, once any command has learned it — the key its messages are stored under. */
4826
+ botId() {
4827
+ const { botId } = this.#read();
4828
+ return typeof botId === "string" ? botId : void 0;
4829
+ }
4830
+ rememberBot(id6) {
4831
+ const file = this.#read();
4832
+ if (file.botId !== id6)
4833
+ this.#write({ ...file, botId: id6 });
4834
+ }
4835
+ /** Makes this bot known to `bot list` before it has seen any chat. */
4836
+ touch() {
4837
+ if (!existsSync2(this.#path))
4838
+ writeSecurely(this.#path, `${JSON.stringify({ chats: [] }, null, 2)}
4839
+ `, 384);
4840
+ }
4841
+ /** Newer facts win; a chat seen only as an id keeps the title it had. */
4842
+ observe(chats, now = /* @__PURE__ */ new Date()) {
4843
+ if (chats.length === 0)
4844
+ return;
4845
+ const byId = new Map(this.list().map((chat2) => [chat2.id, chat2]));
4846
+ const at2 = now.toISOString();
4847
+ for (const chat2 of chats) {
4848
+ const known = byId.get(chat2.id);
4849
+ const defined = Object.fromEntries(Object.entries(chat2).filter(([, value]) => value !== void 0 && value !== null));
4850
+ byId.set(chat2.id, {
4851
+ title: null,
4852
+ kind: "unknown",
4853
+ unreadCount: null,
4854
+ lastMessageAt: null,
4855
+ participantsCount: null,
4856
+ ...known,
4857
+ ...defined,
4858
+ id: chat2.id,
4859
+ firstSeenAt: known?.firstSeenAt ?? at2,
4860
+ lastSeenAt: at2
4861
+ });
4862
+ }
4863
+ this.#write({ ...this.#read(), chats: [...byId.values()] });
4864
+ }
4865
+ #read() {
4866
+ if (!existsSync2(this.#path))
4867
+ return {};
4868
+ try {
4869
+ const parsed = JSON.parse(readFileSync2(this.#path, "utf8"));
4870
+ return parsed && typeof parsed === "object" ? parsed : {};
4871
+ } catch {
4872
+ return {};
4873
+ }
4874
+ }
4875
+ #write(file) {
4876
+ writeSecurely(this.#path, `${JSON.stringify(file, null, 2)}
4877
+ `, 384);
4878
+ }
4879
+ };
4880
+ var registryProfiles = /* @__PURE__ */ __name((app, env = process.env) => {
4881
+ const directory = botsDirectory(app, env);
4882
+ if (!existsSync2(directory))
4883
+ return [];
4884
+ return readdirSync2(directory, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".json")).map((entry) => entry.name).map((name) => name.slice(0, -".json".length));
4885
+ }, "registryProfiles");
4886
+
4887
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/cli/config-issues.js
4888
+ import { readFileSync as readFileSync3 } from "node:fs";
4785
4889
 
4786
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/config-repair.js
4890
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/cli/config-repair.js
4787
4891
  var REPAIR_WORDS = {
4788
4892
  byte_order_mark: "an invisible byte-order mark at the start",
4789
4893
  comment: "a comment, which JSON does not allow",
@@ -5024,7 +5128,7 @@ ${parts.join(",\n")}
5024
5128
  ${indent}${close}`;
5025
5129
  }, "serialise");
5026
5130
 
5027
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/config-issues.js
5131
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/cli/config-issues.js
5028
5132
  var isNode = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value), "isNode");
5029
5133
  var SECTIONS = ["personal", "bot"];
5030
5134
  var SHELL_SAFE = /^[A-Za-z0-9_.:@-]*$/;
@@ -5298,7 +5402,7 @@ var checkConfigText = /* @__PURE__ */ __name((text5, { file, tool, schema: schem
5298
5402
  var wholeFile = /* @__PURE__ */ __name((file, what) => ({ kind: "invalid_value", file, what }), "wholeFile");
5299
5403
  var readConfigText = /* @__PURE__ */ __name((path2) => {
5300
5404
  try {
5301
- return { text: readFileSync2(path2, "utf8") };
5405
+ return { text: readFileSync3(path2, "utf8") };
5302
5406
  } catch (error) {
5303
5407
  const code = error.code;
5304
5408
  if (code === "ENOENT")
@@ -5318,20 +5422,20 @@ var readConfigFile = /* @__PURE__ */ __name((path2) => {
5318
5422
  return "issue" in parsed ? { issue: publicIssue(parsed.issue) } : parsed;
5319
5423
  }, "readConfigFile");
5320
5424
 
5321
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/default-config.js
5322
- import { existsSync as existsSync2, linkSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
5323
- import { dirname, join as join2 } from "node:path";
5425
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/cli/default-config.js
5426
+ import { existsSync as existsSync3, linkSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
5427
+ import { dirname, join as join3 } from "node:path";
5324
5428
  var DEFAULT_CONFIG = {
5325
5429
  defaults: { limit: 20, keep_runs_for_days: 30, sends_per_hour: 30, update_check: true, skill_hint: true },
5326
5430
  profiles: {}
5327
5431
  };
5328
5432
  function ensureDefaultConfig(path2, config = DEFAULT_CONFIG) {
5329
- if (existsSync2(path2))
5433
+ if (existsSync3(path2))
5330
5434
  return;
5331
5435
  const directory = dirname(path2);
5332
5436
  mkdirSync(directory, { recursive: true, mode: 448 });
5333
- const temporary = mkdtempSync(join2(directory, ".config-"));
5334
- const candidate = join2(temporary, "config.json");
5437
+ const temporary = mkdtempSync(join3(directory, ".config-"));
5438
+ const candidate = join3(temporary, "config.json");
5335
5439
  try {
5336
5440
  writeFileSync(candidate, `${JSON.stringify(config, null, 2)}
5337
5441
  `, { flag: "wx", mode: 384 });
@@ -5347,7 +5451,7 @@ function ensureDefaultConfig(path2, config = DEFAULT_CONFIG) {
5347
5451
  }
5348
5452
  __name(ensureDefaultConfig, "ensureDefaultConfig");
5349
5453
 
5350
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/setting-defaults.js
5454
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/cli/setting-defaults.js
5351
5455
  var isNode2 = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value), "isNode");
5352
5456
  var parentOf = /* @__PURE__ */ __name((config, key) => {
5353
5457
  const path2 = key.split(".");
@@ -5380,7 +5484,7 @@ var settingRows = /* @__PURE__ */ __name((raw, declared) => declared.map((settin
5380
5484
  };
5381
5485
  }), "settingRows");
5382
5486
 
5383
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/settings.js
5487
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/cli/settings.js
5384
5488
  var DEFAULT_LIMIT = DEFAULT_CONFIG.defaults.limit;
5385
5489
  var DEFAULT_KEEP_RUNS_FOR_DAYS = DEFAULT_CONFIG.defaults.keep_runs_for_days;
5386
5490
  var DEFAULT_SENDS_PER_HOUR = DEFAULT_CONFIG.defaults.sends_per_hour;
@@ -5606,6 +5710,15 @@ var settingsFor = /* @__PURE__ */ __name((app, extension = {}) => {
5606
5710
  throw new CliError("validation_error", `name a profile: \`${app.command} <profile> \u2026\` \u2014 profiles here: ${here.join(", ")} (or set ${PROFILE})`, { profiles: here });
5607
5711
  }, "unnamed");
5608
5712
  const profilesOf = /* @__PURE__ */ __name((config, env) => profilesHere(app, [...namedProfiles(config), ...extension.profiles?.(env) ?? []], env), "profilesOf");
5713
+ const botsOf = /* @__PURE__ */ __name((config, env) => [.../* @__PURE__ */ new Set([...Object.keys(config.bot?.profiles ?? {}), ...registryProfiles(app, env)])].sort(), "botsOf");
5714
+ const accountsOf = /* @__PURE__ */ __name((config, env, bots) => {
5715
+ const personal = /* @__PURE__ */ new Set([
5716
+ ...Object.keys(config.personal?.profiles ?? {}),
5717
+ ...profilesWithAccounts(app, env),
5718
+ ...extension.profiles?.(env) ?? []
5719
+ ]);
5720
+ return profilesOf(config, env).filter((name) => !bots.includes(name) || personal.has(name));
5721
+ }, "accountsOf");
5609
5722
  const resolveSettings = /* @__PURE__ */ __name((flags = {}, options = {}) => {
5610
5723
  const env = options.env ?? process.env;
5611
5724
  const configPath = configPathFor(options);
@@ -5627,6 +5740,7 @@ var settingsFor = /* @__PURE__ */ __name((app, extension = {}) => {
5627
5740
  ], void 0);
5628
5741
  const profile = locked(named3.value === void 0 ? unnamed(config, env, options.needsProfile !== false) : { value: named3.value, from: named3.from }, lock);
5629
5742
  const kind2 = options.kind ?? "personal";
5743
+ const bots = botsOf(config, env);
5630
5744
  const name = usableProfileName(profile.value);
5631
5745
  const configured = config.profiles[name] ?? {};
5632
5746
  const shared = config.defaults ?? {};
@@ -5718,9 +5832,11 @@ var settingsFor = /* @__PURE__ */ __name((app, extension = {}) => {
5718
5832
  updateCheck: updateCheck.value,
5719
5833
  skillHint: skillHint.value,
5720
5834
  configPath,
5721
- configFound: existsSync3(configPath),
5835
+ configFound: existsSync4(configPath),
5722
5836
  configuredProfiles: namedProfiles(config),
5723
5837
  profilesHere: profilesOf(config, env),
5838
+ accountProfiles: accountsOf(config, env, bots),
5839
+ botProfiles: bots,
5724
5840
  sources: {
5725
5841
  ...ai.sources,
5726
5842
  profile: profile.from,
@@ -5803,10 +5919,20 @@ var settingsFor = /* @__PURE__ */ __name((app, extension = {}) => {
5803
5919
  if (kind2 !== "bot" && botOnlyKeys.includes(setting2)) {
5804
5920
  throw new CliError("validation_error", `${setting2} is a bot's setting \u2014 add --bot`);
5805
5921
  }
5806
- const changed = structuredClone(raw);
5807
- setAt(changed, at2, level2 === void 0 ? parseValue(value) : value.trim());
5808
5922
  const had = new Set(before.map((issue) => issue.at.join(".")));
5809
- const added = schemaIssues(changed, readSchema, context2(path2)).find((issue) => !had.has(issue.at.join(".")) || issue.at.join(".") === at2.join("."));
5923
+ const tried = /* @__PURE__ */ __name((typed2) => {
5924
+ const changed2 = structuredClone(raw);
5925
+ setAt(changed2, at2, typed2);
5926
+ const added2 = schemaIssues(changed2, readSchema, context2(path2)).find((issue) => !had.has(issue.at.join(".")) || issue.at.join(".") === at2.join("."));
5927
+ return { changed: changed2, added: added2 };
5928
+ }, "tried");
5929
+ const parsed = level2 === void 0 ? parseValue(value) : value.trim();
5930
+ let { changed, added } = tried(parsed);
5931
+ if (added && typeof parsed !== "string") {
5932
+ const asText = tried(value.trim());
5933
+ if (!asText.added)
5934
+ ({ changed, added } = asText);
5935
+ }
5810
5936
  if (added)
5811
5937
  throw new CliError("validation_error", `${setting2} cannot be "${value}": ${added.what}`);
5812
5938
  const checked = safeParse(readSchema, changed);
@@ -5868,7 +5994,7 @@ var given = /* @__PURE__ */ __name((value) => {
5868
5994
  return trimmed === void 0 || trimmed === "" ? void 0 : trimmed;
5869
5995
  }, "given");
5870
5996
 
5871
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/context.js
5997
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/cli/context.js
5872
5998
  var setExitCode = /* @__PURE__ */ __name((command, code) => {
5873
5999
  const slot = environmentOf(command).exit;
5874
6000
  if (slot)
@@ -5881,6 +6007,10 @@ var provide = /* @__PURE__ */ __name((program2, environment) => {
5881
6007
  environments.set(program2, environment);
5882
6008
  }, "provide");
5883
6009
  var environmentOf = /* @__PURE__ */ __name((command) => environments.get(rootOf(command)) ?? {}, "environmentOf");
6010
+ var withAgentLevels = /* @__PURE__ */ __name((command, flags) => {
6011
+ const overrides = environmentOf(command).agent?.overrides ?? [];
6012
+ return overrides.length > 0 ? { ...flags, permission: [...overrides, ...flags.permission ?? []] } : flags;
6013
+ }, "withAgentLevels");
5884
6014
  var secretInputOf = /* @__PURE__ */ __name((command) => {
5885
6015
  const { stdin, stderr } = environmentOf(command);
5886
6016
  return { ...stdin ? { input: stdin } : {}, ...stderr ? { output: stderr } : {} };
@@ -5907,9 +6037,7 @@ var outputFor = /* @__PURE__ */ __name((command) => {
5907
6037
  var baseContext = /* @__PURE__ */ __name((command, resolveSettings) => {
5908
6038
  const environment = environmentOf(command);
5909
6039
  const env = environment.env ?? process.env;
5910
- const flags = command.optsWithGlobals();
5911
- const overrides = environment.agent?.overrides ?? [];
5912
- const settings = resolveSettings(overrides.length > 0 ? { ...flags, permission: [...overrides, ...flags.permission ?? []] } : flags, { env });
6040
+ const settings = resolveSettings(withAgentLevels(command, command.optsWithGlobals()), { env });
5913
6041
  const { renderer, format, color, streams, compact, full } = resolveOutput({
5914
6042
  ...settings,
5915
6043
  env,
@@ -5974,6 +6102,13 @@ var baseContext = /* @__PURE__ */ __name((command, resolveSettings) => {
5974
6102
  }, "track")
5975
6103
  };
5976
6104
  }, "baseContext");
6105
+ var inCommandRun = /* @__PURE__ */ __name((command, body) => {
6106
+ const { resolveSettings } = environmentOf(command);
6107
+ if (!resolveSettings)
6108
+ return body(() => {
6109
+ });
6110
+ return baseContext(command, (flags, options) => resolveSettings(flags, { ...options, needsProfile: false })).run(body);
6111
+ }, "inCommandRun");
5977
6112
  var commandPath = /* @__PURE__ */ __name((command) => {
5978
6113
  const words = [];
5979
6114
  for (let current = command; current?.parent; current = current.parent)
@@ -5981,7 +6116,7 @@ var commandPath = /* @__PURE__ */ __name((command) => {
5981
6116
  return words.join(" ");
5982
6117
  }, "commandPath");
5983
6118
 
5984
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/effects.js
6119
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/cli/effects.js
5985
6120
  var REMOTE_READ = { remote: "read", local: "read" };
5986
6121
  var FETCH = { remote: "read", local: "write" };
5987
6122
  var REMOTE_WRITE = { remote: "write", local: "write" };
@@ -6021,6 +6156,14 @@ var isProposal = /* @__PURE__ */ __name((command) => {
6021
6156
  const path2 = pathOf2(command).join(" ");
6022
6157
  return PROPOSE_COMMANDS.some((listed) => path2 === listed || path2.endsWith(` ${listed}`));
6023
6158
  }, "isProposal");
6159
+ var LOCKED_AUTHORITY_COMMANDS = ["rules add"];
6160
+ var NARROWS = /* @__PURE__ */ new WeakSet();
6161
+ var admittedUnderLock = /* @__PURE__ */ __name((command) => {
6162
+ if (!NARROWS.has(command))
6163
+ return false;
6164
+ const path2 = pathOf2(command).join(" ");
6165
+ return LOCKED_AUTHORITY_COMMANDS.some((listed) => path2 === listed || path2.endsWith(` ${listed}`));
6166
+ }, "admittedUnderLock");
6024
6167
  var STORE_WRITES = /* @__PURE__ */ new WeakSet();
6025
6168
  var changesStore = /* @__PURE__ */ __name((command) => {
6026
6169
  STORE_WRITES.add(command);
@@ -6032,6 +6175,14 @@ var fetchesOnly = /* @__PURE__ */ __name((command) => {
6032
6175
  return effects?.remote === "read" && effects.local === "write" && !STORE_WRITES.has(command) && !changesAuthority(command) && !OTHER_SERVICE.has(command) && !savesFiles(command);
6033
6176
  }, "fetchesOnly");
6034
6177
  var FILE_OPTION = /* @__PURE__ */ new WeakMap();
6178
+ var writesFileOnlyWith = /* @__PURE__ */ __name((command, option) => {
6179
+ const flag2 = command.options.find((one) => one.attributeName() === option);
6180
+ if (!flag2 || optionMetaOf(flag2).mcp !== false)
6181
+ throw new Error(`${command.name()}: writesFileOnlyWith needs --${option} added first, as an owner-only option`);
6182
+ FILE_OPTION.set(command, option);
6183
+ return command;
6184
+ }, "writesFileOnlyWith");
6185
+ var writesNewFileOnlyWith = /* @__PURE__ */ __name((command, option) => destroysNothing(writesFileOnlyWith(command, option)), "writesNewFileOnlyWith");
6035
6186
  var writesFileNow = /* @__PURE__ */ __name((command) => {
6036
6187
  const option = FILE_OPTION.get(command);
6037
6188
  return option === void 0 || command.opts()[option] !== void 0;
@@ -6093,7 +6244,7 @@ var refuseUnderReadOnly = /* @__PURE__ */ __name((command, what) => {
6093
6244
  throw readOnlyRefusal(lock, what);
6094
6245
  }, "refuseUnderReadOnly");
6095
6246
 
6096
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/account.js
6247
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/account.js
6097
6248
  var account = strictObject({
6098
6249
  provider: text,
6099
6250
  id,
@@ -6103,7 +6254,7 @@ var account = strictObject({
6103
6254
  scope: optional(picklist(["personal", "work"]))
6104
6255
  });
6105
6256
 
6106
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/account-session.js
6257
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/account-session.js
6107
6258
  var accountSession = strictObject({
6108
6259
  current: boolean(),
6109
6260
  client: nullable(text),
@@ -6113,7 +6264,7 @@ var accountSession = strictObject({
6113
6264
  created_at: optional(nullable(time))
6114
6265
  });
6115
6266
 
6116
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/account-change.js
6267
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/account-change.js
6117
6268
  var accountChange = strictObject({ operation_id: id, account: omit(account, ["provider", "scope"]) });
6118
6269
  var endedAccountSessions = strictObject({ operation_id: id, sessions: array(accountSession) });
6119
6270
  var audience = picklist(["everyone", "contacts", "nobody"]);
@@ -6131,17 +6282,19 @@ var accountPrivacy = strictObject({
6131
6282
  });
6132
6283
  var accountPrivacyChange = strictObject({ operation_id: id, privacy: accountPrivacy });
6133
6284
 
6134
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/account-profile.js
6285
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/account-profile.js
6135
6286
  var accountProfile = strictObject({
6136
6287
  profile: id,
6137
6288
  current: boolean(),
6138
6289
  account: nullable(id),
6139
6290
  name: nullable(text),
6140
6291
  /** False for a profile with no session on this computer; absent when the messenger does not say. */
6141
- signed_in: optional(boolean())
6292
+ signed_in: optional(boolean()),
6293
+ /** True when the same name is a bot profile too (`<tool> <profile> bot …`); absent otherwise. */
6294
+ bot: optional(literal(true))
6142
6295
  });
6143
6296
 
6144
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/counter-reading.js
6297
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/counter-reading.js
6145
6298
  var milliseconds = pipe(number(), minValue(0));
6146
6299
  var counterReading = strictObject({
6147
6300
  counter: picklist(["views", "reactions", "comments"]),
@@ -6153,7 +6306,7 @@ var counterReading = strictObject({
6153
6306
  });
6154
6307
  var selection = record(string(), unknown());
6155
6308
 
6156
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/admin-report.js
6309
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/admin-report.js
6157
6310
  var adminRow = strictObject({
6158
6311
  ref: reference,
6159
6312
  /** What `stats * evidence` takes: a person id, a stay or a message locator. */
@@ -6206,11 +6359,11 @@ var adminReport = strictObject({
6206
6359
  rows: array(adminRow)
6207
6360
  });
6208
6361
 
6209
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/analysis-consent.js
6362
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/analysis-consent.js
6210
6363
  var analysisConsent = strictObject({ chat: id, provider: text, at: time });
6211
6364
  var analysisConsentRevocation = strictObject({ revoked: boolean() });
6212
6365
 
6213
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/batch-result.js
6366
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/batch-result.js
6214
6367
  var actionableError = objectWithRest({
6215
6368
  code: text,
6216
6369
  message: text,
@@ -6227,7 +6380,7 @@ var batchResult = strictObject({
6227
6380
  max_error_percent: count
6228
6381
  });
6229
6382
 
6230
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/extraction-report.js
6383
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/extraction-report.js
6231
6384
  var extractionItem = strictObject({
6232
6385
  ref: reference,
6233
6386
  attachment: count,
@@ -6260,7 +6413,7 @@ var extractionReport = strictObject({
6260
6413
  cursor: optional(text)
6261
6414
  });
6262
6415
 
6263
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/attachment-results.js
6416
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/attachment-results.js
6264
6417
  var fingerprint = pipe(text, regex(/^[a-f0-9]{64}$/));
6265
6418
  var attachmentBytes = strictObject({
6266
6419
  ref: reference,
@@ -6288,7 +6441,7 @@ var attachmentTextChange = strictObject({
6288
6441
  replaced: nullable(picklist(["extracted", "agent"]))
6289
6442
  });
6290
6443
 
6291
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/chart.js
6444
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/chart.js
6292
6445
  var chart = strictObject({
6293
6446
  version: literal(1),
6294
6447
  kind: picklist(["bar", "line", "grouped-bar"]),
@@ -6303,7 +6456,7 @@ var chart = strictObject({
6303
6456
  file: optional(strictObject({ path: text, format: picklist(["svg", "png"]), width: count, height: count }))
6304
6457
  });
6305
6458
 
6306
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/member.js
6459
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/member.js
6307
6460
  var member = strictObject({
6308
6461
  id,
6309
6462
  name: nullable(text),
@@ -6326,7 +6479,7 @@ var member = strictObject({
6326
6479
  check: optional(record(string(), unknown()))
6327
6480
  });
6328
6481
 
6329
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/chat.js
6482
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/chat.js
6330
6483
  var setting = optional(nullable(boolean()));
6331
6484
  var chat = strictObject({
6332
6485
  ref: reference,
@@ -6367,7 +6520,7 @@ var chat = strictObject({
6367
6520
  members: optional(array(member))
6368
6521
  });
6369
6522
 
6370
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/folder.js
6523
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/folder.js
6371
6524
  var named2 = strictObject({
6372
6525
  id,
6373
6526
  title: nullable(text),
@@ -6390,7 +6543,7 @@ var folder = strictObject({
6390
6543
  excluded_chats: optional(array(named2))
6391
6544
  });
6392
6545
 
6393
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/invite-link.js
6546
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/invite-link.js
6394
6547
  var inviteLink = strictObject({
6395
6548
  link: text,
6396
6549
  /** Who joins by it asks first, and an admin lets them in. */
@@ -6406,7 +6559,7 @@ var inviteLink = strictObject({
6406
6559
  joined_count: optional(count)
6407
6560
  });
6408
6561
 
6409
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/chat-admin.js
6562
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/chat-admin.js
6410
6563
  var operated = { operation_id: id, chat_id: id };
6411
6564
  var group = strictObject({
6412
6565
  ...omit(chat, ["ref", "provider", "account", "invite_link", "members"]).entries,
@@ -6486,7 +6639,7 @@ var chatFolderOrder = strictObject({
6486
6639
  folders: array(strictObject({ id, title: text }))
6487
6640
  });
6488
6641
 
6489
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/chat-change.js
6642
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/chat-change.js
6490
6643
  var operated2 = { operation_id: id, chat_id: id };
6491
6644
  var chatRemoval = strictObject(operated2);
6492
6645
  var chatMuting = strictObject({
@@ -6497,7 +6650,7 @@ var chatArchive = strictObject({ ...operated2, archived: boolean() });
6497
6650
  var chatPin = strictObject({ ...operated2, pinned: boolean() });
6498
6651
  var chatUnread = strictObject({ ...operated2, unread: literal(true) });
6499
6652
 
6500
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/chat-event.js
6653
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/chat-event.js
6501
6654
  var who = strictObject({ id: nullable(id), name: nullable(text), username: optional(nullable(text)) });
6502
6655
  var chatEvent = strictObject({
6503
6656
  chat_id: id,
@@ -6514,7 +6667,7 @@ var chatEvent = strictObject({
6514
6667
  before: optional(strictObject({ name: nullable(text), username: nullable(text) }))
6515
6668
  });
6516
6669
 
6517
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/chat-metadata.js
6670
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/chat-metadata.js
6518
6671
  var chatMetadata = strictObject({
6519
6672
  chat_id: id,
6520
6673
  title: nullable(text),
@@ -6529,7 +6682,7 @@ var chatMetadataRefresh = strictObject({
6529
6682
  has_more: boolean()
6530
6683
  });
6531
6684
 
6532
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/chat-moderation.js
6685
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/chat-moderation.js
6533
6686
  var action = picklist(["report", "delete", "remove"]);
6534
6687
  var level = picklist(["deny", "readonly", "ask", "allow"]);
6535
6688
  var chatRules = strictObject({
@@ -6566,7 +6719,7 @@ var chatModeration = strictObject({
6566
6719
  }))
6567
6720
  });
6568
6721
 
6569
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/chat-stats.js
6722
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/chat-stats.js
6570
6723
  var optionalCount = optional(count);
6571
6724
  var minutes = nullable(number());
6572
6725
  var chatStats = strictObject({
@@ -6640,7 +6793,7 @@ var taskStats = strictObject({
6640
6793
  }))
6641
6794
  });
6642
6795
 
6643
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/chat-tracking.js
6796
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/chat-tracking.js
6644
6797
  var memberCount = strictObject({
6645
6798
  day: pipe(text, isoDate()),
6646
6799
  participants: nullable(count),
@@ -6663,7 +6816,7 @@ var chatTracking = strictObject({
6663
6816
  tracked: boolean()
6664
6817
  });
6665
6818
 
6666
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/contact-read.js
6819
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/contact-read.js
6667
6820
  var contactLookup = strictObject({ id, name: nullable(text), username: nullable(text) });
6668
6821
  var contactSync = strictObject({ added: count, changed: count, known: count });
6669
6822
  var profileFields = {
@@ -6701,7 +6854,7 @@ var profileFields = {
6701
6854
  }))
6702
6855
  };
6703
6856
 
6704
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/contact.js
6857
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/contact.js
6705
6858
  var contact = strictObject({
6706
6859
  ref: reference,
6707
6860
  id,
@@ -6732,7 +6885,7 @@ var contact = strictObject({
6732
6885
  notes: optional(array(strictObject({ id, text, revision: count, created_at: time, updated_at: time })))
6733
6886
  });
6734
6887
 
6735
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/contact-activity.js
6888
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/contact-activity.js
6736
6889
  var linkedIdentity = strictObject({
6737
6890
  provider: text,
6738
6891
  id,
@@ -6740,6 +6893,7 @@ var linkedIdentity = strictObject({
6740
6893
  username: nullable(text),
6741
6894
  is_bot: nullable(boolean()),
6742
6895
  accounts: array(id),
6896
+ seen_in: array(strictObject({ account: id, scope: picklist(["personal", "work"]) })),
6743
6897
  method: text,
6744
6898
  linked_by: text,
6745
6899
  linked_at: time
@@ -6773,7 +6927,7 @@ var contactCheck = strictObject({
6773
6927
  checked_at: time
6774
6928
  });
6775
6929
 
6776
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/message.js
6930
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/message.js
6777
6931
  var quoted = strictObject({
6778
6932
  id,
6779
6933
  sender_id: nullable(id),
@@ -6892,7 +7046,7 @@ var message = strictObject({
6892
7046
  provider_metadata: providerMetadata
6893
7047
  });
6894
7048
 
6895
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/contact-context.js
7049
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/contact-context.js
6896
7050
  var contextPerson = strictObject({ ...linkedPerson.entries, provider: text, id });
6897
7051
  var contextMessage = strictObject({
6898
7052
  locator: reference,
@@ -6926,6 +7080,8 @@ var contextEvent = strictObject({
6926
7080
  });
6927
7081
  var context = strictObject({
6928
7082
  person: contextPerson,
7083
+ /** The accounts read: only those of the scopes the caller may read. */
7084
+ accounts: array(strictObject({ provider: text, account: id, scope: picklist(["personal", "work"]) })),
6929
7085
  shared: array(sharedChat),
6930
7086
  last: strictObject({
6931
7087
  from_them: nullable(contextMessage),
@@ -7090,7 +7246,7 @@ var contactPreparation = strictObject({
7090
7246
  })
7091
7247
  });
7092
7248
 
7093
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/contact-note.js
7249
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/contact-note.js
7094
7250
  var contactNote = strictObject({
7095
7251
  id,
7096
7252
  /** The contact, as a `contact:` reference. */
@@ -7102,13 +7258,13 @@ var contactNote = strictObject({
7102
7258
  updated_at: time
7103
7259
  });
7104
7260
 
7105
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/contact-write.js
7261
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/contact-write.js
7106
7262
  var addressBookPerson = strictObject({ id, name: nullable(text), username: nullable(text) });
7107
7263
  var contactUpdate = strictObject({ operation_id: id, person: addressBookPerson });
7108
7264
  var contactStateChange = strictObject({ operation_id: id, person_id: id });
7109
7265
  var contactImport = strictObject({ operation_id: id, sent: count, recognised: array(addressBookPerson) });
7110
7266
 
7111
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/conversation-preparation.js
7267
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/conversation-preparation.js
7112
7268
  var conversationBuild = strictObject({
7113
7269
  chat: id,
7114
7270
  messages: count,
@@ -7133,7 +7289,7 @@ var catchUpPreparation = strictObject({
7133
7289
  prepared: optional(conversationPreparation)
7134
7290
  });
7135
7291
 
7136
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/conversation-results.js
7292
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/conversation-results.js
7137
7293
  var conversationDetails = union([
7138
7294
  strictObject({ ...conversation.entries, messages: array(message) }),
7139
7295
  message
@@ -7223,7 +7379,7 @@ var conversationHit = strictObject({
7223
7379
  stale: boolean()
7224
7380
  });
7225
7381
 
7226
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/counters.js
7382
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/counters.js
7227
7383
  var counters = strictObject({
7228
7384
  cutoff: time,
7229
7385
  max_age_ms: milliseconds,
@@ -7253,7 +7409,97 @@ var counterRefresh = strictObject({
7253
7409
  complete: optional(boolean())
7254
7410
  });
7255
7411
 
7256
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/document.js
7412
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/deal.js
7413
+ var nullableText = nullable(text);
7414
+ var party = strictObject({ ref: reference, name: nullableText, owner: boolean() });
7415
+ var outcome = picklist(["open", "won", "lost"]);
7416
+ var crmAccount = nullable(strictObject({ provider: text, account: text }));
7417
+ var day = nullable(pipe(string(), regex(/^\d{4}-\d{2}-\d{2}$/)));
7418
+ var deal = strictObject({
7419
+ id,
7420
+ ref: reference,
7421
+ kind: picklist(["deal", "lead"]),
7422
+ title: text,
7423
+ /** One line with the stage, amount and status. */
7424
+ summary: text,
7425
+ pipeline: reference,
7426
+ pipeline_name: text,
7427
+ stage: text,
7428
+ status: outcome,
7429
+ organization: nullable(party),
7430
+ currency: nullableText,
7431
+ amount: nullableText,
7432
+ close_date: day,
7433
+ closed_date: day,
7434
+ closed_reason: nullableText,
7435
+ rank: nullable(number()),
7436
+ /** A lead's deal, once it became one. */
7437
+ deal: nullable(reference),
7438
+ /** The CRM account it is a copy from; `null` for the owner's own. */
7439
+ account: crmAccount,
7440
+ external_id: nullableText,
7441
+ /** A CRM copy's assignee, the identity `<account>/user/<id>`. */
7442
+ assignee: nullableText,
7443
+ /** A CRM copy's own fields by code; a list field's value is its option's label, `option_id` its id. */
7444
+ provider_metadata: record(string(), strictObject({
7445
+ label: nullable(string()),
7446
+ value: unknown(),
7447
+ option_id: optional(union([string(), array(string())]))
7448
+ })),
7449
+ people: array(strictObject({ ...party.entries, role: picklist(DEAL_ROLES) })),
7450
+ author: strictObject({
7451
+ type: picklist(["person", "bot"]),
7452
+ id,
7453
+ name: nullableText,
7454
+ kind: nullable(picklist(["agent", "rule"]))
7455
+ }),
7456
+ model: nullableText,
7457
+ source: text,
7458
+ reason: nullableText,
7459
+ evidence: array(reference),
7460
+ project: nullable(reference),
7461
+ project_name: nullableText,
7462
+ created_at: time,
7463
+ updated_at: time,
7464
+ untrusted
7465
+ });
7466
+ var lead = deal;
7467
+ var pipelineStage = strictObject({
7468
+ name: text,
7469
+ position: count,
7470
+ outcome,
7471
+ external_id: nullableText,
7472
+ /** Open deals or leads in it now. */
7473
+ open: count,
7474
+ /** With a funnel: rows that got this far, and the share of them that reached the next stage. */
7475
+ reached: optional(count),
7476
+ conversion: optional(nullable(number())),
7477
+ /** With a funnel: rows standing in it now, and their sum per currency, never converted. */
7478
+ items: optional(count),
7479
+ amounts: optional(array(strictObject({ amount: text, currency: text, items: count })))
7480
+ });
7481
+ var pipeline = strictObject({
7482
+ id,
7483
+ ref: reference,
7484
+ name: text,
7485
+ kind: picklist(["deal", "lead"]),
7486
+ account: crmAccount,
7487
+ external_id: nullableText,
7488
+ stages: array(pipelineStage),
7489
+ created_at: time,
7490
+ totals: optional(strictObject({ items: count, open: count, won: count, lost: count, win_rate: nullable(number()) })),
7491
+ since: optional(day),
7492
+ untrusted
7493
+ });
7494
+ var stage = strictObject({
7495
+ ...pipelineStage.entries,
7496
+ pipeline: reference,
7497
+ pipeline_name: text,
7498
+ kind: picklist(["deal", "lead"]),
7499
+ untrusted
7500
+ });
7501
+
7502
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/document.js
7257
7503
  var document = strictObject({
7258
7504
  ref: reference,
7259
7505
  id,
@@ -7268,7 +7514,7 @@ var document = strictObject({
7268
7514
  owners: optional(array(text))
7269
7515
  });
7270
7516
 
7271
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/document-link.js
7517
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/document-link.js
7272
7518
  var documentLink = strictObject({
7273
7519
  ref: reference,
7274
7520
  url: text,
@@ -7279,7 +7525,7 @@ var documentLink = strictObject({
7279
7525
  sender: strictObject({ id: nullable(id), name: nullable(text) })
7280
7526
  });
7281
7527
 
7282
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/evidence.js
7528
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/evidence.js
7283
7529
  var evidenceMessage = pick(message, ["ref", "chat_title", "timestamp", "sender_name", "text"]);
7284
7530
  var contribution = strictObject({
7285
7531
  message: evidenceMessage,
@@ -7309,7 +7555,7 @@ var retentionStay = strictObject({
7309
7555
  });
7310
7556
  var evidence = union([contribution, retentionStay]);
7311
7557
 
7312
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/fact.js
7558
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/fact.js
7313
7559
  var fact = strictObject({
7314
7560
  ref: reference,
7315
7561
  id,
@@ -7339,9 +7585,9 @@ var fact = strictObject({
7339
7585
  updated_at: time
7340
7586
  });
7341
7587
 
7342
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/hit.js
7588
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/hit.js
7343
7589
  var hit = strictObject({
7344
- kind: picklist(["message", "mail", "note", "document", "event", "meeting"]),
7590
+ kind: picklist(["message", "mail", "note", "document", "event", "meeting", "deal", "lead"]),
7345
7591
  ref: reference,
7346
7592
  provider: text,
7347
7593
  url: optional(text),
@@ -7377,7 +7623,7 @@ var hit = strictObject({
7377
7623
  untrusted
7378
7624
  });
7379
7625
 
7380
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/identity.js
7626
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/identity.js
7381
7627
  var identity = strictObject({
7382
7628
  ref: reference,
7383
7629
  provider: text,
@@ -7390,7 +7636,7 @@ var identity = strictObject({
7390
7636
  person: optional(nullable(reference))
7391
7637
  });
7392
7638
 
7393
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/image-embedding.js
7639
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/image-embedding.js
7394
7640
  var imageEmbedding = strictObject({
7395
7641
  model: text,
7396
7642
  embedded: count,
@@ -7399,13 +7645,13 @@ var imageEmbedding = strictObject({
7399
7645
  more: boolean()
7400
7646
  });
7401
7647
 
7402
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/backfill-jobs.js
7648
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/backfill-jobs.js
7403
7649
  import { spawn } from "node:child_process";
7404
7650
  import { randomBytes } from "node:crypto";
7405
- import { closeSync, existsSync as existsSync4, mkdirSync as mkdirSync2, openSync, readdirSync as readdirSync2, readFileSync as readFileSync3, realpathSync, rmSync as rmSync2 } from "node:fs";
7406
- import { dirname as dirname2, join as join3 } from "node:path";
7651
+ import { closeSync, existsSync as existsSync5, mkdirSync as mkdirSync2, openSync, readdirSync as readdirSync3, readFileSync as readFileSync4, realpathSync, rmSync as rmSync2 } from "node:fs";
7652
+ import { dirname as dirname2, join as join4 } from "node:path";
7407
7653
 
7408
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/background/checkpoints.js
7654
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/background/checkpoints.js
7409
7655
  var progressOf = /* @__PURE__ */ __name((input) => {
7410
7656
  const total = input.total ?? null;
7411
7657
  const updated = input.updatedAt ?? null;
@@ -7421,7 +7667,7 @@ var progressOf = /* @__PURE__ */ __name((input) => {
7421
7667
  };
7422
7668
  }, "progressOf");
7423
7669
 
7424
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/runs/record-log.js
7670
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/runs/record-log.js
7425
7671
  var recordLogFor = /* @__PURE__ */ __name((to, app, { traceId, command } = {}) => {
7426
7672
  const run = currentRun();
7427
7673
  const trace = traceId ?? run.traceId;
@@ -7435,7 +7681,7 @@ var recordLogFor = /* @__PURE__ */ __name((to, app, { traceId, command } = {}) =
7435
7681
  }));
7436
7682
  }, "recordLogFor");
7437
7683
 
7438
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/backfill-jobs.js
7684
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/backfill-jobs.js
7439
7685
  var JOB_STATES = ["running", "done", "partial", "failed", "cancelled", "died"];
7440
7686
  var spawnDetached = /* @__PURE__ */ __name((argv, env, log) => {
7441
7687
  const out = openSync(log, "a", 384);
@@ -7451,23 +7697,23 @@ var spawnDetached = /* @__PURE__ */ __name((argv, env, log) => {
7451
7697
  closeSync(out);
7452
7698
  }
7453
7699
  }, "spawnDetached");
7454
- var jobsDir = /* @__PURE__ */ __name((app, env) => join3(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "backfill"), "jobsDir");
7455
- var jobPath = /* @__PURE__ */ __name((dir, id6) => join3(dir, `${id6}.json`), "jobPath");
7700
+ var jobsDir = /* @__PURE__ */ __name((app, env) => join4(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "backfill"), "jobsDir");
7701
+ var jobPath = /* @__PURE__ */ __name((dir, id6) => join4(dir, `${id6}.json`), "jobPath");
7456
7702
  var saveJob = /* @__PURE__ */ __name((dir, job2) => {
7457
7703
  mkdirSync2(dir, { recursive: true, mode: 448 });
7458
7704
  writeSecurely(jobPath(dir, job2.id), `${JSON.stringify(job2, null, 2)}
7459
7705
  `, 384);
7460
7706
  }, "saveJob");
7461
7707
  var readJob = /* @__PURE__ */ __name((dir, id6) => {
7462
- if (!/^[\w-]+$/.test(id6) || !existsSync4(jobPath(dir, id6)))
7708
+ if (!/^[\w-]+$/.test(id6) || !existsSync5(jobPath(dir, id6)))
7463
7709
  return void 0;
7464
7710
  try {
7465
- return JSON.parse(readFileSync3(jobPath(dir, id6), "utf8"));
7711
+ return JSON.parse(readFileSync4(jobPath(dir, id6), "utf8"));
7466
7712
  } catch {
7467
7713
  return void 0;
7468
7714
  }
7469
7715
  }, "readJob");
7470
- var recordsPath = /* @__PURE__ */ __name((dir, id6) => join3(dir, `${id6}.jsonl`), "recordsPath");
7716
+ var recordsPath = /* @__PURE__ */ __name((dir, id6) => join4(dir, `${id6}.jsonl`), "recordsPath");
7471
7717
  var tracedJob = /* @__PURE__ */ __name((env) => {
7472
7718
  const trace = childTrace();
7473
7719
  return { env: { ...env, TRACEPARENT: trace.traceparent }, traceId: trace.traceId };
@@ -7485,11 +7731,11 @@ var finishJob = /* @__PURE__ */ __name((app, dir, id6, change) => {
7485
7731
  const job2 = readJob(dir, id6);
7486
7732
  if (!job2)
7487
7733
  return;
7488
- const outcome3 = stateOf(job2);
7734
+ const outcome4 = stateOf(job2);
7489
7735
  recordLogFor(recordsPath(dir, id6), app, job2.traceId ? { traceId: job2.traceId } : {})[job2.error ? "error" : "info"]({
7490
7736
  event: "job.exit",
7491
7737
  job: id6,
7492
- outcome: outcome3,
7738
+ outcome: outcome4,
7493
7739
  ...job2.error ? { errorCode: job2.error.code } : {}
7494
7740
  });
7495
7741
  }, "finishJob");
@@ -7504,7 +7750,7 @@ var removeJob = /* @__PURE__ */ __name((dir, job2) => {
7504
7750
  if (dirname2(job2.log) === dir)
7505
7751
  rmSync2(job2.log, { force: true });
7506
7752
  }, "removeJob");
7507
- var listJobs = /* @__PURE__ */ __name((dir) => existsSync4(dir) ? readdirSync2(dir).filter((name) => name.endsWith(".json")).flatMap((name) => readJob(dir, name.slice(0, -".json".length)) ?? []).sort((a, b) => b.startedAt.localeCompare(a.startedAt)) : [], "listJobs");
7753
+ 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");
7508
7754
  var jobDetails = /* @__PURE__ */ __name((job2) => ({
7509
7755
  job: job2.id,
7510
7756
  profile: job2.profile,
@@ -7570,7 +7816,7 @@ var startArchiveJob = /* @__PURE__ */ __name((app, env, profile, input, spawnJob
7570
7816
  const startedAt = (/* @__PURE__ */ new Date()).toISOString();
7571
7817
  const id6 = `${startedAt.replace(/[-:]/g, "").slice(0, 15)}-${randomBytes(3).toString("hex")}`;
7572
7818
  mkdirSync2(dir, { recursive: true, mode: 448 });
7573
- const log = join3(dir, `${id6}.log`);
7819
+ const log = join4(dir, `${id6}.log`);
7574
7820
  const job2 = {
7575
7821
  id: id6,
7576
7822
  chat: input.chat,
@@ -7590,7 +7836,7 @@ var startArchiveJob = /* @__PURE__ */ __name((app, env, profile, input, spawnJob
7590
7836
  return { job: id6, pid, chat: input.chat, log };
7591
7837
  }, "startArchiveJob");
7592
7838
 
7593
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/job.js
7839
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/job.js
7594
7840
  var problem = strictObject({ code: text, message: text });
7595
7841
  var job = strictObject({
7596
7842
  id,
@@ -7613,7 +7859,7 @@ var job = strictObject({
7613
7859
  error: optional(problem)
7614
7860
  });
7615
7861
 
7616
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/join-request.js
7862
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/join-request.js
7617
7863
  var joinRequest = strictObject({
7618
7864
  person_id: id,
7619
7865
  name: nullable(text),
@@ -7624,7 +7870,7 @@ var joinRequest = strictObject({
7624
7870
  about: optional(text)
7625
7871
  });
7626
7872
 
7627
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/list-results.js
7873
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/list-results.js
7628
7874
  var botProfile = strictObject({
7629
7875
  name: text,
7630
7876
  token: text,
@@ -7655,6 +7901,10 @@ var scheduledJob = strictObject({
7655
7901
  name: text,
7656
7902
  kind: picklist(["command", "agent"]),
7657
7903
  when: text,
7904
+ /** When a finished run shows a desktop notice: `always`, `failures` or `never`; the default is shown, not left out. */
7905
+ notify: optional(picklist(["always", "failures", "never"])),
7906
+ /** Where a run's result is sent after it: `telegram-bot:<profile>/<chat>` or `email:<profile>/<address>`. */
7907
+ deliver_to: optional(array(text)),
7658
7908
  last: nullable(strictObject({
7659
7909
  at: time,
7660
7910
  exit_code: number(),
@@ -7663,8 +7913,29 @@ var scheduledJob = strictObject({
7663
7913
  reason: optional(text),
7664
7914
  error_code: optional(text),
7665
7915
  failing_since: optional(time),
7666
- failures: optional(number())
7667
- }))
7916
+ failures: optional(number()),
7917
+ cost_usd: optional(number()),
7918
+ /** The last time a run did not start, and why: the day's cost cap, or too little new mail. */
7919
+ skipped: optional(strictObject({
7920
+ at: time,
7921
+ why: text,
7922
+ /** A dotted id for `why`, so a client can translate it: `cost.day-cap`, `mail.none-new`, `mail.below-threshold`. */
7923
+ reason: optional(pipe(text, regex(/^[a-z][a-z0-9-]*(\.[a-z][a-z0-9-]*)+$/)))
7924
+ })),
7925
+ /** How the run's result went along each route; `reason` a dotted id, `error` the sending CLI's code and reason id. */
7926
+ deliveries: optional(array(strictObject({
7927
+ to: text,
7928
+ ok: boolean(),
7929
+ reason: optional(pipe(text, regex(/^[a-z][a-z0-9-]*(\.[a-z][a-z0-9-]*)+$/))),
7930
+ error: optional(text)
7931
+ })))
7932
+ })),
7933
+ /** Agent schedules: what today's runs cost, in US dollars. */
7934
+ spent_today_usd: optional(number()),
7935
+ /** Agent schedules: the cap on one run (`--max-cost`), null when none. */
7936
+ max_cost_usd: optional(nullable(number())),
7937
+ /** Agent schedules: the daily cap in force, the schedule's `--max-cost-per-day` or the config's; 0 for none. */
7938
+ max_cost_per_day_usd: optional(number())
7668
7939
  });
7669
7940
  var botTemplate = strictObject({
7670
7941
  name: nullable(text),
@@ -7692,7 +7963,7 @@ var stickerInventory = strictObject({
7692
7963
  url: optional(nullable(text))
7693
7964
  });
7694
7965
 
7695
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/poll-vote.js
7966
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/poll-vote.js
7696
7967
  var pollVote = strictObject({
7697
7968
  person_id: id,
7698
7969
  name: nullable(text),
@@ -7702,7 +7973,7 @@ var pollVote = strictObject({
7702
7973
  voted_at: time
7703
7974
  });
7704
7975
 
7705
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/listener.js
7976
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/listener.js
7706
7977
  var reactions = unwrap(unwrap(message.entries.reactions));
7707
7978
  var observation = strictObject({
7708
7979
  value: pipe(number(), minValue(0)),
@@ -7744,7 +8015,7 @@ var serveSummary = strictObject({
7744
8015
  tasks: optional(strictObject({ added: count, closed: count, review: count }))
7745
8016
  });
7746
8017
 
7747
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/mail-counts.js
8018
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/mail-counts.js
7748
8019
  var mailCounts = strictObject({
7749
8020
  by: picklist(["day", "week", "sender"]),
7750
8021
  received: count,
@@ -7759,7 +8030,7 @@ var mailCounts = strictObject({
7759
8030
  }))
7760
8031
  });
7761
8032
 
7762
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/mail-findings.js
8033
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/mail-findings.js
7763
8034
  var evidence2 = strictObject({ reference, fingerprint: text });
7764
8035
  var base = { id, evidence: array(evidence2) };
7765
8036
  var finding = variant("kind", [
@@ -7774,7 +8045,11 @@ var finding = variant("kind", [
7774
8045
  due_at: optional(time),
7775
8046
  due_evidence: optional(array(reference)),
7776
8047
  assignee: optional(reference),
7777
- assignee_evidence: optional(array(reference))
8048
+ assignee_evidence: optional(array(reference)),
8049
+ /** `<service>:<id>` in the outside service the mail came from, such as `avito:4512345678`. */
8050
+ external_id: optional(text),
8051
+ /** The http or https page the task is about, such as the conversation the mail links to. */
8052
+ source_url: optional(text)
7778
8053
  }),
7779
8054
  strictObject({
7780
8055
  ...base,
@@ -7782,7 +8057,9 @@ var finding = variant("kind", [
7782
8057
  project: optional(reference),
7783
8058
  subject: optional(reference),
7784
8059
  type: picklist(FACT_TYPES),
7785
- statement: text
8060
+ statement: text,
8061
+ /** Every new finding gives one; a batch staged before reason was needed on every kind has none. */
8062
+ reason: optional(text)
7786
8063
  }),
7787
8064
  strictObject({
7788
8065
  ...base,
@@ -7800,12 +8077,84 @@ var finding = variant("kind", [
7800
8077
  scope: picklist(MEMORY_SCOPES),
7801
8078
  body: text,
7802
8079
  subject: optional(reference),
7803
- project: optional(reference)
8080
+ project: optional(reference),
8081
+ reason: optional(text)
7804
8082
  }),
7805
8083
  strictObject({ ...base, kind: literal("link"), from: reference, to: reference, reason: text }),
7806
- strictObject({ ...base, kind: literal("new_contact"), address: text, name: text, reason: optional(text) })
8084
+ strictObject({ ...base, kind: literal("new_contact"), address: text, name: text, reason: optional(text) }),
8085
+ strictObject({
8086
+ ...base,
8087
+ kind: literal("invoice"),
8088
+ direction: picklist(INVOICE_DIRECTIONS),
8089
+ counterparty: optional(reference),
8090
+ /** A counterparty the store may not hold yet; the owner's accept finds its organization or makes one. */
8091
+ counterparty_name: optional(text),
8092
+ counterparty_email: optional(text),
8093
+ currency: text,
8094
+ lines: array(strictObject({
8095
+ description: text,
8096
+ quantity: optional(text),
8097
+ unit_price: optional(text),
8098
+ amount: optional(text)
8099
+ })),
8100
+ total: optional(text),
8101
+ number: optional(text),
8102
+ issue_date: optional(text),
8103
+ due_date: optional(text),
8104
+ project: optional(reference),
8105
+ reason: text
8106
+ }),
8107
+ strictObject({
8108
+ ...base,
8109
+ kind: literal("payment"),
8110
+ direction: picklist(MONEY_DIRECTIONS),
8111
+ payer: optional(reference),
8112
+ payer_name: optional(text),
8113
+ payer_email: optional(text),
8114
+ payee: optional(reference),
8115
+ payee_name: optional(text),
8116
+ payee_email: optional(text),
8117
+ amount: text,
8118
+ currency: text,
8119
+ date: text,
8120
+ reference: optional(text),
8121
+ allocations: optional(array(strictObject({ invoice: reference, amount: text }))),
8122
+ project: optional(reference),
8123
+ reason: text
8124
+ }),
8125
+ strictObject({
8126
+ ...base,
8127
+ kind: literal("order"),
8128
+ purpose: picklist(ORDER_PURPOSES),
8129
+ customer: optional(reference),
8130
+ customer_name: optional(text),
8131
+ customer_email: optional(text),
8132
+ supplier: optional(reference),
8133
+ supplier_name: text,
8134
+ number: optional(text),
8135
+ total: optional(text),
8136
+ currency: optional(text),
8137
+ status: optional(picklist(ORDER_STATUSES)),
8138
+ order_date: optional(text),
8139
+ fulfilled_date: optional(text),
8140
+ invoice: optional(reference),
8141
+ payment: optional(reference),
8142
+ project: optional(reference),
8143
+ /** The order's page at the shop, http or https. */
8144
+ source_url: optional(text),
8145
+ reason: text
8146
+ }),
8147
+ strictObject({
8148
+ ...base,
8149
+ kind: literal("order_update"),
8150
+ supplier_name: text,
8151
+ number: text,
8152
+ status: picklist(ORDER_STATUSES),
8153
+ date: optional(text),
8154
+ reason: text
8155
+ })
7807
8156
  ]);
7808
- var outcome = strictObject({
8157
+ var outcome2 = strictObject({
7809
8158
  id,
7810
8159
  fingerprint: text,
7811
8160
  status: picklist(["accepted", "rejected"]),
@@ -7821,11 +8170,11 @@ var mailFindings = strictObject({
7821
8170
  author,
7822
8171
  decided_by: nullable(strictObject({ type: picklist(["person", "bot"]), id })),
7823
8172
  decided_at: nullable(time),
7824
- previous: array(outcome),
7825
- receipt: nullable(strictObject({ preview_fingerprint: text, accepted: array(id), items: array(outcome) }))
8173
+ previous: array(outcome2),
8174
+ receipt: nullable(strictObject({ preview_fingerprint: text, accepted: array(id), items: array(outcome2) }))
7826
8175
  });
7827
8176
 
7828
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/media-archive.js
8177
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/media-archive.js
7829
8178
  var mediaArchive = strictObject({
7830
8179
  directory: text,
7831
8180
  chats: count,
@@ -7857,7 +8206,7 @@ var mediaArchiveTimer = union([
7857
8206
  strictObject({ ...timer, action: picklist(["install", "start", "stop", "uninstall"]) })
7858
8207
  ]);
7859
8208
 
7860
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/meeting-preparation-parts.js
8209
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/meeting-preparation-parts.js
7861
8210
  var preparationId = pipe(string(), minLength(1));
7862
8211
  var preparationCount = pipe(number(), integer(), minValue(0));
7863
8212
  var preparationTime = nullable(isoTime);
@@ -7949,7 +8298,7 @@ var preparationMeeting = strictObject({
7949
8298
  updated_at: isoTime
7950
8299
  });
7951
8300
 
7952
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/meeting-evidence.js
8301
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/meeting-evidence.js
7953
8302
  var meetingEvidence = preparationEvidence;
7954
8303
  var meetingPersonContext = strictObject({
7955
8304
  person: strictObject({ uid: string(), name: nullable(string()) }),
@@ -7971,7 +8320,7 @@ var meetingPersonContext = strictObject({
7971
8320
  })
7972
8321
  });
7973
8322
 
7974
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/meeting-findings.js
8323
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/meeting-findings.js
7975
8324
  var evidence3 = strictObject({ reference, fingerprint: text });
7976
8325
  var base2 = { id, project: reference, evidence: array(evidence3) };
7977
8326
  var finding2 = variant("kind", [
@@ -7989,7 +8338,7 @@ var finding2 = variant("kind", [
7989
8338
  assignee_evidence: optional(array(reference))
7990
8339
  })
7991
8340
  ]);
7992
- var outcome2 = strictObject({
8341
+ var outcome3 = strictObject({
7993
8342
  id,
7994
8343
  fingerprint: text,
7995
8344
  status: picklist(["accepted", "rejected"]),
@@ -8005,11 +8354,11 @@ var meetingFindings = strictObject({
8005
8354
  author,
8006
8355
  decided_by: nullable(strictObject({ type: picklist(["person", "bot"]), id })),
8007
8356
  decided_at: nullable(time),
8008
- previous: array(outcome2),
8009
- receipt: nullable(strictObject({ preview_fingerprint: text, accepted: array(id), items: array(outcome2) }))
8357
+ previous: array(outcome3),
8358
+ receipt: nullable(strictObject({ preview_fingerprint: text, accepted: array(id), items: array(outcome3) }))
8010
8359
  });
8011
8360
 
8012
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/meeting-communications.js
8361
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/meeting-communications.js
8013
8362
  var communicationCoverage = strictObject({
8014
8363
  read_usage: strictObject({ reads: preparationCount, charged_bytes: preparationCount, reserved_bytes: preparationCount, remaining_bytes: preparationCount }),
8015
8364
  query: string(),
@@ -8054,7 +8403,7 @@ var preparationCommunications = strictObject({
8054
8403
  }))
8055
8404
  });
8056
8405
 
8057
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/meeting-preparation.js
8406
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/meeting-preparation.js
8058
8407
  var meetingPreparation = strictObject({
8059
8408
  communications: optional(preparationCommunications),
8060
8409
  schema_version: literal(1),
@@ -8167,7 +8516,7 @@ var meetingPreparation = strictObject({
8167
8516
  })
8168
8517
  });
8169
8518
 
8170
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/meeting-project-candidates.js
8519
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/meeting-project-candidates.js
8171
8520
  var count4 = pipe(number(), integer(), minValue(0));
8172
8521
  var id3 = pipe(string(), minLength(1));
8173
8522
  var text3 = string();
@@ -8231,7 +8580,7 @@ var meetingProjectCandidates = strictObject({
8231
8580
  })
8232
8581
  });
8233
8582
 
8234
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/meeting-series-inventory.js
8583
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/meeting-series-inventory.js
8235
8584
  var count5 = pipe(number(), integer(), minValue(0));
8236
8585
  var id4 = pipe(string(), minLength(1), maxLength(1e3));
8237
8586
  var meetingSeriesInventory = strictObject({
@@ -8261,7 +8610,7 @@ var meetingSeriesInventory = strictObject({
8261
8610
  })
8262
8611
  });
8263
8612
 
8264
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/meeting-task-proposal.js
8613
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/meeting-task-proposal.js
8265
8614
  var text4 = string();
8266
8615
  var id5 = pipe(number(), integer(), minValue(1));
8267
8616
  var revision = picklist(["current", "superseded"]);
@@ -8278,7 +8627,7 @@ var meetingTaskProposal = strictObject({
8278
8627
  persistence: literal("proposal-only")
8279
8628
  });
8280
8629
 
8281
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/memory.js
8630
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/memory.js
8282
8631
  var memory = strictObject({
8283
8632
  ref: reference,
8284
8633
  id,
@@ -8305,7 +8654,7 @@ var memory = strictObject({
8305
8654
  updated_at: time
8306
8655
  });
8307
8656
 
8308
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/mention.js
8657
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/mention.js
8309
8658
  var kind = picklist(["phone", "email", "url", "document", "person-name", "place"]);
8310
8659
  var status = picklist(["found", "linked", "dismissed"]);
8311
8660
  var mention = strictObject({
@@ -8348,13 +8697,13 @@ var mentionRebuild = strictObject({
8348
8697
  mentions: count
8349
8698
  });
8350
8699
 
8351
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/message-change.js
8700
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/message-change.js
8352
8701
  var operated3 = { operation_id: id, chat_id: id };
8353
8702
  var messagePin = strictObject({ ...operated3, message_id: id, pinned: boolean() });
8354
8703
  var messageStar = strictObject({ ...operated3, message_id: id, starred: boolean() });
8355
8704
  var messageDeletion = strictObject({ ...operated3, deleted: array(id), for_everyone: boolean() });
8356
8705
 
8357
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/message-read.js
8706
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/message-read.js
8358
8707
  var messageTranscript = strictObject({
8359
8708
  message_id: id,
8360
8709
  text,
@@ -8412,7 +8761,7 @@ var evidencePacket = strictObject({
8412
8761
  }))
8413
8762
  });
8414
8763
 
8415
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/message-context.js
8764
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/message-context.js
8416
8765
  var messageThread = strictObject({
8417
8766
  ref: reference,
8418
8767
  chat: id,
@@ -8429,7 +8778,7 @@ var messageThread = strictObject({
8429
8778
  });
8430
8779
  var messageContext = union([message, messageThread]);
8431
8780
 
8432
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/message-counts.js
8781
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/message-counts.js
8433
8782
  var messageCounts = strictObject({
8434
8783
  by: picklist(["chat", "sender", "day", "hour"]),
8435
8784
  total: count,
@@ -8442,7 +8791,7 @@ var messageCounts = strictObject({
8442
8791
  }))
8443
8792
  });
8444
8793
 
8445
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/message-link.js
8794
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/message-link.js
8446
8795
  var messageLink = strictObject({
8447
8796
  ref: reference,
8448
8797
  url: nullable(text),
@@ -8459,7 +8808,7 @@ var messageLink = strictObject({
8459
8808
  })))
8460
8809
  });
8461
8810
 
8462
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/message-transfer.js
8811
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/message-transfer.js
8463
8812
  var savedMessageFile = strictObject({
8464
8813
  kind: text,
8465
8814
  path: text,
@@ -8546,7 +8895,7 @@ var messageSyncAll = strictObject({
8546
8895
  var messageSyncStarted = strictObject({ job: id, pid: count, chat: text, log: text });
8547
8896
  var messageSync = union([messageSyncEstimate, messageSyncChat, messageSyncAll, messageSyncStarted]);
8548
8897
 
8549
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/message-write.js
8898
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/message-write.js
8550
8899
  var messageWrite = strictObject({
8551
8900
  operation_id: id,
8552
8901
  message,
@@ -8561,7 +8910,7 @@ var draftWrite = strictObject({
8561
8910
  });
8562
8911
  var messageSend = union([messageWrite, draftWrite]);
8563
8912
 
8564
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/model.js
8913
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/model.js
8565
8914
  var model2 = strictObject({
8566
8915
  id,
8567
8916
  kind: picklist(["audio", "text", "image", "reranker"]),
@@ -8578,7 +8927,7 @@ var model2 = strictObject({
8578
8927
  path: text
8579
8928
  });
8580
8929
 
8581
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/model-key.js
8930
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/model-key.js
8582
8931
  var source = picklist(["environment", "keyring", "file"]);
8583
8932
  var modelKey = strictObject({
8584
8933
  provider: text,
@@ -8588,7 +8937,7 @@ var modelKey = strictObject({
8588
8937
  var storedModelKey = strictObject({ ...omit(modelKey, ["removed"]).entries, stored: source });
8589
8938
  var removedModelKey = strictObject({ ...omit(modelKey, ["stored"]).entries, removed: array(source) });
8590
8939
 
8591
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/official-stats.js
8940
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/official-stats.js
8592
8941
  var versus = strictObject({ current: number(), previous: number() });
8593
8942
  var person = { person_ref: reference, name: nullable(text) };
8594
8943
  var graph = strictObject({
@@ -8622,14 +8971,14 @@ var officialStats = strictObject({
8622
8971
  graphs: record(string(), union([graph, strictObject({ error: text })]))
8623
8972
  });
8624
8973
 
8625
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/person.js
8974
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/person.js
8626
8975
  var person2 = strictObject({
8627
8976
  ref: reference,
8628
8977
  name: nullable(text),
8629
8978
  identities: optional(array(identity))
8630
8979
  });
8631
8980
 
8632
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/poll.js
8981
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/poll.js
8633
8982
  var poll = strictObject({
8634
8983
  chat_id: id,
8635
8984
  message_id: id,
@@ -8645,11 +8994,11 @@ var poll = strictObject({
8645
8994
  });
8646
8995
  var pollChange = strictObject({ operation_id: id, poll });
8647
8996
 
8648
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/private-contact.js
8997
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/private-contact.js
8649
8998
  var contactAlias = strictObject({ person_id: id, alias: nullable(text) });
8650
8999
  var contactNoteRemoval = strictObject({ id, person_id: id, removed: boolean() });
8651
9000
 
8652
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/ranking.js
9001
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/ranking.js
8653
9002
  var figures = record(string(), number());
8654
9003
  var freshness = picklist(["fresh", "stale", "partial", "unknown"]);
8655
9004
  var rankingRow = strictObject({
@@ -8696,7 +9045,7 @@ var ranking = strictObject({
8696
9045
  rows: array(rankingRow)
8697
9046
  });
8698
9047
 
8699
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/reaction.js
9048
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/reaction.js
8700
9049
  var reaction = strictObject({
8701
9050
  person: strictObject({ id, name: nullable(text), username: nullable(text) }),
8702
9051
  /** The emoji, or `custom:<id>` for a custom one. */
@@ -8704,7 +9053,7 @@ var reaction = strictObject({
8704
9053
  reacted_at: time
8705
9054
  });
8706
9055
 
8707
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/reaction-change.js
9056
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/reaction-change.js
8708
9057
  var reactionChange = strictObject({
8709
9058
  operation_id: id,
8710
9059
  chat_id: id,
@@ -8712,7 +9061,7 @@ var reactionChange = strictObject({
8712
9061
  reaction: nullable(text)
8713
9062
  });
8714
9063
 
8715
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/recipient.js
9064
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/recipient.js
8716
9065
  var recipient = strictObject({ id, title: nullable(text), partner_id: optional(id), added_at: time });
8717
9066
  var recipientAdded = strictObject({ id, title: nullable(text), added: boolean() });
8718
9067
  var recipientRemoved = strictObject({ id, title: nullable(text), removed: boolean() });
@@ -8723,7 +9072,7 @@ var recipientChange = strictObject({
8723
9072
  ...partial(recipientOff).entries
8724
9073
  });
8725
9074
 
8726
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/recorded-run.js
9075
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/recorded-run.js
8727
9076
  var events = array(record(string(), unknown()));
8728
9077
  var recordedRun = strictObject({
8729
9078
  run_id: id,
@@ -8795,7 +9144,7 @@ var runHit = strictObject({
8795
9144
  });
8796
9145
  var runLocation = strictObject({ path: text });
8797
9146
 
8798
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/relationship.js
9147
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/relationship.js
8799
9148
  var relationship = strictObject({
8800
9149
  id,
8801
9150
  from: reference,
@@ -8809,10 +9158,16 @@ var relationship = strictObject({
8809
9158
  confirmed: boolean(),
8810
9159
  provenance: nullable(text),
8811
9160
  confidence_category: picklist(["owner-confirmed", "weak"]),
9161
+ /** `reported`: a CRM account says so and nobody confirmed it; `ended`: it no longer holds. */
9162
+ standing: picklist(STANDINGS),
9163
+ /** A job title beside it, never its role. */
9164
+ position: nullable(text),
9165
+ starts_at: nullable(time),
9166
+ ends_at: nullable(time),
8812
9167
  created_at: time
8813
9168
  });
8814
9169
 
8815
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/reply-stats.js
9170
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/reply-stats.js
8816
9171
  var milliseconds2 = nullable(pipe(number(), minValue(0)));
8817
9172
  var figures2 = { replies: count, median_ms: milliseconds2, p90_ms: milliseconds2, mean_ms: milliseconds2 };
8818
9173
  var responseTimes = strictObject({
@@ -8829,7 +9184,7 @@ var waitingChats = strictObject({
8829
9184
  by_kind: strictObject({ private: count, group: count })
8830
9185
  });
8831
9186
 
8832
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/retention.js
9187
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/retention.js
8833
9188
  var retentionCohort = strictObject({
8834
9189
  /** The first day of the joining day or week. */
8835
9190
  cohort: text,
@@ -8877,7 +9232,7 @@ var retention = strictObject({
8877
9232
  rows: array(retentionCohort)
8878
9233
  });
8879
9234
 
8880
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/saved-search.js
9235
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/saved-search.js
8881
9236
  var savedSearch = strictObject({
8882
9237
  id,
8883
9238
  /** `null` for a run in the history. */
@@ -8894,7 +9249,7 @@ var savedSearch = strictObject({
8894
9249
  });
8895
9250
  var searchHistoryClear = strictObject({ cleared: count });
8896
9251
 
8897
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/send-attempt.js
9252
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/send-attempt.js
8898
9253
  var sendAttempt = strictObject({
8899
9254
  at: time,
8900
9255
  profile: text,
@@ -8922,7 +9277,7 @@ var sendAttempt = strictObject({
8922
9277
  error_code: optional(text)
8923
9278
  });
8924
9279
 
8925
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/store-maintenance.js
9280
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/store-maintenance.js
8926
9281
  var absent = strictObject({ path: text, exists: literal(false) });
8927
9282
  var schema = strictObject({ version: count, min_compatible: count, writable: boolean(), speaks: count });
8928
9283
  var infoSchema = strictObject({
@@ -9077,12 +9432,25 @@ var storeBackup = strictObject({
9077
9432
  encrypted: optional(literal(true))
9078
9433
  });
9079
9434
  var storeDecrypt = strictObject({ path: text, from: text, bytes: count });
9080
- var storeRestore = strictObject({
9081
- path: text,
9082
- restored_from: text,
9083
- kept_at: nullable(text),
9084
- schema: count
9085
- });
9435
+ var storeRestore = union([
9436
+ strictObject({
9437
+ path: text,
9438
+ restored_from: text,
9439
+ kept_at: nullable(text),
9440
+ schema: count
9441
+ }),
9442
+ /** From a rollback copy: its tables put back in place, the store returned to `schema` from `was`. */
9443
+ strictObject({
9444
+ path: text,
9445
+ restored_from: text,
9446
+ rolled_back: literal(true),
9447
+ schema: count,
9448
+ was: count,
9449
+ tables: array(strictObject({ table: text, rows: count })),
9450
+ rebuilt: array(text),
9451
+ foreign_key_violations: count
9452
+ })
9453
+ ]);
9086
9454
  var storeReset = union([
9087
9455
  strictObject({ ...absent.entries, reset: literal(false) }),
9088
9456
  strictObject({
@@ -9130,7 +9498,7 @@ var storeRepair = union([
9130
9498
  ]);
9131
9499
  var storeCopyRemoval = strictObject({ path: text, deleted: strictObject({ name: text, rows: count }) });
9132
9500
 
9133
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/store-records.js
9501
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/store-records.js
9134
9502
  var range = strictObject({ from: number(), to: number() });
9135
9503
  var storeChatStatus = strictObject({
9136
9504
  chat_id: id,
@@ -9228,7 +9596,7 @@ var storeJobRetry = union([
9228
9596
  ]);
9229
9597
  var storeJobClear = strictObject({ cleared: array(id) });
9230
9598
 
9231
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/store-table.js
9599
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/store-table.js
9232
9600
  var TABLE_KINDS = ["data", "search_index", "search_index_part", "internal"];
9233
9601
  var storeTable = strictObject({
9234
9602
  name: text,
@@ -9237,7 +9605,7 @@ var storeTable = strictObject({
9237
9605
  bytes: optional(nullable(count))
9238
9606
  });
9239
9607
 
9240
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/tag-change.js
9608
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/tag-change.js
9241
9609
  var tagTarget = variant("type", [
9242
9610
  strictObject({ type: literal("chat"), chat_id: id }),
9243
9611
  strictObject({ type: literal("contact"), person_id: id }),
@@ -9268,7 +9636,7 @@ var automaticTags = strictObject({
9268
9636
  dry_run: boolean()
9269
9637
  });
9270
9638
 
9271
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/task-pair.js
9639
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/task-pair.js
9272
9640
  var side = strictObject({ ref: reference, key: text, title: text, status: text });
9273
9641
  var taskPair = strictObject({
9274
9642
  task: nullable(side),
@@ -9291,7 +9659,7 @@ var taskPair = strictObject({
9291
9659
  created_at: time
9292
9660
  });
9293
9661
 
9294
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/task-results.js
9662
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/task-results.js
9295
9663
  var nullableTime = nullable(time);
9296
9664
  var link = strictObject({
9297
9665
  id,
@@ -9326,6 +9694,10 @@ var taskCard = strictObject({
9326
9694
  revision: number(),
9327
9695
  parent: nullable(reference),
9328
9696
  source: nullable(text),
9697
+ /** `<service>:<id>`, its id in an outside service, such as `avito:4512345678`. */
9698
+ external_id: nullable(text),
9699
+ /** The http or https page it is about, such as an Avito ad. */
9700
+ source_url: nullable(text),
9329
9701
  due_at: nullableTime,
9330
9702
  next_check_at: nullableTime,
9331
9703
  closed_at: nullableTime,
@@ -9461,7 +9833,7 @@ var taskReview = strictObject({
9461
9833
  untrusted
9462
9834
  });
9463
9835
 
9464
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/topic.js
9836
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/topic.js
9465
9837
  var topic = strictObject({
9466
9838
  id,
9467
9839
  title: text,
@@ -9475,9 +9847,13 @@ var topic = strictObject({
9475
9847
  untrusted
9476
9848
  });
9477
9849
 
9478
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/entities/index.js
9850
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/entities/index.js
9479
9851
  var ENTITIES = {
9480
9852
  sync_progress: progress,
9853
+ deal,
9854
+ lead,
9855
+ pipeline,
9856
+ stage,
9481
9857
  ...MEETING_RESULT_ENTITIES,
9482
9858
  message,
9483
9859
  message_context: messageContext,
@@ -9757,7 +10133,7 @@ var entityDefinitions = /* @__PURE__ */ __name(() => Object.fromEntries(Object.e
9757
10133
  return [name, definition];
9758
10134
  })), "entityDefinitions");
9759
10135
 
9760
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/answer-entity.js
10136
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/cli/answer-entity.js
9761
10137
  var schemas = /* @__PURE__ */ new WeakMap();
9762
10138
  var answerEntity = /* @__PURE__ */ __name((command, name, schema2, options = {}) => {
9763
10139
  if (Object.hasOwn(ENTITIES, name))
@@ -9791,7 +10167,7 @@ var answerRow = /* @__PURE__ */ __name((command) => {
9791
10167
  return own && metaOf(command).output?.entity === own.name ? own.row : void 0;
9792
10168
  }, "answerRow");
9793
10169
 
9794
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/steps.js
10170
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/cli/steps.js
9795
10171
  var STEPS2 = defineSteps([
9796
10172
  ...STEPS,
9797
10173
  {
@@ -10005,6 +10381,12 @@ var STEPS2 = defineSteps([
10005
10381
  ],
10006
10382
  why: "once the tasks these {shown} messages hold are opened, updated or closed, so the next review starts after them"
10007
10383
  },
10384
+ {
10385
+ id: "store.recover",
10386
+ command: "store recover",
10387
+ args: [],
10388
+ why: "the store file is damaged; this says what is lost and the commands that recover it"
10389
+ },
10008
10390
  {
10009
10391
  id: "search.meetings",
10010
10392
  command: "*",
@@ -10043,7 +10425,7 @@ var failureSteps = /* @__PURE__ */ __name((root, error) => {
10043
10425
  nextStep(IMAGE_MODELS.some((one) => one.id === model3) ? "models.download-image" : "models.download", {
10044
10426
  args: { model: model3 }
10045
10427
  })
10046
- ] : [];
10428
+ ] : error.reason === "store.damaged" ? [nextStep("store.recover", {})] : [];
10047
10429
  return runnable(root, [...error.next ?? [], ...own]);
10048
10430
  }, "failureSteps");
10049
10431
  var withSafety = /* @__PURE__ */ __name((steps, targets) => steps.map((step2) => {
@@ -10072,29 +10454,20 @@ var stepLine = /* @__PURE__ */ __name((root, step2) => {
10072
10454
  ].join(" ");
10073
10455
  }, "stepLine");
10074
10456
 
10075
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/project-status-rows.js
10076
- var where = [{ field: "ref" }, { field: ["chat_title", "chat"] }];
10457
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/cli/project-status-rows.js
10458
+ var where = [{ field: "ref" }];
10077
10459
  var who2 = { field: ["who.owner", "who.name"], tag: "you" };
10460
+ var ON_CHAT_ROW = /* @__PURE__ */ new Set(["reply-next", "coverage"]);
10078
10461
  var STATUS_SIGNAL_ROWS = {
10079
- "status.last-message": { columns: [...where, { field: "at", as: "time" }, who2] },
10080
- "status.reply-next": {
10081
- columns: [
10082
- ...where,
10083
- { field: "data.next" },
10084
- { field: "data.addressed.name" },
10085
- { field: "data.waiting_since", as: "day" },
10086
- { field: "data.overdue", tag: "overdue" }
10087
- ]
10088
- },
10089
10462
  "status.questions": {
10090
- columns: [...where, { field: "at", as: "day" }, { field: "data.side" }, who2],
10463
+ columns: [...where, { field: "at", as: "day" }, who2],
10091
10464
  text: ["data.excerpt"]
10092
10465
  },
10093
10466
  "status.promises": {
10094
10467
  columns: [
10095
10468
  ...where,
10096
10469
  { field: "at", as: "day" },
10097
- { field: "data.source" },
10470
+ { field: "basis" },
10098
10471
  { field: "data.side" },
10099
10472
  { field: "data.due", as: "day" },
10100
10473
  { field: "data.status" }
@@ -10121,21 +10494,10 @@ var STATUS_SIGNAL_ROWS = {
10121
10494
  columns: [
10122
10495
  ...where,
10123
10496
  { field: "data.query" },
10124
- { field: "data.theirs_last", as: "day" },
10125
10497
  { field: "data.yours_last", as: "day" },
10126
10498
  { field: "data.silent_since", as: "day" }
10127
10499
  ]
10128
10500
  },
10129
- "status.coverage": {
10130
- columns: [
10131
- { field: "chat" },
10132
- { field: "chat_title" },
10133
- { field: "data.state" },
10134
- { field: "data.held.messages", as: "count", tag: "held" },
10135
- { field: "data.held.oldest_at", as: "day" },
10136
- { field: "sync_command" }
10137
- ]
10138
- },
10139
10501
  "status.children": {
10140
10502
  columns: [
10141
10503
  { field: "data.child" },
@@ -10152,10 +10514,14 @@ var STATUS_ROWS = {
10152
10514
  columns: [
10153
10515
  { field: "chat" },
10154
10516
  { field: "title" },
10155
- { field: "kind" },
10156
10517
  { field: "role" },
10157
- { field: "attention", as: "count", tag: "attention" },
10158
- { field: "why" }
10518
+ { field: "next", prefix: "next" },
10519
+ { field: "addressed.name" },
10520
+ { field: "waiting_since", as: "day" },
10521
+ { field: "overdue", tag: "overdue" },
10522
+ { field: "held.messages", as: "count", tag: "held" },
10523
+ { field: "unlisted.questions", as: "count", tag: "questions unlisted" },
10524
+ { field: "unlisted.promises", as: "count", tag: "promises unlisted" }
10159
10525
  ]
10160
10526
  },
10161
10527
  "status.money": {
@@ -10166,7 +10532,6 @@ var STATUS_ROWS = {
10166
10532
  { field: "rows", as: "count", tag: "rows" }
10167
10533
  ]
10168
10534
  },
10169
- "status.signal": { columns: [{ field: "id" }, { field: "version" }] },
10170
10535
  "status.out-of-scope": {
10171
10536
  columns: [
10172
10537
  { field: "chat" },
@@ -10181,7 +10546,7 @@ var STATUS_ROWS = {
10181
10546
  "status.failed": { columns: [{ field: "signal" }], text: ["why"] }
10182
10547
  };
10183
10548
 
10184
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/compact.js
10549
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/cli/compact.js
10185
10550
  var TEXT_CHARS = 400;
10186
10551
  var sender = { field: ["sender_is_me", "sender_name"], tag: "me" };
10187
10552
  var messageRow = {
@@ -10366,8 +10731,8 @@ var cellOf = /* @__PURE__ */ __name((item, column, clock) => {
10366
10731
  const parts = clock.parts(iso);
10367
10732
  if (!parts)
10368
10733
  return { text: clean(iso) };
10369
- const day = parts.date.slice(5);
10370
- return { text: column.as === "day" ? day : `${day} ${parts.time}`, date: parts.date };
10734
+ const day2 = parts.date.slice(5);
10735
+ return column.as === "day" ? { text: day2, date: parts.date } : { text: `${day2} ${parts.time}`, date: parts.date, time: parts.time };
10371
10736
  }
10372
10737
  case "count":
10373
10738
  return typeof value === "number" && value !== 0 ? { text: column.tag ? `${value} ${column.tag}` : String(value) } : void 0;
@@ -10415,6 +10780,17 @@ var sameEverywhere = /* @__PURE__ */ __name((rows2, index) => {
10415
10780
  const first2 = rows2[0]?.cells[index]?.text;
10416
10781
  return first2 !== void 0 && rows2.every(({ cells }) => cells[index]?.text === first2);
10417
10782
  }, "sameEverywhere");
10783
+ var ordered = /* @__PURE__ */ __name((dates) => dates.every((one, at2) => at2 === 0 || one >= dates[at2 - 1]) || dates.every((one, at2) => at2 === 0 || one <= dates[at2 - 1]), "ordered");
10784
+ var dayColumn = /* @__PURE__ */ __name((rows2, shape, hoisted) => {
10785
+ const index = shape.columns.findIndex((column, at2) => column.as === "time" && !hoisted[at2]);
10786
+ if (index < 0)
10787
+ return -1;
10788
+ const dates = rows2.map(({ cells }) => cells[index]?.date);
10789
+ if (dates.some((one) => one === void 0))
10790
+ return -1;
10791
+ const days = dates;
10792
+ return ordered(days) && new Set(days).size * 3 <= days.length ? index : -1;
10793
+ }, "dayColumn");
10418
10794
  var rowsOfItems = /* @__PURE__ */ __name((items, shape, clock, chars) => {
10419
10795
  const dates = [];
10420
10796
  const rows2 = items.map((item) => {
@@ -10437,18 +10813,31 @@ var rowsOfItems = /* @__PURE__ */ __name((items, shape, clock, chars) => {
10437
10813
  return [];
10438
10814
  return [`${sourceOf(item, column) ?? fieldsOfColumn(column.field)[0]}: ${rows2[0]?.cells[index]?.text}`];
10439
10815
  });
10440
- const lines = rows2.map(({ cells, text: text5, item }) => {
10441
- const parts = cells.map((cell, index) => hoisted[index] ? void 0 : cell?.text);
10816
+ const byDay = dayColumn(rows2, shape, hoisted);
10817
+ let shownDay;
10818
+ const lines = rows2.flatMap(({ cells, text: text5, item }) => {
10819
+ const parts = cells.map((cell2, index) => hoisted[index] ? void 0 : cell2?.text);
10820
+ const dayLine = [];
10821
+ const cell = cells[byDay];
10822
+ if (byDay >= 0 && cell?.date && cell.time) {
10823
+ if (cell.date !== shownDay)
10824
+ dayLine.push(`# ${cell.date}`);
10825
+ shownDay = cell.date;
10826
+ parts[byDay] = cell.time;
10827
+ }
10442
10828
  const shortened = prefix ? clean(prefix) : void 0;
10443
10829
  if (shortened && parts[0]?.startsWith(shortened))
10444
10830
  parts[0] = `#${parts[0].slice(shortened.length)}`;
10445
10831
  const shown = [...parts, text5].filter((part) => part !== void 0 && part !== "");
10446
- return guarded(shown.length ? shown.join(" \xB7 ") : item ? blockLine(item, chars) : "");
10832
+ return [...dayLine, guarded(shown.length ? shown.join(" \xB7 ") : item ? blockLine(item, chars) : "")];
10447
10833
  });
10448
- const when = span(dates);
10449
- const header = [...prefix ? [`ref: ${clean(prefix)}<id>`] : [], ...named3, ...when ? [when, clock.zone] : []];
10450
- return { header, lines };
10834
+ const header = [...prefix ? [`ref: ${clean(prefix)}<id>`] : [], ...named3];
10835
+ return { header, lines, dates };
10451
10836
  }, "rowsOfItems");
10837
+ var spanOf = /* @__PURE__ */ __name((dates, clock) => {
10838
+ const when = span(dates);
10839
+ return when ? [when, clock.zone] : [];
10840
+ }, "spanOf");
10452
10841
  var blockLine = /* @__PURE__ */ __name((fields, chars) => blockOf(fields, chars).join(" "), "blockLine");
10453
10842
  var blockOf = /* @__PURE__ */ __name((fields, chars, indent = "", whole = []) => Object.entries(fields).filter(([name]) => !(name === "priority" && "priority_label" in fields)).filter(([, value]) => present(value) || value === false).flatMap(([name, value]) => {
10454
10843
  const label = `${indent}${clean(name)}:`;
@@ -10499,25 +10888,31 @@ var compactText = /* @__PURE__ */ __name((body, shape, options, rowsOf = rowsOfE
10499
10888
  const chars = options.textChars ?? TEXT_CHARS;
10500
10889
  let lines = [];
10501
10890
  if ("items" in body) {
10502
- const { header, lines: rows2 } = rowsOfItems(body.items, shape, clock, chars);
10503
- lines = (header.length ? [`# ${header.join(" \xB7 ")}`] : []).concat(rows2.length ? rows2 : ["# nothing found"]);
10891
+ const { header, lines: rows2, dates } = rowsOfItems(body.items, shape, clock, chars);
10892
+ const head = [...header, ...spanOf(dates, clock)];
10893
+ lines = (head.length ? [`# ${head.join(" \xB7 ")}`] : []).concat(rows2.length ? rows2 : ["# nothing found"]);
10504
10894
  } else if (isFields(body.item)) {
10505
10895
  const sections = shape.sections ?? {};
10506
- const rest = Object.fromEntries(Object.entries(body.item).filter(([name]) => !Object.hasOwn(sections, name)));
10896
+ const rest = Object.fromEntries(Object.entries(body.item).filter(([name]) => !Object.hasOwn(sections, name) && !shape.hidden?.includes(name)));
10507
10897
  lines = blockOf(rest, chars, "", shape.whole).map(guarded);
10898
+ let dates = [];
10899
+ let drawn = [];
10508
10900
  for (const [name, entity] of Object.entries(sections)) {
10509
10901
  const list = body.item[name];
10510
10902
  if (!Array.isArray(list))
10511
10903
  continue;
10512
- const { header, lines: rows2 } = rowsOfItems(list, rowsOf(entity), clock, chars);
10513
- lines = lines.concat([`# ${[`${clean(name)}: ${list.length}`, ...header].join(" \xB7 ")}`], rows2);
10904
+ const { header, lines: rows2, dates: more } = rowsOfItems(list, rowsOf(entity), clock, chars);
10905
+ dates = dates.concat(more);
10906
+ drawn = drawn.concat([`# ${[`${clean(name)}: ${list.length}`, ...header].join(" \xB7 ")}`], rows2);
10514
10907
  }
10908
+ const when = spanOf(dates, clock);
10909
+ lines = lines.concat(when.length ? [`# ${when.join(" \xB7 ")}`] : [], drawn);
10515
10910
  } else if (present(body.item))
10516
10911
  lines = [guarded(cut(clean(String(body.item)), chars))];
10517
10912
  return lines.concat(footerOf(body)).join("\n");
10518
10913
  }, "compactText");
10519
10914
 
10520
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/output-budget.js
10915
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/cli/output-budget.js
10521
10916
  var SOFT_OUTPUT_BYTES = 256 * 1024;
10522
10917
  var CARRIED = ["json", "compact", "offline", "timeout", "full", "brief", "maxOutputBytes"];
10523
10918
  var NOT_WITH_COMPACT = /* @__PURE__ */ new Set(["json", "brief"]);
@@ -10575,7 +10970,7 @@ var largeAnswerSteps = /* @__PURE__ */ __name((command) => {
10575
10970
  return args ? compactStep(command, args, "the answer is large as JSON; one line per item keeps every ref") : [];
10576
10971
  }, "largeAnswerSteps");
10577
10972
 
10578
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/provider-refs.js
10973
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/cli/provider-refs.js
10579
10974
  var HIDDEN = /* @__PURE__ */ new Set(["providerRef", "provider_ref"]);
10580
10975
  var withoutProviderRefs = /* @__PURE__ */ __name((value) => strip(value), "withoutProviderRefs");
10581
10976
  var strip = /* @__PURE__ */ __name((value) => {
@@ -10589,7 +10984,7 @@ var strip = /* @__PURE__ */ __name((value) => {
10589
10984
  return Object.fromEntries(Object.entries(value).flatMap(([key, inner]) => HIDDEN.has(key) ? [] : [[key, strip(inner)]]));
10590
10985
  }, "strip");
10591
10986
 
10592
- // node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/envelope.js
10987
+ // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/cli/envelope.js
10593
10988
  var answerSchema = /* @__PURE__ */ __name((item = unknown()) => union([listEnvelopeSchema(item), itemEnvelopeSchema(item)]), "answerSchema");
10594
10989
  var capped2 = /* @__PURE__ */ __name((steps) => steps.length > 0 ? { next: steps.slice(0, MAX_NEXT_STEPS) } : {}, "capped");
10595
10990
  var listOf = /* @__PURE__ */ __name((command, input) => {
@@ -10788,6 +11183,9 @@ export {
10788
11183
  modelTarget,
10789
11184
  AI_ENTRIES,
10790
11185
  resolveAISettings,
11186
+ botFiles,
11187
+ ChatRegistry,
11188
+ registryProfiles,
10791
11189
  REPAIR_WORDS,
10792
11190
  repairConfigText,
10793
11191
  permissionIssues,
@@ -10807,9 +11205,11 @@ export {
10807
11205
  setExitCode,
10808
11206
  provide,
10809
11207
  environmentOf,
11208
+ withAgentLevels,
10810
11209
  secretInputOf,
10811
11210
  outputFor,
10812
11211
  baseContext,
11212
+ inCommandRun,
10813
11213
  REMOTE_READ,
10814
11214
  FETCH,
10815
11215
  REMOTE_WRITE,
@@ -10822,7 +11222,9 @@ export {
10822
11222
  changesAuthorityNow,
10823
11223
  isLogin,
10824
11224
  destroysNothing,
11225
+ admittedUnderLock,
10825
11226
  changesStore,
11227
+ writesNewFileOnlyWith,
10826
11228
  readsOverMcpAt,
10827
11229
  isStoreChange,
10828
11230
  previewFlag,
@@ -10890,6 +11292,7 @@ export {
10890
11292
  answerEntity,
10891
11293
  answerEntitySchema,
10892
11294
  answerProjectionSchema,
11295
+ ON_CHAT_ROW,
10893
11296
  STATUS_SIGNAL_ROWS,
10894
11297
  entityRows,
10895
11298
  nextStep,