@wirecat/zoom-cli 0.63.0 → 0.65.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/README.md +3 -0
  2. package/dist/answer-entities.d.ts +13 -0
  3. package/dist/answer-entities.d.ts.map +1 -1
  4. package/dist/answer-entities.js +5 -0
  5. package/dist/answer-entities.js.map +1 -1
  6. package/dist/answers.d.ts +8 -0
  7. package/dist/answers.d.ts.map +1 -1
  8. package/dist/archive-import.d.ts +1 -1
  9. package/dist/archive-import.d.ts.map +1 -1
  10. package/dist/archive-import.js +2 -1
  11. package/dist/archive-import.js.map +1 -1
  12. package/dist/bin/zm.js +6 -2
  13. package/dist/bundle/{all-profiles-CGGNBINU.js → all-profiles-SKMLZJSY.js} +8 -8
  14. package/dist/bundle/answer-policy-BHDNSJWX.js +96 -0
  15. package/dist/bundle/{anthropic-KVWPIHFG.js → anthropic-TVHK7CY2.js} +4 -4
  16. package/dist/bundle/{app-server-NKKFBTQN.js → app-server-44ASFH47.js} +53 -52
  17. package/dist/bundle/{bun-XRO6XJHQ.js → bun-O4WHGL2F.js} +2 -2
  18. package/dist/bundle/{bun-sqlite-FWNCLOAR.js → bun-sqlite-NS32GMM4.js} +3 -3
  19. package/dist/bundle/{chunk-M6FCCVYZ.js → chunk-24F7JBLY.js} +72 -4
  20. package/dist/bundle/{chunk-4OQVRDTG.js → chunk-25IDWPEN.js} +166 -96
  21. package/dist/bundle/{chunk-QLQ7VVLK.js → chunk-266WOOB3.js} +4 -4
  22. package/dist/bundle/{chunk-ECXRRW7J.js → chunk-2H5SXK7K.js} +57 -27
  23. package/dist/bundle/{chunk-YI6ZNDPC.js → chunk-37PHGASE.js} +2 -2
  24. package/dist/bundle/{chunk-URJZK4GX.js → chunk-3CZIWGZ6.js} +1 -1
  25. package/dist/bundle/{chunk-6URISMGR.js → chunk-5NGOP4EZ.js} +125 -35
  26. package/dist/bundle/{chunk-IOUPXUFH.js → chunk-6CS7ETBK.js} +4496 -386
  27. package/dist/bundle/{chunk-FDCGTODC.js → chunk-7SQJCKR6.js} +1 -1
  28. package/dist/bundle/{chunk-EG7HC4EC.js → chunk-A6OA2EH2.js} +2 -2
  29. package/dist/bundle/{chunk-QUWMFBMS.js → chunk-AMMD6YCJ.js} +49 -11
  30. package/dist/bundle/chunk-BLT3LR3U.js +34 -0
  31. package/dist/bundle/{chunk-MI3JK6MW.js → chunk-BNXH73OU.js} +10 -10
  32. package/dist/bundle/{chunk-GOESXUJQ.js → chunk-BWRBALXG.js} +3 -3
  33. package/dist/bundle/{chunk-6SPWQCJF.js → chunk-C6BG57FA.js} +11 -11
  34. package/dist/bundle/{chunk-CXPHUOJR.js → chunk-CNEE6TPE.js} +26 -13
  35. package/dist/bundle/{chunk-RWG44LQD.js → chunk-CVCRQW3A.js} +35 -35
  36. package/dist/bundle/{chunk-FAOLCUKV.js → chunk-DNCKH7CO.js} +17 -17
  37. package/dist/bundle/{chunk-LTE6WH22.js → chunk-DYJXAY7Q.js} +26 -25
  38. package/dist/bundle/{chunk-IOCS5FXW.js → chunk-EA63UGWE.js} +2 -2
  39. package/dist/bundle/{chunk-5LMQTEU5.js → chunk-ERPRAYA7.js} +5 -5
  40. package/dist/bundle/{chunk-KMQUZ4YM.js → chunk-FYJL276J.js} +3 -3
  41. package/dist/bundle/{chunk-AMIIU3UZ.js → chunk-FYM27FCG.js} +32 -9
  42. package/dist/bundle/{chunk-NQCFUYC2.js → chunk-GBZF4IIP.js} +10 -9
  43. package/dist/bundle/{chunk-DIXC56OU.js → chunk-GEX4V5TM.js} +4 -4
  44. package/dist/bundle/{chunk-4OTXE6CF.js → chunk-GMTXCFI7.js} +683 -504
  45. package/dist/bundle/{chunk-TILW3EJY.js → chunk-GXCNCMUY.js} +2865 -924
  46. package/dist/bundle/{chunk-YJN4XYNA.js → chunk-H7762LDA.js} +2 -2
  47. package/dist/bundle/{chunk-JDJDVYGS.js → chunk-IPTI3Y2E.js} +6 -41
  48. package/dist/bundle/{chunk-SB47UAW2.js → chunk-JF7ZEUXU.js} +34 -26
  49. package/dist/bundle/{chunk-7AY3ADNV.js → chunk-K6ATTKQR.js} +13 -6
  50. package/dist/bundle/{chunk-6SK5SHCR.js → chunk-KYLS5QGC.js} +2 -2
  51. package/dist/bundle/{chunk-YF2PT5KA.js → chunk-KZE3G4ZT.js} +38 -36
  52. package/dist/bundle/{chunk-MIUPH3WA.js → chunk-LOL6JYYN.js} +211 -106
  53. package/dist/bundle/{chunk-UIPT6IAU.js → chunk-LPUFOWL3.js} +1 -1
  54. package/dist/bundle/{chunk-5NLFQ644.js → chunk-M6IDHQ7N.js} +6739 -4659
  55. package/dist/bundle/{chunk-M2WQWF3I.js → chunk-MH7AWCB4.js} +179 -50
  56. package/dist/bundle/{chunk-VFJ3MOIR.js → chunk-MIB5X2XW.js} +3 -3
  57. package/dist/bundle/{chunk-SLBMXXOW.js → chunk-MPKKIL3U.js} +15 -12
  58. package/dist/bundle/{chunk-BJPFWPKH.js → chunk-MRWIXUYT.js} +2 -2
  59. package/dist/bundle/{chunk-BNTAQADF.js → chunk-MZ6U6HNJ.js} +12 -3
  60. package/dist/bundle/{chunk-6R3GMSLR.js → chunk-NJSIHMAE.js} +2 -2
  61. package/dist/bundle/{chunk-5MYLM6SU.js → chunk-NNNEVWFF.js} +108 -41
  62. package/dist/bundle/{chunk-2LLNPNMB.js → chunk-NO24PJNW.js} +1 -1
  63. package/dist/bundle/{chunk-HIZQYFY3.js → chunk-OXUHTKO2.js} +8 -2
  64. package/dist/bundle/{chunk-3YBDRVOG.js → chunk-PV3UDPCI.js} +82 -6
  65. package/dist/bundle/{chunk-IK2OSV5C.js → chunk-QI7BZS2G.js} +8 -13
  66. package/dist/bundle/{chunk-2NAM2XQG.js → chunk-QLCYAQ66.js} +2 -2
  67. package/dist/bundle/{chunk-RUJBN7ZP.js → chunk-R5BAF5XE.js} +1 -1
  68. package/dist/bundle/{chunk-IR73ZZY6.js → chunk-RZLNHNSS.js} +8 -8
  69. package/dist/bundle/{chunk-TQFCPUIM.js → chunk-S4GDDO5S.js} +1 -1
  70. package/dist/bundle/{chunk-YFIUXE25.js → chunk-SQWRZZOQ.js} +3 -3
  71. package/dist/bundle/{chunk-EJFSS65P.js → chunk-T3KICUOK.js} +6 -6
  72. package/dist/bundle/{chunk-UD4FKICZ.js → chunk-TC7PD3LH.js} +4 -4
  73. package/dist/bundle/{chunk-YBMOFCY5.js → chunk-TUIEDVI6.js} +2 -2
  74. package/dist/bundle/{chunk-JBBZCTTF.js → chunk-U3ZUT557.js} +1 -1
  75. package/dist/bundle/{chunk-EOEDICIE.js → chunk-U4RVOSX3.js} +1 -1
  76. package/dist/bundle/{chunk-BPMKLWHV.js → chunk-U5ASRBBF.js} +6 -4
  77. package/dist/bundle/{chunk-7CNRZSAV.js → chunk-UKU6MYUI.js} +4 -4
  78. package/dist/bundle/{chunk-72S5TXFN.js → chunk-UMHJZWZU.js} +9 -9
  79. package/dist/bundle/{chunk-TZE6WXID.js → chunk-UPJXN2CO.js} +10651 -9814
  80. package/dist/bundle/{chunk-NVC4VQ2B.js → chunk-VH4F2EK4.js} +1 -1
  81. package/dist/bundle/{chunk-SPJJCD2A.js → chunk-VJTGYBJJ.js} +18 -13
  82. package/dist/bundle/{chunk-MLNC5N7H.js → chunk-VW2SW7ME.js} +3 -3
  83. package/dist/bundle/{chunk-Q4ZE2LXE.js → chunk-WLSF3GCC.js} +2 -2
  84. package/dist/bundle/{chunk-N3KQ7XND.js → chunk-XJQB47IL.js} +4 -4
  85. package/dist/bundle/{chunk-KM7Q67Z3.js → chunk-Y3EIK4XW.js} +1 -1
  86. package/dist/bundle/{chunk-7LQLJ7LW.js → chunk-Z5424QL6.js} +2 -2
  87. package/dist/bundle/{chunk-LXYC75D3.js → chunk-ZFNM3FNI.js} +199 -141
  88. package/dist/bundle/{chunk-D6FTCPXA.js → chunk-ZH743WNV.js} +41 -12
  89. package/dist/bundle/{chunk-XAXXEZZ5.js → chunk-ZOGYTDHG.js} +2 -2
  90. package/dist/bundle/{chunk-SEH7DBAM.js → chunk-ZREFYKUB.js} +7 -7
  91. package/dist/bundle/{chunk-2DPMYUWQ.js → chunk-ZXGRK44F.js} +14 -13
  92. package/dist/bundle/{cli-AHPIESAC.js → cli-FDO6CP6R.js} +124 -60
  93. package/dist/bundle/command-contract-O4FDXM4U.js +37 -0
  94. package/dist/bundle/config-UBHKZG3J.js +78 -0
  95. package/dist/bundle/{decode-ZU7WLMMV.js → decode-7SZI3TGZ.js} +3 -3
  96. package/dist/bundle/{dist-LTS7VI3S.js → dist-5GWUXW27.js} +18 -14
  97. package/dist/bundle/{echarts-YNGCOYHW.js → echarts-FMACRZQC.js} +2 -2
  98. package/dist/bundle/{embed-VWWOW7PP.js → embed-24YSXHLP.js} +4 -4
  99. package/dist/bundle/{embedder-T5GJC7M2.js → embedder-MEXN2TFB.js} +7 -7
  100. package/dist/bundle/{first-run-PX3SHPUU.js → first-run-OCVEJH63.js} +8 -8
  101. package/dist/bundle/first-screen-KJIU25MH.js +35 -0
  102. package/dist/bundle/{folders-VXMDFC2D.js → folders-DBAAMU26.js} +2 -2
  103. package/dist/bundle/{instructions-GJHHFV64.js → instructions-E5FXYCWF.js} +1 -1
  104. package/dist/bundle/{main-APVJXUJE.js → main-EIUCXXDW.js} +17 -16
  105. package/dist/bundle/{mcp-EMNFFY4N.js → mcp-FUSDPAOL.js} +2 -2
  106. package/dist/bundle/{meetings-GHYNIOHG.js → meetings-JDTRGXZJ.js} +16 -6
  107. package/dist/bundle/{node-GFOH6FKP.js → node-4SNKUPXT.js} +2 -2
  108. package/dist/bundle/{node-sqlite-QXKSPHTP.js → node-sqlite-O4BAODFR.js} +9 -3
  109. package/dist/bundle/{oauth-A6I2OMDD.js → oauth-3YLHXGUW.js} +5 -5
  110. package/dist/bundle/{open-TQKCU447.js → open-QGRMSNM2.js} +3 -2
  111. package/dist/bundle/{openai-XE3BJXOI.js → openai-7PSCSTH7.js} +9 -9
  112. package/dist/bundle/{output-file-FQNFCUKE.js → output-file-J26UQKRA.js} +3 -3
  113. package/dist/bundle/{process-XVDX4SPD.js → process-HQZOTT6U.js} +1 -1
  114. package/dist/bundle/{program-QRKEXYDG.js → program-47DT7SHE.js} +75 -75
  115. package/dist/bundle/{prompt-ISYG5RWM.js → prompt-IUD7HCDC.js} +3 -3
  116. package/dist/bundle/{recognize-KENPECLZ.js → recognize-DMJJHHXF.js} +2 -2
  117. package/dist/bundle/{remote-ZP5XTDCC.js → remote-5WFSOVVB.js} +5 -5
  118. package/dist/bundle/{rerank-SG653RHT.js → rerank-UKQ65ECH.js} +5 -5
  119. package/dist/bundle/{run-log-HYKGQ42E.js → run-log-UGYL6NW2.js} +53 -53
  120. package/dist/bundle/{serve-6UJCZD7Z.js → serve-WAOSED3I.js} +9 -8
  121. package/dist/bundle/server-HAXN772R.js +66 -0
  122. package/dist/bundle/{server-ZAYEDPFR.js → server-NWZFNXC5.js} +42 -42
  123. package/dist/bundle/{services-KMH7XZPY.js → services-VPANRE72.js} +101 -28
  124. package/dist/bundle/{speech-LINBLG5E.js → speech-O6UNUDRW.js} +11 -11
  125. package/dist/bundle/{state-4RKZNHE7.js → state-BNE7I65A.js} +4 -4
  126. package/dist/bundle/{store-253N7NUC.js → store-4IIVSCJ4.js} +56 -19
  127. package/dist/bundle/{store-JTBHRQZK.js → store-QQH4FJXJ.js} +16 -13
  128. package/dist/bundle/store-connection-PPEQK2K3.js +76 -0
  129. package/dist/bundle/store-maintenance-command-JZXCT6NY.js +56 -0
  130. package/dist/bundle/{streaming-YW64OKKQ.js → streaming-S4EZB6P2.js} +4 -4
  131. package/dist/bundle/{tokens-DPBC2P3I.js → tokens-VCXIH7WZ.js} +4 -4
  132. package/dist/bundle/zm.js +1 -1
  133. package/dist/local-transcription.d.ts.map +1 -1
  134. package/dist/local-transcription.js +1 -0
  135. package/dist/local-transcription.js.map +1 -1
  136. package/dist/version.d.ts +1 -1
  137. package/dist/version.js +1 -1
  138. package/package.json +3 -3
  139. package/dist/bundle/answer-policy-V2KDPLDO.js +0 -96
  140. package/dist/bundle/chunk-2T7MUSDB.js +0 -3605
  141. package/dist/bundle/command-contract-HVLI3OKU.js +0 -38
  142. package/dist/bundle/config-3SFEGYZO.js +0 -78
  143. package/dist/bundle/first-screen-RAPEZG57.js +0 -36
  144. package/dist/bundle/server-AXE37E6Q.js +0 -66
  145. package/dist/bundle/store-connection-ID2ETC7F.js +0 -76
  146. package/dist/bundle/store-maintenance-command-XRNECVDU.js +0 -55
  147. /package/dist/bundle/{chunk-NPGVOZVK.js → chunk-NUN6OGOV.js} +0 -0
