@wirecat/tg-cli 0.100.0 → 0.101.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 (107) hide show
  1. package/README.md +3 -3
  2. package/dist/bin/tg.js +1 -1
  3. package/dist/bundle/{adapter-2LVPMFKF.js → adapter-A3VD4Y6Z.js} +24 -24
  4. package/dist/bundle/{all-profiles-BLTK2AAB.js → all-profiles-UPVNHXB2.js} +16 -7
  5. package/dist/bundle/{anthropic-RJE4XEOO.js → anthropic-IRKNWPIB.js} +5 -5
  6. package/dist/bundle/{bot-api-4XM3NVWG.js → bot-api-UNTQG2M5.js} +48 -48
  7. package/dist/bundle/{bot-history-WVM5GEQN.js → bot-history-V4RTY5K7.js} +15 -15
  8. package/dist/bundle/{bun-UZXO2LRQ.js → bun-2JZPG2NL.js} +2 -2
  9. package/dist/bundle/{bun-sqlite-GJLGSQIT.js → bun-sqlite-TZHKM225.js} +4 -4
  10. package/dist/bundle/{chunk-V4JSVH4M.js → chunk-22PQUX72.js} +2 -2
  11. package/dist/bundle/{chunk-MQNFEVAH.js → chunk-2DGOFLDA.js} +2 -2
  12. package/dist/bundle/{chunk-2IM4M7Q2.js → chunk-2XBSVRT2.js} +1 -1
  13. package/dist/bundle/{chunk-HKT5EOT5.js → chunk-4ZS73HTJ.js} +1 -1
  14. package/dist/bundle/{chunk-SMJTL5U7.js → chunk-54R2GDQ3.js} +6 -4
  15. package/dist/bundle/{chunk-2MXQ2EUN.js → chunk-5GKXETRP.js} +21 -20
  16. package/dist/bundle/{chunk-GTURDJJD.js → chunk-5KU4UQBM.js} +1 -1
  17. package/dist/bundle/{chunk-JFJVS5JC.js → chunk-5TPT2S2Z.js} +2 -2
  18. package/dist/bundle/{chunk-SYPL4PHV.js → chunk-64DK7S4F.js} +1 -1
  19. package/dist/bundle/{chunk-BAIZAZ6Q.js → chunk-6IPY2QRG.js} +2 -2
  20. package/dist/bundle/{chunk-I6WZJVRT.js → chunk-7CBUCTB6.js} +55 -36
  21. package/dist/bundle/{chunk-LI7TXFLS.js → chunk-A5JSTZZZ.js} +3 -3
  22. package/dist/bundle/{chunk-OW3COBN5.js → chunk-ACGTFLEB.js} +9 -9
  23. package/dist/bundle/{chunk-Q26JMPBP.js → chunk-BX6HH4F6.js} +11 -11
  24. package/dist/bundle/{chunk-CV5ASHTW.js → chunk-BXQS5RCE.js} +45 -45
  25. package/dist/bundle/{chunk-MUEXF4ME.js → chunk-CJ6IYCYP.js} +12 -11
  26. package/dist/bundle/{chunk-GYEOQS2D.js → chunk-DG62L57H.js} +17 -17
  27. package/dist/bundle/{chunk-4U7QOFDA.js → chunk-DYNSP6FW.js} +445 -236
  28. package/dist/bundle/{chunk-HXTTDIL7.js → chunk-F7TDFWXY.js} +3 -3
  29. package/dist/bundle/{chunk-P26LWFNZ.js → chunk-G2US6LJB.js} +1 -1
  30. package/dist/bundle/{chunk-KE6L2UEG.js → chunk-G3ZRY436.js} +70 -61
  31. package/dist/bundle/{chunk-QY3YOOTP.js → chunk-G77QOTXE.js} +2 -2
  32. package/dist/bundle/{chunk-6YLT4YVJ.js → chunk-H6OXALTJ.js} +2 -2
  33. package/dist/bundle/{chunk-WKOY3POD.js → chunk-LPB2MDUW.js} +7 -7
  34. package/dist/bundle/{chunk-66E5QDLH.js → chunk-MLLJ74LM.js} +1 -1
  35. package/dist/bundle/{chunk-6VEOR6GD.js → chunk-N5UFBWDM.js} +6 -6
  36. package/dist/bundle/{chunk-THVNP6S6.js → chunk-NC5WS7OP.js} +2 -2
  37. package/dist/bundle/{chunk-YG7PNCSW.js → chunk-NKJJJAIJ.js} +10 -3
  38. package/dist/bundle/{chunk-DVOUKGFK.js → chunk-NMGO6LW6.js} +8 -8
  39. package/dist/bundle/{chunk-QU2FJMFB.js → chunk-ODSVNH3H.js} +798 -492
  40. package/dist/bundle/{chunk-WE3LBRMB.js → chunk-OEJ5DMCX.js} +7 -7
  41. package/dist/bundle/{chunk-3N6LXAPE.js → chunk-OILBDLWL.js} +10 -10
  42. package/dist/bundle/{chunk-U7LXA4SO.js → chunk-OPBTNQ35.js} +11 -11
  43. package/dist/bundle/{chunk-OOOV3JBZ.js → chunk-PUBS2F5J.js} +953 -677
  44. package/dist/bundle/{chunk-H3X5LS6U.js → chunk-PYTOIDSM.js} +4 -4
  45. package/dist/bundle/{chunk-RER6DAHP.js → chunk-QOWSVDPZ.js} +157 -145
  46. package/dist/bundle/{chunk-2XUGPE5W.js → chunk-QYVVRQTN.js} +3 -3
  47. package/dist/bundle/{chunk-RDQMV6EU.js → chunk-RF54YDBB.js} +4 -4
  48. package/dist/bundle/{chunk-3QDPV34J.js → chunk-RVCS7Q3A.js} +51 -47
  49. package/dist/bundle/{chunk-4YCLWWZ3.js → chunk-S2JSZWEC.js} +11 -11
  50. package/dist/bundle/{chunk-SGJYU3SB.js → chunk-S7ZNLLY5.js} +3 -3
  51. package/dist/bundle/{chunk-JSKT5UZX.js → chunk-TGREFJVA.js} +8 -8
  52. package/dist/bundle/{chunk-4VBDVZNE.js → chunk-U46UNBMT.js} +15 -15
  53. package/dist/bundle/{chunk-BL36RR34.js → chunk-UN6CKIBN.js} +4 -4
  54. package/dist/bundle/chunk-VA5YEJS3.js +161 -0
  55. package/dist/bundle/{chunk-DN4QUTWU.js → chunk-VCGL2ETF.js} +1 -1
  56. package/dist/bundle/{chunk-UMLPXNJI.js → chunk-VRSN7VLO.js} +1 -1
  57. package/dist/bundle/{chunk-ATZ44Z77.js → chunk-VYDTI254.js} +108 -29
  58. package/dist/bundle/{chunk-UD4DOZCN.js → chunk-W2336E7Y.js} +6 -6
  59. package/dist/bundle/{chunk-3S5CL55R.js → chunk-XCKD54TN.js} +6 -6
  60. package/dist/bundle/{chunk-A7OBVRJV.js → chunk-ZEOCU24Z.js} +3 -3
  61. package/dist/bundle/{chunk-BZANDKWT.js → chunk-ZJVZXJOG.js} +2 -2
  62. package/dist/bundle/{chunk-ASDZHG5I.js → chunk-ZV24I2UJ.js} +2 -2
  63. package/dist/bundle/command-contract-TKDI7E56.js +31 -0
  64. package/dist/bundle/{echarts-YHSYUWLY.js → echarts-QZ6PR3VC.js} +2 -2
  65. package/dist/bundle/{embed-3HGI2XIW.js → embed-UBXCXSRD.js} +4 -4
  66. package/dist/bundle/{embedder-2CJMZETJ.js → embedder-B4ZTKC23.js} +7 -7
  67. package/dist/bundle/{entry-UVE53OV3.js → entry-BTUTHO5M.js} +5 -5
  68. package/dist/bundle/{first-run-6GYC2QS3.js → first-run-UC4HRIFV.js} +9 -9
  69. package/dist/bundle/first-screen-SMCX6YKY.js +29 -0
  70. package/dist/bundle/{identity-HEV5E57G.js → identity-QSDEGDH7.js} +3 -3
  71. package/dist/bundle/{instructions-5UVAXSQV.js → instructions-BBGLZKO3.js} +1 -1
  72. package/dist/bundle/{mcp-NWXBVNUA.js → mcp-4Y37G2UY.js} +2 -2
  73. package/dist/bundle/{node-YHYEGYVE.js → node-LZZX22VR.js} +2 -2
  74. package/dist/bundle/{node-sqlite-CQ33A3R2.js → node-sqlite-BPGT6T5U.js} +4 -4
  75. package/dist/bundle/{oauth-OB3JFAD7.js → oauth-XNE2KPKJ.js} +6 -6
  76. package/dist/bundle/{open-JHGZIXU2.js → open-SXGYZLB5.js} +3 -3
  77. package/dist/bundle/{process-PSKS3N5B.js → process-GPUXC4PG.js} +1 -1
  78. package/dist/bundle/{program-RPYVPNRX.js → program-NEXEAL7T.js} +51 -51
  79. package/dist/bundle/{prompt-7BXUMJGG.js → prompt-SORGLEYI.js} +4 -4
  80. package/dist/bundle/{proxy-transport-3EEMW2HW.js → proxy-transport-G4MA6BGU.js} +4 -4
  81. package/dist/bundle/{recognize-YMZPL47R.js → recognize-UJBXORVD.js} +5 -5
  82. package/dist/bundle/{remote-LQ3Q22NG.js → remote-W72AR7KH.js} +5 -5
  83. package/dist/bundle/{rerank-SM7IYVXJ.js → rerank-3Y2VZM3J.js} +5 -5
  84. package/dist/bundle/{serve-GHUEP5H5.js → serve-VDZIVOPR.js} +23 -8
  85. package/dist/bundle/{server-K2BQPPHN.js → server-BERXP4GW.js} +52 -52
  86. package/dist/bundle/{server-A45HVXQY.js → server-ZFHN4GUF.js} +34 -34
  87. package/dist/bundle/{state-WIOL52GZ.js → state-DGR4EE3E.js} +9 -5
  88. package/dist/bundle/{store-XE5AKUJZ.js → store-MRCFSCZD.js} +10 -10
  89. package/dist/bundle/store-maintenance-command-DCMZDMYS.js +46 -0
  90. package/dist/bundle/tg.js +4 -4
  91. package/dist/commands/context.d.ts.map +1 -1
  92. package/dist/commands/context.js +2 -0
  93. package/dist/commands/context.js.map +1 -1
  94. package/dist/program.js +1 -1
  95. package/dist/program.js.map +1 -1
  96. package/dist/telegram/errors.js +1 -1
  97. package/dist/telegram/errors.js.map +1 -1
  98. package/dist/version.d.ts +1 -1
  99. package/dist/version.js +1 -1
  100. package/install/windows.ps1 +1 -1
  101. package/package.json +3 -3
  102. package/skills/tg-cli/SKILL.md +4 -4
  103. package/dist/bundle/chunk-Z2FHEIXN.js +0 -63
  104. package/dist/bundle/command-contract-AIVKJYIR.js +0 -31
  105. package/dist/bundle/first-screen-HRRLVLOG.js +0 -29
  106. package/dist/bundle/store-maintenance-command-YS5E7VUN.js +0 -46
  107. /package/dist/bundle/{chunk-3MVHRZWR.js → chunk-2SJOUK6J.js} +0 -0
