@wirecat/zoom-cli 0.69.0 → 0.71.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 (177) hide show
  1. package/README.md +1 -1
  2. package/dist/account-removal.d.ts +6 -0
  3. package/dist/account-removal.d.ts.map +1 -0
  4. package/dist/account-removal.js +43 -0
  5. package/dist/account-removal.js.map +1 -0
  6. package/dist/answer-entities.d.ts +2 -0
  7. package/dist/answer-entities.d.ts.map +1 -1
  8. package/dist/bin/zm.js +2 -2
  9. package/dist/bundle/{all-profiles-ZQWPCJEK.js → all-profiles-O4YNVPZX.js} +9 -9
  10. package/dist/bundle/answer-policy-PPSPMCLH.js +104 -0
  11. package/dist/bundle/{anthropic-7FUQ2HYJ.js → anthropic-7GGRX3RX.js} +20 -9
  12. package/dist/bundle/{app-server-DNPE2EQB.js → app-server-CPMKM3HI.js} +50 -50
  13. package/dist/bundle/{bun-ZVQFCFCC.js → bun-POHZKEPV.js} +2 -2
  14. package/dist/bundle/{bun-sqlite-EB2UMUPJ.js → bun-sqlite-PGYMBPEL.js} +4 -4
  15. package/dist/bundle/{chunk-R2ULMWB4.js → chunk-2FV5JUQU.js} +39 -593
  16. package/dist/bundle/{chunk-R3JYPY3J.js → chunk-2KESWII5.js} +2 -2
  17. package/dist/bundle/{chunk-S2EAGDS7.js → chunk-2RUAMDVV.js} +11 -11
  18. package/dist/bundle/{chunk-H3MFBYTQ.js → chunk-2U27KIKU.js} +5 -5
  19. package/dist/bundle/{chunk-KAPJQGHE.js → chunk-2U6SER67.js} +1 -1
  20. package/dist/bundle/chunk-4LAQDZXU.js +1635 -0
  21. package/dist/bundle/{chunk-SQT47CFW.js → chunk-4QPQ7MDA.js} +1 -1
  22. package/dist/bundle/{chunk-MNOVYS43.js → chunk-4QUFFB2U.js} +3 -3
  23. package/dist/bundle/{chunk-V74QFMSL.js → chunk-54YDWBYG.js} +1 -1
  24. package/dist/bundle/{chunk-MSDCZ6GT.js → chunk-5J4AMBMM.js} +4 -4
  25. package/dist/bundle/{chunk-GR3QDHBU.js → chunk-5K7OGPGA.js} +5 -5
  26. package/dist/bundle/{chunk-WY4NYPPS.js → chunk-5LJTU4LY.js} +12 -12
  27. package/dist/bundle/{chunk-MJMVIFSC.js → chunk-633QXP57.js} +10 -8
  28. package/dist/bundle/{chunk-EPPSMCEV.js → chunk-64ZHF6PJ.js} +1 -1
  29. package/dist/bundle/{chunk-ZRHMB3LQ.js → chunk-77TCCHMP.js} +1 -1
  30. package/dist/bundle/{chunk-BOAMDYLY.js → chunk-7QC4M4HS.js} +2 -2
  31. package/dist/bundle/{chunk-O7L44JK2.js → chunk-7ROXXRGG.js} +3933 -1525
  32. package/dist/bundle/{chunk-MVDPZRFE.js → chunk-ALIT5QFT.js} +1 -1
  33. package/dist/bundle/{chunk-6N2D6JGX.js → chunk-BBTQIVFP.js} +1 -1
  34. package/dist/bundle/{chunk-QXM7S3Y3.js → chunk-BGTEVIW4.js} +5 -5
  35. package/dist/bundle/{chunk-JX5JJZC3.js → chunk-CFQF6IGY.js} +2 -2
  36. package/dist/bundle/{chunk-5GOE6PQK.js → chunk-CKPCVEXU.js} +5 -5
  37. package/dist/bundle/{chunk-6KMTQX3D.js → chunk-CRFOGYDG.js} +1 -1
  38. package/dist/bundle/{chunk-5H6VTEEC.js → chunk-CT4WVR4N.js} +2 -2
  39. package/dist/bundle/{chunk-3TPRYZUW.js → chunk-DHWBSXG3.js} +23 -23
  40. package/dist/bundle/{chunk-IPBZKUC3.js → chunk-DIQLXAAZ.js} +3 -3
  41. package/dist/bundle/{chunk-JZ4YOAHA.js → chunk-DK6ICIGL.js} +4558 -1670
  42. package/dist/bundle/{chunk-OSBHEM2A.js → chunk-DRBQDCDU.js} +10 -10
  43. package/dist/bundle/{chunk-G6IX2MD2.js → chunk-DSVZEXYJ.js} +1104 -948
  44. package/dist/bundle/{chunk-B6JMVB6R.js → chunk-EOSVN2ER.js} +1 -1
  45. package/dist/bundle/{chunk-MOTKS7XG.js → chunk-FSHCAWZS.js} +29354 -16490
  46. package/dist/bundle/{chunk-TKXLWFM2.js → chunk-GGS6D4W4.js} +3 -3
  47. package/dist/bundle/{chunk-4APZQYCH.js → chunk-GL3MYFMX.js} +4 -4
  48. package/dist/bundle/{chunk-LDRQ5NAP.js → chunk-GXF5HFFP.js} +3 -3
  49. package/dist/bundle/{chunk-5ZF6QVMC.js → chunk-HB6XJQ3Y.js} +4 -4
  50. package/dist/bundle/{chunk-QW5VPZEH.js → chunk-I4DFFR7F.js} +23 -1
  51. package/dist/bundle/{chunk-DHD25JII.js → chunk-IAV5BG3I.js} +1 -1
  52. package/dist/bundle/{chunk-52DCABMU.js → chunk-IED3NS7G.js} +30 -38
  53. package/dist/bundle/{chunk-LQX74VKG.js → chunk-INVTDIF6.js} +1 -1
  54. package/dist/bundle/{chunk-CKK6JOC4.js → chunk-KMV7GZB6.js} +2 -2
  55. package/dist/bundle/{chunk-XRZDYWF6.js → chunk-LE7MDAQG.js} +2 -2
  56. package/dist/bundle/{chunk-B5D7NZI7.js → chunk-M76MXMLY.js} +1 -1
  57. package/dist/bundle/{chunk-37B7A4RP.js → chunk-MEED7YFG.js} +1 -1
  58. package/dist/bundle/{chunk-LEA4BGK7.js → chunk-MRI6QMZ3.js} +11 -11
  59. package/dist/bundle/{chunk-6TICX3MN.js → chunk-MW4EGDDV.js} +2 -2
  60. package/dist/bundle/{chunk-SZ3Z4ZNO.js → chunk-N2FNMION.js} +1 -1
  61. package/dist/bundle/{chunk-CUZHKYC2.js → chunk-OHWMIUCT.js} +450 -641
  62. package/dist/bundle/{chunk-KNE6VFHZ.js → chunk-OORMSM6O.js} +1 -1
  63. package/dist/bundle/{chunk-Z6TTGTMU.js → chunk-OWEBWDHV.js} +76 -6
  64. package/dist/bundle/{chunk-5ZJXKASF.js → chunk-P3XC6EDU.js} +17 -21
  65. package/dist/bundle/chunk-Q2SUFGSH.js +136 -0
  66. package/dist/bundle/{chunk-TFFEFEG2.js → chunk-Q3XLZIY3.js} +18 -18
  67. package/dist/bundle/{chunk-IEC4E65G.js → chunk-Q5PI72CR.js} +5 -1
  68. package/dist/bundle/{chunk-V4MM6GST.js → chunk-QTHIU7CO.js} +1 -1
  69. package/dist/bundle/{chunk-JHFP3Z5S.js → chunk-QVSLSWAL.js} +8 -8
  70. package/dist/bundle/{chunk-QLGG7S6F.js → chunk-RN4EHCC5.js} +22 -4
  71. package/dist/bundle/{chunk-BL36NSV5.js → chunk-RQG5VOGH.js} +12 -2
  72. package/dist/bundle/{chunk-RPQ3JOD3.js → chunk-SELXER2Q.js} +5 -5
  73. package/dist/bundle/{chunk-KX5MZVPX.js → chunk-TM4JSVGQ.js} +60 -53
  74. package/dist/bundle/{chunk-TN77LX6W.js → chunk-UG447QY2.js} +1 -1
  75. package/dist/bundle/{chunk-HC56J5LB.js → chunk-ULDXZ6LH.js} +66 -59
  76. package/dist/bundle/chunk-USQ23X5V.js +1227 -0
  77. package/dist/bundle/{chunk-UEZ6URJR.js → chunk-VJXHIUFP.js} +19 -19
  78. package/dist/bundle/{chunk-TWIC6JJG.js → chunk-VRH7VRTK.js} +7 -7
  79. package/dist/bundle/{chunk-NRRI37NJ.js → chunk-WOIHSQAL.js} +44 -0
  80. package/dist/bundle/{chunk-L62EJDNZ.js → chunk-X277FBTF.js} +3 -3
  81. package/dist/bundle/{chunk-XITUFTON.js → chunk-X3ZDN3U7.js} +1 -1
  82. package/dist/bundle/{chunk-GXDOTUUO.js → chunk-X4GWR6GO.js} +9 -9
  83. package/dist/bundle/chunk-XI3VIQKW.js +756 -0
  84. package/dist/bundle/{chunk-FBLUKCIR.js → chunk-XRFHQGOD.js} +1 -1
  85. package/dist/bundle/{chunk-HW5QTRFF.js → chunk-YD2RYVMK.js} +36 -36
  86. package/dist/bundle/{chunk-XJBYGMZ4.js → chunk-YPO2U2YB.js} +669 -458
  87. package/dist/bundle/{chunk-C6TEYKXV.js → chunk-ZBFL5JPT.js} +8 -7
  88. package/dist/bundle/{chunk-7AUP2WT3.js → chunk-ZBKWRYRS.js} +2 -2
  89. package/dist/bundle/{chunk-HSI7YOYK.js → chunk-ZVI6TFQR.js} +100 -43
  90. package/dist/bundle/{cli-P3BZUE6S.js → cli-KHMEUXNG.js} +123 -68
  91. package/dist/bundle/command-contract-4K6XXZYE.js +41 -0
  92. package/dist/bundle/config-EEDB632I.js +90 -0
  93. package/dist/bundle/{decode-QWOQXM7M.js → decode-7RP4HSVE.js} +4 -4
  94. package/dist/bundle/{dispatch-5MGDLOK4.js → dispatch-IZCAK47P.js} +1 -1
  95. package/dist/bundle/{dist-OUE4MF37.js → dist-BFT2SUBV.js} +87 -51
  96. package/dist/bundle/{echarts-65IMPY43.js → echarts-T2BSQ2YV.js} +2 -2
  97. package/dist/bundle/{embed-4IULBCKL.js → embed-BAS6YPDT.js} +5 -5
  98. package/dist/bundle/{embedder-JW4W6IZI.js → embedder-5XD5FCAO.js} +8 -8
  99. package/dist/bundle/{failure-CR64C4XA.js → failure-R2OIHCE5.js} +1 -1
  100. package/dist/bundle/{first-run-CH6C674R.js → first-run-23WWZ2PW.js} +8 -8
  101. package/dist/bundle/first-screen-6HFUYVFR.js +39 -0
  102. package/dist/bundle/{folders-VU4IN35Y.js → folders-ZXTOFY4T.js} +3 -3
  103. package/dist/bundle/{instructions-G5QIH2TM.js → instructions-XZPROPKY.js} +1 -1
  104. package/dist/bundle/{main-O4ZJIEWP.js → main-TZXKGL3L.js} +18 -18
  105. package/dist/bundle/{meetings-77CCAVYD.js → meetings-JB2ISPND.js} +6 -4
  106. package/dist/bundle/{node-E6VQHU4Y.js → node-A3B3MJWX.js} +2 -2
  107. package/dist/bundle/{node-sqlite-RJZ4PGLD.js → node-sqlite-QVWDLGDX.js} +5 -5
  108. package/dist/bundle/{oauth-F4JKNRW4.js → oauth-YA6IYV4O.js} +6 -6
  109. package/dist/bundle/{open-NYOGMIAA.js → open-SY7TXJBS.js} +4 -4
  110. package/dist/bundle/{openai-5U6EQTFQ.js → openai-2AU24NRN.js} +10 -10
  111. package/dist/bundle/{output-file-6COFGPUL.js → output-file-YGQYZCBJ.js} +4 -4
  112. package/dist/bundle/{process-OBWUKBMX.js → process-6HNBTJIY.js} +1 -1
  113. package/dist/bundle/{program-MU7DEJTO.js → program-77BUCJ4H.js} +132 -100
  114. package/dist/bundle/{prompt-2QWQTHWT.js → prompt-YDG73YDS.js} +6 -4
  115. package/dist/bundle/{recognize-SNUNTUC3.js → recognize-ECXDGTB7.js} +3 -3
  116. package/dist/bundle/{remote-2CTCIQGF.js → remote-K4JHGBVJ.js} +6 -6
  117. package/dist/bundle/{rerank-XDA7NJNH.js → rerank-IU2YYD4T.js} +6 -6
  118. package/dist/bundle/{run-log-NSG3DJVX.js → run-log-LFEXNZ74.js} +54 -54
  119. package/dist/bundle/{serve-TWQFHOV2.js → serve-3XWIF3HI.js} +8 -8
  120. package/dist/bundle/{server-RIQ6HMH2.js → server-56VYOHWP.js} +42 -42
  121. package/dist/bundle/server-YSTMUZ22.js +72 -0
  122. package/dist/bundle/{services-NKZQJQIV.js → services-X7IPEGQ5.js} +118 -36
  123. package/dist/bundle/{speech-ZOB76SXA.js → speech-E2OBQWYA.js} +12 -12
  124. package/dist/bundle/{state-7YYEIXQ5.js → state-4GMJYK4H.js} +5 -5
  125. package/dist/bundle/{store-OX4HRBLO.js → store-KPI7GB5Y.js} +49 -22
  126. package/dist/bundle/{store-E6RTSSNR.js → store-LA4TV4DM.js} +39 -16
  127. package/dist/bundle/store-connection-AZTIF6IH.js +83 -0
  128. package/dist/bundle/store-maintenance-command-LR572PS4.js +61 -0
  129. package/dist/bundle/{streaming-O53PIORL.js → streaming-EJ3NM2C2.js} +5 -5
  130. package/dist/bundle/{tokens-QKNEP2GJ.js → tokens-BE6CJMR5.js} +5 -5
  131. package/dist/bundle/zm.js +3 -3
  132. package/dist/bundle/{zoom-app-TSI2MGVK.js → zoom-app-QEJBTIJ4.js} +6 -6
  133. package/dist/contract-overrides.d.ts.map +1 -1
  134. package/dist/contract-overrides.js +0 -6
  135. package/dist/contract-overrides.js.map +1 -1
  136. package/dist/first-screen.d.ts.map +1 -1
  137. package/dist/first-screen.js +1 -0
  138. package/dist/first-screen.js.map +1 -1
  139. package/dist/ingestion-search-commands.d.ts.map +1 -1
  140. package/dist/ingestion-search-commands.js +0 -10
  141. package/dist/ingestion-search-commands.js.map +1 -1
  142. package/dist/meeting-integration-commands.d.ts.map +1 -1
  143. package/dist/meeting-integration-commands.js +8 -6
  144. package/dist/meeting-integration-commands.js.map +1 -1
  145. package/dist/meeting-integration.d.ts +3 -1
  146. package/dist/meeting-integration.d.ts.map +1 -1
  147. package/dist/permissions.js +1 -1
  148. package/dist/permissions.js.map +1 -1
  149. package/dist/setup-commands.d.ts.map +1 -1
  150. package/dist/setup-commands.js +11 -0
  151. package/dist/setup-commands.js.map +1 -1
  152. package/dist/store-connection.d.ts.map +1 -1
  153. package/dist/store-connection.js +4 -3
  154. package/dist/store-connection.js.map +1 -1
  155. package/dist/tokens.d.ts +2 -0
  156. package/dist/tokens.d.ts.map +1 -1
  157. package/dist/tokens.js +11 -0
  158. package/dist/tokens.js.map +1 -1
  159. package/dist/unified-search.d.ts +4 -4
  160. package/dist/unified-search.d.ts.map +1 -1
  161. package/dist/unified-search.js +1 -24
  162. package/dist/unified-search.js.map +1 -1
  163. package/dist/version.d.ts +1 -1
  164. package/dist/version.js +1 -1
  165. package/package.json +3 -3
  166. package/skills/zoom-cli/SKILL.md +2 -2
  167. package/dist/bundle/answer-policy-VBDYLUXI.js +0 -104
  168. package/dist/bundle/chunk-2SYWVIQJ.js +0 -33
  169. package/dist/bundle/chunk-6AMMTXEA.js +0 -12473
  170. package/dist/bundle/chunk-F5DYBWH7.js +0 -299
  171. package/dist/bundle/chunk-T5X4LGXE.js +0 -380
  172. package/dist/bundle/command-contract-TOLB32NJ.js +0 -41
  173. package/dist/bundle/config-4KLLIADY.js +0 -90
  174. package/dist/bundle/first-screen-OCAW5ZN6.js +0 -39
  175. package/dist/bundle/server-XO6XQQTJ.js +0 -72
  176. package/dist/bundle/store-connection-55QPNUDS.js +0 -83
  177. package/dist/bundle/store-maintenance-command-Q5MSU6OK.js +0 -62
