@wirecat/tg-cli 0.103.0 → 0.104.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 (87) hide show
  1. package/README.md +1 -0
  2. package/dist/bin/tg.js +2 -2
  3. package/dist/bundle/{adapter-QG3YFFOY.js → adapter-QTAHA2JC.js} +37 -37
  4. package/dist/bundle/{all-profiles-ECXH3TBF.js → all-profiles-7CXBVRFU.js} +5 -5
  5. package/dist/bundle/{anthropic-5MKO3QX7.js → anthropic-FWBQ7JHT.js} +3 -3
  6. package/dist/bundle/app-server-XF4GY2Y6.js +222 -0
  7. package/dist/bundle/{bot-api-4DQPIOMK.js → bot-api-XDMMWRYI.js} +38 -38
  8. package/dist/bundle/{bot-history-UN74XXLU.js → bot-history-TU2X7RNN.js} +10 -10
  9. package/dist/bundle/{bun-PS73VF2C.js → bun-6GSDPKNZ.js} +2 -2
  10. package/dist/bundle/{bun-sqlite-RAWGPH23.js → bun-sqlite-AO27E35V.js} +2 -2
  11. package/dist/bundle/{chunk-ZHXSRYJ5.js → chunk-3GGU65YR.js} +7 -5
  12. package/dist/bundle/{chunk-SSV37M5T.js → chunk-3XZQQGCB.js} +46 -46
  13. package/dist/bundle/{chunk-VZN5LD26.js → chunk-54RJDS3X.js} +2 -2
  14. package/dist/bundle/{chunk-SSALGKMJ.js → chunk-5K7E36ND.js} +2 -2
  15. package/dist/bundle/{chunk-RKQIEJFR.js → chunk-6K4QGBXU.js} +1 -1
  16. package/dist/bundle/{chunk-DLF3H6NP.js → chunk-6YUFPSSE.js} +4 -4
  17. package/dist/bundle/{chunk-TEO2KP52.js → chunk-7WHM3KNI.js} +1 -1
  18. package/dist/bundle/{chunk-57XGUIXA.js → chunk-ADMV4WGV.js} +4 -4
  19. package/dist/bundle/{chunk-RD7SSY7H.js → chunk-B7TTM75D.js} +1 -1
  20. package/dist/bundle/{chunk-BV4N333Y.js → chunk-BI2AXVHY.js} +2 -2
  21. package/dist/bundle/{chunk-F27OI4J2.js → chunk-BIWJK5YU.js} +1 -1
  22. package/dist/bundle/{chunk-Q2LBOPKO.js → chunk-BKVJNPA6.js} +25 -14
  23. package/dist/bundle/{chunk-3CP7RK5R.js → chunk-C5N7G6UH.js} +1 -1
  24. package/dist/bundle/{chunk-QF7VVIF4.js → chunk-DANCAYRP.js} +11 -6
  25. package/dist/bundle/{chunk-EMC57SOZ.js → chunk-FRZHF2X6.js} +9 -7
  26. package/dist/bundle/{chunk-NIVZHTN4.js → chunk-FUWSIEYY.js} +9 -9
  27. package/dist/bundle/{chunk-EQHQ2AX3.js → chunk-GE22MYA6.js} +57 -48
  28. package/dist/bundle/{chunk-KCVDWZWS.js → chunk-GZ5CR5QB.js} +7 -7
  29. package/dist/bundle/{chunk-OGVBRRWY.js → chunk-HOR7DS3P.js} +20 -20
  30. package/dist/bundle/{chunk-6N25NZOE.js → chunk-KRLCUBII.js} +5 -5
  31. package/dist/bundle/{chunk-RMC2S3F4.js → chunk-LJCGQMGN.js} +4 -4
  32. package/dist/bundle/{chunk-YI72UVTJ.js → chunk-LOFG3Q35.js} +1 -1
  33. package/dist/bundle/{chunk-Z2DPNTSU.js → chunk-LSQUNABH.js} +1 -1
  34. package/dist/bundle/{chunk-537O7OVE.js → chunk-MB3PCNRL.js} +2 -2
  35. package/dist/bundle/{chunk-LAYPLF7G.js → chunk-MCD2GANK.js} +5 -5
  36. package/dist/bundle/{chunk-5HPAPVCB.js → chunk-MR4LW4EC.js} +2140 -1907
  37. package/dist/bundle/{chunk-AUKAZRF6.js → chunk-N6VHHMSZ.js} +1 -1
  38. package/dist/bundle/{chunk-MHHDVR4G.js → chunk-P3WU6UYJ.js} +193 -193
  39. package/dist/bundle/{chunk-3QX6SOEO.js → chunk-PHQTSF44.js} +4 -4
  40. package/dist/bundle/{chunk-GO354DJ5.js → chunk-PWIE7VBL.js} +1 -1
  41. package/dist/bundle/{chunk-KQ5BUI5T.js → chunk-QVTCOBN5.js} +257 -243
  42. package/dist/bundle/{chunk-NKN54EDN.js → chunk-QY7MW7HK.js} +2 -2
  43. package/dist/bundle/{chunk-HCDZWFXO.js → chunk-RRWMYR2H.js} +10 -9
  44. package/dist/bundle/{chunk-AAMJZJYC.js → chunk-RTAV5XNT.js} +8 -8
  45. package/dist/bundle/{server-6XYURULQ.js → chunk-SZE6425L.js} +46 -62
  46. package/dist/bundle/{chunk-FSPDODVT.js → chunk-TJR37WKA.js} +10 -10
  47. package/dist/bundle/{chunk-COZ74WW4.js → chunk-U2AK4QXY.js} +20 -2
  48. package/dist/bundle/{chunk-DWQ4QT6X.js → chunk-UDXRDFHN.js} +92 -91
  49. package/dist/bundle/{chunk-CMQ34EZL.js → chunk-UT6G2X7T.js} +4 -3
  50. package/dist/bundle/{chunk-S5M4HFOZ.js → chunk-UTVANQN5.js} +1 -1
  51. package/dist/bundle/{chunk-H2UTBYFC.js → chunk-UVYY5EIS.js} +1 -1
  52. package/dist/bundle/{chunk-G5IMOOPB.js → chunk-Y3VNNLUT.js} +1 -1
  53. package/dist/bundle/{chunk-TPFLD4OM.js → chunk-Y5PJQPMQ.js} +1 -1
  54. package/dist/bundle/{chunk-WULARSC4.js → chunk-YBQ753RP.js} +20 -20
  55. package/dist/bundle/{chunk-3IXKDIPH.js → chunk-YD6ZQ6LM.js} +44 -42
  56. package/dist/bundle/{chunk-BYYSVINK.js → chunk-ZBH7Z6WX.js} +2 -2
  57. package/dist/bundle/{command-contract-ZGFJTLB2.js → command-contract-RICU4OWW.js} +12 -12
  58. package/dist/bundle/{echarts-UEQDIHVQ.js → echarts-2YP32GX5.js} +2 -2
  59. package/dist/bundle/{embed-5DPZKRW5.js → embed-QNWVBCL5.js} +3 -3
  60. package/dist/bundle/{embedder-NBQXDXAO.js → embedder-ENS7ARPP.js} +6 -6
  61. package/dist/bundle/{entry-EE6YRAP4.js → entry-MPYSQPZO.js} +3 -3
  62. package/dist/bundle/{first-run-OSEVVWNT.js → first-run-YLB7RNGP.js} +5 -5
  63. package/dist/bundle/{first-screen-753THOU6.js → first-screen-AYOE4JFC.js} +13 -13
  64. package/dist/bundle/{identity-LNH33PN3.js → identity-XQLO7NYW.js} +1 -1
  65. package/dist/bundle/{instructions-PYGVIT7I.js → instructions-5F4XG3B6.js} +3 -1
  66. package/dist/bundle/{node-3OBKCX6M.js → node-JOUDFPFN.js} +2 -2
  67. package/dist/bundle/{node-sqlite-DMMTDRFB.js → node-sqlite-ZY6ZFFXS.js} +2 -2
  68. package/dist/bundle/{oauth-FX5DDCRS.js → oauth-KOR3ZNTA.js} +4 -4
  69. package/dist/bundle/{open-G6QRQAAL.js → open-JACXAGY5.js} +1 -1
  70. package/dist/bundle/{process-47MMIFIJ.js → process-7W3X5VME.js} +1 -1
  71. package/dist/bundle/{program-LBHBWRK5.js → program-NSZWGHNJ.js} +40 -40
  72. package/dist/bundle/{prompt-CJ6Y4JYC.js → prompt-CRRG5UB6.js} +2 -2
  73. package/dist/bundle/{recognize-7BLTOI45.js → recognize-ASXEB45M.js} +3 -3
  74. package/dist/bundle/{remote-Q4A4JY6U.js → remote-CB3GAXGJ.js} +4 -4
  75. package/dist/bundle/{rerank-CQAR46L3.js → rerank-PDD5BPID.js} +4 -4
  76. package/dist/bundle/{serve-2UO2YMMG.js → serve-M4XFAYUM.js} +6 -6
  77. package/dist/bundle/{server-FMKC4RLL.js → server-IN673OYO.js} +26 -26
  78. package/dist/bundle/server-ISWPSKQ6.js +55 -0
  79. package/dist/bundle/{state-RNWN2RDY.js → state-626GOOVZ.js} +3 -3
  80. package/dist/bundle/{store-BBHTR477.js → store-6JM4HJU5.js} +7 -7
  81. package/dist/bundle/store-maintenance-command-DI2UX4V3.js +44 -0
  82. package/dist/bundle/tg.js +2 -2
  83. package/dist/version.d.ts +1 -1
  84. package/dist/version.js +1 -1
  85. package/package.json +2 -2
  86. package/skills/tg-cli/SKILL.md +1 -0
  87. package/dist/bundle/store-maintenance-command-GD6OLRXH.js +0 -44
