@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
@@ -140,7 +140,7 @@ if ($Agent -ne 'none') {
140
140
  $skillJson = & $shim skill install --for $target --json
141
141
  if ($LASTEXITCODE -ne 0) { throw 'Agent skill installation failed.' }
142
142
  $skill = ($skillJson -join "`n") | ConvertFrom-Json
143
- $written = @($skill.written)
143
+ $written = @($skill.item.written)
144
144
  if (-not $written.Count) { throw 'Agent skill installation wrote no instructions.' }
145
145
  foreach ($file in $written) {
146
146
  if (-not (Test-Path -LiteralPath $file)) { throw 'An installed agent skill could not be found.' }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wirecat/tg-cli",
3
- "version": "0.100.0",
3
+ "version": "0.101.0",
4
4
  "description": "A local command line interface for a personal Telegram account, built for agents and scripts",
5
5
  "mcpName": "dev.wirecat/tg-cli",
6
6
  "license": "Apache-2.0",
@@ -70,8 +70,8 @@
70
70
  },
71
71
  "dependencies": {
72
72
  "@mtcute/node": "0.32.7",
73
- "@wirecat/cli-base": "0.63.0",
74
- "@wirecat/cli-core": "0.452.0",
73
+ "@wirecat/cli-base": "0.64.0",
74
+ "@wirecat/cli-core": "0.466.0",
75
75
  "commander": "15.0.0",
76
76
  "undici": "8.12.3",
77
77
  "valibot": "1.5.0"
@@ -41,7 +41,7 @@ before action; it opens no messenger connection, reserves no write and leaves ta
41
41
  See the [CLI contract](https://github.com/WireCatLabs/tg-cli/blob/main/docs/cli-contract.md).
42
42
 
43
43
  The command line is the default. MCP is the rare case for a client that cannot run commands (a chat app,
44
- a remote agent): `tg <profile> mcp` starts the server, `tg <profile> mcp config` prints the client entry.
44
+ a remote agent): `tg <profile> mcp serve` starts the server, `tg <profile> mcp config` prints the client entry.
45
45
  Its permissions are the profile's, the same as on the command line. Prefer the commands above when you can run them.
46
46
  MCP uses `tg_tools_search`, then `tg_read` or `tg_write` with `{command, arguments}`.
47
47
  Use the CLI path such as `stats messages show`.
@@ -330,7 +330,7 @@ tg personal search conversations "<question>" --json # by meaning, after the ow
330
330
  tg personal watch --jsonl # new messages as {"type":"item","data"} lines, then a {"type":"end"} line
331
331
  ```
332
332
 
333
- An agent without a terminal (Claude Desktop, Cursor) uses the MCP server instead: `tg personal mcp`. The
333
+ An agent without a terminal (Claude Desktop, Cursor) uses the MCP server instead: `tg personal mcp serve`. The
334
334
  profile's `permissions` decide which commands may run, through `tg_tools_search`, `tg_read` and
335
335
  `tg_write`. Discovery keeps denied commands and their arguments, marking current unavailability
336
336
  with a reason and permission key. There is no confirmation form. `tg personal mcp config` prints the entry with full paths.
@@ -381,10 +381,10 @@ Never ask the owner to paste a credential into argv, print one, or fall back to
381
381
 
382
382
  Use `tg personal stats chats show <chat> --offline --json` for stored group/channel activity. The online command also
383
383
  requests joins/leaves; MCP and offline results omit `members`. Incomplete counts are lower bounds.
384
- `tg personal mcp --http --public-url https://<name>.ts.net` serves behind your tunnel with its own owner-code login;
384
+ `tg personal mcp serve --http --public-url https://<name>.ts.net` serves behind your tunnel with its own owner-code login;
385
385
  MCP has no server forms. `deny`/`readonly` block writes; `ask`/`allow` permit the requested write.
386
386
  Repeat `--permission key=level` to tighten permissions for the server; it never loosens them. Never change permissions to bypass a refusal.
387
- `tg personal mcp --revoke` forgets browser logins for the profile.
387
+ `tg personal mcp revoke` forgets browser logins for the profile.
388
388
 
389
389
  `tg personal chats members check <chat> --json` reads member pages with reasons; it removes nobody.
390
390
  Treat scores as hints; check `more` and `unknown`, and review each person before any moderation action.
@@ -1,63 +0,0 @@
1
- import { createRequire as __tgRequire } from "node:module";
2
- const require = __tgRequire(import.meta.url);
3
- import {
4
- holdLock,
5
- readLock,
6
- releaseLock,
7
- takeLock
8
- } from "./chunk-2XUGPE5W.js";
9
- import {
10
- __name
11
- } from "./chunk-AFV74GK3.js";
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/mcp/http/state.js
14
- import { existsSync, readFileSync } from "node:fs";
15
- var ACCESS_SECONDS = 60 * 60;
16
- var REFRESH_SECONDS = 30 * 24 * 60 * 60;
17
- var readStored = /* @__PURE__ */ __name((path) => existsSync(path) ? JSON.parse(readFileSync(path, "utf8")) : { clients: [], tokens: [] }, "readStored");
18
- var mcpHttpMarker = /* @__PURE__ */ __name((envPrefix) => `${envPrefix}_MCP_HTTP`, "mcpHttpMarker");
19
- var httpLogFile = /* @__PURE__ */ __name((tokenFile) => `${tokenFile.replace(/\.json$/, "")}.log`, "httpLogFile");
20
- var httpLockFile = /* @__PURE__ */ __name((tokenFile) => `${tokenFile.replace(/\.json$/, "")}.lock`, "httpLockFile");
21
- var readHttpLock = /* @__PURE__ */ __name((path) => {
22
- const lock = readLock(path);
23
- return lock && typeof lock.port === "number" && typeof lock.publicUrl === "string" ? lock : void 0;
24
- }, "readHttpLock");
25
- var httpLock = /* @__PURE__ */ __name((path, first) => {
26
- let current = first;
27
- const held = takeLock(path, current);
28
- return {
29
- held,
30
- update: /* @__PURE__ */ __name((change) => {
31
- current = { ...current, ...change };
32
- holdLock(path, current);
33
- }, "update"),
34
- release: /* @__PURE__ */ __name(() => releaseLock(path), "release")
35
- };
36
- }, "httpLock");
37
- var signedInClients = /* @__PURE__ */ __name((tokenFile, now = Date.now()) => {
38
- const seconds = Math.floor(now / 1e3);
39
- const { clients, tokens } = readStored(tokenFile);
40
- const last = /* @__PURE__ */ new Map();
41
- for (const token of tokens) {
42
- if (token.expiresAt <= seconds)
43
- continue;
44
- const issued = token.expiresAt - (token.kind === "access" ? ACCESS_SECONDS : REFRESH_SECONDS);
45
- last.set(token.clientId, Math.max(last.get(token.clientId) ?? 0, issued));
46
- }
47
- return clients.filter((client) => last.has(client.id)).map((client) => ({
48
- claimedName: client.name ?? null,
49
- lastLoginAt: new Date((last.get(client.id) ?? 0) * 1e3).toISOString()
50
- })).sort((a, b) => b.lastLoginAt.localeCompare(a.lastLoginAt));
51
- }, "signedInClients");
52
-
53
- export {
54
- ACCESS_SECONDS,
55
- REFRESH_SECONDS,
56
- readStored,
57
- mcpHttpMarker,
58
- httpLogFile,
59
- httpLockFile,
60
- readHttpLock,
61
- httpLock,
62
- signedInClients
63
- };
@@ -1,31 +0,0 @@
1
- import { createRequire as __tgRequire } from "node:module";
2
- const require = __tgRequire(import.meta.url);
3
- import {
4
- SCHEMA_DIALECT,
5
- commandContract,
6
- commandPathOf,
7
- findCommand,
8
- outputOf
9
- } from "./chunk-6VEOR6GD.js";
10
- import "./chunk-RER6DAHP.js";
11
- import "./chunk-3QDPV34J.js";
12
- import "./chunk-U7LXA4SO.js";
13
- import "./chunk-SMJTL5U7.js";
14
- import "./chunk-SGJYU3SB.js";
15
- import "./chunk-ASDZHG5I.js";
16
- import "./chunk-UMLPXNJI.js";
17
- import "./chunk-KE6L2UEG.js";
18
- import "./chunk-UD4DOZCN.js";
19
- import "./chunk-3MVHRZWR.js";
20
- import "./chunk-QY3YOOTP.js";
21
- import "./chunk-GYEOQS2D.js";
22
- import "./chunk-WE3LBRMB.js";
23
- import "./chunk-BJG6JA5U.js";
24
- import "./chunk-AFV74GK3.js";
25
- export {
26
- SCHEMA_DIALECT,
27
- commandContract,
28
- commandPathOf,
29
- findCommand,
30
- outputOf
31
- };
@@ -1,29 +0,0 @@
1
- import { createRequire as __tgRequire } from "node:module";
2
- const require = __tgRequire(import.meta.url);
3
- import {
4
- WIRECAT_TOOLS,
5
- firstScreen,
6
- installHelp
7
- } from "./chunk-WKOY3POD.js";
8
- import "./chunk-ZZLKX62Z.js";
9
- import "./chunk-6VEOR6GD.js";
10
- import "./chunk-RER6DAHP.js";
11
- import "./chunk-3QDPV34J.js";
12
- import "./chunk-U7LXA4SO.js";
13
- import "./chunk-SMJTL5U7.js";
14
- import "./chunk-SGJYU3SB.js";
15
- import "./chunk-ASDZHG5I.js";
16
- import "./chunk-UMLPXNJI.js";
17
- import "./chunk-KE6L2UEG.js";
18
- import "./chunk-UD4DOZCN.js";
19
- import "./chunk-3MVHRZWR.js";
20
- import "./chunk-QY3YOOTP.js";
21
- import "./chunk-GYEOQS2D.js";
22
- import "./chunk-WE3LBRMB.js";
23
- import "./chunk-BJG6JA5U.js";
24
- import "./chunk-AFV74GK3.js";
25
- export {
26
- WIRECAT_TOOLS,
27
- firstScreen,
28
- installHelp
29
- };
@@ -1,46 +0,0 @@
1
- import { createRequire as __tgRequire } from "node:module";
2
- const require = __tgRequire(import.meta.url);
3
- import {
4
- buildStems,
5
- storeMaintenanceCommands,
6
- storeSummary
7
- } from "./chunk-CV5ASHTW.js";
8
- import "./chunk-V4JSVH4M.js";
9
- import "./chunk-2MXQ2EUN.js";
10
- import "./chunk-MUEXF4ME.js";
11
- import "./chunk-4U7QOFDA.js";
12
- import "./chunk-3N6LXAPE.js";
13
- import "./chunk-RDQMV6EU.js";
14
- import "./chunk-ZZLKX62Z.js";
15
- import "./chunk-3QDPV34J.js";
16
- import "./chunk-U7LXA4SO.js";
17
- import "./chunk-SMJTL5U7.js";
18
- import "./chunk-H3X5LS6U.js";
19
- import "./chunk-GTURDJJD.js";
20
- import "./chunk-SGJYU3SB.js";
21
- import "./chunk-ASDZHG5I.js";
22
- import "./chunk-2XUGPE5W.js";
23
- import "./chunk-UMLPXNJI.js";
24
- import "./chunk-THVNP6S6.js";
25
- import "./chunk-6YLT4YVJ.js";
26
- import "./chunk-LI7TXFLS.js";
27
- import "./chunk-OW3COBN5.js";
28
- import "./chunk-OOOV3JBZ.js";
29
- import "./chunk-KE6L2UEG.js";
30
- import "./chunk-JSKT5UZX.js";
31
- import "./chunk-UD4DOZCN.js";
32
- import "./chunk-3MVHRZWR.js";
33
- import "./chunk-QY3YOOTP.js";
34
- import "./chunk-3S5CL55R.js";
35
- import "./chunk-HKT5EOT5.js";
36
- import "./chunk-HXTTDIL7.js";
37
- import "./chunk-BAIZAZ6Q.js";
38
- import "./chunk-GYEOQS2D.js";
39
- import "./chunk-WE3LBRMB.js";
40
- import "./chunk-BJG6JA5U.js";
41
- import "./chunk-AFV74GK3.js";
42
- export {
43
- buildStems,
44
- storeMaintenanceCommands,
45
- storeSummary
46
- };