@@ -27,8 +27,9 @@ import {
27
27
  } from "./chunk-5D4AEUVA.js";
28
28
  import {
29
29
  agentOf,
30
- clientHash
31
- } from "./chunk-NQCFUYC2.js";
30
+ clientHash,
31
+ currentCaller
32
+ } from "./chunk-GBZF4IIP.js";
32
33
  import {
33
34
  __name
34
35
  } from "./chunk-ZVVMGPBJ.js";
@@ -540,7 +541,14 @@ function toError(value) {
540
541
  }
541
542
  __name(toError, "toError");
542
543
 
543
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/mcp/caller.js
544
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/mcp/caller.js
545
+ var callingAgent = /* @__PURE__ */ __name((fallback, caller = currentCaller()) => {
546
+ const client = caller?.agent?.client?.name;
547
+ if (client && client !== "unknown")
548
+ return client;
549
+ const kind = caller?.agent?.kind;
550
+ return kind && kind !== "mcp-client" ? kind : fallback;
551
+ }, "callingAgent");
544
552
  var CALLER_META_KEY = "wirecat.dev/caller";
545
553
  var PROXY_CLIENT_NAME = "all-profiles";
546
554
  var NAME = /^[\w .@()/+-]{1,64}$/;
@@ -624,6 +632,7 @@ var passedOn = /* @__PURE__ */ __name((value, tool) => {
624
632
  export {
625
633
  StdioServerTransport,
626
634
  serveStdio,
635
+ callingAgent,
627
636
  CALLER_META_KEY,
628
637
  PROXY_CLIENT_NAME,
629
638
  callerOf
@@ -2,7 +2,7 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  CliError
5
- } from "./chunk-SB47UAW2.js";
5
+ } from "./chunk-JF7ZEUXU.js";
6
6
  import {
7
7
  importFrom
8
8
  } from "./chunk-Y5E2WNWB.js";
@@ -10,7 +10,7 @@ import {
10
10
  __name
11
11
  } from "./chunk-ZVVMGPBJ.js";
12
12
 
13
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/store/vector-extension.js
13
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/store/vector-extension.js
14
14
  import { readFileSync } from "node:fs";
15
15
  var musl = /* @__PURE__ */ __name(() => {
16
16
  if (process.platform !== "linux")
@@ -6,24 +6,23 @@ import {
6
6
  agentArguments,
7
7
  agentJson,
8
8
  commandAvailability
9
- } from "./chunk-SPJJCD2A.js";
9
+ } from "./chunk-VJTGYBJJ.js";
10
10
  import {
11
11
  callerOf
12
- } from "./chunk-BNTAQADF.js";
12
+ } from "./chunk-MZ6U6HNJ.js";
13
13
  import {
14
+ QUERY_ARGUMENT,
14
15
  lentConnection,
15
16
  refuseLacking
16
- } from "./chunk-ECXRRW7J.js";
17
+ } from "./chunk-2H5SXK7K.js";
17
18
  import {
18
19
  onlineDeps,
19
20
  servicesFor,
20
21
  storeModeDeps
21
- } from "./chunk-5NLFQ644.js";
22
- import {
23
- ENTITIES
24
- } from "./chunk-2T7MUSDB.js";
22
+ } from "./chunk-M6IDHQ7N.js";
25
23
  import {
26
24
  DEFAULT_OUTPUT_BYTES,
25
+ ENTITIES,
27
26
  LOCAL_WRITE,
28
27
  REMOTE_WRITE,
29
28
  answerSchema,
@@ -35,33 +34,37 @@ import {
35
34
  refuseStoreChange,
36
35
  sealed,
37
36
  startRecording
38
- } from "./chunk-IOUPXUFH.js";
37
+ } from "./chunk-6CS7ETBK.js";
39
38
  import {
40
39
  currentCaller,
41
40
  keepsSuccess,
42
41
  runContextOf,
43
42
  withCaller
44
- } from "./chunk-NQCFUYC2.js";
43
+ } from "./chunk-GBZF4IIP.js";
45
44
  import {
46
45
  enclosingTraceId,
47
46
  inRun,
48
47
  newRunId,
49
48
  traceOf
50
- } from "./chunk-4OQVRDTG.js";
49
+ } from "./chunk-25IDWPEN.js";
51
50
  import {
52
51
  failureContext
53
- } from "./chunk-M6FCCVYZ.js";
52
+ } from "./chunk-24F7JBLY.js";
54
53
  import {
55
54
  authorityAllowed,
56
55
  botApiAllowed,
57
56
  keyForCommand,
58
57
  levelFor,
59
58
  readKeysForCommand
60
- } from "./chunk-HIZQYFY3.js";
59
+ } from "./chunk-OXUHTKO2.js";
61
60
  import {
62
61
  MAX_BUFFERED_INPUT
63
- } from "./chunk-6SK5SHCR.js";
62
+ } from "./chunk-KYLS5QGC.js";
63
+ import {
64
+ queryDescription
65
+ } from "./chunk-ZH743WNV.js";
64
66
  import {
67
+ COMPACT_FLAG,
65
68
  CliError,
66
69
  SNAKE_CASE,
67
70
  array,
@@ -102,15 +105,15 @@ import {
102
105
  unknown,
103
106
  word,
104
107
  writes
105
- } from "./chunk-SB47UAW2.js";
108
+ } from "./chunk-JF7ZEUXU.js";
106
109
  import {
107
110
  __name
108
111
  } from "./chunk-ZVVMGPBJ.js";