package/README.md CHANGED
@@ -269,6 +269,7 @@ form, so set up approval in your agent app.
269
269
 
270
270
  ```sh
271
271
  claude mcp add tg -- tg personal mcp serve # Claude Code, by hand
272
+ claude mcp add tg -- tg mcp serve --profiles all # one server for every profile
272
273
  tg personal mcp check # check the local MCP server
273
274
  ```
274
275
 
package/dist/bin/tg.js CHANGED
@@ -9,7 +9,7 @@ if (
9
9
  (words[0] === "--version" || words[0] === "-V") &&
10
10
  !Object.keys(process.env).some((key) => key.endsWith("_TEST_ARGV_LOG"))
11
11
  ) {
12
- process.stdout.write("0.103.0\n")
12
+ process.stdout.write("0.104.0\n")
13
13
  } else {
14
14
  // Before the bundle compiles: the bundle's own call comes after its chunks.
15
15
  module.enableCompileCache()
@@ -29,7 +29,7 @@ if (
29
29
  })
30
30
  }
31
31
  const running = import("../bundle/tg.js")
32
- const chunks = ["../bundle/adapter-QG3YFFOY.js","../bundle/all-profiles-ECXH3TBF.js","../bundle/anthropic-5MKO3QX7.js","../bundle/bot-api-4DQPIOMK.js","../bundle/bot-history-UN74XXLU.js","../bundle/bun-PS73VF2C.js","../bundle/bun-sqlite-RAWGPH23.js","../bundle/command-contract-ZGFJTLB2.js","../bundle/dist-I7OZPHAZ.js","../bundle/echarts-UEQDIHVQ.js","../bundle/embed-5DPZKRW5.js","../bundle/embedder-NBQXDXAO.js","../bundle/entry-EE6YRAP4.js","../bundle/first-run-OSEVVWNT.js","../bundle/first-screen-753THOU6.js","../bundle/identity-LNH33PN3.js","../bundle/instructions-PYGVIT7I.js","../bundle/mcp-OQBZXELQ.js","../bundle/node-3OBKCX6M.js","../bundle/node-P4E63KXA.js","../bundle/node-TLZSIHIJ.js","../bundle/node-sqlite-DMMTDRFB.js","../bundle/oauth-FX5DDCRS.js","../bundle/open-G6QRQAAL.js","../bundle/process-47MMIFIJ.js","../bundle/program-LBHBWRK5.js","../bundle/prompt-CJ6Y4JYC.js","../bundle/proxy-transport-YSBYG26I.js","../bundle/recognize-7BLTOI45.js","../bundle/remote-Q4A4JY6U.js","../bundle/rerank-CQAR46L3.js","../bundle/serve-2UO2YMMG.js","../bundle/server-6XYURULQ.js","../bundle/server-FMKC4RLL.js","../bundle/state-RNWN2RDY.js","../bundle/store-BBHTR477.js","../bundle/store-maintenance-command-GD6OLRXH.js"]
32
+ const chunks = ["../bundle/adapter-QTAHA2JC.js","../bundle/all-profiles-7CXBVRFU.js","../bundle/anthropic-FWBQ7JHT.js","../bundle/app-server-XF4GY2Y6.js","../bundle/bot-api-XDMMWRYI.js","../bundle/bot-history-TU2X7RNN.js","../bundle/bun-6GSDPKNZ.js","../bundle/bun-sqlite-AO27E35V.js","../bundle/command-contract-RICU4OWW.js","../bundle/dist-I7OZPHAZ.js","../bundle/echarts-2YP32GX5.js","../bundle/embed-QNWVBCL5.js","../bundle/embedder-ENS7ARPP.js","../bundle/entry-MPYSQPZO.js","../bundle/first-run-YLB7RNGP.js","../bundle/first-screen-AYOE4JFC.js","../bundle/identity-XQLO7NYW.js","../bundle/instructions-5F4XG3B6.js","../bundle/mcp-OQBZXELQ.js","../bundle/node-JOUDFPFN.js","../bundle/node-P4E63KXA.js","../bundle/node-TLZSIHIJ.js","../bundle/node-sqlite-ZY6ZFFXS.js","../bundle/oauth-KOR3ZNTA.js","../bundle/open-JACXAGY5.js","../bundle/process-7W3X5VME.js","../bundle/program-NSZWGHNJ.js","../bundle/prompt-CRRG5UB6.js","../bundle/proxy-transport-YSBYG26I.js","../bundle/recognize-ASXEB45M.js","../bundle/remote-CB3GAXGJ.js","../bundle/rerank-PDD5BPID.js","../bundle/serve-M4XFAYUM.js","../bundle/server-IN673OYO.js","../bundle/server-ISWPSKQ6.js","../bundle/state-626GOOVZ.js","../bundle/store-6JM4HJU5.js","../bundle/store-maintenance-command-DI2UX4V3.js"]
33
33
  // After the server answers its first request, so it starts no later.
