@wirecat/mail-cli 0.36.0 → 0.38.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 (191) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/contracts/wirecat.json +1 -0
  3. package/dist/bin/mail.js +2 -2
  4. package/dist/bundle/agent-U43CYLAP.js +41 -0
  5. package/dist/bundle/{all-profiles-RS6OV3YO.js → all-profiles-OCUZMXMI.js} +11 -11
  6. package/dist/bundle/{anthropic-PPQ7DTXN.js → anthropic-CABWJABQ.js} +5 -5
  7. package/dist/bundle/{app-server-EBFBMFQC.js → app-server-TTWPIGWG.js} +70 -67
  8. package/dist/bundle/{bun-J7HAT7MW.js → bun-F4M4KCNA.js} +2 -2
  9. package/dist/bundle/{bun-sqlite-PCSNAXIQ.js → bun-sqlite-YKYG25CR.js} +6 -6
  10. package/dist/bundle/{chunk-6FZPFNEU.js → chunk-24UGTK32.js} +9 -9
  11. package/dist/bundle/{chunk-RJUVWJTA.js → chunk-2HDXD6LM.js} +7 -7
  12. package/dist/bundle/{chunk-VIDPFLFM.js → chunk-2SQLHBDP.js} +2 -2
  13. package/dist/bundle/{chunk-WZFGZBGD.js → chunk-2YO3PLOE.js} +19 -19
  14. package/dist/bundle/{chunk-3ZKNXKM7.js → chunk-3TYER5IK.js} +14 -6
  15. package/dist/bundle/{chunk-AVR4FPYG.js → chunk-4FXDUXZP.js} +8 -8
  16. package/dist/bundle/{chunk-MQ6DQRRI.js → chunk-5ICUC66S.js} +4 -4
  17. package/dist/bundle/{chunk-WNQECDIP.js → chunk-725OPCHI.js} +61 -61
  18. package/dist/bundle/{chunk-Q6TPXXOS.js → chunk-77YTUOKN.js} +35 -176
  19. package/dist/bundle/chunk-7ECP5ZQR.js +2 -0
  20. package/dist/bundle/{chunk-5G4MDFZ2.js → chunk-7EJWHADX.js} +14 -10
  21. package/dist/bundle/{chunk-GEU3WR75.js → chunk-7KO5FSAW.js} +3 -3
  22. package/dist/bundle/{chunk-NSH2UHJR.js → chunk-A3KNH3Q4.js} +8 -8
  23. package/dist/bundle/{chunk-SCJVKWMV.js → chunk-AGO3OVKW.js} +2145 -902
  24. package/dist/bundle/{chunk-TV634B6T.js → chunk-AQ5RIOUE.js} +1 -1
  25. package/dist/bundle/{chunk-ROK7Z5LQ.js → chunk-BA5B5ZF4.js} +274 -182
  26. package/dist/bundle/{chunk-ZV57PIPE.js → chunk-C4PUDTGD.js} +2 -2
  27. package/dist/bundle/{chunk-IBOWSQ7X.js → chunk-C7JPYWYQ.js} +1 -1
  28. package/dist/bundle/{chunk-BBQERXQX.js → chunk-CJJFOT7W.js} +3 -3
  29. package/dist/bundle/{chunk-645FQC4G.js → chunk-CLTFTGBP.js} +18 -17
  30. package/dist/bundle/{chunk-XRVZMM5B.js → chunk-DKGKPJA3.js} +164 -36
  31. package/dist/bundle/{chunk-HPSESLOZ.js → chunk-DNCLQPOM.js} +1 -1
  32. package/dist/bundle/{chunk-EGR3YUWD.js → chunk-DPV53EZC.js} +4 -4
  33. package/dist/bundle/{chunk-GI6DNX7Q.js → chunk-DYCE72XB.js} +36 -36
  34. package/dist/bundle/{chunk-42XY6D5C.js → chunk-EDWY73H7.js} +5 -5
  35. package/dist/bundle/{chunk-L4QLZDBZ.js → chunk-EJQAP6A6.js} +6 -6
  36. package/dist/bundle/{chunk-REWV37HQ.js → chunk-ESNZL7SB.js} +6 -6
  37. package/dist/bundle/{chunk-DVJPEZGV.js → chunk-FFER7KJI.js} +13 -13
  38. package/dist/bundle/{chunk-NJZR3OFK.js → chunk-FTH6WGYO.js} +1 -1
  39. package/dist/bundle/{chunk-SJNFPBPF.js → chunk-FWGNDKJK.js} +2 -2
  40. package/dist/bundle/{chunk-5VPLQS4S.js → chunk-G46PNDWL.js} +2 -2
  41. package/dist/bundle/chunk-G5HG7ZWQ.js +1169 -0
  42. package/dist/bundle/{chunk-RMWS7IQ4.js → chunk-G6NY7LFB.js} +4 -4
  43. package/dist/bundle/{chunk-PPIMXOBT.js → chunk-GMWKNWWY.js} +6 -6
  44. package/dist/bundle/{chunk-774VG5WZ.js → chunk-GZ7WBU5Y.js} +1 -1
  45. package/dist/bundle/{chunk-LQQIYBHN.js → chunk-HFDDVGDH.js} +201 -113
  46. package/dist/bundle/{chunk-NYYMMIVW.js → chunk-HFRH5YJ6.js} +16 -3
  47. package/dist/bundle/{chunk-3BYKGMRM.js → chunk-HI6MTNID.js} +6 -6
  48. package/dist/bundle/{chunk-PF7ZNIVP.js → chunk-HIKPVWCL.js} +3 -3
  49. package/dist/bundle/{chunk-U3BO342P.js → chunk-HO4JGD4Q.js} +1 -1
  50. package/dist/bundle/chunk-HUAHLO6N.js +29 -0
  51. package/dist/bundle/{chunk-QI2XGTFH.js → chunk-HYUUAH2N.js} +8 -8
  52. package/dist/bundle/chunk-I4AWLFYH.js +377 -0
  53. package/dist/bundle/{chunk-MRWV5VNQ.js → chunk-I4PZOWYG.js} +6 -6
  54. package/dist/bundle/chunk-IDCZ4LWS.js +150 -0
  55. package/dist/bundle/{chunk-NTUP5RCP.js → chunk-ISQ23VKV.js} +8 -1
  56. package/dist/bundle/{chunk-2VEFNFYZ.js → chunk-KLRCTMES.js} +3 -3
  57. package/dist/bundle/{chunk-C3JSQ7UJ.js → chunk-KP5JDYY6.js} +27 -8
  58. package/dist/bundle/{chunk-CMOO4INK.js → chunk-KYRYD4CR.js} +1 -1
  59. package/dist/bundle/{chunk-KTVQIKU5.js → chunk-LB2CF3GG.js} +19 -15
  60. package/dist/bundle/{chunk-6PKMUKUF.js → chunk-LC7ZD2RW.js} +1 -1
  61. package/dist/bundle/{chunk-2UNZ3L2H.js → chunk-M65NILSA.js} +6 -6
  62. package/dist/bundle/{chunk-PMSZBUC7.js → chunk-NQFG7AES.js} +8 -8
  63. package/dist/bundle/chunk-OAO3JKQD.js +463 -0
  64. package/dist/bundle/{chunk-JCILSTFK.js → chunk-OEEWVKJX.js} +1 -1
  65. package/dist/bundle/{chunk-6VMJLOYO.js → chunk-OVHC7OV4.js} +12 -12
  66. package/dist/bundle/{chunk-OEL4DQTT.js → chunk-PT4VLN3K.js} +4 -4
  67. package/dist/bundle/chunk-QETNCUWB.js +1703 -0
  68. package/dist/bundle/{chunk-ZRSLG3B3.js → chunk-QK3Z7BCC.js} +6 -6
  69. package/dist/bundle/{chunk-CJHO6B3M.js → chunk-QWF3TFW4.js} +43 -29
  70. package/dist/bundle/{chunk-NYR7PIAG.js → chunk-RHEDE7D4.js} +3 -3
  71. package/dist/bundle/{chunk-KP7JHJVP.js → chunk-RI5YZ23Y.js} +27 -27
  72. package/dist/bundle/{chunk-2RV4V55B.js → chunk-ROUZN6UQ.js} +20 -85
  73. package/dist/bundle/{chunk-4WSTWZUB.js → chunk-RQD7CAGF.js} +2 -2
  74. package/dist/bundle/{chunk-PMGAU6AP.js → chunk-S6JG4YUH.js} +2 -2
  75. package/dist/bundle/{chunk-KLPFPNZP.js → chunk-SBLHQAH3.js} +11 -11
  76. package/dist/bundle/{chunk-6UYIWQLU.js → chunk-SXLIADMY.js} +4 -4
  77. package/dist/bundle/{chunk-5JEKBYIH.js → chunk-SYCM6SQ5.js} +14 -14
  78. package/dist/bundle/{chunk-3NOXZZJV.js → chunk-T3W4V4A6.js} +1 -1
  79. package/dist/bundle/{chunk-6NDPOY4N.js → chunk-TCT5D2X2.js} +1 -1
  80. package/dist/bundle/{chunk-YPB5BEAD.js → chunk-TES7MB6I.js} +2 -2
  81. package/dist/bundle/chunk-TQDSBLQB.js +2 -0
  82. package/dist/bundle/{chunk-VIJV474N.js → chunk-TXDR6YSF.js} +1 -1
  83. package/dist/bundle/{chunk-QDNYJOWJ.js → chunk-TY7NDMFY.js} +1 -1
  84. package/dist/bundle/{chunk-437UHSIO.js → chunk-UGFMQWAZ.js} +210 -62
  85. package/dist/bundle/{chunk-KVFBSOCV.js → chunk-VA6PHTMV.js} +9 -9
  86. package/dist/bundle/{chunk-WPPPO427.js → chunk-VK24UQSD.js} +4 -4
  87. package/dist/bundle/{chunk-MT3LYU4T.js → chunk-VUHH4MQW.js} +21768 -12322
  88. package/dist/bundle/{chunk-CJMZQ2MZ.js → chunk-W3BOR6AT.js} +8 -8
  89. package/dist/bundle/chunk-WA53OJ7V.js +160 -0
  90. package/dist/bundle/{chunk-HH34WRQE.js → chunk-XGVMQMTS.js} +7 -7
  91. package/dist/bundle/{chunk-GBZIWCEP.js → chunk-YP4FYLFI.js} +3 -3
  92. package/dist/bundle/{chunk-V5I7QP4T.js → chunk-ZDBWBCEO.js} +2 -2
  93. package/dist/bundle/{chunk-GCTHVCJU.js → chunk-ZKVUAH5N.js} +4 -4
  94. package/dist/bundle/command-contract-V2WIL6RL.js +40 -0
  95. package/dist/bundle/{command-server-entry-73RJELAV.js → command-server-entry-ZC5YF4EC.js} +29 -28
  96. package/dist/bundle/{decode-7BUWBDPT.js → decode-NXAGEUAD.js} +5 -5
  97. package/dist/bundle/{dispatch-IBOMVWZA.js → dispatch-USKS7J74.js} +8 -8
  98. package/dist/bundle/{dist-MULVCVSR.js → dist-XN2CRP3U.js} +49 -48
  99. package/dist/bundle/{echarts-VLWFC322.js → echarts-QMAA7HH5.js} +2 -2
  100. package/dist/bundle/{embed-W3VH4HPY.js → embed-3P3LSM2O.js} +6 -6
  101. package/dist/bundle/{embedder-I7ERQZJV.js → embedder-2SANUF2X.js} +9 -9
  102. package/dist/bundle/{failure-QMAPSQ7X.js → failure-D4FGOIWF.js} +2 -2
  103. package/dist/bundle/{first-run-LCVER6QN.js → first-run-HEZKQLJL.js} +12 -12
  104. package/dist/bundle/first-screen-7TQZ4I6X.js +41 -0
  105. package/dist/bundle/{instructions-BNCVLSYQ.js → instructions-4H7UREH2.js} +1 -1
  106. package/dist/bundle/mail.js +12 -12
  107. package/dist/bundle/{mcp-Z2KZNCXB.js → mcp-5HFPWC3W.js} +2 -2
  108. package/dist/bundle/meeting-combined-HF2NL4PU.js +26 -0
  109. package/dist/bundle/{meeting-model-BWLSTNXA.js → meeting-model-B7RVFB7L.js} +11 -11
  110. package/dist/bundle/{meeting-semantic-ZIEHXN2R.js → meeting-semantic-YQTL7YVQ.js} +6 -6
  111. package/dist/bundle/{node-RYFTRSG4.js → node-P3PUHKYH.js} +2 -2
  112. package/dist/bundle/{node-sqlite-XCHVNTGQ.js → node-sqlite-OFHTCHJH.js} +7 -7
  113. package/dist/bundle/{oauth-FNUJSKKJ.js → oauth-IVB5RP7T.js} +7 -7
  114. package/dist/bundle/{open-WVWSJ3WI.js → open-KDGDLCWV.js} +5 -5
  115. package/dist/bundle/{openai-QOUTYYTF.js → openai-NVUBKA7Z.js} +15 -15
  116. package/dist/bundle/{process-W5KPID53.js → process-AFIXYXWL.js} +1 -1
  117. package/dist/bundle/{program-L5UANM3I.js → program-JQ7EFODJ.js} +2825 -7739
  118. package/dist/bundle/{prompt-JSBAPNJE.js → prompt-QG7FC2SA.js} +5 -5
  119. package/dist/bundle/public-FBD7MQUM.js +204 -0
  120. package/dist/bundle/{recognize-FDX4SJ6Q.js → recognize-ZBR5KNID.js} +4 -4
  121. package/dist/bundle/{remote-MYOXOQHM.js → remote-QOTHNO2M.js} +9 -9
  122. package/dist/bundle/{rerank-NY5MSZCR.js → rerank-JD2NIUW6.js} +7 -7
  123. package/dist/bundle/{serve-URI6NZA3.js → serve-QZT3FKK7.js} +9 -9
  124. package/dist/bundle/{server-HQ25RHQM.js → server-M6JJ7IKS.js} +62 -59
  125. package/dist/bundle/server-TAMXMWK6.js +87 -0
  126. package/dist/bundle/{sqlite-runtime-6UUPSSKG.js → sqlite-runtime-N2PY7C7J.js} +6 -6
  127. package/dist/bundle/{state-NDDVFPCI.js → state-OGRUMU7P.js} +6 -6
  128. package/dist/bundle/{store-2RDOICVN.js → store-7UE63OQR.js} +61 -43
  129. package/dist/bundle/{store-PKYWPKKR.js → store-DGJKE4ZJ.js} +25 -23
  130. package/dist/bundle/store-maintenance-command-WIDKMZLK.js +74 -0
  131. package/dist/bundle/surface-LTEEEZU4.js +73 -0
  132. package/dist/commands/import.js +2 -2
  133. package/dist/commands/import.js.map +1 -1
  134. package/dist/commands/messages.js +3 -3
  135. package/dist/commands/messages.js.map +1 -1
  136. package/dist/commands/read.js +2 -2
  137. package/dist/commands/read.js.map +1 -1
  138. package/dist/commands/send.d.ts.map +1 -1
  139. package/dist/commands/send.js +1 -0
  140. package/dist/commands/send.js.map +1 -1
  141. package/dist/commands/session.d.ts.map +1 -1
  142. package/dist/commands/session.js +2 -2
  143. package/dist/commands/session.js.map +1 -1
  144. package/dist/commands/sync.d.ts.map +1 -1
  145. package/dist/commands/sync.js +28 -4
  146. package/dist/commands/sync.js.map +1 -1
  147. package/dist/commands/tags.d.ts.map +1 -1
  148. package/dist/commands/tags.js.map +1 -1
  149. package/dist/commands/words.js +1 -1
  150. package/dist/commands/words.js.map +1 -1
  151. package/dist/config.d.ts +2 -0
  152. package/dist/config.d.ts.map +1 -1
  153. package/dist/config.js +7 -0
  154. package/dist/config.js.map +1 -1
  155. package/dist/identity.d.ts.map +1 -1
  156. package/dist/identity.js +1 -0
  157. package/dist/identity.js.map +1 -1
  158. package/dist/mail/imap/account.d.ts.map +1 -1
  159. package/dist/mail/imap/account.js +2 -1
  160. package/dist/mail/imap/account.js.map +1 -1
  161. package/dist/mail/send-as.d.ts +21 -0
  162. package/dist/mail/send-as.d.ts.map +1 -0
  163. package/dist/mail/send-as.js +66 -0
  164. package/dist/mail/send-as.js.map +1 -0
  165. package/dist/mail/send.d.ts +2 -0
  166. package/dist/mail/send.d.ts.map +1 -1
  167. package/dist/mail/send.js +3 -1
  168. package/dist/mail/send.js.map +1 -1
  169. package/dist/profile.js +1 -1
  170. package/dist/profile.js.map +1 -1
  171. package/dist/program.d.ts.map +1 -1
  172. package/dist/program.js +4 -4
  173. package/dist/program.js.map +1 -1
  174. package/dist/reasons.d.ts.map +1 -1
  175. package/dist/reasons.js +0 -1
  176. package/dist/reasons.js.map +1 -1
  177. package/dist/version.d.ts +1 -1
  178. package/dist/version.js +1 -1
  179. package/package.json +3 -3
  180. package/dist/bundle/agent-MW7YWUIY.js +0 -39
  181. package/dist/bundle/chunk-5TIWO6AR.js +0 -787
  182. package/dist/bundle/chunk-6LJIENVT.js +0 -29
  183. package/dist/bundle/chunk-6TT62IUW.js +0 -1264
  184. package/dist/bundle/chunk-NCY55XIT.js +0 -721
  185. package/dist/bundle/chunk-U67XMAEE.js +0 -72
  186. package/dist/bundle/command-contract-WFTIRPL5.js +0 -39
  187. package/dist/bundle/first-screen-DCTHI4NQ.js +0 -39
  188. package/dist/bundle/meeting-combined-ITU7SZ7E.js +0 -24
  189. package/dist/bundle/server-UVYFU2JN.js +0 -84
  190. package/dist/bundle/store-maintenance-command-Y5XTO47X.js +0 -71
  191. package/dist/bundle/surface-3XKM3MQ2.js +0 -70
