@wirecat/zoom-cli 0.70.0 → 0.72.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 (180) hide show
  1. package/dist/answer-entities.d.ts +2 -0
  2. package/dist/answer-entities.d.ts.map +1 -1
  3. package/dist/answers.d.ts +56 -0
  4. package/dist/answers.d.ts.map +1 -1
  5. package/dist/bin/zm.js +2 -2
  6. package/dist/bundle/{all-profiles-GE2TFJJP.js → all-profiles-XFIPF4GF.js} +12 -12
  7. package/dist/bundle/answer-policy-AT6CDEE5.js +110 -0
  8. package/dist/bundle/{anthropic-FA6NHENI.js → anthropic-SSUBR3BC.js} +29 -13
  9. package/dist/bundle/{app-server-IRADMSNX.js → app-server-7DJHHF2F.js} +68 -56
  10. package/dist/bundle/{bun-ZYZGGCX5.js → bun-6HBYWQIX.js} +2 -2
  11. package/dist/bundle/{bun-sqlite-Y24TUIGS.js → bun-sqlite-4L3Q55NB.js} +10 -6
  12. package/dist/bundle/{chunk-JULBAECW.js → chunk-23J2ANZ7.js} +16 -6
  13. package/dist/bundle/{chunk-4DSIWYGO.js → chunk-24OFZNRC.js} +39296 -24139
  14. package/dist/bundle/{chunk-LXXCLQCW.js → chunk-2MIBRVSV.js} +2 -2
  15. package/dist/bundle/{chunk-CHGUNZ3L.js → chunk-37NF5CBJ.js} +4 -4
  16. package/dist/bundle/chunk-3KRTEX5M.js +53 -0
  17. package/dist/bundle/{chunk-VNU5L37V.js → chunk-4SY67IUA.js} +34 -42
  18. package/dist/bundle/{chunk-XWQNJKTP.js → chunk-4XQWF3U2.js} +6 -6
  19. package/dist/bundle/{chunk-OAQLVV6W.js → chunk-4YIGXTBP.js} +3 -3
  20. package/dist/bundle/{chunk-RB33VTUW.js → chunk-5AELTC52.js} +810 -210
  21. package/dist/bundle/chunk-5MGICK47.js +1243 -0
  22. package/dist/bundle/{chunk-RRRJCHUC.js → chunk-5X4IY5JH.js} +4504 -1622
  23. package/dist/bundle/{chunk-EOSVN2ER.js → chunk-63QXCE5Z.js} +242 -242
  24. package/dist/bundle/{chunk-OE7EIP5L.js → chunk-6DCLZLGX.js} +1 -1
  25. package/dist/bundle/chunk-7GLJSJ7M.js +16 -0
  26. package/dist/bundle/{chunk-KM736RMJ.js → chunk-7IFO43Q5.js} +2 -2
  27. package/dist/bundle/{chunk-IWPXWGF7.js → chunk-7JYMGXLI.js} +44 -42
  28. package/dist/bundle/{chunk-LAG5O2FV.js → chunk-7OD3522V.js} +4162 -3769
  29. package/dist/bundle/{chunk-DCUWJITQ.js → chunk-7S4D5SM2.js} +60 -608
  30. package/dist/bundle/{chunk-3KC7C465.js → chunk-7SUWPMZG.js} +10 -15
  31. package/dist/bundle/{chunk-6IF5ZHDS.js → chunk-ADKMBXY4.js} +1 -1
  32. package/dist/bundle/{chunk-56OV5ASY.js → chunk-B3SILJBU.js} +18 -18
  33. package/dist/bundle/{chunk-CIZ25UPK.js → chunk-CANRIRNZ.js} +8241 -5553
  34. package/dist/bundle/{chunk-YUHM2OJM.js → chunk-CW46FWKW.js} +38 -123
  35. package/dist/bundle/{chunk-VSLDWT4E.js → chunk-D24OQAHM.js} +4 -4
  36. package/dist/bundle/{chunk-ZBKWRYRS.js → chunk-D5EUMWD5.js} +3 -3
  37. package/dist/bundle/{chunk-CSEBB4OP.js → chunk-DEPXZJ2V.js} +21 -150
  38. package/dist/bundle/{chunk-YJSPBUGB.js → chunk-DOCVEKP2.js} +51 -67
  39. package/dist/bundle/{chunk-V2E7QFZ3.js → chunk-EFF2XBHP.js} +2 -2
  40. package/dist/bundle/{chunk-XRFHQGOD.js → chunk-EG25AY4L.js} +1 -1
  41. package/dist/bundle/{chunk-FEM2JQN2.js → chunk-ELJUBPY4.js} +1 -1
  42. package/dist/bundle/{chunk-2U6SER67.js → chunk-ERJYJ36F.js} +2 -2
  43. package/dist/bundle/chunk-FSCPQQS5.js +244 -0
  44. package/dist/bundle/{chunk-BVWF4B33.js → chunk-H53WFZBN.js} +16 -139
  45. package/dist/bundle/{chunk-VJ5ZU4UF.js → chunk-I7CUMZD6.js} +3 -3
  46. package/dist/bundle/{chunk-OA37BWE5.js → chunk-IACWKZWS.js} +1 -1
  47. package/dist/bundle/{chunk-BSS6HX4O.js → chunk-IFBIXU6C.js} +2 -2
  48. package/dist/bundle/{chunk-UVPL7YAY.js → chunk-IU4DUUB3.js} +7 -7
  49. package/dist/bundle/{chunk-W7ZEEC4K.js → chunk-IXO4SCKE.js} +1 -1
  50. package/dist/bundle/{chunk-J3SKXICS.js → chunk-JAEPK457.js} +359 -765
  51. package/dist/bundle/{chunk-ZV3INEKM.js → chunk-JFPUYQSP.js} +5 -5
  52. package/dist/bundle/{chunk-ZS55EERO.js → chunk-JG4MNYG2.js} +1 -1
  53. package/dist/bundle/{chunk-IINZIP73.js → chunk-JRCH4YZP.js} +17 -10
  54. package/dist/bundle/{chunk-2JEM2YNV.js → chunk-JZ4XNNL7.js} +1 -1
  55. package/dist/bundle/chunk-K6HR6HCO.js +32 -0
  56. package/dist/bundle/{chunk-SNIY3JDN.js → chunk-KFZL67JP.js} +328 -60
  57. package/dist/bundle/{chunk-CEJJBZAE.js → chunk-KPIQXFNB.js} +375 -10
  58. package/dist/bundle/{chunk-M7VUXXGS.js → chunk-KWURWGGB.js} +137 -7
  59. package/dist/bundle/{chunk-M6JIXMQZ.js → chunk-LA6QUVGQ.js} +3 -2
  60. package/dist/bundle/{chunk-AISJCF7A.js → chunk-LLUNHAZ7.js} +4 -4
  61. package/dist/bundle/{chunk-KWRCP55G.js → chunk-LTWJM3ED.js} +17 -17
  62. package/dist/bundle/{chunk-IS3ZTT2Z.js → chunk-M3DMXDX6.js} +6 -6
  63. package/dist/bundle/{chunk-VW6BF6M7.js → chunk-MCPOZNWG.js} +1 -1
  64. package/dist/bundle/{chunk-L24UOUWG.js → chunk-MSQHSW4C.js} +2 -2
  65. package/dist/bundle/chunk-N4QNYWWG.js +71 -0
  66. package/dist/bundle/chunk-NMZQTYKJ.js +18 -0
  67. package/dist/bundle/{chunk-DNR4B5YV.js → chunk-OHCLQJOV.js} +3 -3
  68. package/dist/bundle/{chunk-MVOMLJYQ.js → chunk-OP5PGE2N.js} +4 -4
  69. package/dist/bundle/{chunk-QL7EMFIC.js → chunk-OY6N2ABP.js} +29 -23
  70. package/dist/bundle/chunk-PJWSGXOB.js +185 -0
  71. package/dist/bundle/{chunk-YTN2JN6N.js → chunk-QA6KIL7Q.js} +12 -8
  72. package/dist/bundle/{chunk-6HJFIMT7.js → chunk-QQUY4MZY.js} +1 -1
  73. package/dist/bundle/{chunk-ZSKE7N2U.js → chunk-QW7YTRV2.js} +3 -3
  74. package/dist/bundle/chunk-RJTGENHZ.js +109 -0
  75. package/dist/bundle/{chunk-RIPAUCKJ.js → chunk-RLCVPECY.js} +74 -67
  76. package/dist/bundle/{chunk-M7E44TMT.js → chunk-RN5SU2RN.js} +6 -6
  77. package/dist/bundle/{chunk-P3ASN72F.js → chunk-RX5CJ55S.js} +1 -1
  78. package/dist/bundle/{chunk-7QC4M4HS.js → chunk-RZUJMAMK.js} +4 -4
  79. package/dist/bundle/{chunk-OORMSM6O.js → chunk-S7SXSHRC.js} +21 -21
  80. package/dist/bundle/{chunk-SVF3NDAO.js → chunk-SXZGCD6E.js} +3 -3
  81. package/dist/bundle/{chunk-DXCTW3MV.js → chunk-T27IMG6X.js} +3 -1
  82. package/dist/bundle/{chunk-PV6OHXHN.js → chunk-TF2WKPNW.js} +18 -18
  83. package/dist/bundle/{chunk-X4ZF4XXI.js → chunk-U32VL3MA.js} +1 -1
  84. package/dist/bundle/{chunk-RQG5VOGH.js → chunk-U3NJBGLA.js} +3 -3
  85. package/dist/bundle/{chunk-WOIHSQAL.js → chunk-UVZLK3M4.js} +33 -9
  86. package/dist/bundle/chunk-VIV64MQM.js +779 -0
  87. package/dist/bundle/{chunk-2QFPVUM3.js → chunk-W3YTVEWV.js} +69 -6
  88. package/dist/bundle/{chunk-AUNW7N4I.js → chunk-WLVG4RBZ.js} +1 -1
  89. package/dist/bundle/{chunk-JRO2FWO2.js → chunk-WOAYHCM2.js} +1 -1
  90. package/dist/bundle/{chunk-RO3ZR4VP.js → chunk-WXTYYWZI.js} +13 -13
  91. package/dist/bundle/{chunk-RWIILYKW.js → chunk-WZGKHTA4.js} +2 -2
  92. package/dist/bundle/{chunk-GB5X3GBE.js → chunk-X2MP634F.js} +14 -5
  93. package/dist/bundle/{chunk-RGJ7OWHU.js → chunk-XPWZSW6Y.js} +61 -21
  94. package/dist/bundle/{chunk-D3PNCJD5.js → chunk-YVVJ6Y5C.js} +7 -7
  95. package/dist/bundle/chunk-ZHA56THL.js +2355 -0
  96. package/dist/bundle/{chunk-QO2KPU26.js → chunk-ZVFYGTGJ.js} +101 -44
  97. package/dist/bundle/{chunk-V5GRSOCZ.js → chunk-ZW5KHKMA.js} +5 -5
  98. package/dist/bundle/{cli-VRSQ7HAE.js → cli-IYYI7GAM.js} +215 -100
  99. package/dist/bundle/command-contract-TX7NSUBM.js +42 -0
  100. package/dist/bundle/command-server-entry-FXX4LJWF.js +171 -0
  101. package/dist/bundle/config-YKNM33J7.js +96 -0
  102. package/dist/bundle/{decode-523PUQMR.js → decode-SRGOOGBW.js} +6 -6
  103. package/dist/bundle/{dispatch-IZCAK47P.js → dispatch-OUHRPFUL.js} +11 -11
  104. package/dist/bundle/{dist-6WWKPEVW.js → dist-UZLNLAIO.js} +97 -56
  105. package/dist/bundle/{echarts-S5UMX2D3.js → echarts-7CM2MCMW.js} +2 -2
  106. package/dist/bundle/{embed-ODPDVHUK.js → embed-VEE56BOB.js} +7 -7
  107. package/dist/bundle/{embedder-PAXRBSZE.js → embedder-SZFYR543.js} +10 -10
  108. package/dist/bundle/{failure-R2OIHCE5.js → failure-MZBNM7M5.js} +3 -3
  109. package/dist/bundle/first-run-KWC7RKF2.js +29 -0
  110. package/dist/bundle/first-screen-DWKMNSEI.js +40 -0
  111. package/dist/bundle/{folders-ZXTOFY4T.js → folders-UQXRSDJJ.js} +5 -5
  112. package/dist/bundle/{instructions-DUB7E6C5.js → instructions-R7OHVAWH.js} +1 -1
  113. package/dist/bundle/{main-A7JSYQI6.js → main-EFUN2O3K.js} +21 -20
  114. package/dist/bundle/{mcp-M4QN2E7R.js → mcp-7KQUJNFN.js} +2 -2
  115. package/dist/bundle/{meetings-BDZQV3HR.js → meetings-5I2BDNTA.js} +9 -7
  116. package/dist/bundle/{node-E25KP53H.js → node-3N2JGZ7V.js} +2 -2
  117. package/dist/bundle/{node-sqlite-PHWDFZCP.js → node-sqlite-2UVEE2WM.js} +11 -7
  118. package/dist/bundle/{oauth-G2K46IYP.js → oauth-AYGD7UU3.js} +8 -8
  119. package/dist/bundle/{open-INWS5HIZ.js → open-3GUVDLGD.js} +6 -6
  120. package/dist/bundle/openai-NHCDLWWY.js +28 -0
  121. package/dist/bundle/{output-file-YGQYZCBJ.js → output-file-72JFXVHQ.js} +6 -6
  122. package/dist/bundle/{process-UJ2JHMJN.js → process-YAHHUFR5.js} +1 -1
  123. package/dist/bundle/{program-LYTGFV6L.js → program-OSZROCTK.js} +113 -118
  124. package/dist/bundle/{prompt-VTUCRCE4.js → prompt-HMCW4XQJ.js} +6 -6
  125. package/dist/bundle/{recognize-3CEPOW2F.js → recognize-VF5CA7EM.js} +5 -5
  126. package/dist/bundle/{remote-DRQEXEZL.js → remote-5C6VTPR2.js} +10 -8
  127. package/dist/bundle/{rerank-UL4KNNVN.js → rerank-ER7NEDOI.js} +8 -8
  128. package/dist/bundle/run-log-JKTLKXSK.js +124 -0
  129. package/dist/bundle/{serve-P5UWUOWQ.js → serve-QJWXJOM7.js} +10 -10
  130. package/dist/bundle/{server-M6XK2Y3X.js → server-KCIK3Y2P.js} +50 -48
  131. package/dist/bundle/server-LLGFDLLJ.js +75 -0
  132. package/dist/bundle/{services-4HRYNY62.js → services-LQMYJQG3.js} +121 -52
  133. package/dist/bundle/{speech-BBPBMFAO.js → speech-74GJQNQH.js} +20 -17
  134. package/dist/bundle/{state-GDSUNUSY.js → state-4XDGCHDF.js} +7 -7
  135. package/dist/bundle/{store-LBQ6FZP2.js → store-5Y5HK2L2.js} +28 -19
  136. package/dist/bundle/{store-VWLABMLF.js → store-Y56AHJ2Y.js} +64 -31
  137. package/dist/bundle/store-connection-4WI32AYU.js +89 -0
  138. package/dist/bundle/store-maintenance-command-PCXO5AH4.js +65 -0
  139. package/dist/bundle/{streaming-EJ3NM2C2.js → streaming-E5CR6HSR.js} +7 -7
  140. package/dist/bundle/{tokens-BE6CJMR5.js → tokens-E2QNVC4F.js} +7 -7
  141. package/dist/bundle/zm.js +34 -10
  142. package/dist/bundle/{zoom-app-YIEJLWCW.js → zoom-app-NVL7HEAX.js} +8 -8
  143. package/dist/contract-overrides.d.ts.map +1 -1
  144. package/dist/contract-overrides.js +0 -6
  145. package/dist/contract-overrides.js.map +1 -1
  146. package/dist/ingestion-search-commands.d.ts.map +1 -1
  147. package/dist/ingestion-search-commands.js +0 -10
  148. package/dist/ingestion-search-commands.js.map +1 -1
  149. package/dist/meeting-integration-commands.d.ts.map +1 -1
  150. package/dist/meeting-integration-commands.js +8 -6
  151. package/dist/meeting-integration-commands.js.map +1 -1
  152. package/dist/meeting-integration.d.ts +3 -1
  153. package/dist/meeting-integration.d.ts.map +1 -1
  154. package/dist/store-connection.d.ts.map +1 -1
  155. package/dist/store-connection.js +4 -3
  156. package/dist/store-connection.js.map +1 -1
  157. package/dist/unified-search.d.ts +4 -4
  158. package/dist/unified-search.d.ts.map +1 -1
  159. package/dist/unified-search.js +1 -24
  160. package/dist/unified-search.js.map +1 -1
  161. package/dist/version.d.ts +1 -1
  162. package/dist/version.js +1 -1
  163. package/package.json +4 -4
  164. package/skills/zoom-cli/SKILL.md +2 -2
  165. package/dist/bundle/answer-policy-GOXSDYDD.js +0 -104
  166. package/dist/bundle/chunk-5XWCBLUR.js +0 -27
  167. package/dist/bundle/chunk-AT2XKNFN.js +0 -342
  168. package/dist/bundle/chunk-GVT5363M.js +0 -35
  169. package/dist/bundle/chunk-VE2VNECR.js +0 -380
  170. package/dist/bundle/chunk-Y6C3N7YG.js +0 -12434
  171. package/dist/bundle/command-contract-RPRKHVU6.js +0 -41
  172. package/dist/bundle/config-QU6A6VIO.js +0 -90
  173. package/dist/bundle/first-run-NVTDR5VO.js +0 -28
  174. package/dist/bundle/first-screen-5RWZDWLK.js +0 -39
  175. package/dist/bundle/openai-T44ORVGQ.js +0 -25
  176. package/dist/bundle/run-log-UZAB5CWF.js +0 -118
  177. package/dist/bundle/server-F3NPVMS2.js +0 -72
  178. package/dist/bundle/store-connection-XEBFP56U.js +0 -83
  179. package/dist/bundle/store-maintenance-command-G43JN57J.js +0 -61
  180. /package/dist/bundle/{chunk-VOXIGICJ.js → chunk-YVNHQFLC.js} +0 -0