34
34
  if (serves) setTimeout(() => void Promise.allSettled(chunks.map((chunk) => import(chunk))), 2000).unref()
35
35
  await running
@@ -35,7 +35,7 @@ import {
35
35
  toUploadParams,
36
36
  videoMime,
37
37
  withCause
38
- } from "./chunk-RKQIEJFR.js";
38
+ } from "./chunk-6K4QGBXU.js";
39
39
  import {
40
40
  proxiedTransport
41
41
  } from "./chunk-WAGDZB62.js";
@@ -46,56 +46,56 @@ import {
46
46
  bareCheck,
47
47
  formatMarkdown,
48
48
  providerRequest
49
- } from "./chunk-5HPAPVCB.js";
49
+ } from "./chunk-MR4LW4EC.js";
50
+ import "./chunk-C5N7G6UH.js";
50
51
  import "./chunk-FG2QTYEF.js";
51
- import "./chunk-GO354DJ5.js";
52
- import "./chunk-WULARSC4.js";
53
- import "./chunk-3CP7RK5R.js";
54
- import "./chunk-HCDZWFXO.js";
55
- import "./chunk-3IXKDIPH.js";
56
- import "./chunk-OGVBRRWY.js";
52
+ import "./chunk-PWIE7VBL.js";
53
+ import "./chunk-YBQ753RP.js";
54
+ import "./chunk-RRWMYR2H.js";
55
+ import "./chunk-YD6ZQ6LM.js";
56
+ import "./chunk-HOR7DS3P.js";
57
57
  import {
58
58
  pickChat,
59
59
  uploadBlob,
60
60
  validateFormattedText
61
- } from "./chunk-MHHDVR4G.js";
62
- import "./chunk-ZHXSRYJ5.js";
63
- import "./chunk-QF7VVIF4.js";
61
+ } from "./chunk-P3WU6UYJ.js";
62
+ import "./chunk-3GGU65YR.js";
63
+ import "./chunk-DANCAYRP.js";
64
64
  import "./chunk-2ABQZVK4.js";
