@wirecat/amo-cli 0.5.0 → 0.7.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 (281) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +2 -2
  3. package/contracts/wirecat.json +14 -0
  4. package/dist/amo/button.js +1 -1
  5. package/dist/amo/json.js +1 -1
  6. package/dist/amo/oauth.js +3 -5
  7. package/dist/amo/transport.js +3 -7
  8. package/dist/api-keys.js +1 -1
  9. package/dist/bin/amo.js +11 -11
  10. package/dist/bundle/amo.js +5 -183
  11. package/dist/bundle/{chunk-3PYE55JY.js → chunk-3HWD4BKU.js} +4 -6
  12. package/dist/bundle/{chunk-M6VZXAJC.js → chunk-4EXURQQQ.js} +21 -19
  13. package/dist/bundle/chunk-AEWYRB6F.js +8 -0
  14. package/dist/bundle/{chunk-WUFX4TKA.js → chunk-GL7CRTHR.js} +3 -3
  15. package/dist/bundle/chunk-N2UB32VN.js +76 -0
  16. package/dist/bundle/{chunk-KZ2FIDI3.js → chunk-PVVSHDMQ.js} +7 -15
  17. package/dist/bundle/program-SQH3SPOW.js +2352 -0
  18. package/dist/bundle/{instructions-AMH5RWVJ.js → source-C65ZJUTW.js} +5 -6
  19. package/dist/bundle/store-SJ2TOUGU.js +12 -0
  20. package/dist/bundle/writer-I7GBI3VE.js +12 -0
  21. package/dist/commands/account.js +1 -1
  22. package/dist/commands/api.js +1 -3
  23. package/dist/commands/crm-shared.js +2 -3
  24. package/dist/commands/schedule.js +1 -1
  25. package/dist/commands/session.js +1 -8
  26. package/dist/commands/write.js +1 -2
  27. package/dist/config.js +1 -2
  28. package/dist/context.js +1 -2
  29. package/dist/crm/activities.js +1 -1
  30. package/dist/crm/records.js +1 -1
  31. package/dist/crm/source.js +1 -1
  32. package/dist/crm/writer.js +1 -1
  33. package/dist/identity.js +4 -0
  34. package/dist/program.js +1 -2
  35. package/dist/setup/flow.js +1 -1
  36. package/dist/store.js +1 -1
  37. package/dist/version.js +1 -1
  38. package/dist/whoami.js +1 -1
  39. package/package.json +3 -3
  40. package/scenarios/first-sync.md +13 -11
  41. package/scenarios/keep-in-sync.md +7 -6
  42. package/scenarios/safe-agent-writes.md +10 -9
  43. package/dist/amo/account.d.ts +0 -18
  44. package/dist/amo/account.d.ts.map +0 -1
  45. package/dist/amo/account.js.map +0 -1
  46. package/dist/amo/allow-list.d.ts +0 -31
  47. package/dist/amo/allow-list.d.ts.map +0 -1
  48. package/dist/amo/allow-list.js.map +0 -1
  49. package/dist/amo/button.d.ts +0 -53
  50. package/dist/amo/button.d.ts.map +0 -1
  51. package/dist/amo/button.js.map +0 -1
  52. package/dist/amo/errors.d.ts +0 -12
  53. package/dist/amo/errors.d.ts.map +0 -1
  54. package/dist/amo/errors.js.map +0 -1
  55. package/dist/amo/json.d.ts +0 -3
  56. package/dist/amo/json.d.ts.map +0 -1
  57. package/dist/amo/json.js.map +0 -1
  58. package/dist/amo/oauth.d.ts +0 -64
  59. package/dist/amo/oauth.d.ts.map +0 -1
  60. package/dist/amo/oauth.js.map +0 -1
  61. package/dist/amo/operation.d.ts +0 -45
  62. package/dist/amo/operation.d.ts.map +0 -1
  63. package/dist/amo/operation.js.map +0 -1
  64. package/dist/amo/operations.d.ts +0 -3
  65. package/dist/amo/operations.d.ts.map +0 -1
  66. package/dist/amo/operations.js.map +0 -1
  67. package/dist/amo/routes.d.ts +0 -67
  68. package/dist/amo/routes.d.ts.map +0 -1
  69. package/dist/amo/routes.js.map +0 -1
  70. package/dist/amo/transport.d.ts +0 -62
  71. package/dist/amo/transport.d.ts.map +0 -1
  72. package/dist/amo/transport.js.map +0 -1
  73. package/dist/api-keys.d.ts +0 -47
  74. package/dist/api-keys.d.ts.map +0 -1
  75. package/dist/api-keys.js.map +0 -1
  76. package/dist/bin/amo.d.ts +0 -3
  77. package/dist/bin/amo.d.ts.map +0 -1
  78. package/dist/bin/amo.js.map +0 -1
  79. package/dist/bundle/agent-EFMUK732.js +0 -41
  80. package/dist/bundle/all-profiles-PIWUQWBA.js +0 -320
  81. package/dist/bundle/anthropic-47CMXBPQ.js +0 -90
  82. package/dist/bundle/app-server-QRBQODF2.js +0 -257
  83. package/dist/bundle/areas-QVHVU57Z.js +0 -63
  84. package/dist/bundle/bun-OPDGMZZQ.js +0 -169
  85. package/dist/bundle/bun-sqlite-7I4X7CZW.js +0 -75
  86. package/dist/bundle/chunk-2JHVQMVC.js +0 -16
  87. package/dist/bundle/chunk-2XBDILVW.js +0 -53
  88. package/dist/bundle/chunk-3DEQUYEG.js +0 -185
  89. package/dist/bundle/chunk-3GX6KM2E.js +0 -5302
  90. package/dist/bundle/chunk-3HC5F3P7.js +0 -24
  91. package/dist/bundle/chunk-3YM4B2GT.js +0 -63
  92. package/dist/bundle/chunk-43OW5NTG.js +0 -338
  93. package/dist/bundle/chunk-43PMSR33.js +0 -357
  94. package/dist/bundle/chunk-4N7PP76S.js +0 -6848
  95. package/dist/bundle/chunk-4VN7RI4I.js +0 -1718
  96. package/dist/bundle/chunk-57HFPNMF.js +0 -189
  97. package/dist/bundle/chunk-5UTB3ADZ.js +0 -360
  98. package/dist/bundle/chunk-633NQY2R.js +0 -80
  99. package/dist/bundle/chunk-63N46DJU.js +0 -12278
  100. package/dist/bundle/chunk-6D4VWSJD.js +0 -259
  101. package/dist/bundle/chunk-6JTHXWPE.js +0 -64
  102. package/dist/bundle/chunk-6QGUK3H7.js +0 -161
  103. package/dist/bundle/chunk-6WS6GJ4V.js +0 -30
  104. package/dist/bundle/chunk-7IR2G5XY.js +0 -559
  105. package/dist/bundle/chunk-7IWIFVXH.js +0 -52
  106. package/dist/bundle/chunk-ABX7BBS4.js +0 -388
  107. package/dist/bundle/chunk-ADLS6FVG.js +0 -24600
  108. package/dist/bundle/chunk-ADTI5RUO.js +0 -1007
  109. package/dist/bundle/chunk-AKRIUNYP.js +0 -1197
  110. package/dist/bundle/chunk-BIKOE2IW.js +0 -614
  111. package/dist/bundle/chunk-BVVMIAQ6.js +0 -37727
  112. package/dist/bundle/chunk-CGW5R4UD.js +0 -362
  113. package/dist/bundle/chunk-D4NE7EON.js +0 -170
  114. package/dist/bundle/chunk-D72URWJE.js +0 -532
  115. package/dist/bundle/chunk-DFDN6AUB.js +0 -21
  116. package/dist/bundle/chunk-DNCLQPOM.js +0 -7
  117. package/dist/bundle/chunk-DPV53EZC.js +0 -206
  118. package/dist/bundle/chunk-DQ6S5TFZ.js +0 -9539
  119. package/dist/bundle/chunk-DSJ6EAOA.js +0 -4172
  120. package/dist/bundle/chunk-DVZ75WZJ.js +0 -3752
  121. package/dist/bundle/chunk-EH6ZEJGT.js +0 -932
  122. package/dist/bundle/chunk-EHK73OSW.js +0 -2017
  123. package/dist/bundle/chunk-FNV5HLHX.js +0 -1068
  124. package/dist/bundle/chunk-FV4GQNIK.js +0 -136
  125. package/dist/bundle/chunk-G2TU5RYY.js +0 -332
  126. package/dist/bundle/chunk-GDK7ETSB.js +0 -218
  127. package/dist/bundle/chunk-GGMAIIVE.js +0 -38
  128. package/dist/bundle/chunk-GLYWZQY4.js +0 -86
  129. package/dist/bundle/chunk-H4AFNENN.js +0 -1343
  130. package/dist/bundle/chunk-HOF7GQWW.js +0 -142
  131. package/dist/bundle/chunk-HSPEU6S7.js +0 -209
  132. package/dist/bundle/chunk-IA7LLLEI.js +0 -100
  133. package/dist/bundle/chunk-IB55P46L.js +0 -334
  134. package/dist/bundle/chunk-IG2TJQJ7.js +0 -79
  135. package/dist/bundle/chunk-JG6LCSEX.js +0 -407
  136. package/dist/bundle/chunk-JLXXUEAM.js +0 -72
  137. package/dist/bundle/chunk-JXT6GY4V.js +0 -1023
  138. package/dist/bundle/chunk-K7YY6SXR.js +0 -738
  139. package/dist/bundle/chunk-KEKXERBE.js +0 -67181
  140. package/dist/bundle/chunk-KZN2BG3P.js +0 -721
  141. package/dist/bundle/chunk-LKH3UKLO.js +0 -230
  142. package/dist/bundle/chunk-LZPKBN3C.js +0 -193
  143. package/dist/bundle/chunk-MDEPJZYJ.js +0 -106
  144. package/dist/bundle/chunk-NB7EOAUZ.js +0 -123
  145. package/dist/bundle/chunk-NISH4UXM.js +0 -58
  146. package/dist/bundle/chunk-NSKMNIY6.js +0 -460
  147. package/dist/bundle/chunk-PL5P7UKW.js +0 -25216
  148. package/dist/bundle/chunk-PPSAWFJD.js +0 -1293
  149. package/dist/bundle/chunk-Q7ICVP25.js +0 -18
  150. package/dist/bundle/chunk-QFOP3KUP.js +0 -2603
  151. package/dist/bundle/chunk-R53XXHEI.js +0 -76
  152. package/dist/bundle/chunk-RIMPFMZE.js +0 -1251
  153. package/dist/bundle/chunk-RN6RT5CB.js +0 -58
  154. package/dist/bundle/chunk-RRTMPSQR.js +0 -29
  155. package/dist/bundle/chunk-S4ZHQMNM.js +0 -133
  156. package/dist/bundle/chunk-S6JG4YUH.js +0 -72
  157. package/dist/bundle/chunk-TAVI73RW.js +0 -288
  158. package/dist/bundle/chunk-TLG6ECZ2.js +0 -54
  159. package/dist/bundle/chunk-TXDR6YSF.js +0 -23
  160. package/dist/bundle/chunk-TY7NDMFY.js +0 -46
  161. package/dist/bundle/chunk-U5RJJ2EC.js +0 -353
  162. package/dist/bundle/chunk-UDSL3MUU.js +0 -2333
  163. package/dist/bundle/chunk-V2CNGXWX.js +0 -798
  164. package/dist/bundle/chunk-VB7FZOYX.js +0 -633
  165. package/dist/bundle/chunk-VZ5PPYDG.js +0 -77
  166. package/dist/bundle/chunk-W5JRXIG6.js +0 -27995
  167. package/dist/bundle/chunk-WIHN3ELW.js +0 -2793
  168. package/dist/bundle/chunk-WOPVBRPV.js +0 -29
  169. package/dist/bundle/chunk-WXJYMMEL.js +0 -95
  170. package/dist/bundle/chunk-XCCU2E3Z.js +0 -274
  171. package/dist/bundle/chunk-XEQQJBBO.js +0 -92
  172. package/dist/bundle/chunk-XUT7DSM5.js +0 -108
  173. package/dist/bundle/chunk-Y5E2WNWB.js +0 -35
  174. package/dist/bundle/chunk-YWDFYQOU.js +0 -82
  175. package/dist/bundle/chunk-ZLUIRFJX.js +0 -780
  176. package/dist/bundle/chunk-ZVVMGPBJ.js +0 -50
  177. package/dist/bundle/cli-3NXOSENF.js +0 -1239
  178. package/dist/bundle/command-contract-LNSAV5LA.js +0 -39
  179. package/dist/bundle/command-server-entry-4ZQPNUL4.js +0 -168
  180. package/dist/bundle/decode-K7U7X5EL.js +0 -296
  181. package/dist/bundle/dispatch-56FECRCU.js +0 -411
  182. package/dist/bundle/dist-PAKDDIBT.js +0 -191
  183. package/dist/bundle/dist-T54K3FJV.js +0 -7577
  184. package/dist/bundle/echarts-O3TNDAXJ.js +0 -42501
  185. package/dist/bundle/embed-SWLVG73O.js +0 -37
  186. package/dist/bundle/embedder-EJN75BPV.js +0 -110
  187. package/dist/bundle/failure-WDSX6H3B.js +0 -24
  188. package/dist/bundle/first-run-WPGUUC4Z.js +0 -28
  189. package/dist/bundle/first-screen-JMNEUQ46.js +0 -40
  190. package/dist/bundle/mcp-5HFPWC3W.js +0 -167
  191. package/dist/bundle/meeting-combined-5TKG2RYD.js +0 -24
  192. package/dist/bundle/meeting-model-YXXNETKC.js +0 -24
  193. package/dist/bundle/meeting-semantic-U7EUB3ET.js +0 -21
  194. package/dist/bundle/node-EGMCBAO7.js +0 -176
  195. package/dist/bundle/node-P4E63KXA.js +0 -2340
  196. package/dist/bundle/node-TLZSIHIJ.js +0 -21
  197. package/dist/bundle/node-sqlite-YVOGMDSP.js +0 -73
  198. package/dist/bundle/oauth-2SNRBIJM.js +0 -19
  199. package/dist/bundle/open-ABCPY5IH.js +0 -22
  200. package/dist/bundle/openai-4D6PXJR7.js +0 -237
  201. package/dist/bundle/process-SGHEN6MQ.js +0 -91
  202. package/dist/bundle/program-CBDQBZZ3.js +0 -4971
  203. package/dist/bundle/prompt-2QUK5QST.js +0 -16
  204. package/dist/bundle/recognize-QMQSJRIH.js +0 -25
  205. package/dist/bundle/remote-U7TC2BLZ.js +0 -30
  206. package/dist/bundle/rerank-5UPVXGVV.js +0 -51
  207. package/dist/bundle/serve-VX6GUM6J.js +0 -198
  208. package/dist/bundle/server-FOPC6DJ3.js +0 -219
  209. package/dist/bundle/server-OIVNOMVK.js +0 -87
  210. package/dist/bundle/source-HWS5SJIV.js +0 -46
  211. package/dist/bundle/sqlite-runtime-77NKDEXN.js +0 -19
  212. package/dist/bundle/state-X2HU6GB2.js +0 -35
  213. package/dist/bundle/store-2U4U6KL4.js +0 -184
  214. package/dist/bundle/store-3CHPHFP7.js +0 -301
  215. package/dist/bundle/store-Z3747L5F.js +0 -34
  216. package/dist/bundle/store-maintenance-command-UOSZJTVP.js +0 -74
  217. package/dist/bundle/surface-MUT72QON.js +0 -73
  218. package/dist/bundle/writer-RBKQ64ZM.js +0 -48
  219. package/dist/commands/account.d.ts +0 -4
  220. package/dist/commands/account.d.ts.map +0 -1
  221. package/dist/commands/account.js.map +0 -1
  222. package/dist/commands/api.d.ts +0 -3
  223. package/dist/commands/api.d.ts.map +0 -1
  224. package/dist/commands/api.js.map +0 -1
  225. package/dist/commands/crm-shared.d.ts +0 -8
  226. package/dist/commands/crm-shared.d.ts.map +0 -1
  227. package/dist/commands/crm-shared.js.map +0 -1
  228. package/dist/commands/schedule.d.ts +0 -3
  229. package/dist/commands/schedule.d.ts.map +0 -1
  230. package/dist/commands/schedule.js.map +0 -1
  231. package/dist/commands/session.d.ts +0 -35
  232. package/dist/commands/session.d.ts.map +0 -1
  233. package/dist/commands/session.js.map +0 -1
  234. package/dist/commands/write.d.ts +0 -14
  235. package/dist/commands/write.d.ts.map +0 -1
  236. package/dist/commands/write.js.map +0 -1
  237. package/dist/config.d.ts +0 -4
  238. package/dist/config.d.ts.map +0 -1
  239. package/dist/config.js.map +0 -1
  240. package/dist/context.d.ts +0 -62
  241. package/dist/context.d.ts.map +0 -1
  242. package/dist/context.js.map +0 -1
  243. package/dist/crm/activities.d.ts +0 -32
  244. package/dist/crm/activities.d.ts.map +0 -1
  245. package/dist/crm/activities.js.map +0 -1
  246. package/dist/crm/records.d.ts +0 -20
  247. package/dist/crm/records.d.ts.map +0 -1
  248. package/dist/crm/records.js.map +0 -1
  249. package/dist/crm/source.d.ts +0 -41
  250. package/dist/crm/source.d.ts.map +0 -1
  251. package/dist/crm/source.js.map +0 -1
  252. package/dist/crm/writer.d.ts +0 -14
  253. package/dist/crm/writer.d.ts.map +0 -1
  254. package/dist/crm/writer.js.map +0 -1
  255. package/dist/identity.d.ts +0 -7
  256. package/dist/identity.d.ts.map +0 -1
  257. package/dist/identity.js.map +0 -1
  258. package/dist/index.d.ts +0 -3
  259. package/dist/index.d.ts.map +0 -1
  260. package/dist/index.js.map +0 -1
  261. package/dist/program.d.ts +0 -6
  262. package/dist/program.d.ts.map +0 -1
  263. package/dist/program.js.map +0 -1
  264. package/dist/reasons.d.ts +0 -10
  265. package/dist/reasons.d.ts.map +0 -1
  266. package/dist/reasons.js.map +0 -1
  267. package/dist/setup/flow.d.ts +0 -2
  268. package/dist/setup/flow.d.ts.map +0 -1
  269. package/dist/setup/flow.js.map +0 -1
  270. package/dist/store.d.ts +0 -15
  271. package/dist/store.d.ts.map +0 -1
  272. package/dist/store.js.map +0 -1
  273. package/dist/version.d.ts +0 -2
  274. package/dist/version.d.ts.map +0 -1
  275. package/dist/version.js.map +0 -1
  276. package/dist/wcat.d.ts +0 -3
  277. package/dist/wcat.d.ts.map +0 -1
  278. package/dist/wcat.js.map +0 -1
  279. package/dist/whoami.d.ts +0 -24
  280. package/dist/whoami.d.ts.map +0 -1
  281. package/dist/whoami.js.map +0 -1
