@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
@@ -3,7 +3,7 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  formatMeetingReference,
5
5
  parseMeetingReference
6
- } from "./chunk-DSJ6EAOA.js";
6
+ } from "./chunk-YF3S26TS.js";
7
7
  import {
8
8
  CliError,
9
9
  singleLine
@@ -12,178 +12,7 @@ import {
12
12
  __name
13
13
  } from "./chunk-ZVVMGPBJ.js";
14
14
 
15
- // 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/domain/money.js
16
- var CURRENCY_SCALES = {
17
- AED: 2,
18
- AMD: 2,
19
- AUD: 2,
20
- BHD: 3,
21
- BYN: 2,
22
- CAD: 2,
23
- CHF: 2,
24
- CLP: 0,
25
- CNY: 2,
26
- CZK: 2,
27
- DKK: 2,
28
- EUR: 2,
29
- GBP: 2,
30
- GEL: 2,
31
- HUF: 2,
32
- ILS: 2,
33
- INR: 2,
34
- ISK: 0,
35
- JPY: 0,
36
- KGS: 2,
37
- KRW: 0,
38
- KWD: 3,
39
- KZT: 2,
40
- NOK: 2,
41
- PLN: 2,
42
- RSD: 2,
43
- RUB: 2,
44
- SEK: 2,
45
- THB: 2,
46
- TRY: 2,
47
- UAH: 2,
48
- USD: 2,
49
- UZS: 2,
50
- VND: 0
51
- };
52
- var refuse = /* @__PURE__ */ __name((message, reason) => {
53
- throw new CliError("validation_error", message, { reason });
54
- }, "refuse");
55
- var DECIMAL = /^(\d{1,15})(?:\.(\d+))?$/;
56
- var parseDecimal = /* @__PURE__ */ __name((text, scale) => {
57
- const match = DECIMAL.exec(text.trim());
58
- if (!match || (match[2] ?? "").length > scale)
59
- return void 0;
60
- return BigInt(`${match[1]}${(match[2] ?? "").padEnd(scale, "0")}`);
61
- }, "parseDecimal");
62
- var formatDecimal = /* @__PURE__ */ __name((units, scale) => {
63
- const value = BigInt(units);
64
- if (value < 0n)
65
- return `-${formatDecimal(-value, scale)}`;
66
- const digits = value.toString().padStart(scale + 1, "0");
67
- return scale === 0 ? digits : `${digits.slice(0, -scale)}.${digits.slice(-scale)}`;
68
- }, "formatDecimal");
69
- var groupDigits = /* @__PURE__ */ __name((decimal) => {
70
- const [whole = "0", fraction] = decimal.split(".");
71
- const grouped = whole.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
72
- return fraction === void 0 ? grouped : `${grouped}.${fraction}`;
73
- }, "groupDigits");
74
- var currencyOf = /* @__PURE__ */ __name((text) => {
75
- const code = typeof text === "string" ? text.trim().toUpperCase() : "";
76
- if (CURRENCY_SCALES[code] === void 0)
77
- 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");
78
- return code;
79
- }, "currencyOf");
80
- var scaleOf = /* @__PURE__ */ __name((currency) => CURRENCY_SCALES[currencyOf(currency)], "scaleOf");
81
- var minorUnits = /* @__PURE__ */ __name((amount, currency, what = "an amount") => {
82
- const scale = scaleOf(currency);
83
- const units = typeof amount === "string" ? parseDecimal(amount, scale) : void 0;
84
- if (units === void 0 || units > BigInt(Number.MAX_SAFE_INTEGER))
85
- 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");
86
- return Number(units);
87
- }, "minorUnits");
88
- var signedMinorUnits = /* @__PURE__ */ __name((amount, currency, what = "an amount") => {
89
- if (typeof amount !== "string" || !amount.trim().startsWith("-"))
90
- return minorUnits(amount, currency, what);
91
- const units = minorUnits(amount.trim().slice(1), currency, what);
92
- return units === 0 ? 0 : -units;
93
- }, "signedMinorUnits");
94
- var moneyOf = /* @__PURE__ */ __name((units, currency) => ({
95
- amount: formatDecimal(units, scaleOf(currency)),
96
- currency
97
- }), "moneyOf");
98
- var moneyLabel = /* @__PURE__ */ __name((units, currency) => `${groupDigits(formatDecimal(units, scaleOf(currency)))} ${currency}`, "moneyLabel");
99
- var QUANTITY_SCALE = 3;
100
- var quantityOf = /* @__PURE__ */ __name((text) => {
101
- const thousandths = typeof text === "string" ? parseDecimal(text, QUANTITY_SCALE) : void 0;
102
- if (thousandths === void 0 || thousandths === 0n)
103
- return refuse('a quantity is a decimal string above 0 with at most 3 decimals, such as "1.5"', "money.quantity");
104
- const plain = formatDecimal(thousandths, QUANTITY_SCALE).replace(/\.?0+$/, "");
105
- return { text: plain, thousandths };
106
- }, "quantityOf");
107
- var lineUnits = /* @__PURE__ */ __name((thousandths, unitPrice) => Number((thousandths * BigInt(unitPrice) + 500n) / 1000n), "lineUnits");
108
-
109
- // 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/domain/finance.js
110
- var INVOICE_DIRECTIONS = ["receivable", "payable"];
111
- var INVOICE_STATUSES = ["draft", "issued", "partly_paid", "paid", "void"];
112
- var MONEY_DIRECTIONS = ["in", "out"];
113
- var FINANCE_REVIEWS = ["proposed", "confirmed", "rejected"];
114
- var settledStatus = /* @__PURE__ */ __name((current, total, paid) => {
115
- if (current === "draft" || current === "void")
116
- return current;
117
- if (paid <= 0)
118
- return "issued";
119
- return paid < total ? "partly_paid" : "paid";
120
- }, "settledStatus");
121
- var dayMonth = /* @__PURE__ */ __name((date) => date === null ? null : `${date.slice(8, 10)}.${date.slice(5, 7)}`, "dayMonth");
122
- var notes = /* @__PURE__ */ __name((...words) => {
123
- const kept = words.filter((word) => word !== null);
124
- return kept.length === 0 ? "" : ` (${kept.join(", ")})`;
125
- }, "notes");
126
- var invoiceLine = /* @__PURE__ */ __name((invoice) => {
127
- const party = invoice.counterpartyName === null ? "" : `${invoice.direction === "receivable" ? " to" : " from"} ${invoice.counterpartyName}`;
128
- const due = invoice.dueDate === null ? "" : `, due ${dayMonth(invoice.dueDate)}`;
129
- return `${invoice.number ?? `#${invoice.id}`} \xB7 ${moneyLabel(invoice.total, invoice.currency)}${party}${due}` + notes(invoice.status.replace("_", " "), invoice.review === "confirmed" ? null : invoice.review);
130
- }, "invoiceLine");
131
- var paymentLine = /* @__PURE__ */ __name((payment) => {
132
- const party = payment.partyName === null ? "" : `${payment.direction === "in" ? " from" : " to"} ${payment.partyName}`;
133
- return `${moneyLabel(payment.amount, payment.currency)}${party}, ${dayMonth(payment.date)}` + notes(payment.review === "confirmed" ? null : payment.review);
134
- }, "paymentLine");
135
- var invoiceTitle = /* @__PURE__ */ __name((invoice) => `Invoice ${invoiceLine(invoice)}`, "invoiceTitle");
136
- var paymentEntryTitle = /* @__PURE__ */ __name((payment) => `Payment \xB7 ${paymentLine(payment)}`, "paymentEntryTitle");
137
-
138
- // 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/domain/business.js
139
- var CATALOG_KINDS = ["product", "service"];
140
- var BUSINESS_KINDS = ["invoice", "payment", "order", "contract", "subscription", "product", "wallet"];
141
- var CONTRACT_KINDS = ["sale", "purchase", "service", "lease", "employment", "nda", "license", "other"];
142
- var CONTRACT_STATUSES = ["draft", "active", "ended", "terminated"];
143
- var SUBSCRIPTION_STATUSES = ["trial", "active", "paused", "cancelled", "ended"];
144
- var WALLET_KINDS = ["bank", "card", "cash", "wallet", "other"];
145
- var TRANSACTION_STATUSES = ["pending", "booked"];
146
- var ORDER_DIRECTIONS = ["purchase", "sale"];
147
- var intervalOf = /* @__PURE__ */ __name((text, reason = "subscription.interval") => {
148
- const match = typeof text === "string" ? /^(?:([1-9]\d{0,2})-)?(day|week|month|year)$/.exec(text.trim()) : null;
149
- if (!match)
150
- throw new CliError("validation_error", "an interval is a count and a unit, such as 1-month or 2-week", { reason });
151
- return { count: match[1] === void 0 ? 1 : Number(match[1]), unit: match[2] };
152
- }, "intervalOf");
153
- var intervalText = /* @__PURE__ */ __name(({ count, unit }) => `${count}-${unit}`, "intervalText");
154
- var priced = /* @__PURE__ */ __name((units, currency) => units === null || currency === null ? "" : `, ${moneyLabel(units, currency)}`, "priced");
155
- var pending = /* @__PURE__ */ __name((review) => review === "confirmed" ? null : review, "pending");
156
- var productLine = /* @__PURE__ */ __name((product) => {
157
- const price = product.unitPrice === null || product.currency === null ? "" : moneyLabel(product.unitPrice, product.currency);
158
- const per = price && product.unit !== null ? ` per ${product.unit}` : "";
159
- return `${product.name}${price ? ` \xB7 ${price}${per}` : ""}${notes(product.kind, product.archived ? "archived" : null)}`;
160
- }, "productLine");
161
- var contractLine = /* @__PURE__ */ __name((contract) => `${contract.number ?? `#${contract.id}`} \xB7 ${contract.name}${priced(contract.value, contract.currency)}` + notes(contract.status, pending(contract.review)), "contractLine");
162
- var subscriptionLine = /* @__PURE__ */ __name((subscription) => `${subscription.name}${priced(subscription.price, subscription.currency)} every ${intervalText(subscription.interval)}` + notes(subscription.status, pending(subscription.review)), "subscriptionLine");
163
- var walletLine = /* @__PURE__ */ __name((wallet) => `${wallet.name} \xB7 ${wallet.kind}, ${wallet.currency}${wallet.numberHint === null ? "" : `, \u2026${wallet.numberHint}`}` + notes(wallet.closed ? "closed" : null), "walletLine");
164
- 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");
165
-
166
- // 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/domain/crm.js
167
- var CRM_KINDS = ["organization", "person", "deal", "lead"];
168
- var CRM_ACTIVITY_KINDS = ["call", "email", "meeting", "todo", "task", "comment", "other"];
169
- var isCrmUserId = /* @__PURE__ */ __name((id) => /^\d{1,20}$/.test(id), "isCrmUserId");
170
- var normalCrmUserId = /* @__PURE__ */ __name((id) => {
171
- const text = id.trim();
172
- return /^\d+$/.test(text) ? text.replace(/^0+(?=\d)/, "") : text;
173
- }, "normalCrmUserId");
174
- var isItemKind = /* @__PURE__ */ __name((kind2) => kind2 === "deal" || kind2 === "lead", "isItemKind");
175
-
176
- // 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/domain/deals.js
177
- var DEAL_KINDS = ["deal", "lead"];
178
- var DEAL_STATUSES = ["open", "won", "lost"];
179
- var STAGE_OUTCOMES = DEAL_STATUSES;
180
- var DEAL_ROLES = ["owner", "contact", "decision-maker", "influencer"];
181
- var dealLine = /* @__PURE__ */ __name((deal) => {
182
- const money = deal.amount === null || deal.currency === null ? "" : `, ${moneyLabel(deal.amount, deal.currency)}`;
183
- return `${deal.title} \xB7 ${deal.stage}${money}${deal.status === "open" ? "" : ` (${deal.status})`}`;
184
- }, "dealLine");
185
-
186
- // 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/domain/locator.js
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/locator.js
187
16
  var SCHEME = "msg:";
188
17
  var formatLocator = /* @__PURE__ */ __name(({ provider, account, chat, message }) => SCHEME + [provider, account, chat, message].map(encodeURIComponent).join("/"), "formatLocator");
189
18
  var isLocator = /* @__PURE__ */ __name((reference) => reference.trim().startsWith(SCHEME), "isLocator");
@@ -204,7 +33,7 @@ var parseLocator = /* @__PURE__ */ __name((reference) => {
204
33
  return { provider, account, chat, message };
205
34
  }, "parseLocator");
206
35
 
207
- // 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/domain/references.js
36
+ // 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/references.js
208
37
  var SIMPLE_REFERENCES = [
209
38
  "note",
210
39
  "document",
@@ -214,6 +43,7 @@ var SIMPLE_REFERENCES = [
214
43
  "task",
215
44
  "memory",
216
45
  "fact",
46
+ "agent",
217
47
  "bot",
218
48
  "event",
219
49
  "invoice",
@@ -252,19 +82,21 @@ var folderPath = /* @__PURE__ */ __name((path) => {
252
82
  }, "folderPath");
253
83
  var MEETING_SHAPE = "meeting:<account>/<meeting>[/<transcript>[/<cue>]] with safe integer ids";
254
84
  var kind = /* @__PURE__ */ __name((spec) => spec, "kind");
255
- var simple = /* @__PURE__ */ __name((prefix) => kind({
85
+ var BY_NUMBER_ONLY = /* @__PURE__ */ new Set(["agent"]);
86
+ var simple = /* @__PURE__ */ __name((prefix, type = prefix) => kind({
256
87
  prefix,
257
- type: prefix,
258
- shape: `${prefix}:<id>`,
88
+ type,
89
+ shape: BY_NUMBER_ONLY.has(prefix) ? `${prefix}:<number>` : `${prefix}:<id>`,
259
90
  parse: /* @__PURE__ */ __name((rest, text) => {
260
- if (!rest.trim())
91
+ if (!rest.trim() || BY_NUMBER_ONLY.has(prefix) && !/^[1-9]\d*$/.test(rest))
261
92
  throw new CliError("validation_error", `"${singleLine(text)}" names no ${prefix}`, {
262
93
  reason: "ref.malformed"
263
94
  });
264
- return { type: prefix, id: rest };
95
+ return { type, id: rest };
265
96
  }, "parse"),
266
97
  format: /* @__PURE__ */ __name((reference) => `${reference.type}:${reference.id}`, "format")
267
98
  }), "simple");
99
+ var ALIASES = /* @__PURE__ */ new Set(["sender-bot"]);
268
100
  var REF_KINDS = [
269
101
  kind({
270
102
  prefix: "msg",
@@ -326,11 +158,12 @@ var REF_KINDS = [
326
158
  }, "parse"),
327
159
  format: formatMeetingReference
328
160
  }),
329
- ...SIMPLE_REFERENCES.map(simple)
161
+ simple("sender-bot", "bot"),
162
+ ...SIMPLE_REFERENCES.map((prefix) => simple(prefix))
330
163
  ];
331
164
  var byPrefix = new Map(REF_KINDS.map((spec) => [spec.prefix, spec]));
332
165
  var byType = new Map(REF_KINDS.map((spec) => [spec.type, spec]));
333
- var offered = REF_KINDS.map(({ prefix }) => prefix).filter((prefix) => prefix !== "entity");
166
+ var offered = REF_KINDS.map(({ prefix }) => prefix).filter((prefix) => prefix !== "entity" && !ALIASES.has(prefix));
334
167
  var distance = /* @__PURE__ */ __name((a, b) => {
335
168
  let row = Array.from({ length: b.length + 1 }, (_, at) => at);
336
169
  for (const [i, x] of [...a].entries()) {
@@ -363,11 +196,13 @@ var parseReference = /* @__PURE__ */ __name((text) => {
363
196
  }, "parseReference");
364
197
  var canonicalReference = /* @__PURE__ */ __name((text) => formatReference(parseReference(text)), "canonicalReference");
365
198
  var looksLikeReference = /* @__PURE__ */ __name((text) => {
366
- const match = /^([a-z]+):\S+$/.exec(text.trim());
367
- return match !== null && byPrefix.has(match[1]);
199
+ const match = /^([a-z][a-z-]*):(\S+)$/.exec(text.trim());
200
+ if (match === null || !byPrefix.has(match[1]))
201
+ return false;
202
+ return !BY_NUMBER_ONLY.has(match[1]) || /^[1-9]\d*$/.test(match[2]);
368
203
  }, "looksLikeReference");
369
204
 
370
- // 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/domain/providers.js
205
+ // 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/providers.js
371
206
  var KINDS = ["messages", "mail", "notes", "documents", "meetings", "events", "crm", "tracker"];
372
207
  var MESSENGER_OPENS = { chat: "messages list", message: "messages show", contact: "contacts show" };
373
208
  var PROVIDERS = [
@@ -559,165 +394,21 @@ var holdsKind = /* @__PURE__ */ __name((provider, kind2) => kindsIn(provider).in
559
394
  var holdsKindOf = /* @__PURE__ */ __name((provider, kind2) => kindIn(provider) === void 0 ? kind2 === "messages" : holdsKind(provider, kind2), "holdsKindOf");
560
395
  var kindOf = /* @__PURE__ */ __name((provider) => kindIn(provider) ?? "messages", "kindOf");
561
396
 
562
- // 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/domain/orders.js
563
- var ORDER_STATUSES = ["placed", "shipped", "delivered", "cancelled", "returned"];
564
- var ORDER_PURPOSES = ["personal", "business", "client", "other"];
565
- var orderLine = /* @__PURE__ */ __name((order) => {
566
- const party = order.direction === "sale" && order.customerName !== null ? `to ${order.customerName}` : order.supplierName;
567
- const money = order.total === null || order.currency === null ? "" : `, ${moneyLabel(order.total, order.currency)}`;
568
- const notes2 = [order.status, order.review === "confirmed" ? null : order.review].filter(Boolean).join(", ");
569
- return `${order.number ?? `#${order.id}`} \xB7 ${party}${money} (${notes2})`;
570
- }, "orderLine");
571
- var orderTitle = /* @__PURE__ */ __name((order) => `Order ${orderLine(order)}`, "orderTitle");
572
-
573
- // 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/domain/relations.js
574
- var ORGANIZATION_ROLES = [
575
- "employee",
576
- "contractor",
577
- "founder",
578
- "owner",
579
- "manager",
580
- "adviser",
581
- "contact"
582
- ];
583
- var PROJECT_ROLES = ["owner", "manager", "contributor", "client-contact", "approver"];
584
- var CONTRACT_ROLES = ["customer", "supplier", "signatory", "guarantor"];
585
- var RELATED_ROLES = ["colleague", "adviser", "investor", "mentor", "family", "friend"];
586
- var ENGAGEMENT_LEVELS = ["none", "low", "medium", "high"];
587
- var isEngagement = /* @__PURE__ */ __name((value) => typeof value === "string" && ENGAGEMENT_LEVELS.includes(value), "isEngagement");
588
- var checkEngagement = /* @__PURE__ */ __name((kind2, from, to, level) => {
589
- if (kind2 !== "member-of" || from !== "person" || to !== "project")
590
- throw new CliError("validation_error", "an engagement level is set only on a person's member-of a project", {
591
- reason: "relationship.engagement-ends"
592
- });
593
- if (!isEngagement(level))
594
- throw new CliError("validation_error", `an engagement level is one of ${ENGAGEMENT_LEVELS.join(", ")}`, {
595
- reason: "relationship.engagement-unknown"
596
- });
597
- return level;
598
- }, "checkEngagement");
599
- var RELATIONS = {
600
- "member-of": {
601
- from: ["person", "organization", "project", "chat", "email_thread"],
602
- to: ["organization", "project"],
603
- roles: { to: { organization: ORGANIZATION_ROLES, project: PROJECT_ROLES } }
604
- },
605
- "reports-to": { from: ["person"], to: ["person"], inverse: "manages" },
606
- "customer-of": { from: ["person", "organization"], to: ["organization"], inverse: "supplier of" },
607
- "partner-of": { from: ["organization"], to: ["organization"], symmetric: true },
608
- "related-to": {
609
- from: ["person", "organization", "project", "task", "deal", "lead", "contract"],
610
- to: ["person", "organization", "project", "task"],
611
- roles: { from: { deal: DEAL_ROLES, lead: DEAL_ROLES, contract: CONTRACT_ROLES } }
612
- }
613
- };
614
- var RELATION_KINDS = Object.keys(RELATIONS);
615
- var specOf = /* @__PURE__ */ __name((kind2) => Object.hasOwn(RELATIONS, kind2) ? RELATIONS[kind2] : void 0, "specOf");
616
- var isRelationKind = /* @__PURE__ */ __name((kind2) => specOf(kind2) !== void 0, "isRelationKind");
617
- var memberOnly = /* @__PURE__ */ __name((type) => type === "chat" || type === "email_thread", "memberOnly");
618
- var partyOnly = /* @__PURE__ */ __name((from, to) => from === "contract" && to !== "person" && to !== "organization", "partyOnly");
619
- var checkEnds = /* @__PURE__ */ __name((kind2, from, to) => {
620
- const spec = specOf(kind2);
621
- if (!spec)
622
- throw new CliError("validation_error", `a relationship's kind is one of ${RELATION_KINDS.join(", ")}`);
623
- if (memberOnly(from) && (kind2 !== "member-of" || to !== "project"))
624
- throw new CliError("validation_error", `a ${from === "chat" ? "chat" : "mail thread"} is related only as member-of a project`);
625
- if (partyOnly(from, to))
626
- throw new CliError("validation_error", "a contract is related only to a person or an organization");
627
- if (!spec.from.includes(from) || !spec.to.includes(to))
628
- throw new CliError("validation_error", `${kind2} joins ${spec.from.join(", ")} to ${spec.to.join(", ")}, not ${from} to ${to}`);
629
- return spec;
630
- }, "checkEnds");
631
- var isParty = /* @__PURE__ */ __name((type) => type === "person" || type === "organization", "isParty");
632
- var rolesOf = /* @__PURE__ */ __name((kind2, from, to) => {
633
- const spec = specOf(kind2);
634
- if (kind2 === "member-of" && from !== "person")
635
- return void 0;
636
- return spec?.roles?.from?.[from] ?? spec?.roles?.to?.[to];
637
- }, "rolesOf");
638
- var ROLE_LISTS = {
639
- organization: ORGANIZATION_ROLES,
640
- project: PROJECT_ROLES,
641
- deal: DEAL_ROLES,
642
- contract: CONTRACT_ROLES,
643
- related: RELATED_ROLES
644
- };
645
- var roleListOf = /* @__PURE__ */ __name((kind2, from, to) => {
646
- if (kind2 === "related-to" && isParty(from) && isParty(to))
647
- return "related";
648
- const roles = rolesOf(kind2, from, to);
649
- return Object.keys(ROLE_LISTS).find((list) => ROLE_LISTS[list] === roles);
650
- }, "roleListOf");
651
- var checkRole = /* @__PURE__ */ __name((kind2, from, to, role, extra = []) => {
652
- const roles = rolesOf(kind2, from, to)?.concat(extra);
653
- if (roles && !roles.includes(role))
654
- throw new CliError("validation_error", `a ${from}'s role on ${kind2} ${to} is one of ${roles.join(", ")}`, {
655
- reason: "relationship.role-unknown"
656
- });
657
- return role;
658
- }, "checkRole");
659
- var isSymmetric = /* @__PURE__ */ __name((kind2) => specOf(kind2)?.symmetric === true, "isSymmetric");
660
- var inverseOf = /* @__PURE__ */ __name((kind2) => specOf(kind2)?.symmetric ? kind2 : specOf(kind2)?.inverse ?? null, "inverseOf");
661
- var STANDINGS = ["confirmed", "reported", "proposed", "ended"];
662
- var standingOf = /* @__PURE__ */ __name((link, now) => {
663
- if (link.endsAt != null && link.endsAt <= now)
664
- return "ended";
665
- if (link.confirmed)
666
- return "confirmed";
667
- if (link.deletedAt != null)
668
- return "ended";
669
- return link.accountId != null ? "reported" : "proposed";
670
- }, "standingOf");
671
- var isUsable = /* @__PURE__ */ __name((standing) => standing === "confirmed" || standing === "reported", "isUsable");
672
- var KEYED = "kind IN ('member-of', 'related-to', 'reports-to', 'customer-of', 'partner-of') AND to_id IS NOT NULL";
673
- 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");
674
- 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");
397
+ // 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/tags.js
398
+ var TAG_TYPES = ["chat", "contact", "message", "task"];
399
+ var TAG = /^[a-z0-9-]{1,32}$/;
400
+ var tagOf = /* @__PURE__ */ __name((value) => {
401
+ const tag = value.trim().toLowerCase();
402
+ return TAG.test(tag) ? tag : void 0;
403
+ }, "tagOf");
404
+ var normalizeTag = /* @__PURE__ */ __name((value) => {
405
+ const tag = tagOf(value);
406
+ if (tag === void 0)
407
+ throw new CliError("validation_error", `"${singleLine(value)}" is not a tag \u2014 use 1\u201332 letters a\u2013z, digits and hyphens`, { reason: "tag.invalid" });
408
+ return tag;
409
+ }, "normalizeTag");
675
410
 
676
411
  export {
677
- parseDecimal,
678
- formatDecimal,
679
- groupDigits,
680
- currencyOf,
681
- scaleOf,
682
- minorUnits,
683
- signedMinorUnits,
684
- moneyOf,
685
- moneyLabel,
686
- quantityOf,
687
- lineUnits,
688
- INVOICE_DIRECTIONS,
689
- INVOICE_STATUSES,
690
- MONEY_DIRECTIONS,
691
- FINANCE_REVIEWS,
692
- settledStatus,
693
- invoiceLine,
694
- paymentLine,
695
- invoiceTitle,
696
- paymentEntryTitle,
697
- CATALOG_KINDS,
698
- BUSINESS_KINDS,
699
- CONTRACT_KINDS,
700
- CONTRACT_STATUSES,
701
- SUBSCRIPTION_STATUSES,
702
- WALLET_KINDS,
703
- TRANSACTION_STATUSES,
704
- ORDER_DIRECTIONS,
705
- intervalOf,
706
- productLine,
707
- contractLine,
708
- subscriptionLine,
709
- walletLine,
710
- transactionLine,
711
- CRM_KINDS,
712
- CRM_ACTIVITY_KINDS,
713
- isCrmUserId,
714
- normalCrmUserId,
715
- isItemKind,
716
- DEAL_KINDS,
717
- DEAL_STATUSES,
718
- STAGE_OUTCOMES,
719
- DEAL_ROLES,
720
- dealLine,
721
412
  formatLocator,
722
413
  isLocator,
723
414
  parseLocator,
@@ -756,25 +447,7 @@ export {
756
447
  holdsKind,
757
448
  holdsKindOf,
758
449
  kindOf,
759
- ORDER_STATUSES,
760
- ORDER_PURPOSES,
761
- orderLine,
762
- orderTitle,
763
- isEngagement,
764
- checkEngagement,
765
- RELATION_KINDS,
766
- isRelationKind,
767
- checkEnds,
768
- rolesOf,
769
- ROLE_LISTS,
770
- roleListOf,
771
- checkRole,
772
- isSymmetric,
773
- inverseOf,
774
- STANDINGS,
775
- standingOf,
776
- isUsable,
777
- KEYED,
778
- notOverriddenSql,
779
- usableLinkSql
450
+ TAG_TYPES,
451
+ tagOf,
452
+ normalizeTag
780
453
  };