65
- import "./chunk-57XGUIXA.js";
66
- import "./chunk-DWQ4QT6X.js";
65
+ import "./chunk-ADMV4WGV.js";
66
+ import "./chunk-UDXRDFHN.js";
67
67
  import {
68
68
  currentAttempt,
69
69
  runEvent
70
- } from "./chunk-EQHQ2AX3.js";
71
- import "./chunk-CMQ34EZL.js";
72
- import "./chunk-EMC57SOZ.js";
73
- import "./chunk-FSPDODVT.js";
70
+ } from "./chunk-GE22MYA6.js";
71
+ import "./chunk-UT6G2X7T.js";
72
+ import "./chunk-FRZHF2X6.js";
73
+ import "./chunk-TJR37WKA.js";
74
74
  import "./chunk-VMU4SGCE.js";
75
75
  import "./chunk-MFS52LTZ.js";
76
- import "./chunk-BV4N333Y.js";
77
- import "./chunk-NIVZHTN4.js";
78
- import "./chunk-AUKAZRF6.js";
79
- import "./chunk-DLF3H6NP.js";
80
- import "./chunk-VZN5LD26.js";
81
- import "./chunk-RD7SSY7H.js";
82
- import "./chunk-Z2DPNTSU.js";
83
- import "./chunk-YI72UVTJ.js";
84
- import "./chunk-NKN54EDN.js";
85
- import "./chunk-LAYPLF7G.js";
86
- import "./chunk-RMC2S3F4.js";
76
+ import "./chunk-BI2AXVHY.js";
77
+ import "./chunk-FUWSIEYY.js";
78
+ import "./chunk-N6VHHMSZ.js";
79
+ import "./chunk-6YUFPSSE.js";
80
+ import "./chunk-54RJDS3X.js";
81
+ import "./chunk-B7TTM75D.js";
82
+ import "./chunk-LSQUNABH.js";
83
+ import "./chunk-LOFG3Q35.js";
84
+ import "./chunk-QY7MW7HK.js";
85
+ import "./chunk-MCD2GANK.js";
86
+ import "./chunk-LJCGQMGN.js";
87
87
  import {
88
88
  observedCounters
89
- } from "./chunk-KQ5BUI5T.js";
90
- import "./chunk-SSV37M5T.js";
91
- import "./chunk-KCVDWZWS.js";
92
- import "./chunk-3QX6SOEO.js";
89
+ } from "./chunk-QVTCOBN5.js";
90
+ import "./chunk-3XZQQGCB.js";
91
+ import "./chunk-GZ5CR5QB.js";
92
+ import "./chunk-PHQTSF44.js";
93
93
  import "./chunk-O5EHUB2V.js";
94
- import "./chunk-TPFLD4OM.js";
95
- import "./chunk-6N25NZOE.js";
96
- import "./chunk-G5IMOOPB.js";
97
- import "./chunk-537O7OVE.js";
98
- import "./chunk-TEO2KP52.js";
94
+ import "./chunk-Y5PJQPMQ.js";
95
+ import "./chunk-KRLCUBII.js";
96
+ import "./chunk-Y3VNNLUT.js";
97
+ import "./chunk-MB3PCNRL.js";
98
+ import "./chunk-7WHM3KNI.js";
99
99
  import "./chunk-T4SDOYPY.js";
100
100
  import {
101
101
  CliError,
@@ -2,18 +2,18 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  answeredWire
5
- } from "./chunk-F27OI4J2.js";
5
+ } from "./chunk-BIWJK5YU.js";
6
6
  import {
7
7
  CALLER_META_KEY,
8
8
  PROXY_CLIENT_NAME,
9
9
  StdioServerTransport,
10
10
  callerOf,
11
11
  serveStdio
12
- } from "./chunk-SSALGKMJ.js";
12
+ } from "./chunk-5K7E36ND.js";
13
13
  import {
14
14
  McpServer
15
15
  } from "./chunk-5D4AEUVA.js";
16
- import "./chunk-EMC57SOZ.js";
16
+ import "./chunk-FRZHF2X6.js";
17
17
  import "./chunk-O5EHUB2V.js";
18
18
  import "./chunk-T4SDOYPY.js";
19
19
  import "./chunk-67SRVSPU.js";
@@ -22,7 +22,7 @@ import {
22
22
  __name
23
23
  } from "./chunk-ZVVMGPBJ.js";
24
24
 
25
- // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/mcp/all-profiles.js
25
+ // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._b1c2181cd33bddb10eb51dd3b7fa80c8/node_modules/@wirecat/cli-core/dist/mcp/all-profiles.js
26
26
  import { spawn } from "node:child_process";
27
27
  import { randomUUID } from "node:crypto";
28
28
  var PROTOCOL = "2025-06-18";
@@ -256,7 +256,7 @@ var serveAllProfilesOverStdio = /* @__PURE__ */ __name(async (options, io = {})
256
256
  }, "serveAllProfilesOverStdio");