@@ -2,16 +2,16 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  alive
5
- } from "./chunk-3NOXZZJV.js";
5
+ } from "./chunk-T3W4V4A6.js";
6
6
  import {
7
7
  resolvePaths,
8
8
  writeSecurely
9
- } from "./chunk-WZFGZBGD.js";
9
+ } from "./chunk-2YO3PLOE.js";
10
10
  import {
11
11
  __name
12
12
  } from "./chunk-ZVVMGPBJ.js";
13
13
 
14
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/background/lock.js
14
+ // 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/background/lock.js
15
15
  import { existsSync, linkSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
16
16
  import { dirname, join } from "node:path";
17
17
  var lockPath = /* @__PURE__ */ __name((app, profile, env) => join(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "serve", `${profile}.lock`), "lockPath");
@@ -53,6 +53,17 @@ var releaseLock = /* @__PURE__ */ __name((path, pid = process.pid) => {
53
53
  if (readLock(path)?.pid === pid)
54
54
  rmSync(path, { force: true });
55
55
  }, "releaseLock");
56
+ var currentPath = /* @__PURE__ */ __name((lock) => lock.replace(/\.lock$/, ".current"), "currentPath");
57
+ var markCurrent = /* @__PURE__ */ __name((lock, at = /* @__PURE__ */ new Date()) => writeSecurely(currentPath(lock), `${JSON.stringify({ at: at.toISOString() })}
58
+ `, 384), "markCurrent");
59
+ var readCurrent = /* @__PURE__ */ __name((lock) => {
60
+ try {
61
+ const { at } = JSON.parse(readFileSync(currentPath(lock), "utf8"));
62
+ return typeof at === "string" ? at : void 0;
63
+ } catch {
64
+ return void 0;
65
+ }
66
+ }, "readCurrent");
56
67
  var servingProfiles = /* @__PURE__ */ __name((app, env) => {
57
68
  const dir = dirname(lockPath(app, "default", env));
58
69
  if (!existsSync(dir))
@@ -69,5 +80,7 @@ export {
69
80
  holdLock,
70
81
  takeLock,
71
82
  releaseLock,
83
+ markCurrent,
84
+ readCurrent,
72
85
  servingProfiles
73
86
  };
@@ -2,11 +2,11 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  throughWrapper
5
- } from "./chunk-KTVQIKU5.js";
5
+ } from "./chunk-LB2CF3GG.js";
6
6
  import {
7
7
  environmentOf,
8
8
  readOnlyLockOf
9
- } from "./chunk-ROK7Z5LQ.js";
9
+ } from "./chunk-BA5B5ZF4.js";
10
10
  import {
11
11
  array,
12
12
  boolean,
@@ -16,15 +16,15 @@ import {
16
16
  safeParse,
17
17
  strictObject,
18
18
  string
19
- } from "./chunk-C3JSQ7UJ.js";
19
+ } from "./chunk-KP5JDYY6.js";
20
20
  import {
21
21
  CliError
22
- } from "./chunk-PMGAU6AP.js";
22
+ } from "./chunk-S6JG4YUH.js";
23
23
  import {
24
24
  __name
25
25
  } from "./chunk-ZVVMGPBJ.js";