@@ -1,5 +1,12 @@
1
1
  import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ endpoint
5
+ } from "./chunk-K6HR6HCO.js";
6
+ import {
7
+ filesPresent,
8
+ sharedModelsDirectory
9
+ } from "./chunk-D24OQAHM.js";
3
10
  import {
4
11
  PRIORITY_LABELS,
5
12
  TASK_ORIGINS,
@@ -9,28 +16,21 @@ import {
9
16
  id,
10
17
  text,
11
18
  time
12
- } from "./chunk-VE2VNECR.js";
19
+ } from "./chunk-5MGICK47.js";
20
+ import {
21
+ TAG_TYPES
22
+ } from "./chunk-VIV64MQM.js";
13
23
  import {
14
24
  readSharedSection,
15
25
  sharedConfigPath,
16
26
  writeSharedSection
17
- } from "./chunk-UVPL7YAY.js";
18
- import {
19
- TAG_TYPES
20
- } from "./chunk-AT2XKNFN.js";
21
- import {
22
- filesPresent,
23
- sharedModelsDirectory
24
- } from "./chunk-VSLDWT4E.js";
27
+ } from "./chunk-IU4DUUB3.js";
25
28
  import {
26
29
  storePath
27
- } from "./chunk-GVT5363M.js";
30
+ } from "./chunk-3KRTEX5M.js";
28
31
  import {
29
- createRecordLog,
30
- resolvePaths,
31
- traceIdOf,
32
32
  writeSecurely
33
- } from "./chunk-OORMSM6O.js";
33
+ } from "./chunk-S7SXSHRC.js";
34
34
  import {
35
35
  array,
36
36
  boolean,
@@ -55,496 +55,16 @@ import {
55
55
  string,
56
56
  trim,
57
57
  url
58
- } from "./chunk-WOIHSQAL.js";
58
+ } from "./chunk-UVZLK3M4.js";
59
59
  import {
60
60
  CliError,
61
61
  isCliError
62
- } from "./chunk-FEM2JQN2.js";
62
+ } from "./chunk-ELJUBPY4.js";
63
63
  import {
64
64
  __name
65
65
  } from "./chunk-ZVVMGPBJ.js";