257
257
  var serveAllProfilesOverHttp = /* @__PURE__ */ __name(async (options, http) => {
258
258
  const { build, close } = allProfilesServer(options);
259
- const { serveOverHttp } = await import("./serve-2UO2YMMG.js");
259
+ const { serveOverHttp } = await import("./serve-M4XFAYUM.js");
260
260
  const listening = await serveOverHttp(build, {
261
261
  ...http,
262
262
  appName: options.command,
@@ -2,11 +2,11 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  checkedOptions
5
- } from "./chunk-Z2DPNTSU.js";
5
+ } from "./chunk-LSQUNABH.js";
6
6
  import {
7
7
  messagesFor,
8
8
  systemFor
9
- } from "./chunk-YI72UVTJ.js";
9
+ } from "./chunk-LOFG3Q35.js";
10
10
  import {
11
11
  Anthropic
12
12
  } from "./chunk-ADLS6FVG.js";
@@ -22,7 +22,7 @@ import {
22
22
  __name
23
23
  } from "./chunk-ZVVMGPBJ.js";
24
24
 
25
- // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/models/anthropic.js
25
+ // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._b1c2181cd33bddb10eb51dd3b7fa80c8/node_modules/@wirecat/cli-core/dist/models/anthropic.js
26
26
  var options = strictObject({
27
27
  stop_sequences: optional(array(string()))
28
28
  });
@@ -0,0 +1,222 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ PER_RUN,
5
+ envelope
6
+ } from "./chunk-SZE6425L.js";
7
+ import {
8
+ answered,
9
+ failed,
10
+ registerCommands,
11
+ runCommandForAgent,
12
+ toolsFromCommands
13
+ } from "./chunk-BKVJNPA6.js";
14
+ import {
15
+ mcpUrlOf
16
+ } from "./chunk-YBQ753RP.js";
17
+ import {
18
+ agentJson,
19
+ skillResource
20
+ } from "./chunk-RRWMYR2H.js";
21
+ import {
22
+ answeredWire
23
+ } from "./chunk-BIWJK5YU.js";
24
+ import {
25
+ StdioServerTransport,
26
+ serveStdio
27
+ } from "./chunk-5K7E36ND.js";
28
+ import {
29
+ McpServer
30
+ } from "./chunk-5D4AEUVA.js";
31
+ import "./chunk-HOR7DS3P.js";
32
+ import "./chunk-P3WU6UYJ.js";
33
+ import "./chunk-3GGU65YR.js";
34
+ import "./chunk-ADMV4WGV.js";
35
+ import "./chunk-UDXRDFHN.js";
36
+ import {
37
+ DEFAULT_OUTPUT_BYTES,
38
+ changesAuthorityAt,
39
+ describeProgram,
40
+ environmentOf,
41
+ fetchesOnlyAt,
42
+ judgedTargets,
43
+ rootOf2 as rootOf
44
+ } from "./chunk-GE22MYA6.js";
45
+ import "./chunk-UT6G2X7T.js";
46
+ import "./chunk-FRZHF2X6.js";
47
+ import "./chunk-VMU4SGCE.js";
48
+ import "./chunk-MFS52LTZ.js";
49
+ import "./chunk-BI2AXVHY.js";
50
+ import {
51
+ readOnlyLockOf
52
+ } from "./chunk-N6VHHMSZ.js";
53
+ import {
54
+ mcpHttpMarker
55
+ } from "./chunk-6YUFPSSE.js";
56
+ import "./chunk-54RJDS3X.js";
57
+ import "./chunk-B7TTM75D.js";
58
+ import {
59
+ appInstructions
60
+ } from "./chunk-U2AK4QXY.js";
61
+ import "./chunk-LOFG3Q35.js";
62
+ import "./chunk-QY7MW7HK.js";
63
+ import "./chunk-MCD2GANK.js";
64
+ import "./chunk-LJCGQMGN.js";
65
+ import "./chunk-QVTCOBN5.js";
66
+ import "./chunk-3XZQQGCB.js";
67
+ import "./chunk-GZ5CR5QB.js";
68
+ import "./chunk-PHQTSF44.js";
69
+ import "./chunk-O5EHUB2V.js";
70
+ import "./chunk-Y5PJQPMQ.js";
71
+ import "./chunk-KRLCUBII.js";
72
+ import "./chunk-Y3VNNLUT.js";
73
+ import "./chunk-7WHM3KNI.js";
74
+ import {
75
+ mcpErrorResult
76
+ } from "./chunk-T4SDOYPY.js";
77
+ import {
78
+ CliError
79
+ } from "./chunk-67SRVSPU.js";
80
+ import "./chunk-Y5E2WNWB.js";
81
+ import {
82
+ __name
83
+ } from "./chunk-ZVVMGPBJ.js";
84
+
85
+ // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._b1c2181cd33bddb10eb51dd3b7fa80c8/node_modules/@wirecat/cli-core/dist/mcp/app-server.js
86
+ var EXCLUDED = [["mcp"]];
87
+ var createAppServer = /* @__PURE__ */ __name((command, context, options) => {
88
+ const { app } = options;
89
+ const root = rootOf(command);
90
+ const environment = environmentOf(command);
91
+ if (!environment.runCommand)
92
+ throw new Error("the MCP server runs inside run(), which hands it the program");
93
+ const program = { run: environment.runCommand, commands: describeProgram(root) };
94
+ const flags = command.optsWithGlobals();
95
+ const overrides = flags.permission ?? [];
96
+ const { settings } = context;
97
+ const levels = /* @__PURE__ */ __name(() => options.resolveSettings(flags, { env: context.env }).permissions, "levels");
98
+ const readOnly = /* @__PURE__ */ __name(() => readOnlyLockOf(app, context.env) !== void 0, "readOnly");
99
+ const authority = changesAuthorityAt(root);
100
+ const targets = judgedTargets(root);
101
+ const passed = Object.fromEntries(Object.entries(environment).filter(([key]) => !PER_RUN.has(key)));
102
+ const tools = toolsFromCommands(program.commands, {
103
+ includeUnavailable: true,
104
+ exclude: EXCLUDED,
105
+ levels: settings.permissions,
106
+ currentLevels: levels,
107
+ readOnly: readOnly(),
108
+ authority,
109
+ fetchOnly: fetchesOnlyAt(root),
110
+ permissions: options.permissions
111
+ });
112
+ const availability = /* @__PURE__ */ __name((one) => () => {
113
+ const permitted = one.availability?.() ?? { available: true };
114
+ if (!permitted.available)
115
+ return permitted;
116
+ return options.availability?.(one.path, settings.profile) ?? permitted;
117
+ }, "availability");
118
+ const commands = Object.fromEntries(tools.map((one) => [
119
+ one.command,
120
+ {
121
+ title: one.title,
122
+ description: one.description,
123
+ writes: one.writes,
124
+ availability: availability(one),
125
+ input: one.input,
126
+ run: /* @__PURE__ */ __name(async (input, ctx) => {
127
+ const own = options.availability?.(one.path, settings.profile);
128
+ if (own && !own.available)
129
+ return failed(new CliError("permission_error", `${one.command}: ${own.reason ?? "unavailable for this profile"}`, {
130
+ ...own.permission ? { permission: own.permission } : {}
131
+ }), app.errors);
132
+ const traceparent = ctx?.mcpReq?._meta?.traceparent;
133
+ const env = typeof traceparent === "string" ? { ...context.env, TRACEPARENT: traceparent } : context.env;
134
+ const answer = await runCommandForAgent(program, one.path, input, {
135
+ profile: settings.profile,
136
+ readOnly: readOnly(),
137
+ env,
138
+ levels,
139
+ overrides,
140
+ authority,
141
+ permissions: options.permissions,
142
+ environment: passed
143
+ });
144
+ if ("error" in answer)
145
+ return mcpErrorResult(JSON.parse(agentJson(answer.error)));
146
+ try {
147
+ return answered(envelope(one.command, answer.result), DEFAULT_OUTPUT_BYTES, targets);
148
+ } catch (error) {
149
+ return failed(error, app.errors);
150
+ }
151
+ }, "run")
152
+ }
153
+ ]));
154
+ const skill = options.skill ? skillResource(app, options.skill) : void 0;
155
+ const build = /* @__PURE__ */ __name(() => {
156
+ const server = new McpServer({ name: app.command, version: app.version }, {
157
+ instructions: appInstructions({
158
+ command: app.command,
159
+ name: options.name,
160
+ profile: settings.profile,
161
+ untrusted: options.untrusted,
162
+ ...skill ? { skill: skill.instruction } : {}
163
+ })
164
+ });
165
+ registerCommands(server, app.command, commands, app.errors, void 0, app.messenger);
166
+ if (skill) {
167
+ const { uri, name, title, description, mimeType, read } = skill;
168
+ server.registerResource(name, uri, { title, description, mimeType }, read);
169
+ }
170
+ return server;
171
+ }, "build");
172
+ return { build, offered: Object.keys(commands) };
173
+ }, "createAppServer");
174
+ var serveAppOverStdio = /* @__PURE__ */ __name(async (command, context, options) => {
175
+ const { build } = createAppServer(command, context, options);
176
+ const { stdin, stdout, signal } = environmentOf(command);
177
+ const own = stdin && stdout && stdin !== process.stdin;
178
+ const wire = answeredWire(own ? stdin : process.stdin, own ? stdout : process.stdout);
179
+ const handle = serveStdio(build, {
180
+ transport: new StdioServerTransport(wire.input, wire.output),
181
+ onerror: /* @__PURE__ */ __name((error) => context.renderer.note(`mcp: ${error.message}`), "onerror")
182
+ });
183
+ const ended = await new Promise((resolve) => {
184
+ wire.ended.then(() => resolve("input"));
185
+ if (own)
186
+ signal?.addEventListener("abort", () => resolve("stopped"), { once: true });
187
+ else {
188
+ process.once("SIGINT", () => resolve("stopped"));
189
+ process.once("SIGTERM", () => resolve("stopped"));
190
+ }
191
+ });
192
+ if (ended === "input")
193
+ await wire.answered();
194
+ wire.release();
195
+ await handle.close();
196
+ }, "serveAppOverStdio");
197
+ var serveAppOverHttp = /* @__PURE__ */ __name(async (command, context, options, http) => {
198
+ const { app } = options;
199
+ const { build } = createAppServer(command, context, options);
200
+ const { serveOverHttp } = await import("./serve-M4XFAYUM.js");
201
+ const listening = await serveOverHttp(build, {
202
+ ...http,
203
+ appName: app.command,
204
+ onCode: /* @__PURE__ */ __name((code, expires) => context.renderer.note(context.env[mcpHttpMarker(app.envPrefix)] === 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: \`${app.command} ${context.settings.profile} mcp server status\``), "onCode"),
205
+ onError: /* @__PURE__ */ __name((error) => context.renderer.note(`mcp: ${error.message}`), "onError")
206
+ }).catch((error) => {
207
+ if (error.code === "EADDRINUSE")
208
+ throw new CliError("configuration_error", `port ${http.port} is in use \u2014 pass another with --port`);
209
+ throw error;
210
+ });
211
+ context.renderer.note(`serving on ${listening.url.href} \u2014 point your tunnel at it; connectors use ${mcpUrlOf(http.publicUrl).href}`);
212
+ await new Promise((resolve) => {
213
+ process.once("SIGINT", resolve);
214
+ process.once("SIGTERM", resolve);
215
+ });
216
+ await listening.close();
217
+ }, "serveAppOverHttp");
218
+ export {
219
+ createAppServer,
220
+ serveAppOverHttp,
221
+ serveAppOverStdio
222
+ };
@@ -2,7 +2,7 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  TELEGRAM_BOT
5
- } from "./chunk-AAMJZJYC.js";
5
+ } from "./chunk-RTAV5XNT.js";
6
6
  import {
7
7
  BotTokenStore,
8
8
  ChatRegistry,
@@ -12,58 +12,58 @@ import {
12
12
  checkApiParameter,
13
13
  generatedApiCommand,
14
14
  prepareRpcApiBody
15
- } from "./chunk-5HPAPVCB.js";
15
+ } from "./chunk-MR4LW4EC.js";
16
+ import "./chunk-C5N7G6UH.js";
16
17
  import "./chunk-FG2QTYEF.js";
