@wirecat/tg-cli 0.100.0 → 0.102.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 (117) hide show
  1. package/README.md +3 -3
  2. package/dist/bin/tg.js +1 -1
  3. package/dist/bot/transport.d.ts.map +1 -1
  4. package/dist/bot/transport.js +14 -17
  5. package/dist/bot/transport.js.map +1 -1
  6. package/dist/bundle/{adapter-2LVPMFKF.js → adapter-M2HRSFFL.js} +95 -33
  7. package/dist/bundle/{all-profiles-BLTK2AAB.js → all-profiles-GOD2QNTK.js} +42 -12
  8. package/dist/bundle/{anthropic-RJE4XEOO.js → anthropic-LKU7RWMA.js} +5 -5
  9. package/dist/bundle/{bot-api-4XM3NVWG.js → bot-api-X3MPFVPL.js} +49 -53
  10. package/dist/bundle/{bot-history-WVM5GEQN.js → bot-history-OUMVVG22.js} +15 -15
  11. package/dist/bundle/{bun-UZXO2LRQ.js → bun-LIZ6MKFS.js} +2 -2
  12. package/dist/bundle/{bun-sqlite-GJLGSQIT.js → bun-sqlite-2IFQYQ44.js} +4 -4
  13. package/dist/bundle/chunk-264DAFJV.js +161 -0
  14. package/dist/bundle/{chunk-ASDZHG5I.js → chunk-2SUTCDGO.js} +2 -2
  15. package/dist/bundle/{chunk-2IM4M7Q2.js → chunk-2XBSVRT2.js} +1 -1
  16. package/dist/bundle/{chunk-Q26JMPBP.js → chunk-334UBWOB.js} +11 -11
  17. package/dist/bundle/{chunk-MQNFEVAH.js → chunk-4PDEQL6T.js} +2 -2
  18. package/dist/bundle/chunk-4QB4WDLT.js +922 -0
  19. package/dist/bundle/{chunk-66E5QDLH.js → chunk-5D6OJREA.js} +1 -1
  20. package/dist/bundle/{chunk-RDQMV6EU.js → chunk-5DFGJPT6.js} +4 -4
  21. package/dist/bundle/{chunk-GTURDJJD.js → chunk-5KU4UQBM.js} +1 -1
  22. package/dist/bundle/{chunk-JSKT5UZX.js → chunk-5VSR5ENL.js} +8 -8
  23. package/dist/bundle/{chunk-DN4QUTWU.js → chunk-AUOXTGTU.js} +1 -1
  24. package/dist/bundle/{chunk-X4Y2ROJI.js → chunk-BBC546ZA.js} +91 -2
  25. package/dist/bundle/{chunk-RER6DAHP.js → chunk-BQYTIYGB.js} +171 -148
  26. package/dist/bundle/{chunk-3S5CL55R.js → chunk-CLWYQNSC.js} +6 -6
  27. package/dist/bundle/{chunk-I6WZJVRT.js → chunk-CRZPQQHE.js} +59 -46
  28. package/dist/bundle/chunk-DE7LFMY2.js +440 -0
  29. package/dist/bundle/{chunk-GYEOQS2D.js → chunk-DG62L57H.js} +17 -17
  30. package/dist/bundle/{chunk-QU2FJMFB.js → chunk-ENE5CSVY.js} +2903 -1490
  31. package/dist/bundle/{chunk-P26LWFNZ.js → chunk-ERQDBK5I.js} +1 -1
  32. package/dist/bundle/{chunk-UD4DOZCN.js → chunk-F2TG3BA2.js} +6 -6
  33. package/dist/bundle/{chunk-4U7QOFDA.js → chunk-FBWOQMPE.js} +1698 -816
  34. package/dist/bundle/{chunk-JFJVS5JC.js → chunk-FOUE7XLK.js} +2 -2
  35. package/dist/bundle/{chunk-3QDPV34J.js → chunk-GSKFAE3I.js} +1297 -518
  36. package/dist/bundle/{chunk-BAIZAZ6Q.js → chunk-HLAZ65AW.js} +2 -2
  37. package/dist/bundle/{chunk-LI7TXFLS.js → chunk-JFSVXMN6.js} +3 -3
  38. package/dist/bundle/{chunk-6VEOR6GD.js → chunk-M5UH5CF3.js} +6 -8
  39. package/dist/bundle/{chunk-HXTTDIL7.js → chunk-MGG7JSNO.js} +3 -3
  40. package/dist/bundle/{chunk-6YLT4YVJ.js → chunk-OCWARAFE.js} +2 -2
  41. package/dist/bundle/{chunk-WE3LBRMB.js → chunk-OEJ5DMCX.js} +7 -7
  42. package/dist/bundle/{chunk-SGJYU3SB.js → chunk-OHBHHBYL.js} +3 -3
  43. package/dist/bundle/{chunk-2MXQ2EUN.js → chunk-PSH7K6TL.js} +617 -57
  44. package/dist/bundle/{chunk-H3X5LS6U.js → chunk-PYTOIDSM.js} +4 -4
  45. package/dist/bundle/{chunk-ATZ44Z77.js → chunk-Q2NYEX4A.js} +150 -52
  46. package/dist/bundle/{chunk-KE6L2UEG.js → chunk-QEPZUFPL.js} +70 -61
  47. package/dist/bundle/{chunk-CV5ASHTW.js → chunk-QL7CQ6VZ.js} +255 -80
  48. package/dist/bundle/{chunk-THVNP6S6.js → chunk-SRU3OF4R.js} +2 -2
  49. package/dist/bundle/{chunk-OOOV3JBZ.js → chunk-TV5DGHBT.js} +953 -677
  50. package/dist/bundle/{chunk-A7OBVRJV.js → chunk-TXBUDJ3P.js} +3 -3
  51. package/dist/bundle/{chunk-OW3COBN5.js → chunk-U4RRZUNP.js} +9 -9
  52. package/dist/bundle/{chunk-WKOY3POD.js → chunk-UK3GAN7Q.js} +7 -7
  53. package/dist/bundle/{chunk-BL36RR34.js → chunk-UR6ASUSG.js} +10 -7
  54. package/dist/bundle/{chunk-4VBDVZNE.js → chunk-V52SBQYF.js} +242 -19
  55. package/dist/bundle/{chunk-4YCLWWZ3.js → chunk-VUJ34PEQ.js} +11 -11
  56. package/dist/bundle/{chunk-2XUGPE5W.js → chunk-W5EB4JLV.js} +3 -3
  57. package/dist/bundle/{chunk-3KHKYYCR.js → chunk-WMOEOVWZ.js} +1 -0
  58. package/dist/bundle/{chunk-UMLPXNJI.js → chunk-WVEHUKCZ.js} +1 -1
  59. package/dist/bundle/{chunk-SYPL4PHV.js → chunk-XXTJUZMB.js} +1 -1
  60. package/dist/bundle/{chunk-SMJTL5U7.js → chunk-Y4XSWI22.js} +6 -4
  61. package/dist/bundle/{chunk-HKT5EOT5.js → chunk-YHB57PFN.js} +1 -1
  62. package/dist/bundle/{chunk-BZANDKWT.js → chunk-ZJVZXJOG.js} +2 -2
  63. package/dist/bundle/{chunk-QY3YOOTP.js → chunk-ZRNRQFTF.js} +2 -2
  64. package/dist/bundle/command-contract-A6VZN3ZR.js +31 -0
  65. package/dist/bundle/{echarts-YHSYUWLY.js → echarts-27W2CIBD.js} +2 -2
  66. package/dist/bundle/{embed-3HGI2XIW.js → embed-FGJ273X2.js} +4 -4
  67. package/dist/bundle/{embedder-2CJMZETJ.js → embedder-7ELL3CQ3.js} +7 -7
  68. package/dist/bundle/{entry-UVE53OV3.js → entry-SEE5YWIX.js} +5 -5
  69. package/dist/bundle/{first-run-6GYC2QS3.js → first-run-BD7FEC3W.js} +9 -9
  70. package/dist/bundle/first-screen-ASZV6LSA.js +29 -0
  71. package/dist/bundle/{identity-HEV5E57G.js → identity-QR4F42T6.js} +3 -3
  72. package/dist/bundle/{instructions-5UVAXSQV.js → instructions-L74K64PV.js} +1 -1
  73. package/dist/bundle/{mcp-NWXBVNUA.js → mcp-4Y37G2UY.js} +2 -2
  74. package/dist/bundle/{node-YHYEGYVE.js → node-RSL3HANO.js} +2 -2
  75. package/dist/bundle/{node-sqlite-CQ33A3R2.js → node-sqlite-7R3PYQGJ.js} +4 -4
  76. package/dist/bundle/{oauth-OB3JFAD7.js → oauth-4ESGXF6U.js} +7 -7
  77. package/dist/bundle/{open-JHGZIXU2.js → open-DFYEUGTA.js} +3 -3
  78. package/dist/bundle/{process-PSKS3N5B.js → process-RMV3AKLB.js} +1 -1
  79. package/dist/bundle/{program-RPYVPNRX.js → program-PIUYQHBF.js} +62 -67
  80. package/dist/bundle/{prompt-7BXUMJGG.js → prompt-H7GYQQLL.js} +4 -4
  81. package/dist/bundle/{proxy-transport-3EEMW2HW.js → proxy-transport-G4MA6BGU.js} +4 -4
  82. package/dist/bundle/{recognize-YMZPL47R.js → recognize-3GMOLZF4.js} +5 -5
  83. package/dist/bundle/{remote-LQ3Q22NG.js → remote-IRWTCI2B.js} +5 -5
  84. package/dist/bundle/{rerank-SM7IYVXJ.js → rerank-W3OSXXBN.js} +5 -5
  85. package/dist/bundle/{serve-GHUEP5H5.js → serve-ZCPO44NO.js} +24 -9
  86. package/dist/bundle/{server-A45HVXQY.js → server-FXU4QFRB.js} +42 -39
  87. package/dist/bundle/{server-K2BQPPHN.js → server-YWL4HDOP.js} +77 -68
  88. package/dist/bundle/{state-WIOL52GZ.js → state-MJPTDIB5.js} +9 -5
  89. package/dist/bundle/{store-XE5AKUJZ.js → store-6VNQG56O.js} +10 -10
  90. package/dist/bundle/store-maintenance-command-62TQTMER.js +43 -0
  91. package/dist/bundle/tg.js +4 -4
  92. package/dist/commands/context.d.ts.map +1 -1
  93. package/dist/commands/context.js +2 -0
  94. package/dist/commands/context.js.map +1 -1
  95. package/dist/program.js +1 -1
  96. package/dist/program.js.map +1 -1
  97. package/dist/telegram/errors.js +1 -1
  98. package/dist/telegram/errors.js.map +1 -1
  99. package/dist/telegram/sending.d.ts.map +1 -1
  100. package/dist/telegram/sending.js +52 -3
  101. package/dist/telegram/sending.js.map +1 -1
  102. package/dist/version.d.ts +1 -1
  103. package/dist/version.js +1 -1
  104. package/install/windows.ps1 +1 -1
  105. package/package.json +3 -3
  106. package/skills/tg-cli/SKILL.md +4 -4
  107. package/dist/bundle/chunk-3N6LXAPE.js +0 -724
  108. package/dist/bundle/chunk-DVOUKGFK.js +0 -1950
  109. package/dist/bundle/chunk-MUEXF4ME.js +0 -582
  110. package/dist/bundle/chunk-U7LXA4SO.js +0 -1007
  111. package/dist/bundle/chunk-V4JSVH4M.js +0 -190
  112. package/dist/bundle/chunk-YG7PNCSW.js +0 -230
  113. package/dist/bundle/chunk-Z2FHEIXN.js +0 -63
  114. package/dist/bundle/command-contract-AIVKJYIR.js +0 -31
  115. package/dist/bundle/first-screen-HRRLVLOG.js +0 -29
  116. package/dist/bundle/store-maintenance-command-YS5E7VUN.js +0 -46
  117. /package/dist/bundle/{chunk-3MVHRZWR.js → chunk-2SJOUK6J.js} +0 -0
