@wirecat/tg-cli 0.99.0 → 0.100.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 (112) hide show
  1. package/README.md +3 -2
  2. package/dist/bin/tg.js +23 -28
  3. package/dist/bundle/adapter-2LVPMFKF.js +2790 -0
  4. package/dist/bundle/all-profiles-BLTK2AAB.js +255 -0
  5. package/dist/bundle/anthropic-RJE4XEOO.js +71 -0
  6. package/dist/bundle/bot-api-4XM3NVWG.js +39793 -0
  7. package/dist/bundle/bot-history-WVM5GEQN.js +167 -0
  8. package/dist/bundle/bun-UZXO2LRQ.js +169 -0
  9. package/dist/bundle/bun-sqlite-GJLGSQIT.js +70 -0
  10. package/dist/bundle/chunk-2IM4M7Q2.js +98 -0
  11. package/dist/bundle/chunk-2MXQ2EUN.js +1344 -0
  12. package/dist/bundle/chunk-2XUGPE5W.js +73 -0
  13. package/dist/bundle/chunk-3KHKYYCR.js +24782 -0
  14. package/dist/bundle/chunk-3MVHRZWR.js +2 -0
  15. package/dist/bundle/chunk-3N6LXAPE.js +724 -0
  16. package/dist/bundle/chunk-3QDPV34J.js +6668 -0
  17. package/dist/bundle/chunk-3S5CL55R.js +100 -0
  18. package/dist/bundle/chunk-4U7QOFDA.js +33511 -0
  19. package/dist/bundle/chunk-4VBDVZNE.js +524 -0
  20. package/dist/bundle/chunk-4YCLWWZ3.js +277 -0
  21. package/dist/bundle/chunk-66E5QDLH.js +24 -0
  22. package/dist/bundle/chunk-6VEOR6GD.js +166 -0
  23. package/dist/bundle/chunk-6YLT4YVJ.js +45 -0
  24. package/dist/bundle/chunk-7BFO3DY6.js +21 -0
  25. package/dist/bundle/chunk-A7OBVRJV.js +738 -0
  26. package/dist/bundle/chunk-AFV74GK3.js +50 -0
  27. package/dist/bundle/chunk-ASDZHG5I.js +25 -0
  28. package/dist/bundle/chunk-ATZ44Z77.js +3253 -0
  29. package/dist/bundle/chunk-AVWK4NCW.js +24600 -0
  30. package/dist/bundle/chunk-BAIZAZ6Q.js +82 -0
  31. package/dist/bundle/chunk-BJG6JA5U.js +35 -0
  32. package/dist/bundle/chunk-BL36RR34.js +285 -0
  33. package/dist/bundle/chunk-BZANDKWT.js +71 -0
  34. package/dist/bundle/chunk-CV5ASHTW.js +8170 -0
  35. package/dist/bundle/chunk-DN4QUTWU.js +78 -0
  36. package/dist/bundle/chunk-DVOUKGFK.js +1950 -0
  37. package/dist/bundle/chunk-GTURDJJD.js +570 -0
  38. package/dist/bundle/chunk-GYEOQS2D.js +2795 -0
  39. package/dist/bundle/chunk-H3X5LS6U.js +153 -0
  40. package/dist/bundle/chunk-HKT5EOT5.js +6848 -0
  41. package/dist/bundle/chunk-HXTTDIL7.js +82 -0
  42. package/dist/bundle/chunk-I6WZJVRT.js +1123 -0
  43. package/dist/bundle/chunk-JFJVS5JC.js +41 -0
  44. package/dist/bundle/chunk-JSKT5UZX.js +2315 -0
  45. package/dist/bundle/chunk-KE6L2UEG.js +3068 -0
  46. package/dist/bundle/chunk-LI7TXFLS.js +122 -0
  47. package/dist/bundle/chunk-MQNFEVAH.js +58 -0
  48. package/dist/bundle/chunk-MUEXF4ME.js +582 -0
  49. package/dist/bundle/chunk-OOOV3JBZ.js +35527 -0
  50. package/dist/bundle/chunk-OW3COBN5.js +1275 -0
  51. package/dist/bundle/chunk-P26LWFNZ.js +35 -0
  52. package/dist/bundle/chunk-Q26JMPBP.js +215 -0
  53. package/dist/bundle/chunk-QU2FJMFB.js +18282 -0
  54. package/dist/bundle/chunk-QY3YOOTP.js +18 -0
  55. package/dist/bundle/chunk-RDQMV6EU.js +46 -0
  56. package/dist/bundle/chunk-RER6DAHP.js +3514 -0
  57. package/dist/bundle/chunk-SGJYU3SB.js +54 -0
  58. package/dist/bundle/chunk-SMJTL5U7.js +117 -0
  59. package/dist/bundle/chunk-SYPL4PHV.js +76 -0
  60. package/dist/bundle/chunk-THVNP6S6.js +31 -0
  61. package/dist/bundle/chunk-U7LXA4SO.js +1007 -0
  62. package/dist/bundle/chunk-UD4DOZCN.js +886 -0
  63. package/dist/bundle/chunk-UMLPXNJI.js +63 -0
  64. package/dist/bundle/chunk-V4JSVH4M.js +190 -0
  65. package/dist/bundle/chunk-WE3LBRMB.js +2374 -0
  66. package/dist/bundle/chunk-WKOY3POD.js +452 -0
  67. package/dist/bundle/chunk-X4Y2ROJI.js +541 -0
  68. package/dist/bundle/chunk-YG7PNCSW.js +230 -0
  69. package/dist/bundle/chunk-Z2FHEIXN.js +63 -0
  70. package/dist/bundle/chunk-ZZLKX62Z.js +928 -0
  71. package/dist/bundle/command-contract-AIVKJYIR.js +31 -0
  72. package/dist/bundle/dist-RJMT44PL.js +7577 -0
  73. package/dist/bundle/echarts-YHSYUWLY.js +42501 -0
  74. package/dist/bundle/embed-3HGI2XIW.js +35 -0
  75. package/dist/bundle/embedder-2CJMZETJ.js +108 -0
  76. package/dist/bundle/entry-UVE53OV3.js +14 -0
  77. package/dist/bundle/first-run-6GYC2QS3.js +24 -0
  78. package/dist/bundle/first-screen-HRRLVLOG.js +29 -0
  79. package/dist/bundle/identity-HEV5E57G.js +11 -0
  80. package/dist/bundle/instructions-5UVAXSQV.js +9 -0
  81. package/dist/bundle/mcp-NWXBVNUA.js +165 -0
  82. package/dist/bundle/node-IUL5HSYI.js +2340 -0
  83. package/dist/bundle/node-UPPL626U.js +21 -0
  84. package/dist/bundle/node-YHYEGYVE.js +176 -0
  85. package/dist/bundle/node-sqlite-CQ33A3R2.js +46 -0
  86. package/dist/bundle/oauth-OB3JFAD7.js +18 -0
  87. package/dist/bundle/open-JHGZIXU2.js +20 -0
  88. package/dist/bundle/process-PSKS3N5B.js +91 -0
  89. package/dist/bundle/program-RPYVPNRX.js +1060 -0
  90. package/dist/bundle/prompt-7BXUMJGG.js +13 -0
  91. package/dist/bundle/proxy-transport-3EEMW2HW.js +17 -0
  92. package/dist/bundle/recognize-YMZPL47R.js +191 -0
  93. package/dist/bundle/remote-LQ3Q22NG.js +26 -0
  94. package/dist/bundle/rerank-SM7IYVXJ.js +49 -0
  95. package/dist/bundle/serve-GHUEP5H5.js +181 -0
  96. package/dist/bundle/server-A45HVXQY.js +178 -0
  97. package/dist/bundle/server-K2BQPPHN.js +785 -0
  98. package/dist/bundle/state-WIOL52GZ.js +30 -0
  99. package/dist/bundle/store-XE5AKUJZ.js +121 -0
  100. package/dist/bundle/store-maintenance-command-YS5E7VUN.js +46 -0
  101. package/dist/bundle/tg.js +40 -0
  102. package/dist/commands/context.d.ts.map +1 -1
  103. package/dist/commands/context.js +1 -1
  104. package/dist/commands/context.js.map +1 -1
  105. package/dist/install/postinstall.js +1 -1
  106. package/dist/install/postinstall.js.map +1 -1
  107. package/dist/version.d.ts +1 -1
  108. package/dist/version.d.ts.map +1 -1
  109. package/dist/version.js +1 -1
  110. package/dist/version.js.map +1 -1
  111. package/package.json +4 -2
  112. /package/skills/{wirecat-tg → tg-cli}/SKILL.md +0 -0