66
66
 
67
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/runs/run.js
68
- import { randomUUID } from "node:crypto";
69
- import { appendFileSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
70
- import { userInfo } from "node:os";
71
- import { join, sep } from "node:path";
72
-
73
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/runs/log-keys.js
74
- var snake = /* @__PURE__ */ __name((key) => key.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`), "snake");
75
- var camel = /* @__PURE__ */ __name((key) => key.replace(/_([a-z0-9])/g, (_, letter) => letter.toUpperCase()), "camel");
76
- var renamed = /* @__PURE__ */ __name((record2, name) => Object.fromEntries(Object.entries(record2).map(([key, value]) => [name(key), value])), "renamed");
77
- var logAttributes = /* @__PURE__ */ __name((event) => renamed(event, snake), "logAttributes");
78
- var fromLogAttributes = /* @__PURE__ */ __name((attributes) => renamed(attributes, camel), "fromLogAttributes");
79
- var snakeLogger = /* @__PURE__ */ __name((logger) => ({
80
- debug: /* @__PURE__ */ __name((event, message) => logger.debug(logAttributes(event), message), "debug"),
81
- info: /* @__PURE__ */ __name((event, message) => logger.info(logAttributes(event), message), "info"),
82
- warn: /* @__PURE__ */ __name((event, message) => logger.warn(logAttributes(event), message), "warn"),
83
- error: /* @__PURE__ */ __name((event, message) => logger.error(logAttributes(event), message), "error")
84
- }), "snakeLogger");
85
-
86
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/runs/log-attributes.js
87
- var diagnostic = {
88
- event: true,
89
- operation: true,
90
- opcode: true,
91
- seq: true,
92
- status: true,
93
- method: true,
94
- endpointTemplate: true,
95
- bytes: true,
96
- ids: true,
97
- counts: true,
98
- durationMs: true,
99
- outcome: true,
100
- errorCode: true,
101
- providerError: true,
102
- level: true,
103
- transport: true,
104
- attempt: true,
105
- waitMs: true,
106
- code: true,
107
- detail: true,
108
- reason: true,
109
- ageMs: true
110
- };
111
- var send = {
112
- profile: true,
113
- chatId: true,
114
- outcome: true,
115
- kind: true,
116
- action: true,
117
- people: true,
118
- messageId: true,
119
- key: true,
120
- count: true,
121
- forEveryone: true,
122
- sendId: true,
123
- operationId: true,
124
- parentOperationId: true,
125
- replyTo: true,
126
- threadId: true,
127
- sendAs: true,
128
- resultChatId: true,
129
- length: true,
130
- attachments: true,
131
- scheduledFor: true,
132
- notify: true,
133
- origin: true,
134
- reservation: true,
135
- errorCode: true
136
- };
137
- var background = [
138
- "job",
139
- "pid",
140
- "schedule",
141
- "exitCode",
142
- "tool",
143
- "tier",
144
- "actorType",
145
- "actorId",
146
- "agent",
147
- "targetType",
148
- "targetId"
149
- ];
150
- var crash = ["errorClass", "frames"];
151
- var dropped = ["dropped"];
152
- var LOG_ATTRIBUTES = [
153
- ...new Set([...Object.keys(diagnostic), ...Object.keys(send), ...background, ...crash, ...dropped].map((key) => Object.keys(logAttributes({ [key]: true }))[0]))
154
- ].sort();
155
-
156
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/runs/run.js
157
- var KEEP_RUNS_FOR_DAYS = 30;
158
- var KEEP_SUCCESSFUL_RUNS_FOR_DAYS = 7;
159
- var RUNS_SIZE_LIMIT_MB = 200;
160
- var runsDirFor = /* @__PURE__ */ __name((app, env = process.env) => join(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "runs"), "runsDirFor");
161
- var startRun = /* @__PURE__ */ __name((options) => {
162
- const now = options.now ?? (() => /* @__PURE__ */ new Date());
163
- const startedAt = options.startedAt ?? now();
164
- const id2 = options.runId ?? newRunId(startedAt, options.command);
165
- const dir = join(options.runsDir, day(startedAt), id2);
166
- pruneRuns(options.runsDir, {
167
- keepDays: options.keepDays ?? KEEP_RUNS_FOR_DAYS,
168
- keepSuccessDays: options.keepSuccessDays ?? KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
169
- maxBytes: options.maxBytes ?? RUNS_SIZE_LIMIT_MB * 1024 * 1024,
170
- now: startedAt
171
- });
172
- refuseRealStateInTests(dir);
173
- const metadata = {
174
- runId: id2,
175
- command: options.command,
176
- ...options.profile === void 0 ? {} : { profile: options.profile },
177
- startedAt: startedAt.toISOString(),
178
- status: "running",
179
- cliVersion: options.cliVersion,
180
- runtime: runtime(),
181
- platform: process.platform,
182
- arch: process.arch,
183
- ...options.traceId === void 0 ? {} : { traceId: options.traceId },
184
- ...options.context
185
- };
186
- let file;
187
- const opened = /* @__PURE__ */ __name(() => {
188
- if (file)
189
- return file;
190
- mkdirSync(dir, { recursive: true, mode: 448 });
191
- const events = join(dir, "events.jsonl");
192
- writeFileSync(events, "", { flag: "a", mode: 384 });
193
- file = snakeLogger(createRecordLog({
194
- to: events,
195
- runId: id2,
196
- command: options.command,
197
- resource: { service: options.service, version: options.cliVersion },
198
- allow: LOG_ATTRIBUTES,
199
- ...options.traceId === void 0 ? {} : { traceId: options.traceId },
200
- ...options.onError === void 0 ? {} : { onError: options.onError }
201
- }));
202
- writeRunFile(dir, metadata);
203
- return file;
204
- }, "opened");
205
- if (!options.lazy)
206
- opened();
207
- let finished = false;
208
- const operations = /* @__PURE__ */ new Set();
209
- const codes = /* @__PURE__ */ new Set();
210
- const noted = /* @__PURE__ */ __name((level) => (event, message) => {
211
- const { operation, errorCode, error_code, code } = event;
212
- if (typeof operation === "string")
213
- operations.add(operation);
214
- for (const value of [errorCode, error_code, code])
215
- if (typeof value === "string")
216
- codes.add(value);
217
- if (finished)
218
- return;
219
- opened()[level](event, message);
220
- }, "noted");
221
- const logger = { debug: noted("debug"), info: noted("info"), warn: noted("warn"), error: noted("error") };
222
- return {
223
- id: id2,
224
- dir,
225
- logger,
226
- finish: /* @__PURE__ */ __name(async (status, extra = {}) => {
227
- if (finished)
228
- return;
229
- finished = true;
230
- const completedAt = now();
231
- const final = {
232
- ...metadata,
233
- ...extra,
234
- status,
235
- completedAt: completedAt.toISOString(),
236
- durationMs: completedAt.getTime() - startedAt.getTime(),
237
- operations: [...operations].sort(),
238
- codes: [...codes].sort()
239
- };
240
- if (file || status !== "success") {
241
- opened();
242
- writeRunFile(dir, final);
243
- return;
244
- }
245
- try {
246
- mkdirSync(join(dir, ".."), { recursive: true, mode: 448 });
247
- appendIndex(join(dir, ".."), runFileOf(final));
248
- } catch (error) {
249
- options.onError?.(error);
250
- }
251
- }, "finish")
252
- };
253
- }, "startRun");
254
- var refuseRealStateInTests = /* @__PURE__ */ __name((dir, env = process.env) => {
255
- if (env.VITEST === void 0)
256
- return;
257
- let home;
258
- try {
259
- home = userInfo().homedir;
260
- } catch {
261
- return;
262
- }
263
- if (dir.startsWith(join(home, ".local", "share") + sep))
264
- throw new Error(`a test opened a run in the real data folder: ${dir}`);
265
- }, "refuseRealStateInTests");
266
- var runtime = /* @__PURE__ */ __name(() => {
267
- const bun = process.versions.bun;
268
- return bun ? `bun ${bun}` : `node ${process.versions.node}`;
269
- }, "runtime");
270
- var newRunId = /* @__PURE__ */ __name((startedAt, command) => {
271
- const stamp = startedAt.toISOString().replace(/[-:]/g, "").replace(/\.\d+Z$/, "Z");
272
- const slug2 = command.replace(/[^a-z0-9]+/gi, "-").toLowerCase();
273
- return `${stamp}-${slug2}-${randomUUID().slice(0, 6)}`;
274
- }, "newRunId");
275
- var INDEX = "index.jsonl";
276
- var appendIndex = /* @__PURE__ */ __name((dayDir, written) => {
277
- appendFileSync(join(dayDir, INDEX), `${JSON.stringify(written)}
278
- `, { mode: 384 });
279
- }, "appendIndex");
280
- var writeRunFile = /* @__PURE__ */ __name((dir, metadata) => {
281
- const written = runFileOf(metadata);
282
- writeSecurely(join(dir, "run.json"), `${JSON.stringify(written, null, 2)}
283
- `, 384);
284
- try {
285
- appendIndex(join(dir, ".."), written);
286
- } catch {
287
- }
288
- }, "writeRunFile");
289
- var matchesListFilter = /* @__PURE__ */ __name((run, filter) => (filter.runId === void 0 || run.runId === filter.runId) && (filter.command === void 0 || run.command === filter.command) && (filter.profile === void 0 || run.profile === filter.profile) && (filter.status === void 0 || run.status === filter.status) && (filter.errorCode === void 0 || run.errorCode === filter.errorCode), "matchesListFilter");
290
- var listRuns = /* @__PURE__ */ __name((runsDir, { since, atLeast = Number.POSITIVE_INFINITY, filter = {} } = {}) => {
291
- const first = since === void 0 ? void 0 : day(new Date(since));
292
- const runs = [];
293
- for (const date of days(runsDir).sort().reverse()) {
294
- if (first !== void 0 && date < first || runs.length >= atLeast)
295
- break;
296
- for (const metadata of runsOfDay(join(runsDir, date))) {
297
- if (matchesListFilter(metadata, filter))
298
- runs.push(metadata);
299
- }
300
- }
301
- return runs;
302
- }, "listRuns");
303
- var indexedRuns = /* @__PURE__ */ __name((dayDir) => {
304
- const latest = /* @__PURE__ */ new Map();
305
- let raw = "";
306
- try {
307
- raw = readFileSync(join(dayDir, INDEX), "utf8");
308
- } catch {
309
- }
310
- for (const line of raw.split("\n")) {
311
- if (line.trim() === "")
312
- continue;
313
- try {
314
- const metadata = metadataOf(JSON.parse(line));
315
- if (typeof metadata.runId === "string")
316
- latest.set(metadata.runId, metadata);
317
- } catch {
318
- }
319
- }
320
- return latest;
321
- }, "indexedRuns");
322
- var runsOfDay = /* @__PURE__ */ __name((dayDir) => {
323
- const latest = indexedRuns(dayDir);
324
- for (const entry of safeReaddir(dayDir)) {
325
- if (entry === INDEX || entry.startsWith(".") || latest.has(entry))
326
- continue;
327
- const metadata = readRun(join(dayDir, entry));
328
- if (metadata)
329
- latest.set(metadata.runId, metadata);
330
- }
331
- return [...latest.values()].sort((a, b) => a.runId < b.runId ? 1 : a.runId > b.runId ? -1 : 0);
332
- }, "runsOfDay");
333
- var findRun = /* @__PURE__ */ __name((runsDir, id2) => {
334
- const stamped = /^(\d{4})(\d{2})(\d{2})T/.exec(id2);
335
- const likely = stamped ? [`${stamped[1]}-${stamped[2]}-${stamped[3]}`] : [];
336
- const dates = [.../* @__PURE__ */ new Set([...likely, ...days(runsDir)])];
337
- for (const date of dates) {
338
- const dir = join(runsDir, date, id2);
339
- const metadata = readRun(dir);
340
- if (metadata)
341
- return { dir, metadata };
342
- }
343
- for (const date of dates) {
344
- const metadata = indexedRuns(join(runsDir, date)).get(id2);
345
- if (metadata)
346
- return { dir: join(runsDir, date, id2), metadata };
347
- }
348
- return void 0;
349
- }, "findRun");
350
- var readEvents = /* @__PURE__ */ __name((dir) => {
351
- let raw;
352
- try {
353
- raw = readFileSync(join(dir, "events.jsonl"), "utf8");
354
- } catch {
355
- return [];
356
- }
357
- const events = [];
358
- for (const line of raw.split("\n")) {
359
- if (line.trim() === "")
360
- continue;
361
- try {
362
- const parsed = JSON.parse(line);
363
- if (parsed !== null && typeof parsed === "object")
364
- events.push(eventOf(parsed));
365
- } catch {
366
- }
367
- }
368
- return events;
369
- }, "readEvents");
370
- var eventOf = /* @__PURE__ */ __name((line) => {
371
- const { attributes, time: time2, severity } = line;
372
- if (attributes === null || typeof attributes !== "object")
373
- return logAttributes(line);
374
- return { time: time2, severity, ...logAttributes(attributes) };
375
- }, "eventOf");
376
- var pruneRuns = /* @__PURE__ */ __name((runsDir, { keepDays, keepSuccessDays = keepDays, maxBytes, now }) => {
377
- const cutoff = day(new Date(now.getTime() - keepDays * DAY_MS));
378
- const successCutoff = day(new Date(now.getTime() - Math.min(keepSuccessDays, keepDays) * DAY_MS));
379
- let removed = 0;
380
- for (const date of days(runsDir)) {
381
- if (date >= cutoff) {
382
- if (date < successCutoff)
383
- dropSuccesses(join(runsDir, date));
384
- continue;
385
- }
386
- try {
387
- rmSync(join(runsDir, date), { recursive: true, force: true });
388
- removed += 1;
389
- } catch {
390
- }
391
- }
392
- if (maxBytes !== void 0)
393
- removed += fitSize(runsDir, maxBytes, now);
394
- return removed;
395
- }, "pruneRuns");
396
- var DAY_MS = 24 * 60 * 60 * 1e3;
397
- var SUCCESSES_DROPPED = ".successes-dropped";
398
- var SIZE_CHECKED = ".size-checked";
399
- var dropSuccesses = /* @__PURE__ */ __name((dayDir) => {
400
- const marker = join(dayDir, SUCCESSES_DROPPED);
401
- try {
402
- statSync(marker);
403
- return;
404
- } catch {
405
- }
406
- try {
407
- const kept = [];
408
- for (const [id2, metadata] of indexedRuns(dayDir)) {
409
- if (metadata.status === "success")
410
- rmSync(join(dayDir, id2), { recursive: true, force: true });
411
- else
412
- kept.push(JSON.stringify(runFileOf(metadata)));
413
- }
414
- for (const entry of safeReaddir(dayDir)) {
415
- if (entry === INDEX || entry.startsWith("."))
416
- continue;
417
- if (readRun(join(dayDir, entry))?.status === "success")
418
- rmSync(join(dayDir, entry), { recursive: true, force: true });
419
- }
420
- writeSecurely(join(dayDir, INDEX), kept.map((line) => `${line}
421
- `).join(""), 384);
422
- writeFileSync(marker, "", { mode: 384 });
423
- } catch {
424
- }
425
- }, "dropSuccesses");
426
- var sizeOf = /* @__PURE__ */ __name((path) => {
427
- let total = 0;
428
- for (const entry of safeReaddir(path)) {
429
- const full = join(path, entry);
430
- try {
431
- const stat = statSync(full);
432
- total += stat.isDirectory() ? sizeOf(full) : stat.size;
433
- } catch {
434
- }
435
- }
436
- return total;
437
- }, "sizeOf");
438
- var fitSize = /* @__PURE__ */ __name((runsDir, maxBytes, now) => {
439
- const stamp = join(runsDir, SIZE_CHECKED);
440
- const today = day(now);
441
- try {
442
- if (readFileSync(stamp, "utf8").trim() === today)
443
- return 0;
444
- } catch {
445
- }
446
- const dates = days(runsDir).sort();
447
- const sizes = new Map(dates.map((date) => [date, sizeOf(join(runsDir, date))]));
448
- let total = [...sizes.values()].reduce((sum, size) => sum + size, 0);
449
- let removed = 0;
450
- for (const date of dates) {
451
- if (total <= maxBytes || date === today)
452
- break;
453
- dropSuccesses(join(runsDir, date));
454
- const after = sizeOf(join(runsDir, date));
455
- total -= (sizes.get(date) ?? 0) - after;
456
- sizes.set(date, after);
457
- }
458
- for (const date of dates) {
459
- if (total <= maxBytes || date === today)
460
- break;
461
- try {
462
- rmSync(join(runsDir, date), { recursive: true, force: true });
463
- total -= sizes.get(date) ?? 0;
464
- removed += 1;
465
- } catch {
466
- }
467
- }
468
- try {
469
- mkdirSync(runsDir, { recursive: true, mode: 448 });
470
- writeFileSync(stamp, today, { mode: 384 });
471
- } catch {
472
- }
473
- return removed;
474
- }, "fitSize");
475
- var day = /* @__PURE__ */ __name((date) => date.toISOString().slice(0, 10), "day");
476
- var days = /* @__PURE__ */ __name((runsDir) => safeReaddir(runsDir).filter((entry) => /^\d{4}-\d{2}-\d{2}$/.test(entry)), "days");
477
- var readRun = /* @__PURE__ */ __name((dir) => {
478
- try {
479
- return metadataOf(JSON.parse(readFileSync(join(dir, "run.json"), "utf8")));
480
- } catch {
481
- return void 0;
482
- }
483
- }, "readRun");
484
- var safeReaddir = /* @__PURE__ */ __name((dir) => {
485
- try {
486
- return readdirSync(dir);
487
- } catch {
488
- return [];
489
- }
490
- }, "safeReaddir");
491
- var runFileOf = /* @__PURE__ */ __name(({ partial, ...metadata }) => ({
492
- ...logAttributes(metadata),
493
- ...partial ? { partial: { ...logAttributes(partial), failures: partial.failures.map((failure) => logAttributes(failure)) } } : {}
494
- }), "runFileOf");
495
- var metadataOf = /* @__PURE__ */ __name((parsed) => {
496
- const { partial, ...metadata } = fromLogAttributes(parsed);
497
- if (partial === null || typeof partial !== "object")
498
- return metadata;
499
- const { failures, ...rest } = fromLogAttributes(partial);
500
- return {
501
- ...metadata,
502
- partial: {
503
- ...rest,
504
- failures: Array.isArray(failures) ? failures.map((failure) => fromLogAttributes(failure)) : []
505
- }
506
- };
507
- }, "metadataOf");
508
-
509
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/runs/scope.js
510
- import { AsyncLocalStorage } from "node:async_hooks";
511
- import { randomBytes } from "node:crypto";
512
- var scopes = new AsyncLocalStorage();
513
- var processScope;
514
- var currentRun = /* @__PURE__ */ __name(() => {
515
- const scope = scopes.getStore();
516
- if (scope)
517
- return scope;
518
- processScope ??= {
519
- runId: newRunId(/* @__PURE__ */ new Date(), "process"),
520
- command: "",
521
- startedAt: Date.now(),
522
- ...traceOf(process.env)
523
- };
524
- return processScope;
525
- }, "currentRun");
526
- var inRun = /* @__PURE__ */ __name((scope, body) => scopes.run(scope, body), "inRun");
527
- var runEvent = /* @__PURE__ */ __name((event) => scopes.getStore()?.events?.(event), "runEvent");
528
- var typedCommand = /* @__PURE__ */ __name((tool, words2, profile = currentRun().profile) => [tool, profile, words2].filter((part) => part !== void 0 && part !== "").join(" "), "typedCommand");
529
- var useAsProcessRun = /* @__PURE__ */ __name((scope) => {
530
- processScope = scope;
531
- }, "useAsProcessRun");
532
- var processRun = /* @__PURE__ */ __name(() => processScope, "processRun");
533
- var enclosingTraceId = /* @__PURE__ */ __name(() => scopes.getStore()?.traceId, "enclosingTraceId");
534
- var traceOf = /* @__PURE__ */ __name((env) => {
535
- const traceId = traceIdOf(env.TRACEPARENT);
536
- return traceId === void 0 ? {} : { traceId };
537
- }, "traceOf");
538
- var childTrace = /* @__PURE__ */ __name(() => {
539
- const hex = /* @__PURE__ */ __name((bytes) => randomBytes(bytes).toString("hex"), "hex");
540
- const traceId = hex(16);
541
- return { traceId, traceparent: `00-${traceId}-${hex(8)}-01` };
542
- }, "childTrace");
543
- var attempts = new AsyncLocalStorage();
544
- var withAttempt = /* @__PURE__ */ __name((attempt, work) => attempts.run(attempt, work), "withAttempt");
545
- var currentAttempt = /* @__PURE__ */ __name(() => attempts.getStore(), "currentAttempt");
546
-
547
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/domain/duration.js
67
+ // node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/domain/duration.js
548
68
  var DURATION = /^(\d+)(ms|s|m|h|d)$/;
549
69
  var UNIT_MS = { ms: 1, s: 1e3, m: 6e4, h: 36e5, d: 864e5 };
550
70
  var parseDuration = /* @__PURE__ */ __name((value, source) => {
@@ -558,7 +78,9 @@ var parseDuration = /* @__PURE__ */ __name((value, source) => {
558
78
  return ms;
559
79
  }, "parseDuration");
560
80
 
561
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/embeddings/models.js
81
+ // node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/embeddings/models.js
82
+ import { existsSync } from "node:fs";
83
+ import { join } from "node:path";
562
84
  var huggingFace = /* @__PURE__ */ __name((repository, commit) => (name) => `https://huggingface.co/${repository}/resolve/${commit}/${name}`, "huggingFace");
563
85
  var e5 = huggingFace("Xenova/multilingual-e5-small", "761b726dd34fb83930e26aab4e9ac3899aa1fa78");
564
86
  var e5Large = huggingFace("Xenova/multilingual-e5-large", "00fc3aeb3dbb95842de2ac1961d33c6319acf57b");
@@ -605,9 +127,13 @@ var TEXT_MODELS = [
605
127
  languages: "over 100 languages \u2014 the best of the two on chat, about seven times slower",
606
128
  licence: "Gemma Terms of Use",
607
129
  terms: "https://ai.google.dev/gemma/terms",
130
+ // Gemma Terms of Use §3.1: every copy carries this notice and the use restrictions of §3.2.
131
+ notice: "Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms. Its use is restricted by the Gemma Prohibited Use Policy: https://ai.google.dev/gemma/prohibited_use_policy",
608
132
  dims: 768,
609
133
  maxTokens: 2048,
610
- chunksPerSecond: 2,
134
+ // 2026-11-08, 1,200-character chunks, 8 threads on the Ryzen AI 9 HX 470: 8.3 chunks/s against e5-small's 52.7, so
135
+ // 5 on the scale e5-small's 31 sets. It was 2, which held a memo sync to 39 chunks.
136
+ chunksPerSecond: 5,
611
137
  pooling: "sentence_embedding",
612
138
  prefix: { query: "task: search result | query: ", passage: "title: none | text: " },
613
139
  onnx: "onnx/model_q4.onnx",
@@ -674,7 +200,8 @@ var TEXT_MODELS = [
674
200
  ]
675
201
  }
676
202
  ];
677
- var DEFAULT_TEXT_MODEL = "e5-small";
203
+ var DEFAULT_TEXT_MODEL = "embeddinggemma";
204
+ var PREVIOUS_DEFAULT_TEXT_MODEL = "e5-small";
678
205
  var SECTION = "text_models";
679
206
  var slug = pipe(string(), regex(/^[a-z0-9][a-z0-9._-]{0,62}$/, "is not a model id: a-z, 0-9, . _ -"));
680
207
  var words = pipe(string(), trim(), minLength(1), maxLength(300));
@@ -741,9 +268,17 @@ var textModel = /* @__PURE__ */ __name((id2, env = process.env) => {
741
268
  }
742
269
  return found;
743
270
  }, "textModel");