@@ -1,7 +1,8 @@
1
1
  import { AsyncLocalStorage } from "node:async_hooks";
2
- import { networkMiddlewares } from "@mtcute/node";
3
- import { CliError } from "@wirecat/cli-base";
2
+ import { networkMiddlewares, tl } from "@mtcute/node";
3
+ import { CliError, isCliError } from "@wirecat/cli-base";
4
4
  import { bareCheck } from "@wirecat/cli-core";
5
+ import { currentAttempt, providerRequest, runEvent } from "@wirecat/cli-core/cli";
5
6
  import { toCliError } from "./errors.js";
6
7
  const SENDS = new Set([
7
8
  "messages.sendMessage",
@@ -22,14 +23,62 @@ const noteAcceptedSend = async (context, next) => {
22
23
  current.accepted = true;
23
24
  return answer;
24
25
  };
26
+ // floodWaiter and internalErrorsHandler retry by passing the same context to `next` again.
27
+ const tries = new WeakMap();
28
+ const codeOf = (error) => {
29
+ const known = toCliError(error, bareCheck);
30
+ return isCliError(known) ? known.code : "network_error";
31
+ };
32
+ /** `FLOOD_WAIT_12` → `FLOOD_WAIT`: the seconds go into the retry's `waitMs`. */
33
+ const errorKey = (message) => message.replace(/_\d+(?=_|$)/g, "");
34
+ /**
35
+ * One request line and one response line per RPC that goes on the wire, into the run under way. Only the
36
+ * method name leaves the request: every other field of it is what the person sent or asked for.
37
+ */
38
+ const recordRequest = async (context, next) => {
39
+ const tried = tries.get(context);
40
+ const attempt = (tried?.attempt ?? 0) + 1;
41
+ // mtcute's own retry names its attempt; a first try takes the attempt of a retry made above it (`patiently`).
42
+ const retried = attempt > 1 ? { attempt, ...(tried?.waitMs === undefined ? {} : { waitMs: tried.waitMs }) } : undefined;
43
+ const end = providerRequest(context.request._, runEvent, {
44
+ transport: "mtproto",
45
+ ...(retried ?? currentAttempt() ?? { attempt: 1 }),
46
+ });
47
+ tries.set(context, { attempt });
48
+ let answer;
49
+ try {
50
+ answer = await next(context);
51
+ }
52
+ catch (error) {
53
+ end({ errorCode: codeOf(error) });
54
+ throw error;
55
+ }
56
+ const failure = answer;
57
+ if (failure?._ === "mt_rpc_error" && typeof failure.errorMessage === "string") {
58
+ end({
59
+ errorCode: codeOf(tl.RpcError.fromTl(failure)),
60
+ providerError: errorKey(failure.errorMessage),
61
+ });
62
+ }
63
+ else
64
+ end();
65
+ return answer;
66
+ };
25
67
  export const middlewaresOf = ({ maxWait, maxRetries }, say) => [
26
68
  ...networkMiddlewares.basic({
27
69
  floodWaiter: {
28
70
  maxWait,
29
71
  maxRetries,
30
- onBeforeWait: (context, seconds) => say(`Telegram asks to wait ${seconds} s before ${context.request._} — waiting, then going on`),
72
+ onBeforeWait: (context, seconds) => {
73
+ const tried = tries.get(context);
74
+ if (tried)
75
+ tried.waitMs = seconds * 1000;
76
+ say(`Telegram asks to wait ${seconds} s before ${context.request._} — waiting, then going on`);
77
+ },
31
78
  },
32
79
  }),
80
+ // Inside the flood and internal-error waiters, so each retry they make is a line of its own.
81
+ recordRequest,
33
82
  noteAcceptedSend,
34
83
  ];
35
84
  /** One send. A rate limit before Telegram accepted it sent nothing, so `retry.safe` may say so. */
@@ -1 +1 @@
1
- {"version":3,"file":"sending.js","sourceRoot":"","sources":["../../src/telegram/sending.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,kBAAkB,EAA0B,MAAM,cAAc,CAAA;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC;IACpB,sBAAsB;IACtB,oBAAoB;IACpB,yBAAyB;IACzB,0BAA0B;IAC1B,mBAAmB;CACpB,CAAC,CAAA;AACF,MAAM,IAAI,GAAG,IAAI,iBAAiB,EAAyB,CAAA;AAE3D;;;GAGG;AACH,MAAM,gBAAgB,GAAsB,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAClE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,CAAA;IAClC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAA;IAC/B,IAAI,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,C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AQ,IAAI,CAAC,CAAC,KAAK,YAAY,QAAQ,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc;YAAE,MAAM,KAAK,CAAA;QAClG,MAAM,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,GAAG,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;IAClF,CAAC;AACH,CAAC,CAAA"}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.100.0";
1
+ export declare const VERSION = "0.102.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = "0.100.0";
1
+ export const VERSION = "0.102.0";
2
2
  //# sourceMappingURL=version.js.map
@@ -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.102.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.467.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.