@@ -1,299 +0,0 @@
1
- import { createRequire as __bundleRequire } from "node:module";
2
- const require = __bundleRequire(import.meta.url);
3
- import {
4
- CliError
5
- } from "./chunk-FEM2JQN2.js";
6
- import {
7
- singleLine
8
- } from "./chunk-OE7EIP5L.js";
9
- import {
10
- __name
11
- } from "./chunk-ZVVMGPBJ.js";
12
-
13
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/domain/money.js
14
- var CURRENCY_SCALES = {
15
- AED: 2,
16
- AMD: 2,
17
- AUD: 2,
18
- BHD: 3,
19
- BYN: 2,
20
- CAD: 2,
21
- CHF: 2,
22
- CLP: 0,
23
- CNY: 2,
24
- CZK: 2,
25
- DKK: 2,
26
- EUR: 2,
27
- GBP: 2,
28
- GEL: 2,
29
- HUF: 2,
30
- ILS: 2,
31
- INR: 2,
32
- ISK: 0,
33
- JPY: 0,
34
- KGS: 2,
35
- KRW: 0,
36
- KWD: 3,
37
- KZT: 2,
38
- NOK: 2,
39
- PLN: 2,
40
- RSD: 2,
41
- RUB: 2,
42
- SEK: 2,
43
- THB: 2,
44
- TRY: 2,
45
- UAH: 2,
46
- USD: 2,
47
- UZS: 2,
48
- VND: 0
49
- };
50
- var refuse = /* @__PURE__ */ __name((message, reason) => {
51
- throw new CliError("validation_error", message, { reason });
52
- }, "refuse");
53
- var DECIMAL = /^(\d{1,15})(?:\.(\d+))?$/;
54
- var parseDecimal = /* @__PURE__ */ __name((text, scale) => {
55
- const match = DECIMAL.exec(text.trim());
56
- if (!match || (match[2] ?? "").length > scale)
57
- return void 0;
58
- return BigInt(`${match[1]}${(match[2] ?? "").padEnd(scale, "0")}`);
59
- }, "parseDecimal");
60
- var formatDecimal = /* @__PURE__ */ __name((units, scale) => {
61
- const value = BigInt(units);
62
- if (value < 0n)
63
- return `-${formatDecimal(-value, scale)}`;
64
- const digits = value.toString().padStart(scale + 1, "0");
65
- return scale === 0 ? digits : `${digits.slice(0, -scale)}.${digits.slice(-scale)}`;
66
- }, "formatDecimal");
67
- var groupDigits = /* @__PURE__ */ __name((decimal) => {
68
- const [whole = "0", fraction] = decimal.split(".");
69
- const grouped = whole.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
70
- return fraction === void 0 ? grouped : `${grouped}.${fraction}`;
71
- }, "groupDigits");
72
- var currencyOf = /* @__PURE__ */ __name((text) => {
73
- const code = typeof text === "string" ? text.trim().toUpperCase() : "";
74
- if (CURRENCY_SCALES[code] === void 0)
75
- return refuse(`${typeof text === "string" && text.trim() ? text.trim() : "an empty currency"} is not a currency the store keeps; use one of ${Object.keys(CURRENCY_SCALES).join(", ")}`, "money.currency");
76
- return code;
77
- }, "currencyOf");
78
- var scaleOf = /* @__PURE__ */ __name((currency) => CURRENCY_SCALES[currencyOf(currency)], "scaleOf");
79
- var minorUnits = /* @__PURE__ */ __name((amount, currency, what = "an amount") => {
80
- const scale = scaleOf(currency);
81
- const units = typeof amount === "string" ? parseDecimal(amount, scale) : void 0;
82
- if (units === void 0 || units > BigInt(Number.MAX_SAFE_INTEGER))
83
- 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");
84
- return Number(units);
85
- }, "minorUnits");
86
- var signedMinorUnits = /* @__PURE__ */ __name((amount, currency, what = "an amount") => {
87
- if (typeof amount !== "string" || !amount.trim().startsWith("-"))
88
- return minorUnits(amount, currency, what);
89
- const units = minorUnits(amount.trim().slice(1), currency, what);
90
- return units === 0 ? 0 : -units;
91
- }, "signedMinorUnits");
92
- var moneyOf = /* @__PURE__ */ __name((units, currency) => ({
93
- amount: formatDecimal(units, scaleOf(currency)),
94
- currency
95
- }), "moneyOf");
96
- var moneyLabel = /* @__PURE__ */ __name((units, currency) => `${groupDigits(formatDecimal(units, scaleOf(currency)))} ${currency}`, "moneyLabel");
97
- var QUANTITY_SCALE = 3;
98
- var quantityOf = /* @__PURE__ */ __name((text) => {
99
- const thousandths = typeof text === "string" ? parseDecimal(text, QUANTITY_SCALE) : void 0;
100
- if (thousandths === void 0 || thousandths === 0n)
101
- return refuse('a quantity is a decimal string above 0 with at most 3 decimals, such as "1.5"', "money.quantity");
102
- const plain = formatDecimal(thousandths, QUANTITY_SCALE).replace(/\.?0+$/, "");
103
- return { text: plain, thousandths };
104
- }, "quantityOf");
105
- var lineUnits = /* @__PURE__ */ __name((thousandths, unitPrice) => Number((thousandths * BigInt(unitPrice) + 500n) / 1000n), "lineUnits");
106
-
107
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/domain/finance.js
108
- var INVOICE_DIRECTIONS = ["receivable", "payable"];
109
- var INVOICE_STATUSES = ["draft", "issued", "partly_paid", "paid", "void"];
110
- var MONEY_DIRECTIONS = ["in", "out"];
111
- var FINANCE_REVIEWS = ["proposed", "confirmed", "rejected"];
112
- var settledStatus = /* @__PURE__ */ __name((current, total, paid) => {
113
- if (current === "draft" || current === "void")
114
- return current;
115
- if (paid <= 0)
116
- return "issued";
117
- return paid < total ? "partly_paid" : "paid";
118
- }, "settledStatus");
119
- var dayMonth = /* @__PURE__ */ __name((date) => date === null ? null : `${date.slice(8, 10)}.${date.slice(5, 7)}`, "dayMonth");
120
- var notes = /* @__PURE__ */ __name((...words) => {
121
- const kept = words.filter((word) => word !== null);
122
- return kept.length === 0 ? "" : ` (${kept.join(", ")})`;
123
- }, "notes");
124
- var invoiceLine = /* @__PURE__ */ __name((invoice) => {
125
- const party = invoice.counterpartyName === null ? "" : `${invoice.direction === "receivable" ? " to" : " from"} ${invoice.counterpartyName}`;
126
- const due = invoice.dueDate === null ? "" : `, due ${dayMonth(invoice.dueDate)}`;
127
- return `${invoice.number ?? `#${invoice.id}`} \xB7 ${moneyLabel(invoice.total, invoice.currency)}${party}${due}` + notes(invoice.status.replace("_", " "), invoice.review === "confirmed" ? null : invoice.review);
128
- }, "invoiceLine");
129
- var paymentLine = /* @__PURE__ */ __name((payment) => {
130
- const party = payment.partyName === null ? "" : `${payment.direction === "in" ? " from" : " to"} ${payment.partyName}`;
131
- return `${moneyLabel(payment.amount, payment.currency)}${party}, ${dayMonth(payment.date)}` + notes(payment.review === "confirmed" ? null : payment.review);
132
- }, "paymentLine");
133
- var invoiceTitle = /* @__PURE__ */ __name((invoice) => `Invoice ${invoiceLine(invoice)}`, "invoiceTitle");
134
- var paymentEntryTitle = /* @__PURE__ */ __name((payment) => `Payment \xB7 ${paymentLine(payment)}`, "paymentEntryTitle");
135
-
136
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/domain/deals.js
137
- var DEAL_KINDS = ["deal", "lead"];
138
- var DEAL_STATUSES = ["open", "won", "lost"];
139
- var STAGE_OUTCOMES = DEAL_STATUSES;
140
- var DEAL_ROLES = ["owner", "contact", "decision-maker", "influencer"];
141
- var dealLine = /* @__PURE__ */ __name((deal) => {
142
- const money = deal.amount === null || deal.currency === null ? "" : `, ${moneyLabel(deal.amount, deal.currency)}`;
143
- return `${deal.title} \xB7 ${deal.stage}${money}${deal.status === "open" ? "" : ` (${deal.status})`}`;
144
- }, "dealLine");
145
-
146
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/domain/orders.js
147
- var ORDER_STATUSES = ["placed", "shipped", "delivered", "cancelled", "returned"];
148
- var ORDER_PURPOSES = ["personal", "business", "client", "other"];
149
- var orderLine = /* @__PURE__ */ __name((order) => {
150
- const money = order.total === null || order.currency === null ? "" : `, ${moneyLabel(order.total, order.currency)}`;
151
- const notes2 = [order.status, order.review === "confirmed" ? null : order.review].filter(Boolean).join(", ");
152
- return `${order.number ?? `#${order.id}`} \xB7 ${order.supplierName}${money} (${notes2})`;
153
- }, "orderLine");
154
- var orderTitle = /* @__PURE__ */ __name((order) => `Order ${orderLine(order)}`, "orderTitle");
155
-
156
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/domain/relations.js
157
- var ORGANIZATION_ROLES = [
158
- "employee",
159
- "contractor",
160
- "founder",
161
- "owner",
162
- "manager",
163
- "adviser",
164
- "contact"
165
- ];
166
- var PROJECT_ROLES = ["owner", "manager", "contributor", "client-contact", "approver"];
167
- var RELATIONS = {
168
- "member-of": {
169
- from: ["person", "organization", "project", "chat", "email_thread"],
170
- to: ["organization", "project"],
171
- roles: { to: { organization: ORGANIZATION_ROLES, project: PROJECT_ROLES } }
172
- },
173
- "reports-to": { from: ["person"], to: ["person"], inverse: "manages" },
174
- "customer-of": { from: ["person", "organization"], to: ["organization"], inverse: "supplier of" },
175
- "partner-of": { from: ["organization"], to: ["organization"], symmetric: true },
176
- "related-to": {
177
- from: ["person", "organization", "project", "task", "deal", "lead"],
178
- to: ["person", "organization", "project", "task"],
179
- roles: { from: { deal: DEAL_ROLES, lead: DEAL_ROLES } }
180
- }
181
- };
182
- var RELATION_KINDS = Object.keys(RELATIONS);
183
- var specOf = /* @__PURE__ */ __name((kind) => Object.hasOwn(RELATIONS, kind) ? RELATIONS[kind] : void 0, "specOf");
184
- var isRelationKind = /* @__PURE__ */ __name((kind) => specOf(kind) !== void 0, "isRelationKind");
185
- var memberOnly = /* @__PURE__ */ __name((type) => type === "chat" || type === "email_thread", "memberOnly");
186
- var checkEnds = /* @__PURE__ */ __name((kind, from, to) => {
187
- const spec = specOf(kind);
188
- if (!spec)
189
- throw new CliError("validation_error", `a relationship's kind is one of ${RELATION_KINDS.join(", ")}`);
190
- if (memberOnly(from) && (kind !== "member-of" || to !== "project"))
191
- throw new CliError("validation_error", `a ${from === "chat" ? "chat" : "mail thread"} is related only as member-of a project`);
192
- if (!spec.from.includes(from) || !spec.to.includes(to))
193
- throw new CliError("validation_error", `${kind} joins ${spec.from.join(", ")} to ${spec.to.join(", ")}, not ${from} to ${to}`);
194
- return spec;
195
- }, "checkEnds");
196
- var rolesOf = /* @__PURE__ */ __name((kind, from, to) => {
197
- const spec = specOf(kind);
198
- if (kind === "member-of" && from !== "person")
199
- return void 0;
200
- return spec?.roles?.from?.[from] ?? spec?.roles?.to?.[to];
201
- }, "rolesOf");
202
- var ROLE_LISTS = { organization: ORGANIZATION_ROLES, project: PROJECT_ROLES, deal: DEAL_ROLES };
203
- var roleListOf = /* @__PURE__ */ __name((kind, from, to) => {
204
- const roles = rolesOf(kind, from, to);
205
- return Object.keys(ROLE_LISTS).find((list) => ROLE_LISTS[list] === roles);
206
- }, "roleListOf");
207
- var checkRole = /* @__PURE__ */ __name((kind, from, to, role, extra = []) => {
208
- const roles = rolesOf(kind, from, to)?.concat(extra);
209
- if (roles && !roles.includes(role))
210
- throw new CliError("validation_error", `a ${from}'s role on ${kind} ${to} is one of ${roles.join(", ")}`, {
211
- reason: "relationship.role-unknown"
212
- });
213
- return role;
214
- }, "checkRole");
215
- var isSymmetric = /* @__PURE__ */ __name((kind) => specOf(kind)?.symmetric === true, "isSymmetric");
216
- var inverseOf = /* @__PURE__ */ __name((kind) => specOf(kind)?.symmetric ? kind : specOf(kind)?.inverse ?? null, "inverseOf");
217
- var STANDINGS = ["confirmed", "reported", "proposed", "ended"];
218
- var standingOf = /* @__PURE__ */ __name((link, now) => {
219
- if (link.endsAt != null && link.endsAt <= now)
220
- return "ended";
221
- if (link.confirmed)
222
- return "confirmed";
223
- if (link.deletedAt != null)
224
- return "ended";
225
- return link.accountId != null ? "reported" : "proposed";
226
- }, "standingOf");
227
- var isUsable = /* @__PURE__ */ __name((standing) => standing === "confirmed" || standing === "reported", "isUsable");
228
- var usableLink = /* @__PURE__ */ __name((link, now) => isUsable(standingOf(link, now)), "usableLink");
229
- 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");
230
- 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");
231
-
232
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/domain/tags.js
233
- var TAG_TYPES = ["chat", "contact", "message", "task"];
234
- var TAG = /^[a-z0-9-]{1,32}$/;
235
- var tagOf = /* @__PURE__ */ __name((value) => {
236
- const tag = value.trim().toLowerCase();
237
- return TAG.test(tag) ? tag : void 0;
238
- }, "tagOf");
239
- var normalizeTag = /* @__PURE__ */ __name((value) => {
240
- const tag = tagOf(value);
241
- if (tag === void 0)
242
- throw new CliError("validation_error", `"${singleLine(value)}" is not a tag \u2014 use 1\u201332 letters a\u2013z, digits and hyphens`, { reason: "tag.invalid" });
243
- return tag;
244
- }, "normalizeTag");
245
-
246
- export {
247
- CURRENCY_SCALES,
248
- parseDecimal,
249
- formatDecimal,
250
- currencyOf,
251
- scaleOf,
252
- minorUnits,
253
- signedMinorUnits,
254
- moneyOf,
255
- moneyLabel,
256
- quantityOf,
257
- lineUnits,
258
- INVOICE_DIRECTIONS,
259
- INVOICE_STATUSES,
260
- MONEY_DIRECTIONS,
261
- FINANCE_REVIEWS,
262
- settledStatus,
263
- dayMonth,
264
- notes,
265
- invoiceLine,
266
- paymentLine,
267
- invoiceTitle,
268
- paymentEntryTitle,
269
- DEAL_KINDS,
270
- DEAL_STATUSES,
271
- STAGE_OUTCOMES,
272
- DEAL_ROLES,
273
- dealLine,
274
- ORDER_STATUSES,
275
- ORDER_PURPOSES,
276
- orderLine,
277
- orderTitle,
278
- ORGANIZATION_ROLES,
279
- PROJECT_ROLES,
280
- RELATIONS,
281
- RELATION_KINDS,
282
- isRelationKind,
283
- checkEnds,
284
- rolesOf,
285
- ROLE_LISTS,
286
- roleListOf,
287
- checkRole,
288
- isSymmetric,
289
- inverseOf,
290
- STANDINGS,
291
- standingOf,
292
- isUsable,
293
- usableLink,
294
- notOverriddenSql,
295
- usableLinkSql,
296
- TAG_TYPES,
297
- tagOf,
298
- normalizeTag
299
- };
@@ -1,380 +0,0 @@
1
- import { createRequire as __bundleRequire } from "node:module";
2
- const require = __bundleRequire(import.meta.url);
3
- import {
4
- isCliFailure,
5
- isStoreDamage
6
- } from "./chunk-37B7A4RP.js";
7
- import {
8
- refuseOwnerStoreInTests
9
- } from "./chunk-CKK6JOC4.js";
10
- import {
11
- array,
12
- boolean,
13
- integer,
14
- isoTime,
15
- isoTimestamp,
16
- minLength,
17
- minValue,
18
- nullable,
19
- number,
20
- optional,
21
- picklist,
22
- pipe,
23
- record,
24
- reference,
25
- strictObject,
26
- string,
27
- unknown
28
- } from "./chunk-NRRI37NJ.js";
29
- import {
30
- CliError
31
- } from "./chunk-FEM2JQN2.js";
32
- import {
33
- __name
34
- } from "./chunk-ZVVMGPBJ.js";
35
-
36
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/tasks/model.js
37
- var TASK_KINDS = ["question", "request", "mention", "promise"];
38
- var TASK_STATES = ["open", "todo", "in_progress", "done", "dismissed"];
39
- var CLOSED_STATES = ["done", "dismissed"];
40
- var TASK_ORIGINS = ["rule", "agent", "owner"];
41
- var TASK_VERDICTS = ["useful", "not_useful"];
42
- var isClosedState = /* @__PURE__ */ __name((state) => CLOSED_STATES.includes(state), "isClosedState");
43
- function closeTask(task, state, by, at, reason) {
44
- if (isClosedState(task.state))
45
- throw new CliError("validation_error", `task ${task.id} is already ${task.state}`, { reason: "task.closed" });
46
- const { claimedBy: _by, claimedUntil: _until, ...unclaimed } = task;
47
- return { ...unclaimed, state, closedAt: at, closedBy: by, ...reason === void 0 ? {} : { reason } };
48
- }
49
- __name(closeTask, "closeTask");
50
-
51
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/tasks/priority.js
52
- var PRIORITY_LABELS = ["low", "medium", "high", "critical"];
53
- var MIDDLE = { low: 0.125, medium: 0.375, high: 0.625, critical: 0.875 };
54
- var LEGACY_PRIORITY_SCORES = [0.875, 0.625, 0.375, 0.1875, 0.0625];
55
- var priorityLabel = /* @__PURE__ */ __name((score) => score === null ? null : PRIORITY_LABELS[Math.min(3, Math.max(0, Math.floor(score * 4)))], "priorityLabel");
56
- var priorityBand = /* @__PURE__ */ __name((label) => {
57
- const at = PRIORITY_LABELS.indexOf(label);
58
- return { from: at / 4, to: (at + 1) / 4 };
59
- }, "priorityBand");
60
- var legacyPriority = /* @__PURE__ */ __name((score) => score === null ? null : score < 0.125 ? 4 : 3 - PRIORITY_LABELS.indexOf(priorityLabel(score)), "legacyPriority");
61
- var checkedScore = /* @__PURE__ */ __name((score) => {
62
- if (!Number.isFinite(score) || score < 0 || score > 1)
63
- throw new CliError("validation_error", "a priority score is 0 to 1");
64
- return score;
65
- }, "checkedScore");
66
- var priorityOf = /* @__PURE__ */ __name((value) => {
67
- const word = value.trim().toLowerCase();
68
- if (word === "none")
69
- return null;
70
- if (PRIORITY_LABELS.includes(word))
71
- return MIDDLE[word];
72
- if (/^[0-4]$/.test(word))
73
- return LEGACY_PRIORITY_SCORES[Number(word)];
74
- if (/^(0?\.\d+|[01]\.\d*)$/.test(word) && Number(word) <= 1)
75
- return Number(word);
76
- throw new CliError("validation_error", `a priority is ${PRIORITY_LABELS.join(", ")}, none, or a score from 0.0 to 1.0 with its decimal point; 0 (urgent) \u2026 4 (low) still work as critical, high, medium, low, low`);
77
- }, "priorityOf");
78
- var priorityOption = /* @__PURE__ */ __name((value) => priorityOf(value) ?? "none", "priorityOption");
79
-
80
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/tasks/service.js
81
- function createTaskService({ store, now = /* @__PURE__ */ __name(() => /* @__PURE__ */ new Date(), "now"), newId = /* @__PURE__ */ __name(() => crypto.randomUUID(), "newId") }) {
82
- async function find(id2) {
83
- const task = await store.get(id2);
84
- if (!task)
85
- throw new CliError("not_found", `no task ${id2}`);
86
- return task;
87
- }
88
- __name(find, "find");
89
- return {
90
- /**
91
- * A rule never makes a second task from a source it has seen, whatever that task's state, so a
92
- * dismissed one stays dismissed — nor from a message attached or merged into a task. A person or an agent may
93
- * add a task of another kind to it. A task a rule opens goes through the host's duplicate check.
94
- */
95
- async add(input) {
96
- const rule = input.origin === "rule";
97
- const existing = await store.findBySource(input.account, input.source, rule ? { linked: true } : void 0);
98
- const same = rule ? existing[0] : existing.find((task2) => task2.kind === input.kind);
99
- if (same)
100
- return { task: same, created: false };
101
- const task = { ...input, id: newId(), state: "open", createdAt: now() };
102
- await store.insert(task);
103
- if (!rule || !store.reviewDuplicates)
104
- return { task, created: true };
105
- return { task, created: true, review: await store.reviewDuplicates(task.id) };
106
- },
107
- async close(id2, { as, by, reason }) {
108
- const task = closeTask(await find(id2), as, by, now(), reason);
109
- await store.update(task);
110
- return task;
111
- },
112
- list: /* @__PURE__ */ __name((filter = {}) => store.list(filter), "list"),
113
- async stats(filter = {}) {
114
- const byGroup = /* @__PURE__ */ new Map();
115
- for (const task of await store.list(filter))
116
- byGroup.set(task.group, [...byGroup.get(task.group) ?? [], task]);
117
- return [...byGroup].map(([group, tasks]) => {
118
- const open = tasks.filter((task) => !isClosedState(task.state));
119
- const closeMs = tasks.flatMap((task) => task.closedAt ? [task.closedAt.getTime() - task.createdAt.getTime()] : []);
120
- const oldestOpenAt = open.map((task) => task.createdAt).sort((a, b) => a.getTime() - b.getTime())[0];
121
- return {
122
- group,
123
- open: open.length,
124
- ...oldestOpenAt ? { oldestOpenAt } : {},
125
- ...closeMs.length > 0 ? { medianCloseMs: median(closeMs) } : {}
126
- };
127
- });
128
- }
129
- };
130
- }
131
- __name(createTaskService, "createTaskService");
132
- function median(values) {
133
- const sorted = [...values].sort((a, b) => a - b);
134
- const middle = Math.floor(sorted.length / 2);
135
- const upper = sorted[middle] ?? 0;
136
- return sorted.length % 2 === 1 ? upper : ((sorted[middle - 1] ?? 0) + upper) / 2;
137
- }
138
- __name(median, "median");
139
-
140
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/tasks/store.js
141
- function matches(task, filter) {
142
- 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);
143
- }
144
- __name(matches, "matches");
145
-
146
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/domain/knowledge.js
147
- var FACT_STATUSES = ["proposed", "accepted", "superseded", "reversed", "rejected"];
148
- var MEMORY_KINDS = ["summary", "digest", "preference"];
149
- var MEMORY_STATUSES = ["proposed", "confirmed", "stale", "superseded"];
150
- var MEMORY_SCOPES = ["personal", "work"];
151
- var WORK_TASK_TYPES = ["bug", "feature", "chore"];
152
- var TASK_TYPES = [...WORK_TASK_TYPES, ...TASK_KINDS];
153
-
154
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/entities/fields.js
155
- var text = string();
156
- var id = pipe(string(), minLength(1));
157
- var time = isoTime;
158
- var zonedTime = pipe(string(), isoTimestamp("an ISO 8601 time with a zone"));
159
- var count = pipe(number(), integer(), minValue(0));
160
- var untrusted = optional(array(text));
161
- var providerMetadata = optional(record(string(), unknown()));
162
- var evidenceSource = strictObject({
163
- ref: nullable(reference),
164
- kind: text,
165
- title: nullable(text),
166
- sender: nullable(text),
167
- at: nullable(time),
168
- excerpt: nullable(text),
169
- tool: nullable(text),
170
- missing: boolean()
171
- });
172
- var author = strictObject({
173
- type: picklist(["person", "bot"]),
174
- id,
175
- name: nullable(text)
176
- });
177
-
178
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/entities/knowledge-lists.js
179
- var organization = strictObject({
180
- id,
181
- ref: reference,
182
- kind: picklist(["company", "team", "family", "community"]),
183
- name: text,
184
- scope: picklist(["personal", "work"]),
185
- created_at: time
186
- });
187
- var project = strictObject({
188
- id,
189
- ref: reference,
190
- key: text,
191
- name: text,
192
- kind: picklist(["project", "inbox"]),
193
- type: picklist(["work", "client", "personal", "oss", "other"]),
194
- organization_id: nullable(id),
195
- scope: picklist(["personal", "work"]),
196
- created_at: time
197
- });
198
- var reminder = strictObject({
199
- id,
200
- task: text,
201
- due_at: time,
202
- timezone: text,
203
- state: picklist(["pending", "leased", "delivered", "cancelled"]),
204
- revision: number(),
205
- receipt: nullable(text)
206
- });
207
-
208
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/store/marks.js
209
- import { readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
210
- var damageMarkPath = /* @__PURE__ */ __name((store) => `${store}.damaged.json`, "damageMarkPath");
211
- var healthMarkPath = /* @__PURE__ */ __name((store) => `${store}.health.json`, "healthMarkPath");
212
- var inodeOf = /* @__PURE__ */ __name((store) => statSync(store, { throwIfNoEntry: false })?.ino, "inodeOf");
213
- var readJson = /* @__PURE__ */ __name((path) => {
214
- try {
215
- return JSON.parse(readFileSync(path, "utf8"));
216
- } catch (error) {
217
- if (error.code === "ENOENT")
218
- return null;
219
- throw error;
220
- }
221
- }, "readJson");
222
- var ownerStoreInTests = /* @__PURE__ */ __name((store) => {
223
- try {
224
- refuseOwnerStoreInTests(store);
225
- return false;
226
- } catch {
227
- return true;
228
- }
229
- }, "ownerStoreInTests");
230
- var sqliteFailure = /* @__PURE__ */ __name((error) => isCliFailure(error) && error.details?.reason === "store.damaged" ? error.cause : error, "sqliteFailure");
231
- var markStoreDamaged = /* @__PURE__ */ __name((error, { store, command, version, runId, now = Date.now }) => {
232
- const failure = sqliteFailure(error);
233
- if (!isStoreDamage(failure) || ownerStoreInTests(store))
234
- return false;
235
- const inode = inodeOf(store);
236
- if (inode === void 0)
237
- return false;
238
- const mark = {
239
- at: new Date(now()).toISOString(),
240
- command,
241
- ...version ? { cli_version: version } : {},
242
- ...runId ? { run_id: runId } : {},
243
- error: failure.message.slice(0, 500),
244
- inode
245
- };
246
- try {
247
- writeFileSync(damageMarkPath(store), `${JSON.stringify(mark, null, 2)}
248
- `, { flag: "wx", mode: 384 });
249
- return true;
250
- } catch {
251
- return false;
252
- }
253
- }, "markStoreDamaged");
254
- var readDamageMark = /* @__PURE__ */ __name((store) => {
255
- const path = damageMarkPath(store);
256
- let mark;
257
- try {
258
- mark = readJson(path);
259
- } catch {
260
- return { at: "unknown", command: "unknown", error: `${path} cannot be read`, inode: inodeOf(store) ?? 0 };
261
- }
262
- if (mark === null)
263
- return null;
264
- if (mark.inode !== inodeOf(store)) {
265
- clearDamageMark(store);
266
- return null;
267
- }
268
- return mark;
269
- }, "readDamageMark");
270
- var clearDamageMark = /* @__PURE__ */ __name((store) => rmSync(damageMarkPath(store), { force: true }), "clearDamageMark");
271
- var refuseDamagedStore = /* @__PURE__ */ __name((store, cli) => {
272
- const mark = readDamageMark(store);
273
- if (!mark)
274
- return;
275
- 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" });
276
- }, "refuseDamagedStore");
277
- var readHealthMark = /* @__PURE__ */ __name((store) => {
278
- try {
279
- return readJson(healthMarkPath(store));
280
- } catch {
281
- return null;
282
- }
283
- }, "readHealthMark");
284
- var recordDeepCheck = /* @__PURE__ */ __name((store, health, { cli, version, schema, now = Date.now }) => {
285
- const previous = readHealthMark(store);
286
- if (ownerStoreInTests(store))
287
- return { previous, cleared: null };
288
- const checkedAt = new Date(now()).toISOString();
289
- const mark = {
290
- checked_at: checkedAt,
291
- ok: health.ok,
292
- problems: health.problems ?? 0,
293
- schema,
294
- cli,
295
- ...version ? { cli_version: version } : {},
296
- last_ok_at: health.ok ? checkedAt : previous?.last_ok_at ?? null
297
- };
298
- const cleared = health.ok ? readDamageMark(store) : null;
299
- try {
300
- writeFileSync(healthMarkPath(store), `${JSON.stringify(mark, null, 2)}
301
- `, { mode: 384 });
302
- } catch {
303
- }
304
- if (cleared)
305
- clearDamageMark(store);
306
- return { previous, cleared };
307
- }, "recordDeepCheck");
308
-
309
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/store/sqlite/link-kinds.js
310
- var LINK_KINDS = [
311
- "links-to",
312
- "blocked-by",
313
- "follow-up-of",
314
- "about",
315
- "member-of",
316
- "labelled",
317
- "answered-by",
318
- "evidence",
319
- "created-from",
320
- "duplicate-of",
321
- "related-to",
322
- "reports-to",
323
- "customer-of",
324
- "partner-of",
325
- "assigned-to",
326
- "attached"
327
- ];
328
- var LINK_ORIGINS = ["file", "owner", "suggested", "message"];
329
- var LINK_SOURCES = [...LINK_ORIGINS, "calendar"];
330
- var linkKind = /* @__PURE__ */ __name((kind) => `'${kind}'`, "linkKind");
331
- var COUNTERPART_ROLE = "counterpart";
332
-
333
- export {
334
- LINK_KINDS,
335
- LINK_ORIGINS,
336
- LINK_SOURCES,
337
- linkKind,
338
- COUNTERPART_ROLE,
339
- TASK_KINDS,
340
- TASK_STATES,
341
- CLOSED_STATES,
342
- TASK_ORIGINS,
343
- TASK_VERDICTS,
344
- isClosedState,
345
- PRIORITY_LABELS,
346
- priorityLabel,
347
- priorityBand,
348
- legacyPriority,
349
- checkedScore,
350
- priorityOf,
351
- priorityOption,
352
- createTaskService,
353
- matches,
354
- FACT_STATUSES,
355
- MEMORY_KINDS,
356
- MEMORY_STATUSES,
357
- MEMORY_SCOPES,
358
- WORK_TASK_TYPES,
359
- TASK_TYPES,
360
- text,
361
- id,
362
- time,
363
- zonedTime,
364
- count,
365
- untrusted,
366
- providerMetadata,
367
- evidenceSource,
368
- author,
369
- organization,
370
- project,
371
- reminder,
372
- damageMarkPath,
373
- healthMarkPath,
374
- markStoreDamaged,
375
- readDamageMark,
376
- clearDamageMark,
377
- refuseDamagedStore,
378
- readHealthMark,
379
- recordDeepCheck
380
- };