271
+ var downloaded = /* @__PURE__ */ __name((id2, env) => {
272
+ const model = TEXT_MODELS.find((one) => one.id === id2);
273
+ const directory = sharedModelsDirectory("text", env);
274
+ return model !== void 0 && filesPresent(model.files.map((file) => [file, join(directory, model.id, file.name)]));
275
+ }, "downloaded");
744
276
  var chosenTextModel = /* @__PURE__ */ __name((env = process.env) => {
745
277
  const use = readTextModelsSection(env).use;
746
- return use === void 0 ? { id: DEFAULT_TEXT_MODEL, from: "default" } : { id: use, from: "chosen" };
278
+ if (use !== void 0)
279
+ return { id: use, from: "chosen" };
280
+ const kept = !downloaded(DEFAULT_TEXT_MODEL, env) && existsSync(join(sharedModelsDirectory("text", env), PREVIOUS_DEFAULT_TEXT_MODEL));
281
+ return { id: kept ? PREVIOUS_DEFAULT_TEXT_MODEL : DEFAULT_TEXT_MODEL, from: "default" };
747
282
  }, "chosenTextModel");
748
283
  var mmarco = huggingFace("cross-encoder/mmarco-mMiniLMv2-L12-H384-v1", "1427fd652930e4ba29e8149678df786c240d8825");