package/README.md CHANGED
@@ -100,7 +100,7 @@ More: [recipes, with a schedule and limits for each](https://github.com/WireCatL
100
100
  Your agent. Your Telegram. Your rules.
101
101
 
102
102
  - **Agents with a terminal** (for example Claude Code, Codex, Gemini CLI) run `tg` commands
103
- themselves. The bundled [skill](https://github.com/WireCatLabs/tg-cli/blob/main/skills/wirecat-tg/SKILL.md)
103
+ themselves. The bundled [skill](https://github.com/WireCatLabs/tg-cli/blob/main/skills/tg-cli/SKILL.md)
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
@@ -401,7 +401,8 @@ What each version changed: [CHANGELOG.md](https://github.com/WireCatLabs/tg-cli/
401
401
  ```sh
402
402
  pnpm install
403
403
  pnpm lint && pnpm typecheck && pnpm test
404
- pnpm build && pnpm smoke:bun # the built command under Bun
404
+ pnpm build && pnpm smoke:node # the built command, the bundle a user installs
405
+ pnpm build && pnpm smoke:bun # the same under Bun
405
406
  pnpm generate # rewrites docs/commands.md from the command tree
406
407
  bin/tg session start # everything under .tg/ in this checkout, never the real profile
407
408
  ```
package/dist/bin/tg.js CHANGED
@@ -1,29 +1,24 @@
1
1
  #!/usr/bin/env node
2
- import { enableCompileCache } from "node:module";
3
- import { errorObjectOf, exitCodeOfError, renderError } from "@wirecat/cli-base";
4
- // Compiling about 1,700 module files is most of a start; later runs reuse what this one compiled.
5
- enableCompileCache();
6
- const [{ startCli }, { TG }] = await Promise.all([import("@wirecat/cli-core/cli/start"), import("../identity.js")]);
7
- await startCli({
8
- app: TG,
9
- sqlite: true,
10
- // A static import would load the whole program, and its SQLite, before ensureSqlite could swap it.
11
- run: async ({ args }) => (await import("../program.js")).run(args),
12
- fail: (error, { tty }) => {
13
- const object = errorObjectOf(error);
14
- process.stderr.write(`${renderError(object, { cli: TG.command, interactive: tty })}\n`);
15
- return exitCodeOfError(object);
16
- },
17
- });
18
- // A one-shot command exits (project rule 3). Once a download printed its answer and stayed alive for
19
- // 30 minutes, --timeout or not, and it never happened again; if something is still open, name it and go.
20
- const lingering = setTimeout(() => {
21
- if (process.stdout.writableLength > 0) {
22
- lingering.refresh();
23
- return;
24
- }
25
- process.stderr.write(`tg: finished, but ${process.getActiveResourcesInfo().join(", ")} stayed open — exiting anyway\n`);
26
- process.exit();
27
- }, 5_000);
28
- lingering.unref();
29
- //# sourceMappingURL=tg.js.map
2
+ // tg: bundle loader
3
+ import * as module from "node:module"
4
+
5
+ // Before the bundle compiles: the bundle's own call comes after its chunks.
6
+ module.enableCompileCache()
7
+ const words = process.argv.slice(2)
8
+ const serves = words
9
+ .slice(0, 3)
10
+ .some((word, at) => ["serve", "watch"].includes(word) || (word === "mcp" && !/^[^-]/.test(words[at + 1] ?? "")))
11
+ if (serves && module.registerHooks) {
12
+ const bundle = new URL("../bundle/", import.meta.url).href
13
+ module.registerHooks({
14
+ resolve: (specifier, context, next) =>
15
+ specifier.startsWith("./") && context.parentURL?.startsWith(bundle)
16
+ ? { url: new URL(specifier, context.parentURL).href, format: "module", shortCircuit: true }
17
+ : next(specifier, context),
18
+ })
19
+ }
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"]
22
+ // After the server answers its first request, so it starts no later.
23
+ if (serves) setTimeout(() => void Promise.allSettled(chunks.map((chunk) => import(chunk))), 2000).unref()
24
+ await running