109
112
 
110
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/mcp/agent.js
113
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/mcp/agent.js
111
114
  import { Readable } from "node:stream";
112
115
 
113
- // node_modules/.pnpm/@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/lint.js
116
+ // node_modules/.pnpm/@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/lint.js
114
117
  var LINT_SEVERITIES = ["high", "medium", "low"];
115
118
  var lintRuleSchema = strictObject({
116
119
  id: word,
@@ -237,7 +240,7 @@ var overridesSchema = array(strictObject({
237
240
  review_after: pipe(string(), isoDate("a date, YYYY-MM-DD"))
238
241
  }));
239
242
 
240
- // node_modules/.pnpm/@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/audit.js
243
+ // node_modules/.pnpm/@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/audit.js
241
244
  var auditRuleSchema = strictObject({ id: word, severity: picklist(LINT_SEVERITIES), summary: text });
242
245
  var defineAuditRules = /* @__PURE__ */ __name((input) => parseRegistry("audit rules", array(auditRuleSchema), input, (rules) => duplicates(rules.map((rule) => rule.id)).map((id) => `"${id}" is listed twice`)), "defineAuditRules");
243
246
  var AUDIT_RULES = defineAuditRules([
@@ -297,18 +300,34 @@ var defineParityGroups = /* @__PURE__ */ __name((input) => parseRegistry("parity
297
300
  ...group.differences.filter((entry) => entry.absent && entry.expected).map((entry) => `${group.name}: "${entry.target}" has \`absent\`, which measures the values itself; drop \`expected\``)
298
301
  ])
299
302
  ]), "defineParityGroups");
303
+ var MEMO_HAS_NO_PROFILES = [
304
+ "mcp serve",
305
+ "mcp revoke",
306
+ "mcp server start",
307
+ "mcp server status",
308
+ "mcp server stop"
309
+ ].map((path) => ({
310
+ rule: "same-path-contract",
311
+ target: `${path} --profiles`,
312
+ absent: "memo",
313
+ reason: "memo has no profiles: it reads other CLIs' stores and selects their accounts with --source and --account (https://github.com/WireCatLabs/cli-base/issues/390)"
314
+ }));
300
315
  var PARITY_GROUPS = defineParityGroups([
301
316
  { name: "messengers", members: ["tg", "max"], covers: "tree", differences: [] },
302
317
  {
303
318
  name: "all",
304
- members: ["tg", "max", "memo", "drive", "zm", "wa", "mail"],
319
+ members: ["tg", "max", "memo", "drive", "zm", "wa"],
305
320
  covers: ["commands", "doctor", "skill", "mcp", "upgrade", "search", "notes", "meetings"],
306
- differences: ["mcp serve", "mcp revoke", "mcp server start", "mcp server status", "mcp server stop"].map((path) => ({
307
- rule: "same-path-contract",
308
- target: `${path} --profiles`,
309
- absent: "memo",
310
- reason: "memo has no profiles: it reads other CLIs' stores and selects their accounts with --source and --account (https://github.com/WireCatLabs/cli-base/issues/390)"
311
- }))
321
+ differences: MEMO_HAS_NO_PROFILES
322
+ },
323
+ // mail's `search messages` is cli-core's mail search, not the messengers' command: --complete took their 20-odd
324
+ // differences as inherited (https://github.com/WireCatLabs/cli-base/issues/390). mail is compared everywhere else
325
+ // and moves back into "all" once its search is aligned with the messengers' or renamed.
326
+ {
327
+ name: "mail-shared",
328
+ members: ["tg", "max", "memo", "drive", "zm", "wa", "mail"],
329
+ covers: ["commands", "doctor", "skill", "mcp", "upgrade", "notes", "meetings"],
330
+ differences: MEMO_HAS_NO_PROFILES
312
331
  },
313
332
  // gcal is compared on what it already shares with every CLI; doctor, mcp, search and skill wait until the published
314
333
  // CLIs agree there (https://github.com/WireCatLabs/cli-base/issues/390), then gcal moves back into "all".
@@ -330,7 +349,7 @@ var REQUIRED_ROOTS = defineRequiredRoots([
330
349
  { path: ["upgrade"], meaning: "updates the CLI" }
331
350
  ]);
332
351
 
333
- // node_modules/.pnpm/@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/fields.js
352
+ // node_modules/.pnpm/@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/fields.js
334
353
  var fieldRuleSchema = strictObject({ id: word, rule: text });
335
354
  var defineFieldRules = /* @__PURE__ */ __name((input) => parseRegistry("output field rules", array(fieldRuleSchema), input, (rules) => duplicates(rules.map((rule) => rule.id)).map((id) => `"${id}" is listed twice`)), "defineFieldRules");
336
355
  var FIELD_RULES = defineFieldRules([
@@ -346,7 +365,7 @@ var FIELD_RULES = defineFieldRules([
346
365
  }
347
366
  ]);
348
367
 
349
- // node_modules/.pnpm/@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/identifiers.js
368
+ // node_modules/.pnpm/@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/identifiers.js
350
369
  var key = pipe(string(), regex(SNAKE_CASE, "a snake_case key"));
351
370
  var identifierSchema = strictObject({ key, meaning: text, replaces: optional(array(key)) });
352
371
  var defineIdentifiers = /* @__PURE__ */ __name((input) => parseRegistry("identifiers", array(identifierSchema), input, (identifiers) => {
@@ -368,7 +387,7 @@ var IDENTIFIERS = defineIdentifiers([
368
387
  { key: "trace_id", meaning: "the distributed trace a run belongs to, from `traceparent`" }
369
388
  ]);
370
389
 
371
- // node_modules/.pnpm/@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-calendar.js
390
+ // node_modules/.pnpm/@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-calendar.js
372
391
  var CALENDAR_FLAGS = [
373
392
  { name: "--end-time", value: "<time>", role: "value", type: "time", meaning: "when it ends" },
374
393
  {
@@ -442,7 +461,7 @@ var CALENDAR_FLAGS = [
442
461
  }
443
462
  ];
444
463
 
445
- // node_modules/.pnpm/@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-how.js
464
+ // node_modules/.pnpm/@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-how.js
446
465
  var HOW_FLAGS = [
447
466
  {
448
467
  name: "--limit",
@@ -529,6 +548,12 @@ var HOW_FLAGS = [
529
548
  type: "switch",
530
549
  meaning: "each item as its reference, title, time and excerpt only"
531
550
  },
551
+ {
552
+ name: COMPACT_FLAG,
553
+ role: "output",
554
+ type: "switch",
555
+ meaning: "one line per item, built from the same answer as --json, with its paging and next steps as # lines"
556
+ },
532
557
  {
533
558
  name: "--chart-kind",
534
559
  value: "<messages|active|membership>",
@@ -720,6 +745,7 @@ var HOW_FLAGS = [
720
745
  meaning: "refuse if what it names has changed since it was read",
721
746
  replaces: ["--expected"]
722
747
  },
748
+ { name: "--full-history", role: "mode", type: "switch", meaning: "keep a chat's whole history, past its limits" },
723
749
  {
724
750
  name: "--for-everyone",
725
751
  role: "mode",
@@ -1429,7 +1455,31 @@ var HOW_FLAGS = [
1429
1455
  }
1430
1456
  ];
1431
1457
 
1432
- // node_modules/.pnpm/@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-what.js
1458
+ // node_modules/.pnpm/@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-mail.js
1459
+ var MAIL_FLAGS = [
1460
+ {
1461
+ name: "--cc",
1462
+ value: "<address>",
1463
+ role: "value",
1464
+ type: "string",
1465
+ meaning: "an e-mail address that gets a copy; repeat it for more"
1466
+ },
1467
+ {
1468
+ name: "--bcc",
1469
+ value: "<address>",
1470
+ role: "value",
1471
+ type: "string",
1472
+ meaning: "an e-mail address that gets a blind copy; repeat it for more"
1473
+ },
1474
+ {
1475
+ name: "--reply-all",
1476
+ role: "value",
1477
+ type: "switch",
1478
+ meaning: "with --reply-to, an e-mail reply also goes to everyone the message went to"
1479
+ }
1480
+ ];
1481
+
1482
+ // node_modules/.pnpm/@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-what.js
1433
1483
  var WHAT_FLAGS = [
1434
1484
  {
1435
1485
  name: "--analysis-provider",
@@ -1874,7 +1924,14 @@ var WHAT_FLAGS = [
1874
1924
  meaning: "keep a token an operation returns only in this bot profile's keyring; never print it"
1875
1925
  },
1876
1926
  { name: "--task", value: "<id>", role: "target", type: "id", meaning: "a task, by id" },
1877
- { name: "--to", value: "<chat>", role: "target", type: "id", meaning: "the chat it goes to" },
1927
+ {
1928
+ name: "--to",
1929
+ value: "<chat>",
1930
+ role: "target",
1931
+ type: "id",
1932
+ otherValues: ["address"],
1933
+ meaning: "who it goes to: a chat in a messenger (<chat>), an e-mail address in mail (<address>, repeated for more)"
1934
+ },
1878
1935
  {
1879
1936
  name: "--topic-name",
1880
1937
  value: "<name>",
@@ -2324,7 +2381,8 @@ var WHAT_FLAGS = [
2324
2381
  value: "<ref>",
2325
2382
  role: "value",
2326
2383
  type: "string",
2327
- meaning: "what it is about, as a reference",
2384
+ otherValues: ["text"],
2385
+ meaning: "what it is about: a reference in a note or task (<ref>), the subject line in mail (<text>)",
2328
2386
  replaces: ["--about"]
2329
2387
  },
2330
2388
  {
@@ -2419,7 +2477,7 @@ var WHAT_FLAGS = [
2419
2477
  }
2420
2478
  ];
2421
2479
 
2422
- // node_modules/.pnpm/@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/vocabulary.js
2480
+ // node_modules/.pnpm/@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/vocabulary.js
2423
2481
  var FLAG_TYPES = [
2424
2482
  "switch",
2425
2483
  "count",
@@ -2461,6 +2519,11 @@ var flagSchema = strictObject({
2461
2519
  type: picklist(FLAG_TYPES),
2462
2520
  role: picklist(Object.keys(FLAG_ROLES)),
2463
2521
  meaning: text,
2522
+ /**
2523
+ * Value names a domain other than the main one gives the flag, such as mail's `--to <address>` beside the
2524
+ * messengers' `<chat>`. The meaning for each says which is which. `flag-two-meanings` accepts these and no others.
2525
+ */
2526
+ otherValues: optional(array(pipe(string(), regex(/^[a-z][a-z0-9-]*$/, "a value name such as address")))),
2464
2527
  unit: optional(text),
2465
2528
  /** Other names for the same flag, which `flag-synonym` refuses. */
2466
2529
  replaces: optional(array(pipe(string(), regex(/^--[a-z][a-z0-9]*(-[a-z0-9]+)*$/, "a long flag"))))
@@ -2570,6 +2633,7 @@ var verbs = [
2570
2633
  ["vote", "answer a poll"],
2571
2634
  ["answer", "reply to a button someone pressed under a bot's message"],
2572
2635
  ["respond", "answer an invitation: accept, tentatively accept or decline it"],
2636
+ ["remind", "tell the owner once about what starts soon: print it, or run the owner's own program for it"],
2573
2637
  ["press", "press a button under a bot's message; the bot sees who pressed it"],
2574
2638
  ["action", "show what a bot is doing in a chat, such as typing, for a few seconds"],
2575
2639
  ["watch", "follow new events as they come, and keep them"],
@@ -2624,6 +2688,7 @@ var collections = [
2624
2688
  ["chats", "conversations in a messenger"],
2625
2689
  ["contacts", "identities in a messenger's contact list"],
2626
2690
  ["messages", "posts in a messenger chat, or emails"],
2691
+ ["drafts", "e-mails saved in a mailbox's Drafts folder, written and not sent"],
2627
2692
  ["polls", "polls in a chat"],
2628
2693
  ["reactions", "reactions to a message"],
2629
2694
  ["recipients", "who a message goes to"],
@@ -2770,10 +2835,10 @@ var VOCABULARY = defineVocabulary({
2770
2835
  ],
2771
2836
  views: views.map(([entry, meaning]) => ({ word: entry, meaning })),
2772
2837
  roots: roots.map(([entry, meaning]) => ({ word: entry, meaning })),
2773
- flags: [...HOW_FLAGS, ...WHAT_FLAGS, ...CALENDAR_FLAGS]
2838
+ flags: [...HOW_FLAGS, ...WHAT_FLAGS, ...CALENDAR_FLAGS, ...MAIL_FLAGS]
2774
2839
  });
2775
2840
 
2776
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/mcp/agent.js
2841
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/mcp/agent.js
2777
2842
  var TYPES = new Map(VOCABULARY.flags.map((flag) => [flag.name, flag.type]));
2778
2843
  var snake = /* @__PURE__ */ __name((name) => name.replaceAll("|", "_or_").replace(/[^a-z0-9]+/gi, "_"), "snake");
2779
2844
  var longOf = /* @__PURE__ */ __name((option) => option.flags.match(/--[a-z0-9][a-z0-9-]*/)?.[0], "longOf");
@@ -2832,8 +2897,10 @@ var optionField = /* @__PURE__ */ __name((option, long, negated) => {
2832
2897
  }, "argv")
2833
2898
  };
2834
2899
  }, "optionField");
2835
- var argumentField = /* @__PURE__ */ __name((argument) => {
2836
- const one = argument.choices ? pipe(picklist(argument.choices), description(argument.description)) : text2(argument.description || argument.name);
2900
+ var argumentField = /* @__PURE__ */ __name((argument, query) => {
2901
+ const own = argument.description || argument.name;
2902
+ const about = query && argument.name === "query" ? own === QUERY_ARGUMENT ? queryDescription(query) : `${own}; ${queryDescription(query)}` : own;
2903
+ const one = argument.choices ? pipe(picklist(argument.choices), description(argument.description)) : text2(about);
2837
2904
  return {
2838
2905
  name: snake(argument.name),
2839
2906
  required: argument.required,
@@ -2859,7 +2926,7 @@ var stdinField = /* @__PURE__ */ __name(({ name, description: description2, json
2859
2926
  argv: /* @__PURE__ */ __name(() => [], "argv")
2860
2927
  }), "stdinField");
2861
2928
  var fieldsOf = /* @__PURE__ */ __name((info, { omit = [], offline = false, stdin }) => {
2862
- const fields = info.arguments.map(argumentField);
2929
+ const fields = info.arguments.map((argument) => argumentField(argument, info.query));
2863
2930
  const read = stdin?.(info.path);
2864
2931
  if (read)
2865
2932
  fields.push(stdinField(read));
@@ -2994,7 +3061,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
2994
3061
  }
2995
3062
  }, "runCommandForAgent");
2996
3063
 
2997
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/mcp/tool.js
3064
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/mcp/tool.js
2998
3065
  var limit = optional(pipe(number(), integer(), minValue(1), maxValue(100), description("how many")));
2999
3066
  var page = optional(pipe(number(), integer(), minValue(1), description("which page, from 1")));
3000
3067
  var message = pipe(
@@ -3108,7 +3175,7 @@ var entryRunner = /* @__PURE__ */ __name((registration) => {
3108
3175
  ...outcomeOf(result),
3109
3176
  startedAt,
3110
3177
  finishedAt: Date.now()
3111
- })?.catch(() => void 0);
3178
+ }, caller)?.catch(() => void 0);
3112
3179
  return result;
3113
3180
  };
3114
3181
  }, "entryRunner");
@@ -3253,7 +3320,7 @@ var failed = /* @__PURE__ */ __name((error, errors, effects) => {
3253
3320
  return mcpErrorResult(JSON.parse(agentJson(errorObjectOf(error, context))));
3254
3321
  }, "failed");
3255
3322
 
3256
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/mcp/surface.js
3323
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/mcp/surface.js
3257
3324
  import { randomUUID } from "node:crypto";
3258
3325
  var MATCHES = 8;
3259
3326
  var ANSWER = answerSchema();
@@ -3276,7 +3343,7 @@ var runnableOnly = /* @__PURE__ */ __name((result, offered) => {
3276
3343
  const body = result.structuredContent;
3277
3344
  if (result.isError || !Array.isArray(body?.next))
3278
3345
  return result;
3279
- const next = body.next.filter((step) => offered(step.command));
3346
+ const next = body.next.filter((step) => step.command === void 0 || offered(step.command));
3280
3347
  const { next: _, ...rest } = body;
3281
3348
  const kept = next.length > 0 ? { ...rest, next } : rest;
3282
3349
  return {
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
7
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/mcp/bot/instructions.js
7
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/mcp/bot/instructions.js
8
8
  var botInstructions = /* @__PURE__ */ __name(({ command, name, profile, writes, skill }) => [
9
9
  `The owner's ${name} bot "${profile}", through the official Bot API \u2014 not the owner's personal account. What it writes, people see as the bot.`,
10
10
  "Use these tools to read the chats this bot is in, find a message or a person, and \u2014 when the profile allows \u2014 write as the bot.",
@@ -2,12 +2,12 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  CliError
5
- } from "./chunk-SB47UAW2.js";
5
+ } from "./chunk-JF7ZEUXU.js";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-ZVVMGPBJ.js";
9
9
 
10
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/sends/permissions.js
10
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/sends/permissions.js
11
11
  var LEVELS = ["deny", "readonly", "ask", "allow"];
12
12
  var DANGEROUS = /* @__PURE__ */ new Set(["messages.delete", "bot.messages.delete", "topics.delete", "chats.delete", "chats.clear"]);
13
13
  var skipFlagFor = /* @__PURE__ */ __name((key) => DANGEROUS.has(key) ? "--allow-dangerous" : "--yes", "skipFlagFor");
@@ -153,6 +153,12 @@ var ACCOUNT_KEYS = {
153
153
  "chat-mark-unread": "chats.mark-unread",
154
154
  "message-star": "messages.star",
155
155
  "message-unstar": "messages.unstar",
156
+ // A mail CLI names its own key on every write; these only answer `keyForWrite` when one is left out.
157
+ "message-flag": "messages.update",
158
+ "message-move": "messages.move",
159
+ "message-copy": "messages.copy",
160
+ "message-delete": "messages.trash",
161
+ "message-restore": "messages.restore",
156
162
  privacy: "account.privacy.set"
157
163
  };
158
164
  var KIND_KEYS = {
@@ -2,7 +2,13 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  LEVELS
5
- } from "./chunk-HIZQYFY3.js";
5
+ } from "./chunk-OXUHTKO2.js";
6
+ import {
7
+ looksLikeReference,
8
+ parseReference,
9
+ providerLabel,
10
+ providerNamed
11
+ } from "./chunk-LOL6JYYN.js";
6
12
  import {
7
13
  CliError,
8
14
  array,
@@ -26,12 +32,72 @@ import {
26
32
  unknown,
27
33
  visibleControls,
28
34
  writeSecurely
29
- } from "./chunk-SB47UAW2.js";
35
+ } from "./chunk-JF7ZEUXU.js";
30
36
  import {
31
37
  __name
32
38
  } from "./chunk-ZVVMGPBJ.js";
33
39
 
34
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/resolve.js
40
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/domain/ref-arguments.js
41
+ var TAKES = {
42
+ chat: "a chat: chat:<provider>/<account>/<chat>, its id or its title",
43
+ message: "a message: msg:<provider>/<account>/<chat>/<message>, or a chat and the message's id"
44
+ };
45
+ var article = /* @__PURE__ */ __name((word) => /^[aeiou]/.test(word) ? "an" : "a", "article");
46
+ var wrongKind = /* @__PURE__ */ __name((text, kind, takes) => new CliError("validation_error", `${text} names ${article(kind)} ${kind}; this takes ${TAKES[takes]}`, {
47
+ reason: "ref.wrong-kind"
48
+ }), "wrongKind");
49
+ var wrongProvider = /* @__PURE__ */ __name((text, provider, kind) => {
50
+ const entry = providerNamed(provider);
51
+ const command = entry?.command;
52
+ const opens = kind === "entity" ? void 0 : entry?.opens?.[kind];
53
+ const how = command && opens ? `open it with ${command} <profile> ${opens} ${text}` : "open it with its own CLI";
54
+ const label = providerLabel(provider);
55
+ return new CliError("validation_error", `${text} is ${article(label.toLowerCase())} ${label} ${kind}; ${how}`, {
56
+ reason: "ref.wrong-provider"
57
+ });
58
+ }, "wrongProvider");
59
+ var chatReferenceOf = /* @__PURE__ */ __name((text, provider, takes = "chat") => {
60
+ const trimmed = text.trim();
61
+ if (!looksLikeReference(trimmed))
62
+ return void 0;
63
+ const reference = parseReference(trimmed);
64
+ if (reference.type !== "chat" && reference.type !== "message")
65
+ throw wrongKind(trimmed, reference.type, takes);
66
+ if (reference.provider !== provider)
67
+ throw wrongProvider(trimmed, reference.provider, reference.type);
68
+ const found = {
69
+ text: trimmed,
70
+ provider: reference.provider,
71
+ account: reference.account,
72
+ chat: reference.chat,
73
+ ...reference.type === "message" ? { message: reference.message } : {}
74
+ };
75
+ return found;
76
+ }, "chatReferenceOf");
77
+ var contactReferenceOf = /* @__PURE__ */ __name((text, provider) => {
78
+ const trimmed = text.trim();
79
+ if (!trimmed.startsWith("contact:"))
80
+ return void 0;
81
+ const reference = parseReference(trimmed);
82
+ if (reference.type !== "contact")
83
+ return void 0;
84
+ if (provider !== void 0 && reference.provider !== provider)
85
+ throw wrongProvider(trimmed, reference.provider, reference.type);
86
+ return reference.id;
87
+ }, "contactReferenceOf");
88
+ var wrongAccount = /* @__PURE__ */ __name((reference, scope, profiles) => {
89
+ const here = scope.account === void 0 ? "the account of this profile is not known yet" : `${scope.profile === void 0 ? "this profile" : `profile ${scope.profile}`} is account ${scope.account}`;
90
+ const others = profiles === void 0 ? "" : `. Profiles signed in to ${reference.account}: ${profiles.length > 0 ? profiles.join(", ") : "none here"}`;
91
+ return new CliError("validation_error", `${reference.text} belongs to account ${reference.account}; ${here}${others}`, { reason: "ref.wrong-account" });
92
+ }, "wrongAccount");
93
+ var ensureAccount = /* @__PURE__ */ __name(async (reference, scope, profilesOn) => {
94
+ if (scope.account !== void 0 && scope.account === reference.account)
95
+ return;
96
+ const profiles = await profilesOn?.(reference.account).catch(() => void 0);
97
+ throw wrongAccount(reference, scope, profiles);
98
+ }, "ensureAccount");
99
+
100
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/resolve.js
35
101
  var isId = /* @__PURE__ */ __name((reference) => /^-?\d+$/.test(reference.trim()), "isId");
36
102
  var foldName = /* @__PURE__ */ __name((name) => name.normalize("NFC").replace(/[\uFE0E\uFE0F\u200D]/g, "").toLowerCase(), "foldName");
37
103
  var pickChat = /* @__PURE__ */ __name((reference, chats) => {
@@ -45,6 +111,13 @@ var pickChat = /* @__PURE__ */ __name((reference, chats) => {
45
111
  }, "pickChat");
46
112
  var pickPerson = /* @__PURE__ */ __name((reference, people) => {
47
113
  const trimmed = reference.trim();
114
+ const contact = contactReferenceOf(trimmed, people.provider);
115
+ if (contact !== void 0) {
116
+ const named = people.get(contact);
117
+ if (named)
118
+ return named;
119
+ throw new CliError("not_found", `no person ${contact} in what this account has seen`);
120
+ }
48
121
  const known = people.get(trimmed);
49
122
  if (known)
50
123
  return known;
@@ -69,7 +142,7 @@ ${lines}`, { candidates });
69
142
  }, "ambiguous");
70
143
  var isPresent = /* @__PURE__ */ __name((value) => value !== null && value !== void 0, "isPresent");
71
144
 
72
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/domain/formatting.js
145
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/domain/formatting.js
73
146
  var invalid = /* @__PURE__ */ __name(() => new CliError("validation_error", "the messenger formatter returned invalid text spans"), "invalid");
74
147
  var validateFormattedText = /* @__PURE__ */ __name((formatted) => {
75
148
  const { text, spans } = formatted;
@@ -129,7 +202,7 @@ var visibleFormattedText = /* @__PURE__ */ __name((formatted) => {
129
202
  };
130
203
  }, "visibleFormattedText");
131
204
 
132
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/moderation/check.js
205
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/moderation/check.js
133
206
  var INVITE = /max\.ru\/join\/|(t|telegram)\.me\/(\+|joinchat\/)|tg:\/\/join/i;
134
207
  var LINK = /https?:\/\/\S+/i;
135
208
  var STRENGTH = { report: 0, delete: 1, remove: 2 };
@@ -317,7 +390,7 @@ var nextPoint = /* @__PURE__ */ __name((rows, found) => {
317
390
  }, "nextPoint");
318
391
  var someUndone = /* @__PURE__ */ __name((rows) => rows.some(undone), "someUndone");
319
392
 
320
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/moderation/rules.js
393
+ // node_modules/.pnpm/@wirecat+cli-core@0.552.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_23aa5a610a285948c067a35e1587367b/node_modules/@wirecat/cli-core/dist/moderation/rules.js
321
394
  import { existsSync, readFileSync } from "node:fs";
322
395
  import { join } from "node:path";
323
396
  var RULE_ACTIONS = ["report", "delete", "remove"];
@@ -461,6 +534,9 @@ var assign = /* @__PURE__ */ __name((rules, key, value) => {
461
534
  }, "assign");
462
535
 
463
536
  export {
537
+ chatReferenceOf,
538
+ wrongAccount,
539
+ ensureAccount,
464
540
  isId,
465
541
  foldName,
466
542
  pickChat,