@wirecat/drive-cli 0.64.0 → 0.65.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 (182) hide show
  1. package/dist/bin/drive.js +2 -2
  2. package/dist/bundle/{all-profiles-BPPT2AK5.js → all-profiles-PD7GJHFA.js} +14 -13
  3. package/dist/bundle/{anthropic-JW6GOJUD.js → anthropic-PJKFON5H.js} +20 -11
  4. package/dist/bundle/{app-server-KAQIOJMZ.js → app-server-6ELQA6FJ.js} +59 -56
  5. package/dist/bundle/{bun-UT7GNTPV.js → bun-P54TGES2.js} +2 -2
  6. package/dist/bundle/{bun-sqlite-2OIVV3LS.js → bun-sqlite-TND5ZRJH.js} +12 -8
  7. package/dist/bundle/chunk-2AFI4KGI.js +185 -0
  8. package/dist/bundle/{chunk-WWCYTMAV.js → chunk-3HXNDF6Q.js} +2 -2
  9. package/dist/bundle/{chunk-46CD64J2.js → chunk-3ONWN3IA.js} +166 -53
  10. package/dist/bundle/{chunk-4YRENUB5.js → chunk-42G2XNPN.js} +2 -2
  11. package/dist/bundle/chunk-4AOINPN2.js +66 -0
  12. package/dist/bundle/{chunk-ZF6GUZCE.js → chunk-4EDWLR22.js} +1 -1
  13. package/dist/bundle/{chunk-BEZJA44H.js → chunk-4Y5YBFMS.js} +7 -7
  14. package/dist/bundle/{chunk-B7XBIOMR.js → chunk-54V4H6PM.js} +16 -16
  15. package/dist/bundle/{chunk-4CNTID2X.js → chunk-5XSBCMAF.js} +4 -4
  16. package/dist/bundle/{chunk-IDAK4DDK.js → chunk-6DCLZLGX.js} +1 -1
  17. package/dist/bundle/{chunk-G4KEKKDE.js → chunk-7AQGVX5O.js} +20 -20
  18. package/dist/bundle/{chunk-34BIDKF4.js → chunk-7TAP7Y2E.js} +508 -155
  19. package/dist/bundle/{chunk-BZ2ZKILM.js → chunk-A27UVLPK.js} +3 -3
  20. package/dist/bundle/{chunk-SIOIMO62.js → chunk-A4QNADEX.js} +57 -51
  21. package/dist/bundle/{chunk-FXBHOCJK.js → chunk-ADLS6FVG.js} +1 -1
  22. package/dist/bundle/{chunk-66AF4FBW.js → chunk-B2LPCHQN.js} +4 -4
  23. package/dist/bundle/{chunk-M73NNJ3X.js → chunk-CGQRZRTH.js} +2 -2
  24. package/dist/bundle/{chunk-KVW4XNKB.js → chunk-CWLL63JD.js} +107 -48
  25. package/dist/bundle/{chunk-CPMRM3GQ.js → chunk-D6Z43SOG.js} +1592 -335
  26. package/dist/bundle/{chunk-QXCKJUZY.js → chunk-D7WB54P7.js} +111 -27
  27. package/dist/bundle/{chunk-VT2UFYPJ.js → chunk-DA63E2UM.js} +13 -9
  28. package/dist/bundle/{chunk-2FEZ24DK.js → chunk-ECEP4SO3.js} +20 -20
  29. package/dist/bundle/{chunk-ZSZJLJIA.js → chunk-EHU6EYGO.js} +38 -28
  30. package/dist/bundle/{chunk-EJ4PNHPP.js → chunk-ELJUBPY4.js} +1 -1
  31. package/dist/bundle/{chunk-F2VDAG32.js → chunk-EM7NL5ES.js} +3 -3
  32. package/dist/bundle/{chunk-O2QO5UZC.js → chunk-EU5MD24W.js} +13 -13
  33. package/dist/bundle/{chunk-KIN6PDFE.js → chunk-EZ2OLYEK.js} +4 -4
  34. package/dist/bundle/{chunk-OH3K2E7X.js → chunk-F56DRBGY.js} +655 -1220
  35. package/dist/bundle/{chunk-VIJ6ACYB.js → chunk-FA6JNXCC.js} +8 -8
  36. package/dist/bundle/{chunk-KE4XPPRQ.js → chunk-FBHSWQU7.js} +1531 -136
  37. package/dist/bundle/{chunk-ZRZ4HTCK.js → chunk-GW3LBY3T.js} +51 -67
  38. package/dist/bundle/{chunk-6B37XO6B.js → chunk-HP3NT6JJ.js} +3 -3
  39. package/dist/bundle/{chunk-IX7NQJLY.js → chunk-I272E6UR.js} +9 -8
  40. package/dist/bundle/{chunk-5HSRQ53R.js → chunk-IBO23OID.js} +2 -2
  41. package/dist/bundle/{chunk-EZ6O3ST3.js → chunk-II4S2DBJ.js} +3 -3
  42. package/dist/bundle/{chunk-3NULZGQU.js → chunk-IKHOIXJR.js} +2 -2
  43. package/dist/bundle/{chunk-JRXFW7HE.js → chunk-IMHW7VIV.js} +5 -5
  44. package/dist/bundle/{chunk-USLZE36C.js → chunk-JMJIH6JH.js} +6 -6
  45. package/dist/bundle/{chunk-C7WBNOYW.js → chunk-JPPPLKAO.js} +26 -1
  46. package/dist/bundle/{chunk-EQEGJVO2.js → chunk-LMKPP2JP.js} +1 -1
  47. package/dist/bundle/{chunk-G3NULXOM.js → chunk-M7ELUGU6.js} +4 -4
  48. package/dist/bundle/{chunk-6G53ZFUT.js → chunk-MCPOZNWG.js} +1 -1
  49. package/dist/bundle/{chunk-EWGVDFPT.js → chunk-NI5PD5KM.js} +39203 -35871
  50. package/dist/bundle/{chunk-AHB4OJCI.js → chunk-NQ5XMSLA.js} +3678 -2049
  51. package/dist/bundle/chunk-NQRTKYJB.js +257 -0
  52. package/dist/bundle/{chunk-3J5KAFNA.js → chunk-O6K2E7OA.js} +3917 -3005
  53. package/dist/bundle/{chunk-J62DI53V.js → chunk-O7ZDCOZE.js} +1 -1
  54. package/dist/bundle/{chunk-XPXKD63J.js → chunk-OFJXHEFT.js} +13 -13
  55. package/dist/bundle/chunk-OWMZUWCM.js +109 -0
  56. package/dist/bundle/chunk-PHOL2DZM.js +138 -0
  57. package/dist/bundle/{chunk-KG2XKEHL.js → chunk-PLP5527C.js} +5 -5
  58. package/dist/bundle/{chunk-5ZBR55US.js → chunk-RNHGQ35R.js} +1 -1
  59. package/dist/bundle/{chunk-IK6KH3RE.js → chunk-RX5CJ55S.js} +1 -1
  60. package/dist/bundle/{chunk-K6BSB53R.js → chunk-SE352DBY.js} +1 -1
  61. package/dist/bundle/chunk-SEQWBZYH.js +18 -0
  62. package/dist/bundle/{chunk-LOMW6F2E.js → chunk-SIWXYB4E.js} +3734 -3448
  63. package/dist/bundle/{chunk-GW3U6OLD.js → chunk-SNLSEYJO.js} +1 -1
  64. package/dist/bundle/{chunk-UJR272CP.js → chunk-SS4LKLD7.js} +52 -605
  65. package/dist/bundle/{chunk-BEUAICUD.js → chunk-TMHF4BCL.js} +2 -2
  66. package/dist/bundle/{chunk-BDYWZ7JE.js → chunk-TOVWMURV.js} +30 -6
  67. package/dist/bundle/{chunk-N622LRPM.js → chunk-TTP4NOP3.js} +4 -4
  68. package/dist/bundle/chunk-UTNRBOEN.js +53 -0
  69. package/dist/bundle/{chunk-36GPBPWM.js → chunk-VDZY3L7U.js} +3 -1
  70. package/dist/bundle/chunk-VHQYWFWV.js +13 -0
  71. package/dist/bundle/{chunk-VPLFD5RJ.js → chunk-VLXWAH5E.js} +4 -4
  72. package/dist/bundle/{chunk-UIEA6FIV.js → chunk-VMAMRFFC.js} +23 -23
  73. package/dist/bundle/{chunk-HW4UPST2.js → chunk-W2XY6C5S.js} +2 -2
  74. package/dist/bundle/{chunk-P7DEGRZA.js → chunk-WRAUO5EJ.js} +22 -24
  75. package/dist/bundle/{chunk-QEAD2LF4.js → chunk-WRMJN6UQ.js} +3 -3
  76. package/dist/bundle/{chunk-UD55VB2N.js → chunk-WVJHZIDH.js} +3 -3
  77. package/dist/bundle/{chunk-B67BLRAI.js → chunk-X7YGGWXI.js} +1 -59
  78. package/dist/bundle/{chunk-EC2XGDKJ.js → chunk-XPWZSW6Y.js} +4 -4
  79. package/dist/bundle/{chunk-E2LBCCTG.js → chunk-XYE7XZPB.js} +5 -5
  80. package/dist/bundle/{chunk-TNV2FXVK.js → chunk-Y5PKRITX.js} +5 -5
  81. package/dist/bundle/{chunk-5OFA5EXE.js → chunk-Z2ADO6UA.js} +2 -2
  82. package/dist/bundle/{chunk-PBMSBCVB.js → chunk-ZD4MB7NH.js} +1 -1
  83. package/dist/bundle/{chunk-2W464HAE.js → chunk-ZILALBYQ.js} +4 -4
  84. package/dist/bundle/{chunk-OEVHZOHC.js → chunk-ZR2EJPMQ.js} +44 -15
  85. package/dist/bundle/command-contract-25E4PYMD.js +40 -0
  86. package/dist/bundle/command-server-entry-36JXYIJB.js +170 -0
  87. package/dist/bundle/{decode-HTOQ6S3V.js → decode-T5ZW57WZ.js} +8 -8
  88. package/dist/bundle/{dispatch-SH5SP6LA.js → dispatch-RMA2XFYA.js} +9 -9
  89. package/dist/bundle/drive.js +11 -11
  90. package/dist/bundle/{echarts-KFHB6SLX.js → echarts-KQ44LPSF.js} +2 -2
  91. package/dist/bundle/{embed-YATFB2PN.js → embed-Q7XST53J.js} +9 -9
  92. package/dist/bundle/{embedder-MQPDFGTJ.js → embedder-RWZSBVW2.js} +12 -12
  93. package/dist/bundle/entry-HPLW4QL2.js +25 -0
  94. package/dist/bundle/{failure-4FQL4XJI.js → failure-7NP4QPIN.js} +4 -4
  95. package/dist/bundle/first-run-RL3RKYZW.js +30 -0
  96. package/dist/bundle/first-screen-NX3TM2VJ.js +38 -0
  97. package/dist/bundle/google-DPD5N6AQ.js +42 -0
  98. package/dist/bundle/{google-api-QMFGCXBM.js → google-api-P5DRHD7L.js} +61 -55
  99. package/dist/bundle/grants-TX4MHLI4.js +109 -0
  100. package/dist/bundle/{identity-FYVDK4M2.js → identity-VDV6CHRW.js} +6 -6
  101. package/dist/bundle/{instructions-D3GF3B7M.js → instructions-Q45FVY6H.js} +1 -1
  102. package/dist/bundle/{login-COFZ2IWP.js → login-XKN3NI6X.js} +67 -61
  103. package/dist/bundle/{mcp-RKJG22KM.js → mcp-7KQUJNFN.js} +2 -2
  104. package/dist/bundle/{node-OFICOKX3.js → node-MSW565D3.js} +2 -2
  105. package/dist/bundle/{node-KM3CUABH.js → node-P4E63KXA.js} +9 -9
  106. package/dist/bundle/{node-sqlite-DNBTDOXD.js → node-sqlite-S74XVVHL.js} +13 -9
  107. package/dist/bundle/oauth-6R7AWAES.js +22 -0
  108. package/dist/bundle/{open-PTPR2YWX.js → open-P7UQG7XJ.js} +8 -8
  109. package/dist/bundle/{openai-2KV5LUW4.js → openai-DDHJ57KZ.js} +19 -40
  110. package/dist/bundle/{process-EAW6NST2.js → process-NMUB5SHK.js} +1 -1
  111. package/dist/bundle/{program-6UV5Q5YN.js → program-PJNWP6JW.js} +294 -137
  112. package/dist/bundle/{prompt-634TPMJK.js → prompt-VOSMK4C2.js} +8 -8
  113. package/dist/bundle/{reasons-DDWCEYSQ.js → reasons-KDAXOC5S.js} +5 -5
  114. package/dist/bundle/{recognize-SJO6QUDW.js → recognize-GZIY63HS.js} +7 -7
  115. package/dist/bundle/{remote-6JXZITKF.js → remote-V3YGN7LN.js} +10 -10
  116. package/dist/bundle/{rerank-MD5VOPQ6.js → rerank-XRU6AVN7.js} +10 -10
  117. package/dist/bundle/{serve-LZTROA2M.js → serve-NDOAFA57.js} +12 -12
  118. package/dist/bundle/{server-NSA3UAFY.js → server-BKGWJYMC.js} +46 -44
  119. package/dist/bundle/server-QD2MUJJZ.js +72 -0
  120. package/dist/bundle/{services-F5A6XQCV.js → services-TYDMFQCA.js} +101 -41
  121. package/dist/bundle/{sqlite-runtime-7YF6REKS.js → sqlite-runtime-UAFJKSJR.js} +9 -9
  122. package/dist/bundle/{start-MUFLE6FA.js → start-2ZLDP2OE.js} +7 -7
  123. package/dist/bundle/{state-UC54F3YZ.js → state-6SP27J2K.js} +9 -9
  124. package/dist/bundle/{store-J53YNAH6.js → store-4UUY545Q.js} +25 -18
  125. package/dist/bundle/{store-F5FJGWMR.js → store-EJN27MXI.js} +61 -28
  126. package/dist/bundle/store-maintenance-command-LETURZDC.js +60 -0
  127. package/dist/bundle/tokens-MTFJPTYT.js +107 -0
  128. package/dist/commands/config.d.ts.map +1 -1
  129. package/dist/commands/config.js +6 -5
  130. package/dist/commands/config.js.map +1 -1
  131. package/dist/commands/context.d.ts +4 -2
  132. package/dist/commands/context.d.ts.map +1 -1
  133. package/dist/commands/context.js.map +1 -1
  134. package/dist/commands/documents.d.ts +2 -0
  135. package/dist/commands/documents.d.ts.map +1 -1
  136. package/dist/commands/documents.js +39 -3
  137. package/dist/commands/documents.js.map +1 -1
  138. package/dist/config.d.ts +13 -0
  139. package/dist/config.d.ts.map +1 -1
  140. package/dist/config.js +32 -2
  141. package/dist/config.js.map +1 -1
  142. package/dist/documents-add.d.ts +49 -0
  143. package/dist/documents-add.d.ts.map +1 -0
  144. package/dist/documents-add.js +122 -0
  145. package/dist/documents-add.js.map +1 -0
  146. package/dist/errors.d.ts +1 -0
  147. package/dist/errors.d.ts.map +1 -1
  148. package/dist/errors.js +9 -1
  149. package/dist/errors.js.map +1 -1
  150. package/dist/knowledge.d.ts +1 -1
  151. package/dist/knowledge.d.ts.map +1 -1
  152. package/dist/knowledge.js +15 -17
  153. package/dist/knowledge.js.map +1 -1
  154. package/dist/model.d.ts +3 -0
  155. package/dist/model.d.ts.map +1 -1
  156. package/dist/model.js.map +1 -1
  157. package/dist/program.d.ts.map +1 -1
  158. package/dist/program.js +22 -15
  159. package/dist/program.js.map +1 -1
  160. package/dist/reasons.d.ts.map +1 -1
  161. package/dist/reasons.js +25 -0
  162. package/dist/reasons.js.map +1 -1
  163. package/dist/store.d.ts.map +1 -1
  164. package/dist/store.js +20 -0
  165. package/dist/store.js.map +1 -1
  166. package/dist/version.d.ts +1 -1
  167. package/dist/version.js +1 -1
  168. package/package.json +4 -4
  169. package/dist/bundle/chunk-DD7EFG6B.js +0 -35
  170. package/dist/bundle/chunk-GSMYXGFR.js +0 -62
  171. package/dist/bundle/command-contract-H5OYJOPF.js +0 -38
  172. package/dist/bundle/entry-YZBB647C.js +0 -22
  173. package/dist/bundle/first-run-5JT3UQZB.js +0 -30
  174. package/dist/bundle/first-screen-BEMDEWO7.js +0 -36
  175. package/dist/bundle/google-DVADVICN.js +0 -36
  176. package/dist/bundle/grants-WKB2E4TA.js +0 -103
  177. package/dist/bundle/oauth-PDQHWFBF.js +0 -22
  178. package/dist/bundle/server-GT7X666D.js +0 -69
  179. package/dist/bundle/store-maintenance-command-GJVXLBAB.js +0 -58
  180. package/dist/bundle/tokens-H2EJKGA5.js +0 -101
  181. package/dist/bundle/{chunk-SW6C6WH5.js → chunk-YVNHQFLC.js} +0 -0
  182. package/dist/bundle/{mdast-util-from-markdown-FXEPSNER.js → mdast-util-from-markdown-CE73EWJ2.js} +3 -3
@@ -8,18 +8,26 @@ import {
8
8
  queryFieldsOf,
9
9
  timezoneOf,
10
10
  validateQuery
11
- } from "./chunk-2FEZ24DK.js";
11
+ } from "./chunk-ECEP4SO3.js";
12
12
  import {
13
13
  isCliFailure,
14
14
  isStoreDamage
15
- } from "./chunk-B67BLRAI.js";
15
+ } from "./chunk-4AOINPN2.js";
16
16
  import {
17
17
  refuseOwnerStoreInTests
18
- } from "./chunk-DD7EFG6B.js";
18
+ } from "./chunk-UTNRBOEN.js";
19
+ import {
20
+ createRecordLog,
21
+ resolvePaths,
22
+ writeSecurely
23
+ } from "./chunk-7AQGVX5O.js";
19
24
  import {
20
25
  singleLine,
21
26
  visibleControls
22
- } from "./chunk-IDAK4DDK.js";
27
+ } from "./chunk-6DCLZLGX.js";
28
+ import {
29
+ traceIdOf
30
+ } from "./chunk-W2XY6C5S.js";
23
31
  import {
24
32
  STEPS,
25
33
  array,
@@ -46,15 +54,530 @@ import {
46
54
  string,
47
55
  union,
48
56
  unknown
49
- } from "./chunk-BDYWZ7JE.js";
57
+ } from "./chunk-TOVWMURV.js";
50
58
  import {
51
59
  CliError
52
- } from "./chunk-EJ4PNHPP.js";
60
+ } from "./chunk-ELJUBPY4.js";
53
61
  import {
54
62
  __name
55
63
  } from "./chunk-ZVVMGPBJ.js";
56
64
 
