@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
@@ -20,7 +20,7 @@ import {
20
20
  tool,
21
21
  toolKey,
22
22
  toolsFromCommands
23
- } from "./chunk-5MYLM6SU.js";
23
+ } from "./chunk-NNNEVWFF.js";
24
24
  import {
25
25
  CHART_KINDS,
26
26
  CHART_SIZE,
@@ -34,25 +34,26 @@ import {
34
34
  registerPrompts,
35
35
  stdinFieldOf,
36
36
  syncsFirst
37
- } from "./chunk-LXYC75D3.js";
37
+ } from "./chunk-ZFNM3FNI.js";
38
38
  import {
39
39
  agentJson,
40
40
  skillResource
41
- } from "./chunk-SPJJCD2A.js";
41
+ } from "./chunk-VJTGYBJJ.js";
42
42
  import {
43
43
  instructions
44
- } from "./chunk-TQFCPUIM.js";
44
+ } from "./chunk-S4GDDO5S.js";
45
45
  import {
46
46
  mcpHttpMarker
47
- } from "./chunk-UD4FKICZ.js";
47
+ } from "./chunk-TC7PD3LH.js";
48
48
  import {
49
49
  answeredWire
50
- } from "./chunk-JBBZCTTF.js";
50
+ } from "./chunk-U3ZUT557.js";
51
51
  import {
52
52
  StdioServerTransport,
53
53
  callerOf,
54
+ callingAgent,
54
55
  serveStdio
55
- } from "./chunk-BNTAQADF.js";
56
+ } from "./chunk-MZ6U6HNJ.js";
56
57
  import {
57
58
  McpServer,
58
59
  ResourceTemplate
@@ -60,60 +61,60 @@ import {
60
61
  import {
61
62
  connectedFor,
62
63
  guardFor
63
- } from "./chunk-6URISMGR.js";
64
+ } from "./chunk-5NGOP4EZ.js";
64
65
  import {
65
66
  lackedNeed,
66
67
  wholeList
67
- } from "./chunk-ECXRRW7J.js";
68
+ } from "./chunk-2H5SXK7K.js";
68
69
  import {
69
70
  capability,
70
71
  dateWindow,
71
72
  imageSize,
72
73
  servicesFor,
73
74
  storedDeps
74
- } from "./chunk-5NLFQ644.js";
75
+ } from "./chunk-M6IDHQ7N.js";
75
76
  import {
76
77
  findCommand
77
- } from "./chunk-JDJDVYGS.js";
78
+ } from "./chunk-IPTI3Y2E.js";
78
79
  import {
79
80
  DEFAULT_OUTPUT_BYTES,
80
81
  changesAuthorityAt,
81
82
  describeProgram,
82
83
  environmentOf,
83
- fetchesOnlyAt,
84
84
  itemOf,
85
85
  judgedTargets,
86
+ readsOverMcpAt,
86
87
  recalledAccount,
87
88
  rootOf2 as rootOf,
88
89
  sealed,
89
90
  snakeKeys
90
- } from "./chunk-IOUPXUFH.js";
91
+ } from "./chunk-6CS7ETBK.js";
91
92
  import {
92
93
  readOnlyLockOf
93
- } from "./chunk-Q4ZE2LXE.js";
94
+ } from "./chunk-WLSF3GCC.js";
94
95
  import {
95
96
  withCaller
96
- } from "./chunk-NQCFUYC2.js";
97
+ } from "./chunk-GBZF4IIP.js";
97
98
  import {
98
99
  typedCommand
99
- } from "./chunk-4OQVRDTG.js";
100
+ } from "./chunk-25IDWPEN.js";
100
101
  import {
101
102
  isCliFailure
102
- } from "./chunk-7LQLJ7LW.js";
103
+ } from "./chunk-Z5424QL6.js";
103
104
  import {
104
105
  levelFor,
105
106
  readKeysForCommand
106
- } from "./chunk-HIZQYFY3.js";
107
+ } from "./chunk-OXUHTKO2.js";
107
108
  import {
108
109
  warmEmbedders
109
- } from "./chunk-EJFSS65P.js";
110
+ } from "./chunk-T3KICUOK.js";
110
111
  import {
111
112
  openStore,
112
113
  pdfPreviewLimits
113
- } from "./chunk-TILW3EJY.js";
114
+ } from "./chunk-GXCNCMUY.js";
114
115
  import {
115
116
  timezoneOf
116
- } from "./chunk-D6FTCPXA.js";
117
+ } from "./chunk-ZH743WNV.js";
117
118
  import {
118
119
  CliError,
119
120
  description,
@@ -131,15 +132,15 @@ import {
131
132
  strictObject,
132
133
  string,
133
134
  visibleControls
134
- } from "./chunk-SB47UAW2.js";
135
+ } from "./chunk-JF7ZEUXU.js";
135
136
  import {
136
137
  __name
137
138
  } from "./chunk-ZVVMGPBJ.js";