749
284
  var bge = huggingFace("onnx-community/bge-reranker-v2-m3-ONNX", "6f5ff65298512715a1e669753bc754d2bc8f367b");
@@ -820,14 +355,262 @@ var vectorModelKey = /* @__PURE__ */ __name((model) => {
820
355
  }, "vectorModelKey");
821
356
  var meaningFloor = /* @__PURE__ */ __name((key) => key === "local:e5-small:384" ? 0.8 : 0, "meaningFloor");
822
357
 
823
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/sends/guarded.js
824
- import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
358
+ // node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/entities/task.js
359
+ var closeSuggestion = strictObject({
360
+ as: picklist(["done", "dismissed"]),
361
+ /** The agent's name. */
362
+ by: text,
363
+ /** 0–1, as the agent rated it. */
364
+ certainty: number(),
365
+ reason: nullable(text),
366
+ at: time
367
+ });
368
+ var task = strictObject({
369
+ ref: reference,
370
+ id,
371
+ /** The readable key: `Q-15` for a task found in a message from now on, `IN1A2B3C4D-17` before, `HRB-12` in a project. */
372
+ key: optional(nullable(text)),
373
+ title: nullable(text),
374
+ description: optional(nullable(text)),
375
+ kind: picklist(TASK_TYPES),
376
+ state: picklist(TASK_STATES),
377
+ origin: optional(picklist(TASK_ORIGINS)),
378
+ project: optional(nullable(text)),
379
+ /** The project's key and name, as `tasks counts` names it. */
380
+ project_key: optional(nullable(text)),
381
+ project_name: optional(nullable(text)),
382
+ /** Who added it: the owner, or an agent by its bot name. */
383
+ created_by: optional(nullable(strictObject({ type: picklist(["person", "bot"]), id, name: nullable(text), owner: boolean() }))),
384
+ account: optional(text),
385
+ /** The chat it came from, as a `chat:` reference. */
386
+ chat: optional(nullable(reference)),
387
+ /** The message it came from. */
388
+ source_message: optional(nullable(reference)),
389
+ /** `<service>:<id>`, its id in an outside service, such as `avito:4512345678`. */
390
+ external_id: optional(nullable(text)),
391
+ /** The http or https page it is about, such as an Avito ad. */
392
+ source_url: optional(nullable(text)),
393
+ /** 0 to 1, higher first; `priority_label` reads it as low, medium, high or critical. */
394
+ priority: optional(nullable(number())),
395
+ priority_label: optional(nullable(picklist(PRIORITY_LABELS))),
396
+ /** The agent working on it, apart from its assignees and its claim. */
397
+ agent: optional(nullable(text)),
398
+ /** Give it back with `--revision` to refuse a write made on a stale copy. */
399
+ revision: optional(number()),
400
+ assignments: optional(array(strictObject({ to: reference, role: picklist(["assignee", "reviewer", "watcher"]) }))),
401
+ /** Open work whose blocked-by tasks are all done. */
402
+ ready: optional(boolean()),
403
+ /** The blocked-by tasks not done yet: open (any open state), dismissed, or unavailable. */
404
+ blocked_by: optional(array(strictObject({ task: reference, state: picklist(["open", "dismissed", "unavailable"]) }))),
405
+ parent: optional(nullable(reference)),
406
+ due_at: optional(nullable(time)),
407
+ closed_at: optional(nullable(time)),
408
+ reason: optional(nullable(text)),
409
+ /** One name from the category list (`tasks categories`). */
410
+ category: optional(nullable(text)),
411
+ /** Who works on it now, and until when; null when nobody does. */
412
+ claimed_by: optional(nullable(text)),
413
+ claimed_until: optional(nullable(time)),
414
+ /** The close an agent would make, waiting on the owner: `tasks close` confirms it, `tasks reject` refuses it. */
415
+ close_suggestion: optional(nullable(closeSuggestion)),
416
+ created_at: time,
417
+ updated_at: optional(time)
418
+ });
419
+
420
+ // node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/entities/agenda.js
421
+ var agendaChat = strictObject({
422
+ chat: reference,
423
+ title: nullable(text),
424
+ kind: picklist(["dialog", "group", "channel", "saved", "unknown"]),
425
+ /** The newest message, never its text; `null` while it is not stored. */
426
+ last_message: nullable(reference),
427
+ last_message_at: time,
428
+ /** `null` when the newest message is not stored, or the messenger did not say who sent it. */
429
+ last_from_owner: nullable(boolean()),
430
+ /** Open tasks whose source is in this chat. */
431
+ open_tasks: array(id),
432
+ /** `unknown` means nothing ever fetched the chat's history; `partial` that the store holds only part of it. */
433
+ completeness: strictObject({
434
+ state: picklist(["complete", "partial", "unknown"]),
435
+ up_to_date: nullable(boolean()),
436
+ gaps: boolean(),
437
+ reaches_start: boolean(),
438
+ fetched_at: nullable(time)
439
+ }),
440
+ /** What the store holds of the chat: the count and the span, never the text. */
441
+ held: strictObject({ messages: number(), oldest_at: nullable(time), newest_at: nullable(time) })
442
+ });
443
+ var agenda = strictObject({
444
+ at: time,
445
+ account: text,
446
+ stored_at: nullable(time),
447
+ /** The store saved nothing for a day: a chat may look quiet only because nothing was synced. */
448
+ stale: boolean(),
449
+ tasks: array(strictObject({
450
+ id,
451
+ key: text,
452
+ title: nullable(text),
453
+ kind: picklist(TASK_TYPES),
454
+ category: nullable(text),
455
+ /** The message or note it came from. */
456
+ source: nullable(reference),
457
+ due_at: nullable(time),
458
+ next_check_at: nullable(time),
459
+ /** Who works on it now; only the asker's own claims are listed unless the query names claimed:. */
460
+ claimed_by: nullable(text),
461
+ claimed_until: nullable(time),
462
+ /** An agent's close waiting on the owner: `tasks close` confirms it, `tasks reject` refuses it. */
463
+ close_suggestion: nullable(closeSuggestion),
464
+ created_at: time,
465
+ reasons: array(picklist(["overdue", "due", "check", "unplanned", "close-suggested"]))
466
+ })),
467
+ /** Someone else wrote last, and the owner has not answered. */
468
+ owed: array(agendaChat),
469
+ /** The owner wrote last, and nobody answered. */
470
+ waiting: array(agendaChat),
471
+ /** The chat list says these moved and their newest message is not stored: read them first. */
472
+ unsynced: array(agendaChat),
473
+ /** Open tasks someone else does: what they owe the owner, oldest first. */
474
+ assigned: array(strictObject({
475
+ id,
476
+ key: text,
477
+ title: nullable(text),
478
+ kind: picklist(TASK_TYPES),
479
+ category: nullable(text),
480
+ source: nullable(reference),
481
+ due_at: nullable(time),
482
+ created_at: time,
483
+ /** `person:<id>`, each one who does it. */
484
+ assignees: array(reference)
485
+ })),
486
+ /** Open tasks carry these categories, which the list no longer holds: move them, or put the category back. */
487
+ unlisted_categories: array(strictObject({ name: text, open_tasks: number() }))
488
+ });
489
+
490
+ // node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/entities/attachment.js
491
+ var attachment = strictObject({
492
+ /** The message it came with, as a locator; absent inside that message. */
493
+ message: optional(reference),
494
+ /** Lower-cased: `photo`, `video`, `file`, `voice`… */
495
+ kind: text,
496
+ /** Its place among the message's attachments, from 1, as `attachments show --attachment` takes it. */
497
+ position: optional(count),
498
+ url: optional(text),
499
+ name: optional(text),
500
+ title: optional(text),
501
+ mime: optional(text),
502
+ size: optional(count),
503
+ width: optional(count),
504
+ height: optional(count),
505
+ /** Seconds, for audio and video. */
506
+ duration: optional(number()),
507
+ /** The text read out of it; how it was read is `extraction`. */
508
+ text: optional(text),
509
+ extraction: optional(strictObject({ origin: text, extractor: text, chars: count, error: optional(text) })),
510
+ local_path: optional(text),
511
+ /** A shared contact card (`kind: "contact"`); the phone is the whole number as the sender put it. */
512
+ contact: optional(strictObject({
513
+ name: text,
514
+ first_name: optional(text),
515
+ last_name: optional(text),
516
+ phone: optional(text),
517
+ user_id: optional(id)
518
+ })),
519
+ /** A bot's keyboard under the message, row by row; `messages press` presses one. */
520
+ buttons: optional(array(array(strictObject({
521
+ kind: picklist(["callback", "link", "message", "chat", "contact", "location", "app", "clipboard", "other"]),
522
+ text,
523
+ url: optional(text)
524
+ }))))
525
+ });
526
+ var hitFile = strictObject({
527
+ position: count,
528
+ kind: text,
529
+ name: optional(text),
530
+ size: optional(count),
531
+ /** The saved copy on this computer, once `messages download` fetched it; absent until then. */
532
+ local_path: optional(text)
533
+ });
534
+
535
+ // node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/entities/conversation.js
536
+ var conversation = strictObject({
537
+ id,
538
+ chat: reference,
539
+ /** The message it starts with. */
540
+ first_message: reference,
541
+ started_at: time,
542
+ ended_at: time,
543
+ messages_count: count,
544
+ /** How many people wrote in it. */
545
+ senders_count: count,
546
+ built_at: time,
547
+ rules_version: count
548
+ });
549
+
550
+ // node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/entities/tagging.js
551
+ var tagging = strictObject({
552
+ tag: text,
553
+ type: picklist(TAG_TYPES),
554
+ /** What carries it: a `chat:`, `contact:` or `msg:` reference. */
555
+ target: reference,
556
+ /** The chat's title or the person's name, as the store holds it. */
557
+ name: nullable(text),
558
+ /** Who claims it: `manual` the owner, `auto` the keyword rules; both when both do. */
559
+ sources: array(picklist(["manual", "auto"])),
560
+ created_at: time
561
+ });
562
+
563
+ // node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/background/budget.js
564
+ var DEADLINE_MARGIN_MS = 5e3;
565
+ var DEADLINE_MARGIN_SHARE = 0.15;
566
+ var DEFAULT_REQUEST_MS = 2e3;
567
+ var deadlineMargin = /* @__PURE__ */ __name((deadline) => Math.max(DEADLINE_MARGIN_MS, deadline.ms * DEADLINE_MARGIN_SHARE), "deadlineMargin");
568
+ var requestsFor = /* @__PURE__ */ __name((deadline, requestMs = DEFAULT_REQUEST_MS) => deadline === void 0 ? null : Math.max(1, Math.floor((deadline.ms - deadlineMargin(deadline)) / requestMs)), "requestsFor");
569
+ var runBudget = /* @__PURE__ */ __name(({ requests, deadline, requestMs, signal, now = Date.now } = {}) => {
570
+ const fits = requestsFor(deadline, requestMs);
571
+ const limit = fits === null ? requests ?? null : Math.min(fits, requests ?? fits);
572
+ const margin = deadline ? deadlineMargin(deadline) : 0;
573
+ let used = 0;
574
+ let stopped2 = null;
575
+ let last;
576
+ let slowest = 0;
577
+ return {
578
+ take() {
579
+ if (stopped2)
580
+ return stopped2;
581
+ const at = now();
582
+ if (last !== void 0)
583
+ slowest = Math.max(slowest, at - last);
584
+ if (signal?.aborted)
585
+ stopped2 = "cancelled";
586
+ else if (limit !== null && used >= limit)
587
+ stopped2 = "requests";
588
+ else if (deadline && at + margin + slowest >= deadline.endsAt)
589
+ stopped2 = "deadline";
590
+ if (stopped2)
591
+ return stopped2;
592
+ used += 1;
593
+ last = at;
594
+ return null;
595
+ },
596
+ get used() {
597
+ return used;
598
+ },
599
+ limit,
600
+ get stopped() {
601
+ return stopped2;
602
+ }
603
+ };
604
+ }, "runBudget");
605
+
606
+ // node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/sends/guarded.js
607
+ import { AsyncLocalStorage } from "node:async_hooks";
825
608
  var sentIds = /* @__PURE__ */ __name((typed, message) => ({
826
609
  messageId: message.id,
827
610
  ...message.chatId && message.chatId !== typed ? { resultChatId: message.chatId } : {}
828
611
  }), "sentIds");