57
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/payment.js
65
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/runs/scope.js
66
+ import { AsyncLocalStorage } from "node:async_hooks";
67
+ import { randomBytes } from "node:crypto";
68
+
69
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/runs/run.js
70
+ import { randomUUID } from "node:crypto";
71
+ import { appendFileSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
72
+ import { userInfo } from "node:os";
73
+ import { join, sep } from "node:path";
74
+
75
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/runs/log-keys.js
76
+ var snake = /* @__PURE__ */ __name((key) => key.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`), "snake");
77
+ var camel = /* @__PURE__ */ __name((key) => key.replace(/_([a-z0-9])/g, (_, letter) => letter.toUpperCase()), "camel");
78
+ var renamed = /* @__PURE__ */ __name((record2, name) => Object.fromEntries(Object.entries(record2).map(([key, value]) => [name(key), value])), "renamed");
79
+ var logAttributes = /* @__PURE__ */ __name((event2) => renamed(event2, snake), "logAttributes");
80
+ var fromLogAttributes = /* @__PURE__ */ __name((attributes) => renamed(attributes, camel), "fromLogAttributes");
81
+ var snakeLogger = /* @__PURE__ */ __name((logger) => ({
82
+ debug: /* @__PURE__ */ __name((event2, message) => logger.debug(logAttributes(event2), message), "debug"),
83
+ info: /* @__PURE__ */ __name((event2, message) => logger.info(logAttributes(event2), message), "info"),
84
+ warn: /* @__PURE__ */ __name((event2, message) => logger.warn(logAttributes(event2), message), "warn"),
85
+ error: /* @__PURE__ */ __name((event2, message) => logger.error(logAttributes(event2), message), "error")
86
+ }), "snakeLogger");
87
+
88
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/runs/log-attributes.js
89
+ var diagnostic = {
90
+ event: true,
91
+ operation: true,
92
+ opcode: true,
93
+ seq: true,
94
+ status: true,
95
+ method: true,
96
+ endpointTemplate: true,
97
+ bytes: true,
98
+ ids: true,
99
+ counts: true,
100
+ durationMs: true,
101
+ outcome: true,
102
+ errorCode: true,
103
+ providerError: true,
104
+ level: true,
105
+ transport: true,
106
+ attempt: true,
107
+ waitMs: true,
108
+ code: true,
109
+ detail: true,
110
+ reason: true,
111
+ ageMs: true,
112
+ kind: true,
113
+ table: true,
114
+ op: true,
115
+ n: true
116
+ };
117
+ var send = {
118
+ profile: true,
119
+ chatId: true,
120
+ outcome: true,
121
+ kind: true,
122
+ action: true,
123
+ people: true,
124
+ messageId: true,
125
+ key: true,
126
+ count: true,
127
+ forEveryone: true,
128
+ sendId: true,
129
+ operationId: true,
130
+ parentOperationId: true,
131
+ replyTo: true,
132
+ threadId: true,
133
+ sendAs: true,
134
+ resultChatId: true,
135
+ length: true,
136
+ attachments: true,
137
+ scheduledFor: true,
138
+ notify: true,
139
+ origin: true,
140
+ reservation: true,
141
+ errorCode: true
142
+ };
143
+ var background = [
144
+ "job",
145
+ "pid",
146
+ "schedule",
147
+ "exitCode",
148
+ "tool",
149
+ "tier",
150
+ "actorType",
151
+ "actorId",
152
+ "agent",
153
+ "targetType",
154
+ "targetId"
155
+ ];
156
+ var crash = ["errorClass", "frames"];
157
+ var dropped = ["dropped"];
158
+ var LOG_ATTRIBUTES = [
159
+ ...new Set([...Object.keys(diagnostic), ...Object.keys(send), ...background, ...crash, ...dropped].map((key) => Object.keys(logAttributes({ [key]: true }))[0]))
160
+ ].sort();
161
+
162
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/runs/run.js
163
+ var KEEP_RUNS_FOR_DAYS = 30;
164
+ var KEEP_SUCCESSFUL_RUNS_FOR_DAYS = 7;
165
+ var KEEP_STORE_RUNS_FOR_DAYS = 3;
166
+ var RUNS_SIZE_LIMIT_MB = 200;
167
+ var runsDirFor = /* @__PURE__ */ __name((app, env = process.env) => join(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "runs"), "runsDirFor");
168
+ var startRun = /* @__PURE__ */ __name((options) => {
169
+ const now = options.now ?? (() => /* @__PURE__ */ new Date());
170
+ const startedAt = options.startedAt ?? now();
171
+ const id5 = options.runId ?? newRunId(startedAt, options.command);
172
+ const dir = join(options.runsDir, day(startedAt), id5);
173
+ pruneRuns(options.runsDir, {
174
+ keepDays: options.keepDays ?? KEEP_RUNS_FOR_DAYS,
175
+ keepSuccessDays: options.keepSuccessDays ?? KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
176
+ keepStoreDays: options.keepStoreDays ?? KEEP_STORE_RUNS_FOR_DAYS,
177
+ maxBytes: options.maxBytes ?? RUNS_SIZE_LIMIT_MB * 1024 * 1024,
178
+ now: startedAt
179
+ });
180
+ refuseRealStateInTests(dir);
181
+ const metadata = {
182
+ runId: id5,
183
+ command: options.command,
184
+ ...options.profile === void 0 ? {} : { profile: options.profile },
185
+ startedAt: startedAt.toISOString(),
186
+ status: "running",
187
+ cliVersion: options.cliVersion,
188
+ runtime: runtime(),
189
+ platform: process.platform,
190
+ arch: process.arch,
191
+ ...options.traceId === void 0 ? {} : { traceId: options.traceId },
192
+ ...options.context
193
+ };
194
+ let file;
195
+ const opened = /* @__PURE__ */ __name(() => {
196
+ if (file)
197
+ return file;
198
+ mkdirSync(dir, { recursive: true, mode: 448 });
199
+ const events = join(dir, "events.jsonl");
200
+ writeFileSync(events, "", { flag: "a", mode: 384 });
201
+ file = snakeLogger(createRecordLog({
202
+ to: events,
203
+ runId: id5,
204
+ command: options.command,
205
+ resource: { service: options.service, version: options.cliVersion },
206
+ allow: LOG_ATTRIBUTES,
207
+ ...options.traceId === void 0 ? {} : { traceId: options.traceId },
208
+ ...options.onError === void 0 ? {} : { onError: options.onError }
209
+ }));
210
+ writeRunFile(dir, metadata);
211
+ return file;
212
+ }, "opened");
213
+ if (!options.lazy)
214
+ opened();
215
+ let finished = false;
216
+ const operations = /* @__PURE__ */ new Set();
217
+ const codes = /* @__PURE__ */ new Set();
218
+ const tables = /* @__PURE__ */ new Set();
219
+ const noted = /* @__PURE__ */ __name((level) => (event2, message) => {
220
+ const { operation, errorCode, error_code, code, kind: kind2, table } = event2;
221
+ if (typeof operation === "string")
222
+ operations.add(operation);
223
+ if (kind2 === "store" && typeof table === "string")
224
+ tables.add(table);
225
+ for (const value of [errorCode, error_code, code])
226
+ if (typeof value === "string")
227
+ codes.add(value);
228
+ if (finished)
229
+ return;
230
+ opened()[level](event2, message);
231
+ }, "noted");
232
+ const logger = { debug: noted("debug"), info: noted("info"), warn: noted("warn"), error: noted("error") };
233
+ return {
234
+ id: id5,
235
+ dir,
236
+ logger,
237
+ finish: /* @__PURE__ */ __name(async (status, extra = {}) => {
238
+ if (finished)
239
+ return;
240
+ finished = true;
241
+ const completedAt = now();
242
+ const final = {
243
+ ...metadata,
244
+ ...extra,
245
+ status,
246
+ completedAt: completedAt.toISOString(),
247
+ durationMs: completedAt.getTime() - startedAt.getTime(),
248
+ operations: [...operations].sort(),
249
+ codes: [...codes].sort(),
250
+ ...tables.size > 0 ? { tables: [...tables].sort() } : {}
251
+ };
252
+ if (file || status !== "success") {
253
+ opened();
254
+ writeRunFile(dir, final);
255
+ return;
256
+ }
257
+ try {
258
+ mkdirSync(join(dir, ".."), { recursive: true, mode: 448 });
259
+ appendIndex(join(dir, ".."), runFileOf(final));
260
+ } catch (error) {
261
+ options.onError?.(error);
262
+ }
263
+ }, "finish")
264
+ };
265
+ }, "startRun");
266
+ var refuseRealStateInTests = /* @__PURE__ */ __name((dir, env = process.env) => {
267
+ if (env.VITEST === void 0)
268
+ return;
269
+ let home;
270
+ try {
271
+ home = userInfo().homedir;
272
+ } catch {
273
+ return;
274
+ }
275
+ if (dir.startsWith(join(home, ".local", "share") + sep))
276
+ throw new Error(`a test opened a run in the real data folder: ${dir}`);
277
+ }, "refuseRealStateInTests");
278
+ var runtime = /* @__PURE__ */ __name(() => {
279
+ const bun = process.versions.bun;
280
+ return bun ? `bun ${bun}` : `node ${process.versions.node}`;
281
+ }, "runtime");
282
+ var newRunId = /* @__PURE__ */ __name((startedAt, command) => {
283
+ const stamp = startedAt.toISOString().replace(/[-:]/g, "").replace(/\.\d+Z$/, "Z");
284
+ const slug = command.replace(/[^a-z0-9]+/gi, "-").toLowerCase();
285
+ return `${stamp}-${slug}-${randomUUID().slice(0, 6)}`;
286
+ }, "newRunId");
287
+ var INDEX = "index.jsonl";
288
+ var appendIndex = /* @__PURE__ */ __name((dayDir, written) => {
289
+ appendFileSync(join(dayDir, INDEX), `${JSON.stringify(written)}
290
+ `, { mode: 384 });
291
+ }, "appendIndex");
292
+ var writeRunFile = /* @__PURE__ */ __name((dir, metadata) => {
293
+ const written = runFileOf(metadata);
294
+ writeSecurely(join(dir, "run.json"), `${JSON.stringify(written, null, 2)}
295
+ `, 384);
296
+ try {
297
+ appendIndex(join(dir, ".."), written);
298
+ } catch {
299
+ }
300
+ }, "writeRunFile");
301
+ var matchesListFilter = /* @__PURE__ */ __name((run2, filter) => (filter.runId === void 0 || run2.runId === filter.runId) && (filter.command === void 0 || run2.command === filter.command) && (filter.profile === void 0 || run2.profile === filter.profile) && (filter.status === void 0 || run2.status === filter.status) && (filter.errorCode === void 0 || run2.errorCode === filter.errorCode), "matchesListFilter");
302
+ var listRuns = /* @__PURE__ */ __name((runsDir, { since, atLeast = Number.POSITIVE_INFINITY, filter = {} } = {}) => {
303
+ const first = since === void 0 ? void 0 : day(new Date(since));
304
+ const runs = [];
305
+ for (const date of days(runsDir).sort().reverse()) {
306
+ if (first !== void 0 && date < first || runs.length >= atLeast)
307
+ break;
308
+ for (const metadata of runsOfDay(join(runsDir, date))) {
309
+ if (matchesListFilter(metadata, filter))
310
+ runs.push(metadata);
311
+ }
312
+ }
313
+ return runs;
314
+ }, "listRuns");
315
+ var indexedRuns = /* @__PURE__ */ __name((dayDir) => {
316
+ const latest = /* @__PURE__ */ new Map();
317
+ let raw = "";
318
+ try {
319
+ raw = readFileSync(join(dayDir, INDEX), "utf8");
320
+ } catch {
321
+ }
322
+ for (const line2 of raw.split("\n")) {
323
+ if (line2.trim() === "")
324
+ continue;
325
+ try {
326
+ const metadata = metadataOf(JSON.parse(line2));
327
+ if (typeof metadata.runId === "string")
328
+ latest.set(metadata.runId, metadata);
329
+ } catch {
330
+ }
331
+ }
332
+ return latest;
333
+ }, "indexedRuns");
334
+ var runsOfDay = /* @__PURE__ */ __name((dayDir) => {
335
+ const latest = indexedRuns(dayDir);
336
+ for (const entry of safeReaddir(dayDir)) {
337
+ if (entry === INDEX || entry.startsWith(".") || latest.has(entry))
338
+ continue;
339
+ const metadata = readRun(join(dayDir, entry));
340
+ if (metadata)
341
+ latest.set(metadata.runId, metadata);
342
+ }
343
+ return [...latest.values()].sort((a, b) => a.runId < b.runId ? 1 : a.runId > b.runId ? -1 : 0);
344
+ }, "runsOfDay");
345
+ var findRun = /* @__PURE__ */ __name((runsDir, id5) => {
346
+ const stamped = /^(\d{4})(\d{2})(\d{2})T/.exec(id5);
347
+ const likely = stamped ? [`${stamped[1]}-${stamped[2]}-${stamped[3]}`] : [];
348
+ const dates = [.../* @__PURE__ */ new Set([...likely, ...days(runsDir)])];
349
+ for (const date of dates) {
350
+ const dir = join(runsDir, date, id5);
351
+ const metadata = readRun(dir);
352
+ if (metadata)
353
+ return { dir, metadata };
354
+ }
355
+ for (const date of dates) {
356
+ const metadata = indexedRuns(join(runsDir, date)).get(id5);
357
+ if (metadata)
358
+ return { dir: join(runsDir, date, id5), metadata };
359
+ }
360
+ return void 0;
361
+ }, "findRun");
362
+ var readEvents = /* @__PURE__ */ __name((dir) => {
363
+ let raw;
364
+ try {
365
+ raw = readFileSync(join(dir, "events.jsonl"), "utf8");
366
+ } catch {
367
+ return [];
368
+ }
369
+ const events = [];
370
+ for (const line2 of raw.split("\n")) {
371
+ if (line2.trim() === "")
372
+ continue;
373
+ try {
374
+ const parsed = JSON.parse(line2);
375
+ if (parsed !== null && typeof parsed === "object")
376
+ events.push(eventOf(parsed));
377
+ } catch {
378
+ }
379
+ }
380
+ return events;
381
+ }, "readEvents");
382
+ var eventOf = /* @__PURE__ */ __name((line2) => {
383
+ const { attributes, time: time2, severity: severity2 } = line2;
384
+ if (attributes === null || typeof attributes !== "object")
385
+ return logAttributes(line2);
386
+ return { time: time2, severity: severity2, ...logAttributes(attributes) };
387
+ }, "eventOf");
388
+ var pruneRuns = /* @__PURE__ */ __name((runsDir, { keepDays, keepSuccessDays = keepDays, keepStoreDays = KEEP_STORE_RUNS_FOR_DAYS, maxBytes, now }) => {
389
+ const cutoff = day(new Date(now.getTime() - keepDays * DAY_MS));
390
+ const before = /* @__PURE__ */ __name((days2) => day(new Date(now.getTime() - Math.min(days2, keepDays) * DAY_MS)), "before");
391
+ const successCutoff = before(keepSuccessDays);
392
+ const storeCutoff = before(keepStoreDays);
393
+ const keptFor = /* @__PURE__ */ __name((metadata) => metadata.keptBecauseStore ? keepStoreDays : metadata.operations?.includes(STORE_WRITE) ? Math.max(keepSuccessDays, keepStoreDays) : keepSuccessDays, "keptFor");
394
+ let removed = 0;
395
+ for (const date of days(runsDir)) {
396
+ if (date >= cutoff) {
397
+ if (date < storeCutoff)
398
+ dropSuccesses(join(runsDir, date), STORE_RUNS_DROPPED, (metadata) => keptFor(metadata) <= keepStoreDays);
399
+ if (date < successCutoff)
400
+ dropSuccesses(join(runsDir, date), SUCCESSES_DROPPED, (metadata) => keptFor(metadata) <= keepSuccessDays);
401
+ continue;
402
+ }
403
+ try {
404
+ rmSync(join(runsDir, date), { recursive: true, force: true });
405
+ removed += 1;
406
+ } catch {
407
+ }
408
+ }
409
+ if (maxBytes !== void 0)
410
+ removed += fitSize(runsDir, maxBytes, now);
411
+ return removed;
412
+ }, "pruneRuns");
413
+ var DAY_MS = 24 * 60 * 60 * 1e3;
414
+ var STORE_WRITE = "store.write";
415
+ var SUCCESSES_DROPPED = ".successes-dropped";
416
+ var STORE_RUNS_DROPPED = ".store-runs-dropped";
417
+ var SIZE_CHECKED = ".size-checked";
418
+ var dropSuccesses = /* @__PURE__ */ __name((dayDir, marker = SUCCESSES_DROPPED, drops = () => true) => {
419
+ const done = join(dayDir, marker);
420
+ try {
421
+ statSync(done);
422
+ return;
423
+ } catch {
424
+ }
425
+ const dropped2 = /* @__PURE__ */ __name((metadata) => metadata?.status === "success" && drops(metadata), "dropped");
426
+ try {
427
+ const kept = [];
428
+ for (const [id5, metadata] of indexedRuns(dayDir)) {
429
+ if (dropped2(metadata))
430
+ rmSync(join(dayDir, id5), { recursive: true, force: true });
431
+ else
432
+ kept.push(JSON.stringify(runFileOf(metadata)));
433
+ }
434
+ for (const entry of safeReaddir(dayDir)) {
435
+ if (entry === INDEX || entry.startsWith("."))
436
+ continue;
437
+ if (dropped2(readRun(join(dayDir, entry))))
438
+ rmSync(join(dayDir, entry), { recursive: true, force: true });
439
+ }
440
+ writeSecurely(join(dayDir, INDEX), kept.map((line2) => `${line2}
441
+ `).join(""), 384);
442
+ writeFileSync(done, "", { mode: 384 });
443
+ } catch {
444
+ }
445
+ }, "dropSuccesses");
446
+ var sizeOf = /* @__PURE__ */ __name((path) => {
447
+ let total = 0;
448
+ for (const entry of safeReaddir(path)) {
449
+ const full = join(path, entry);
450
+ try {
451
+ const stat = statSync(full);
452
+ total += stat.isDirectory() ? sizeOf(full) : stat.size;
453
+ } catch {
454
+ }
455
+ }
456
+ return total;
457
+ }, "sizeOf");
458
+ var fitSize = /* @__PURE__ */ __name((runsDir, maxBytes, now) => {
459
+ const stamp = join(runsDir, SIZE_CHECKED);
460
+ const today = day(now);
461
+ try {
462
+ if (readFileSync(stamp, "utf8").trim() === today)
463
+ return 0;
464
+ } catch {
465
+ }
466
+ const dates = days(runsDir).sort();
467
+ const sizes = new Map(dates.map((date) => [date, sizeOf(join(runsDir, date))]));
468
+ let total = [...sizes.values()].reduce((sum, size) => sum + size, 0);
469
+ let removed = 0;
470
+ for (const date of dates) {
471
+ if (total <= maxBytes || date === today)
472
+ break;
473
+ dropSuccesses(join(runsDir, date));
474
+ const after = sizeOf(join(runsDir, date));
475
+ total -= (sizes.get(date) ?? 0) - after;
476
+ sizes.set(date, after);
477
+ }
478
+ for (const date of dates) {
479
+ if (total <= maxBytes || date === today)
480
+ break;
481
+ try {
482
+ rmSync(join(runsDir, date), { recursive: true, force: true });
483
+ total -= sizes.get(date) ?? 0;
484
+ removed += 1;
485
+ } catch {
486
+ }
487
+ }
488
+ try {
489
+ mkdirSync(runsDir, { recursive: true, mode: 448 });
490
+ writeFileSync(stamp, today, { mode: 384 });
491
+ } catch {
492
+ }
493
+ return removed;
494
+ }, "fitSize");
495
+ var day = /* @__PURE__ */ __name((date) => date.toISOString().slice(0, 10), "day");
496
+ var days = /* @__PURE__ */ __name((runsDir) => safeReaddir(runsDir).filter((entry) => /^\d{4}-\d{2}-\d{2}$/.test(entry)), "days");
497
+ var readRun = /* @__PURE__ */ __name((dir) => {
498
+ try {
499
+ return metadataOf(JSON.parse(readFileSync(join(dir, "run.json"), "utf8")));
500
+ } catch {
501
+ return void 0;
502
+ }
503
+ }, "readRun");
504
+ var safeReaddir = /* @__PURE__ */ __name((dir) => {
505
+ try {
506
+ return readdirSync(dir);
507
+ } catch {
508
+ return [];
509
+ }
510
+ }, "safeReaddir");
511
+ var runFileOf = /* @__PURE__ */ __name(({ partial, ...metadata }) => ({
512
+ ...logAttributes(metadata),
513
+ ...partial ? { partial: { ...logAttributes(partial), failures: partial.failures.map((failure) => logAttributes(failure)) } } : {}
514
+ }), "runFileOf");
515
+ var metadataOf = /* @__PURE__ */ __name((parsed) => {
516
+ const { partial, ...metadata } = fromLogAttributes(parsed);
517
+ if (partial === null || typeof partial !== "object")
518
+ return metadata;
519
+ const { failures, ...rest } = fromLogAttributes(partial);
520
+ return {
521
+ ...metadata,
522
+ partial: {
523
+ ...rest,
524
+ failures: Array.isArray(failures) ? failures.map((failure) => fromLogAttributes(failure)) : []
525
+ }
526
+ };
527
+ }, "metadataOf");
528
+
529
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/runs/scope.js
530
+ var scopes = new AsyncLocalStorage();
531
+ var processScope;
532
+ var ownProcesses = new AsyncLocalStorage();
533
+ var asOwnProcess = /* @__PURE__ */ __name((body) => ownProcesses.run({}, body), "asOwnProcess");
534
+ var currentRun = /* @__PURE__ */ __name(() => {
535
+ const scope2 = scopes.getStore();
536
+ if (scope2)
537
+ return scope2;
538
+ const own = ownProcesses.getStore();
539
+ const fresh = /* @__PURE__ */ __name(() => ({
540
+ runId: newRunId(/* @__PURE__ */ new Date(), "process"),
541
+ command: "",
542
+ startedAt: Date.now(),
543
+ ...traceOf(process.env)
544
+ }), "fresh");
545
+ if (own) {
546
+ own.scope ??= fresh();
547
+ return own.scope;
548
+ }
549
+ processScope ??= fresh();
550
+ return processScope;
551
+ }, "currentRun");
552
+ var inRun = /* @__PURE__ */ __name((scope2, body) => scopes.run(scope2, body), "inRun");
553
+ var runEvent = /* @__PURE__ */ __name((event2) => scopes.getStore()?.events?.(event2), "runEvent");
554
+ var typedCommand = /* @__PURE__ */ __name((tool, words2, profile = currentRun().profile) => [tool, profile, words2].filter((part) => part !== void 0 && part !== "").join(" "), "typedCommand");
555
+ var useAsProcessRun = /* @__PURE__ */ __name((scope2) => {
556
+ const own = ownProcesses.getStore();
557
+ if (own)
558
+ own.scope = scope2;
559
+ else
560
+ processScope = scope2;
561
+ }, "useAsProcessRun");
562
+ var processRun = /* @__PURE__ */ __name(() => {
563
+ const own = ownProcesses.getStore();
564
+ return own ? own.scope : processScope;
565
+ }, "processRun");
566
+ var enclosingTraceId = /* @__PURE__ */ __name(() => scopes.getStore()?.traceId, "enclosingTraceId");
567
+ var traceOf = /* @__PURE__ */ __name((env) => {
568
+ const traceId = traceIdOf(env.TRACEPARENT);
569
+ return traceId === void 0 ? {} : { traceId };
570
+ }, "traceOf");
571
+ var childTrace = /* @__PURE__ */ __name(() => {
572
+ const hex = /* @__PURE__ */ __name((bytes) => randomBytes(bytes).toString("hex"), "hex");
573
+ const traceId = hex(16);
574
+ return { traceId, traceparent: `00-${traceId}-${hex(8)}-01` };
575
+ }, "childTrace");
576
+ var attempts = new AsyncLocalStorage();
577
+ var withAttempt = /* @__PURE__ */ __name((attempt, work) => attempts.run(attempt, work), "withAttempt");
578
+ var currentAttempt = /* @__PURE__ */ __name(() => attempts.getStore(), "currentAttempt");
579
+
580
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/payment.js
58
581
  var FACT_TYPES = ["fact", "statement", "question", "decision", "promise"];
59
582
  var PAYMENT_DIRECTIONS = ["to_us", "from_us"];
60
583
  var PAYMENT_STATES = ["expected", "paid", "cancelled"];
@@ -148,7 +671,7 @@ var paymentTitle = /* @__PURE__ */ __name((fact) => {
148
671
  return `${grouped(payment.amount)} ${payment.currency} ${way}${party}${item}${due} (${payment.state})`;
149
672
  }, "paymentTitle");
150
673
 
151
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/passage.js
674
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/passage.js
152
675
  var meetingHitContextLimits = /* @__PURE__ */ __name((options = {}) => {
153
676
  const { before = 3, after = 3, bytes = 65536, max_read_bytes = 4194304, expected_fingerprint } = options;
154
677
  if (![before, after].every((value) => Number.isSafeInteger(value) && value >= 0) || before + after > 999 || !Number.isSafeInteger(bytes) || bytes < 2 || bytes > 4194304 || !Number.isSafeInteger(max_read_bytes) || max_read_bytes < 1 || max_read_bytes > 67108864 || expected_fingerprint !== void 0 && (typeof expected_fingerprint !== "string" || !/^[a-f0-9]{64}$/.test(expected_fingerprint)))
@@ -161,7 +684,7 @@ var validateMeetingPassage = /* @__PURE__ */ __name((reference2, options) => {
161
684
  throw new CliError("validation_error", "choose a cue reference and json, text or markdown output");
162
685
  }, "validateMeetingPassage");
163
686
 
164
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/reference.js
687
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/reference.js
165
688
  var invalid2 = /* @__PURE__ */ __name(() => new CliError("validation_error", "expected meeting:<accountId>/<meetingId>[/<transcriptId>[/<cuePosition>]] with safe integer IDs"), "invalid");
166
689
  var integer2 = /* @__PURE__ */ __name((value, minimum = 1) => {
167
690
  if (!Number.isSafeInteger(value) || value < minimum)
@@ -169,24 +692,24 @@ var integer2 = /* @__PURE__ */ __name((value, minimum = 1) => {
169
692
  return value;
170
693
  }, "integer");
171
694
  var formatMeetingReference = /* @__PURE__ */ __name((reference2) => {
172
- const parts = [integer2(reference2.accountId), integer2(reference2.meetingId)];
695
+ const parts2 = [integer2(reference2.accountId), integer2(reference2.meetingId)];
173
696
  if (reference2.transcriptId !== void 0)
174
- parts.push(integer2(reference2.transcriptId));
697
+ parts2.push(integer2(reference2.transcriptId));
175
698
  if (reference2.cuePosition !== void 0) {
176
699
  if (reference2.transcriptId === void 0)
177
700
  throw invalid2();
178
- parts.push(integer2(reference2.cuePosition, 0));
701
+ parts2.push(integer2(reference2.cuePosition, 0));
179
702
  }
180
- return `meeting:${parts.join("/")}`;
703
+ return `meeting:${parts2.join("/")}`;
181
704
  }, "formatMeetingReference");
182
705
  var parseMeetingReference = /* @__PURE__ */ __name((text7) => {
183
706
  const value = text7.trim();
184
707
  if (!value.startsWith("meeting:"))
185
708
  throw invalid2();
186
- const parts = value.slice(8).split("/");
187
- if (parts.length < 2 || parts.length > 4 || parts.some((part) => !/^\d+$/.test(part)))
709
+ const parts2 = value.slice(8).split("/");
710
+ if (parts2.length < 2 || parts2.length > 4 || parts2.some((part) => !/^\d+$/.test(part)))
188
711
  throw invalid2();
189
- const ids2 = parts.map(Number);
712
+ const ids2 = parts2.map(Number);
190
713
  const reference2 = {
191
714
  type: "meeting",
192
715
  accountId: integer2(ids2[0]),
@@ -198,7 +721,7 @@ var parseMeetingReference = /* @__PURE__ */ __name((text7) => {
198
721
  }, "parseMeetingReference");
199
722
  var canonicalMeetingReference = /* @__PURE__ */ __name((text7) => formatMeetingReference(parseMeetingReference(text7)), "canonicalMeetingReference");
200
723
 
201
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/item.js
724
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/item.js
202
725
  var text = string();
203
726
  var count = pipe(number(), integer(), minValue(0));
204
727
  var MEETING_ISSUES = ["time_without_zone"];
@@ -263,7 +786,7 @@ var MEETING_QUERY = {
263
786
  })
264
787
  };
265
788
 
266
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/answers.js
789
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/answers.js
267
790
  var text2 = string();
268
791
  var count2 = pipe(number(), integer(), minValue(0));
269
792
  var iso2 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
@@ -498,7 +1021,7 @@ var meetingHitsList = /* @__PURE__ */ __name((found, limit, command = "search me
498
1021
  };
499
1022
  }, "meetingHitsList");
500
1023
 
501
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/join-key.js
1024
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/join-key.js
502
1025
  var joinKeyOf = /* @__PURE__ */ __name((url) => {
503
1026
  const parsed = urlOf(url);
504
1027
  if (!parsed)
@@ -532,7 +1055,7 @@ var urlOf = /* @__PURE__ */ __name((url) => {
532
1055
  }
533
1056
  }, "urlOf");
534
1057
 
535
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/calendar-text.js
1058
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/calendar-text.js
536
1059
  var ENTITIES = { amp: "&", lt: "<", gt: ">", quot: '"', "#39": "'", apos: "'", nbsp: " " };
537
1060
  var SECRET_LINE = /(?<![\p{L}\p{N}])(pass ?codes?|passwords?|pwd|pins?|access ?codes?|meeting ?codes?|kennwort|пароль|пин-?код|код доступа)(?![\p{L}\p{N}])|pwd=/iu;
538
1061
  var htmlToText = /* @__PURE__ */ __name((html) => html.replace(/<\s*br\s*\/?>/giu, "\n").replace(/<\/\s*(p|div|li|tr|h[1-6])\s*>/giu, "\n").replace(/<a\s[^>]*href\s*=\s*"([^"]*)"[^>]*>/giu, " $1 ").replace(/<[^>]+>/gu, "").replace(/&(amp|lt|gt|quot|#39|apos|nbsp);/gu, (_, name) => ENTITIES[name] ?? ""), "htmlToText");
@@ -541,8 +1064,8 @@ var calendarText = /* @__PURE__ */ __name((text7, { dropSecretLines = true } = {
541
1064
  if (!text7)
542
1065
  return null;
543
1066
  const kept = htmlToText(text7).split(/\r?\n/u).map((line2) => withoutLinkQueries(line2).replace(/[ \t]+/gu, " ").trim()).filter((line2) => !dropSecretLines || !SECRET_LINE.test(line2));
544
- const joined = kept.join("\n").replace(/\n{3,}/gu, "\n\n").trim();
545
- return joined || null;
1067
+ const joined2 = kept.join("\n").replace(/\n{3,}/gu, "\n\n").trim();
1068
+ return joined2 || null;
546
1069
  }, "calendarText");
547
1070
  var ENTRY_METADATA_KEYS = [
548
1071
  "colorId",
@@ -569,7 +1092,7 @@ var entryMetadata = /* @__PURE__ */ __name((metadata) => {
569
1092
  return kept;
570
1093
  }, "entryMetadata");
571
1094
 
572
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/cue-fingerprint.js
1095
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/cue-fingerprint.js
573
1096
  import { createHash } from "node:crypto";
574
1097
  var meetingCueFingerprint = /* @__PURE__ */ __name((cue2) => createHash("sha256").update(JSON.stringify({
575
1098
  reference: cue2.reference,
@@ -583,7 +1106,7 @@ var meetingCueFingerprint = /* @__PURE__ */ __name((cue2) => createHash("sha256"
583
1106
  text: cue2.text
584
1107
  })).digest("hex"), "meetingCueFingerprint");
585
1108
 
586
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/event-query.js
1109
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/event-query.js
587
1110
  var EVENT_QUERY = defineQuery({
588
1111
  entity: "event",
589
1112
  backend: "sql",
@@ -599,7 +1122,7 @@ var EVENT_QUERY = defineQuery({
599
1122
  ]
600
1123
  });
601
1124
 
602
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/event-store.js
1125
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/event-store.js
603
1126
  var UNTIL = /(?:^|;)UNTIL=(\d{4})(\d{2})(\d{2})(?:T(\d{2})(\d{2})(\d{2})Z?)?(?:;|$)/iu;
604
1127
  var seriesEnd = /* @__PURE__ */ __name((entry) => {
605
1128
  if (entry.recurrenceEndsAt !== null)
@@ -608,8 +1131,8 @@ var seriesEnd = /* @__PURE__ */ __name((entry) => {
608
1131
  const until = rule === void 0 ? null : UNTIL.exec(rule.slice("RRULE:".length));
609
1132
  if (!until)
610
1133
  return Number.POSITIVE_INFINITY;
611
- const [, year, month, day, hour = "23", minute = "59", second = "59"] = until;
612
- return Date.UTC(Number(year), Number(month) - 1, Number(day), Number(hour), Number(minute), Number(second)) + 864e5;
1134
+ const [, year, month, day2, hour = "23", minute = "59", second = "59"] = until;
1135
+ return Date.UTC(Number(year), Number(month) - 1, Number(day2), Number(hour), Number(minute), Number(second)) + 864e5;
613
1136
  }, "seriesEnd");
614
1137
  var entryInWindow = /* @__PURE__ */ __name((entry, window) => {
615
1138
  if (entry.kind === "occurrence" && !entry.exception)
@@ -622,7 +1145,7 @@ var entryInWindow = /* @__PURE__ */ __name((entry, window) => {
622
1145
  return Math.max(entry.endsAt ?? start, start + 1) > window.from;
623
1146
  }, "entryInWindow");
624
1147
 
625
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/events.js
1148
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/events.js
626
1149
  var linkEvent = /* @__PURE__ */ __name(async (store, details, now = Date.now()) => {
627
1150
  const current = await store.meeting(details.meeting.id);
628
1151
  if (!current)
@@ -665,7 +1188,7 @@ var linkEvent = /* @__PURE__ */ __name(async (store, details, now = Date.now())
665
1188
  return (await store.events()).find((e) => e.id === linked?.meeting.eventId) ?? null;
666
1189
  }, "linkEvent");
667
1190
 
668
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/participant-search.js
1191
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/participant-search.js
669
1192
  var normalizeMeetingParticipantQuery = /* @__PURE__ */ __name((text7) => text7.normalize("NFKC").toLowerCase(), "normalizeMeetingParticipantQuery");
670
1193
  var validateMeetingParticipantQuery = /* @__PURE__ */ __name((query) => {
671
1194
  if (typeof query !== "string" || !query.trim() || query.length > 500 || query.includes("\0"))
@@ -689,7 +1212,7 @@ var validateMeetingParticipantSearch = /* @__PURE__ */ __name((query, input) =>
689
1212
  };
690
1213
  }, "validateMeetingParticipantSearch");
691
1214
 
692
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/reads.js
1215
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/reads.js
693
1216
  var MeetingError = class extends CliError {
694
1217
  static {
695
1218
  __name(this, "MeetingError");
@@ -821,7 +1344,7 @@ var meetingSummaryAnswer = /* @__PURE__ */ __name(async (store, id5, accountId)
821
1344
  return wholeList(details.summaries.map((one) => meetingSummaryItem(details.meeting.accountId, one)));
822
1345
  }, "meetingSummaryAnswer");
823
1346
 
824
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/export.js
1347
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/export.js
825
1348
  var timestamp = /* @__PURE__ */ __name((milliseconds) => {
826
1349
  if (!Number.isSafeInteger(milliseconds) || milliseconds < 0)
827
1350
  throw new MeetingError("validation_error", "transcript times must be nonnegative integer milliseconds");
@@ -883,30 +1406,30 @@ var exportMeeting = /* @__PURE__ */ __name(async (store, id5, options) => {
883
1406
  text: row.text
884
1407
  })));
885
1408
  } else {
886
- const parts = [`# ${heading(details.meeting.title ?? "Untitled meeting")}`, `Meeting ID: ${details.meeting.id}`];
1409
+ const parts2 = [`# ${heading(details.meeting.title ?? "Untitled meeting")}`, `Meeting ID: ${details.meeting.id}`];
887
1410
  if (details.meeting.description !== null)
888
- parts.push("## Description", quote(details.meeting.description));
1411
+ parts2.push("## Description", quote(details.meeting.description));
889
1412
  for (const summary of details.summaries) {
890
- parts.push(`## ${heading(summary.title ?? "Summary")}`);
1413
+ parts2.push(`## ${heading(summary.title ?? "Summary")}`);
891
1414
  if (summary.content !== null)
892
- parts.push(quote(summary.content));
1415
+ parts2.push(quote(summary.content));
893
1416
  else {
894
1417
  if (summary.overview !== null)
895
- parts.push(quote(summary.overview));
1418
+ parts2.push(quote(summary.overview));
896
1419
  for (const section of summary.sections)
897
- parts.push(`### ${heading(section.label)}`, quote(section.text));
1420
+ parts2.push(`### ${heading(section.label)}`, quote(section.text));
898
1421
  if (summary.nextSteps.length > 0)
899
- parts.push("### Next steps", summary.nextSteps.map((step) => `- ${markdown(step)}`).join("\n"));
1422
+ parts2.push("### Next steps", summary.nextSteps.map((step) => `- ${markdown(step)}`).join("\n"));
900
1423
  }
901
1424
  }
902
1425
  for (const part of transcripts) {
903
- parts.push(`## Transcript ${part.transcript.id}`, `Source: ${heading(part.transcript.source)}`);
1426
+ parts2.push(`## Transcript ${part.transcript.id}`, `Source: ${heading(part.transcript.source)}`);
904
1427
  if (part.transcript.supersededAt !== null)
905
- parts.push("Version: superseded");
1428
+ parts2.push("Version: superseded");
906
1429
  for (const row of [...part.rows].sort((a, b) => a.position - b.position))
907
- parts.push(`[${timestamp(row.startMs)} \u2013 ${timestamp(row.endMs)}]${row.speakerName === null ? "" : ` ${heading(row.speakerName)}`}`, quote(row.text));
1430
+ parts2.push(`[${timestamp(row.startMs)} \u2013 ${timestamp(row.endMs)}]${row.speakerName === null ? "" : ` ${heading(row.speakerName)}`}`, quote(row.text));
908
1431
  }
909
- content = `${parts.join("\n\n")}
1432
+ content = `${parts2.join("\n\n")}
910
1433
  `;
911
1434
  }
912
1435
  return {
@@ -917,10 +1440,10 @@ var exportMeeting = /* @__PURE__ */ __name(async (store, id5, options) => {
917
1440
  };
918
1441
  }, "exportMeeting");
919
1442
 
920
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
1443
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
921
1444
  import { createHash as createHash2 } from "node:crypto";
922
1445
 
923
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/timestamp.js
1446
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/timestamp.js
924
1447
  var meetingTimestamp = /* @__PURE__ */ __name((value, name) => {
925
1448
  if (typeof value !== "string" || !/^\d{4}-\d{2}-\d{2}T.+(?:Z|[+-]\d{2}:\d{2})$/i.test(value) || !Number.isFinite(Date.parse(value)))
926
1449
  throw new CliError("validation_error", `${name} must be an ISO timestamp with a timezone, such as 2026-11-09T09:00:00Z`);
@@ -931,7 +1454,7 @@ var meetingTimestamp = /* @__PURE__ */ __name((value, name) => {
931
1454
  return new Date(value).toISOString();
932
1455
  }, "meetingTimestamp");
933
1456
 
934
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
1457
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
935
1458
  var TASK_TYPES = ["bug", "feature", "chore"];
936
1459
  var invalid3 = /* @__PURE__ */ __name((message) => {
937
1460
  throw new CliError("validation_error", message);
@@ -945,10 +1468,10 @@ var findingHash = /* @__PURE__ */ __name((value) => createHash2("sha256").update
945
1468
  var snakeCase = /* @__PURE__ */ __name((key) => key.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`), "snakeCase");