26
26
 
27
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/background/relay.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/background/relay.js
28
28
  import { createHash } from "node:crypto";
29
29
  import { chmodSync, lstatSync, mkdirSync, rmSync } from "node:fs";
30
30
  import { createConnection, createServer } from "node:net";
@@ -245,7 +245,7 @@ var relayCommand = /* @__PURE__ */ __name((path, request, options) => new Promis
245
245
  }, () => finish({ error: stopped() }));
246
246
  }), "relayCommand");
247
247
 
248
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-relay.js
248
+ // 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/serve-relay.js
249
249
  var lentConnection = /* @__PURE__ */ __name((connection, watchers) => throughWrapper(connection, {
250
250
  close: /* @__PURE__ */ __name(async () => {
251
251
  }, "close"),
@@ -2,7 +2,7 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  defineReasons
5
- } from "./chunk-C3JSQ7UJ.js";
5
+ } from "./chunk-KP5JDYY6.js";
6
6
 
7
7
  // dist/reasons.js
8
8
  var ENTRIES = [
@@ -44,7 +44,6 @@ var ENTRIES = [
44
44
  ["mail.original-gone", "not_found", "the message is not where the store last saw it on the server"],
45
45
  ["mail.others-for-agent", "permission_error", "over MCP the profile mails only its owner"],
46
46
  ["mail.no-submission", "configuration_error", "the profile names no submission server"],
47
- ["mail.config-unreadable", "configuration_error", "the config file cannot be read"],
48
47
  ["mail.profile-exists", "validation_error", "a profile of this name already exists"],
49
48
  ["mail.server-unknown", "not_found", "no mail server was found for the address's domain"],
50
49
  ["mail.export-other", "validation_error", "the export folder holds an export of another format or mailbox"],
@@ -58,7 +57,7 @@ var ENTRIES = [
58
57
  var REASONS = defineReasons(ENTRIES.map(([reason, code, message]) => ({ reason, code, message, details: [] })));
59
58
 
60
59
  // dist/version.js
61
- var VERSION = "0.36.0";
60
+ var VERSION = "0.38.0";
62
61
 
63
62
  // dist/identity.js
64
63
  var PACKAGE = "@wirecat/mail-cli";
@@ -84,6 +83,7 @@ var DESKTOP = {
84
83
  "accounts.google.com",
85
84
  "oauth2.googleapis.com",
86
85
  "openidconnect.googleapis.com",
86
+ "gmail.googleapis.com",
87
87
  "autoconfig.thunderbird.net",
88
88
  "data.iana.org",
89
89
  "imap.yandex.com",
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
7
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/store/normalize.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/store/normalize.js
8
8
  var NORMALIZER_VERSION = 1;
9
9
  var fold = /* @__PURE__ */ __name((text) => text.normalize("NFKD").replace(new RegExp("\\p{M}+", "gu"), "").normalize("NFC").toLowerCase(), "fold");
10
10
  var normalize = /* @__PURE__ */ __name((text) => fold(text).replace(new RegExp("\\p{Cc}", "gu"), " ").replace(/\s+/gu, " ").trim(), "normalize");
@@ -0,0 +1,29 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ __name
5
+ } from "./chunk-ZVVMGPBJ.js";
6
+
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/cli/commander-internals.js
8
+ var internals = /* @__PURE__ */ __name((command) => command, "internals");
9
+ var hasOwnAction = /* @__PURE__ */ __name((command) => internals(command)._actionHandler != null, "hasOwnAction");
10
+ var isHidden = /* @__PURE__ */ __name((command) => internals(command)._hidden === true, "isHidden");
11
+ var hide = /* @__PURE__ */ __name((command) => {
12
+ internals(command)._hidden = true;
13
+ }, "hide");
14
+ var helpOptionOf = /* @__PURE__ */ __name((command) => internals(command)._getHelpOption(), "helpOptionOf");
15
+ var rejectUnknownOption = /* @__PURE__ */ __name((command, flag) => internals(command).unknownOption(flag), "rejectUnknownOption");
16
+ var onUnknownOption = /* @__PURE__ */ __name((command, handle) => {
17
+ const own = internals(command);
18
+ const fallback = own.unknownOption.bind(command);
19
+ own.unknownOption = (flag) => handle(flag, fallback);
20
+ }, "onUnknownOption");
21
+
22
+ export {
23
+ hasOwnAction,
24
+ isHidden,
25
+ hide,
26
+ helpOptionOf,
27
+ rejectUnknownOption,
28
+ onUnknownOption
29
+ };
@@ -2,33 +2,33 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  stdinFieldOf
5
- } from "./chunk-774VG5WZ.js";
5
+ } from "./chunk-GZ7WBU5Y.js";
6
6
  import {
7
7
  commandPathOf
8
- } from "./chunk-42XY6D5C.js";
8
+ } from "./chunk-EDWY73H7.js";
9
9
  import {
10
10
  commandServerRequest,
11
11
  metaOf
12
- } from "./chunk-ROK7Z5LQ.js";
12
+ } from "./chunk-BA5B5ZF4.js";
13
13
  import {
14
14
  errorObjectOf,
15
15
  renderError
16
- } from "./chunk-C3JSQ7UJ.js";
16
+ } from "./chunk-KP5JDYY6.js";
17
17
  import {
18
18
  CliError
19
- } from "./chunk-PMGAU6AP.js";
19
+ } from "./chunk-S6JG4YUH.js";
20
20
  import {
21
21
  __name
22
22
  } from "./chunk-ZVVMGPBJ.js";