17
- import "./chunk-GO354DJ5.js";
18
- import "./chunk-WULARSC4.js";
19
- import "./chunk-3CP7RK5R.js";
20
- import "./chunk-HCDZWFXO.js";
21
- import "./chunk-3IXKDIPH.js";
22
- import "./chunk-OGVBRRWY.js";
18
+ import "./chunk-PWIE7VBL.js";
19
+ import "./chunk-YBQ753RP.js";
20
+ import "./chunk-RRWMYR2H.js";
21
+ import "./chunk-YD6ZQ6LM.js";
22
+ import "./chunk-HOR7DS3P.js";
23
23
  import {
24
24
  newOperationId,
25
25
  readUpload,
26
26
  uploadBytes
27
- } from "./chunk-MHHDVR4G.js";
28
- import "./chunk-ZHXSRYJ5.js";
29
- import "./chunk-QF7VVIF4.js";
27
+ } from "./chunk-P3WU6UYJ.js";
28
+ import "./chunk-3GGU65YR.js";
29
+ import "./chunk-DANCAYRP.js";
30
30
  import "./chunk-2ABQZVK4.js";
31
- import "./chunk-57XGUIXA.js";
32
- import "./chunk-DWQ4QT6X.js";
31
+ import "./chunk-ADMV4WGV.js";
32
+ import "./chunk-UDXRDFHN.js";
33
33
  import {
34
34
  DEFAULT_PERMISSIONS,
35
35
  guardedWrite,
36
36
  levelFor,
37
37
  overrideSharedContract,
38
38
  ownerOnlyOption
39
- } from "./chunk-EQHQ2AX3.js";
40
- import "./chunk-CMQ34EZL.js";
41
- import "./chunk-EMC57SOZ.js";
42
- import "./chunk-FSPDODVT.js";
39
+ } from "./chunk-GE22MYA6.js";
40
+ import "./chunk-UT6G2X7T.js";
41
+ import "./chunk-FRZHF2X6.js";
42
+ import "./chunk-TJR37WKA.js";
43
43
  import "./chunk-VMU4SGCE.js";