946
1469
  var findingWhere = /* @__PURE__ */ __name((of) => {
947
1470
  const id5 = typeof of.id === "string" ? of.id : null;
948
- const kind = typeof of.kind === "string" ? of.kind : null;
1471
+ const kind2 = typeof of.kind === "string" ? of.kind : null;
949
1472
  return {
950
- where: id5 || kind ? ` in ${[id5, kind && `(${kind})`].filter(Boolean).join(" ")}` : "",
951
- named: { ...id5 ? { finding: id5 } : {}, ...kind ? { kind } : {} }
1473
+ where: id5 || kind2 ? ` in ${[id5, kind2 && `(${kind2})`].filter(Boolean).join(" ")}` : "",
1474
+ named: { ...id5 ? { finding: id5 } : {}, ...kind2 ? { kind: kind2 } : {} }
952
1475
  };
953
1476
  }, "findingWhere");
954
1477
  var findingFields = /* @__PURE__ */ __name((value, allowed, noun, of = value) => {
@@ -976,13 +1499,15 @@ var validEvidence = /* @__PURE__ */ __name((raw, rules) => {
976
1499
  const evidence = raw.map((item) => {
977
1500
  if (!item || typeof item !== "object")
978
1501
  return invalid3("finding evidence is a reference and fingerprint");
979
- findingFields(item, ["reference", "fingerprint"], rules.singular);
1502
+ findingFields(item, rules.quotes ? ["reference", "fingerprint", "quote"] : ["reference", "fingerprint"], rules.singular);
980
1503
  if (typeof item.reference !== "string" || typeof item.fingerprint !== "string")
981
1504
  return invalid3("evidence requires a reference and fingerprint");
982
1505
  const reference2 = rules.reference(item.reference);
983
1506
  if (!/^[a-f0-9]{64}$/.test(item.fingerprint))
984
1507
  return invalid3(`finding evidence requires exact ${rules.cited} references and fingerprints`);
985
- return { reference: reference2, fingerprint: item.fingerprint };
1508
+ if (item.quote === void 0)
1509
+ return { reference: reference2, fingerprint: item.fingerprint };
1510
+ return { reference: reference2, fingerprint: item.fingerprint, quote: findingText(item.quote, rules.quotes ?? 0) };
986
1511
  }).sort((a, b) => a.reference.localeCompare(b.reference));
987
1512
  if (new Set(evidence.map((item) => item.reference)).size !== evidence.length)
988
1513
  return invalid3(`duplicate evidence ${rules.cited}`);
@@ -1104,7 +1629,7 @@ var validateBatch = /* @__PURE__ */ __name((input, rules, most, one) => {
1104
1629
  var validateFindings = /* @__PURE__ */ __name((input, rules) => validateBatch(input, rules, 16, (finding, ids2) => validateFinding(finding, rules, ids2)), "validateFindings");
1105
1630
  var findingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "findingFingerprint");
1106
1631
 
1107
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/findings.js
1632
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/findings.js
1108
1633
  var MEETING_FINDINGS_KIND = "meeting_findings";
1109
1634
  var cue = /* @__PURE__ */ __name((raw) => {
1110
1635
  const reference2 = canonicalMeetingReference(raw);
@@ -1115,7 +1640,7 @@ var cue = /* @__PURE__ */ __name((raw) => {
1115
1640
  var validateMeetingFindings = /* @__PURE__ */ __name((input) => validateFindings(input, { plural: "meeting findings", singular: "meeting finding", cited: "cue", reference: cue }), "validateMeetingFindings");
1116
1641
  var meetingFindingFingerprint = findingFingerprint;
1117
1642
 
1118
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/hit-query.js
1643
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/hit-query.js
1119
1644
  var context = {
1120
1645
  command: "search meetings",
1121
1646
  guide: "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md#\u0432\u0441\u0442\u0440\u0435\u0447\u0438"
@@ -1178,7 +1703,7 @@ var MEETING_FIELDS = defineQuery({
1178
1703
  });
1179
1704
  var LIFTED = /* @__PURE__ */ new Set(["date", "project", "tag", "topic"]);
1180
1705
  var MEETING_FIELD_NAMES = new Set(MEETING_FIELDS.fields.map(({ name }) => name));
1181
- var liftMeetingFields = /* @__PURE__ */ __name((query, request, now) => {
1706
+ var liftMeetingFields = /* @__PURE__ */ __name((query, request, now, timezone) => {
1182
1707
  let ast;
1183
1708
  try {
1184
1709
  ast = validateQuery(parseLucene(query, { defaultField: "text", proximity: true, ...context }), MEETING_FIELDS, context);
@@ -1204,7 +1729,7 @@ var liftMeetingFields = /* @__PURE__ */ __name((query, request, now) => {
1204
1729
  if (node.field === "date") {
1205
1730
  once("since", "--since-time");
1206
1731
  once("until", "--until-time");
1207
- const range = dateRange(node.value, node.operator === "range" ? node.upper ?? "*" : node.value, node.lower_inclusive !== false, node.upper_inclusive !== false, timezoneOf(), node.span, now);
1732
+ const range = dateRange(node.value, node.operator === "range" ? node.upper ?? "*" : node.value, node.lower_inclusive !== false, node.upper_inclusive !== false, timezoneOf(timezone), node.span, now);
1208
1733
  if (range.lower !== void 0)
1209
1734
  next.since = range.lower + (range.lower_inclusive ? 0 : 1);
1210
1735
  if (range.upper !== void 0)
@@ -1235,7 +1760,7 @@ var meetingWordsQuery = /* @__PURE__ */ __name((text7) => {
1235
1760
  return { version: 1, language: "lucene-v1", root };
1236
1761
  }, "meetingWordsQuery");
1237
1762
 
1238
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/language.js
1763
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/language.js
1239
1764
  var LATIN_WORDS = {
1240
1765
  en: ["the", "and", "is", "that", "you", "this", "what", "have", "with", "are"],
1241
1766
  es: ["el", "los", "las", "por", "pero", "para", "est\xE1", "muy", "tambi\xE9n", "hay"],
@@ -1284,7 +1809,7 @@ var transcriptLanguage = /* @__PURE__ */ __name((texts) => {
1284
1809
  return null;
1285
1810
  }, "transcriptLanguage");
1286
1811
 
1287
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/ingest.js
1812
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/ingest.js
1288
1813
  var contentHash = /* @__PURE__ */ __name(async (text7) => {
1289
1814
  const bytes = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(text7));
1290
1815
  return Array.from(new Uint8Array(bytes), (byte) => byte.toString(16).padStart(2, "0")).join("");
@@ -1321,7 +1846,7 @@ var timestamp2 = /* @__PURE__ */ __name((value) => {
1321
1846
  return time2;
1322
1847
  }, "timestamp");
1323
1848
 
1324
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/transcript-text.js
1849
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/transcript-text.js
1325
1850
  var TranscriptTextError = class extends Error {
1326
1851
  static {
1327
1852
  __name(this, "TranscriptTextError");
@@ -1376,7 +1901,7 @@ var parseTranscriptText = /* @__PURE__ */ __name((input) => {
1376
1901
  return { header, lines };
1377
1902
  }, "parseTranscriptText");
1378
1903
 
1379
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/vtt.js
1904
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/vtt.js
1380
1905
  var VttError = class extends Error {
1381
1906
  static {
1382
1907
  __name(this, "VttError");
@@ -1428,7 +1953,7 @@ var parseVtt = /* @__PURE__ */ __name((input) => {
1428
1953
  return cues;
1429
1954
  }, "parseVtt");
1430
1955
 
1431
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/import.js
1956
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/import.js
1432
1957
  var importFiles = /* @__PURE__ */ __name(async (files, store, now = Date.now()) => {
1433
1958
  const report = { meetings: 0, participants: 0, transcriptRows: 0, summaries: 0, warnings: [] };
1434
1959
  for (const file of files) {
@@ -1461,10 +1986,10 @@ var importFiles = /* @__PURE__ */ __name(async (files, store, now = Date.now())
1461
1986
  return report;
1462
1987
  }, "importFiles");
1463
1988
 
1464
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/links.js
1989
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/links.js
1465
1990
  var CHAT_MESSAGES_READ = 1e5;
1466
1991
 
1467
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/provider.js
1992
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/provider.js
1468
1993
  var snapshotMeetingScope = /* @__PURE__ */ __name((scope2) => {
1469
1994
  const provider = scope2?.provider;
1470
1995
  const account = scope2?.account;
@@ -1473,7 +1998,7 @@ var snapshotMeetingScope = /* @__PURE__ */ __name((scope2) => {
1473
1998
  return Object.freeze({ provider, account });
1474
1999
  }, "snapshotMeetingScope");
1475
2000
 
1476
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/meeting-management.js
2001
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/meeting-management.js
1477
2002
  var nonempty = /* @__PURE__ */ __name((value, name) => {
1478
2003
  if (typeof value !== "string" || !value.trim())
1479
2004
  throw new CliError("validation_error", `${name} must be nonempty`);
@@ -1539,7 +2064,7 @@ var dispatchMeetingMutation = /* @__PURE__ */ __name(async (options, dispatch) =
1539
2064
  return { applied: true, value: await dispatch(signal) };
1540
2065
  }, "dispatchMeetingMutation");
1541
2066
 
1542
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/meeting-context.js
2067
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/meeting-context.js
1543
2068
  var id = /* @__PURE__ */ __name((value) => {
1544
2069
  if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 1)
1545
2070
  throw new CliError("validation_error", "meeting context identifiers must be positive integers");
@@ -1661,7 +2186,7 @@ var createMeetingContext = /* @__PURE__ */ __name((scope2, accountId, ports) =>
1661
2186
  };
1662
2187
  }, "createMeetingContext");
1663
2188
 
1664
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/preparation-context.js
2189
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/preparation-context.js
1665
2190
  var validateMeetingPreparationContext = /* @__PURE__ */ __name((original) => {
1666
2191
  if (!original || typeof original !== "object" || Array.isArray(original))
1667
2192
  throw new CliError("validation_error", "meeting preparation context is required");
@@ -1686,7 +2211,7 @@ var validateMeetingPreparationContext = /* @__PURE__ */ __name((original) => {
1686
2211
  return { ...input, limit, maxReadBytes };
1687
2212
  }, "validateMeetingPreparationContext");
1688
2213
 
1689
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-answer.js
2214
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-answer.js
1690
2215
  var count3 = pipe(number(), integer(), minValue(0));
1691
2216
  var id2 = pipe(string(), minLength(1));
1692
2217
  var meetingProjectEvidence = strictObject({
@@ -1807,7 +2332,7 @@ var meetingProjectEvidenceAnswer = /* @__PURE__ */ __name((page, prepared, comma
1807
2332
  };
1808
2333
  }, "meetingProjectEvidenceAnswer");
1809
2334
 
1810
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/search-validation.js
2335
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/search-validation.js
1811
2336
  var validateMeetingHitSearch = /* @__PURE__ */ __name((query, options = {}) => {
1812
2337
  const integer3 = /* @__PURE__ */ __name((value, low, high) => Number.isSafeInteger(value) && value >= low && value <= high, "integer");
1813
2338
  if (typeof query !== "string" || !query.trim() || query.includes("\0") || new TextEncoder().encode(query).byteLength > 65536 || !integer3(options.limit ?? 100, 1, 1e3) || !integer3(options.maxReadBytes ?? 4194304, 1, 67108864) || [
@@ -1827,7 +2352,7 @@ var validateMeetingHitSearch = /* @__PURE__ */ __name((query, options = {}) => {
1827
2352
  throw new CliError("validation_error", "choose one project selector and one tag or topic selector");
1828
2353
  }, "validateMeetingHitSearch");
1829
2354
 
1830
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-query.js
2355
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-query.js
1831
2356
  var ids = {
1832
2357
  meeting_id: "meetingId",
1833
2358
  identity_id: "participantIdentityId",
@@ -1918,7 +2443,7 @@ var prepareMeetingProjectEvidence = /* @__PURE__ */ __name((project2, request =
1918
2443
  return { project: project2.trim(), options, query: frozen.join(" AND ") };
1919
2444
  }, "prepareMeetingProjectEvidence");
1920
2445
 
1921
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/project-evidence.js
2446
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/project-evidence.js
1922
2447
  var readMeetingProjectEvidence = /* @__PURE__ */ __name(async (read, project2, request = {}, now = Date.now()) => {
1923
2448
  const prepared = prepareMeetingProjectEvidence(project2, request, now);
1924
2449
  const page = await read(prepared.project, prepared.options);
@@ -1926,7 +2451,7 @@ var readMeetingProjectEvidence = /* @__PURE__ */ __name(async (read, project2, r
1926
2451
  return meetingProjectEvidenceAnswer(page, prepared);
1927
2452
  }, "readMeetingProjectEvidence");
1928
2453
 
1929
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/pull.js
2454
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/pull.js
1930
2455
  var participantInput = /* @__PURE__ */ __name((p, provider, occurrenceId2, position, accountId) => {
1931
2456
  const { identityExternalId, ...fields2 } = p;
1932
2457
  const externalId = identityExternalId ?? (p.email ? `email:${p.email.toLowerCase()}` : p.externalId) ?? `name:${p.displayName ?? "unknown"}@${accountId}/${occurrenceId2}:${position}`;
@@ -2088,7 +2613,7 @@ unlinked`, format)],
2088
2613
  return report;
2089
2614
  }, "pull");
2090
2615
 
2091
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/read-answers.js
2616
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/read-answers.js
2092
2617
  var text4 = string();
2093
2618
  var count4 = pipe(number(), integer(), minValue(0));
2094
2619
  var id3 = pipe(number(), integer(), minValue(1));
@@ -2282,10 +2807,10 @@ var eventItem = /* @__PURE__ */ __name((one) => ({
2282
2807
  updated_at: new Date(one.updatedAt).toISOString()
2283
2808
  }), "eventItem");
2284
2809
 
2285
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/recording-transfer.js
2810
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/recording-transfer.js
2286
2811
  var strongRecordingValidator = /* @__PURE__ */ __name((value) => typeof value === "string" && value.length <= 1024 && /^"[\x21\x23-\x7e\x80-\xff]*"$/.test(value), "strongRecordingValidator");
2287
2812
 
2288
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/related-history.js
2813
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/related-history.js
2289
2814
  var validateMeetingRelatedHistory = /* @__PURE__ */ __name((original) => {
2290
2815
  if (!original || typeof original !== "object" || Array.isArray(original))
2291
2816
  throw new CliError("validation_error", "related history request is required");
@@ -2315,7 +2840,7 @@ var validateMeetingRelatedHistory = /* @__PURE__ */ __name((original) => {
2315
2840
  return { ...input, anchorIds: [...new Set(input.anchorIds)], limit, maxReadBytes };
2316
2841
  }, "validateMeetingRelatedHistory");
2317
2842
 
2318
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/result-items.js
2843
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/result-items.js
2319
2844
  var text5 = string();
2320
2845
  var identifier = pipe(text5, minLength(1));
2321
2846
  var nullableText = nullable(text5);
@@ -2357,7 +2882,8 @@ var personResult = strictObject({
2357
2882
  participant_id: identifier,
2358
2883
  person_uid: text5,
2359
2884
  previous_person_uid: nullableText,
2360
- changed: flag
2885
+ changed: flag,
2886
+ proposal: optional(text5)
2361
2887
  });
2362
2888
  var meetingChange = strictObject({
2363
2889
  scope,
@@ -2448,14 +2974,14 @@ var MEETING_RESULT_ENTITIES = {
2448
2974
  meeting_repair: repair
2449
2975
  };
2450
2976
 
2451
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/review.js
2977
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/review.js
2452
2978
  var REVIEW_LIMIT = { default: 50, most: 200 };
2453
2979
 
2454
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/save-hints.js
2980
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/save-hints.js
2455
2981
  var SAVE_HELP = `Worth keeping \u2014 a decision, a promise, a preference? Record it with \`memo facts add\` or
2456
2982
  \`memo memories add\`, citing the msg: locator or meeting: reference as --evidence.`;
2457
2983
 
2458
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/series-history.js
2984
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/series-history.js
2459
2985
  var validateMeetingSeriesHistory = /* @__PURE__ */ __name((input) => {
2460
2986
  input.signal?.throwIfAborted();
2461
2987
  if (!Number.isSafeInteger(input.accountId) || input.accountId <= 0)
@@ -2476,10 +3002,10 @@ var validateMeetingSeriesHistory = /* @__PURE__ */ __name((input) => {
2476
3002
  return { ...input, limit, maxReadBytes };
2477
3003
  }, "validateMeetingSeriesHistory");
2478
3004
 
2479
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/upcoming-validation.js
3005
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/upcoming-validation.js
2480
3006
  var occurrenceId = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim().length > 0 && value.length <= 1e3 && !/[\0\r\n]/.test(value), "occurrenceId");
2481
3007
 
2482
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/series-inventory-validation.js
3008
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/series-inventory-validation.js
2483
3009
  function invalid4(field, response = false) {
2484
3010
  throw new CliError(response ? "invalid_response" : "validation_error", `invalid meeting inventory ${field}`);
2485
3011
  }
@@ -2508,7 +3034,7 @@ var validateMeetingSeriesInventoryCursor = /* @__PURE__ */ __name((value) => {
2508
3034
  cursorDetails(value);
2509
3035
  }, "validateMeetingSeriesInventoryCursor");
2510
3036
 
2511
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/meetings/stats.js
3037
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/stats.js
2512
3038
  var MEETING_COUNTS_GROUPINGS = ["day", "week", "series"];
2513
3039
  var zoneOf = /* @__PURE__ */ __name((timeZone) => {
2514
3040
  const zone = timeZone ?? "UTC";
@@ -2521,13 +3047,13 @@ var zoneOf = /* @__PURE__ */ __name((timeZone) => {
2521
3047
  }, "zoneOf");
2522
3048
  var DAYS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
2523
3049
  var weekStart = /* @__PURE__ */ __name((at, format) => {
2524
- const parts = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
2525
- const day = Date.UTC(Number(parts.year), Number(parts.month) - 1, Number(parts.day));
2526
- return new Date(day - DAYS.indexOf(parts.weekday ?? "Mon") * 864e5).toISOString().slice(0, 10);
3050
+ const parts2 = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
3051
+ const day2 = Date.UTC(Number(parts2.year), Number(parts2.month) - 1, Number(parts2.day));
3052
+ return new Date(day2 - DAYS.indexOf(parts2.weekday ?? "Mon") * 864e5).toISOString().slice(0, 10);
2527
3053
  }, "weekStart");
2528
3054
  var dayKey = /* @__PURE__ */ __name((at, format) => {
2529
- const parts = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
2530
- return `${parts.year}-${parts.month}-${parts.day}`;
3055
+ const parts2 = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
3056
+ return `${parts2.year}-${parts2.month}-${parts2.day}`;
2531
3057
  }, "dayKey");
2532
3058
  var zoneFormat = /* @__PURE__ */ __name((zone) => new Intl.DateTimeFormat("en-US", {
2533
3059
  timeZone: zone,
@@ -2643,158 +3169,17 @@ var aggregateMeetingStats = /* @__PURE__ */ __name((rows, timeZone) => {
2643
3169
  };
2644
3170
  }, "aggregateMeetingStats");
2645
3171
 
2646
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/domain/money.js
2647
- var CURRENCY_SCALES = {
2648
- AED: 2,
2649
- AMD: 2,
2650
- AUD: 2,
2651
- BHD: 3,
2652
- BYN: 2,
2653
- CAD: 2,
2654
- CHF: 2,
2655
- CLP: 0,
2656
- CNY: 2,
2657
- CZK: 2,
2658
- DKK: 2,
2659
- EUR: 2,
2660
- GBP: 2,
2661
- GEL: 2,
2662
- HUF: 2,
2663
- ILS: 2,
2664
- INR: 2,
2665
- ISK: 0,
2666
- JPY: 0,
2667
- KGS: 2,
2668
- KRW: 0,
2669
- KWD: 3,
2670
- KZT: 2,
2671
- NOK: 2,
2672
- PLN: 2,
2673
- RSD: 2,
2674
- RUB: 2,
2675
- SEK: 2,
2676
- THB: 2,
2677
- TRY: 2,
2678
- UAH: 2,
2679
- USD: 2,
2680
- UZS: 2,
2681
- VND: 0
2682
- };
2683
- var refuse = /* @__PURE__ */ __name((message, reason) => {
2684
- throw new CliError("validation_error", message, { reason });
2685
- }, "refuse");
2686
- var DECIMAL = /^(\d{1,15})(?:\.(\d+))?$/;
2687
- var parseDecimal = /* @__PURE__ */ __name((text7, scale) => {
2688
- const match = DECIMAL.exec(text7.trim());
2689
- if (!match || (match[2] ?? "").length > scale)
2690
- return void 0;
2691
- return BigInt(`${match[1]}${(match[2] ?? "").padEnd(scale, "0")}`);
2692
- }, "parseDecimal");
2693
- var formatDecimal = /* @__PURE__ */ __name((units, scale) => {
2694
- const value = BigInt(units);
2695
- if (value < 0n)
2696
- return `-${formatDecimal(-value, scale)}`;
2697
- const digits = value.toString().padStart(scale + 1, "0");
2698
- return scale === 0 ? digits : `${digits.slice(0, -scale)}.${digits.slice(-scale)}`;
2699
- }, "formatDecimal");
2700
- var groupDigits = /* @__PURE__ */ __name((decimal) => {
2701
- const [whole = "0", fraction] = decimal.split(".");
2702
- const grouped2 = whole.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
2703
- return fraction === void 0 ? grouped2 : `${grouped2}.${fraction}`;
2704
- }, "groupDigits");
2705
- var currencyOf = /* @__PURE__ */ __name((text7) => {
2706
- const code = typeof text7 === "string" ? text7.trim().toUpperCase() : "";
2707
- if (CURRENCY_SCALES[code] === void 0)
2708
- return refuse(`${typeof text7 === "string" && text7.trim() ? text7.trim() : "an empty currency"} is not a currency the store keeps; use one of ${Object.keys(CURRENCY_SCALES).join(", ")}`, "money.currency");
2709
- return code;
2710
- }, "currencyOf");
2711
- var scaleOf = /* @__PURE__ */ __name((currency) => CURRENCY_SCALES[currencyOf(currency)], "scaleOf");
2712
- var minorUnits = /* @__PURE__ */ __name((amount, currency, what = "an amount") => {
2713
- const scale = scaleOf(currency);
2714
- const units = typeof amount === "string" ? parseDecimal(amount, scale) : void 0;
2715
- if (units === void 0 || units > BigInt(Number.MAX_SAFE_INTEGER))
2716
- return refuse(`${what} is a decimal string with at most ${scale} decimal${scale === 1 ? "" : "s"} for ${currency}, such as "${formatDecimal(5e3 * 10 ** scale, scale)}"`, "money.amount");
2717
- return Number(units);
2718
- }, "minorUnits");
2719
- var signedMinorUnits = /* @__PURE__ */ __name((amount, currency, what = "an amount") => {
2720
- if (typeof amount !== "string" || !amount.trim().startsWith("-"))
2721
- return minorUnits(amount, currency, what);
2722
- const units = minorUnits(amount.trim().slice(1), currency, what);
2723
- return units === 0 ? 0 : -units;
2724
- }, "signedMinorUnits");
2725
- var moneyOf = /* @__PURE__ */ __name((units, currency) => ({
2726
- amount: formatDecimal(units, scaleOf(currency)),
2727
- currency
2728
- }), "moneyOf");
2729
- var moneyLabel = /* @__PURE__ */ __name((units, currency) => `${groupDigits(formatDecimal(units, scaleOf(currency)))} ${currency}`, "moneyLabel");
2730
- var QUANTITY_SCALE = 3;
2731
- var quantityOf = /* @__PURE__ */ __name((text7) => {
2732
- const thousandths = typeof text7 === "string" ? parseDecimal(text7, QUANTITY_SCALE) : void 0;
2733
- if (thousandths === void 0 || thousandths === 0n)
2734
- return refuse('a quantity is a decimal string above 0 with at most 3 decimals, such as "1.5"', "money.quantity");
2735
- const plain = formatDecimal(thousandths, QUANTITY_SCALE).replace(/\.?0+$/, "");
2736
- return { text: plain, thousandths };
2737
- }, "quantityOf");
2738
- var lineUnits = /* @__PURE__ */ __name((thousandths, unitPrice) => Number((thousandths * BigInt(unitPrice) + 500n) / 1000n), "lineUnits");
2739
-
2740
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/domain/finance.js
2741
- var INVOICE_DIRECTIONS = ["receivable", "payable"];
2742
- var INVOICE_STATUSES = ["draft", "issued", "partly_paid", "paid", "void"];
2743
- var MONEY_DIRECTIONS = ["in", "out"];
2744
- var FINANCE_REVIEWS = ["proposed", "confirmed", "rejected"];
2745
- var settledStatus = /* @__PURE__ */ __name((current, total, paid) => {
2746
- if (current === "draft" || current === "void")
2747
- return current;
2748
- if (paid <= 0)
2749
- return "issued";
2750
- return paid < total ? "partly_paid" : "paid";
2751
- }, "settledStatus");
2752
- var dayMonth = /* @__PURE__ */ __name((date) => date === null ? null : `${date.slice(8, 10)}.${date.slice(5, 7)}`, "dayMonth");
2753
- var notes = /* @__PURE__ */ __name((...words2) => {
2754
- const kept = words2.filter((word) => word !== null);
2755
- return kept.length === 0 ? "" : ` (${kept.join(", ")})`;
2756
- }, "notes");
2757
- var invoiceLine = /* @__PURE__ */ __name((invoice) => {
2758
- const party = invoice.counterpartyName === null ? "" : `${invoice.direction === "receivable" ? " to" : " from"} ${invoice.counterpartyName}`;
2759
- const due = invoice.dueDate === null ? "" : `, due ${dayMonth(invoice.dueDate)}`;
2760
- return `${invoice.number ?? `#${invoice.id}`} \xB7 ${moneyLabel(invoice.total, invoice.currency)}${party}${due}` + notes(invoice.status.replace("_", " "), invoice.review === "confirmed" ? null : invoice.review);
2761
- }, "invoiceLine");
2762
- var paymentLine = /* @__PURE__ */ __name((payment) => {
2763
- const party = payment.partyName === null ? "" : `${payment.direction === "in" ? " from" : " to"} ${payment.partyName}`;
2764
- return `${moneyLabel(payment.amount, payment.currency)}${party}, ${dayMonth(payment.date)}` + notes(payment.review === "confirmed" ? null : payment.review);
2765
- }, "paymentLine");
2766
- var invoiceTitle = /* @__PURE__ */ __name((invoice) => `Invoice ${invoiceLine(invoice)}`, "invoiceTitle");
2767
- var paymentEntryTitle = /* @__PURE__ */ __name((payment) => `Payment \xB7 ${paymentLine(payment)}`, "paymentEntryTitle");
3172
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/meetings/store.js
3173
+ var READ_BUDGET_EXCEEDED = "Meeting search exceeds its stored text byte budget";
2768
3174
 
2769
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/domain/business.js
2770
- var CATALOG_KINDS = ["product", "service"];
2771
- var BUSINESS_KINDS = ["invoice", "payment", "order", "contract", "subscription", "product", "wallet"];
2772
- var CONTRACT_KINDS = ["sale", "purchase", "service", "lease", "employment", "nda", "license", "other"];
2773
- var CONTRACT_STATUSES = ["draft", "active", "ended", "terminated"];
2774
- var SUBSCRIPTION_STATUSES = ["trial", "active", "paused", "cancelled", "ended"];
2775
- var WALLET_KINDS = ["bank", "card", "cash", "wallet", "other"];
2776
- var TRANSACTION_STATUSES = ["pending", "booked"];
2777
- var ORDER_DIRECTIONS = ["purchase", "sale"];
2778
- var intervalOf = /* @__PURE__ */ __name((text7, reason = "subscription.interval") => {
2779
- const match = typeof text7 === "string" ? /^(?:([1-9]\d{0,2})-)?(day|week|month|year)$/.exec(text7.trim()) : null;
2780
- if (!match)
2781
- throw new CliError("validation_error", "an interval is a count and a unit, such as 1-month or 2-week", { reason });
2782
- return { count: match[1] === void 0 ? 1 : Number(match[1]), unit: match[2] };
2783
- }, "intervalOf");
2784
- var intervalText = /* @__PURE__ */ __name(({ count: count7, unit }) => `${count7}-${unit}`, "intervalText");
2785
- var priced = /* @__PURE__ */ __name((units, currency) => units === null || currency === null ? "" : `, ${moneyLabel(units, currency)}`, "priced");
2786
- var pending = /* @__PURE__ */ __name((review) => review === "confirmed" ? null : review, "pending");
2787
- var productLine = /* @__PURE__ */ __name((product) => {
2788
- const price = product.unitPrice === null || product.currency === null ? "" : moneyLabel(product.unitPrice, product.currency);
2789
- const per = price && product.unit !== null ? ` per ${product.unit}` : "";
2790
- return `${product.name}${price ? ` \xB7 ${price}${per}` : ""}${notes(product.kind, product.archived ? "archived" : null)}`;
2791
- }, "productLine");
2792
- var contractLine = /* @__PURE__ */ __name((contract) => `${contract.number ?? `#${contract.id}`} \xB7 ${contract.name}${priced(contract.value, contract.currency)}` + notes(contract.status, pending(contract.review)), "contractLine");
2793
- var subscriptionLine = /* @__PURE__ */ __name((subscription) => `${subscription.name}${priced(subscription.price, subscription.currency)} every ${intervalText(subscription.interval)}` + notes(subscription.status, pending(subscription.review)), "subscriptionLine");
2794
- var walletLine = /* @__PURE__ */ __name((wallet) => `${wallet.name} \xB7 ${wallet.kind}, ${wallet.currency}${wallet.numberHint === null ? "" : `, \u2026${wallet.numberHint}`}` + notes(wallet.closed ? "closed" : null), "walletLine");
2795
- var transactionLine = /* @__PURE__ */ __name((transaction) => `${moneyLabel(transaction.amount, transaction.currency)} ${transaction.direction}${transaction.label === null ? "" : ` \xB7 ${transaction.label}`}, ${dayMonth(transaction.date)}` + notes(transaction.status === "pending" ? "pending" : null, pending(transaction.review)), "transactionLine");
3175
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/store/source-review.js
3176
+ var SOURCE_REVIEW_KIND = "memory_source_review";
3177
+ var SOURCE_REVIEW_CAUSES = ["changed", "outdated", "deleted", "contradicted"];
3178
+ var ERASED_TEXT = "[source erased]";
3179
+ var severity = /* @__PURE__ */ __name((cause) => SOURCE_REVIEW_CAUSES.indexOf(cause), "severity");
3180
+ var graver = /* @__PURE__ */ __name((a, b) => severity(b) > severity(a) ? b : a, "graver");
2796
3181
 
2797
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/tasks/model.js
3182
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/tasks/model.js
2798
3183
  var TASK_KINDS = ["question", "request", "mention", "promise"];
2799
3184
  var TASK_STATES = ["open", "todo", "in_progress", "done", "dismissed"];
2800
3185
  var CLOSED_STATES = ["done", "dismissed"];
@@ -2809,7 +3194,7 @@ function closeTask(task, state, by, at, reason) {
2809
3194
  }
2810
3195
  __name(closeTask, "closeTask");
2811
3196
 
2812
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/tasks/priority.js
3197
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/tasks/priority.js
2813
3198
  var PRIORITY_LABELS = ["low", "medium", "high", "critical"];
2814
3199
  var MIDDLE = { low: 0.125, medium: 0.375, high: 0.625, critical: 0.875 };
2815
3200
  var LEGACY_PRIORITY_SCORES = [0.875, 0.625, 0.375, 0.1875, 0.0625];
@@ -2838,7 +3223,7 @@ var priorityOf = /* @__PURE__ */ __name((value) => {
2838
3223
  }, "priorityOf");
2839
3224
  var priorityOption = /* @__PURE__ */ __name((value) => priorityOf(value) ?? "none", "priorityOption");
2840
3225
 
2841
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/tasks/service.js
3226
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/tasks/service.js
2842
3227
  function createTaskService({ store, now = /* @__PURE__ */ __name(() => /* @__PURE__ */ new Date(), "now"), newId = /* @__PURE__ */ __name(() => crypto.randomUUID(), "newId") }) {
2843
3228
  async function find(id5) {
2844
3229
  const task = await store.get(id5);
@@ -2898,13 +3283,13 @@ function median(values) {
2898
3283
  }
2899
3284
  __name(median, "median");
2900
3285
 
2901
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/tasks/store.js
3286
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/tasks/store.js
2902
3287
  function matches(task, filter) {
2903
3288
  return (filter.account === void 0 || task.account === filter.account) && (filter.state === void 0 || task.state === filter.state) && (filter.group === void 0 || task.group === filter.group) && (filter.kind === void 0 || task.kind === filter.kind) && (filter.createdBefore === void 0 || task.createdAt < filter.createdBefore);
2904
3289
  }
2905
3290
  __name(matches, "matches");
2906
3291
 
2907
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/domain/knowledge.js
3292
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/domain/knowledge.js
2908
3293
  var FACT_STATUSES = ["proposed", "accepted", "superseded", "reversed", "rejected"];
2909
3294
  var MEMORY_KINDS = ["summary", "digest", "preference"];
2910
3295
  var MEMORY_STATUSES = ["proposed", "confirmed", "stale", "superseded"];
@@ -2912,7 +3297,10 @@ var MEMORY_SCOPES = ["personal", "work"];
2912
3297
  var WORK_TASK_TYPES = ["bug", "feature", "chore"];
2913
3298
  var TASK_TYPES2 = [...WORK_TASK_TYPES, ...TASK_KINDS];
2914
3299
 
2915
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/entities/fields.js
3300
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/domain/categories.js
3301
+ var CATEGORIES = ["client", "supplier", "partner", "employer"];
3302
+
3303
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/entities/fields.js
2916
3304
  var text6 = string();
2917
3305
  var id4 = pipe(string(), minLength(1));
2918
3306
  var time = isoTime;
@@ -2930,13 +3318,14 @@ var evidenceSource = strictObject({
2930
3318
  tool: nullable(text6),
2931
3319
  missing: boolean()
2932
3320
  });
3321
+ var sourceReview = nullable(strictObject({ id: id4, cause: picklist(SOURCE_REVIEW_CAUSES) }));
2933
3322
  var author = strictObject({
2934
3323
  type: picklist(["person", "bot"]),
2935
3324
  id: id4,
2936
3325
  name: nullable(text6)
2937
3326
  });
2938
3327
 
2939
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/entities/knowledge-lists.js
3328
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/entities/knowledge-lists.js
2940
3329
  var organization = strictObject({
2941
3330
  id: id4,
2942
3331
  ref: reference,
@@ -2966,17 +3355,169 @@ var reminder = strictObject({
2966
3355
  receipt: nullable(text6)
2967
3356
  });
2968
3357
 
2969
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/store/marks.js
2970
- import { readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
2971
- var damageMarkPath = /* @__PURE__ */ __name((store) => `${store}.damaged.json`, "damageMarkPath");
2972
- var healthMarkPath = /* @__PURE__ */ __name((store) => `${store}.health.json`, "healthMarkPath");
2973
- var inodeOf = /* @__PURE__ */ __name((store) => statSync(store, { throwIfNoEntry: false })?.ino, "inodeOf");
2974
- var readJson = /* @__PURE__ */ __name((path) => {
2975
- try {
2976
- return JSON.parse(readFileSync(path, "utf8"));
2977
- } catch (error) {
2978
- if (error.code === "ENOENT")
2979
- return null;
3358
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/domain/money.js
3359
+ var CURRENCY_SCALES = {
3360
+ AED: 2,
3361
+ AMD: 2,
3362
+ AUD: 2,
3363
+ BHD: 3,
3364
+ BYN: 2,
3365
+ CAD: 2,
3366
+ CHF: 2,
3367
+ CLP: 0,
3368
+ CNY: 2,
3369
+ CZK: 2,
3370
+ DKK: 2,
3371
+ EUR: 2,
3372
+ GBP: 2,
3373
+ GEL: 2,
3374
+ HUF: 2,
3375
+ ILS: 2,
3376
+ INR: 2,
3377
+ ISK: 0,
3378
+ JPY: 0,
3379
+ KGS: 2,
3380
+ KRW: 0,
3381
+ KWD: 3,
3382
+ KZT: 2,
3383
+ NOK: 2,
3384
+ PLN: 2,
3385
+ RSD: 2,
3386
+ RUB: 2,
3387
+ SEK: 2,
3388
+ THB: 2,
3389
+ TRY: 2,
3390
+ UAH: 2,
3391
+ USD: 2,
3392
+ UZS: 2,
3393
+ VND: 0
3394
+ };
3395
+ var refuse = /* @__PURE__ */ __name((message, reason) => {
3396
+ throw new CliError("validation_error", message, { reason });
3397
+ }, "refuse");
3398
+ var DECIMAL = /^(\d{1,15})(?:\.(\d+))?$/;
3399
+ var parseDecimal = /* @__PURE__ */ __name((text7, scale) => {
3400
+ const match = DECIMAL.exec(text7.trim());
3401
+ if (!match || (match[2] ?? "").length > scale)
3402
+ return void 0;
3403
+ return BigInt(`${match[1]}${(match[2] ?? "").padEnd(scale, "0")}`);
3404
+ }, "parseDecimal");
3405
+ var formatDecimal = /* @__PURE__ */ __name((units, scale) => {
3406
+ const value = BigInt(units);
3407
+ if (value < 0n)
3408
+ return `-${formatDecimal(-value, scale)}`;
3409
+ const digits = value.toString().padStart(scale + 1, "0");
3410
+ return scale === 0 ? digits : `${digits.slice(0, -scale)}.${digits.slice(-scale)}`;
3411
+ }, "formatDecimal");
3412
+ var groupDigits = /* @__PURE__ */ __name((decimal) => {
3413
+ const [whole = "0", fraction] = decimal.split(".");
3414
+ const grouped2 = whole.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
3415
+ return fraction === void 0 ? grouped2 : `${grouped2}.${fraction}`;
3416
+ }, "groupDigits");
3417
+ var currencyOf = /* @__PURE__ */ __name((text7) => {
3418
+ const code = typeof text7 === "string" ? text7.trim().toUpperCase() : "";
3419
+ if (CURRENCY_SCALES[code] === void 0)
3420
+ return refuse(`${typeof text7 === "string" && text7.trim() ? text7.trim() : "an empty currency"} is not a currency the store keeps; use one of ${Object.keys(CURRENCY_SCALES).join(", ")}`, "money.currency");
3421
+ return code;
3422
+ }, "currencyOf");
3423
+ var scaleOf = /* @__PURE__ */ __name((currency) => CURRENCY_SCALES[currencyOf(currency)], "scaleOf");
3424
+ var minorUnits = /* @__PURE__ */ __name((amount, currency, what = "an amount") => {
3425
+ const scale = scaleOf(currency);
3426
+ const units = typeof amount === "string" ? parseDecimal(amount, scale) : void 0;
3427
+ if (units === void 0 || units > BigInt(Number.MAX_SAFE_INTEGER))
3428
+ return refuse(`${what} is a decimal string with at most ${scale} decimal${scale === 1 ? "" : "s"} for ${currency}, such as "${formatDecimal(5e3 * 10 ** scale, scale)}"`, "money.amount");
3429
+ return Number(units);
3430
+ }, "minorUnits");
3431
+ var signedMinorUnits = /* @__PURE__ */ __name((amount, currency, what = "an amount") => {
3432
+ if (typeof amount !== "string" || !amount.trim().startsWith("-"))
3433
+ return minorUnits(amount, currency, what);
3434
+ const units = minorUnits(amount.trim().slice(1), currency, what);
3435
+ return units === 0 ? 0 : -units;
3436
+ }, "signedMinorUnits");
3437
+ var moneyOf = /* @__PURE__ */ __name((units, currency) => ({
3438
+ amount: formatDecimal(units, scaleOf(currency)),
3439
+ currency
3440
+ }), "moneyOf");
3441
+ var moneyLabel = /* @__PURE__ */ __name((units, currency) => `${groupDigits(formatDecimal(units, scaleOf(currency)))} ${currency}`, "moneyLabel");
3442
+ var QUANTITY_SCALE = 3;
3443
+ var quantityOf = /* @__PURE__ */ __name((text7) => {
3444
+ const thousandths = typeof text7 === "string" ? parseDecimal(text7, QUANTITY_SCALE) : void 0;
3445
+ if (thousandths === void 0 || thousandths === 0n)
3446
+ return refuse('a quantity is a decimal string above 0 with at most 3 decimals, such as "1.5"', "money.quantity");
3447
+ const plain = formatDecimal(thousandths, QUANTITY_SCALE).replace(/\.?0+$/, "");
3448
+ return { text: plain, thousandths };
3449
+ }, "quantityOf");
3450
+ var lineUnits = /* @__PURE__ */ __name((thousandths, unitPrice) => Number((thousandths * BigInt(unitPrice) + 500n) / 1000n), "lineUnits");
3451
+
3452
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/domain/finance.js
3453
+ var INVOICE_DIRECTIONS = ["receivable", "payable"];
3454
+ var INVOICE_STATUSES = ["draft", "issued", "partly_paid", "paid", "void"];
3455
+ var MONEY_DIRECTIONS = ["in", "out"];
3456
+ var FINANCE_REVIEWS = ["proposed", "confirmed", "rejected"];
3457
+ var settledStatus = /* @__PURE__ */ __name((current, total, paid) => {
3458
+ if (current === "draft" || current === "void")
3459
+ return current;
3460
+ if (paid <= 0)
3461
+ return "issued";
3462
+ return paid < total ? "partly_paid" : "paid";
3463
+ }, "settledStatus");
3464
+ var dayMonth = /* @__PURE__ */ __name((date) => date === null ? null : `${date.slice(8, 10)}.${date.slice(5, 7)}`, "dayMonth");
3465
+ var notes = /* @__PURE__ */ __name((...words2) => {
3466
+ const kept = words2.filter((word) => word !== null);
3467
+ return kept.length === 0 ? "" : ` (${kept.join(", ")})`;
3468
+ }, "notes");
3469
+ var invoiceLine = /* @__PURE__ */ __name((invoice) => {
3470
+ const party = invoice.counterpartyName === null ? "" : `${invoice.direction === "receivable" ? " to" : " from"} ${invoice.counterpartyName}`;
3471
+ const due = invoice.dueDate === null ? "" : `, due ${dayMonth(invoice.dueDate)}`;
3472
+ return `${invoice.number ?? `#${invoice.id}`} \xB7 ${moneyLabel(invoice.total, invoice.currency)}${party}${due}` + notes(invoice.status.replace("_", " "), invoice.review === "confirmed" ? null : invoice.review);
3473
+ }, "invoiceLine");
3474
+ var paymentLine = /* @__PURE__ */ __name((payment) => {
3475
+ const party = payment.partyName === null ? "" : `${payment.direction === "in" ? " from" : " to"} ${payment.partyName}`;
3476
+ return `${moneyLabel(payment.amount, payment.currency)}${party}, ${dayMonth(payment.date)}` + notes(payment.review === "confirmed" ? null : payment.review);
3477
+ }, "paymentLine");
3478
+ var invoiceTitle = /* @__PURE__ */ __name((invoice) => `Invoice ${invoiceLine(invoice)}`, "invoiceTitle");
3479
+ var paymentEntryTitle = /* @__PURE__ */ __name((payment) => `Payment \xB7 ${paymentLine(payment)}`, "paymentEntryTitle");
3480
+
3481
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/domain/business.js
3482
+ var CATALOG_KINDS = ["product", "service"];
3483
+ var BUSINESS_KINDS = ["invoice", "payment", "order", "contract", "subscription", "product", "wallet"];
3484
+ var CONTRACT_KINDS = ["sale", "purchase", "service", "lease", "employment", "nda", "license", "other"];
3485
+ var CONTRACT_STATUSES = ["draft", "active", "ended", "terminated"];
3486
+ var SUBSCRIPTION_STATUSES = ["trial", "active", "paused", "cancelled", "ended"];
3487
+ var WALLET_KINDS = ["bank", "card", "cash", "wallet", "other"];
3488
+ var TRANSACTION_STATUSES = ["pending", "booked"];
3489
+ var ORDER_DIRECTIONS = ["purchase", "sale"];
3490
+ var intervalOf = /* @__PURE__ */ __name((text7, reason = "subscription.interval") => {
3491
+ const match = typeof text7 === "string" ? /^(?:([1-9]\d{0,2})-)?(day|week|month|year)$/.exec(text7.trim()) : null;
3492
+ if (!match)
3493
+ throw new CliError("validation_error", "an interval is a count and a unit, such as 1-month or 2-week", { reason });
3494
+ return { count: match[1] === void 0 ? 1 : Number(match[1]), unit: match[2] };
3495
+ }, "intervalOf");
3496
+ var intervalText = /* @__PURE__ */ __name(({ count: count7, unit }) => `${count7}-${unit}`, "intervalText");
3497
+ var priced = /* @__PURE__ */ __name((units, currency) => units === null || currency === null ? "" : `, ${moneyLabel(units, currency)}`, "priced");
3498
+ var pending = /* @__PURE__ */ __name((review) => review === "confirmed" ? null : review, "pending");
3499
+ var productLine = /* @__PURE__ */ __name((product) => {
3500
+ const price = product.unitPrice === null || product.currency === null ? "" : moneyLabel(product.unitPrice, product.currency);
3501
+ const per = price && product.unit !== null ? ` per ${product.unit}` : "";
3502
+ return `${product.name}${price ? ` \xB7 ${price}${per}` : ""}${notes(product.kind, product.archived ? "archived" : null)}`;
3503
+ }, "productLine");
3504
+ var contractLine = /* @__PURE__ */ __name((contract) => `${contract.number ?? `#${contract.id}`} \xB7 ${contract.name}${priced(contract.value, contract.currency)}` + notes(contract.status, pending(contract.review)), "contractLine");
3505
+ var subscriptionLine = /* @__PURE__ */ __name((subscription) => `${subscription.name}${priced(subscription.price, subscription.currency)} every ${intervalText(subscription.interval)}` + notes(subscription.status, pending(subscription.review)), "subscriptionLine");
3506
+ var walletLine = /* @__PURE__ */ __name((wallet) => `${wallet.name} \xB7 ${wallet.kind}, ${wallet.currency}${wallet.numberHint === null ? "" : `, \u2026${wallet.numberHint}`}` + notes(wallet.closed ? "closed" : null), "walletLine");
3507
+ var transactionLine = /* @__PURE__ */ __name((transaction) => `${moneyLabel(transaction.amount, transaction.currency)} ${transaction.direction}${transaction.label === null ? "" : ` \xB7 ${transaction.label}`}, ${dayMonth(transaction.date)}` + notes(transaction.status === "pending" ? "pending" : null, pending(transaction.review)), "transactionLine");
3508
+
3509
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/store/marks.js
3510
+ import { readFileSync as readFileSync2, rmSync as rmSync2, statSync as statSync2, writeFileSync as writeFileSync2 } from "node:fs";
3511
+ var damageMarkPath = /* @__PURE__ */ __name((store) => `${store}.damaged.json`, "damageMarkPath");
3512
+ var healthMarkPath = /* @__PURE__ */ __name((store) => `${store}.health.json`, "healthMarkPath");
3513
+ var journalMarkPath = /* @__PURE__ */ __name((store) => `${store}.journal.json`, "journalMarkPath");
3514
+ var inodeOf = /* @__PURE__ */ __name((store) => statSync2(store, { throwIfNoEntry: false })?.ino, "inodeOf");
3515
+ var readJson = /* @__PURE__ */ __name((path) => {
3516
+ try {
3517
+ return JSON.parse(readFileSync2(path, "utf8"));
3518
+ } catch (error) {
3519
+ if (error.code === "ENOENT")
3520
+ return null;
2980
3521
  throw error;
2981
3522
  }
2982
3523
  }, "readJson");
@@ -3005,7 +3546,7 @@ var markStoreDamaged = /* @__PURE__ */ __name((error, { store, command, version,
3005
3546
  inode
3006
3547
  };
3007
3548
  try {
3008
- writeFileSync(damageMarkPath(store), `${JSON.stringify(mark, null, 2)}
3549
+ writeFileSync2(damageMarkPath(store), `${JSON.stringify(mark, null, 2)}
3009
3550
  `, { flag: "wx", mode: 384 });
3010
3551
  return true;
3011
3552
  } catch {
@@ -3028,13 +3569,30 @@ var readDamageMark = /* @__PURE__ */ __name((store) => {
3028
3569
  }
3029
3570
  return mark;
3030
3571
  }, "readDamageMark");
3031
- var clearDamageMark = /* @__PURE__ */ __name((store) => rmSync(damageMarkPath(store), { force: true }), "clearDamageMark");
3572
+ var clearDamageMark = /* @__PURE__ */ __name((store) => rmSync2(damageMarkPath(store), { force: true }), "clearDamageMark");
3032
3573
  var refuseDamagedStore = /* @__PURE__ */ __name((store, cli) => {
3033
3574
  const mark = readDamageMark(store);
3034
3575
  if (!mark)
3035
3576
  return;
3036
3577
  throw new CliError("configuration_error", `the store was found damaged at ${mark.at} by \`${mark.command}\` (${mark.error}), so nothing writes to it until it is recovered; \`${cli ?? "<cli>"} store recover\` says what is damaged and what to do`, { reason: "store.damaged" });
3037
3578
  }, "refuseDamagedStore");
3579
+ var markJournalLost = /* @__PURE__ */ __name((store, { seen, command, now = Date.now }) => {
3580
+ if (ownerStoreInTests(store))
3581
+ return;
3582
+ const mark = { at: new Date(now()).toISOString(), command, seen };
3583
+ try {
3584
+ writeFileSync2(journalMarkPath(store), `${JSON.stringify(mark, null, 2)}
3585
+ `, { flag: "wx", mode: 384 });
3586
+ } catch {
3587
+ }
3588
+ }, "markJournalLost");
3589
+ var readJournalMark = /* @__PURE__ */ __name((store) => {
3590
+ try {
3591
+ return readJson(journalMarkPath(store));
3592
+ } catch {
3593
+ return null;
3594
+ }
3595
+ }, "readJournalMark");
3038
3596
  var readHealthMark = /* @__PURE__ */ __name((store) => {
3039
3597
  try {
3040
3598
  return readJson(healthMarkPath(store));
@@ -3058,16 +3616,584 @@ var recordDeepCheck = /* @__PURE__ */ __name((store, health, { cli, version, sch
3058
3616
  };
3059
3617
  const cleared = health.ok ? readDamageMark(store) : null;
3060
3618
  try {
3061
- writeFileSync(healthMarkPath(store), `${JSON.stringify(mark, null, 2)}
3619
+ writeFileSync2(healthMarkPath(store), `${JSON.stringify(mark, null, 2)}
3062
3620
  `, { mode: 384 });
3063
3621
  } catch {
3064
3622
  }
3065
3623
  if (cleared)
3066
3624
  clearDamageMark(store);
3625
+ if (health.ok)
3626
+ rmSync2(journalMarkPath(store), { force: true });
3067
3627
  return { previous, cleared };
3068
3628
  }, "recordDeepCheck");
3069
3629
 
3070
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/domain/deals.js
3630
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/domain/locator.js
3631
+ var SCHEME = "msg:";
3632
+ var formatLocator = /* @__PURE__ */ __name(({ provider, account, chat, message }) => SCHEME + [provider, account, chat, message].map(encodeURIComponent).join("/"), "formatLocator");
3633
+ var isLocator = /* @__PURE__ */ __name((reference2) => reference2.trim().startsWith(SCHEME), "isLocator");
3634
+ var parseLocator = /* @__PURE__ */ __name((reference2) => {
3635
+ const trimmed = reference2.trim();
3636
+ const parts2 = trimmed.startsWith(SCHEME) ? trimmed.slice(SCHEME.length).split("/") : [];
3637
+ if (parts2.length !== 4 || parts2.some((part) => part === "")) {
3638
+ throw new CliError("validation_error", `"${singleLine(reference2)}" is not a message locator \u2014 expected msg:<provider>/<account>/<chat>/<message>`);
3639
+ }
3640
+ const [provider, account, chat, message] = parts2.map(decodeURIComponent);
3641
+ return { provider, account, chat, message };
3642
+ }, "parseLocator");
3643
+
3644
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/domain/references.js
3645
+ var SIMPLE_REFERENCES = [
3646
+ "note",
3647
+ "document",
3648
+ "person",
3649
+ "organization",
3650
+ "project",
3651
+ "task",
3652
+ "memory",
3653
+ "fact",
3654
+ "bot",
3655
+ "event",
3656
+ "invoice",
3657
+ "payment",
3658
+ "order",
3659
+ "deal",
3660
+ "lead",
3661
+ "pipeline",
3662
+ "product",
3663
+ "contract",
3664
+ "subscription",
3665
+ "wallet",
3666
+ "transaction",
3667
+ "entity"
3668
+ ];
3669
+ var malformed = /* @__PURE__ */ __name((text7, shape) => new CliError("validation_error", `"${singleLine(text7)}" is not a reference \u2014 expected ${shape}`, {
3670
+ reason: "ref.malformed"
3671
+ }), "malformed");
3672
+ var parts = /* @__PURE__ */ __name((rest, count7, text7, shape) => {
3673
+ const split = rest.split("/");
3674
+ if (split.length !== count7 || split.some((part) => part === ""))
3675
+ throw malformed(text7, shape);
3676
+ return split.map(decodeURIComponent);
3677
+ }, "parts");
3678
+ var encoded = /* @__PURE__ */ __name((...values) => values.map(encodeURIComponent).join("/"), "encoded");
3679
+ var folderPath = /* @__PURE__ */ __name((path) => {
3680
+ const clean = path.split("/").filter((part) => part !== "" && part !== ".").join("/");
3681
+ return clean === "" ? path.trim() === "" ? "" : null : clean;
3682
+ }, "folderPath");
3683
+ var MEETING_SHAPE = "meeting:<account>/<meeting>[/<transcript>[/<cue>]] with safe integer ids";
3684
+ var kind = /* @__PURE__ */ __name((spec) => spec, "kind");
3685
+ var simple = /* @__PURE__ */ __name((prefix) => kind({
3686
+ prefix,
3687
+ type: prefix,
3688
+ shape: `${prefix}:<id>`,
3689
+ parse: /* @__PURE__ */ __name((rest, text7) => {
3690
+ if (!rest.trim())
3691
+ throw new CliError("validation_error", `"${singleLine(text7)}" names no ${prefix}`, {
3692
+ reason: "ref.malformed"
3693
+ });
3694
+ return { type: prefix, id: rest };
3695
+ }, "parse"),
3696
+ format: /* @__PURE__ */ __name((reference2) => `${reference2.type}:${reference2.id}`, "format")
3697
+ }), "simple");
3698
+ var REF_KINDS = [
3699
+ kind({
3700
+ prefix: "msg",
3701
+ type: "message",
3702
+ shape: "msg:<provider>/<account>/<chat>/<message>",
3703
+ parse: /* @__PURE__ */ __name((_, text7) => {
3704
+ try {
3705
+ return { type: "message", ...parseLocator(text7) };
3706
+ } catch {
3707
+ throw malformed(text7, "msg:<provider>/<account>/<chat>/<message>");
3708
+ }
3709
+ }, "parse"),
3710
+ format: formatLocator
3711
+ }),
3712
+ kind({
3713
+ prefix: "chat",
3714
+ type: "chat",
3715
+ shape: "chat:<provider>/<account>/<chat>",
3716
+ parse: /* @__PURE__ */ __name((rest, text7) => {
3717
+ const [provider, account, chat] = parts(rest, 3, text7, "chat:<provider>/<account>/<chat>");
3718
+ return { type: "chat", provider, account, chat };
3719
+ }, "parse"),
3720
+ format: /* @__PURE__ */ __name(({ provider, account, chat }) => `chat:${encoded(provider, account, chat)}`, "format")
3721
+ }),
3722
+ kind({
3723
+ prefix: "contact",
3724
+ type: "contact",
3725
+ shape: "contact:<provider>/<id>",
3726
+ parse: /* @__PURE__ */ __name((rest, text7) => {
3727
+ const [provider, id5] = parts(rest, 2, text7, "contact:<provider>/<id>");
3728
+ return { type: "contact", provider, id: id5 };
3729
+ }, "parse"),
3730
+ format: /* @__PURE__ */ __name(({ provider, id: id5 }) => `contact:${encoded(provider, id5)}`, "format")
3731
+ }),
3732
+ kind({
3733
+ prefix: "folder",
3734
+ type: "folder",
3735
+ shape: "folder:<id>[/<path>]",
3736
+ parse: /* @__PURE__ */ __name((rest, text7) => {
3737
+ const slash = rest.indexOf("/");
3738
+ const id5 = decodeURIComponent(slash < 0 ? rest : rest.slice(0, slash));
3739
+ const path = slash < 0 ? null : folderPath(decodeURIComponent(rest.slice(slash + 1)));
3740
+ if (!id5.trim() || path === "")
3741
+ throw malformed(text7, "folder:<id>[/<path>]");
3742
+ return { type: "folder", id: id5, path };
3743
+ }, "parse"),
3744
+ format: /* @__PURE__ */ __name(({ id: id5, path }) => path === null ? `folder:${encodeURIComponent(id5)}` : `folder:${encoded(id5, path)}`, "format")
3745
+ }),
3746
+ kind({
3747
+ prefix: "meeting",
3748
+ type: "meeting",
3749
+ shape: MEETING_SHAPE,
3750
+ parse: /* @__PURE__ */ __name((_, text7) => {
3751
+ try {
3752
+ return parseMeetingReference(text7);
3753
+ } catch {
3754
+ throw malformed(text7, MEETING_SHAPE);
3755
+ }
3756
+ }, "parse"),
3757
+ format: formatMeetingReference
3758
+ }),
3759
+ ...SIMPLE_REFERENCES.map(simple)
3760
+ ];
3761
+ var byPrefix = new Map(REF_KINDS.map((spec) => [spec.prefix, spec]));
3762
+ var byType = new Map(REF_KINDS.map((spec) => [spec.type, spec]));
3763
+ var offered = REF_KINDS.map(({ prefix }) => prefix).filter((prefix) => prefix !== "entity");
3764
+ var distance = /* @__PURE__ */ __name((a, b) => {
3765
+ let row = Array.from({ length: b.length + 1 }, (_, at) => at);
3766
+ for (const [i, x] of [...a].entries()) {
3767
+ const next = [i + 1];
3768
+ for (const [j, y] of [...b].entries())
3769
+ next.push(Math.min(row[j + 1] + 1, next[j] + 1, row[j] + (x === y ? 0 : 1)));
3770
+ row = next;
3771
+ }
3772
+ return row[b.length];
3773
+ }, "distance");
3774
+ var nearest = /* @__PURE__ */ __name((typed) => offered.find((prefix) => typed.length >= 2 && prefix.startsWith(typed)) ?? offered.map((prefix) => ({ prefix, far: distance(typed, prefix) })).filter(({ far }) => far <= 2).sort((a, b) => a.far - b.far)[0]?.prefix, "nearest");
3775
+ var unknownKind = /* @__PURE__ */ __name((text7, prefix, rest) => {
3776
+ const near2 = prefix === "" ? void 0 : nearest(prefix);
3777
+ const kinds = offered.map((one) => `${one}:`).join(", ");
3778
+ const hint = near2 === void 0 ? `; kinds: ${kinds}` : `; did you mean ${near2}:${singleLine(rest)}? Kinds: ${kinds}`;
3779
+ return new CliError("validation_error", `"${singleLine(text7)}" is no kind of reference${hint}`, {
3780
+ reason: "ref.unknown-kind"
3781
+ });
3782
+ }, "unknownKind");
3783
+ var formatReference = /* @__PURE__ */ __name((reference2) => byType.get(reference2.type).format(reference2), "formatReference");
3784
+ var parseReference = /* @__PURE__ */ __name((text7) => {
3785
+ const reference2 = text7.trim();
3786
+ const colon = reference2.indexOf(":");
3787
+ const prefix = colon < 0 ? "" : reference2.slice(0, colon);
3788
+ const rest = reference2.slice(colon + 1);
3789
+ const spec = byPrefix.get(prefix);
3790
+ if (!spec)
3791
+ throw unknownKind(reference2, prefix, rest);
3792
+ return spec.parse(rest, reference2);
3793
+ }, "parseReference");
3794
+ var canonicalReference = /* @__PURE__ */ __name((text7) => formatReference(parseReference(text7)), "canonicalReference");
3795
+ var looksLikeReference = /* @__PURE__ */ __name((text7) => {
3796
+ const match = /^([a-z]+):\S+$/.exec(text7.trim());
3797
+ return match !== null && byPrefix.has(match[1]);
3798
+ }, "looksLikeReference");
3799
+
3800
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/domain/providers.js
3801
+ var KINDS = ["messages", "mail", "notes", "documents", "meetings", "events", "crm"];
3802
+ var MESSENGER_OPENS = { chat: "messages list", message: "messages show", contact: "contacts show" };
3803
+ var PROVIDERS = [
3804
+ { name: "telegram", kind: "messages", aliases: ["tg"], command: "tg", opens: MESSENGER_OPENS },
3805
+ { name: "telegram-bot", kind: "messages", aliases: ["tg-bot"] },
3806
+ { name: "max", kind: "messages", aliases: [], command: "max", opens: MESSENGER_OPENS },
3807
+ { name: "max-bot", kind: "messages", aliases: [] },
3808
+ { name: "whatsapp", kind: "messages", aliases: ["wa"], command: "wa", opens: MESSENGER_OPENS },
3809
+ { name: "whatsapp-bot", kind: "messages", aliases: ["wa-bot"] },
3810
+ { name: "email", kind: "mail", aliases: [] },
3811
+ { name: "notes", kind: "notes", aliases: [] },
3812
+ { name: "local", kind: "notes", aliases: [] },
3813
+ { name: "obsidian", kind: "notes", aliases: [] },
3814
+ { name: "added", kind: "notes", aliases: [] },
3815
+ { name: "zoom", kind: "meetings", aliases: [] },
3816
+ // A phone export's records: its SMS and its calls in the one account the import names.
3817
+ { name: "phone", kind: "messages", kinds: ["messages", "events"], aliases: [], imported: true }
3818
+ ];
3819
+ var LABELS = {
3820
+ telegram: "Telegram",
3821
+ "telegram-bot": "Telegram bot",
3822
+ max: "MAX",
3823
+ "max-bot": "MAX bot",
3824
+ whatsapp: "WhatsApp",
3825
+ "whatsapp-bot": "WhatsApp bot",
3826
+ "google-drive": "Google Drive",
3827
+ added: "added by hand",
3828
+ email: "mail"
3829
+ };
3830
+ var providerLabel = /* @__PURE__ */ __name((provider) => LABELS[provider] ?? provider, "providerLabel");
3831
+ var FOLDER_PROVIDERS = ["local", "obsidian", "folder"];
3832
+ var isFolderProvider = /* @__PURE__ */ __name((provider) => FOLDER_PROVIDERS.includes(provider), "isFolderProvider");
3833
+ var folderProviderSql = /* @__PURE__ */ __name((column = "provider") => `${column} IN (${FOLDER_PROVIDERS.map((name) => `'${name}'`).join(", ")})`, "folderProviderSql");
3834
+ var folderProviderOf = /* @__PURE__ */ __name((format) => format === "markdown" ? "local" : "obsidian", "folderProviderOf");
3835
+ var DOCUMENT_ACCOUNT_PROVIDERS = ["google-drive"];
3836
+ var isDocumentAccountProvider = /* @__PURE__ */ __name((provider) => DOCUMENT_ACCOUNT_PROVIDERS.includes(provider), "isDocumentAccountProvider");
3837
+ var ADDED_PROVIDER = "added";
3838
+ var ADDED_ACCOUNT = "owner";
3839
+ var notAdded = `d.account_id NOT IN (SELECT id FROM accounts WHERE provider = '${ADDED_PROVIDER}')`;
3840
+ var filesAccountSql = /* @__PURE__ */ __name((column = "provider") => `${column} IN (${[...FOLDER_PROVIDERS, ...DOCUMENT_ACCOUNT_PROVIDERS, ADDED_PROVIDER].map((name) => `'${name}'`).join(", ")})`, "filesAccountSql");
3841
+ var INTERNAL_NOTES = "internal";
3842
+ var UNKNOWN_PROVIDER = "unknown provider \u2014 run its CLI once";
3843
+ var WORD = /^[a-z0-9][a-z0-9_-]*$/;
3844
+ var invalid5 = /* @__PURE__ */ __name((message) => {
3845
+ throw new CliError("validation_error", message);
3846
+ }, "invalid");
3847
+ var wordOf = /* @__PURE__ */ __name((value, what) => typeof value === "string" && WORD.test(value) ? value : invalid5(`${what} is lowercase letters, digits, - and _ \u2014 not ${JSON.stringify(value)}`), "wordOf");
3848
+ var OPEN_KINDS = new Set(REF_KINDS.map(({ type }) => type).filter((type) => type !== "entity"));
3849
+ var COMMAND_WORDS = /^[a-z0-9][a-z0-9_-]*( [a-z0-9][a-z0-9_-]*)*$/;
3850
+ var opensOf = /* @__PURE__ */ __name((value, named) => {
3851
+ if (typeof value !== "object" || value === null || Array.isArray(value))
3852
+ return invalid5(`provider ${named}'s opens maps a kind of reference to a command`);
3853
+ const known = Object.entries(value).filter(([kind2]) => OPEN_KINDS.has(kind2));
3854
+ for (const [kind2, command] of known)
3855
+ if (typeof command !== "string" || !COMMAND_WORDS.test(command))
3856
+ invalid5(`provider ${named} opens a ${kind2} with command words, not ${JSON.stringify(command)}`);
3857
+ return Object.fromEntries(known);
3858
+ }, "opensOf");
3859
+ var providerEntryOf = /* @__PURE__ */ __name((value) => {
3860
+ if (typeof value !== "object" || value === null || Array.isArray(value))
3861
+ return invalid5("a provider entry is an object");
3862
+ const { name, kind: kind2, kinds, aliases = [], command, opens, imported } = value;
3863
+ const named = wordOf(name, "a provider's name");
3864
+ const isKindWord = /* @__PURE__ */ __name((one) => typeof one === "string" && KINDS.includes(one), "isKindWord");
3865
+ const given = kinds === void 0 ? [kind2] : Array.isArray(kinds) && kinds.length > 0 ? kinds : [void 0];
3866
+ for (const one of given)
3867
+ if (!isKindWord(one))
3868
+ invalid5(`provider ${named}'s kind is one of ${KINDS.join(", ")} \u2014 not ${JSON.stringify(one)}`);
3869
+ const list = [...new Set(given)];
3870
+ if (kind2 !== void 0 && kind2 !== list[0])
3871
+ invalid5(`provider ${named}'s kind is the first of its kinds`);
3872
+ if (!Array.isArray(aliases))
3873
+ invalid5(`provider ${named}'s aliases are a list`);
3874
+ if (imported !== void 0 && typeof imported !== "boolean")
3875
+ invalid5(`provider ${named}'s imported is true or false`);
3876
+ return {
3877
+ name: named,
3878
+ kind: list[0],
3879
+ ...list.length > 1 ? { kinds: list } : {},
3880
+ ...imported === true ? { imported: true } : {},
3881
+ aliases: [...new Set(aliases.map((alias) => wordOf(alias, `an alias of ${named}`)))],
3882
+ ...command === void 0 ? {} : { command: wordOf(command, `the command of ${named}`) },
3883
+ ...opens === void 0 ? {} : { opens: opensOf(opens, named) }
3884
+ };
3885
+ }, "providerEntryOf");
3886
+ var kindsOfEntry = /* @__PURE__ */ __name((entry) => entry.kinds ?? [entry.kind], "kindsOfEntry");
3887
+ var describe = /* @__PURE__ */ __name((entry) => `${entry.name} (${kindsOfEntry(entry).join(", ")}${entry.command ? `, from ${entry.command}` : ""})`, "describe");
3888
+ var unitedKinds = /* @__PURE__ */ __name((known, entry) => [
3889
+ .../* @__PURE__ */ new Set([...known, ...entry])
3890
+ ], "unitedKinds");
3891
+ var wordsOf = /* @__PURE__ */ __name(({ name, aliases }) => [name, ...aliases], "wordsOf");
3892
+ var joined = /* @__PURE__ */ __name((known, entry) => {
3893
+ const same = known.find(({ name }) => name === entry.name);
3894
+ const kinds = same ? unitedKinds(kindsOfEntry(same), kindsOfEntry(entry)) : kindsOfEntry(entry);
3895
+ if (same && same.kind !== entry.kind)
3896
+ invalid5(`two provider entries disagree on the kind: ${describe(same)} and ${describe(entry)}`);
3897
+ if (same && entry.imported === true && same.imported !== true)
3898
+ invalid5(`provider ${entry.name} is synced, so an entry cannot make it import-only`);
3899
+ const merged = same ? {
3900
+ ...same,
3901
+ ...kinds.length > 1 ? { kinds } : {},
3902
+ aliases: [.../* @__PURE__ */ new Set([...same.aliases, ...entry.aliases])],
3903
+ ...entry.command ? { command: entry.command } : {},
3904
+ ...entry.opens ? { opens: { ...same.opens, ...entry.opens } } : {}
3905
+ } : entry;
3906
+ const others = known.filter((one) => one !== same);
3907
+ for (const word of wordsOf(merged)) {
3908
+ const owner = others.find((one) => wordsOf(one).includes(word));
3909
+ if (owner)
3910
+ invalid5(`"${word}" names two providers: ${describe(owner)} and ${describe(merged)}`);
3911
+ }
3912
+ return same ? known.map((one) => one === same ? merged : one) : [...known, merged];
3913
+ }, "joined");
3914
+ var registry = PROVIDERS;
3915
+ var providers = /* @__PURE__ */ __name(() => registry, "providers");
3916
+ var useStoredProviders = /* @__PURE__ */ __name((entries) => {
3917
+ const left = [];
3918
+ registry = entries.reduce((known, entry) => {
3919
+ try {
3920
+ return joined(known, providerEntryOf(entry));
3921
+ } catch (error) {
3922
+ if (!(error instanceof CliError))
3923
+ throw error;
3924
+ left.push(entry);
3925
+ return known;
3926
+ }
3927
+ }, PROVIDERS);
3928
+ return left;
3929
+ }, "useStoredProviders");
3930
+ var addProvider = /* @__PURE__ */ __name((entry) => {
3931
+ registry = joined(registry, providerEntryOf(entry));
3932
+ }, "addProvider");
3933
+ var isKind = /* @__PURE__ */ __name((word) => KINDS.includes(word.toLowerCase()), "isKind");
3934
+ var providerNamed = /* @__PURE__ */ __name((word) => {
3935
+ const wanted = word.toLowerCase();
3936
+ return registry.find((entry) => wordsOf(entry).includes(wanted));
3937
+ }, "providerNamed");
3938
+ var kindIn = /* @__PURE__ */ __name((provider) => isFolderProvider(provider) ? "notes" : registry.find(({ name }) => name === provider)?.kind, "kindIn");
3939
+ var kindsIn = /* @__PURE__ */ __name((provider) => {
3940
+ if (isFolderProvider(provider))
3941
+ return ["notes"];
3942
+ const entry = registry.find(({ name }) => name === provider);
3943
+ return entry ? kindsOfEntry(entry) : [];
3944
+ }, "kindsIn");
3945
+ var importedOf = /* @__PURE__ */ __name((entry, held) => {
3946
+ const builtIn = PROVIDERS.find(({ name }) => name === entry.name);
3947
+ if (builtIn) {
3948
+ if (entry.imported === true && builtIn.imported !== true)
3949
+ invalid5(`provider ${entry.name} is synced, so an entry cannot make it import-only`);
3950
+ return builtIn.imported === true;
3951
+ }
3952
+ if (held === void 0)
3953
+ return entry.imported === true;
3954
+ if (entry.imported === true && held.imported !== true)
3955
+ invalid5(`provider ${entry.name} was registered without imported: an entry cannot make it import-only later`);
3956
+ return held.imported === true;
3957
+ }, "importedOf");
3958
+ var isImportedProvider = /* @__PURE__ */ __name((provider) => registry.find(({ name }) => name === provider)?.imported === true, "isImportedProvider");
3959
+ var holdsKind = /* @__PURE__ */ __name((provider, kind2) => kindsIn(provider).includes(kind2), "holdsKind");
3960
+ var holdsKindOf = /* @__PURE__ */ __name((provider, kind2) => kindIn(provider) === void 0 ? kind2 === "messages" : holdsKind(provider, kind2), "holdsKindOf");
3961
+ var kindOf = /* @__PURE__ */ __name((provider) => kindIn(provider) ?? "messages", "kindOf");
3962
+
3963
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/search/query.js
3964
+ var isBotProvider = /* @__PURE__ */ __name((provider) => provider.endsWith("-bot"), "isBotProvider");
3965
+ var inSource = /* @__PURE__ */ __name((source, provider) => source === "all" || source === "bots" && isBotProvider(provider) || source === "personal" && !isBotProvider(provider) || source === provider || providerNamed(source)?.name === provider || isKind(source) && holdsKindOf(provider, source), "inSource");
3966
+ var fail = /* @__PURE__ */ __name((message) => {
3967
+ throw new CliError("validation_error", message);
3968
+ }, "fail");
3969
+ var sourceOf = /* @__PURE__ */ __name((name, value, providers2) => {
3970
+ const sources = [...providers2, "personal", "bots", "all"];
3971
+ const source = value.toLowerCase();
3972
+ if (sources.includes(source))
3973
+ return source;
3974
+ if (source === "mail")
3975
+ return "email";
3976
+ if (source === "messages")
3977
+ return source;
3978
+ if (isKind(source))
3979
+ fail(`${name}${source} names ${source}, which a message search does not read \u2014 search ${source === "meetings" || source === "events" ? `all --source ${source}` : "notes"} does`);
3980
+ const named = providerNamed(source);
3981
+ if (named && providers2.includes(named.name))
3982
+ return named.name;
3983
+ return fail(`${name} takes ${[...sources, "messages", "mail"].join(", ")} \u2014 not "${value}"`);
3984
+ }, "sourceOf");
3985
+
3986
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/search/account-list.js
3987
+ var ACCOUNT_GROUPS = "accountGroups";
3988
+ var ACCOUNT_GROUPS_SETTING = "account_groups";
3989
+ var GROUP_NAME = /^[a-z0-9][a-z0-9_-]*$/i;
3990
+ var fail2 = /* @__PURE__ */ __name((message) => {
3991
+ throw new CliError("validation_error", message);
3992
+ }, "fail");
3993
+ var isAccountList = /* @__PURE__ */ __name((value) => value.includes(",") || value.includes(":"), "isAccountList");
3994
+ var itemsOf = /* @__PURE__ */ __name((value) => {
3995
+ const items = value.split(",").map((item) => item.trim());
3996
+ if (items.some((item) => item === ""))
3997
+ fail2(`"${value}" has an empty entry \u2014 separate accounts with one comma`);
3998
+ return items;
3999
+ }, "itemsOf");
4000
+ var isGroupName = /* @__PURE__ */ __name((name) => GROUP_NAME.test(name), "isGroupName");
4001
+ var groupName = /* @__PURE__ */ __name((name) => isGroupName(name) ? name : fail2(`a group name is letters, digits, - and _ \u2014 not "${name}"`), "groupName");
4002
+ var groupMembers = /* @__PURE__ */ __name((value) => itemsOf(value).map((item) => item.toLowerCase().startsWith("group:") ? fail2(`a group lists accounts, not other groups \u2014 "${item}"`) : item.includes(":") && item.split(":")[1] === "" ? fail2(`"${item}" names no account after the colon`) : item), "groupMembers");
4003
+ var describe2 = /* @__PURE__ */ __name((accounts) => accounts.map(({ provider, account, name }) => `${provider}:${account}${name ? ` (${name})` : ""}`).join(", "), "describe");
4004
+ var listedHolds = /* @__PURE__ */ __name((account, kind2) => (account.kinds ?? (account.kind === void 0 ? [] : [account.kind])).includes(kind2), "listedHolds");
4005
+ var kindHere = /* @__PURE__ */ __name((provider, running) => provider === running.provider ? kindOf(provider) : kindIn(provider), "kindHere");
4006
+ var kindsOfHere = /* @__PURE__ */ __name((provider, running) => {
4007
+ const kinds = kindsIn(provider);
4008
+ return { kind: kindHere(provider, running), ...kinds.length > 1 ? { kinds } : {} };
4009
+ }, "kindsOfHere");
4010
+ var heldOf = /* @__PURE__ */ __name((stored, running) => [
4011
+ ...stored.filter(({ provider }) => kindIn(provider) !== "notes" && !isDocumentAccountProvider(provider)).map(({ provider, account, name }) => ({ provider, account, name, ...kindsOfHere(provider, running) })),
4012
+ { provider: "notes", account: INTERNAL_NOTES, name: null, kind: "notes" },
4013
+ ...stored.filter(({ provider }) => isFolderProvider(provider)).map(({ id: id5, name, provider, account }) => ({
4014
+ provider: "notes",
4015
+ account: String(id5),
4016
+ name,
4017
+ kind: "notes",
4018
+ stored: { provider, account }
4019
+ })),
4020
+ ...stored.filter(({ provider }) => isDocumentAccountProvider(provider) || provider === ADDED_PROVIDER).map(({ id: id5, provider, account, name }) => ({
4021
+ provider: "notes",
4022
+ account: String(id5),
4023
+ name,
4024
+ kind: "notes",
4025
+ stored: { provider, account }
4026
+ }))
4027
+ ], "heldOf");
4028
+ var storedAs = /* @__PURE__ */ __name((held, key) => held.filter(({ stored }) => stored?.provider === key.provider && (key.account === "" || stored.account === key.account)), "storedAs");
4029
+ var registry2 = /* @__PURE__ */ __name(() => providers().map(({ name, aliases }) => aliases.length ? `${name} (${aliases.join(", ")})` : name).join(", "), "registry");
4030
+ var providerOf = /* @__PURE__ */ __name((prefix, held, { running, profiles }) => {
4031
+ const wanted = prefix.toLowerCase();
4032
+ if (wanted === running.command?.toLowerCase())
4033
+ return running.provider;
4034
+ const providers2 = [...new Set(held.map(({ provider }) => provider))];
4035
+ if (providers2.includes(wanted) || isDocumentAccountProvider(wanted))
4036
+ return wanted;
4037
+ const named = providerNamed(wanted);
4038
+ if (named)
4039
+ return named.name;
4040
+ const recorded = Object.values(profiles[wanted] ?? {})[0];
4041
+ if (recorded)
4042
+ return recorded.provider;
4043
+ return fail2(`${prefix} is not a provider \u2014 they are ${registry2()}; the store holds ${providers2.join(", ")}`);
4044
+ }, "providerOf");
4045
+ var profilesOf = /* @__PURE__ */ __name((provider, profiles) => Object.values(profiles).flatMap((named) => Object.entries(named).filter(([, key]) => key.provider === provider)), "profilesOf");
4046
+ var accountOf = /* @__PURE__ */ __name((prefix, ref, held, context3) => {
4047
+ const provider = providerOf(prefix, held, context3);
4048
+ if (isDocumentAccountProvider(provider) && !context3.profiles[prefix.toLowerCase()]?.[ref]) {
4049
+ const stored = storedAs(held, { provider, account: ref })[0];
4050
+ if (stored)
4051
+ return stored;
4052
+ }
4053
+ const folder = isFolderProvider(provider);
4054
+ const ofProvider = folder ? storedAs(held, { provider, account: "" }) : held.filter((one) => one.provider === provider);
4055
+ const byId = ofProvider.find(({ account, stored }) => account === ref || account === ref.toLowerCase() || folder && stored?.account === ref.toUpperCase());
4056
+ if (byId)
4057
+ return byId;
4058
+ const keyed = /* @__PURE__ */ __name((key) => ofProvider.find(({ account }) => account === key.account) ?? {
4059
+ ...key,
4060
+ name: null,
4061
+ ...kindsOfHere(key.provider, context3.running)
4062
+ }, "keyed");
4063
+ const recorded = context3.profiles[prefix.toLowerCase()]?.[ref];
4064
+ if (recorded && isFolderProvider(recorded.provider)) {
4065
+ const folder2 = held.find((one) => one.provider === "notes" && one.name === recorded.account);
4066
+ if (folder2)
4067
+ return folder2;
4068
+ return fail2(`no stored folder for ${prefix}:${ref}; sync that profile first`);
4069
+ }
4070
+ if (recorded && isDocumentAccountProvider(recorded.provider)) {
4071
+ const account = storedAs(held, recorded)[0];
4072
+ if (account)
4073
+ return account;
4074
+ return fail2(`no stored documents for ${prefix}:${ref}; sync that profile first`);
4075
+ }
4076
+ if (recorded)
4077
+ return keyed(recorded);
4078
+ const byProfile = [
4079
+ ...new Map(profilesOf(provider, context3.profiles).filter(([name]) => name === ref).map(([, key]) => [key.account, key])).values()
4080
+ ];
4081
+ if (byProfile.length === 1)
4082
+ return keyed(byProfile[0]);
4083
+ const byName = ofProvider.filter(({ name }) => name?.toLowerCase() === ref.toLowerCase());
4084
+ if (byName.length === 1)
4085
+ return byName[0];
4086
+ if (byName.length > 1 || byProfile.length > 1)
4087
+ fail2(`${provider}:${ref} names more than one account \u2014 use the id: ${describe2(ofProvider)}`);
4088
+ const names = profilesOf(provider, context3.profiles).map(([name]) => name);
4089
+ return fail2(`no ${provider} account "${ref}" \u2014 the store holds ${describe2(ofProvider) || "none"}` + (names.length ? `; profiles: ${[...new Set(names)].join(", ")}` : ""));
4090
+ }, "accountOf");
4091
+ var accountsOfWord = /* @__PURE__ */ __name((word, held, context3) => {
4092
+ const wanted = word.toLowerCase();
4093
+ if (wanted === "all")
4094
+ return [...held];
4095
+ if (wanted === "personal" || wanted === "bots")
4096
+ return held.filter((one) => listedHolds(one, "messages") && isBotProvider(one.provider) === (wanted === "bots"));
4097
+ if (isKind(wanted))
4098
+ return held.filter((one) => listedHolds(one, wanted));
4099
+ const recorded = context3.profiles[wanted];
4100
+ if (recorded && Object.values(recorded).every((key) => isFolderProvider(key.provider) || isDocumentAccountProvider(key.provider)))
4101
+ return Object.keys(recorded).map((profile) => accountOf(word, profile, held, context3));
4102
+ const provider = providerOf(word, held, context3);
4103
+ if (isDocumentAccountProvider(provider) || isFolderProvider(provider))
4104
+ return storedAs(held, { provider, account: "" });
4105
+ return held.filter((one) => one.provider === provider);
4106
+ }, "accountsOfWord");
4107
+ var keyOf = /* @__PURE__ */ __name(({ provider, account }) => `${provider}\0${account}`, "keyOf");
4108
+ var sourceOf2 = /* @__PURE__ */ __name(({ provider, account }) => `${provider}:${account}`, "sourceOf");
4109
+ var sameAs = /* @__PURE__ */ __name((key) => (one) => one.provider === key.provider && one.account === key.account, "sameAs");
4110
+ var entriesOfList = /* @__PURE__ */ __name((value, context3) => {
4111
+ const held = heldOf(context3.held, context3.running);
4112
+ const entries = [];
4113
+ const entry = /* @__PURE__ */ __name((item, group) => {
4114
+ const colon = item.indexOf(":");
4115
+ if (colon === -1) {
4116
+ try {
4117
+ entries.push({ entry: item, accounts: accountsOfWord(item, held, context3) });
4118
+ } catch (error) {
4119
+ if (!group || !(error instanceof CliError))
4120
+ throw error;
4121
+ fail2(`"${item}" in group ${group}: ${error.message}`);
4122
+ }
4123
+ return;
4124
+ }
4125
+ const prefix = item.slice(0, colon);
4126
+ const ref = item.slice(colon + 1).trim();
4127
+ if (ref === "")
4128
+ fail2(`"${item}" names no account after the colon`);
4129
+ if (prefix.toLowerCase() === "group") {
4130
+ if (group)
4131
+ fail2(`group ${group} lists another group \u2014 a group lists accounts`);
4132
+ const members = context3.groups[ref];
4133
+ if (!members) {
4134
+ const known = Object.keys(context3.groups);
4135
+ fail2(`no account group "${ref}" \u2014 ${known.length ? `there are ${known.join(", ")}` : "none saved yet"}; \`config set ${ACCOUNT_GROUPS_SETTING}.${ref} <accounts>\` saves one`);
4136
+ }
4137
+ for (const member of members)
4138
+ entry(member, ref);
4139
+ return;
4140
+ }
4141
+ entries.push({ entry: item, accounts: [accountOf(prefix, ref, held, context3)] });
4142
+ }, "entry");
4143
+ for (const item of itemsOf(value))
4144
+ entry(item);
4145
+ const { only } = context3;
4146
+ return entries.map(({ entry: entry2, accounts }) => ({
4147
+ entry: entry2,
4148
+ accounts: accounts.filter((one) => only === void 0 || only.has(keyOf(one))).map(({ provider, account, kind: kind2, kinds }) => ({
4149
+ provider,
4150
+ account,
4151
+ kind: kind2,
4152
+ ...kinds === void 0 ? {} : { kinds }
4153
+ }))
4154
+ }));
4155
+ }, "entriesOfList");
4156
+ var accountsOfList = /* @__PURE__ */ __name((value, context3) => {
4157
+ const chosen = /* @__PURE__ */ new Map();
4158
+ for (const { accounts } of entriesOfList(value, context3))
4159
+ for (const one of accounts)
4160
+ if (!chosen.has(keyOf(one)))
4161
+ chosen.set(keyOf(one), one);
4162
+ return [...chosen.values()];
4163
+ }, "accountsOfList");
4164
+ var READS = {
4165
+ messages: "messenger messages \u2014 search messages reads them",
4166
+ mail: "a mailbox \u2014 memo search mail reads it",
4167
+ notes: "notes \u2014 search notes reads them",
4168
+ documents: "documents \u2014 search notes reads them",
4169
+ meetings: "meetings \u2014 search all reads them",
4170
+ events: "calendar events \u2014 no search reads them yet",
4171
+ crm: "CRM deals and leads \u2014 search all reads them"
4172
+ };
4173
+ var fitting = /* @__PURE__ */ __name((entries, kinds, what, reasonOf = (kind2) => READS[kind2], alsoFits = () => false) => {
4174
+ const chosen = /* @__PURE__ */ new Map();
4175
+ const skipped = [];
4176
+ for (const { entry, accounts } of entries) {
4177
+ const fits = accounts.filter((one) => kinds.some((kind2) => listedHolds(one, kind2)) || alsoFits(one));
4178
+ for (const { provider, account } of fits)
4179
+ if (!chosen.has(keyOf({ provider, account })))
4180
+ chosen.set(keyOf({ provider, account }), { provider, account });
4181
+ const known = accounts.filter(({ kind: kind2 }) => kind2 !== void 0);
4182
+ const unknown2 = accounts.filter((one) => one.kind === void 0 && !alsoFits(one));
4183
+ if (known.length)
4184
+ for (const { provider, account } of unknown2)
4185
+ skipped.push({ source: `${provider}:${account}`, code: "not_found", reason: UNKNOWN_PROVIDER });
4186
+ if (fits.length)
4187
+ continue;
4188
+ const other = known[0];
4189
+ skipped.push(other?.kind ? { source: entry, code: "validation_error", reason: reasonOf(other.kind) } : unknown2.length ? { source: entry, code: "not_found", reason: UNKNOWN_PROVIDER } : { source: entry, code: "not_found", reason: "no account in the store" });
4190
+ }
4191
+ if (chosen.size === 0)
4192
+ fail2(`--source names nothing ${what} reads: ${skipped.map(({ source, reason }) => `${source} (${reason})`).join(", ")}`);
4193
+ return { accounts: [...chosen.values()], skipped };
4194
+ }, "fitting");
4195
+
4196
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/domain/deals.js
3071
4197
  var DEAL_KINDS = ["deal", "lead"];
3072
4198
  var DEAL_STATUSES = ["open", "won", "lost"];
3073
4199
  var STAGE_OUTCOMES = DEAL_STATUSES;
@@ -3077,17 +4203,18 @@ var dealLine = /* @__PURE__ */ __name((deal) => {
3077
4203
  return `${deal.title} \xB7 ${deal.stage}${money}${deal.status === "open" ? "" : ` (${deal.status})`}`;
3078
4204
  }, "dealLine");
3079
4205
 
3080
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/domain/orders.js
4206
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/domain/orders.js
3081
4207
  var ORDER_STATUSES = ["placed", "shipped", "delivered", "cancelled", "returned"];
3082
4208
  var ORDER_PURPOSES = ["personal", "business", "client", "other"];
3083
4209
  var orderLine = /* @__PURE__ */ __name((order) => {
4210
+ const party = order.direction === "sale" && order.customerName !== null ? `to ${order.customerName}` : order.supplierName;
3084
4211
  const money = order.total === null || order.currency === null ? "" : `, ${moneyLabel(order.total, order.currency)}`;
3085
4212
  const notes2 = [order.status, order.review === "confirmed" ? null : order.review].filter(Boolean).join(", ");
3086
- return `${order.number ?? `#${order.id}`} \xB7 ${order.supplierName}${money} (${notes2})`;
4213
+ return `${order.number ?? `#${order.id}`} \xB7 ${party}${money} (${notes2})`;
3087
4214
  }, "orderLine");
3088
4215
  var orderTitle = /* @__PURE__ */ __name((order) => `Order ${orderLine(order)}`, "orderTitle");
3089
4216
 
3090
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/domain/relations.js
4217
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/domain/relations.js
3091
4218
  var ORGANIZATION_ROLES = [
3092
4219
  "employee",
3093
4220
  "contractor",
@@ -3098,6 +4225,21 @@ var ORGANIZATION_ROLES = [
3098
4225
  "contact"
3099
4226
  ];
3100
4227
  var PROJECT_ROLES = ["owner", "manager", "contributor", "client-contact", "approver"];
4228
+ var CONTRACT_ROLES = ["customer", "supplier", "signatory", "guarantor"];
4229
+ var RELATED_ROLES = ["colleague", "adviser", "investor", "mentor", "family", "friend"];
4230
+ var ENGAGEMENT_LEVELS = ["none", "low", "medium", "high"];
4231
+ var isEngagement = /* @__PURE__ */ __name((value) => typeof value === "string" && ENGAGEMENT_LEVELS.includes(value), "isEngagement");
4232
+ var checkEngagement = /* @__PURE__ */ __name((kind2, from, to, level) => {
4233
+ if (kind2 !== "member-of" || from !== "person" || to !== "project")
4234
+ throw new CliError("validation_error", "an engagement level is set only on a person's member-of a project", {
4235
+ reason: "relationship.engagement-ends"
4236
+ });
4237
+ if (!isEngagement(level))
4238
+ throw new CliError("validation_error", `an engagement level is one of ${ENGAGEMENT_LEVELS.join(", ")}`, {
4239
+ reason: "relationship.engagement-unknown"
4240
+ });
4241
+ return level;
4242
+ }, "checkEngagement");
3101
4243
  var RELATIONS = {
3102
4244
  "member-of": {
3103
4245
  from: ["person", "organization", "project", "chat", "email_thread"],
@@ -3108,46 +4250,58 @@ var RELATIONS = {
3108
4250
  "customer-of": { from: ["person", "organization"], to: ["organization"], inverse: "supplier of" },
3109
4251
  "partner-of": { from: ["organization"], to: ["organization"], symmetric: true },
3110
4252
  "related-to": {
3111
- from: ["person", "organization", "project", "task", "deal", "lead"],
4253
+ from: ["person", "organization", "project", "task", "deal", "lead", "contract"],
3112
4254
  to: ["person", "organization", "project", "task"],
3113
- roles: { from: { deal: DEAL_ROLES, lead: DEAL_ROLES } }
4255
+ roles: { from: { deal: DEAL_ROLES, lead: DEAL_ROLES, contract: CONTRACT_ROLES } }
3114
4256
  }
3115
4257
  };
3116
4258
  var RELATION_KINDS = Object.keys(RELATIONS);
3117
- var specOf = /* @__PURE__ */ __name((kind) => Object.hasOwn(RELATIONS, kind) ? RELATIONS[kind] : void 0, "specOf");
3118
- var isRelationKind = /* @__PURE__ */ __name((kind) => specOf(kind) !== void 0, "isRelationKind");
4259
+ var specOf = /* @__PURE__ */ __name((kind2) => Object.hasOwn(RELATIONS, kind2) ? RELATIONS[kind2] : void 0, "specOf");
4260
+ var isRelationKind = /* @__PURE__ */ __name((kind2) => specOf(kind2) !== void 0, "isRelationKind");
3119
4261
  var memberOnly = /* @__PURE__ */ __name((type) => type === "chat" || type === "email_thread", "memberOnly");
3120
- var checkEnds = /* @__PURE__ */ __name((kind, from, to) => {
3121
- const spec = specOf(kind);
4262
+ var partyOnly = /* @__PURE__ */ __name((from, to) => from === "contract" && to !== "person" && to !== "organization", "partyOnly");
4263
+ var checkEnds = /* @__PURE__ */ __name((kind2, from, to) => {
4264
+ const spec = specOf(kind2);
3122
4265
  if (!spec)
3123
4266
  throw new CliError("validation_error", `a relationship's kind is one of ${RELATION_KINDS.join(", ")}`);
3124
- if (memberOnly(from) && (kind !== "member-of" || to !== "project"))
4267
+ if (memberOnly(from) && (kind2 !== "member-of" || to !== "project"))
3125
4268
  throw new CliError("validation_error", `a ${from === "chat" ? "chat" : "mail thread"} is related only as member-of a project`);
4269
+ if (partyOnly(from, to))
4270
+ throw new CliError("validation_error", "a contract is related only to a person or an organization");
3126
4271
  if (!spec.from.includes(from) || !spec.to.includes(to))
3127
- throw new CliError("validation_error", `${kind} joins ${spec.from.join(", ")} to ${spec.to.join(", ")}, not ${from} to ${to}`);
4272
+ throw new CliError("validation_error", `${kind2} joins ${spec.from.join(", ")} to ${spec.to.join(", ")}, not ${from} to ${to}`);
3128
4273
  return spec;
3129
4274
  }, "checkEnds");
3130
- var rolesOf = /* @__PURE__ */ __name((kind, from, to) => {
3131
- const spec = specOf(kind);
3132
- if (kind === "member-of" && from !== "person")
4275
+ var isParty = /* @__PURE__ */ __name((type) => type === "person" || type === "organization", "isParty");
4276
+ var rolesOf = /* @__PURE__ */ __name((kind2, from, to) => {
4277
+ const spec = specOf(kind2);
4278
+ if (kind2 === "member-of" && from !== "person")
3133
4279
  return void 0;
3134
4280
  return spec?.roles?.from?.[from] ?? spec?.roles?.to?.[to];
3135
4281
  }, "rolesOf");
3136
- var ROLE_LISTS = { organization: ORGANIZATION_ROLES, project: PROJECT_ROLES, deal: DEAL_ROLES };
3137
- var roleListOf = /* @__PURE__ */ __name((kind, from, to) => {
3138
- const roles = rolesOf(kind, from, to);
4282
+ var ROLE_LISTS = {
4283
+ organization: ORGANIZATION_ROLES,
4284
+ project: PROJECT_ROLES,
4285
+ deal: DEAL_ROLES,
4286
+ contract: CONTRACT_ROLES,
4287
+ related: RELATED_ROLES
4288
+ };
4289
+ var roleListOf = /* @__PURE__ */ __name((kind2, from, to) => {
4290
+ if (kind2 === "related-to" && isParty(from) && isParty(to))
4291
+ return "related";
4292
+ const roles = rolesOf(kind2, from, to);
3139
4293
  return Object.keys(ROLE_LISTS).find((list) => ROLE_LISTS[list] === roles);
3140
4294
  }, "roleListOf");
3141
- var checkRole = /* @__PURE__ */ __name((kind, from, to, role, extra = []) => {
3142
- const roles = rolesOf(kind, from, to)?.concat(extra);
4295
+ var checkRole = /* @__PURE__ */ __name((kind2, from, to, role, extra = []) => {
4296
+ const roles = rolesOf(kind2, from, to)?.concat(extra);
3143
4297
  if (roles && !roles.includes(role))
3144
- throw new CliError("validation_error", `a ${from}'s role on ${kind} ${to} is one of ${roles.join(", ")}`, {
4298
+ throw new CliError("validation_error", `a ${from}'s role on ${kind2} ${to} is one of ${roles.join(", ")}`, {
3145
4299
  reason: "relationship.role-unknown"
3146
4300
  });
3147
4301
  return role;
3148
4302
  }, "checkRole");
3149
- var isSymmetric = /* @__PURE__ */ __name((kind) => specOf(kind)?.symmetric === true, "isSymmetric");
3150
- var inverseOf = /* @__PURE__ */ __name((kind) => specOf(kind)?.symmetric ? kind : specOf(kind)?.inverse ?? null, "inverseOf");
4303
+ var isSymmetric = /* @__PURE__ */ __name((kind2) => specOf(kind2)?.symmetric === true, "isSymmetric");
4304
+ var inverseOf = /* @__PURE__ */ __name((kind2) => specOf(kind2)?.symmetric ? kind2 : specOf(kind2)?.inverse ?? null, "inverseOf");
3151
4305
  var STANDINGS = ["confirmed", "reported", "proposed", "ended"];
3152
4306
  var standingOf = /* @__PURE__ */ __name((link, now) => {
3153
4307
  if (link.endsAt != null && link.endsAt <= now)
@@ -3159,10 +4313,11 @@ var standingOf = /* @__PURE__ */ __name((link, now) => {
3159
4313
  return link.accountId != null ? "reported" : "proposed";
3160
4314
  }, "standingOf");
3161
4315
  var isUsable = /* @__PURE__ */ __name((standing) => standing === "confirmed" || standing === "reported", "isUsable");
3162
- var notOverriddenSql = /* @__PURE__ */ __name((alias) => `NOT EXISTS (SELECT 1 FROM links override WHERE override.kind = ${alias}.kind AND override.from_type = ${alias}.from_type AND override.from_id = ${alias}.from_id AND override.to_type = ${alias}.to_type AND override.to_id = ${alias}.to_id AND json_extract(override.metadata, '$.overrides') = ${alias}.id)`, "notOverriddenSql");
4316
+ var KEYED = "kind IN ('member-of', 'related-to', 'reports-to', 'customer-of', 'partner-of') AND to_id IS NOT NULL";
4317
+ var notOverriddenSql = /* @__PURE__ */ __name((alias) => `NOT EXISTS (SELECT 1 FROM links override WHERE ${KEYED} AND override.kind = ${alias}.kind AND override.from_type = ${alias}.from_type AND override.from_id = ${alias}.from_id AND override.to_type = ${alias}.to_type AND override.to_id = ${alias}.to_id AND json_extract(override.metadata, '$.overrides') = ${alias}.id)`, "notOverriddenSql");
3163
4318
  var usableLinkSql = /* @__PURE__ */ __name((alias, now) => `(${alias}.confirmed = 1 OR (${alias}.account_id IS NOT NULL AND ${alias}.deleted_at IS NULL))` + (now === void 0 ? "" : ` AND (${alias}.ends_at IS NULL OR ${alias}.ends_at > ${Math.trunc(now)})`), "usableLinkSql");
3164
4319
 
3165
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/domain/tags.js
4320
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/domain/tags.js
3166
4321
  var TAG_TYPES = ["chat", "contact", "message", "task"];
3167
4322
  var TAG = /^[a-z0-9-]{1,32}$/;
3168
4323
  var tagOf = /* @__PURE__ */ __name((value) => {
@@ -3176,7 +4331,17 @@ var normalizeTag = /* @__PURE__ */ __name((value) => {
3176
4331
  return tag;
3177
4332
  }, "normalizeTag");
3178
4333
 
3179
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/store/sqlite/link-kinds.js
4334
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/store/sqlite/link-source.js
4335
+ var REPORTER_SQL = "(SELECT provider || ':' || external_id FROM accounts r WHERE r.id = links.account_id) AS reporter";
4336
+ var sourceOf3 = /* @__PURE__ */ __name((database, row, metadata) => {
4337
+ const reporter = row.account_id == null ? void 0 : "reporter" in row ? row.reporter : database.prepare("SELECT provider || ':' || external_id AS key FROM accounts WHERE id = ?").get(Number(row.account_id))?.key;
4338
+ return {
4339
+ ...typeof reporter === "string" ? { account: reporter } : {},
4340
+ ...typeof metadata.derived === "string" ? { derived: metadata.derived } : {}
4341
+ };
4342
+ }, "sourceOf");
4343
+
4344
+ // node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/store/sqlite/link-kinds.js
3180
4345
  var LINK_KINDS = [
3181
4346
  "links-to",
3182
4347
  "blocked-by",
@@ -3197,10 +4362,37 @@ var LINK_KINDS = [
3197
4362
  ];
3198
4363
  var LINK_ORIGINS = ["file", "owner", "suggested", "message"];
3199
4364
  var LINK_SOURCES = [...LINK_ORIGINS, "calendar"];
3200
- var linkKind = /* @__PURE__ */ __name((kind) => `'${kind}'`, "linkKind");
4365
+ var linkKind = /* @__PURE__ */ __name((kind2) => `'${kind2}'`, "linkKind");
3201
4366
  var COUNTERPART_ROLE = "counterpart";
3202
4367
 
3203
4368
  export {
4369
+ logAttributes,
4370
+ fromLogAttributes,
4371
+ snakeLogger,
4372
+ LOG_ATTRIBUTES,
4373
+ KEEP_RUNS_FOR_DAYS,
4374
+ KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
4375
+ KEEP_STORE_RUNS_FOR_DAYS,
4376
+ RUNS_SIZE_LIMIT_MB,
4377
+ runsDirFor,
4378
+ startRun,
4379
+ runtime,
4380
+ newRunId,
4381
+ listRuns,
4382
+ findRun,
4383
+ readEvents,
4384
+ asOwnProcess,
4385
+ currentRun,
4386
+ inRun,
4387
+ runEvent,
4388
+ typedCommand,
4389
+ useAsProcessRun,
4390
+ processRun,
4391
+ enclosingTraceId,
4392
+ traceOf,
4393
+ childTrace,
4394
+ withAttempt,
4395
+ currentAttempt,
3204
4396
  formatMeetingReference,
3205
4397
  parseMeetingReference,
3206
4398
  canonicalMeetingReference,
@@ -3288,6 +4480,44 @@ export {
3288
4480
  validateMeetingSeriesInventoryCursor,
3289
4481
  aggregateMeetingCounts,
3290
4482
  aggregateMeetingStats,
4483
+ READ_BUDGET_EXCEEDED,
4484
+ SOURCE_REVIEW_KIND,
4485
+ SOURCE_REVIEW_CAUSES,
4486
+ ERASED_TEXT,
4487
+ severity,
4488
+ graver,
4489
+ text6 as text,
4490
+ id4 as id,
4491
+ time,
4492
+ zonedTime,
4493
+ count6 as count,
4494
+ untrusted,
4495
+ providerMetadata,
4496
+ evidenceSource,
4497
+ sourceReview,
4498
+ author,
4499
+ TASK_KINDS,
4500
+ TASK_STATES,
4501
+ CLOSED_STATES,
4502
+ TASK_ORIGINS,
4503
+ TASK_VERDICTS,
4504
+ isClosedState,
4505
+ PRIORITY_LABELS,
4506
+ priorityLabel,
4507
+ priorityBand,
4508
+ legacyPriority,
4509
+ checkedScore,
4510
+ priorityOf,
4511
+ priorityOption,
4512
+ createTaskService,
4513
+ matches,
4514
+ FACT_STATUSES,
4515
+ MEMORY_KINDS,
4516
+ MEMORY_STATUSES,
4517
+ MEMORY_SCOPES,
4518
+ WORK_TASK_TYPES,
4519
+ TASK_TYPES2 as TASK_TYPES,
4520
+ CATEGORIES,
3291
4521
  parseDecimal,
3292
4522
  formatDecimal,
3293
4523
  currencyOf,
@@ -3298,6 +4528,11 @@ export {
3298
4528
  moneyLabel,
3299
4529
  quantityOf,
3300
4530
  lineUnits,
4531
+ DEAL_KINDS,
4532
+ DEAL_STATUSES,
4533
+ STAGE_OUTCOMES,
4534
+ DEAL_ROLES,
4535
+ dealLine,
3301
4536
  INVOICE_DIRECTIONS,
3302
4537
  INVOICE_STATUSES,
3303
4538
  MONEY_DIRECTIONS,
@@ -3307,29 +4542,12 @@ export {
3307
4542
  paymentLine,
3308
4543
  invoiceTitle,
3309
4544
  paymentEntryTitle,
3310
- CATALOG_KINDS,
3311
- BUSINESS_KINDS,
3312
- CONTRACT_KINDS,
3313
- CONTRACT_STATUSES,
3314
- SUBSCRIPTION_STATUSES,
3315
- WALLET_KINDS,
3316
- TRANSACTION_STATUSES,
3317
- ORDER_DIRECTIONS,
3318
- intervalOf,
3319
- productLine,
3320
- contractLine,
3321
- subscriptionLine,
3322
- walletLine,
3323
- transactionLine,
3324
- DEAL_KINDS,
3325
- DEAL_STATUSES,
3326
- STAGE_OUTCOMES,
3327
- DEAL_ROLES,
3328
- dealLine,
3329
4545
  ORDER_STATUSES,
3330
4546
  ORDER_PURPOSES,
3331
4547
  orderLine,
3332
4548
  orderTitle,
4549
+ isEngagement,
4550
+ checkEngagement,
3333
4551
  RELATION_KINDS,
3334
4552
  isRelationKind,
3335
4553
  checkEnds,
@@ -3342,55 +4560,94 @@ export {
3342
4560
  STANDINGS,
3343
4561
  standingOf,
3344
4562
  isUsable,
4563
+ KEYED,
3345
4564
  notOverriddenSql,
3346
4565
  usableLinkSql,
4566
+ organization,
4567
+ project,
4568
+ reminder,
4569
+ CATALOG_KINDS,
4570
+ BUSINESS_KINDS,
4571
+ CONTRACT_KINDS,
4572
+ CONTRACT_STATUSES,
4573
+ SUBSCRIPTION_STATUSES,
4574
+ WALLET_KINDS,
4575
+ TRANSACTION_STATUSES,
4576
+ ORDER_DIRECTIONS,
4577
+ intervalOf,
4578
+ productLine,
4579
+ contractLine,
4580
+ subscriptionLine,
4581
+ walletLine,
4582
+ transactionLine,
3347
4583
  TAG_TYPES,
3348
4584
  tagOf,
3349
4585
  normalizeTag,
4586
+ REPORTER_SQL,
4587
+ sourceOf3 as sourceOf,
3350
4588
  LINK_KINDS,
3351
4589
  LINK_ORIGINS,
3352
4590
  LINK_SOURCES,
3353
4591
  linkKind,
3354
4592
  COUNTERPART_ROLE,
3355
- TASK_KINDS,
3356
- TASK_STATES,
3357
- CLOSED_STATES,
3358
- TASK_ORIGINS,
3359
- TASK_VERDICTS,
3360
- isClosedState,
3361
- PRIORITY_LABELS,
3362
- priorityLabel,
3363
- priorityBand,
3364
- legacyPriority,
3365
- checkedScore,
3366
- priorityOf,
3367
- priorityOption,
3368
- createTaskService,
3369
- matches,
3370
- FACT_STATUSES,
3371
- MEMORY_KINDS,
3372
- MEMORY_STATUSES,
3373
- MEMORY_SCOPES,
3374
- WORK_TASK_TYPES,
3375
- TASK_TYPES2 as TASK_TYPES,
3376
- text6 as text,
3377
- id4 as id,
3378
- time,
3379
- zonedTime,
3380
- count6 as count,
3381
- untrusted,
3382
- providerMetadata,
3383
- evidenceSource,
3384
- author,
3385
- organization,
3386
- project,
3387
- reminder,
3388
4593
  damageMarkPath,
3389
4594
  healthMarkPath,
4595
+ journalMarkPath,
3390
4596
  markStoreDamaged,
3391
4597
  readDamageMark,
3392
4598
  clearDamageMark,
3393
4599
  refuseDamagedStore,
4600
+ markJournalLost,
4601
+ readJournalMark,
3394
4602
  readHealthMark,
3395
- recordDeepCheck
4603
+ recordDeepCheck,
4604
+ formatLocator,
4605
+ isLocator,
4606
+ parseLocator,
4607
+ SIMPLE_REFERENCES,
4608
+ formatReference,
4609
+ parseReference,
4610
+ canonicalReference,
4611
+ looksLikeReference,
4612
+ providerLabel,
4613
+ isFolderProvider,
4614
+ folderProviderSql,
4615
+ folderProviderOf,
4616
+ DOCUMENT_ACCOUNT_PROVIDERS,
4617
+ isDocumentAccountProvider,
4618
+ ADDED_PROVIDER,
4619
+ ADDED_ACCOUNT,
4620
+ notAdded,
4621
+ filesAccountSql,
4622
+ INTERNAL_NOTES,
4623
+ UNKNOWN_PROVIDER,
4624
+ providerEntryOf,
4625
+ kindsOfEntry,
4626
+ unitedKinds,
4627
+ providers,
4628
+ useStoredProviders,
4629
+ addProvider,
4630
+ isKind,
4631
+ providerNamed,
4632
+ kindIn,
4633
+ importedOf,
4634
+ isImportedProvider,
4635
+ holdsKind,
4636
+ holdsKindOf,
4637
+ isBotProvider,
4638
+ inSource,
4639
+ sourceOf as sourceOf2,
4640
+ ACCOUNT_GROUPS,
4641
+ ACCOUNT_GROUPS_SETTING,
4642
+ isAccountList,
4643
+ isGroupName,
4644
+ groupName,
4645
+ groupMembers,
4646
+ listedHolds,
4647
+ keyOf,
4648
+ sourceOf2 as sourceOf3,
4649
+ sameAs,
4650
+ entriesOfList,
4651
+ accountsOfList,
4652
+ fitting
3396
4653
  };