@@ -1,29 +0,0 @@
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@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/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
- };
@@ -1,95 +0,0 @@
1
- import { createRequire as __bundleRequire } from "node:module";
2
- const require = __bundleRequire(import.meta.url);
3
- import {
4
- PRAGMAS
5
- } from "./chunk-GGMAIIVE.js";
6
- import {
7
- CliError
8
- } from "./chunk-S6JG4YUH.js";
9
- import {
10
- __name
11
- } from "./chunk-ZVVMGPBJ.js";
12
-
13
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/store/sqlite-warning.js
14
- var SQLITE_WARNING = "SQLite is an experimental feature";
15
- var quieted = /* @__PURE__ */ new WeakSet();
16
- var quietSqliteWarning = /* @__PURE__ */ __name((host = process) => {
17
- if (quieted.has(host))
18
- return;
19
- quieted.add(host);
20
- const emit = host.emitWarning;
21
- host.emitWarning = function(warning, ...rest) {
22
- if (isSqliteWarning(warning, rest[0]))
23
- return;
24
- return Reflect.apply(emit, this, [warning, ...rest]);
25
- };
26
- }, "quietSqliteWarning");
27
- var isSqliteWarning = /* @__PURE__ */ __name((warning, options) => {
28
- const type = typeof options === "string" ? options : options?.type;
29
- const name = typeof warning === "string" ? type : warning.name;
30
- const message = typeof warning === "string" ? warning : warning.message;
31
- return name === "ExperimentalWarning" && message.startsWith(SQLITE_WARNING);
32
- }, "isSqliteWarning");
33
-
34
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/store/open.js
35
- var openCache = /* @__PURE__ */ __name(async (path) => {
36
- const database = await openFile(path);
37
- try {
38
- database.exec(PRAGMAS);
39
- } catch (error) {
40
- database.close();
41
- throw error;
42
- }
43
- return database;
44
- }, "openCache");
45
- var openFile = /* @__PURE__ */ __name((path) => "Bun" in globalThis ? openUnderBun(path) : openUnderNode(path), "openFile");
46
- var openUnderBun = /* @__PURE__ */ __name(async (path) => {
47
- const { openWithBunSqlite } = await import("./bun-sqlite-7I4X7CZW.js");
48
- return await openWithBunSqlite(path);
49
- }, "openUnderBun");
50
- var openUnderNode = /* @__PURE__ */ __name(async (path) => {
51
- quietSqliteWarning();
52
- const { openWithNodeSqlite } = await import("./node-sqlite-YVOGMDSP.js");
53
- return openWithNodeSqlite(path);
54
- }, "openUnderNode");
55
- var runtime = /* @__PURE__ */ __name(() => {
56
- const bun = globalThis.Bun;
57
- return bun ? `Bun ${bun.version}` : `Node ${process.versions.node}`;
58
- }, "runtime");
59
- var CAPABILITY_STATEMENTS = [
60
- `CREATE VIRTUAL TABLE temp.capability_words USING fts5(a, content = '', contentless_delete = 1,
61
- tokenize = 'unicode61 remove_diacritics 2')`,
62
- "CREATE VIRTUAL TABLE temp.capability_text USING fts5(a, tokenize = 'trigram')",
63
- "DROP TABLE temp.capability_words",
64
- "DROP TABLE temp.capability_text"
65
- ];
66
- var assertStoreCapable = /* @__PURE__ */ __name((database, on = runtime()) => {
67
- try {
68
- for (const statement of CAPABILITY_STATEMENTS)
69
- database.exec(statement);
70
- } catch (error) {
71
- const version = String(database.prepare("SELECT sqlite_version() AS version").get()?.version);
72
- const remedy = on.startsWith("Bun") ? "Run it under Node 22.16 or newer instead" : "Update Node to 22.16 or newer, or run it under Bun";
73
- throw new CliError("configuration_error", `the message store needs full-text search that this SQLite (${version}, ${on}) does not have. ${remedy}.`, { sqlite: version, runtime: on, cause: error instanceof Error ? error.message : String(error) });
74
- }
75
- }, "assertStoreCapable");
76
- var capable;
77
- var storeCapable = /* @__PURE__ */ __name(() => {
78
- capable ??= openCache(":memory:").then((database) => {
79
- try {
80
- assertStoreCapable(database);
81
- } finally {
82
- database.close();
83
- }
84
- });
85
- return capable;
86
- }, "storeCapable");
87
-
88
- export {
89
- quietSqliteWarning,
90
- openCache,
91
- openFile,
92
- CAPABILITY_STATEMENTS,
93
- assertStoreCapable,
94
- storeCapable
95
- };
@@ -1,274 +0,0 @@
1
- import { createRequire as __bundleRequire } from "node:module";
2
- const require = __bundleRequire(import.meta.url);
3
- import {
4
- wirecatDirectory
5
- } from "./chunk-TLG6ECZ2.js";
6
- import {
7
- CliError
8
- } from "./chunk-S6JG4YUH.js";
9
- import {
10
- __name
11
- } from "./chunk-ZVVMGPBJ.js";
12
-
13
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/speech/models.js
14
- var huggingFace = /* @__PURE__ */ __name((repository, commit) => (name) => `https://huggingface.co/csukuangfj/${repository}/resolve/${commit}/${name}`, "huggingFace");
15
- var gigaam = huggingFace("sherpa-onnx-nemo-transducer-punct-giga-am-v3-russian-2025-12-16", "a6039be7cee829a9044a69ac0ebaf1c191217c97");
16
- var gigaamCtc = huggingFace("sherpa-onnx-nemo-ctc-punct-giga-am-v3-russian-2025-12-16", "4fb5407ff028a69fec516cdf4c10fac9ddea7c16");
17
- var parakeet = huggingFace("sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8", "2bda32ec70b097a55adaa07d9a7173915b43cc78");
18
- var MODELS = [
19
- {
20
- id: "gigaam-v3",
21
- title: "GigaAM v3, with punctuation",
22
- languages: "Russian \u2014 the best of the three for Russian",
23
- language: "ru",
24
- featureDim: 64,
25
- files: [
26
- {
27
- name: "encoder.int8.onnx",
28
- url: gigaam("encoder.int8.onnx"),
29
- sha256: "369f35a71bf288d3b8e0391fabd8dba5f2314088d440bca474056b7b4b6e66bf",
30
- bytes: 224570820
31
- },
32
- {
33
- name: "decoder.onnx",
34
- url: gigaam("decoder.onnx"),
35
- sha256: "38fc7475443ea2a26f63211ca350f73ac50fff824ab7a3876ee2bd610c53bbc4",
36
- bytes: 4600132
37
- },
38
- {
39
- name: "joiner.onnx",
40
- url: gigaam("joiner.onnx"),
41
- sha256: "602ff7017a93311aad34df1437c8d7f49911353c13d6eae7a6ee7b041339465c",
42
- bytes: 2712896
43
- },
44
- {
45
- name: "tokens.txt",
46
- url: gigaam("tokens.txt"),
47
- sha256: "39abae20e692998290c574e606f11a9edef2902a1995463fcff63d1490cf22b7",
48
- bytes: 13354
49
- }
50
- ],
51
- config: /* @__PURE__ */ __name((path) => ({
52
- transducer: { encoder: path("encoder.int8.onnx"), decoder: path("decoder.onnx"), joiner: path("joiner.onnx") },
53
- tokens: path("tokens.txt"),
54
- modelType: "nemo_transducer"
55
- }), "config")
56
- },
57
- {
58
- id: "gigaam-v3-ctc",
59
- title: "GigaAM v3 CTC, with punctuation \u2014 a little faster",
60
- languages: "Russian \u2014 a little faster, rougher with capital letters",
61
- language: "ru",
62
- featureDim: 64,
63
- files: [
64
- {
65
- name: "model.int8.onnx",
66
- url: gigaamCtc("model.int8.onnx"),
67
- sha256: "d5fea8df94263c285e54b21e5774b707c707192d3bdbeffd7b1eb07fb6743b35",
68
- bytes: 224893661
69
- },
70
- {
71
- name: "tokens.txt",
72
- url: gigaamCtc("tokens.txt"),
73
- sha256: "142de7570b3de5b3035ce111a89c228e80e6085273731d944093ddf24fa539cd",
74
- bytes: 2007
75
- }
76
- ],
77
- config: /* @__PURE__ */ __name((path) => ({ nemoCtc: { model: path("model.int8.onnx") }, tokens: path("tokens.txt") }), "config")
78
- },
79
- {
80
- id: "parakeet-v3",
81
- title: "NVIDIA Parakeet TDT 0.6B v3",
82
- /** The model card's list: huggingface.co/nvidia/parakeet-tdt-0.6b-v3, read 2026-09-24. */
83
- languages: "25: bg cs da de el en es et fi fr hr hu it lt lv mt nl pl pt ro ru sk sl sv uk",
84
- featureDim: 80,
85
- files: [
86
- {
87
- name: "encoder.int8.onnx",
88
- url: parakeet("encoder.int8.onnx"),
89
- sha256: "acfc2b4456377e15d04f0243af540b7fe7c992f8d898d751cf134c3a55fd2247",
90
- bytes: 652184281
91
- },
92
- {
93
- name: "decoder.int8.onnx",
94
- url: parakeet("decoder.int8.onnx"),
95
- sha256: "179e50c43d1a9de79c8a24149a2f9bac6eb5981823f2a2ed88d655b24248db4e",
96
- bytes: 11845275
97
- },
98
- {
99
- name: "joiner.int8.onnx",
100
- url: parakeet("joiner.int8.onnx"),
101
- sha256: "3164c13fc2821009440d20fcb5fdc78bff28b4db2f8d0f0b329101719c0948b3",
102
- bytes: 6355277
103
- },
104
- {
105
- name: "tokens.txt",
106
- url: parakeet("tokens.txt"),
107
- sha256: "d58544679ea4bc6ac563d1f545eb7d474bd6cfa467f0a6e2c1dc1c7d37e3c35d",
108
- bytes: 93939
109
- }
110
- ],
111
- config: /* @__PURE__ */ __name((path) => ({
112
- transducer: {
113
- encoder: path("encoder.int8.onnx"),
114
- decoder: path("decoder.int8.onnx"),
115
- joiner: path("joiner.int8.onnx")
116
- },
117
- tokens: path("tokens.txt"),
118
- modelType: "nemo_transducer"
119
- }), "config")
120
- }
121
- ];
122
- var OPENAI_TRANSCRIBE_MODEL = "gpt-transcribe";
123
- var VAD = {
124
- name: "silero_vad.onnx",
125
- url: "https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/silero_vad.onnx",
126
- sha256: "9e2449e1087496d8d4caba907f23e0bd3f78d91fa552479bb9c23ac09cbb1fd6",
127
- bytes: 643854
128
- };
129
- var DEFAULT_ORDER = ["parakeet-v3", "gigaam-v3", "gigaam-v3-ctc"];
130
- var orderedModels = /* @__PURE__ */ __name((order = DEFAULT_ORDER) => [.../* @__PURE__ */ new Set([...order, ...DEFAULT_ORDER])].map(speechModel), "orderedModels");
131
- var findModel = /* @__PURE__ */ __name((id) => MODELS.find((model) => model.id === id), "findModel");
132
- var speechModel = /* @__PURE__ */ __name((id) => {
133
- const model = findModel(id);
134
- if (!model) {
135
- throw new CliError("validation_error", `no speech model "${id}" \u2014 one of ${MODELS.map((known) => known.id).join(", ")}`);
136
- }
137
- return model;
138
- }, "speechModel");
139
-
140
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/speech/install.js
141
- import { createHash, randomUUID } from "node:crypto";
142
- import { createReadStream, createWriteStream, mkdirSync, statSync } from "node:fs";
143
- import { rename, rm } from "node:fs/promises";
144
- import { dirname, join } from "node:path";
145
- import { Readable, Transform } from "node:stream";
146
- import { pipeline } from "node:stream/promises";
147
- var sharedModelsDirectory = /* @__PURE__ */ __name((kind, env = process.env) => join(wirecatDirectory(env), "models", kind), "sharedModelsDirectory");
148
- var modelsDirectory = /* @__PURE__ */ __name((env = process.env) => sharedModelsDirectory("audio", env), "modelsDirectory");
149
- var STALL_MS = 6e4;
150
- var watchdog = /* @__PURE__ */ __name((ms) => {
151
- const controller = new AbortController();
152
- let timer = setTimeout(() => controller.abort(), ms);
153
- return {
154
- signal: controller.signal,
155
- poke: /* @__PURE__ */ __name(() => {
156
- clearTimeout(timer);
157
- timer = setTimeout(() => controller.abort(), ms);
158
- }, "poke"),
159
- stop: /* @__PURE__ */ __name(() => clearTimeout(timer), "stop")
160
- };
161
- }, "watchdog");
162
- var modelPath = /* @__PURE__ */ __name((directory, model) => (name) => join(directory, model.id, name), "modelPath");
163
- var vadPath = /* @__PURE__ */ __name((directory) => join(directory, VAD.name), "vadPath");
164
- var placed = /* @__PURE__ */ __name((model, directory) => [
165
- ...model.files.map((file) => [file, modelPath(directory, model)(file.name)]),
166
- [VAD, vadPath(directory)]
167
- ], "placed");
168
- var isInstalled = /* @__PURE__ */ __name((model, directory) => filesPresent(placed(model, directory)), "isInstalled");
169
- var filesPresent = /* @__PURE__ */ __name((files) => files.every(([file, path]) => sizeOf(path) === file.bytes), "filesPresent");
170
- var sizeOf = /* @__PURE__ */ __name((path) => {
171
- try {
172
- return statSync(path).size;
173
- } catch {
174
- return void 0;
175
- }
176
- }, "sizeOf");
177
- var installedBytes = /* @__PURE__ */ __name((model) => model.files.reduce((sum, file) => sum + file.bytes, 0), "installedBytes");
178
- var install = /* @__PURE__ */ __name(async (model, directory, { fetch: get = fetch, progress, bytes, verifyExisting } = {}) => {
179
- mkdirSync(join(directory, model.id), { recursive: true, mode: 448 });
180
- await installFiles(placed(model, directory), { fetch: get, progress, bytes, verifyExisting });
181
- }, "install");
182
- var installFiles = /* @__PURE__ */ __name(async (files, { fetch: get = fetch, progress, bytes = /* @__PURE__ */ __name(() => {
183
- }, "bytes"), verifyExisting } = {}) => {
184
- if (verifyExisting)
185
- for (const [file, path] of files) {
186
- if (sizeOf(path) !== void 0) {
187
- const hash = createHash("sha256");
188
- for await (const chunk of createReadStream(path))
189
- hash.update(chunk);
190
- if (hash.digest("hex") !== file.sha256) {
191
- progress?.(`${path}: not the file this version expects, downloading it again`);
192
- await rm(path, { force: true });
193
- }
194
- }
195
- }
196
- const total = files.reduce((sum, [file]) => sum + file.bytes, 0);
197
- const missing = files.filter(([file, path]) => sizeOf(path) !== file.bytes);
198
- let done = total - missing.reduce((sum, [file]) => sum + file.bytes, 0);
199
- bytes(done, total);
200
- for (const [file, path] of missing) {
201
- mkdirSync(dirname(path), { recursive: true, mode: 448 });
202
- progress?.(`downloading ${file.name} (${megabytes(file.bytes)})`);
203
- const before = done;
204
- await fetchVerified(file, path, get, (received) => {
205
- done = before + received;
206
- bytes(done, total);
207
- });
208
- }
209
- }, "installFiles");
210
- var fetchVerified = /* @__PURE__ */ __name(async (file, path, get, received) => {
211
- const stalled = watchdog(STALL_MS);
212
- try {
213
- await fetchInto(file, path, get, stalled, received);
214
- } catch (error) {
215
- if (stalled.signal.aborted) {
216
- throw new CliError("timeout", `${file.name} stopped downloading for ${STALL_MS / 1e3} s \u2014 nothing was installed`);
217
- }
218
- throw error;
219
- } finally {
220
- stalled.stop();
221
- }
222
- }, "fetchVerified");
223
- var fetchInto = /* @__PURE__ */ __name(async (file, path, get, stalled, received) => {
224
- const response = await get(file.url, { signal: stalled.signal });
225
- if (!response.ok || !response.body) {
226
- await response.body?.cancel();
227
- throw new CliError("network_error", `${file.name} could not be downloaded: HTTP ${response.status}`);
228
- }
229
- const partial = `${path}.${randomUUID()}.part`;
230
- const hash = createHash("sha256");
231
- let bytes = 0;
232
- const hashing = new Transform({
233
- transform(chunk, _encoding, done) {
234
- stalled.poke();
235
- bytes += chunk.length;
236
- if (bytes > file.bytes) {
237
- done(new CliError("invalid_response", `${file.name} is larger than this version expects \u2014 nothing was installed`));
238
- return;
239
- }
240
- hash.update(chunk);
241
- received(bytes);
242
- done(null, chunk);
243
- }
244
- });
245
- try {
246
- await pipeline(Readable.fromWeb(response.body), hashing, createWriteStream(partial, { flags: "wx", mode: 384 }));
247
- const actual = hash.digest("hex");
248
- if (actual !== file.sha256) {
249
- throw new CliError("invalid_response", `${file.name} is not the file this version expects (sha256 ${actual}) \u2014 nothing was installed`);
250
- }
251
- await rename(partial, path);
252
- } finally {
253
- await rm(partial, { force: true });
254
- }
255
- }, "fetchInto");
256
- var megabytes = /* @__PURE__ */ __name((bytes) => bytes < 1e6 ? "under 1 MB" : `${Math.round(bytes / 1e6)} MB`, "megabytes");
257
-
258
- export {
259
- OPENAI_TRANSCRIBE_MODEL,
260
- VAD,
261
- DEFAULT_ORDER,
262
- orderedModels,
263
- speechModel,
264
- sharedModelsDirectory,
265
- modelsDirectory,
266
- modelPath,
267
- vadPath,
268
- isInstalled,
269
- filesPresent,
270
- installedBytes,
271
- install,
272
- installFiles,
273
- megabytes
274
- };
@@ -1,92 +0,0 @@
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@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/runs/secrets.js
8
- var SECRET_WORDS = /* @__PURE__ */ new Set([
9
- "authorization",
10
- "cookie",
11
- "credential",
12
- "credentials",
13
- "passphrase",
14
- "password",
15
- "passwd",
16
- "pwd",
17
- "pass",
18
- "passcode",
19
- "pin",
20
- "otp",
21
- "2fa",
22
- "secret",
23
- "token",
24
- "contrase\xF1a",
25
- "contrasena",
26
- "clave",
27
- "\u043F\u0430\u0440\u043E\u043B\u044C",
28
- "\u043F\u0438\u043D",
29
- "\u043A\u043E\u0434",
30
- ...["api", "auth", "service", "account", "db", "database", "priv", "private", "client"].map((word) => `${word}key`),
31
- ...["db", "database", "key"].map((word) => `${word}pass`)
32
- ]);
33
- var secretNamed = /* @__PURE__ */ __name((name) => {
34
- const words = name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").split(/[\s_.-]+/).map((word) => word.toLowerCase());
35
- return words.some((word, at) => SECRET_WORDS.has(word) || SECRET_WORDS.has(word + (words[at + 1] ?? "")));
36
- }, "secretNamed");
37
- var START = "(?<![A-Za-z0-9_-])";
38
- var END = "(?![A-Za-z0-9_-])";
39
- var KNOWN_TOKENS = new RegExp(`${[
40
- "gh[pousr]_[A-Za-z0-9]{36,}",
41
- "github_pat_[A-Za-z0-9_]{22,}",
42
- "sk-[A-Za-z0-9_-]{20,}",
43
- "xox[abprs]-[A-Za-z0-9-]{10,}",
44
- "(?:AKIA|ASIA)[A-Z0-9]{16}",
45
- "AIza[A-Za-z0-9_-]{35}",
46
- "(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{10,}",
47
- "npm_[A-Za-z0-9]{36}",
48
- "eyJ[A-Za-z0-9_-]{5,}\\.eyJ[A-Za-z0-9_-]{5,}\\.[A-Za-z0-9_-]*"
49
- ].map((pattern) => `${START}${pattern}${END}`).join("|")}|(?<!\\d)\\d{8,10}:[A-Za-z0-9_-]{35}${END}`, "g");
50
- var WEBHOOK_PATH = /(\/rest\/\d+\/)[^/\s?#"']+/g;
51
- var PRIVATE_KEY = /-----BEGIN[A-Z ]* PRIVATE KEY-----[\s\S]*?(?:-----END[A-Z ]* PRIVATE KEY-----|$)/g;
52
- var SCHEME = /(?<![A-Za-z])(Bearer|Basic)(\s+)(?![A-Z]?[a-z]+(?![A-Za-z0-9]))[A-Za-z0-9._~+/=-]{8,}/g;
53
- var NAMED_PAIR = /(?<![\p{L}\p{N}])([\p{L}\p{N}_.-]*(?:token|pass|pwd|pin|otp|2fa|secret|credential|cookie|authorization|key|contrase|clave|пароль|пин|код)[\p{L}\p{N}_.-]*)(["']?\s*(?:=>|[:=])\s*["']?|\s+(?![\p{L}]+(?![\p{L}\p{N}])))((?:Bearer\s+|Basic\s+)?)([^\s"'&,;]+)/giu;
54
- var looksRandom = /* @__PURE__ */ __name((run) => {
55
- if (run.length < 20)
56
- return false;
57
- const classes = [/[a-z]/, /[A-Z]/, /\d/, /[^A-Za-z0-9]/].filter((kind) => kind.test(run)).length;
58
- if (classes < 3)
59
- return false;
60
- let switches = 0;
61
- for (let at = 1; at < run.length; at++) {
62
- const [before, after] = [run[at - 1], run[at]];
63
- if (/[a-z]/.test(before) && /[A-Z]/.test(after) || /[A-Z]/.test(before) && /[a-z]/.test(after))
64
- switches += 1;
65
- }
66
- if (switches / run.length < 0.15)
67
- return false;
68
- const pieces = run.match(/[A-Z]?[a-z]+|[A-Z]+(?![a-z])|\d+/g) ?? [];
69
- if (pieces.join("").length / Math.max(pieces.length, 1) >= 2.75)
70
- return false;
71
- return entropy(run) >= 3.5;
72
- }, "looksRandom");
73
- var entropy = /* @__PURE__ */ __name((text) => {
74
- const counts = /* @__PURE__ */ new Map();
75
- for (const char of text)
76
- counts.set(char, (counts.get(char) ?? 0) + 1);
77
- let bits = 0;
78
- for (const count of counts.values())
79
- bits -= count / text.length * Math.log2(count / text.length);
80
- return bits;
81
- }, "entropy");
82
- var withoutSecrets = /* @__PURE__ */ __name((text, mark = "[redacted]") => text.replace(WEBHOOK_PATH, `$1${mark}`).replace(PRIVATE_KEY, mark).replace(KNOWN_TOKENS, mark).replace(SCHEME, `$1$2${mark}`).replace(NAMED_PAIR, (whole, name, separator, scheme) => secretNamed(name) ? `${name}${separator}${scheme}${mark}` : whole).replace(/[!-~]{20,}/g, (token) => (
83
- // A URL or a path is somebody's address, not a key; a credential in one is caught by the rules above.
84
- token.includes("://") || /^(?:\/|~\/|\.\.?\/)/.test(token) ? token : token.replace(RUN, (run) => looksRandom(run) ? mark : run.replace(HEX, (hex) => entropy(hex) >= 3 ? mark : hex))
85
- )), "withoutSecrets");
86
- var RUN = /(?<![A-Za-z0-9_+/-])[A-Za-z0-9_+/-]{20,}/g;
87
- var HEX = /(?<![A-Za-z0-9])(?=[0-9]*[a-f])[0-9a-f]{20,}(?![A-Za-z0-9])/g;
88
-
89
- export {
90
- secretNamed,
91
- withoutSecrets
92
- };
@@ -1,108 +0,0 @@
1
- import { createRequire as __bundleRequire } from "node:module";
2
- const require = __bundleRequire(import.meta.url);
3
- import {
4
- CLIENT_INFO_META_KEY
5
- } from "./chunk-PL5P7UKW.js";
6
- import {
7
- agentOf,
8
- clientHash,
9
- currentCaller
10
- } from "./chunk-CGW5R4UD.js";
11
- import {
12
- __name
13
- } from "./chunk-ZVVMGPBJ.js";
14
-
15
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/mcp/caller.js
16
- var callingAgent = /* @__PURE__ */ __name((fallback, caller = currentCaller()) => {
17
- const client = caller?.agent?.client?.name;
18
- if (client && client !== "unknown")
19
- return client;
20
- const kind = caller?.agent?.kind;
21
- return kind && kind !== "mcp-client" ? kind : fallback;
22
- }, "callingAgent");
23
- var CALLER_META_KEY = "wirecat.dev/caller";
24
- var PROXY_CLIENT_NAME = "all-profiles";
25
- var NAME = /^[\w .@()/+-]{1,64}$/;
26
- var plain = /* @__PURE__ */ __name((value) => typeof value === "string" && NAME.test(value.trim()) ? value.trim() : void 0, "plain");
27
- var clientFrom = /* @__PURE__ */ __name((value) => {
28
- if (!value || typeof value !== "object")
29
- return void 0;
30
- const { name, version } = value;
31
- const named = plain(name);
32
- if (!named)
33
- return void 0;
34
- const versioned = plain(version);
35
- return { name: named, ...versioned ? { version: versioned } : {} };
36
- }, "clientFrom");
37
- var callerOf = /* @__PURE__ */ __name((ctx, tool, source) => {
38
- const meta = ctx?.mcpReq?._meta;
39
- const requestId = ctx?.mcpReq?.id;
40
- const initialized = source.client?.();
41
- const proxied = initialized?.name === PROXY_CLIENT_NAME && !ctx?.http ? passedOn(meta?.[CALLER_META_KEY], tool) : void 0;
42
- if (proxied)
43
- return proxied;
44
- const client = clientFrom(meta?.[CLIENT_INFO_META_KEY]) ?? clientFrom(initialized);
45
- const mcp = /* @__PURE__ */ __name((connection) => ({
46
- tool,
47
- ...requestId === void 0 ? {} : { request_id: String(requestId) },
48
- ...connection ? { connection_id: connection } : {}
49
- }), "mcp");
50
- const auth = ctx?.http?.authInfo;
51
- if (auth) {
52
- const registered = plain(auth.extra?.clientName);
53
- return {
54
- via: "mcp-http",
55
- agent: {
56
- kind: "mcp-client",
57
- session_id: ctx?.sessionId ?? null,
58
- client: {
59
- name: registered ?? client?.name ?? "unknown",
60
- ...client?.version ? { version: client.version } : {},
61
- id: clientHash(auth.clientId)
62
- }
63
- },
64
- mcp: mcp(ctx?.sessionId)
65
- };
66
- }
67
- const agent = agentOf(source.env) ?? { kind: "mcp-client", session_id: null };
68
- return { via: "mcp-stdio", agent: { ...agent, ...client ? { client } : {} }, mcp: mcp(source.connectionId) };
69
- }, "callerOf");
70
- var passedOn = /* @__PURE__ */ __name((value, tool) => {
71
- if (!value || typeof value !== "object")
72
- return void 0;
73
- const { via, agent, mcp } = value;
74
- if (via !== "mcp-stdio" && via !== "mcp-http")
75
- return void 0;
76
- const a = agent && typeof agent === "object" ? agent : void 0;
77
- const kind = plain(a?.kind);
78
- const session = typeof a?.session_id === "string" && /^[A-Za-z0-9._:-]{1,128}$/.test(a.session_id) ? a.session_id : null;
79
- const client = clientFrom(a?.client);
80
- const id = a?.client && typeof a.client === "object" ? a.client.id : void 0;
81
- const m = mcp && typeof mcp === "object" ? mcp : {};
82
- const request = plain(m.request_id);
83
- const connection = typeof m.connection_id === "string" && /^[\w-]{1,128}$/.test(m.connection_id) ? m.connection_id : void 0;
84
- return {
85
- via,
86
- ...kind ? {
87
- agent: {
88
- kind,
89
- session_id: session,
90
- ...a?.from_chat === true ? { from_chat: true } : {},
91
- ...client ? { client: { ...client, ...typeof id === "string" && /^[0-9a-f]{8}$/.test(id) ? { id } : {} } } : {}
92
- }
93
- } : {},
94
- mcp: {
95
- tool,
96
- ...request ? { request_id: request } : {},
97
- ...connection ? { connection_id: connection } : {},
98
- proxied: true
99
- }
100
- };
101
- }, "passedOn");
102
-
103
- export {
104
- callingAgent,
105
- CALLER_META_KEY,
106
- PROXY_CLIENT_NAME,
107
- callerOf
108
- };
@@ -1,35 +0,0 @@
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
- // cli-dev-bundle:from:cli-dev-bundle:from
8
- import * as module from "node:module";
9
- import { dirname } from "node:path";
10
- import { fileURLToPath, pathToFileURL } from "node:url";
11
- var resolveFrom = /* @__PURE__ */ __name((parent, specifier) => {
12
- if (globalThis.Bun) {
13
- if (specifier.includes(":")) return import.meta.resolve(specifier);
14
- try {
15
- return pathToFileURL(globalThis.Bun.resolveSync(specifier, dirname(fileURLToPath(parent)))).href;
16
- } catch {
17
- return import.meta.resolve(specifier);
18
- }
19
- }
20
- if (!module.registerHooks) return import.meta.resolve(specifier);
21
- const hooks = module.registerHooks({
22
- resolve: /* @__PURE__ */ __name((asked, context, next) => next(asked, asked === specifier ? { ...context, parentURL: parent } : context), "resolve")
23
- });
24
- try {
25
- return import.meta.resolve(specifier);
26
- } finally {
27
- hooks.deregister();
28
- }
29
- }, "resolveFrom");
30
- var importFrom = /* @__PURE__ */ __name(async (parent, specifier) => import(resolveFrom(parent, specifier)), "importFrom");
31
-
32
- export {
33
- resolveFrom,
34
- importFrom
35
- };