@wirecat/tg-cli 0.54.0 → 0.55.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.
- package/dist/bot/adapter.d.ts.map +1 -1
- package/dist/bot/adapter.js +7 -2
- package/dist/bot/adapter.js.map +1 -1
- package/dist/bot/transport.d.ts +1 -1
- package/dist/bot/transport.d.ts.map +1 -1
- package/dist/bot/transport.js +1 -1
- package/dist/bot/transport.js.map +1 -1
- package/dist/commands/answer.d.ts +1 -8
- package/dist/commands/answer.d.ts.map +1 -1
- package/dist/commands/answer.js +3 -10
- package/dist/commands/answer.js.map +1 -1
- package/dist/commands/session.d.ts.map +1 -1
- package/dist/commands/session.js +3 -4
- package/dist/commands/session.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +2 -2
- package/dist/commands/setup.js.map +1 -1
- package/dist/telegram/adapter.d.ts +1 -1
- package/dist/telegram/adapter.d.ts.map +1 -1
- package/dist/telegram/adapter.js +14 -11
- package/dist/telegram/adapter.js.map +1 -1
- package/dist/telegram/map.d.ts +2 -4
- package/dist/telegram/map.d.ts.map +1 -1
- package/dist/telegram/map.js +2 -4
- package/dist/telegram/map.js.map +1 -1
- package/dist/telegram/upload.d.ts +1 -1
- package/dist/telegram/upload.d.ts.map +1 -1
- package/dist/telegram/upload.js +2 -1
- package/dist/telegram/upload.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/skills/tg-cli/SKILL.md +7 -7
package/dist/telegram/upload.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CliError } from "@wirecat/cli-base";
|
|
2
|
+
import { uploadBlob } from "@wirecat/cli-core/sends";
|
|
2
3
|
import { toCliError } from "./errors.js";
|
|
3
4
|
import { toUploadParams } from "./map.js";
|
|
4
5
|
export const UPLOAD_ATTEMPTS = 3;
|
|
@@ -10,7 +11,7 @@ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
|
10
11
|
export const uploadAttachment = async (client, upload, wait = sleep) => {
|
|
11
12
|
for (let attempt = 1;; attempt++) {
|
|
12
13
|
try {
|
|
13
|
-
return await client.uploadFile(toUploadParams(upload));
|
|
14
|
+
return await client.uploadFile({ file: await uploadBlob(upload.source), ...toUploadParams(upload) });
|
|
14
15
|
}
|
|
15
16
|
catch (error) {
|
|
16
17
|
const known = toCliError(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.js","sourceRoot":"","sources":["../../src/telegram/upload.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"upload.js","sourceRoot":"","sources":["../../src/telegram/upload.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAe,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAEzC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAA;AAEhC,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA;AAE/E;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EACnC,MAA0C,EAC1C,MAAc,EACd,IAAI,GAAqC,KAAK,EACvB,EAAE;IACzB,KAAK,IAAI,OAAO,GAAG,CAAC,GAAI,OAAO,EAAE,EAAE,CAAC;QAClC,IAAI,CAAC;YACH,OAAO,MAAM,MAAM,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;QACtG,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;YAC/B,MAAM,OAAO,GAAG,KAAK,YAAY,QAAQ,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YAC9F,IAAI,CAAC,OAAO;gBAAE,MAAM,KAAK,CAAA;YACzB,IAAI,OAAO,IAAI,eAAe,EAAE,CAAC;gBAC/B,MAAM,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,iCAAiC,OAAO,0BAA0B,EAAE;oBACjG,QAAQ,EAAE,OAAO;iBAClB,CAAC,CAAA;YACJ,CAAC;YACD,MAAM,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;AACH,CAAC,CAAA"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.55.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = "0.
|
|
1
|
+
export const VERSION = "0.55.0";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/tg-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.55.0",
|
|
4
4
|
"description": "A local command line interface for a personal Telegram account, built for agents and scripts",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Viacheslav Ptsarev",
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@mtcute/node": "0.32.4",
|
|
67
|
-
"@wirecat/cli-base": "0.
|
|
68
|
-
"@wirecat/cli-core": "0.
|
|
67
|
+
"@wirecat/cli-base": "0.28.2",
|
|
68
|
+
"@wirecat/cli-core": "0.275.0",
|
|
69
69
|
"commander": "15.0.0",
|
|
70
70
|
"undici": "7.30.0",
|
|
71
71
|
"valibot": "1.5.0"
|
package/skills/tg-cli/SKILL.md
CHANGED
|
@@ -14,8 +14,8 @@ search --json`** describes one command; **`tg commands messages --json`** descri
|
|
|
14
14
|
Both include arguments, options, global options and exit codes. Use `tg <command> --help` for a
|
|
15
15
|
shorter explanation. Command words form one path, not a list of groups: inspect different groups
|
|
16
16
|
in separate calls. **`tg commands --json`** returns the entire tree when you need an overview;
|
|
17
|
-
do not read it in full before every task. `
|
|
18
|
-
|
|
17
|
+
do not read it in full before every task. `effects.remote: "write"` identifies a write to Telegram;
|
|
18
|
+
`effects.local: "write"` alone, a write to this machine. `commands --json` connects to no account. Its `contract` field is the shared JSON contract
|
|
19
19
|
version; it changes only when response fields change incompatibly, not with a package upgrade, so
|
|
20
20
|
check that field rather than comparing whole outputs. This file holds the traps and boundaries.
|
|
21
21
|
|
|
@@ -137,7 +137,7 @@ summary; news digests remain separate future work. Permission: `messages.evidenc
|
|
|
137
137
|
4. **Exit `14` means an unknown write outcome, not permission to replay it.** Inspect
|
|
138
138
|
`tg personal sends list --json` by `operationId` and the target chat's history. `operationId` correlates
|
|
139
139
|
the journal; it is not an idempotency key. Retry a message only when the provider's confirmed
|
|
140
|
-
deduplication contract applies to the same chat, topic, content and `--
|
|
140
|
+
deduplication contract applies to the same chat, topic, content and `--operation-id`.
|
|
141
141
|
Never automatically repeat an unknown write based only on its error code.
|
|
142
142
|
|
|
143
143
|
5. **Start a search with `tg personal search all`**: messages, mail and notes on this machine in one answer, each hit
|
|
@@ -184,15 +184,15 @@ summary; news digests remain separate future work. Permission: `messages.evidenc
|
|
|
184
184
|
Styles nest; code/pre cannot overlap other formatting, and quotes cannot nest. MAX has different rules.
|
|
185
185
|
Without the flag text is literal. Use http/https/mailto links; no unsafe URL schemes.
|
|
186
186
|
14. **`--at-time 2h` or `--at-time 2026-10-01T09:00` (local time) hands the message to Telegram to send later.**
|
|
187
|
-
It is never repeated: `--
|
|
187
|
+
It is never repeated: `--operation-id` is refused with it, and after exit `14` look in
|
|
188
188
|
`tg personal messages scheduled <chat>` — a second send would be a second message. Cancel one in the app.
|
|
189
189
|
15. **`--photo <path>` or `--file <path>` attaches one file, the text as its caption.** A photo is
|
|
190
190
|
recompressed by Telegram; a file goes byte for byte. Hidden files and folders, `~/.ssh`, tg's own
|
|
191
191
|
folders and the message store are refused — only the owner adds `--allow-any-file`. A retry with
|
|
192
|
-
the same `--
|
|
192
|
+
the same `--operation-id` is safe here too (measured 2026-09-29).
|
|
193
193
|
**Forum sends:** `messages send --topic`, `messages forward --topic` and `polls create --topic` use a topic id
|
|
194
194
|
from `topics list` (for a forward, a topic of the `--to` chat); `topics show <chat> <id>` reads one topic.
|
|
195
|
-
Reply targets must belong to that topic. Keep the same chat, topic and `--
|
|
195
|
+
Reply targets must belong to that topic. Keep the same chat, topic and `--operation-id` on a retry;
|
|
196
196
|
never retry a scheduled send. Missing or closed topics are refused; nothing marks them read.
|
|
197
197
|
**Posting as a channel:** `messages send --send-as <id>` only with an id from `chats send-as <chat>`,
|
|
198
198
|
and only when the owner named that identity; `messages forward` and `polls create` take it too. A retry
|
|
@@ -415,7 +415,7 @@ Unknown edges and message-id holes do not prove missing history.
|
|
|
415
415
|
## Pictures
|
|
416
416
|
|
|
417
417
|
Picture search is off until `tg <profile> config set picture_search true`. Then
|
|
418
|
-
`tg <profile> models
|
|
418
|
+
`tg <profile> images models download clip-b32` (once, about 155 MB) and `tg <profile> images embed`
|
|
419
419
|
(`--chat`, `--limit`) read the stored pictures on this machine. After that a message search returns a
|
|
420
420
|
`pictures` list beside its hits; with no model, `picturesSkipped` says so. **Picture queries must be English**:
|
|
421
421
|
translate the owner's words first. Never turn the setting on or run `images embed` without the owner's say.
|