@wirecat/amo-cli 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/amo/oauth.d.ts.map +1 -1
  3. package/dist/amo/oauth.js +3 -4
  4. package/dist/amo/oauth.js.map +1 -1
  5. package/dist/amo/transport.d.ts.map +1 -1
  6. package/dist/amo/transport.js +3 -6
  7. package/dist/amo/transport.js.map +1 -1
  8. package/dist/bin/amo.js +2 -2
  9. package/dist/bundle/agent-VVACEKSX.js +42 -0
  10. package/dist/bundle/{all-profiles-PIWUQWBA.js → all-profiles-QNUKL4NA.js} +7 -7
  11. package/dist/bundle/amo.js +18 -18
  12. package/dist/bundle/{anthropic-47CMXBPQ.js → anthropic-PQN6MNP7.js} +2 -2
  13. package/dist/bundle/{app-server-QRBQODF2.js → app-server-Q2QEA7GP.js} +64 -63
  14. package/dist/bundle/{areas-QVHVU57Z.js → areas-27FRPBF3.js} +28 -20
  15. package/dist/bundle/{bun-OPDGMZZQ.js → bun-F4M4KCNA.js} +2 -2
  16. package/dist/bundle/{bun-sqlite-7I4X7CZW.js → bun-sqlite-P5IDBDVR.js} +3 -3
  17. package/dist/bundle/{chunk-RN6RT5CB.js → chunk-22KAQPX7.js} +3 -3
  18. package/dist/bundle/{chunk-43OW5NTG.js → chunk-2JGNMZ55.js} +4 -4
  19. package/dist/bundle/{chunk-TAVI73RW.js → chunk-2VDHC7QO.js} +2 -2
  20. package/dist/bundle/{chunk-3DEQUYEG.js → chunk-34ZOMVUK.js} +7 -7
  21. package/dist/bundle/{chunk-EHK73OSW.js → chunk-3J3EDSXF.js} +19 -97
  22. package/dist/bundle/{chunk-JLXXUEAM.js → chunk-3TYER5IK.js} +13 -5
  23. package/dist/bundle/{chunk-MDEPJZYJ.js → chunk-5NGLCDYQ.js} +2 -2
  24. package/dist/bundle/{chunk-63N46DJU.js → chunk-5SQTHOBI.js} +203 -168
  25. package/dist/bundle/{chunk-5UTB3ADZ.js → chunk-6GE36KUE.js} +10 -10
  26. package/dist/bundle/{chunk-DVZ75WZJ.js → chunk-6GZKY3HV.js} +10 -10
  27. package/dist/bundle/{chunk-CGW5R4UD.js → chunk-6OV2TRGF.js} +6 -6
  28. package/dist/bundle/{chunk-NSKMNIY6.js → chunk-7CPIZFOE.js} +6 -6
  29. package/dist/bundle/{chunk-BVVMIAQ6.js → chunk-A5K2NU3K.js} +394 -341
  30. package/dist/bundle/{chunk-6D4VWSJD.js → chunk-AEC4H5WZ.js} +5 -5
  31. package/dist/bundle/{chunk-4VN7RI4I.js → chunk-APBEDWOE.js} +4 -4
  32. package/dist/bundle/{chunk-VB7FZOYX.js → chunk-AQ5RIOUE.js} +1 -1
  33. package/dist/bundle/{chunk-FV4GQNIK.js → chunk-B7L5MSRP.js} +2 -2
  34. package/dist/bundle/{chunk-VZ5PPYDG.js → chunk-C7JPYWYQ.js} +1 -1
  35. package/dist/bundle/{chunk-H4AFNENN.js → chunk-DIZEHPS6.js} +30 -26
  36. package/dist/bundle/{chunk-43PMSR33.js → chunk-DUPCDJ3W.js} +7 -7
  37. package/dist/bundle/{chunk-ABX7BBS4.js → chunk-DWT24UVR.js} +1 -1
  38. package/dist/bundle/chunk-DXWJORSY.js +1703 -0
  39. package/dist/bundle/{chunk-G2TU5RYY.js → chunk-DY3PLWIH.js} +1 -1
  40. package/dist/bundle/{chunk-RIMPFMZE.js → chunk-DYWHAJRK.js} +23 -15
  41. package/dist/bundle/{chunk-R53XXHEI.js → chunk-EXRM3ML4.js} +2 -2
  42. package/dist/bundle/{chunk-JG6LCSEX.js → chunk-FFER7KJI.js} +12 -12
  43. package/dist/bundle/{chunk-6JTHXWPE.js → chunk-FIP2DG7W.js} +2 -2
  44. package/dist/bundle/{chunk-3HC5F3P7.js → chunk-FTH6WGYO.js} +1 -1
  45. package/dist/bundle/{chunk-3GX6KM2E.js → chunk-FWRLGIF6.js} +63 -61
  46. package/dist/bundle/{chunk-3PYE55JY.js → chunk-FYOPPKAN.js} +1 -1
  47. package/dist/bundle/{chunk-K7YY6SXR.js → chunk-G3N2RHGF.js} +12 -12
  48. package/dist/bundle/{chunk-NISH4UXM.js → chunk-G46PNDWL.js} +1 -1
  49. package/dist/bundle/{chunk-LKH3UKLO.js → chunk-G6NY7LFB.js} +3 -3
  50. package/dist/bundle/{chunk-M6VZXAJC.js → chunk-GOCMJBEE.js} +2 -2
  51. package/dist/bundle/{chunk-ADTI5RUO.js → chunk-GRGCZSES.js} +5 -5
  52. package/dist/bundle/{chunk-6WS6GJ4V.js → chunk-GVSKLZRD.js} +1 -1
  53. package/dist/bundle/{chunk-Q7ICVP25.js → chunk-GZ7WBU5Y.js} +1 -1
  54. package/dist/bundle/{chunk-FNV5HLHX.js → chunk-HN2LCLGT.js} +18 -18
  55. package/dist/bundle/{chunk-2JHVQMVC.js → chunk-HO4JGD4Q.js} +1 -1
  56. package/dist/bundle/{chunk-WOPVBRPV.js → chunk-HUAHLO6N.js} +1 -1
  57. package/dist/bundle/chunk-IDCZ4LWS.js +150 -0
  58. package/dist/bundle/{chunk-7IR2G5XY.js → chunk-IN3VL7UU.js} +15 -14
  59. package/dist/bundle/{chunk-NB7EOAUZ.js → chunk-ISQ23VKV.js} +1 -1
  60. package/dist/bundle/{chunk-633NQY2R.js → chunk-JVBCQHCS.js} +2 -2
  61. package/dist/bundle/{chunk-DQ6S5TFZ.js → chunk-K5W7YEHB.js} +61 -59
  62. package/dist/bundle/{chunk-LZPKBN3C.js → chunk-KAFSS35C.js} +1 -1
  63. package/dist/bundle/{chunk-IA7LLLEI.js → chunk-KLRCTMES.js} +2 -2
  64. package/dist/bundle/{chunk-GGMAIIVE.js → chunk-KYRYD4CR.js} +1 -1
  65. package/dist/bundle/{chunk-V2CNGXWX.js → chunk-LBZSURLL.js} +36 -36
  66. package/dist/bundle/{chunk-XEQQJBBO.js → chunk-LC7ZD2RW.js} +1 -1
  67. package/dist/bundle/{chunk-IB55P46L.js → chunk-LH6FJYMO.js} +4 -4
  68. package/dist/bundle/{chunk-HSPEU6S7.js → chunk-LJKINNWC.js} +6 -6
  69. package/dist/bundle/{chunk-GLYWZQY4.js → chunk-M36XP74N.js} +2 -2
  70. package/dist/bundle/chunk-MNPGZCKE.js +361 -0
  71. package/dist/bundle/{chunk-U5RJJ2EC.js → chunk-MRPMORLH.js} +7 -7
  72. package/dist/bundle/{chunk-57HFPNMF.js → chunk-NNREILWP.js} +6 -6
  73. package/dist/bundle/chunk-NSOY4FMN.js +159 -0
  74. package/dist/bundle/{chunk-2XBDILVW.js → chunk-OEEWVKJX.js} +1 -1
  75. package/dist/bundle/{chunk-6QGUK3H7.js → chunk-OGJFDKDL.js} +4 -4
  76. package/dist/bundle/{chunk-ZLUIRFJX.js → chunk-PATZAYFZ.js} +35 -362
  77. package/dist/bundle/{chunk-PPSAWFJD.js → chunk-PCR6GFNP.js} +39 -161
  78. package/dist/bundle/{chunk-XUT7DSM5.js → chunk-Q4MH2O5E.js} +2 -2
  79. package/dist/bundle/{chunk-AKRIUNYP.js → chunk-QQRJEWKB.js} +5 -5
  80. package/dist/bundle/{chunk-KZ2FIDI3.js → chunk-RNWUCAJJ.js} +2 -2
  81. package/dist/bundle/{chunk-BIKOE2IW.js → chunk-SDVUGWD7.js} +4 -4
  82. package/dist/bundle/{chunk-GDK7ETSB.js → chunk-SEFE6PGL.js} +10 -10
  83. package/dist/bundle/{chunk-WUFX4TKA.js → chunk-SWCJM3YD.js} +2 -2
  84. package/dist/bundle/{chunk-KEKXERBE.js → chunk-SYRDEMQE.js} +3664 -2704
  85. package/dist/bundle/{chunk-WXJYMMEL.js → chunk-SYYQZDHJ.js} +5 -5
  86. package/dist/bundle/{chunk-3YM4B2GT.js → chunk-T3W4V4A6.js} +1 -1
  87. package/dist/bundle/{chunk-4N7PP76S.js → chunk-TCT5D2X2.js} +1 -1
  88. package/dist/bundle/{chunk-YWDFYQOU.js → chunk-TES7MB6I.js} +1 -1
  89. package/dist/bundle/{chunk-S4ZHQMNM.js → chunk-U6XPWCWM.js} +3 -3
  90. package/dist/bundle/{chunk-W5JRXIG6.js → chunk-UFKC7TIX.js} +1213 -804
  91. package/dist/bundle/{chunk-XCCU2E3Z.js → chunk-UNWF3TH5.js} +3 -3
  92. package/dist/bundle/{chunk-UDSL3MUU.js → chunk-W3BOR6AT.js} +7 -7
  93. package/dist/bundle/{chunk-JXT6GY4V.js → chunk-X76RS6JO.js} +29 -9
  94. package/dist/bundle/{chunk-DSJ6EAOA.js → chunk-YF3S26TS.js} +51 -51
  95. package/dist/bundle/{chunk-TLG6ECZ2.js → chunk-ZCQ4H7CA.js} +1 -1
  96. package/dist/bundle/{chunk-D4NE7EON.js → chunk-ZOZV32IR.js} +2 -2
  97. package/dist/bundle/{chunk-7IWIFVXH.js → chunk-ZTKHXDEU.js} +3 -3
  98. package/dist/bundle/{cli-3NXOSENF.js → cli-EAD3WZLR.js} +81 -66
  99. package/dist/bundle/command-contract-SMEJ2ICG.js +40 -0
  100. package/dist/bundle/{command-server-entry-4ZQPNUL4.js → command-server-entry-YTZP6I4T.js} +25 -24
  101. package/dist/bundle/{decode-K7U7X5EL.js → decode-57BE5OBT.js} +2 -2
  102. package/dist/bundle/{echarts-O3TNDAXJ.js → echarts-QMAA7HH5.js} +2 -2
  103. package/dist/bundle/{embed-SWLVG73O.js → embed-NFGFYUO4.js} +3 -3
  104. package/dist/bundle/{embedder-EJN75BPV.js → embedder-SRBOJMXX.js} +6 -6
  105. package/dist/bundle/{first-run-WPGUUC4Z.js → first-run-HWRUL2GR.js} +6 -6
  106. package/dist/bundle/first-screen-ATN4D3FQ.js +41 -0
  107. package/dist/bundle/{instructions-AMH5RWVJ.js → instructions-4H7UREH2.js} +1 -1
  108. package/dist/bundle/meeting-combined-BGDEHCWY.js +26 -0
  109. package/dist/bundle/{meeting-model-YXXNETKC.js → meeting-model-WWGVRXPL.js} +8 -8
  110. package/dist/bundle/{meeting-semantic-U7EUB3ET.js → meeting-semantic-ZQ47BL2Z.js} +2 -2
  111. package/dist/bundle/{node-EGMCBAO7.js → node-P3PUHKYH.js} +2 -2
  112. package/dist/bundle/{node-sqlite-YVOGMDSP.js → node-sqlite-JOTSNH3P.js} +4 -4
  113. package/dist/bundle/{oauth-2SNRBIJM.js → oauth-XPSAL6VO.js} +4 -4
  114. package/dist/bundle/{open-ABCPY5IH.js → open-PO52FVA5.js} +2 -2
  115. package/dist/bundle/{openai-4D6PXJR7.js → openai-WITYLMY5.js} +12 -12
  116. package/dist/bundle/{process-SGHEN6MQ.js → process-AFIXYXWL.js} +1 -1
  117. package/dist/bundle/{program-CBDQBZZ3.js → program-JODTZNBZ.js} +107 -158
  118. package/dist/bundle/{prompt-2QUK5QST.js → prompt-XORLAXHY.js} +2 -2
  119. package/dist/bundle/{recognize-QMQSJRIH.js → recognize-JKMZHDYS.js} +1 -1
  120. package/dist/bundle/{remote-U7TC2BLZ.js → remote-3IMEJTEH.js} +6 -6
  121. package/dist/bundle/{rerank-5UPVXGVV.js → rerank-3F2E6NNN.js} +4 -4
  122. package/dist/bundle/{serve-VX6GUM6J.js → serve-6BWU3NMB.js} +6 -6
  123. package/dist/bundle/{server-FOPC6DJ3.js → server-GPSB5WFG.js} +56 -55
  124. package/dist/bundle/server-HMCC64ZU.js +88 -0
  125. package/dist/bundle/source-E72OS27D.js +47 -0
  126. package/dist/bundle/{sqlite-runtime-77NKDEXN.js → sqlite-runtime-YHYQDUXE.js} +3 -3
  127. package/dist/bundle/{state-X2HU6GB2.js → state-R7W4U6T4.js} +3 -3
  128. package/dist/bundle/{store-3CHPHFP7.js → store-HTVRL7FB.js} +51 -40
  129. package/dist/bundle/store-IWW6U6QN.js +34 -0
  130. package/dist/bundle/{store-2U4U6KL4.js → store-TBZ3ZS6H.js} +21 -19
  131. package/dist/bundle/store-maintenance-command-CJM2VLMW.js +75 -0
  132. package/dist/bundle/surface-5GBWNYBE.js +74 -0
  133. package/dist/bundle/writer-TW2Q55VJ.js +49 -0
  134. package/dist/commands/session.d.ts.map +1 -1
  135. package/dist/commands/session.js +1 -6
  136. package/dist/commands/session.js.map +1 -1
  137. package/dist/version.d.ts +1 -1
  138. package/dist/version.js +1 -1
  139. package/package.json +2 -2
  140. package/dist/bundle/agent-EFMUK732.js +0 -41
  141. package/dist/bundle/chunk-IG2TJQJ7.js +0 -79
  142. package/dist/bundle/chunk-KZN2BG3P.js +0 -721
  143. package/dist/bundle/chunk-RRTMPSQR.js +0 -29
  144. package/dist/bundle/command-contract-LNSAV5LA.js +0 -39
  145. package/dist/bundle/first-screen-JMNEUQ46.js +0 -40
  146. package/dist/bundle/meeting-combined-5TKG2RYD.js +0 -24
  147. package/dist/bundle/server-OIVNOMVK.js +0 -87
  148. package/dist/bundle/source-HWS5SJIV.js +0 -46
  149. package/dist/bundle/store-Z3747L5F.js +0 -34
  150. package/dist/bundle/store-maintenance-command-UOSZJTVP.js +0 -74
  151. package/dist/bundle/surface-MUT72QON.js +0 -73
  152. package/dist/bundle/writer-RBKQ64ZM.js +0 -48