44
44
  import "./chunk-MFS52LTZ.js";
45
- import "./chunk-BV4N333Y.js";
46
- import "./chunk-NIVZHTN4.js";
47
- import "./chunk-AUKAZRF6.js";
48
- import "./chunk-H2UTBYFC.js";
49
- import "./chunk-DLF3H6NP.js";
50
- import "./chunk-VZN5LD26.js";
51
- import "./chunk-RD7SSY7H.js";
52
- import "./chunk-Z2DPNTSU.js";
53
- import "./chunk-YI72UVTJ.js";
54
- import "./chunk-NKN54EDN.js";
55
- import "./chunk-LAYPLF7G.js";
56
- import "./chunk-RMC2S3F4.js";
57
- import "./chunk-KQ5BUI5T.js";
58
- import "./chunk-SSV37M5T.js";
59
- import "./chunk-KCVDWZWS.js";
60
- import "./chunk-3QX6SOEO.js";
45
+ import "./chunk-BI2AXVHY.js";
46
+ import "./chunk-FUWSIEYY.js";
47
+ import "./chunk-N6VHHMSZ.js";
48
+ import "./chunk-UVYY5EIS.js";
49
+ import "./chunk-6YUFPSSE.js";
50
+ import "./chunk-54RJDS3X.js";
51
+ import "./chunk-B7TTM75D.js";
52
+ import "./chunk-LSQUNABH.js";
53
+ import "./chunk-LOFG3Q35.js";
54
+ import "./chunk-QY7MW7HK.js";
55
+ import "./chunk-MCD2GANK.js";
56
+ import "./chunk-LJCGQMGN.js";
57
+ import "./chunk-QVTCOBN5.js";
58
+ import "./chunk-3XZQQGCB.js";
59
+ import "./chunk-GZ5CR5QB.js";
60
+ import "./chunk-PHQTSF44.js";
61
61
  import "./chunk-O5EHUB2V.js";