829
- var current = new AsyncLocalStorage2();
830
- var writesInFlight = new AsyncLocalStorage2();
612
+ var current = new AsyncLocalStorage();
613
+ var writesInFlight = new AsyncLocalStorage();
831
614
  var parents = /* @__PURE__ */ new WeakMap();
832
615
  var stopped = /* @__PURE__ */ new WeakMap();
833
616
  var scopesFor = /* @__PURE__ */ __name((scope = writesInFlight.getStore()) => {
@@ -847,18 +630,18 @@ var stopWrites = /* @__PURE__ */ __name((scope, reason) => {
847
630
  for (const write of scope)
848
631
  write.cut();
849
632
  }, "stopWrites");
850
- var refuseStopped = /* @__PURE__ */ __name((scopes2) => {
851
- for (const scope of scopes2)
633
+ var refuseStopped = /* @__PURE__ */ __name((scopes) => {
634
+ for (const scope of scopes)
852
635
  if (stopped.has(scope))
853
636
  throw stopped.get(scope);
854
637
  }, "refuseStopped");
855
638
  var currentOperation = /* @__PURE__ */ __name(() => current.getStore(), "currentOperation");
856
639
  var guardedWrite = /* @__PURE__ */ __name(async (guard, attempt, act, settled = () => ({}), prepare) => {
857
- const scopes2 = scopesFor();
858
- refuseStopped(scopes2);
640
+ const scopes = scopesFor();
641
+ refuseStopped(scopes);
859
642
  try {
860
643
  await guard.ask?.(attempt);
861
- refuseStopped(scopes2);
644
+ refuseStopped(scopes);
862
645
  if (guard.reserve) {
863
646
  guard.check(attempt, { reserve: false });
864
647
  await guard.reserve(attempt);
@@ -869,7 +652,7 @@ var guardedWrite = /* @__PURE__ */ __name(async (guard, attempt, act, settled =
869
652
  throw error;
870
653
  }
871
654
  try {
872
- refuseStopped(scopes2);
655
+ refuseStopped(scopes);
873
656
  } catch (error) {
874
657
  guard.record({ ...attempt, outcome: "failed", errorCode: codeOf(error) });
875
658
  throw error;
@@ -894,7 +677,7 @@ var guardedWrite = /* @__PURE__ */ __name(async (guard, attempt, act, settled =
894
677
  });
895
678
  }, "cut")
896
679
  };
897
- for (const scope of scopes2)
680
+ for (const scope of scopes)
898
681
  scope.add(flight);
899
682
  try {
900
683
  if (prepare !== void 0)
@@ -920,23 +703,13 @@ var guardedWrite = /* @__PURE__ */ __name(async (guard, attempt, act, settled =
920
703
  throw new CliError(error.code, error.message, { ...error.details, sent: false });
921
704
  throw error;
922
705
  } finally {
923
- for (const scope of scopes2)
706
+ for (const scope of scopes)
924
707
  scope.delete(flight);
925
708
  }
926
709
  }, "guardedWrite");
927
710
  var codeOf = /* @__PURE__ */ __name((error) => typeof error?.code === "string" ? error.code : "unknown", "codeOf");
928
711
 
929
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/models/endpoint.js
930
- var endpoint = /* @__PURE__ */ __name((value) => {
931
- try {
932
- const url2 = new URL(value);
933
- return ["https:", "http:"].includes(url2.protocol) && !url2.username && !url2.password && !url2.search && !url2.hash;
934
- } catch {
935
- return false;
936
- }
937
- }, "endpoint");
938
-
939
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/models/settings.js
712
+ // node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/models/settings.js
940
713
  var MODEL_FIELDS = ["provider", "model", "base_url"];
941
714
  var modelSettingsShape = record(pipe(string(), regex(/^[a-z][a-z0-9-]*$/)), strictObject({
942
715
  provider: optional(picklist(["off", "openai", "anthropic"])),
@@ -1005,16 +778,16 @@ var modelTarget = /* @__PURE__ */ __name((settings, purpose) => {
1005
778
  };
1006
779
  }, "modelTarget");
1007
780
 
1008
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/services/history-limits.js
781
+ // node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/services/history-limits.js
1009
782
  var HISTORY_MAX_DAYS = 1095;
1010
783
  var DEFAULT_HISTORY_LIMITS = { dialogDays: 1095, groupDays: 365, groupMembersMax: 50 };
1011
- var DAY_MS2 = 24 * 60 * 60 * 1e3;
784
+ var DAY_MS = 24 * 60 * 60 * 1e3;
1012
785
  var historyWindow = /* @__PURE__ */ __name((shape, limits, now) => {
1013
786
  const group = shape !== void 0 && shape.kind !== "dialog" && shape.kind !== "saved";
1014
787
  if (group && (shape.participantsCount ?? 0) > limits.groupMembersMax)
1015
788
  return { skip: "group_too_large", members: shape.participantsCount ?? 0 };
1016
- const days2 = group ? limits.groupDays : limits.dialogDays;
1017
- return { keepFrom: now - Math.min(days2, HISTORY_MAX_DAYS) * DAY_MS2 };
789
+ const days = group ? limits.groupDays : limits.dialogDays;
790
+ return { keepFrom: now - Math.min(days, HISTORY_MAX_DAYS) * DAY_MS };
1018
791
  }, "historyWindow");
1019
792
  var limitBatch = /* @__PURE__ */ __name((batch, shapes, included, limits, now = Date.now()) => {
1020
793
  const skipped = /* @__PURE__ */ new Map();
@@ -1052,205 +825,7 @@ var limitBatch = /* @__PURE__ */ __name((batch, shapes, included, limits, now =
1052
825
  return { batch: { ...batch, messages }, skipped };
1053
826
  }, "limitBatch");
1054
827
 
1055
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/entities/task.js
1056
- var closeSuggestion = strictObject({
1057
- as: picklist(["done", "dismissed"]),
1058
- /** The agent's name. */
1059
- by: text,
1060
- /** 0–1, as the agent rated it. */
1061
- certainty: number(),
1062
- reason: nullable(text),
1063
- at: time
1064
- });
1065
- var task = strictObject({
1066
- ref: reference,
1067
- id,
1068
- /** The readable key: `Q-15` for a task found in a message from now on, `IN1A2B3C4D-17` before, `HRB-12` in a project. */
1069
- key: optional(nullable(text)),
1070
- title: nullable(text),
1071
- description: optional(nullable(text)),
1072
- kind: picklist(TASK_TYPES),
1073
- state: picklist(TASK_STATES),
1074
- origin: optional(picklist(TASK_ORIGINS)),
1075
- project: optional(nullable(text)),
1076
- /** The project's key and name, as `tasks counts` names it. */
1077
- project_key: optional(nullable(text)),
1078
- project_name: optional(nullable(text)),
1079
- /** Who added it: the owner, or an agent by its bot name. */
1080
- created_by: optional(nullable(strictObject({ type: picklist(["person", "bot"]), id, name: nullable(text), owner: boolean() }))),
1081
- account: optional(text),
1082
- /** The chat it came from, as a `chat:` reference. */
1083
- chat: optional(nullable(reference)),
1084
- /** The message it came from. */
1085
- source_message: optional(nullable(reference)),
1086
- /** `<service>:<id>`, its id in an outside service, such as `avito:4512345678`. */
1087
- external_id: optional(nullable(text)),
1088
- /** The http or https page it is about, such as an Avito ad. */
1089
- source_url: optional(nullable(text)),
1090
- /** 0 to 1, higher first; `priority_label` reads it as low, medium, high or critical. */
1091
- priority: optional(nullable(number())),
1092
- priority_label: optional(nullable(picklist(PRIORITY_LABELS))),
1093
- /** The agent working on it, apart from its assignees and its claim. */
1094
- agent: optional(nullable(text)),
1095
- /** Give it back with `--revision` to refuse a write made on a stale copy. */
1096
- revision: optional(number()),
1097
- assignments: optional(array(strictObject({ to: reference, role: picklist(["assignee", "reviewer", "watcher"]) }))),
1098
- /** Open work whose blocked-by tasks are all done. */
1099
- ready: optional(boolean()),
1100
- /** The blocked-by tasks not done yet: open (any open state), dismissed, or unavailable. */
1101
- blocked_by: optional(array(strictObject({ task: reference, state: picklist(["open", "dismissed", "unavailable"]) }))),
1102
- parent: optional(nullable(reference)),
1103
- due_at: optional(nullable(time)),
1104
- closed_at: optional(nullable(time)),
1105
- reason: optional(nullable(text)),
1106
- /** One name from the category list (`tasks categories`). */
1107
- category: optional(nullable(text)),
1108
- /** Who works on it now, and until when; null when nobody does. */
1109
- claimed_by: optional(nullable(text)),
1110
- claimed_until: optional(nullable(time)),
1111
- /** The close an agent would make, waiting on the owner: `tasks close` confirms it, `tasks reject` refuses it. */
1112
- close_suggestion: optional(nullable(closeSuggestion)),
1113
- created_at: time,
1114
- updated_at: optional(time)
1115
- });
1116
-
1117
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/entities/agenda.js
1118
- var agendaChat = strictObject({
1119
- chat: reference,
1120
- title: nullable(text),
1121
- kind: picklist(["dialog", "group", "channel", "saved", "unknown"]),
1122
- /** The newest message, never its text; `null` while it is not stored. */
1123
- last_message: nullable(reference),
1124
- last_message_at: time,
1125
- /** `null` when the newest message is not stored, or the messenger did not say who sent it. */
1126
- last_from_owner: nullable(boolean()),
1127
- /** Open tasks whose source is in this chat. */
1128
- open_tasks: array(id),
1129
- /** `unknown` means nothing ever fetched the chat's history; `partial` that the store holds only part of it. */
1130
- completeness: strictObject({
1131
- state: picklist(["complete", "partial", "unknown"]),
1132
- up_to_date: nullable(boolean()),
1133
- gaps: boolean(),
1134
- reaches_start: boolean(),
1135
- fetched_at: nullable(time)
1136
- }),
1137
- /** What the store holds of the chat: the count and the span, never the text. */
1138
- held: strictObject({ messages: number(), oldest_at: nullable(time), newest_at: nullable(time) })
1139
- });
1140
- var agenda = strictObject({
1141
- at: time,
1142
- account: text,
1143
- stored_at: nullable(time),
1144
- /** The store saved nothing for a day: a chat may look quiet only because nothing was synced. */
1145
- stale: boolean(),
1146
- tasks: array(strictObject({
1147
- id,
1148
- key: text,
1149
- title: nullable(text),
1150
- kind: picklist(TASK_TYPES),
1151
- category: nullable(text),
1152
- /** The message or note it came from. */
1153
- source: nullable(reference),
1154
- due_at: nullable(time),
1155
- next_check_at: nullable(time),
1156
- /** Who works on it now; only the asker's own claims are listed unless the query names claimed:. */
1157
- claimed_by: nullable(text),
1158
- claimed_until: nullable(time),
1159
- /** An agent's close waiting on the owner: `tasks close` confirms it, `tasks reject` refuses it. */
1160
- close_suggestion: nullable(closeSuggestion),
1161
- created_at: time,
1162
- reasons: array(picklist(["overdue", "due", "check", "unplanned", "close-suggested"]))
1163
- })),
1164
- /** Someone else wrote last, and the owner has not answered. */
1165
- owed: array(agendaChat),
1166
- /** The owner wrote last, and nobody answered. */
1167
- waiting: array(agendaChat),
1168
- /** The chat list says these moved and their newest message is not stored: read them first. */
1169
- unsynced: array(agendaChat),
1170
- /** Open tasks someone else does: what they owe the owner, oldest first. */
1171
- assigned: array(strictObject({
1172
- id,
1173
- key: text,
1174
- title: nullable(text),
1175
- kind: picklist(TASK_TYPES),
1176
- category: nullable(text),
1177
- source: nullable(reference),
1178
- due_at: nullable(time),
1179
- created_at: time,
1180
- /** `person:<id>`, each one who does it. */
1181
- assignees: array(reference)
1182
- })),
1183
- /** Open tasks carry these categories, which the list no longer holds: move them, or put the category back. */
1184
- unlisted_categories: array(strictObject({ name: text, open_tasks: number() }))
1185
- });
1186
-
1187
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/entities/attachment.js
1188
- var attachment = strictObject({
1189
- /** The message it came with, as a locator; absent inside that message. */
1190
- message: optional(reference),
1191
- /** Lower-cased: `photo`, `video`, `file`, `voice`… */
1192
- kind: text,
1193
- /** Its place among the message's attachments, from 1, as `attachments show --attachment` takes it. */
1194
- position: optional(count),
1195
- url: optional(text),
1196
- name: optional(text),
1197
- title: optional(text),
1198
- mime: optional(text),
1199
- size: optional(count),
1200
- width: optional(count),
1201
- height: optional(count),
1202
- /** Seconds, for audio and video. */
1203
- duration: optional(number()),
1204
- /** The text read out of it; how it was read is `extraction`. */
1205
- text: optional(text),
1206
- extraction: optional(strictObject({ origin: text, extractor: text, chars: count, error: optional(text) })),
1207
- local_path: optional(text),
1208
- /** A shared contact card (`kind: "contact"`); the phone is the whole number as the sender put it. */
1209
- contact: optional(strictObject({
1210
- name: text,
1211
- first_name: optional(text),
1212
- last_name: optional(text),
1213
- phone: optional(text),
1214
- user_id: optional(id)
1215
- })),
1216
- /** A bot's keyboard under the message, row by row; `messages press` presses one. */
1217
- buttons: optional(array(array(strictObject({
1218
- kind: picklist(["callback", "link", "message", "chat", "contact", "location", "app", "clipboard", "other"]),
1219
- text,
1220
- url: optional(text)
1221
- }))))
1222
- });
1223
- var hitFile = strictObject({ position: count, kind: text, name: optional(text), size: optional(count) });
1224
-
1225
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/entities/conversation.js
1226
- var conversation = strictObject({
1227
- id,
1228
- chat: reference,
1229
- /** The message it starts with. */
1230
- first_message: reference,
1231
- started_at: time,
1232
- ended_at: time,
1233
- messages_count: count,
1234
- /** How many people wrote in it. */
1235
- senders_count: count,
1236
- built_at: time,
1237
- rules_version: count
1238
- });
1239
-
1240
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/entities/tagging.js
1241
- var tagging = strictObject({
1242
- tag: text,
1243
- type: picklist(TAG_TYPES),
1244
- /** What carries it: a `chat:`, `contact:` or `msg:` reference. */
1245
- target: reference,
1246
- /** The chat's title or the person's name, as the store holds it. */
1247
- name: nullable(text),
1248
- /** Who claims it: `manual` the owner, `auto` the keyword rules; both when both do. */
1249
- sources: array(picklist(["manual", "auto"])),
1250
- created_at: time
1251
- });
1252
-
1253
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/images/picture/models.js
828
+ // node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/images/picture/models.js
1254
829
  import { join as join2 } from "node:path";
1255
830
  var clip = /* @__PURE__ */ __name((name) => `https://huggingface.co/Xenova/clip-vit-base-patch32/resolve/d15189d7028b43f1d3e65039190477f6af591c2a/${name}`, "clip");
1256
831
  var IMAGE_MODELS = [
@@ -1304,7 +879,7 @@ var imageModelsDirectory = /* @__PURE__ */ __name((env = process.env) => sharedM
1304
879
  var placedImage = /* @__PURE__ */ __name((model, directory) => model.files.map((file) => [file, join2(directory, model.id, file.name)]), "placedImage");
1305
880
  var isImageModelInstalled = /* @__PURE__ */ __name((model, directory) => filesPresent(placedImage(model, directory)), "isImageModelInstalled");
1306
881
 
1307
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/botcheck/reasons.js
882
+ // node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/botcheck/reasons.js
1308
883
  var WEIGHTS = {
1309
884
  bot: 3,
1310
885
  scam: 3,
@@ -1329,45 +904,74 @@ var LINK = /https?:\/\/|t\.me\/|www\./i;
1329
904
  var DIGITS = /\d{5,}/;
1330
905
  var oddName = /* @__PURE__ */ __name((name) => !name?.trim() || DIGITS.test(name) || LINK.test(name), "oddName");
1331
906
 
907
+ // node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/background/checkpoints.js
908
+ import { existsSync as existsSync2, readFileSync, rmSync } from "node:fs";
909
+ import { join as join3 } from "node:path";
910
+ var PART = /^[\w@+-][\w.@+-]{0,99}$/;
911
+ var checkpointPath = /* @__PURE__ */ __name((state, profile, job) => {
912
+ for (const part of [profile, job]) {
913
+ if (!PART.test(part) || part.includes("..")) {
914
+ throw new CliError("validation_error", `a checkpoint is named by letters, digits, ".", "@" and "-" \u2014 not "${part}"`);
915
+ }
916
+ }
917
+ return join3(state, "checkpoints", profile, `${job}.json`);
918
+ }, "checkpointPath");
919
+ var readCheckpoint = /* @__PURE__ */ __name((path) => {
920
+ try {
921
+ return existsSync2(path) ? JSON.parse(readFileSync(path, "utf8")) : void 0;
922
+ } catch {
923
+ return void 0;
924
+ }
925
+ }, "readCheckpoint");
926
+ var saveCheckpoint = /* @__PURE__ */ __name((path, point, now = /* @__PURE__ */ new Date()) => {
927
+ const saved = { ...point, updated_at: now.toISOString() };
928
+ writeSecurely(path, `${JSON.stringify(saved, null, 2)}
929
+ `, 384);
930
+ return saved;
931
+ }, "saveCheckpoint");
932
+ var progressOf = /* @__PURE__ */ __name((input) => {
933
+ const total = input.total ?? null;
934
+ const updated = input.updatedAt ?? null;
935
+ return {
936
+ job: input.job,
937
+ profile: input.profile,
938
+ done: input.done,
939
+ total,
940
+ remaining: total === null ? null : Math.max(0, total - input.done),
941
+ state: input.complete ?? (total !== null && input.done >= total) ? "complete" : "partial",
942
+ updated_at: updated,
943
+ cursor_age_ms: updated === null ? null : Math.max(0, (input.now ?? /* @__PURE__ */ new Date()).getTime() - Date.parse(updated))
944
+ };
945
+ }, "progressOf");
946
+
1332
947
  export {
1333
- logAttributes,
1334
- fromLogAttributes,
1335
- snakeLogger,
1336
- LOG_ATTRIBUTES,
1337
- KEEP_RUNS_FOR_DAYS,
1338
- KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
1339
- RUNS_SIZE_LIMIT_MB,
1340
- runsDirFor,
1341
- startRun,
1342
- runtime,
1343
- newRunId,
1344
- listRuns,
1345
- findRun,
1346
- readEvents,
1347
- pruneRuns,
1348
- currentRun,
1349
- inRun,
1350
- runEvent,
1351
- typedCommand,
1352
- useAsProcessRun,
1353
- processRun,
1354
- enclosingTraceId,
1355
- traceOf,
1356
- childTrace,
1357
- withAttempt,
1358
- currentAttempt,
948
+ closeSuggestion,
949
+ task,
950
+ agenda,
951
+ attachment,
952
+ hitFile,
953
+ WEIGHTS,
954
+ LINK,
955
+ oddName,
956
+ conversation,
957
+ checkpointPath,
958
+ readCheckpoint,
959
+ saveCheckpoint,
960
+ progressOf,
961
+ tagging,
962
+ runBudget,
1359
963
  sentIds,
1360
964
  withWriteScope,
1361
965
  stopWrites,
1362
966
  currentOperation,
1363
967
  guardedWrite,
1364
968
  codeOf,
1365
- endpoint,
1366
969
  modelSettingsShape,
1367
970
  resolveModelSettings,
1368
971
  modelTarget,
1369
972
  parseDuration,
1370
973
  DEFAULT_TEXT_MODEL,
974
+ PREVIOUS_DEFAULT_TEXT_MODEL,
1371
975
  CustomTextModelShape,
1372
976
  textModelsFile,
1373
977
  readTextModelsSection,
@@ -1384,16 +988,6 @@ export {
1384
988
  DEFAULT_HISTORY_LIMITS,
1385
989
  historyWindow,
1386
990
  limitBatch,
1387
- closeSuggestion,
1388
- task,
1389
- agenda,
1390
- attachment,
1391
- hitFile,
1392
- WEIGHTS,
1393
- LINK,
1394
- oddName,
1395
- conversation,
1396
- tagging,
1397
991
  IMAGE_MODELS,
1398
992
  DEFAULT_IMAGE_MODEL,
1399
993
  imageModel,