@wirecat/tg-cli 0.95.0 → 0.97.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-api-need.d.ts +5 -0
- package/dist/bot-api-need.d.ts.map +1 -0
- package/dist/bot-api-need.js +50 -0
- package/dist/bot-api-need.js.map +1 -0
- package/dist/program.d.ts +4 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +16 -5
- package/dist/program.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/whole-program.d.ts +5 -0
- package/dist/whole-program.d.ts.map +1 -0
- package/dist/whole-program.js +8 -0
- package/dist/whole-program.js.map +1 -0
- package/package.json +5 -4
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** `bot` subcommands that never reach `bot api`; any other word may be a typo that commander answers with "api". */
|
|
2
|
+
export declare const BOT_WITHOUT_API: Set<string>;
|
|
3
|
+
/** Whether this command line needs the `bot api` group built; a wrong yes costs time, a wrong no breaks a command. */
|
|
4
|
+
export declare const needsBotApi: (argv: readonly string[], env: NodeJS.ProcessEnv) => boolean;
|
|
5
|
+
//# sourceMappingURL=bot-api-need.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bot-api-need.d.ts","sourceRoot":"","sources":["../src/bot-api-need.ts"],"names":[],"mappings":"AAUA,oHAAoH;AACpH,eAAO,MAAM,eAAe,aAa1B,CAAA;AAYF,sHAAsH;AACtH,eAAO,MAAM,WAAW,SAAU,SAAS,MAAM,EAAE,OAAO,MAAM,CAAC,UAAU,KAAG,OAW7E,CAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { configFilePath, resolvePaths } from "@wirecat/cli-base";
|
|
3
|
+
import { TG } from "./identity.js";
|
|
4
|
+
/**
|
|
5
|
+
* Commands that read the whole command tree, or run further commands in this process (serve's relay, the MCP
|
|
6
|
+
* servers) without passing through `run` again.
|
|
7
|
+
*/
|
|
8
|
+
const WHOLE_TREE = new Set(["commands", "complete", "help", "mcp", "doctor", "config", "serve", "server", "schedule"]);
|
|
9
|
+
/** `bot` subcommands that never reach `bot api`; any other word may be a typo that commander answers with "api". */
|
|
10
|
+
export const BOT_WITHOUT_API = new Set([
|
|
11
|
+
"auth",
|
|
12
|
+
"list",
|
|
13
|
+
"chats",
|
|
14
|
+
"messages",
|
|
15
|
+
"search",
|
|
16
|
+
"recipients",
|
|
17
|
+
"sends",
|
|
18
|
+
"watch",
|
|
19
|
+
"callbacks",
|
|
20
|
+
"webhooks",
|
|
21
|
+
"contacts",
|
|
22
|
+
"me",
|
|
23
|
+
]);
|
|
24
|
+
/** A saved `bot.api.<operation>` permission is checked against the tree on every command, personal ones included. */
|
|
25
|
+
const savedBotApiKey = (env) => {
|
|
26
|
+
try {
|
|
27
|
+
const path = configFilePath(resolvePaths({ appName: TG.appName, prefix: TG.envPrefix, env }).config);
|
|
28
|
+
return readFileSync(path, "utf8").includes("bot.api");
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
/** Whether this command line needs the `bot api` group built; a wrong yes costs time, a wrong no breaks a command. */
|
|
35
|
+
export const needsBotApi = (argv, env) => {
|
|
36
|
+
const end = argv.indexOf("--");
|
|
37
|
+
const words = end < 0 ? argv : argv.slice(0, end);
|
|
38
|
+
if (words.some((word) => word.includes("bot.api")))
|
|
39
|
+
return true;
|
|
40
|
+
if (words.some((word) => WHOLE_TREE.has(word)))
|
|
41
|
+
return true;
|
|
42
|
+
const bot = words.indexOf("bot");
|
|
43
|
+
if (bot >= 0) {
|
|
44
|
+
const next = words.slice(bot + 1).find((word) => !word.startsWith("-"));
|
|
45
|
+
if (next === undefined || !BOT_WITHOUT_API.has(next))
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
return savedBotApiKey(env);
|
|
49
|
+
};
|
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IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IAC9B,MAAM,KAAK,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;IACjD,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QAAE,OAAO,IAAI,CAAA;IAC/D,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAA;IAC3D,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAChC,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC;QACb,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAA;QACvE,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAA;IACnE,CAAC;IACD,OAAO,cAAc,CAAC,GAAG,CAAC,CAAA;AAC5B,CAAC,CAAA"}
|
package/dist/program.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { type ProgramDefinition } from "@wirecat/cli-core/cli";
|
|
1
2
|
import type { Command } from "commander";
|
|
2
3
|
import { type Environment } from "./commands/context.js";
|
|
3
4
|
/** A revoked or missing login fails the same on every retry; serve reports a locked keyring with another code. */
|
|
4
5
|
export declare const NO_RESTART_ON: number[];
|
|
5
|
-
|
|
6
|
+
/** Builds every later program with `bot api`; the tree walkers' entry (`whole-program.ts`) calls it first. */
|
|
7
|
+
export declare const useBotApi: (group: () => Command) => void;
|
|
8
|
+
export declare const definition: ProgramDefinition;
|
|
6
9
|
/** Never throws: every outcome is an exit code, and a failure is said once, on stderr. */
|
|
7
10
|
export declare const run: (argv: string[], environment?: Environment) => Promise<number>;
|
|
8
11
|
//# sourceMappingURL=program.d.ts.map
|
package/dist/program.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAEA,OAAO,EAuBL,KAAK,iBAAiB,EAqBvB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAIxC,OAAO,EAAE,KAAK,WAAW,EAAmB,MAAM,uBAAuB,CAAA;AAOzE,kHAAkH;AAClH,eAAO,MAAM,aAAa,UAAwC,CAAA;AAKlE,8GAA8G;AAC9G,eAAO,MAAM,SAAS,UAAW,MAAM,OAAO,KAAG,IAEhD,CAAA;AAOD,eAAO,MAAM,UAAU,EAAE,iBAyHxB,CAAA;AAED,0FAA0F;AAC1F,eAAO,MAAM,GAAG,SAAgB,MAAM,EAAE,gBAAe,WAAW,KAAQ,OAAO,CAAC,MAAM,CAYvF,CAAA"}
|
package/dist/program.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { fileURLToPath } from "node:url";
|
|
2
2
|
import { exitCodeFor, processStreams } from "@wirecat/cli-base";
|
|
3
|
-
import { accountCommand, attachmentsCommand, botCommand, chatsCommand, commandsCommand, completeCommand, configCommand, contactsCommand, conversationsCommand,
|
|
3
|
+
import { accountCommand, attachmentsCommand, botCommand, chatsCommand, commandsCommand, completeCommand, configCommand, contactsCommand, conversationsCommand, doctorCommand, floodCommand, guideCommand, imagesCommand, inboxCommand, inSection, MEMO_SCENARIOS, mcpCommand, mentionsCommand, messagesCommand, metadataCommand, modelsCommand, overrideSharedContract, pollsCommand, reactionsCommand, recipientsCommand, repliesCommand, reviewCommand, run as runCli, runsCommand, scheduleCommand, searchCommand, searchesCommand, sendsCommand, serveCommand, serverCommand, skillCommand, statsCommand, storeCommand, tagsCommand, tasksCommand, topicsCommand, watchCommand, } from "@wirecat/cli-core/cli";
|
|
4
4
|
import { CONFIG, TG } from "./app.js";
|
|
5
|
+
import { needsBotApi } from "./bot-api-need.js";
|
|
5
6
|
import { botMcp, TELEGRAM_BOT } from "./commands/bot.js";
|
|
6
|
-
import { telegramBotApiCommand } from "./commands/bot-api.js";
|
|
7
7
|
import { SKILL, TELEGRAM } from "./commands/context.js";
|
|
8
8
|
import { withProxySecrets } from "./commands/proxy-config.js";
|
|
9
9
|
import { sessionCommand } from "./commands/session.js";
|
|
@@ -12,7 +12,17 @@ import { upgradeCommand } from "./commands/update.js";
|
|
|
12
12
|
import { updateNotice } from "./update.js";
|
|
13
13
|
/** A revoked or missing login fails the same on every retry; serve reports a locked keyring with another code. */
|
|
14
14
|
export const NO_RESTART_ON = [exitCodeFor("authentication_error")];
|
|
15
|
-
|
|
15
|
+
// The generated Bot API commands, about 1.5 MB of modules: only a command line that reaches them pays for them.
|
|
16
|
+
let botApi;
|
|
17
|
+
/** Builds every later program with `bot api`; the tree walkers' entry (`whole-program.ts`) calls it first. */
|
|
18
|
+
export const useBotApi = (group) => {
|
|
19
|
+
botApi = group;
|
|
20
|
+
};
|
|
21
|
+
const bot = () => {
|
|
22
|
+
const command = botCommand({ ...TELEGRAM_BOT, mcp: botMcp(run) });
|
|
23
|
+
return botApi ? command.addCommand(botApi()) : command;
|
|
24
|
+
};
|
|
25
|
+
export const definition = {
|
|
16
26
|
app: TG,
|
|
17
27
|
configuration: CONFIG,
|
|
18
28
|
firstScreen: {
|
|
@@ -102,7 +112,7 @@ const definition = {
|
|
|
102
112
|
completeCommand(TELEGRAM, CONFIG),
|
|
103
113
|
upgradeCommand(),
|
|
104
114
|
mcpCommand(TELEGRAM),
|
|
105
|
-
|
|
115
|
+
bot(),
|
|
106
116
|
skillCommand(TG, SKILL),
|
|
107
117
|
guideCommand(TG, {
|
|
108
118
|
directory: fileURLToPath(new URL("../scenarios", import.meta.url)),
|
|
@@ -110,9 +120,10 @@ const definition = {
|
|
|
110
120
|
}),
|
|
111
121
|
],
|
|
112
122
|
};
|
|
113
|
-
export const createProgram = () => create(definition);
|
|
114
123
|
/** Never throws: every outcome is an exit code, and a failure is said once, on stderr. */
|
|
115
124
|
export const run = async (argv, environment = {}) => {
|
|
125
|
+
if (!botApi && needsBotApi(argv, environment.env ?? process.env))
|
|
126
|
+
useBotApi((await import("./commands/bot-api.js")).telegramBotApiCommand);
|
|
116
127
|
const notice = updateNotice(argv, {
|
|
117
128
|
...(environment.tty === undefined ? {} : { tty: environment.tty }),
|
|
118
129
|
...(environment.update ? { environment: environment.update } : {}),
|
package/dist/program.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"program.js","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,eAAe,EACf,eAAe,EACf,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,aAAa,
|
|
1
|
+
{"version":3,"file":"program.js","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,eAAe,EACf,eAAe,EACf,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,YAAY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E,GAAG,EAAE,WAAW,CAAC,GAAG,EAAE,CAAC;QAClE,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAClE,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACrD,CAAC,CAAA;IACF,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,WAAsC,CAAC,CAAA;IACnF,MAAM,IAAI,GAAG,MAAM,MAAM,CAAA;IACzB,IAAI,IAAI,IAAI,IAAI,KAAK,CAAC;QAAE,CAAC,WAAW,CAAC,OAAO,IAAI,cAAc,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;IAChF,OAAO,IAAI,CAAA;AACb,CAAC,CAAA"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.97.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.97.0";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
/** The whole command tree, `bot api` included, for whatever walks it: docs, the test matrix, contract tests. */
|
|
3
|
+
export declare const createProgram: () => Command;
|
|
4
|
+
export { run } from "./program.js";
|
|
5
|
+
//# sourceMappingURL=whole-program.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whole-program.d.ts","sourceRoot":"","sources":["../src/whole-program.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAMxC,gHAAgH;AAChH,eAAO,MAAM,aAAa,QAAO,OAA6B,CAAA;AAC9D,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createProgram as create } from "@wirecat/cli-core/cli";
|
|
2
|
+
import { telegramBotApiCommand } from "./commands/bot-api.js";
|
|
3
|
+
import { definition, useBotApi } from "./program.js";
|
|
4
|
+
useBotApi(telegramBotApiCommand);
|
|
5
|
+
/** The whole command tree, `bot api` included, for whatever walks it: docs, the test matrix, contract tests. */
|
|
6
|
+
export const createProgram = () => create(definition);
|
|
7
|
+
export { run } from "./program.js";
|
|
8
|
+
//# sourceMappingURL=whole-program.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whole-program.js","sourceRoot":"","sources":["../src/whole-program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAE/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAEpD,SAAS,CAAC,qBAAqB,CAAC,CAAA;AAEhC,gHAAgH;AAChH,MAAM,CAAC,MAAM,aAAa,GAAG,GAAY,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;AAC9D,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/tg-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.97.0",
|
|
4
4
|
"description": "A local command line interface for a personal Telegram account, built for agents and scripts",
|
|
5
|
+
"mcpName": "dev.wirecat/tg-cli",
|
|
5
6
|
"license": "Apache-2.0",
|
|
6
7
|
"author": "Viacheslav Ptsarev",
|
|
7
8
|
"repository": {
|
|
@@ -62,14 +63,14 @@
|
|
|
62
63
|
"contracts:upgrade": "pnpm --dir contracts/previous install --frozen-lockfile --ignore-scripts && cli-contract contracts/upgrade.json && cli-contract contracts/legacy-store.json",
|
|
63
64
|
"security:no-leak": "cli-testing security no-leak . contracts/no-leak.json",
|
|
64
65
|
"lint:commands": "cli-dev lint --cli dist/bin/tg.js",
|
|
65
|
-
"test:matrix:check": "cli-dev test-matrix --program dist/program.js --untested scripts/test-matrix-untested.ts --name tg --check && git diff --exit-code -- docs/dev/test-matrix.md",
|
|
66
|
+
"test:matrix:check": "cli-dev test-matrix --program dist/whole-program.js --untested scripts/test-matrix-untested.ts --name tg --check && git diff --exit-code -- docs/dev/test-matrix.md",
|
|
66
67
|
"generate:check": "pnpm bot:generate:check && pnpm build && node --experimental-strip-types scripts/commands.ts && git diff --exit-code -- docs/commands.md",
|
|
67
68
|
"package:check": "node --experimental-strip-types scripts/release-check.ts --package-only"
|
|
68
69
|
},
|
|
69
70
|
"dependencies": {
|
|
70
71
|
"@mtcute/node": "0.32.7",
|
|
71
|
-
"@wirecat/cli-base": "0.
|
|
72
|
-
"@wirecat/cli-core": "0.
|
|
72
|
+
"@wirecat/cli-base": "0.63.0",
|
|
73
|
+
"@wirecat/cli-core": "0.450.0",
|
|
73
74
|
"commander": "15.0.0",
|
|
74
75
|
"undici": "8.12.3",
|
|
75
76
|
"valibot": "1.5.0"
|