62
- import "./chunk-TPFLD4OM.js";
63
- import "./chunk-6N25NZOE.js";
64
- import "./chunk-G5IMOOPB.js";
65
- import "./chunk-537O7OVE.js";
66
- import "./chunk-TEO2KP52.js";
62
+ import "./chunk-Y5PJQPMQ.js";
63
+ import "./chunk-KRLCUBII.js";
64
+ import "./chunk-Y3VNNLUT.js";
65
+ import "./chunk-MB3PCNRL.js";
66
+ import "./chunk-7WHM3KNI.js";
67
67
  import "./chunk-T4SDOYPY.js";
68
68
  import {
69
69
  CliError,
@@ -5,21 +5,21 @@ import {
5
5
  toCliError,
6
6
  toHistoryChannel,
7
7
  toHistoryMessages
8
- } from "./chunk-RKQIEJFR.js";
8
+ } from "./chunk-6K4QGBXU.js";
9
9
  import {
10
10
  proxiedTransport
11
11
  } from "./chunk-WAGDZB62.js";
12
12
  import "./chunk-FG2QTYEF.js";
13
- import "./chunk-ZHXSRYJ5.js";
14
- import "./chunk-CMQ34EZL.js";
15
- import "./chunk-KQ5BUI5T.js";
16
- import "./chunk-SSV37M5T.js";
17
- import "./chunk-KCVDWZWS.js";
18
- import "./chunk-3QX6SOEO.js";
13
+ import "./chunk-3GGU65YR.js";
14
+ import "./chunk-UT6G2X7T.js";
15
+ import "./chunk-QVTCOBN5.js";
16
+ import "./chunk-3XZQQGCB.js";
17
+ import "./chunk-GZ5CR5QB.js";
18
+ import "./chunk-PHQTSF44.js";
19
19
  import "./chunk-O5EHUB2V.js";
20
- import "./chunk-TPFLD4OM.js";
21
- import "./chunk-6N25NZOE.js";
22
- import "./chunk-G5IMOOPB.js";
20
+ import "./chunk-Y5PJQPMQ.js";
21
+ import "./chunk-KRLCUBII.js";
22
+ import "./chunk-Y3VNNLUT.js";
23
23
  import "./chunk-T4SDOYPY.js";
24
24
  import {
25
25
  CliError,
@@ -18,12 +18,12 @@ import {
18
18
  jitCompatCheck,
19
19
  refineSqliteCodecs,
20
20
  sql
21
- } from "./chunk-G5IMOOPB.js";
21
+ } from "./chunk-Y3VNNLUT.js";
22
22
  import {
23
23
  __name
24
24
  } from "./chunk-ZVVMGPBJ.js";
25
25
 
26
- // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/bun.js
26
+ // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._b1c2181cd33bddb10eb51dd3b7fa80c8/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/bun.js
27
27
  import { Database } from "bun:sqlite";
28
28
  var bunSQLiteCodecs = refineSqliteCodecs({
29
29
  "integer:boolean": { normalize: booleanFromInteger },
@@ -3,7 +3,7 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  loadVectorExtension,
5
5
  vectorExtension
6
- } from "./chunk-S5M4HFOZ.js";
6
+ } from "./chunk-UTVANQN5.js";
7
7
  import "./chunk-T4SDOYPY.js";
8
8
  import "./chunk-67SRVSPU.js";
9
9
  import {
@@ -13,7 +13,7 @@ import {
13
13
  __name
14
14
  } from "./chunk-ZVVMGPBJ.js";
15
15
 
16
- // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/store/drivers/bun-sqlite.js
16
+ // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._b1c2181cd33bddb10eb51dd3b7fa80c8/node_modules/@wirecat/cli-core/dist/store/drivers/bun-sqlite.js
17
17
  var customised = false;
18
18
  var ownLibrary = /* @__PURE__ */ __name(async () => {
19
19
  try {
@@ -4,15 +4,15 @@ import {
4
4
  organization,
5
5
  project,
6
6
  reminder
7
- } from "./chunk-CMQ34EZL.js";
7
+ } from "./chunk-UT6G2X7T.js";
8
8
  import {
9
9
  queryFieldsOf
10
- } from "./chunk-SSV37M5T.js";
10
+ } from "./chunk-3XZQQGCB.js";
11
11
 
12
- // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/snapshot.js
12
+ // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._b1c2181cd33bddb10eb51dd3b7fa80c8/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/snapshot.js
13
13
  var MAX_BYTES = 16 * 1024 * 1024;
14
14
 
15
- // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/store/knowledge-query.js
15
+ // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._b1c2181cd33bddb10eb51dd3b7fa80c8/node_modules/@wirecat/cli-core/dist/store/knowledge-query.js
16
16
  var ORGANIZATIONS_QUERY = {
17
17
  entity: "organization",
18
18
  backend: "sql",
@@ -25,10 +25,12 @@ var PROJECTS_QUERY = {
25
25
  entity: "project",
26
26
  backend: "sql",
27
27
  fields: queryFieldsOf(project, {
28
- native: ["id", "key", "type", "organization_id", "scope", "created_at"],
28
+ native: ["id", "key", "name", "kind", "type", "organization_id", "scope", "created_at"],
29
29
  examples: {
30
30
  id: "id:1",
31
31
  key: "key:SMP",
32
+ name: "name:*tart*",
33
+ kind: "kind:inbox",
32
34
  type: "type:work",
33
35
  organization_id: "organization_id:1",
34
36
  scope: "scope:work",