@@ -0,0 +1,361 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ CliError
5
+ } from "./chunk-S6JG4YUH.js";
6
+ import {
7
+ __name
8
+ } from "./chunk-ZVVMGPBJ.js";
9
+
10
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/domain/money.js
11
+ var CURRENCY_SCALES = {
12
+ AED: 2,
13
+ AMD: 2,
14
+ AUD: 2,
15
+ BHD: 3,
16
+ BYN: 2,
17
+ CAD: 2,
18
+ CHF: 2,
19
+ CLP: 0,
20
+ CNY: 2,
21
+ CZK: 2,
22
+ DKK: 2,
23
+ EUR: 2,
24
+ GBP: 2,
25
+ GEL: 2,
26
+ HUF: 2,
27
+ ILS: 2,
28
+ INR: 2,
29
+ ISK: 0,
30
+ JPY: 0,
31
+ KGS: 2,
32
+ KRW: 0,
33
+ KWD: 3,
34
+ KZT: 2,
35
+ NOK: 2,
36
+ PLN: 2,
37
+ RSD: 2,
38
+ RUB: 2,
39
+ SEK: 2,
40
+ THB: 2,
41
+ TRY: 2,
42
+ UAH: 2,
43
+ USD: 2,
44
+ UZS: 2,
45
+ VND: 0
46
+ };
47
+ var refuse = /* @__PURE__ */ __name((message, reason) => {
48
+ throw new CliError("validation_error", message, { reason });
49
+ }, "refuse");
50
+ var DECIMAL = /^(\d{1,15})(?:\.(\d+))?$/;
51
+ var parseDecimal = /* @__PURE__ */ __name((text, scale) => {
52
+ const match = DECIMAL.exec(text.trim());
53
+ if (!match || (match[2] ?? "").length > scale)
54
+ return void 0;
55
+ return BigInt(`${match[1]}${(match[2] ?? "").padEnd(scale, "0")}`);
56
+ }, "parseDecimal");
57
+ var formatDecimal = /* @__PURE__ */ __name((units, scale) => {
58
+ const value = BigInt(units);
59
+ if (value < 0n)
60
+ return `-${formatDecimal(-value, scale)}`;
61
+ const digits = value.toString().padStart(scale + 1, "0");
62
+ return scale === 0 ? digits : `${digits.slice(0, -scale)}.${digits.slice(-scale)}`;
63
+ }, "formatDecimal");
64
+ var groupDigits = /* @__PURE__ */ __name((decimal) => {
65
+ const [whole = "0", fraction] = decimal.split(".");
66
+ const grouped = whole.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
67
+ return fraction === void 0 ? grouped : `${grouped}.${fraction}`;
68
+ }, "groupDigits");
69
+ var currencyOf = /* @__PURE__ */ __name((text) => {
70
+ const code = typeof text === "string" ? text.trim().toUpperCase() : "";
71
+ if (CURRENCY_SCALES[code] === void 0)
72
+ 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");
73
+ return code;
74
+ }, "currencyOf");
75
+ var scaleOf = /* @__PURE__ */ __name((currency) => CURRENCY_SCALES[currencyOf(currency)], "scaleOf");
76
+ var minorUnits = /* @__PURE__ */ __name((amount, currency, what = "an amount") => {
77
+ const scale = scaleOf(currency);
78
+ const units = typeof amount === "string" ? parseDecimal(amount, scale) : void 0;
79
+ if (units === void 0 || units > BigInt(Number.MAX_SAFE_INTEGER))
80
+ 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");
81
+ return Number(units);
82
+ }, "minorUnits");
83
+ var signedMinorUnits = /* @__PURE__ */ __name((amount, currency, what = "an amount") => {
84
+ if (typeof amount !== "string" || !amount.trim().startsWith("-"))
85
+ return minorUnits(amount, currency, what);
86
+ const units = minorUnits(amount.trim().slice(1), currency, what);
87
+ return units === 0 ? 0 : -units;
88
+ }, "signedMinorUnits");
89
+ var moneyOf = /* @__PURE__ */ __name((units, currency) => ({
90
+ amount: formatDecimal(units, scaleOf(currency)),
91
+ currency
92
+ }), "moneyOf");
93
+ var moneyLabel = /* @__PURE__ */ __name((units, currency) => `${groupDigits(formatDecimal(units, scaleOf(currency)))} ${currency}`, "moneyLabel");
94
+ var QUANTITY_SCALE = 3;
95
+ var quantityOf = /* @__PURE__ */ __name((text) => {
96
+ const thousandths = typeof text === "string" ? parseDecimal(text, QUANTITY_SCALE) : void 0;
97
+ if (thousandths === void 0 || thousandths === 0n)
98
+ return refuse('a quantity is a decimal string above 0 with at most 3 decimals, such as "1.5"', "money.quantity");
99
+ const plain = formatDecimal(thousandths, QUANTITY_SCALE).replace(/\.?0+$/, "");
100
+ return { text: plain, thousandths };
101
+ }, "quantityOf");
102
+ var lineUnits = /* @__PURE__ */ __name((thousandths, unitPrice) => Number((thousandths * BigInt(unitPrice) + 500n) / 1000n), "lineUnits");
103
+
104
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/domain/finance.js
105
+ var INVOICE_DIRECTIONS = ["receivable", "payable"];
106
+ var INVOICE_STATUSES = ["draft", "issued", "partly_paid", "paid", "void"];
107
+ var MONEY_DIRECTIONS = ["in", "out"];
108
+ var FINANCE_REVIEWS = ["proposed", "confirmed", "rejected"];
109
+ var settledStatus = /* @__PURE__ */ __name((current, total, paid) => {
110
+ if (current === "draft" || current === "void")
111
+ return current;
112
+ if (paid <= 0)
113
+ return "issued";
114
+ return paid < total ? "partly_paid" : "paid";
115
+ }, "settledStatus");
116
+ var dayMonth = /* @__PURE__ */ __name((date) => date === null ? null : `${date.slice(8, 10)}.${date.slice(5, 7)}`, "dayMonth");
117
+ var notes = /* @__PURE__ */ __name((...words) => {
118
+ const kept = words.filter((word) => word !== null);
119
+ return kept.length === 0 ? "" : ` (${kept.join(", ")})`;
120
+ }, "notes");
121
+ var invoiceLine = /* @__PURE__ */ __name((invoice) => {
122
+ const party = invoice.counterpartyName === null ? "" : `${invoice.direction === "receivable" ? " to" : " from"} ${invoice.counterpartyName}`;
123
+ const due = invoice.dueDate === null ? "" : `, due ${dayMonth(invoice.dueDate)}`;
124
+ return `${invoice.number ?? `#${invoice.id}`} \xB7 ${moneyLabel(invoice.total, invoice.currency)}${party}${due}` + notes(invoice.status.replace("_", " "), invoice.review === "confirmed" ? null : invoice.review);
125
+ }, "invoiceLine");
126
+ var paymentLine = /* @__PURE__ */ __name((payment) => {
127
+ const party = payment.partyName === null ? "" : `${payment.direction === "in" ? " from" : " to"} ${payment.partyName}`;
128
+ return `${moneyLabel(payment.amount, payment.currency)}${party}, ${dayMonth(payment.date)}` + notes(payment.review === "confirmed" ? null : payment.review);
129
+ }, "paymentLine");
130
+ var invoiceTitle = /* @__PURE__ */ __name((invoice) => `Invoice ${invoiceLine(invoice)}`, "invoiceTitle");
131
+ var paymentEntryTitle = /* @__PURE__ */ __name((payment) => `Payment \xB7 ${paymentLine(payment)}`, "paymentEntryTitle");
132
+
133
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/domain/business.js
134
+ var CATALOG_KINDS = ["product", "service"];
135
+ var BUSINESS_KINDS = ["invoice", "payment", "order", "contract", "subscription", "product", "wallet"];
136
+ var CONTRACT_KINDS = ["sale", "purchase", "service", "lease", "employment", "nda", "license", "other"];
137
+ var CONTRACT_STATUSES = ["draft", "active", "ended", "terminated"];
138
+ var SUBSCRIPTION_STATUSES = ["trial", "active", "paused", "cancelled", "ended"];
139
+ var WALLET_KINDS = ["bank", "card", "cash", "wallet", "other"];
140
+ var TRANSACTION_STATUSES = ["pending", "booked"];
141
+ var ORDER_DIRECTIONS = ["purchase", "sale"];
142
+ var intervalOf = /* @__PURE__ */ __name((text, reason = "subscription.interval") => {
143
+ const match = typeof text === "string" ? /^(?:([1-9]\d{0,2})-)?(day|week|month|year)$/.exec(text.trim()) : null;
144
+ if (!match)
145
+ throw new CliError("validation_error", "an interval is a count and a unit, such as 1-month or 2-week", { reason });
146
+ return { count: match[1] === void 0 ? 1 : Number(match[1]), unit: match[2] };
147
+ }, "intervalOf");
148
+ var intervalText = /* @__PURE__ */ __name(({ count, unit }) => `${count}-${unit}`, "intervalText");
149
+ var priced = /* @__PURE__ */ __name((units, currency) => units === null || currency === null ? "" : `, ${moneyLabel(units, currency)}`, "priced");
150
+ var pending = /* @__PURE__ */ __name((review) => review === "confirmed" ? null : review, "pending");
151
+ var productLine = /* @__PURE__ */ __name((product) => {
152
+ const price = product.unitPrice === null || product.currency === null ? "" : moneyLabel(product.unitPrice, product.currency);
153
+ const per = price && product.unit !== null ? ` per ${product.unit}` : "";
154
+ return `${product.name}${price ? ` \xB7 ${price}${per}` : ""}${notes(product.kind, product.archived ? "archived" : null)}`;
155
+ }, "productLine");
156
+ var contractLine = /* @__PURE__ */ __name((contract) => `${contract.number ?? `#${contract.id}`} \xB7 ${contract.name}${priced(contract.value, contract.currency)}` + notes(contract.status, pending(contract.review)), "contractLine");
157
+ var subscriptionLine = /* @__PURE__ */ __name((subscription) => `${subscription.name}${priced(subscription.price, subscription.currency)} every ${intervalText(subscription.interval)}` + notes(subscription.status, pending(subscription.review)), "subscriptionLine");
158
+ var walletLine = /* @__PURE__ */ __name((wallet) => `${wallet.name} \xB7 ${wallet.kind}, ${wallet.currency}${wallet.numberHint === null ? "" : `, \u2026${wallet.numberHint}`}` + notes(wallet.closed ? "closed" : null), "walletLine");
159
+ 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");
160
+
161
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/domain/crm.js
162
+ var CRM_KINDS = ["organization", "person", "deal", "lead"];
163
+ var CRM_ACTIVITY_KINDS = ["call", "email", "meeting", "todo", "task", "comment", "other"];
164
+ var isCrmUserId = /* @__PURE__ */ __name((id) => /^\d{1,20}$/.test(id), "isCrmUserId");
165
+ var normalCrmUserId = /* @__PURE__ */ __name((id) => {
166
+ const text = id.trim();
167
+ return /^\d+$/.test(text) ? text.replace(/^0+(?=\d)/, "") : text;
168
+ }, "normalCrmUserId");
169
+ var isItemKind = /* @__PURE__ */ __name((kind) => kind === "deal" || kind === "lead", "isItemKind");
170
+
171
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/domain/deals.js
172
+ var DEAL_KINDS = ["deal", "lead"];
173
+ var DEAL_STATUSES = ["open", "won", "lost"];
174
+ var STAGE_OUTCOMES = DEAL_STATUSES;
175
+ var DEAL_ROLES = ["owner", "contact", "decision-maker", "influencer"];
176
+ var dealLine = /* @__PURE__ */ __name((deal) => {
177
+ const money = deal.amount === null || deal.currency === null ? "" : `, ${moneyLabel(deal.amount, deal.currency)}`;
178
+ return `${deal.title} \xB7 ${deal.stage}${money}${deal.status === "open" ? "" : ` (${deal.status})`}`;
179
+ }, "dealLine");
180
+
181
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/domain/orders.js
182
+ var ORDER_STATUSES = ["placed", "shipped", "delivered", "cancelled", "returned"];
183
+ var ORDER_PURPOSES = ["personal", "business", "client", "other"];
184
+ var orderLine = /* @__PURE__ */ __name((order) => {
185
+ const party = order.direction === "sale" && order.customerName !== null ? `to ${order.customerName}` : order.supplierName;
186
+ const money = order.total === null || order.currency === null ? "" : `, ${moneyLabel(order.total, order.currency)}`;
187
+ const notes2 = [order.status, order.review === "confirmed" ? null : order.review].filter(Boolean).join(", ");
188
+ return `${order.number ?? `#${order.id}`} \xB7 ${party}${money} (${notes2})`;
189
+ }, "orderLine");
190
+ var orderTitle = /* @__PURE__ */ __name((order) => `Order ${orderLine(order)}`, "orderTitle");
191
+
192
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/domain/relations.js
193
+ var ORGANIZATION_ROLES = [
194
+ "employee",
195
+ "contractor",
196
+ "founder",
197
+ "owner",
198
+ "manager",
199
+ "adviser",
200
+ "contact"
201
+ ];
202
+ var PROJECT_ROLES = ["owner", "manager", "contributor", "client-contact", "approver"];
203
+ var CONTRACT_ROLES = ["customer", "supplier", "signatory", "guarantor"];
204
+ var RELATED_ROLES = ["colleague", "adviser", "investor", "mentor", "family", "friend"];
205
+ var ENGAGEMENT_LEVELS = ["none", "low", "medium", "high"];
206
+ var isEngagement = /* @__PURE__ */ __name((value) => typeof value === "string" && ENGAGEMENT_LEVELS.includes(value), "isEngagement");
207
+ var checkEngagement = /* @__PURE__ */ __name((kind, from, to, level) => {
208
+ if (kind !== "member-of" || from !== "person" || to !== "project")
209
+ throw new CliError("validation_error", "an engagement level is set only on a person's member-of a project", {
210
+ reason: "relationship.engagement-ends"
211
+ });
212
+ if (!isEngagement(level))
213
+ throw new CliError("validation_error", `an engagement level is one of ${ENGAGEMENT_LEVELS.join(", ")}`, {
214
+ reason: "relationship.engagement-unknown"
215
+ });
216
+ return level;
217
+ }, "checkEngagement");
218
+ var RELATIONS = {
219
+ "member-of": {
220
+ from: ["person", "organization", "project", "chat", "email_thread"],
221
+ to: ["organization", "project"],
222
+ roles: { to: { organization: ORGANIZATION_ROLES, project: PROJECT_ROLES } }
223
+ },
224
+ "reports-to": { from: ["person"], to: ["person"], inverse: "manages" },
225
+ "customer-of": { from: ["person", "organization"], to: ["organization"], inverse: "supplier of" },
226
+ "partner-of": { from: ["organization"], to: ["organization"], symmetric: true },
227
+ "related-to": {
228
+ from: ["person", "organization", "project", "task", "deal", "lead", "contract"],
229
+ to: ["person", "organization", "project", "task"],
230
+ roles: { from: { deal: DEAL_ROLES, lead: DEAL_ROLES, contract: CONTRACT_ROLES } }
231
+ }
232
+ };
233
+ var RELATION_KINDS = Object.keys(RELATIONS);
234
+ var specOf = /* @__PURE__ */ __name((kind) => Object.hasOwn(RELATIONS, kind) ? RELATIONS[kind] : void 0, "specOf");
235
+ var isRelationKind = /* @__PURE__ */ __name((kind) => specOf(kind) !== void 0, "isRelationKind");
236
+ var memberOnly = /* @__PURE__ */ __name((type) => type === "chat" || type === "email_thread", "memberOnly");
237
+ var partyOnly = /* @__PURE__ */ __name((from, to) => from === "contract" && to !== "person" && to !== "organization", "partyOnly");
238
+ var checkEnds = /* @__PURE__ */ __name((kind, from, to) => {
239
+ const spec = specOf(kind);
240
+ if (!spec)
241
+ throw new CliError("validation_error", `a relationship's kind is one of ${RELATION_KINDS.join(", ")}`);
242
+ if (memberOnly(from) && (kind !== "member-of" || to !== "project"))
243
+ throw new CliError("validation_error", `a ${from === "chat" ? "chat" : "mail thread"} is related only as member-of a project`);
244
+ if (partyOnly(from, to))
245
+ throw new CliError("validation_error", "a contract is related only to a person or an organization");
246
+ if (!spec.from.includes(from) || !spec.to.includes(to))
247
+ throw new CliError("validation_error", `${kind} joins ${spec.from.join(", ")} to ${spec.to.join(", ")}, not ${from} to ${to}`);
248
+ return spec;
249
+ }, "checkEnds");
250
+ var isParty = /* @__PURE__ */ __name((type) => type === "person" || type === "organization", "isParty");
251
+ var rolesOf = /* @__PURE__ */ __name((kind, from, to) => {
252
+ const spec = specOf(kind);
253
+ if (kind === "member-of" && from !== "person")
254
+ return void 0;
255
+ return spec?.roles?.from?.[from] ?? spec?.roles?.to?.[to];
256
+ }, "rolesOf");
257
+ var ROLE_LISTS = {
258
+ organization: ORGANIZATION_ROLES,
259
+ project: PROJECT_ROLES,
260
+ deal: DEAL_ROLES,
261
+ contract: CONTRACT_ROLES,
262
+ related: RELATED_ROLES
263
+ };
264
+ var roleListOf = /* @__PURE__ */ __name((kind, from, to) => {
265
+ if (kind === "related-to" && isParty(from) && isParty(to))
266
+ return "related";
267
+ const roles = rolesOf(kind, from, to);
268
+ return Object.keys(ROLE_LISTS).find((list) => ROLE_LISTS[list] === roles);
269
+ }, "roleListOf");
270
+ var checkRole = /* @__PURE__ */ __name((kind, from, to, role, extra = []) => {
271
+ const roles = rolesOf(kind, from, to)?.concat(extra);
272
+ if (roles && !roles.includes(role))
273
+ throw new CliError("validation_error", `a ${from}'s role on ${kind} ${to} is one of ${roles.join(", ")}`, {
274
+ reason: "relationship.role-unknown"
275
+ });
276
+ return role;
277
+ }, "checkRole");
278
+ var isSymmetric = /* @__PURE__ */ __name((kind) => specOf(kind)?.symmetric === true, "isSymmetric");
279
+ var inverseOf = /* @__PURE__ */ __name((kind) => specOf(kind)?.symmetric ? kind : specOf(kind)?.inverse ?? null, "inverseOf");
280
+ var STANDINGS = ["confirmed", "reported", "proposed", "ended"];
281
+ var standingOf = /* @__PURE__ */ __name((link, now) => {
282
+ if (link.endsAt != null && link.endsAt <= now)
283
+ return "ended";
284
+ if (link.confirmed)
285
+ return "confirmed";
286
+ if (link.deletedAt != null)
287
+ return "ended";
288
+ return link.accountId != null ? "reported" : "proposed";
289
+ }, "standingOf");
290
+ var isUsable = /* @__PURE__ */ __name((standing) => standing === "confirmed" || standing === "reported", "isUsable");
291
+ var KEYED = "kind IN ('member-of', 'related-to', 'reports-to', 'customer-of', 'partner-of') AND to_id IS NOT NULL";
292
+ 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");
293
+ 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");
294
+
295
+ export {
296
+ parseDecimal,
297
+ formatDecimal,
298
+ groupDigits,
299
+ currencyOf,
300
+ scaleOf,
301
+ minorUnits,
302
+ signedMinorUnits,
303
+ moneyOf,
304
+ moneyLabel,
305
+ quantityOf,
306
+ lineUnits,
307
+ INVOICE_DIRECTIONS,
308
+ INVOICE_STATUSES,
309
+ MONEY_DIRECTIONS,
310
+ FINANCE_REVIEWS,
311
+ settledStatus,
312
+ invoiceLine,
313
+ paymentLine,
314
+ invoiceTitle,
315
+ paymentEntryTitle,
316
+ CATALOG_KINDS,
317
+ BUSINESS_KINDS,
318
+ CONTRACT_KINDS,
319
+ CONTRACT_STATUSES,
320
+ SUBSCRIPTION_STATUSES,
321
+ WALLET_KINDS,
322
+ TRANSACTION_STATUSES,
323
+ ORDER_DIRECTIONS,
324
+ intervalOf,
325
+ productLine,
326
+ contractLine,
327
+ subscriptionLine,
328
+ walletLine,
329
+ transactionLine,
330
+ CRM_KINDS,
331
+ CRM_ACTIVITY_KINDS,
332
+ isCrmUserId,
333
+ normalCrmUserId,
334
+ isItemKind,
335
+ DEAL_KINDS,
336
+ DEAL_STATUSES,
337
+ STAGE_OUTCOMES,
338
+ DEAL_ROLES,
339
+ dealLine,
340
+ ORDER_STATUSES,
341
+ ORDER_PURPOSES,
342
+ orderLine,
343
+ orderTitle,
344
+ isEngagement,
345
+ checkEngagement,
346
+ RELATION_KINDS,
347
+ isRelationKind,
348
+ checkEnds,
349
+ rolesOf,
350
+ ROLE_LISTS,
351
+ roleListOf,
352
+ checkRole,
353
+ isSymmetric,
354
+ inverseOf,
355
+ STANDINGS,
356
+ standingOf,
357
+ isUsable,
358
+ KEYED,
359
+ notOverriddenSql,
360
+ usableLinkSql
361
+ };
@@ -2,11 +2,11 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  AUDIT_MIN_SCORE
5
- } from "./chunk-BVVMIAQ6.js";
5
+ } from "./chunk-A5K2NU3K.js";
6
6
  import {
7
7
  LIST_QUERY_GUIDE,
8
8
  nativeTerms
9
- } from "./chunk-K7YY6SXR.js";
9
+ } from "./chunk-G3N2RHGF.js";
10
10
  import {
11
11
  DEFAULT_CONFIG,
12
12
  environmentOf,
@@ -16,13 +16,13 @@ import {
16
16
  renderAnswer,
17
17
  snakeKeys,
18
18
  withAgentLevels
19
- } from "./chunk-63N46DJU.js";
19
+ } from "./chunk-5SQTHOBI.js";
20
20
  import {
21
21
  formatReference
22
- } from "./chunk-ZLUIRFJX.js";
22
+ } from "./chunk-PATZAYFZ.js";
23
23
  import {
24
24
  queryError
25
- } from "./chunk-DSJ6EAOA.js";
25
+ } from "./chunk-YF3S26TS.js";
26
26
  import {
27
27
  CliError
28
28
  } from "./chunk-S6JG4YUH.js";