138
139
 
139
- // 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/server.js
140
+ // 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/server.js
140
141
  import { randomUUID } from "node:crypto";
141
142
 
142
- // 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-log.js
143
+ // 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-log.js
143
144
  var agentLog = /* @__PURE__ */ __name((open) => {
144
145
  let held;
145
146
  return {
@@ -158,7 +159,7 @@ var agentLog = /* @__PURE__ */ __name((open) => {
158
159
  };
159
160
  }, "agentLog");
160
161
 
161
- // 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/resources.js
162
+ // 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/resources.js
162
163
  var LISTED = 100;
163
164
  var registerResources = /* @__PURE__ */ __name((server, session, { command, name, limit, recorded, withStore, messenger, guard, assertRead }) => {
164
165
  server.registerResource("chat", new ResourceTemplate(`${command}://chat/{id}`, {
@@ -196,7 +197,7 @@ var registerResources = /* @__PURE__ */ __name((server, session, { command, name
196
197
  });
197
198
  }, "registerResources");
198
199
 
199
- // 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/session.js
200
+ // 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/session.js
200
201
  var HARMLESS = /* @__PURE__ */ new Set(["validation_error", "not_found", "permission_error", "confirmation_required", "rate_limited"]);
201
202
  var harmless = /* @__PURE__ */ __name((code) => HARMLESS.has(code), "harmless");
202
203
  var MessengerSession = class {
@@ -271,7 +272,7 @@ var MessengerSession = class {
271
272
  }
272
273
  };
273
274
 
274
- // 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/tools/attachments.js
275
+ // 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/tools/attachments.js
275
276
  var attachmentsTools = /* @__PURE__ */ __name((messenger) => {
276
277
  const _command = messenger.app.command;
277
278
  return {
@@ -325,7 +326,7 @@ var attachmentsTools = /* @__PURE__ */ __name((messenger) => {
325
326
  };
326
327
  }, "attachmentsTools");
327
328
 
328
- // 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/tools/messages-photo.js
329
+ // 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/tools/messages-photo.js
329
330
  var PHOTO_LIMIT = 512 * 1024;
330
331
  var IMAGE_TYPES = [
331
332
  ["image/jpeg", (b) => b[0] === 255 && b[1] === 216 && b[2] === 255],
@@ -379,7 +380,7 @@ var readUpTo = /* @__PURE__ */ __name(async (file, limit, saveIt) => {
379
380
  return new Uint8Array(Buffer.concat(chunks));
380
381
  }, "readUpTo");
381
382
 
382
- // 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/tools/stats.js
383
+ // 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/tools/stats.js
383
384
  var statsTools = /* @__PURE__ */ __name((messenger) => ({
384
385
  stats_charts: tool({
385
386
  title: "A chart from a chat's statistics",
@@ -416,14 +417,14 @@ var statsTools = /* @__PURE__ */ __name((messenger) => ({
416
417
  })
417
418
  }), "statsTools");
418
419
 
419
- // 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/tools.js
420
+ // 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/tools.js
420
421
  var pictureTools = /* @__PURE__ */ __name((messenger) => Object.fromEntries(Object.entries({
421
422
  ...messagesPhotoTools(messenger),
422
423
  ...attachmentsTools(messenger),
423
424
  ...statsTools(messenger)
424
425
  }).map(([name, definition]) => [name, { ...definition, input: strictObject(definition.input.entries) }])), "pictureTools");
425
426
 
426
- // 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/server.js
427
+ // 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/server.js
427
428
  var PER_RUN = /* @__PURE__ */ new Set([
428
429
  "streams",
429
430
  "stdin",
@@ -493,7 +494,7 @@ var createServer = /* @__PURE__ */ __name((command, context, messenger, sessionO
493
494
  readOnly: readOnlyLockOf(app, context.env) !== void 0,
494
495
  keyOf,
495
496
  authority,
496
- fetchOnly: fetchesOnlyAt(root),
497
+ fetchOnly: readsOverMcpAt(root),
497
498
  offline: true,
498
499
  stdin
499
500
  }).map((one) => "sync_first" in one.input.entries && !syncAllowed(one.path) ? {
@@ -541,10 +542,10 @@ var createServer = /* @__PURE__ */ __name((command, context, messenger, sessionO
541
542
  });
542
543
  const skill = messenger.skill ? skillResource(app, messenger.skill) : void 0;
543
544
  const log = agentLog(() => openStore({ env: context.env, command: app.command, version: app.version }));
544
- const audit = /* @__PURE__ */ __name(async (call) => {
545
+ const audit = /* @__PURE__ */ __name(async (call, caller) => {
545
546
  if (!recalledAccount(app, provider, settings.profile, context.env))
546
547
  return;
547
- await log.record({ actor: { bot: `${app.command}-mcp` }, ...call });
548
+ await log.record({ actor: { bot: callingAgent(`${app.command}-mcp`, caller) }, ...call });
548
549
  }, "audit");
549
550
  const targets = judgedTargets(root);
550
551
  const passed = Object.fromEntries(Object.entries(environment).filter(([key]) => !PER_RUN.has(key)));
@@ -616,7 +617,7 @@ var createServer = /* @__PURE__ */ __name((command, context, messenger, sessionO
616
617
  ...outcomeOf(result),
617
618
  startedAt,
618
619
  finishedAt: Date.now()
619
- }).catch(() => void 0);
620
+ }, caller).catch(() => void 0);
620
621
  return result;
621
622
  }, "run")
622
623
  }), "asCommand");
@@ -747,12 +748,13 @@ var serveOverStdio = /* @__PURE__ */ __name(async (command, context, messenger,
747
748
  }, "serveOverStdio");
748
749
  var serveOverHttpUntilStopped = /* @__PURE__ */ __name(async (command, context, messenger, options, http) => {
749
750
  const { session, embedders, build, log } = createServer(command, context, messenger, options);
750
- const { serveOverHttp } = await import("./serve-6UJCZD7Z.js");
751
+ const { serveOverHttp } = await import("./serve-WAOSED3I.js");
751
752
  const appName = messenger.app.command;
752
753
  const appEnvPrefix = messenger.app.envPrefix;
753
754
  const listening = await serveOverHttp(build, {
754
755
  ...http,
755
756
  appName,
757
+ reaches: "your messages",
756
758
  // In the background its log is a file; the code goes only to the lock that `mcp server status` reads.
757
759
  onCode: /* @__PURE__ */ __name((code, expires) => context.renderer.note(context.env[mcpHttpMarker(appEnvPrefix)] === void 0 ? `login code for a new browser app: ${code} (until ${expires.toTimeString().slice(0, 5)}; a new one after each login)` : `a new login code for a browser app: \`${appName} ${context.settings.profile} mcp server status\``), "onCode"),
758
760
  onError: /* @__PURE__ */ __name((error) => context.renderer.note(`mcp: ${error.message}`), "onError")
@@ -1,21 +1,185 @@
1
1
  import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ formatMeetingReference,
5
+ parseMeetingReference
6
+ } from "./chunk-GMTXCFI7.js";
3
7
  import {
4
8
  CliError,
5
9
  singleLine
6
- } from "./chunk-SB47UAW2.js";
10
+ } from "./chunk-JF7ZEUXU.js";
7
11
  import {
8
12
  __name
9
13
  } from "./chunk-ZVVMGPBJ.js";
10
14
 
11
- // 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/providers.js
15
+ // 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/locator.js
16
+ var SCHEME = "msg:";
17
+ var formatLocator = /* @__PURE__ */ __name(({ provider, account, chat, message }) => SCHEME + [provider, account, chat, message].map(encodeURIComponent).join("/"), "formatLocator");
18
+ var isLocator = /* @__PURE__ */ __name((reference) => reference.trim().startsWith(SCHEME), "isLocator");
19
+ var parseLocator = /* @__PURE__ */ __name((reference) => {
20
+ const trimmed = reference.trim();
21
+ const parts2 = trimmed.startsWith(SCHEME) ? trimmed.slice(SCHEME.length).split("/") : [];
22
+ if (parts2.length !== 4 || parts2.some((part) => part === "")) {
23
+ throw new CliError("validation_error", `"${singleLine(reference)}" is not a message locator \u2014 expected msg:<provider>/<account>/<chat>/<message>`);
24
+ }
25
+ const [provider, account, chat, message] = parts2.map(decodeURIComponent);
26
+ return { provider, account, chat, message };
27
+ }, "parseLocator");
28
+
29
+ // 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/references.js
30
+ var SIMPLE_REFERENCES = [
31
+ "note",
32
+ "document",
33
+ "person",
34
+ "organization",
35
+ "project",
36
+ "task",
37
+ "memory",
38
+ "fact",
39
+ "bot",
40
+ "event",
41
+ "entity"
42
+ ];
43
+ var malformed = /* @__PURE__ */ __name((text, shape) => new CliError("validation_error", `"${singleLine(text)}" is not a reference \u2014 expected ${shape}`, {
44
+ reason: "ref.malformed"
45
+ }), "malformed");
46
+ var parts = /* @__PURE__ */ __name((rest, count, text, shape) => {
47
+ const split = rest.split("/");
48
+ if (split.length !== count || split.some((part) => part === ""))
49
+ throw malformed(text, shape);
50
+ return split.map(decodeURIComponent);
51
+ }, "parts");
52
+ var encoded = /* @__PURE__ */ __name((...values) => values.map(encodeURIComponent).join("/"), "encoded");
53
+ var folderPath = /* @__PURE__ */ __name((path) => {
54
+ const clean = path.split("/").filter((part) => part !== "" && part !== ".").join("/");
55
+ return clean === "" ? path.trim() === "" ? "" : null : clean;
56
+ }, "folderPath");
57
+ var MEETING_SHAPE = "meeting:<account>/<meeting>[/<transcript>[/<cue>]] with safe integer ids";
58
+ var kind = /* @__PURE__ */ __name((spec) => spec, "kind");
59
+ var simple = /* @__PURE__ */ __name((prefix) => kind({
60
+ prefix,
61
+ type: prefix,
62
+ shape: `${prefix}:<id>`,
63
+ parse: /* @__PURE__ */ __name((rest, text) => {
64
+ if (!rest.trim())
65
+ throw new CliError("validation_error", `"${singleLine(text)}" names no ${prefix}`, {
66
+ reason: "ref.malformed"
67
+ });
68
+ return { type: prefix, id: rest };
69
+ }, "parse"),
70
+ format: /* @__PURE__ */ __name((reference) => `${reference.type}:${reference.id}`, "format")
71
+ }), "simple");
72
+ var REF_KINDS = [
73
+ kind({
74
+ prefix: "msg",
75
+ type: "message",
76
+ shape: "msg:<provider>/<account>/<chat>/<message>",
77
+ parse: /* @__PURE__ */ __name((_, text) => {
78
+ try {
79
+ return { type: "message", ...parseLocator(text) };
80
+ } catch {
81
+ throw malformed(text, "msg:<provider>/<account>/<chat>/<message>");
82
+ }
83
+ }, "parse"),
84
+ format: formatLocator
85
+ }),
86
+ kind({
87
+ prefix: "chat",
88
+ type: "chat",
89
+ shape: "chat:<provider>/<account>/<chat>",
90
+ parse: /* @__PURE__ */ __name((rest, text) => {
91
+ const [provider, account, chat] = parts(rest, 3, text, "chat:<provider>/<account>/<chat>");
92
+ return { type: "chat", provider, account, chat };
93
+ }, "parse"),
94
+ format: /* @__PURE__ */ __name(({ provider, account, chat }) => `chat:${encoded(provider, account, chat)}`, "format")
95
+ }),
96
+ kind({
97
+ prefix: "contact",
98
+ type: "contact",
99
+ shape: "contact:<provider>/<id>",
100
+ parse: /* @__PURE__ */ __name((rest, text) => {
101
+ const [provider, id] = parts(rest, 2, text, "contact:<provider>/<id>");
102
+ return { type: "contact", provider, id };
103
+ }, "parse"),
104
+ format: /* @__PURE__ */ __name(({ provider, id }) => `contact:${encoded(provider, id)}`, "format")
105
+ }),
106
+ kind({
107
+ prefix: "folder",
108
+ type: "folder",
109
+ shape: "folder:<id>[/<path>]",
110
+ parse: /* @__PURE__ */ __name((rest, text) => {
111
+ const slash = rest.indexOf("/");
112
+ const id = decodeURIComponent(slash < 0 ? rest : rest.slice(0, slash));
113
+ const path = slash < 0 ? null : folderPath(decodeURIComponent(rest.slice(slash + 1)));
114
+ if (!id.trim() || path === "")
115
+ throw malformed(text, "folder:<id>[/<path>]");
116
+ return { type: "folder", id, path };
117
+ }, "parse"),
118
+ format: /* @__PURE__ */ __name(({ id, path }) => path === null ? `folder:${encodeURIComponent(id)}` : `folder:${encoded(id, path)}`, "format")
119
+ }),
120
+ kind({
121
+ prefix: "meeting",
122
+ type: "meeting",
123
+ shape: MEETING_SHAPE,
124
+ parse: /* @__PURE__ */ __name((_, text) => {
125
+ try {
126
+ return parseMeetingReference(text);
127
+ } catch {
128
+ throw malformed(text, MEETING_SHAPE);
129
+ }
130
+ }, "parse"),
131
+ format: formatMeetingReference
132
+ }),
133
+ ...SIMPLE_REFERENCES.map(simple)
134
+ ];
135
+ var byPrefix = new Map(REF_KINDS.map((spec) => [spec.prefix, spec]));
136
+ var byType = new Map(REF_KINDS.map((spec) => [spec.type, spec]));
137
+ var offered = REF_KINDS.map(({ prefix }) => prefix).filter((prefix) => prefix !== "entity");
138
+ var distance = /* @__PURE__ */ __name((a, b) => {
139
+ let row = Array.from({ length: b.length + 1 }, (_, at) => at);
140
+ for (const [i, x] of [...a].entries()) {
141
+ const next = [i + 1];
142
+ for (const [j, y] of [...b].entries())
143
+ next.push(Math.min(row[j + 1] + 1, next[j] + 1, row[j] + (x === y ? 0 : 1)));
144
+ row = next;
145
+ }
146
+ return row[b.length];
147
+ }, "distance");
148
+ var nearest = /* @__PURE__ */ __name((typed) => offered.find((prefix) => typed.length >= 2 && prefix.startsWith(typed)) ?? offered.map((prefix) => ({ prefix, far: distance(typed, prefix) })).filter(({ far }) => far <= 2).sort((a, b) => a.far - b.far)[0]?.prefix, "nearest");
149
+ var unknownKind = /* @__PURE__ */ __name((text, prefix, rest) => {
150
+ const near = prefix === "" ? void 0 : nearest(prefix);
151
+ const kinds = offered.map((one) => `${one}:`).join(", ");
152
+ const hint = near === void 0 ? `; kinds: ${kinds}` : `; did you mean ${near}:${singleLine(rest)}? Kinds: ${kinds}`;
153
+ return new CliError("validation_error", `"${singleLine(text)}" is no kind of reference${hint}`, {
154
+ reason: "ref.unknown-kind"
155
+ });
156
+ }, "unknownKind");
157
+ var formatReference = /* @__PURE__ */ __name((reference) => byType.get(reference.type).format(reference), "formatReference");
158
+ var parseReference = /* @__PURE__ */ __name((text) => {
159
+ const reference = text.trim();
160
+ const colon = reference.indexOf(":");
161
+ const prefix = colon < 0 ? "" : reference.slice(0, colon);
162
+ const rest = reference.slice(colon + 1);
163
+ const spec = byPrefix.get(prefix);
164
+ if (!spec)
165
+ throw unknownKind(reference, prefix, rest);
166
+ return spec.parse(rest, reference);
167
+ }, "parseReference");
168
+ var canonicalReference = /* @__PURE__ */ __name((text) => formatReference(parseReference(text)), "canonicalReference");
169
+ var looksLikeReference = /* @__PURE__ */ __name((text) => {
170
+ const match = /^([a-z]+):\S+$/.exec(text.trim());
171
+ return match !== null && byPrefix.has(match[1]);
172
+ }, "looksLikeReference");
173
+
174
+ // 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/providers.js
12
175
  var KINDS = ["messages", "mail", "notes", "documents", "meetings", "events"];
176
+ var MESSENGER_OPENS = { chat: "messages list", message: "messages show", contact: "contacts show" };
13
177
  var PROVIDERS = [
14
- { name: "telegram", kind: "messages", aliases: ["tg"] },
178
+ { name: "telegram", kind: "messages", aliases: ["tg"], command: "tg", opens: MESSENGER_OPENS },
15
179
  { name: "telegram-bot", kind: "messages", aliases: ["tg-bot"] },
16
- { name: "max", kind: "messages", aliases: [] },
180
+ { name: "max", kind: "messages", aliases: [], command: "max", opens: MESSENGER_OPENS },
17
181
  { name: "max-bot", kind: "messages", aliases: [] },
18
- { name: "whatsapp", kind: "messages", aliases: ["wa"] },
182
+ { name: "whatsapp", kind: "messages", aliases: ["wa"], command: "wa", opens: MESSENGER_OPENS },
19
183
  { name: "whatsapp-bot", kind: "messages", aliases: ["wa-bot"] },
20
184
  { name: "email", kind: "mail", aliases: [] },
21
185
  { name: "notes", kind: "notes", aliases: [] },
@@ -23,6 +187,17 @@ var PROVIDERS = [
23
187
  { name: "obsidian", kind: "notes", aliases: [] },
24
188
  { name: "zoom", kind: "meetings", aliases: [] }
25
189
  ];
190
+ var LABELS = {
191
+ telegram: "Telegram",
192
+ "telegram-bot": "Telegram bot",
193
+ max: "MAX",
194
+ "max-bot": "MAX bot",
195
+ whatsapp: "WhatsApp",
196
+ "whatsapp-bot": "WhatsApp bot",
197
+ "google-drive": "Google Drive",
198
+ email: "mail"
199
+ };
200
+ var providerLabel = /* @__PURE__ */ __name((provider) => LABELS[provider] ?? provider, "providerLabel");
26
201
  var FOLDER_PROVIDERS = ["local", "obsidian", "folder"];
27
202
  var isFolderProvider = /* @__PURE__ */ __name((provider) => FOLDER_PROVIDERS.includes(provider), "isFolderProvider");
28
203
  var folderProviderSql = /* @__PURE__ */ __name((column = "provider") => `${column} IN (${FOLDER_PROVIDERS.map((name) => `'${name}'`).join(", ")})`, "folderProviderSql");
@@ -37,23 +212,35 @@ var invalid = /* @__PURE__ */ __name((message) => {
37
212
  throw new CliError("validation_error", message);
38
213
  }, "invalid");
39
214
  var wordOf = /* @__PURE__ */ __name((value, what) => typeof value === "string" && WORD.test(value) ? value : invalid(`${what} is lowercase letters, digits, - and _ \u2014 not ${JSON.stringify(value)}`), "wordOf");
215
+ var OPEN_KINDS = new Set(REF_KINDS.map(({ type }) => type).filter((type) => type !== "entity"));
216
+ var COMMAND_WORDS = /^[a-z0-9][a-z0-9_-]*( [a-z0-9][a-z0-9_-]*)*$/;
217
+ var opensOf = /* @__PURE__ */ __name((value, named) => {
218
+ if (typeof value !== "object" || value === null || Array.isArray(value))
219
+ return invalid(`provider ${named}'s opens maps a kind of reference to a command`);
220
+ const known = Object.entries(value).filter(([kind2]) => OPEN_KINDS.has(kind2));
221
+ for (const [kind2, command] of known)
222
+ if (typeof command !== "string" || !COMMAND_WORDS.test(command))
223
+ invalid(`provider ${named} opens a ${kind2} with command words, not ${JSON.stringify(command)}`);
224
+ return Object.fromEntries(known);
225
+ }, "opensOf");
40
226
  var providerEntryOf = /* @__PURE__ */ __name((value) => {
41
227
  if (typeof value !== "object" || value === null || Array.isArray(value))
42
228
  return invalid("a provider entry is an object");
43
- const { name, kind, aliases = [], command } = value;
229
+ const { name, kind: kind2, aliases = [], command, opens } = value;
44
230
  const named = wordOf(name, "a provider's name");
45
- if (typeof kind !== "string" || !KINDS.includes(kind))
46
- invalid(`provider ${named}'s kind is one of ${KINDS.join(", ")} \u2014 not ${JSON.stringify(kind)}`);
231
+ if (typeof kind2 !== "string" || !KINDS.includes(kind2))
232
+ invalid(`provider ${named}'s kind is one of ${KINDS.join(", ")} \u2014 not ${JSON.stringify(kind2)}`);
47
233
  if (!Array.isArray(aliases))
48
234
  invalid(`provider ${named}'s aliases are a list`);
49
235
  return {
50
236
  name: named,
51
- kind,
237
+ kind: kind2,
52
238
  aliases: [...new Set(aliases.map((alias) => wordOf(alias, `an alias of ${named}`)))],
53
- ...command === void 0 ? {} : { command: wordOf(command, `the command of ${named}`) }
239
+ ...command === void 0 ? {} : { command: wordOf(command, `the command of ${named}`) },
240
+ ...opens === void 0 ? {} : { opens: opensOf(opens, named) }
54
241
  };
55
242
  }, "providerEntryOf");
56
- var describe = /* @__PURE__ */ __name(({ name, kind, command }) => `${name} (${kind}${command ? `, from ${command}` : ""})`, "describe");
243
+ var describe = /* @__PURE__ */ __name(({ name, kind: kind2, command }) => `${name} (${kind2}${command ? `, from ${command}` : ""})`, "describe");
57
244
  var wordsOf = /* @__PURE__ */ __name(({ name, aliases }) => [name, ...aliases], "wordsOf");
58
245
  var joined = /* @__PURE__ */ __name((known, entry) => {
59
246
  const same = known.find(({ name }) => name === entry.name);
@@ -62,7 +249,8 @@ var joined = /* @__PURE__ */ __name((known, entry) => {
62
249
  const merged = same ? {
63
250
  ...same,
64
251
  aliases: [.../* @__PURE__ */ new Set([...same.aliases, ...entry.aliases])],
65
- ...entry.command ? { command: entry.command } : {}
252
+ ...entry.command ? { command: entry.command } : {},
253
+ ...entry.opens ? { opens: { ...same.opens, ...entry.opens } } : {}
66
254
  } : entry;
67
255
  const others = known.filter((one) => one !== same);
68
256
  for (const word of wordsOf(merged)) {
@@ -102,93 +290,7 @@ var providerNamed = /* @__PURE__ */ __name((word) => {
102
290
  var kindIn = /* @__PURE__ */ __name((provider) => isFolderProvider(provider) ? "notes" : registry.find(({ name }) => name === provider)?.kind, "kindIn");
103
291
  var kindOf = /* @__PURE__ */ __name((provider) => kindIn(provider) ?? "messages", "kindOf");
104
292
 
105
- // 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/locator.js
106
- var SCHEME = "msg:";
107
- var formatLocator = /* @__PURE__ */ __name(({ provider, account, chat, message }) => SCHEME + [provider, account, chat, message].map(encodeURIComponent).join("/"), "formatLocator");
108
- var isLocator = /* @__PURE__ */ __name((reference) => reference.trim().startsWith(SCHEME), "isLocator");
109
- var parseLocator = /* @__PURE__ */ __name((reference) => {
110
- const trimmed = reference.trim();
111
- const parts2 = trimmed.startsWith(SCHEME) ? trimmed.slice(SCHEME.length).split("/") : [];
112
- if (parts2.length !== 4 || parts2.some((part) => part === "")) {
113
- throw new CliError("validation_error", `"${singleLine(reference)}" is not a message locator \u2014 expected msg:<provider>/<account>/<chat>/<message>`);
114
- }
115
- const [provider, account, chat, message] = parts2.map(decodeURIComponent);
116
- return { provider, account, chat, message };
117
- }, "parseLocator");
118
-
119
- // 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/references.js
120
- var SIMPLE_REFERENCES = [
121
- "note",
122
- "document",
123
- "person",
124
- "organization",
125
- "project",
126
- "task",
127
- "memory",
128
- "fact",
129
- "bot",
130
- "entity"
131
- ];
132
- var parts = /* @__PURE__ */ __name((rest, count, reference, shape) => {
133
- const split = rest.split("/");
134
- if (split.length !== count || split.some((part) => part === ""))
135
- throw new CliError("validation_error", `"${singleLine(reference)}" is not a reference \u2014 expected ${shape}`);
136
- return split.map(decodeURIComponent);
137
- }, "parts");
138
- var formatReference = /* @__PURE__ */ __name((reference) => {
139
- switch (reference.type) {
140
- case "message":
141
- return formatLocator(reference);
142
- case "chat":
143
- return `chat:${[reference.provider, reference.account, reference.chat].map(encodeURIComponent).join("/")}`;
144
- case "contact":
145
- return `contact:${[reference.provider, reference.id].map(encodeURIComponent).join("/")}`;
146
- case "folder":
147
- return reference.path === null ? `folder:${encodeURIComponent(reference.id)}` : `folder:${encodeURIComponent(reference.id)}/${encodeURIComponent(reference.path)}`;
148
- default:
149
- return `${reference.type}:${reference.id}`;
150
- }
151
- }, "formatReference");
152
- var parseReference = /* @__PURE__ */ __name((text) => {
153
- const reference = text.trim();
154
- const colon = reference.indexOf(":");
155
- const prefix = colon < 0 ? "" : reference.slice(0, colon);
156
- const rest = reference.slice(colon + 1);
157
- switch (prefix) {
158
- case "msg":
159
- return { type: "message", ...parseLocator(reference) };
160
- case "chat": {
161
- const [provider, account, chat] = parts(rest, 3, reference, "chat:<provider>/<account>/<chat>");
162
- return { type: "chat", provider, account, chat };
163
- }
164
- case "contact": {
165
- const [provider, id] = parts(rest, 2, reference, "contact:<provider>/<id>");
166
- return { type: "contact", provider, id };
167
- }
168
- case "folder": {
169
- const slash = rest.indexOf("/");
170
- const id = decodeURIComponent(slash < 0 ? rest : rest.slice(0, slash));
171
- const path = slash < 0 ? null : folderPath(decodeURIComponent(rest.slice(slash + 1)));
172
- if (!id.trim() || path === "")
173
- throw new CliError("validation_error", `"${singleLine(reference)}" is not a reference \u2014 expected folder:<id>[/<path>]`);
174
- return { type: "folder", id, path };
175
- }
176
- default:
177
- if (SIMPLE_REFERENCES.includes(prefix)) {
178
- if (!rest.trim())
179
- throw new CliError("validation_error", `"${singleLine(reference)}" names no ${prefix}`);
180
- return { type: prefix, id: rest };
181
- }
182
- throw new CliError("validation_error", `"${singleLine(reference)}" is not a reference \u2014 expected msg:, chat:, contact:, folder:, ${SIMPLE_REFERENCES.filter((one) => one !== "entity").join(":, ")}:`);
183
- }
184
- }, "parseReference");
185
- var folderPath = /* @__PURE__ */ __name((path) => {
186
- const clean = path.split("/").filter((part) => part !== "" && part !== ".").join("/");
187
- return clean === "" ? path.trim() === "" ? "" : null : clean;
188
- }, "folderPath");
189
- var canonicalReference = /* @__PURE__ */ __name((text) => formatReference(parseReference(text)), "canonicalReference");
190
-
191
- // 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/counters.js
293
+ // 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/counters.js
192
294
  var COUNTER_FIELDS = ["views", "reactions", "comments"];
193
295
  var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
194
296
  var counterValue = /* @__PURE__ */ __name((message, field) => {
@@ -225,7 +327,7 @@ var counterFreshness = /* @__PURE__ */ __name((states) => {
225
327
  return states.some((one) => one.freshness === "stale") ? "stale" : "fresh";
226
328
  }, "counterFreshness");
227
329
 
228
- // 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/rankings-options.js
330
+ // 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/rankings-options.js
229
331
  var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
230
332
  var AUTHOR_MEASURES = [
231
333
  "messages",
@@ -366,8 +468,17 @@ var rankingWords = /* @__PURE__ */ __name((text) => withoutUrls(text).match(/[\p
366
468
  var rankingQuestion = /* @__PURE__ */ __name((text) => withoutUrls(text).includes("?"), "rankingQuestion");
367
469
 
368
470
  export {
471
+ formatLocator,
472
+ isLocator,
473
+ parseLocator,
474
+ REF_KINDS,
475
+ formatReference,
476
+ parseReference,
477
+ canonicalReference,
478
+ looksLikeReference,
369
479
  KINDS,
370
480
  PROVIDERS,
481
+ providerLabel,
371
482
  FOLDER_PROVIDERS,
372
483
  isFolderProvider,
373
484
  folderProviderSql,
@@ -386,12 +497,6 @@ export {
386
497
  providerNamed,
387
498
  kindIn,
388
499
  kindOf,
389
- formatLocator,
390
- isLocator,
391
- parseLocator,
392
- formatReference,
393
- parseReference,
394
- canonicalReference,
395
500
  COUNTER_FIELDS,
396
501
  validCounter,
397
502
  counterValue,
@@ -527,7 +527,7 @@ var require_cross_spawn = __commonJS({
527
527
  }
528
528
  });
529
529
 
530
- // 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/executable.js
530
+ // 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/executable.js
531
531
  import { existsSync } from "node:fs";
532
532
  import { win32 } from "node:path";
533
533
  var variable = /* @__PURE__ */ __name((env, name) => Object.entries(env).find(([key]) => key.toUpperCase() === name)?.[1], "variable");