23
23
 
24
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/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@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/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@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/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,377 @@
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/deals.js
105
+ var DEAL_KINDS = ["deal", "lead"];
106
+ var DEAL_STATUSES = ["open", "won", "lost"];
107
+ var STAGE_OUTCOMES = DEAL_STATUSES;
108
+ var DEAL_ROLES = ["owner", "contact", "decision-maker", "influencer"];
109
+ var dealLine = /* @__PURE__ */ __name((deal) => {
110
+ const money = deal.amount === null || deal.currency === null ? "" : `, ${moneyLabel(deal.amount, deal.currency)}`;
111
+ return `${deal.title} \xB7 ${deal.stage}${money}${deal.status === "open" ? "" : ` (${deal.status})`}`;
112
+ }, "dealLine");
113
+
114
+ // 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
115
+ var INVOICE_DIRECTIONS = ["receivable", "payable"];
116
+ var INVOICE_STATUSES = ["draft", "issued", "partly_paid", "paid", "void"];
117
+ var MONEY_DIRECTIONS = ["in", "out"];
118
+ var FINANCE_REVIEWS = ["proposed", "confirmed", "rejected"];
119
+ var settledStatus = /* @__PURE__ */ __name((current, total, paid) => {
120
+ if (current === "draft" || current === "void")
121
+ return current;
122
+ if (paid <= 0)
123
+ return "issued";
124
+ return paid < total ? "partly_paid" : "paid";
125
+ }, "settledStatus");
126
+ var dayMonth = /* @__PURE__ */ __name((date) => date === null ? null : `${date.slice(8, 10)}.${date.slice(5, 7)}`, "dayMonth");
127
+ var notes = /* @__PURE__ */ __name((...words) => {
128
+ const kept = words.filter((word) => word !== null);
129
+ return kept.length === 0 ? "" : ` (${kept.join(", ")})`;
130
+ }, "notes");
131
+ var invoiceLine = /* @__PURE__ */ __name((invoice) => {
132
+ const party = invoice.counterpartyName === null ? "" : `${invoice.direction === "receivable" ? " to" : " from"} ${invoice.counterpartyName}`;
133
+ const due = invoice.dueDate === null ? "" : `, due ${dayMonth(invoice.dueDate)}`;
134
+ return `${invoice.number ?? `#${invoice.id}`} \xB7 ${moneyLabel(invoice.total, invoice.currency)}${party}${due}` + notes(invoice.status.replace("_", " "), invoice.review === "confirmed" ? null : invoice.review);
135
+ }, "invoiceLine");
136
+ var paymentLine = /* @__PURE__ */ __name((payment) => {
137
+ const party = payment.partyName === null ? "" : `${payment.direction === "in" ? " from" : " to"} ${payment.partyName}`;
138
+ return `${moneyLabel(payment.amount, payment.currency)}${party}, ${dayMonth(payment.date)}` + notes(payment.review === "confirmed" ? null : payment.review);
139
+ }, "paymentLine");
140
+ var invoiceTitle = /* @__PURE__ */ __name((invoice) => `Invoice ${invoiceLine(invoice)}`, "invoiceTitle");
141
+ var paymentEntryTitle = /* @__PURE__ */ __name((payment) => `Payment \xB7 ${paymentLine(payment)}`, "paymentEntryTitle");
142
+
143
+ // 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
144
+ var ORDER_STATUSES = ["placed", "shipped", "delivered", "cancelled", "returned"];
145
+ var ORDER_PURPOSES = ["personal", "business", "client", "other"];
146
+ var orderLine = /* @__PURE__ */ __name((order) => {
147
+ const party = order.direction === "sale" && order.customerName !== null ? `to ${order.customerName}` : order.supplierName;
148
+ const money = order.total === null || order.currency === null ? "" : `, ${moneyLabel(order.total, order.currency)}`;
149
+ const notes2 = [order.status, order.review === "confirmed" ? null : order.review].filter(Boolean).join(", ");
150
+ return `${order.number ?? `#${order.id}`} \xB7 ${party}${money} (${notes2})`;
151
+ }, "orderLine");
152
+ var orderTitle = /* @__PURE__ */ __name((order) => `Order ${orderLine(order)}`, "orderTitle");
153
+
154
+ // 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
155
+ var ORGANIZATION_ROLES = [
156
+ "employee",
157
+ "contractor",
158
+ "founder",
159
+ "owner",
160
+ "manager",
161
+ "adviser",
162
+ "contact"
163
+ ];
164
+ var PROJECT_ROLES = ["owner", "manager", "contributor", "client-contact", "approver"];
165
+ var CONTRACT_ROLES = ["customer", "supplier", "signatory", "guarantor"];
166
+ var RELATED_ROLES = ["colleague", "adviser", "investor", "mentor", "family", "friend"];
167
+ var ENGAGEMENT_LEVELS = ["none", "low", "medium", "high"];
168
+ var isEngagement = /* @__PURE__ */ __name((value) => typeof value === "string" && ENGAGEMENT_LEVELS.includes(value), "isEngagement");
169
+ var checkEngagement = /* @__PURE__ */ __name((kind, from, to, level) => {
170
+ if (kind !== "member-of" || from !== "person" || to !== "project")
171
+ throw new CliError("validation_error", "an engagement level is set only on a person's member-of a project", {
172
+ reason: "relationship.engagement-ends"
173
+ });
174
+ if (!isEngagement(level))
175
+ throw new CliError("validation_error", `an engagement level is one of ${ENGAGEMENT_LEVELS.join(", ")}`, {
176
+ reason: "relationship.engagement-unknown"
177
+ });
178
+ return level;
179
+ }, "checkEngagement");
180
+ var ENGAGEMENT_ORDER = { high: 0, medium: 1, unknown: 2, low: 3, none: 4 };
181
+ var engagementRank = /* @__PURE__ */ __name((level) => ENGAGEMENT_ORDER[level ?? "unknown"], "engagementRank");
182
+ var byEngagement = /* @__PURE__ */ __name((items) => items.map((item, index) => ({ item, index })).sort((a, b) => engagementRank(a.item.engagement) - engagementRank(b.item.engagement) || a.index - b.index).map(({ item }) => item), "byEngagement");
183
+ var RELATIONS = {
184
+ "member-of": {
185
+ from: ["person", "organization", "project", "chat", "email_thread"],
186
+ to: ["organization", "project"],
187
+ roles: { to: { organization: ORGANIZATION_ROLES, project: PROJECT_ROLES } }
188
+ },
189
+ "reports-to": { from: ["person"], to: ["person"], inverse: "manages" },
190
+ "customer-of": { from: ["person", "organization"], to: ["organization"], inverse: "supplier of" },
191
+ "partner-of": { from: ["organization"], to: ["organization"], symmetric: true },
192
+ "related-to": {
193
+ from: ["person", "organization", "project", "task", "deal", "lead", "contract"],
194
+ to: ["person", "organization", "project", "task"],
195
+ roles: { from: { deal: DEAL_ROLES, lead: DEAL_ROLES, contract: CONTRACT_ROLES } }
196
+ }
197
+ };
198
+ var RELATION_KINDS = Object.keys(RELATIONS);
199
+ var specOf = /* @__PURE__ */ __name((kind) => Object.hasOwn(RELATIONS, kind) ? RELATIONS[kind] : void 0, "specOf");
200
+ var isRelationKind = /* @__PURE__ */ __name((kind) => specOf(kind) !== void 0, "isRelationKind");
201
+ var memberOnly = /* @__PURE__ */ __name((type) => type === "chat" || type === "email_thread", "memberOnly");
202
+ var partyOnly = /* @__PURE__ */ __name((from, to) => from === "contract" && to !== "person" && to !== "organization", "partyOnly");
203
+ var checkEnds = /* @__PURE__ */ __name((kind, from, to) => {
204
+ const spec = specOf(kind);
205
+ if (!spec)
206
+ throw new CliError("validation_error", `a relationship's kind is one of ${RELATION_KINDS.join(", ")}`);
207
+ if (memberOnly(from) && (kind !== "member-of" || to !== "project"))
208
+ throw new CliError("validation_error", `a ${from === "chat" ? "chat" : "mail thread"} is related only as member-of a project`);
209
+ if (partyOnly(from, to))
210
+ throw new CliError("validation_error", "a contract is related only to a person or an organization");
211
+ if (!spec.from.includes(from) || !spec.to.includes(to))
212
+ throw new CliError("validation_error", `${kind} joins ${spec.from.join(", ")} to ${spec.to.join(", ")}, not ${from} to ${to}`);
213
+ return spec;
214
+ }, "checkEnds");
215
+ var isParty = /* @__PURE__ */ __name((type) => type === "person" || type === "organization", "isParty");
216
+ var rolesOf = /* @__PURE__ */ __name((kind, from, to) => {
217
+ const spec = specOf(kind);
218
+ if (kind === "member-of" && from !== "person")
219
+ return void 0;
220
+ return spec?.roles?.from?.[from] ?? spec?.roles?.to?.[to];
221
+ }, "rolesOf");
222
+ var ROLE_LISTS = {
223
+ organization: ORGANIZATION_ROLES,
224
+ project: PROJECT_ROLES,
225
+ deal: DEAL_ROLES,
226
+ contract: CONTRACT_ROLES,
227
+ related: RELATED_ROLES
228
+ };
229
+ var roleListOf = /* @__PURE__ */ __name((kind, from, to) => {
230
+ if (kind === "related-to" && isParty(from) && isParty(to))
231
+ return "related";
232
+ const roles = rolesOf(kind, from, to);
233
+ return Object.keys(ROLE_LISTS).find((list) => ROLE_LISTS[list] === roles);
234
+ }, "roleListOf");
235
+ var checkRole = /* @__PURE__ */ __name((kind, from, to, role, extra = []) => {
236
+ const roles = rolesOf(kind, from, to)?.concat(extra);
237
+ if (roles && !roles.includes(role))
238
+ throw new CliError("validation_error", `a ${from}'s role on ${kind} ${to} is one of ${roles.join(", ")}`, {
239
+ reason: "relationship.role-unknown"
240
+ });
241
+ return role;
242
+ }, "checkRole");
243
+ var isSymmetric = /* @__PURE__ */ __name((kind) => specOf(kind)?.symmetric === true, "isSymmetric");
244
+ var inverseOf = /* @__PURE__ */ __name((kind) => specOf(kind)?.symmetric ? kind : specOf(kind)?.inverse ?? null, "inverseOf");
245
+ var STANDINGS = ["confirmed", "reported", "proposed", "ended"];
246
+ var standingOf = /* @__PURE__ */ __name((link, now) => {
247
+ if (link.endsAt != null && link.endsAt <= now)
248
+ return "ended";
249
+ if (link.confirmed)
250
+ return "confirmed";
251
+ if (link.deletedAt != null)
252
+ return "ended";
253
+ return link.accountId != null ? "reported" : "proposed";
254
+ }, "standingOf");
255
+ var isUsable = /* @__PURE__ */ __name((standing) => standing === "confirmed" || standing === "reported", "isUsable");
256
+ var usableLink = /* @__PURE__ */ __name((link, now) => isUsable(standingOf(link, now)), "usableLink");
257
+ var KEYED = "kind IN ('member-of', 'related-to', 'reports-to', 'customer-of', 'partner-of') AND to_id IS NOT NULL";
258
+ 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");
259
+ 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");
260
+
261
+ // 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
262
+ var CRM_KINDS = ["organization", "person", "deal", "lead"];
263
+ var CRM_ACTIVITY_KINDS = ["call", "email", "meeting", "todo", "task", "comment", "other"];
264
+ var isCrmUserId = /* @__PURE__ */ __name((id) => /^\d{1,20}$/.test(id), "isCrmUserId");
265
+ var normalCrmUserId = /* @__PURE__ */ __name((id) => {
266
+ const text = id.trim();
267
+ return /^\d+$/.test(text) ? text.replace(/^0+(?=\d)/, "") : text;
268
+ }, "normalCrmUserId");
269
+ var isItemKind = /* @__PURE__ */ __name((kind) => kind === "deal" || kind === "lead", "isItemKind");
270
+
271
+ // 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
272
+ var CATALOG_KINDS = ["product", "service"];
273
+ var BUSINESS_KINDS = ["invoice", "payment", "order", "contract", "subscription", "product", "wallet"];
274
+ var CONTRACT_KINDS = ["sale", "purchase", "service", "lease", "employment", "nda", "license", "other"];
275
+ var CONTRACT_STATUSES = ["draft", "active", "ended", "terminated"];
276
+ var PERIOD_UNITS = ["day", "week", "month", "year"];
277
+ var SUBSCRIPTION_STATUSES = ["trial", "active", "paused", "cancelled", "ended"];
278
+ var WALLET_KINDS = ["bank", "card", "cash", "wallet", "other"];
279
+ var TRANSACTION_STATUSES = ["pending", "booked"];
280
+ var ORDER_DIRECTIONS = ["purchase", "sale"];
281
+ var intervalOf = /* @__PURE__ */ __name((text, reason = "subscription.interval") => {
282
+ const match = typeof text === "string" ? /^(?:([1-9]\d{0,2})-)?(day|week|month|year)$/.exec(text.trim()) : null;
283
+ if (!match)
284
+ throw new CliError("validation_error", "an interval is a count and a unit, such as 1-month or 2-week", { reason });
285
+ return { count: match[1] === void 0 ? 1 : Number(match[1]), unit: match[2] };
286
+ }, "intervalOf");
287
+ var intervalText = /* @__PURE__ */ __name(({ count, unit }) => `${count}-${unit}`, "intervalText");
288
+ var priced = /* @__PURE__ */ __name((units, currency) => units === null || currency === null ? "" : `, ${moneyLabel(units, currency)}`, "priced");
289
+ var pending = /* @__PURE__ */ __name((review) => review === "confirmed" ? null : review, "pending");
290
+ var productLine = /* @__PURE__ */ __name((product) => {
291
+ const price = product.unitPrice === null || product.currency === null ? "" : moneyLabel(product.unitPrice, product.currency);
292
+ const per = price && product.unit !== null ? ` per ${product.unit}` : "";
293
+ return `${product.name}${price ? ` \xB7 ${price}${per}` : ""}${notes(product.kind, product.archived ? "archived" : null)}`;
294
+ }, "productLine");
295
+ var contractLine = /* @__PURE__ */ __name((contract) => `${contract.number ?? `#${contract.id}`} \xB7 ${contract.name}${priced(contract.value, contract.currency)}` + notes(contract.status, pending(contract.review)), "contractLine");
296
+ var subscriptionLine = /* @__PURE__ */ __name((subscription) => `${subscription.name}${priced(subscription.price, subscription.currency)} every ${intervalText(subscription.interval)}` + notes(subscription.status, pending(subscription.review)), "subscriptionLine");
297
+ var walletLine = /* @__PURE__ */ __name((wallet) => `${wallet.name} \xB7 ${wallet.kind}, ${wallet.currency}${wallet.numberHint === null ? "" : `, \u2026${wallet.numberHint}`}` + notes(wallet.closed ? "closed" : null), "walletLine");
298
+ 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");
299
+
300
+ export {
301
+ CURRENCY_SCALES,
302
+ parseDecimal,
303
+ formatDecimal,
304
+ currencyOf,
305
+ scaleOf,
306
+ minorUnits,
307
+ signedMinorUnits,
308
+ moneyOf,
309
+ moneyLabel,
310
+ quantityOf,
311
+ lineUnits,
312
+ DEAL_KINDS,
313
+ DEAL_STATUSES,
314
+ STAGE_OUTCOMES,
315
+ DEAL_ROLES,
316
+ dealLine,
317
+ INVOICE_DIRECTIONS,
318
+ INVOICE_STATUSES,
319
+ MONEY_DIRECTIONS,
320
+ FINANCE_REVIEWS,
321
+ settledStatus,
322
+ invoiceLine,
323
+ paymentLine,
324
+ invoiceTitle,
325
+ paymentEntryTitle,
326
+ ORDER_STATUSES,
327
+ ORDER_PURPOSES,
328
+ orderLine,
329
+ orderTitle,
330
+ ORGANIZATION_ROLES,
331
+ PROJECT_ROLES,
332
+ CONTRACT_ROLES,
333
+ RELATED_ROLES,
334
+ ENGAGEMENT_LEVELS,
335
+ isEngagement,
336
+ checkEngagement,
337
+ engagementRank,
338
+ byEngagement,
339
+ RELATIONS,
340
+ RELATION_KINDS,
341
+ isRelationKind,
342
+ checkEnds,
343
+ rolesOf,
344
+ ROLE_LISTS,
345
+ roleListOf,
346
+ checkRole,
347
+ isSymmetric,
348
+ inverseOf,
349
+ STANDINGS,
350
+ standingOf,
351
+ isUsable,
352
+ usableLink,
353
+ KEYED,
354
+ notOverriddenSql,
355
+ usableLinkSql,
356
+ CRM_KINDS,
357
+ CRM_ACTIVITY_KINDS,
358
+ isCrmUserId,
359
+ normalCrmUserId,
360
+ isItemKind,
361
+ CATALOG_KINDS,
362
+ BUSINESS_KINDS,
363
+ CONTRACT_KINDS,
364
+ CONTRACT_STATUSES,
365
+ PERIOD_UNITS,
366
+ SUBSCRIPTION_STATUSES,
367
+ WALLET_KINDS,
368
+ TRANSACTION_STATUSES,
369
+ ORDER_DIRECTIONS,
370
+ intervalOf,
371
+ intervalText,
372
+ productLine,
373
+ contractLine,
374
+ subscriptionLine,
375
+ walletLine,
376
+ transactionLine
377
+ };
@@ -4,14 +4,14 @@ import {
4
4
  readSharedSection,
5
5
  sharedConfigPath,
6
6
  writeSharedSection
7
- } from "./chunk-HH34WRQE.js";
7
+ } from "./chunk-XGVMQMTS.js";
8
8
  import {
9
9
  filesPresent,
10
10
  sharedModelsDirectory
11
- } from "./chunk-GCTHVCJU.js";
11
+ } from "./chunk-ZKVUAH5N.js";
12
12
  import {
13
13
  storePath
14
- } from "./chunk-VIDPFLFM.js";
14
+ } from "./chunk-2SQLHBDP.js";
15
15
  import {
16
16
  array,
17
17
  check,
@@ -32,15 +32,15 @@ import {
32
32
  string,
33
33
  trim,
34
34
  url
35
- } from "./chunk-C3JSQ7UJ.js";
35
+ } from "./chunk-KP5JDYY6.js";
36
36
  import {
37
37
  CliError
38
- } from "./chunk-PMGAU6AP.js";
38
+ } from "./chunk-S6JG4YUH.js";
39
39
  import {
40
40
  __name
41
41
  } from "./chunk-ZVVMGPBJ.js";
42
42
 
43
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/embeddings/models.js
43
+ // 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/embeddings/models.js
44
44
  import { existsSync } from "node:fs";
45
45
  import { join } from "node:path";
46
46
  var huggingFace = /* @__PURE__ */ __name((repository, commit) => (name) => `https://huggingface.co/${repository}/resolve/${commit}/${name}`, "huggingFace");