@@ -30,7 +30,7 @@ import {
30
30
  __name
31
31
  } from "./chunk-ZVVMGPBJ.js";
32
32
 
33
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/paging.js
33
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/paging.js
34
34
  var positiveCount = /* @__PURE__ */ __name((flag) => (value) => {
35
35
  if (!/^\d+$/.test(value.trim()) || Number(value) < 1)
36
36
  throw new CliError("validation_error", `${flag} takes a whole number from 1 upwards, not "${value}"`);
@@ -57,7 +57,7 @@ var pagingOf = /* @__PURE__ */ __name((command) => {
57
57
  return { limit: limit ?? DEFAULT_CONFIG.defaults.limit, page: page ?? 1 };
58
58
  }, "pagingOf");
59
59
 
60
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/chat-answers.js
60
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/messenger/chat-answers.js
61
61
  var defined = /* @__PURE__ */ __name((record) => Object.fromEntries(Object.entries(record).filter(([, value]) => value !== void 0)), "defined");
62
62
  var chatRef = /* @__PURE__ */ __name((account, chat) => formatReference({ type: "chat", provider: account.provider, account: account.account, chat }), "chatRef");
63
63
  var settingsOf = /* @__PURE__ */ __name((settings) => defined({
@@ -2,14 +2,14 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  stdinFieldOf
5
- } from "./chunk-Q7ICVP25.js";
5
+ } from "./chunk-GZ7WBU5Y.js";
6
6
  import {
7
7
  commandPathOf
8
- } from "./chunk-S4ZHQMNM.js";
8
+ } from "./chunk-U6XPWCWM.js";
9
9
  import {
10
10
  commandServerRequest,
11
11
  metaOf
12
- } from "./chunk-63N46DJU.js";
12
+ } from "./chunk-5SQTHOBI.js";
13
13
  import {
14
14
  errorObjectOf,
15
15
  renderError
@@ -21,14 +21,14 @@ import {
21
21
  __name
22
22
  } from "./chunk-ZVVMGPBJ.js";
23
23
 
24
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/command-server.js
24
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/command-server.js
25
25
  import { createInterface } from "node:readline";
26
26
 
27
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/command-server-argv.js
27
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/command-server-argv.js
28
28
  var COMMAND_SERVER_ARGV = ["commands", "--serve"];
29
29
  var isCommandServer = /* @__PURE__ */ __name((args) => args.length === COMMAND_SERVER_ARGV.length && COMMAND_SERVER_ARGV.every((word, at) => args[at] === word), "isCommandServer");
30
30
 
31
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/command-server.js
31
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/command-server.js
32
32
  var COMMAND_SERVER_PROTOCOL = 1;
33
33
  var COMMAND_SERVER_IDLE_MS = 10 * 6e4;
34
34
  var COMMAND_SERVER_CONCURRENT = 8;
@@ -0,0 +1,159 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ QUERY_LIMITS,
5
+ queryError
6
+ } from "./chunk-YF3S26TS.js";
7
+ import {
8
+ CliError,
9
+ isCliError
10
+ } from "./chunk-S6JG4YUH.js";
11
+ import {
12
+ __name
13
+ } from "./chunk-ZVVMGPBJ.js";
14
+
15
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/domain/addresses.js
16
+ var EMAIL_ADDRESS = /^[^\s@]+@[^\s@]+\.[^\s@]+$/u;
17
+ var isEmailAddress = /* @__PURE__ */ __name((value) => EMAIL_ADDRESS.test(value), "isEmailAddress");
18
+ var ROLE_ADDRESS_WORDS = {
19
+ noReply: ["noreply", "no-reply", "donotreply", "do-not-reply", "mailer-daemon", "bounce", "bounces"],
20
+ shared: [
21
+ "info",
22
+ "hello",
23
+ "hi",
24
+ "contact",
25
+ "contacts",
26
+ "support",
27
+ "help",
28
+ "helpdesk",
29
+ "service",
30
+ "sales",
31
+ "office",
32
+ "admin",
33
+ "team",
34
+ "billing",
35
+ "accounts",
36
+ "accounting",
37
+ "invoices",
38
+ "finance",
39
+ "hr",
40
+ "jobs",
41
+ "careers",
42
+ "press",
43
+ "media",
44
+ "marketing",
45
+ "partners",
46
+ "legal",
47
+ "privacy",
48
+ "security",
49
+ "abuse",
50
+ "postmaster",
51
+ "webmaster",
52
+ "mail",
53
+ "inbox",
54
+ "enquiries",
55
+ "inquiries",
56
+ "booking",
57
+ "reservations",
58
+ "orders",
59
+ "feedback",
60
+ "newsletter",
61
+ "notifications",
62
+ "alerts"
63
+ ]
64
+ };
65
+ var bare = /* @__PURE__ */ __name((word) => word.replace(/[.\-_]/gu, ""), "bare");
66
+ var NO_REPLY = new Set(ROLE_ADDRESS_WORDS.noReply.map(bare));
67
+ var ROLE = new Set([...ROLE_ADDRESS_WORDS.shared, ...ROLE_ADDRESS_WORDS.noReply].map(bare));
68
+ var PART_ONLY = /* @__PURE__ */ new Set(["bounce", "bounces"]);
69
+ var NOTIFY = /* @__PURE__ */ new Set(["notify", "notification", "notifications", "alert", "alerts"]);
70
+ var localPart = /* @__PURE__ */ __name((address) => {
71
+ const local = address.trim().toLowerCase().split("@")[0] ?? "";
72
+ return local.split("+")[0] ?? "";
73
+ }, "localPart");
74
+ var localWord = /* @__PURE__ */ __name((address) => bare(localPart(address)), "localWord");
75
+ var SEPARATORS = /[.\-_]/u;
76
+ var partsOf = /* @__PURE__ */ __name((address) => localPart(address).split(SEPARATORS), "partsOf");
77
+ var NO_REPLY_PARTS = ROLE_ADDRESS_WORDS.noReply.map((word) => `.${word.split(SEPARATORS).join(".")}.`);
78
+ var isNoReplyAddress = /* @__PURE__ */ __name((address) => {
79
+ const word = localWord(address);
80
+ const parts = `.${partsOf(address).join(".")}.`;
81
+ if (NO_REPLY_PARTS.some((one) => parts.includes(one)))
82
+ return true;
83
+ return [...NO_REPLY].some((one) => !PART_ONLY.has(one) && (word.startsWith(one) || word.endsWith(one)));
84
+ }, "isNoReplyAddress");
85
+ var isRoleAddress = /* @__PURE__ */ __name((address) => ROLE.has(localWord(address)) || isNoReplyAddress(address), "isRoleAddress");
86
+ var PERSON_LIKE = /* @__PURE__ */ new Set(["hr"]);
87
+ var isPersonLikeRoleAddress = /* @__PURE__ */ __name((address) => PERSON_LIKE.has(localWord(address)), "isPersonLikeRoleAddress");
88
+ var isNotificationAddress = /* @__PURE__ */ __name((address) => partsOf(address).some((part) => NOTIFY.has(part)), "isNotificationAddress");
89
+
90
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/search/lucene/types.js
91
+ var QUERY_VERSION = 1;
92
+ var QUERY_LIMITS2 = {
93
+ ...QUERY_LIMITS,
94
+ pattern: 1024,
95
+ states: 1e4,
96
+ expansions: 1e4,
97
+ candidates: 5e4,
98
+ bodyBytes: 8388608,
99
+ milliseconds: 2e3,
100
+ work: 1e7
101
+ };
102
+ var SEARCH_QUERY = {
103
+ command: "search",
104
+ guide: "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md"
105
+ };
106
+ var MESSAGE_PARSING = { ...SEARCH_QUERY, proximity: true };
107
+ var MOST_WORDS_APART = 50;
108
+ function searchError(reason, span, alternative) {
109
+ queryError(reason, span, alternative, SEARCH_QUERY);
110
+ }
111
+ __name(searchError, "searchError");
112
+ var ANSWER_MS = 1e3;
113
+ var searchTimeLimit = /* @__PURE__ */ __name((deadline, now = Date.now()) => deadline?.explicit ? Math.max(QUERY_LIMITS2.milliseconds, deadline.endsAt - now - ANSWER_MS) : void 0, "searchTimeLimit");
114
+ function outOfTime(limitMs = QUERY_LIMITS2.milliseconds) {
115
+ throw new CliError("timeout", `search stopped at its time limit of ${limitMs / 1e3}s \u2014 the query is valid; add chat: or date: to search less of the store`, { reason: "query.time-limit", budget: "time", limit_ms: limitMs, complete: false });
116
+ }
117
+ __name(outOfTime, "outOfTime");
118
+ var isQueryLimit = /* @__PURE__ */ __name((error) => isCliError(error) && (error.details.reason === "query.too-large" || error.details.reason === "query.time-limit"), "isQueryLimit");
119
+ var SQLITE_TOO_LARGE = /nested too deep|too many terms in compound SELECT|Expression tree is too large|parser stack overflow/;
120
+ var sqliteLimit = /* @__PURE__ */ __name((error) => {
121
+ if (error instanceof Error && SQLITE_TOO_LARGE.test(error.message))
122
+ exhausted("nodes");
123
+ return error;
124
+ }, "sqliteLimit");
125
+ function exhausted(budget) {
126
+ throw new CliError("validation_error", `search exceeded its ${budget} budget \u2014 narrow the chat or date range`, {
127
+ reason: "query.too-large",
128
+ budget,
129
+ complete: false
130
+ });
131
+ }
132
+ __name(exhausted, "exhausted");
133
+ function tooWideTerm([term], budget) {
134
+ if (term === void 0)
135
+ exhausted(budget);
136
+ const part = term.replace(/[*?]+/gu, " ").trim().split(/\s+/u).sort((a, b) => b.length - a.length)[0] ?? term;
137
+ throw new CliError("validation_error", `search exceeded its ${budget} budget: ${term} is checked word by word, and too many messages hold it \u2014 write *${part}* (any word holding it, read from the index), more of the word, or add chat: or date:`, { reason: "query.too-large", budget, term, complete: false });
138
+ }
139
+ __name(tooWideTerm, "tooWideTerm");
140
+
141
+ export {
142
+ isEmailAddress,
143
+ isNoReplyAddress,
144
+ isRoleAddress,
145
+ isPersonLikeRoleAddress,
146
+ isNotificationAddress,
147
+ QUERY_VERSION,
148
+ QUERY_LIMITS2 as QUERY_LIMITS,
149
+ SEARCH_QUERY,
150
+ MESSAGE_PARSING,
151
+ MOST_WORDS_APART,
152
+ searchError,
153
+ searchTimeLimit,
154
+ outOfTime,
155
+ isQueryLimit,
156
+ sqliteLimit,
157
+ exhausted,
158
+ tooWideTerm
159
+ };
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
7
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/mcp/instructions.js
7
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/mcp/instructions.js
8
8
  var instructions = /* @__PURE__ */ __name(({ command, name, profile, writes, skill }) => {
9
9
  const all = typeof profile !== "string";
10
10
  const offers = /* @__PURE__ */ __name((key) => all || writes.includes(key), "offers");
@@ -5,15 +5,15 @@ import {
5
5
  readLock,
6
6
  releaseLock,
7
7
  takeLock
8
- } from "./chunk-GLYWZQY4.js";
8
+ } from "./chunk-M36XP74N.js";
9
9
  import {
10
10
  __name
11
11
  } from "./chunk-ZVVMGPBJ.js";
12
12
 
13
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/mcp/http/state.js
13
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/mcp/http/state.js
14
14
  import { existsSync as existsSync2, readFileSync as readFileSync2 } from "node:fs";
15
15
 
16
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/mcp/http/activity.js
16
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/mcp/http/activity.js
17
17
  import { randomBytes } from "node:crypto";
18
18
  import { chmodSync, existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
19
19
  import { dirname } from "node:path";
@@ -86,7 +86,7 @@ var activityRecorder = /* @__PURE__ */ __name((path, now = Date.now) => {
86
86
  };
87
87
  }, "activityRecorder");
88
88
 
89
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/mcp/http/state.js
89
+ // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/mcp/http/state.js
90
90
  var ACCESS_SECONDS = 60 * 60;
91
91
  var REFRESH_SECONDS = 30 * 24 * 60 * 60;
92
92
  var readStored = /* @__PURE__ */ __name((path) => existsSync2(path) ? JSON.parse(readFileSync2(path, "utf8")) : { clients: [], tokens: [] }, "readStored");