package/README.md CHANGED
@@ -104,7 +104,7 @@ Your agent. Your Telegram. Your rules.
104
104
  tells them how: `tg personal setup --agent …` or `tg skill install` puts it in place, and `tg skill show`
105
105
  prints it before login.
106
106
  - **Apps without a terminal** (for example Claude Desktop, Cursor and other MCP clients) connect to
107
- `tg personal mcp`. It comes with ready prompts: `/catch-up`, `/review`, `/reply`, `/find`, `/open-tasks` and `/link-conversations`.
107
+ `tg personal mcp serve`. It comes with ready prompts: `/catch-up`, `/review`, `/reply`, `/find`, `/open-tasks` and `/link-conversations`.
108
108
 
109
109
  ```sh
110
110
  tg personal mcp add claude-code # or: tg personal mcp add codex
@@ -268,11 +268,11 @@ profile's `permissions` decide which may run. `readonly` stops writes; at `ask`
268
268
  form, so set up approval in your agent app.
269
269
 
270
270
  ```sh
271
- claude mcp add tg -- tg personal mcp # Claude Code, by hand
271
+ claude mcp add tg -- tg personal mcp serve # Claude Code, by hand
272
272
  tg personal mcp check # check the local MCP server
273
273
  ```
274
274
 
275
- **From the browser.** ChatGPT or Claude in the browser reach `tg personal mcp --http --public-url <url>` behind
275
+ **From the browser.** ChatGPT or Claude in the browser reach `tg personal mcp serve --http --public-url <url>` behind
276
276
  your tunnel, after a login with a one-time access code from your terminal.
277
277
 
278
278
  More: [the MCP server](https://github.com/WireCatLabs/tg-cli/blob/main/docs/mcp.md) · [on wirecat.dev](https://wirecat.dev/en/docs/tg/mcp) · [remote access](https://github.com/WireCatLabs/tg-cli/blob/main/docs/remote.md) · [on wirecat.dev](https://wirecat.dev/en/docs/tg/remote)
package/dist/bin/tg.js CHANGED
@@ -18,7 +18,7 @@ if (serves && module.registerHooks) {
18
18
  })
19
19
  }
20
20
  const running = import("../bundle/tg.js")
21
- const chunks = ["../bundle/adapter-2LVPMFKF.js","../bundle/all-profiles-BLTK2AAB.js","../bundle/anthropic-RJE4XEOO.js","../bundle/bot-api-4XM3NVWG.js","../bundle/bot-history-WVM5GEQN.js","../bundle/bun-UZXO2LRQ.js","../bundle/bun-sqlite-GJLGSQIT.js","../bundle/command-contract-AIVKJYIR.js","../bundle/dist-RJMT44PL.js","../bundle/echarts-YHSYUWLY.js","../bundle/embed-3HGI2XIW.js","../bundle/embedder-2CJMZETJ.js","../bundle/entry-UVE53OV3.js","../bundle/first-run-6GYC2QS3.js","../bundle/first-screen-HRRLVLOG.js","../bundle/identity-HEV5E57G.js","../bundle/instructions-5UVAXSQV.js","../bundle/mcp-NWXBVNUA.js","../bundle/node-IUL5HSYI.js","../bundle/node-UPPL626U.js","../bundle/node-YHYEGYVE.js","../bundle/node-sqlite-CQ33A3R2.js","../bundle/oauth-OB3JFAD7.js","../bundle/open-JHGZIXU2.js","../bundle/process-PSKS3N5B.js","../bundle/program-RPYVPNRX.js","../bundle/prompt-7BXUMJGG.js","../bundle/proxy-transport-3EEMW2HW.js","../bundle/recognize-YMZPL47R.js","../bundle/remote-LQ3Q22NG.js","../bundle/rerank-SM7IYVXJ.js","../bundle/serve-GHUEP5H5.js","../bundle/server-A45HVXQY.js","../bundle/server-K2BQPPHN.js","../bundle/state-WIOL52GZ.js","../bundle/store-XE5AKUJZ.js","../bundle/store-maintenance-command-YS5E7VUN.js"]
21
+ const chunks = ["../bundle/adapter-A3VD4Y6Z.js","../bundle/all-profiles-UPVNHXB2.js","../bundle/anthropic-IRKNWPIB.js","../bundle/bot-api-UNTQG2M5.js","../bundle/bot-history-V4RTY5K7.js","../bundle/bun-2JZPG2NL.js","../bundle/bun-sqlite-TZHKM225.js","../bundle/command-contract-TKDI7E56.js","../bundle/dist-RJMT44PL.js","../bundle/echarts-QZ6PR3VC.js","../bundle/embed-UBXCXSRD.js","../bundle/embedder-B4ZTKC23.js","../bundle/entry-BTUTHO5M.js","../bundle/first-run-UC4HRIFV.js","../bundle/first-screen-SMCX6YKY.js","../bundle/identity-QSDEGDH7.js","../bundle/instructions-BBGLZKO3.js","../bundle/mcp-4Y37G2UY.js","../bundle/node-IUL5HSYI.js","../bundle/node-LZZX22VR.js","../bundle/node-UPPL626U.js","../bundle/node-sqlite-BPGT6T5U.js","../bundle/oauth-XNE2KPKJ.js","../bundle/open-SXGYZLB5.js","../bundle/process-GPUXC4PG.js","../bundle/program-NEXEAL7T.js","../bundle/prompt-SORGLEYI.js","../bundle/proxy-transport-G4MA6BGU.js","../bundle/recognize-UJBXORVD.js","../bundle/remote-W72AR7KH.js","../bundle/rerank-3Y2VZM3J.js","../bundle/serve-VDZIVOPR.js","../bundle/server-BERXP4GW.js","../bundle/server-ZFHN4GUF.js","../bundle/state-DGR4EE3E.js","../bundle/store-MRCFSCZD.js","../bundle/store-maintenance-command-DCMZDMYS.js"]
22
22
  // After the server answers its first request, so it starts no later.
23
23
  if (serves) setTimeout(() => void Promise.allSettled(chunks.map((chunk) => import(chunk))), 2000).unref()
24
24
  await running
@@ -35,48 +35,48 @@ import {
35
35
  toUploadParams,
36
36
  videoMime,
37
37
  withCause
38
- } from "./chunk-A7OBVRJV.js";
38
+ } from "./chunk-ZEOCU24Z.js";
39
39
  import {
40
40
  proxiedTransport
41
- } from "./chunk-BZANDKWT.js";
41
+ } from "./chunk-ZJVZXJOG.js";
42
42
  import {
43
43
  ADMIN_RIGHTS,
44
44
  ADMIN_RIGHT_FIELDS,
45
45
  GROUP_SETTINGS,
46
46
  bareCheck,
47
47
  formatMarkdown
48
- } from "./chunk-DVOUKGFK.js";
49
- import "./chunk-2IM4M7Q2.js";
50
- import "./chunk-YG7PNCSW.js";
51
- import "./chunk-V4JSVH4M.js";
52
- import "./chunk-MUEXF4ME.js";
48
+ } from "./chunk-NMGO6LW6.js";
49
+ import "./chunk-2XBSVRT2.js";
50
+ import "./chunk-NKJJJAIJ.js";
51
+ import "./chunk-22PQUX72.js";
52
+ import "./chunk-CJ6IYCYP.js";
53
53
  import {
54
54
  pickChat,
55
55
  uploadBlob,
56
56
  validateFormattedText
57
- } from "./chunk-3N6LXAPE.js";
58
- import "./chunk-RDQMV6EU.js";
57
+ } from "./chunk-OILBDLWL.js";
58
+ import "./chunk-RF54YDBB.js";
59
59
  import "./chunk-ZZLKX62Z.js";
60
- import "./chunk-U7LXA4SO.js";
61
- import "./chunk-SMJTL5U7.js";
62
- import "./chunk-ASDZHG5I.js";
60
+ import "./chunk-OPBTNQ35.js";
61
+ import "./chunk-54R2GDQ3.js";
62
+ import "./chunk-ZV24I2UJ.js";
63
63
  import {
64
64
  observedCounters
65
- } from "./chunk-OOOV3JBZ.js";
66
- import "./chunk-KE6L2UEG.js";
67
- import "./chunk-JSKT5UZX.js";
68
- import "./chunk-UD4DOZCN.js";
69
- import "./chunk-3MVHRZWR.js";
70
- import "./chunk-QY3YOOTP.js";
71
- import "./chunk-3S5CL55R.js";
72
- import "./chunk-HKT5EOT5.js";
73
- import "./chunk-HXTTDIL7.js";
74
- import "./chunk-BAIZAZ6Q.js";
75
- import "./chunk-GYEOQS2D.js";
65
+ } from "./chunk-PUBS2F5J.js";
66
+ import "./chunk-G3ZRY436.js";
67
+ import "./chunk-TGREFJVA.js";
68
+ import "./chunk-W2336E7Y.js";
69
+ import "./chunk-2SJOUK6J.js";
70
+ import "./chunk-G77QOTXE.js";
71
+ import "./chunk-XCKD54TN.js";
72
+ import "./chunk-4ZS73HTJ.js";
73
+ import "./chunk-F7TDFWXY.js";
74
+ import "./chunk-6IPY2QRG.js";
75
+ import "./chunk-DG62L57H.js";
76
76
  import {
77
77
  CliError,
78
78
  isCliError
79
- } from "./chunk-WE3LBRMB.js";
79
+ } from "./chunk-OEJ5DMCX.js";
80
80
  import "./chunk-BJG6JA5U.js";
81
81
  import {
82
82
  __name
@@ -2,7 +2,7 @@ import { createRequire as __tgRequire } from "node:module";
2
2
  const require = __tgRequire(import.meta.url);
3
3
  import {
4
4
  answeredWire
5
- } from "./chunk-SYPL4PHV.js";
5
+ } from "./chunk-64DK7S4F.js";
6
6
  import {
7
7
  StdioServerTransport,
8
8
  serveStdio
@@ -14,7 +14,7 @@ import {
14
14
  __name
15
15
  } from "./chunk-AFV74GK3.js";
16
16
 
17
- // node_modules/.pnpm/@wirecat+cli-core@0.452.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.63.0_commander@15._e609b9d6c8060966368a91e843fe8bd2/node_modules/@wirecat/cli-core/dist/mcp/all-profiles.js
17
+ // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/mcp/all-profiles.js
18
18
  import { spawn } from "node:child_process";
19
19
  var PROTOCOL = "2025-06-18";
20
20
  var START_MS = 3e4;
@@ -145,8 +145,10 @@ var pool = /* @__PURE__ */ __name((options) => {
145
145
  }, "close");
146
146
  return { use, close };
147
147
  }, "pool");
148
- var withProfile = /* @__PURE__ */ __name((tool, profiles, name) => {
148
+ var withProfile = /* @__PURE__ */ __name((tool, profiles, name, signedIn = () => true) => {
149
149
  const schema = tool.inputSchema;
150
+ const out = profiles.filter((profile) => !signedIn(profile));
151
+ const states = out.length === 0 ? "" : ` Signed in: ${profiles.filter(signedIn).join(", ") || "none"} \xB7 Not signed in: ${out.join(", ")}.`;
150
152
  return {
151
153
  ...tool,
152
154
  inputSchema: {
@@ -155,7 +157,11 @@ var withProfile = /* @__PURE__ */ __name((tool, profiles, name) => {
155
157
  profile: {
156
158
  type: "string",
157
159
  enum: [...profiles],
158
- description: `Which ${name} account, by its profile. If the owner did not name one, ask which \u2014 never guess.`
160
+ oneOf: profiles.map((profile) => ({
161
+ const: profile,
162
+ title: signedIn(profile) ? profile : `${profile} \u2014 not signed in`
163
+ })),
164
+ description: `Which ${name} account, by its profile. If the owner did not name one, ask which \u2014 never guess.${states}`
159
165
  },
160
166
  ...schema.properties
161
167
  },
@@ -171,23 +177,26 @@ var allProfilesServer = /* @__PURE__ */ __name((options) => {
171
177
  const children = pool(options);
172
178
  let listed;
173
179
  const tools = /* @__PURE__ */ __name((profiles) => {
174
- listed ??= children.use(profiles[0], (child) => child.request("tools/list", {})).then((answer) => answer.tools ?? []);
180
+ listed ??= children.use(profiles.find(signedIn) ?? profiles[0], (child) => child.request("tools/list", {})).then((answer) => answer.tools ?? []);
175
181
  listed.catch(() => {
176
182
  listed = void 0;
177
183
  });
178
184
  return listed;
179
185
  }, "tools");
186
+ const signedIn = /* @__PURE__ */ __name((profile) => options.signedIn?.(profile) ?? true, "signedIn");
180
187
  const build = /* @__PURE__ */ __name(() => {
181
188
  const profiles = [...options.profiles()].sort();
182
189
  const server = new McpServer({ name: options.command, version: options.version }, { capabilities: { tools: {} }, instructions: options.instructions });
183
190
  server.server.setRequestHandler("tools/list", async () => ({
184
- tools: profiles.length === 0 ? [] : (await tools(profiles)).map((one) => withProfile(one, profiles, options.name))
191
+ tools: profiles.length === 0 ? [] : (await tools(profiles)).map((one) => withProfile(one, profiles, options.name, signedIn))
185
192
  }));
186
193
  server.server.setRequestHandler("tools/call", async (request) => {
187
194
  const { name, arguments: given = {}, _meta } = request.params;
188
195
  const { profile, ...rest } = given;
189
196
  if (typeof profile !== "string" || !profiles.includes(profile))
190
197
  return refusal(`${name} needs "profile", one of: ${profiles.join(", ")}. If the owner did not say which account, ask.`);
198
+ if (!signedIn(profile))
199
+ return refusal(options.signIn?.(profile) ?? `profile ${profile} is not signed in.`);
191
200
  try {
192
201
  return await children.use(profile, (child) => child.request("tools/call", { name, arguments: rest, ..._meta ? { _meta } : {} }));
193
202
  } catch (error) {
@@ -226,7 +235,7 @@ var serveAllProfilesOverStdio = /* @__PURE__ */ __name(async (options, io = {})
226
235
  }, "serveAllProfilesOverStdio");
227
236
  var serveAllProfilesOverHttp = /* @__PURE__ */ __name(async (options, http) => {
228
237
  const { build, close } = allProfilesServer(options);
229
- const { serveOverHttp } = await import("./serve-GHUEP5H5.js");
238
+ const { serveOverHttp } = await import("./serve-VDZIVOPR.js");
230
239
  const listening = await serveOverHttp(build, {
231
240
  ...http,
232
241
  appName: options.command,
@@ -2,27 +2,27 @@ import { createRequire as __tgRequire } from "node:module";
2
2
  const require = __tgRequire(import.meta.url);
3
3
  import {
4
4
  checkedOptions
5
- } from "./chunk-THVNP6S6.js";
5
+ } from "./chunk-NC5WS7OP.js";
6
6
  import {
7
7
  messagesFor,
8
8
  systemFor
9
- } from "./chunk-6YLT4YVJ.js";
9
+ } from "./chunk-H6OXALTJ.js";
10
10
  import {
11
11
  Anthropic
12
12
  } from "./chunk-AVWK4NCW.js";
13
- import "./chunk-GYEOQS2D.js";
13
+ import "./chunk-DG62L57H.js";
14
14
  import {
15
15
  array,
16
16
  optional,
17
17
  strictObject,
18
18
  string
19
- } from "./chunk-WE3LBRMB.js";
19
+ } from "./chunk-OEJ5DMCX.js";
20
20
  import "./chunk-BJG6JA5U.js";
21
21
  import {
22
22
  __name
23
23
  } from "./chunk-AFV74GK3.js";
24
24
 
25
- // node_modules/.pnpm/@wirecat+cli-core@0.452.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.63.0_commander@15._e609b9d6c8060966368a91e843fe8bd2/node_modules/@wirecat/cli-core/dist/models/anthropic.js
25
+ // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/models/anthropic.js
26
26
  var options = strictObject({
27
27
  stop_sequences: optional(array(string()))
28
28
  });
@@ -10,64 +10,64 @@ import {
10
10
  checkApiParameter,
11
11
  generatedApiCommand,
12
12
  prepareRpcApiBody
13
- } from "./chunk-QU2FJMFB.js";
14
- import "./chunk-DVOUKGFK.js";
15
- import "./chunk-2IM4M7Q2.js";
16
- import "./chunk-DN4QUTWU.js";
17
- import "./chunk-I6WZJVRT.js";
18
- import "./chunk-66E5QDLH.js";
19
- import "./chunk-4VBDVZNE.js";
20
- import "./chunk-YG7PNCSW.js";
21
- import "./chunk-CV5ASHTW.js";
22
- import "./chunk-V4JSVH4M.js";
23
- import "./chunk-2MXQ2EUN.js";
24
- import "./chunk-MUEXF4ME.js";
25
- import "./chunk-4U7QOFDA.js";
13
+ } from "./chunk-ODSVNH3H.js";
14
+ import "./chunk-NMGO6LW6.js";
15
+ import "./chunk-2XBSVRT2.js";
16
+ import "./chunk-VCGL2ETF.js";
17
+ import "./chunk-7CBUCTB6.js";
18
+ import "./chunk-MLLJ74LM.js";
19
+ import "./chunk-U46UNBMT.js";
20
+ import "./chunk-NKJJJAIJ.js";
21
+ import "./chunk-BXQS5RCE.js";
22
+ import "./chunk-22PQUX72.js";
23
+ import "./chunk-5GKXETRP.js";
24
+ import "./chunk-CJ6IYCYP.js";
25
+ import "./chunk-DYNSP6FW.js";
26
26
  import {
27
27
  newOperationId,
28
28
  readUpload,
29
29
  uploadBytes
30
- } from "./chunk-3N6LXAPE.js";
31
- import "./chunk-RDQMV6EU.js";
32
- import "./chunk-WKOY3POD.js";
30
+ } from "./chunk-OILBDLWL.js";
31
+ import "./chunk-RF54YDBB.js";
32
+ import "./chunk-LPB2MDUW.js";
33
33
  import "./chunk-ZZLKX62Z.js";
34
- import "./chunk-6VEOR6GD.js";
35
- import "./chunk-RER6DAHP.js";
34
+ import "./chunk-N5UFBWDM.js";
35
+ import "./chunk-QOWSVDPZ.js";
36
36
  import {
37
37
  overrideSharedContract,
38
38
  ownerOnlyOption
39
- } from "./chunk-3QDPV34J.js";
39
+ } from "./chunk-RVCS7Q3A.js";
40
40
  import {
41
41
  DEFAULT_PERMISSIONS,
42
42
  guardedWrite,
43
43
  levelFor
44
- } from "./chunk-U7LXA4SO.js";
45
- import "./chunk-SMJTL5U7.js";
46
- import "./chunk-Q26JMPBP.js";
47
- import "./chunk-H3X5LS6U.js";
48
- import "./chunk-GTURDJJD.js";
49
- import "./chunk-SGJYU3SB.js";
50
- import "./chunk-4YCLWWZ3.js";
51
- import "./chunk-ASDZHG5I.js";
52
- import "./chunk-JFJVS5JC.js";
53
- import "./chunk-Z2FHEIXN.js";
54
- import "./chunk-2XUGPE5W.js";
55
- import "./chunk-UMLPXNJI.js";
56
- import "./chunk-THVNP6S6.js";
57
- import "./chunk-6YLT4YVJ.js";
58
- import "./chunk-LI7TXFLS.js";
59
- import "./chunk-OW3COBN5.js";
60
- import "./chunk-OOOV3JBZ.js";
61
- import "./chunk-KE6L2UEG.js";
62
- import "./chunk-JSKT5UZX.js";
63
- import "./chunk-UD4DOZCN.js";
64
- import "./chunk-3MVHRZWR.js";
65
- import "./chunk-QY3YOOTP.js";
66
- import "./chunk-3S5CL55R.js";
67
- import "./chunk-HKT5EOT5.js";
68
- import "./chunk-HXTTDIL7.js";
69
- import "./chunk-BAIZAZ6Q.js";
70
- import "./chunk-GYEOQS2D.js";
44
+ } from "./chunk-OPBTNQ35.js";
45
+ import "./chunk-54R2GDQ3.js";
46
+ import "./chunk-BX6HH4F6.js";
47
+ import "./chunk-PYTOIDSM.js";
48
+ import "./chunk-5KU4UQBM.js";
49
+ import "./chunk-S7ZNLLY5.js";
50
+ import "./chunk-S2JSZWEC.js";
51
+ import "./chunk-ZV24I2UJ.js";
52
+ import "./chunk-5TPT2S2Z.js";
53
+ import "./chunk-VA5YEJS3.js";
54
+ import "./chunk-QYVVRQTN.js";
55
+ import "./chunk-VRSN7VLO.js";
56
+ import "./chunk-NC5WS7OP.js";
57
+ import "./chunk-H6OXALTJ.js";
58
+ import "./chunk-A5JSTZZZ.js";
59
+ import "./chunk-ACGTFLEB.js";
60
+ import "./chunk-PUBS2F5J.js";
61
+ import "./chunk-G3ZRY436.js";
62
+ import "./chunk-TGREFJVA.js";
63
+ import "./chunk-W2336E7Y.js";
64
+ import "./chunk-2SJOUK6J.js";
65
+ import "./chunk-G77QOTXE.js";
66
+ import "./chunk-XCKD54TN.js";
67
+ import "./chunk-4ZS73HTJ.js";
68
+ import "./chunk-F7TDFWXY.js";
69
+ import "./chunk-6IPY2QRG.js";
70
+ import "./chunk-DG62L57H.js";
71
71
  import {
72
72
  CliError,
73
73
  array,
@@ -83,7 +83,7 @@ import {
83
83
  string,
84
84
  transform,
85
85
  union
86
- } from "./chunk-WE3LBRMB.js";
86
+ } from "./chunk-OEJ5DMCX.js";
87
87
  import "./chunk-BJG6JA5U.js";
88
88
  import {
89
89
  __name
@@ -34548,7 +34548,7 @@ If you'd like to make sure that the webhook was set by you, you can specify secr
34548
34548
  }
34549
34549
  ];
34550
34550
 
34551
- // node_modules/.pnpm/@wirecat+cli-base@0.63.0_commander@15.0.0_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/codegen/runtime.js
34551
+ // node_modules/.pnpm/@wirecat+cli-base@0.64.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/codegen/runtime.js
34552
34552
  var isLossless = /* @__PURE__ */ __name((input) => typeof input === "object" && input !== null && input.isLosslessNumber === true && typeof input.value === "string", "isLossless");
34553
34553
  var INTEGER = /^-?\d+$/;
34554
34554
  var INT64_MIN = -(2n ** 63n);
@@ -5,26 +5,26 @@ import {
5
5
  toCliError,
6
6
  toHistoryChannel,
7
7
  toHistoryMessages
8
- } from "./chunk-A7OBVRJV.js";
8
+ } from "./chunk-ZEOCU24Z.js";
9
9
  import {
10
10
  proxiedTransport
11
- } from "./chunk-BZANDKWT.js";
12
- import "./chunk-2IM4M7Q2.js";
13
- import "./chunk-RDQMV6EU.js";
14
- import "./chunk-SMJTL5U7.js";
15
- import "./chunk-OOOV3JBZ.js";
16
- import "./chunk-KE6L2UEG.js";
17
- import "./chunk-JSKT5UZX.js";
18
- import "./chunk-UD4DOZCN.js";
19
- import "./chunk-3MVHRZWR.js";
20
- import "./chunk-QY3YOOTP.js";
21
- import "./chunk-3S5CL55R.js";
22
- import "./chunk-HKT5EOT5.js";
23
- import "./chunk-GYEOQS2D.js";
11
+ } from "./chunk-ZJVZXJOG.js";
12
+ import "./chunk-2XBSVRT2.js";
13
+ import "./chunk-RF54YDBB.js";
14
+ import "./chunk-54R2GDQ3.js";
15
+ import "./chunk-PUBS2F5J.js";
16
+ import "./chunk-G3ZRY436.js";
17
+ import "./chunk-TGREFJVA.js";
18
+ import "./chunk-W2336E7Y.js";
19
+ import "./chunk-2SJOUK6J.js";
20
+ import "./chunk-G77QOTXE.js";
21
+ import "./chunk-XCKD54TN.js";
22
+ import "./chunk-4ZS73HTJ.js";
23
+ import "./chunk-DG62L57H.js";
24
24
  import {
25
25
  CliError,
26
26
  isCliError
27
- } from "./chunk-WE3LBRMB.js";
27
+ } from "./chunk-OEJ5DMCX.js";
28
28
  import "./chunk-BJG6JA5U.js";
29
29
  import {
30
30
  __name
@@ -18,12 +18,12 @@ import {
18
18
  jitCompatCheck,
19
19
  refineSqliteCodecs,
20
20
  sql
21
- } from "./chunk-HKT5EOT5.js";
21
+ } from "./chunk-4ZS73HTJ.js";
22
22
  import {
23
23
  __name
24
24
  } from "./chunk-AFV74GK3.js";
25
25
 
26
- // node_modules/.pnpm/@wirecat+cli-core@0.452.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.63.0_commander@15._e609b9d6c8060966368a91e843fe8bd2/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/bun.js
26
+ // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/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,9 +3,9 @@ const require = __tgRequire(import.meta.url);
3
3
  import {
4
4
  loadVectorExtension,
5
5
  vectorExtension
6
- } from "./chunk-MQNFEVAH.js";
7
- import "./chunk-GYEOQS2D.js";
8
- import "./chunk-WE3LBRMB.js";
6
+ } from "./chunk-2DGOFLDA.js";
7
+ import "./chunk-DG62L57H.js";
8
+ import "./chunk-OEJ5DMCX.js";
9
9
  import {
10
10
  importFrom
11
11
  } from "./chunk-BJG6JA5U.js";
@@ -13,7 +13,7 @@ import {
13
13
  __name
14
14
  } from "./chunk-AFV74GK3.js";
15
15
 
16
- // node_modules/.pnpm/@wirecat+cli-core@0.452.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.63.0_commander@15._e609b9d6c8060966368a91e843fe8bd2/node_modules/@wirecat/cli-core/dist/store/drivers/bun-sqlite.js
16
+ // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/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 {
@@ -7,12 +7,12 @@ import {
7
7
  import {
8
8
  singleLine,
9
9
  visibleControls
10
- } from "./chunk-GYEOQS2D.js";
10
+ } from "./chunk-DG62L57H.js";
11
11
  import {
12
12
  __name
13
13
  } from "./chunk-AFV74GK3.js";
14
14
 
15
- // node_modules/.pnpm/@wirecat+cli-core@0.452.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.63.0_commander@15._e609b9d6c8060966368a91e843fe8bd2/node_modules/@wirecat/cli-core/dist/render/messages.js
15
+ // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/render/messages.js
16
16
  import { styleText } from "node:util";
17
17
  var TIME_WIDTH = 8;
18
18
  var INDENT = " ".repeat(TIME_WIDTH + 2);
@@ -2,7 +2,7 @@ import { createRequire as __tgRequire } from "node:module";
2
2
  const require = __tgRequire(import.meta.url);
3
3
  import {
4
4
  CliError
5
- } from "./chunk-WE3LBRMB.js";
5
+ } from "./chunk-OEJ5DMCX.js";
6
6
  import {
7
7
  importFrom
8
8
  } from "./chunk-BJG6JA5U.js";
@@ -10,7 +10,7 @@ import {
10
10
  __name
11
11
  } from "./chunk-AFV74GK3.js";
12
12
 
13
- // node_modules/.pnpm/@wirecat+cli-core@0.452.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.63.0_commander@15._e609b9d6c8060966368a91e843fe8bd2/node_modules/@wirecat/cli-core/dist/store/vector-extension.js
13
+ // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/store/vector-extension.js
14
14
  import { readFileSync } from "node:fs";
15
15
  var musl = /* @__PURE__ */ __name(() => {
16
16
  if (process.platform !== "linux")
@@ -5,7 +5,7 @@ import {
5
5
  check,
6
6
  pipe,
7
7
  string
8
- } from "./chunk-WE3LBRMB.js";
8
+ } from "./chunk-OEJ5DMCX.js";
9
9
  import {
10
10
  __name
11
11
  } from "./chunk-AFV74GK3.js";
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-AFV74GK3.js";
6
6
 
7
- // node_modules/.pnpm/@wirecat+cli-core@0.452.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.63.0_commander@15._e609b9d6c8060966368a91e843fe8bd2/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/shared-55XJMTPA.js
7
+ // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/shared-55XJMTPA.js
8
8
  var entityKind = /* @__PURE__ */ Symbol.for("drizzle:entityKind");
9
9
  var kindsByConstructor = /* @__PURE__ */ new WeakMap();
10
10
  function collectKinds(ctor) {
@@ -17,14 +17,15 @@ import {
17
17
  strictObject,
18
18
  string,
19
19
  unknown
20
- } from "./chunk-WE3LBRMB.js";
20
+ } from "./chunk-OEJ5DMCX.js";
21
21
 
22
- // node_modules/.pnpm/@wirecat+cli-core@0.452.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.63.0_commander@15._e609b9d6c8060966368a91e843fe8bd2/node_modules/@wirecat/cli-core/dist/entities/fields.js
22
+ // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/entities/fields.js
23
23
  var text = string();
24
24
  var id = pipe(string(), minLength(1));
25
25
  var time = isoTime;
26
26
  var zonedTime = pipe(string(), isoTimestamp("an ISO 8601 time with a zone"));
27
27
  var count = pipe(number(), integer(), minValue(0));
28
+ var untrusted = optional(array(text));
28
29
  var providerMetadata = optional(record(string(), unknown()));
29
30
  var author = strictObject({
30
31
  type: picklist(["person", "bot"]),
@@ -32,7 +33,7 @@ var author = strictObject({
32
33
  name: nullable(text)
33
34
  });
34
35
 
35
- // node_modules/.pnpm/@wirecat+cli-core@0.452.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.63.0_commander@15._e609b9d6c8060966368a91e843fe8bd2/node_modules/@wirecat/cli-core/dist/entities/note.js
36
+ // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/entities/note.js
36
37
  var link = {
37
38
  target_text: nullable(text),
38
39
  kind: text,
@@ -73,7 +74,7 @@ var note = strictObject({
73
74
  backlinks: optional(array(strictObject({ from: reference, ...link })))
74
75
  });
75
76
 
76
- // node_modules/.pnpm/@wirecat+cli-core@0.452.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.63.0_commander@15._e609b9d6c8060966368a91e843fe8bd2/node_modules/@wirecat/cli-core/dist/entities/knowledge-lists.js
77
+ // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/entities/knowledge-lists.js
77
78
  var organization = strictObject({
78
79
  id,
79
80
  ref: reference,
@@ -108,6 +109,7 @@ export {
108
109
  time,
109
110
  zonedTime,
110
111
  count,
112
+ untrusted,
111
113
  providerMetadata,
112
114
  author,
113
115
  note,