@wirecat/tg-cli 0.49.0 → 0.51.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.js +1 -1
- package/dist/bot/generated/definitions.d.ts +1 -1
- package/dist/bot/generated/manifest.d.ts +1 -1
- package/dist/bot/generated/schemas.js +1 -1
- package/dist/bot/map.js +1 -1
- package/dist/bot/transport.js +1 -1
- package/dist/commands/bot-api.js +1 -1
- package/dist/commands/bot.js +1 -1
- package/dist/commands/context.d.ts +1 -1
- package/dist/commands/context.js +1 -1
- package/dist/commands/proxy-config.js +1 -1
- package/dist/commands/session.js +2 -2
- package/dist/commands/setup.js +3 -3
- package/dist/install/postinstall.js +1 -1
- package/dist/paths.d.ts +2 -2
- package/dist/paths.js +2 -2
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +3 -2
- package/dist/program.js.map +1 -1
- package/dist/proxy.d.ts +1 -1
- package/dist/proxy.js +1 -1
- package/dist/telegram/adapter.js +1 -1
- package/dist/telegram/bot-history.js +1 -1
- package/dist/telegram/comments.js +1 -1
- package/dist/telegram/credentials.d.ts +1 -1
- package/dist/telegram/credentials.js +1 -1
- package/dist/telegram/errors.js +1 -1
- package/dist/telegram/format-html.js +1 -1
- package/dist/telegram/format-markdown.js +1 -1
- package/dist/telegram/join-requests.js +1 -1
- package/dist/telegram/map.js +1 -1
- package/dist/telegram/polls.js +1 -1
- package/dist/telegram/proxy.d.ts +3 -3
- package/dist/telegram/proxy.js +1 -1
- package/dist/telegram/registration.js +1 -1
- package/dist/telegram/send-as.js +1 -1
- package/dist/telegram/upload.js +1 -1
- package/dist/update.d.ts +2 -2
- package/dist/update.js +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +10 -10
- package/spec/bot/README.md +1 -1
package/dist/bot/adapter.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CliError, isCliError } from "@wirecat/cli-
|
|
1
|
+
import { CliError, isCliError } from "@wirecat/cli-base";
|
|
2
2
|
import { formatMarkdown } from "../telegram/format-markdown.js";
|
|
3
3
|
import { ADMIN_RIGHT_FIELDS, entitiesOf, PROMOTE_FIELDS, toAdmin, toChat, toEvent, toMessage, UPDATE_TYPES, } from "./map.js";
|
|
4
4
|
/** `user:<id>` is the dialog with that person: Telegram's chat id for a dialog is the person's id. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// GENERATED. DO NOT EDIT.
|
|
2
2
|
// Source: spec/bot/api.json
|
|
3
3
|
// Run: pnpm bot:generate
|
|
4
|
-
import { int64, integer, number } from "@wirecat/cli-
|
|
4
|
+
import { int64, integer, number } from "@wirecat/cli-base/codegen/runtime";
|
|
5
5
|
import * as v from "valibot";
|
|
6
6
|
export const Update = v.looseObject({
|
|
7
7
|
update_id: int64(),
|
package/dist/bot/map.js
CHANGED
package/dist/bot/transport.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CliError, isCliError } from "@wirecat/cli-
|
|
1
|
+
import { CliError, isCliError } from "@wirecat/cli-base";
|
|
2
2
|
import { apiJson, apiPlainJson, parseApiJson } from "@wirecat/cli-messaging/cli";
|
|
3
3
|
const API = "https://api.telegram.org";
|
|
4
4
|
const DEFAULT_TIMEOUT_MS = 30_000;
|
package/dist/commands/bot-api.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFileSync, statSync } from "node:fs";
|
|
2
2
|
import { basename } from "node:path";
|
|
3
|
-
import { CliError } from "@wirecat/cli-
|
|
3
|
+
import { CliError } from "@wirecat/cli-base";
|
|
4
4
|
import { apiPlainJson, BotTokenStore, botContext, ChatRegistry, checkApiBody, checkApiParameter, generatedApiCommand, prepareRpcApiBody, } from "@wirecat/cli-messaging/cli";
|
|
5
5
|
import { DEFAULT_PERMISSIONS, guardedWrite, levelFor, newOperationId } from "@wirecat/cli-messaging/sends";
|
|
6
6
|
import { definitions } from "../bot/generated/definitions.js";
|
package/dist/commands/bot.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
|
-
import { CliError } from "@wirecat/cli-
|
|
2
|
+
import { CliError } from "@wirecat/cli-base";
|
|
3
3
|
import { BotTokenStore, botCopy, environmentOf, } from "@wirecat/cli-messaging/cli";
|
|
4
4
|
import { resolveSettings, TG } from "../app.js";
|
|
5
5
|
import { telegramBotAdapter } from "../bot/adapter.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type KeyringStore } from "@wirecat/cli-
|
|
1
|
+
import { type KeyringStore } from "@wirecat/cli-base";
|
|
2
2
|
import { type BaseEnvironment, type ConnectOptions, type Messenger, type MessengerAdapter, type MessengerContext, type ServerSystem } from "@wirecat/cli-messaging/cli";
|
|
3
3
|
import type { Command } from "commander";
|
|
4
4
|
import type { FetchLike } from "../bot/transport.js";
|
package/dist/commands/context.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, statSync } from "node:fs";
|
|
2
2
|
import { dirname } from "node:path";
|
|
3
|
-
import { CliError } from "@wirecat/cli-
|
|
3
|
+
import { CliError } from "@wirecat/cli-base";
|
|
4
4
|
import { asFirstWord, environmentOf, messengerContext, } from "@wirecat/cli-messaging/cli";
|
|
5
5
|
import { resolveSettings, TG } from "../app.js";
|
|
6
6
|
import { isolated, sessionFile } from "../paths.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CliError, isCliError } from "@wirecat/cli-
|
|
1
|
+
import { CliError, isCliError } from "@wirecat/cli-base";
|
|
2
2
|
import { readSecret } from "@wirecat/cli-messaging";
|
|
3
3
|
import { environmentOf } from "@wirecat/cli-messaging/cli";
|
|
4
4
|
import { CONFIG } from "../app.js";
|
package/dist/commands/session.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { chmodSync, existsSync, rmSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { resolve } from "node:path";
|
|
3
|
-
import { CliError, indent } from "@wirecat/cli-
|
|
4
|
-
import { annotate } from "@wirecat/cli-
|
|
3
|
+
import { CliError, indent } from "@wirecat/cli-base";
|
|
4
|
+
import { annotate } from "@wirecat/cli-base/commands";
|
|
5
5
|
import { qrPng, readSecret, terminalQr } from "@wirecat/cli-messaging";
|
|
6
6
|
import { asFirstWord, commandWords, inputPolicy, refuseCommandName, rememberAccount, rootOf, } from "@wirecat/cli-messaging/cli";
|
|
7
7
|
import { Argument, Command, Option } from "commander";
|
package/dist/commands/setup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { accessSync, constants, existsSync, mkdirSync } from "node:fs";
|
|
2
|
-
import { CliError, indent, renderPretty } from "@wirecat/cli-
|
|
3
|
-
import { annotate } from "@wirecat/cli-
|
|
4
|
-
import { installSkill } from "@wirecat/cli-
|
|
2
|
+
import { CliError, indent, renderPretty } from "@wirecat/cli-base";
|
|
3
|
+
import { annotate } from "@wirecat/cli-base/commands";
|
|
4
|
+
import { installSkill } from "@wirecat/cli-base/skill";
|
|
5
5
|
import { readSecret } from "@wirecat/cli-messaging";
|
|
6
6
|
import { asFirstWord, commandWords, environmentOf, inputPolicy, refuseCommandName, rootOf, runtime, withDeadline, } from "@wirecat/cli-messaging/cli";
|
|
7
7
|
import { levelFor } from "@wirecat/cli-messaging/sends";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { spawnSync } from "node:child_process";
|
|
2
2
|
import { dirname, join, resolve } from "node:path";
|
|
3
3
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
4
|
-
import { installSkill } from "@wirecat/cli-
|
|
4
|
+
import { installSkill } from "@wirecat/cli-base/skill";
|
|
5
5
|
import { VERSION } from "../version.js";
|
|
6
6
|
const root = resolve(dirname(fileURLToPath(import.meta.url)), "../..");
|
|
7
7
|
export const completeGlobalInstall = ({ env = process.env, platform = process.platform, packageRoot = root, repair = (prefix) => {
|
package/dist/paths.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type Paths } from "@wirecat/cli-
|
|
1
|
+
import { type Paths } from "@wirecat/cli-base";
|
|
2
2
|
export declare const APP: string;
|
|
3
3
|
export declare const pathsFor: (env?: NodeJS.ProcessEnv) => Paths;
|
|
4
|
-
/** A throwaway config directory must not share the real keyring entry (cli-
|
|
4
|
+
/** A throwaway config directory must not share the real keyring entry (cli-base `isolated`). */
|
|
5
5
|
export declare const isolated: (env?: NodeJS.ProcessEnv) => boolean;
|
|
6
6
|
/** The MTProto session: an auth key, which is a credential as good as a password. */
|
|
7
7
|
export declare const sessionFile: (profile: string, env?: NodeJS.ProcessEnv) => string;
|
package/dist/paths.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
|
-
import { pathsAreOverridden, resolvePaths } from "@wirecat/cli-
|
|
2
|
+
import { pathsAreOverridden, resolvePaths } from "@wirecat/cli-base";
|
|
3
3
|
import { TG } from "./app.js";
|
|
4
4
|
export const APP = TG.appName;
|
|
5
5
|
export const pathsFor = (env = process.env) => resolvePaths({ appName: TG.appName, prefix: TG.envPrefix, env });
|
|
6
|
-
/** A throwaway config directory must not share the real keyring entry (cli-
|
|
6
|
+
/** A throwaway config directory must not share the real keyring entry (cli-base `isolated`). */
|
|
7
7
|
export const isolated = (env = process.env) => pathsAreOverridden({ appName: TG.appName, prefix: TG.envPrefix, env });
|
|
8
8
|
/** The MTProto session: an auth key, which is a credential as good as a password. */
|
|
9
9
|
export const sessionFile = (profile, env = process.env) => join(pathsFor(env).state, "sessions", `${profile}.session`);
|
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":"AA0CA,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;AA0FlE,eAAO,MAAM,aAAa,QAAO,OAA6B,CAAA;AAE9D,0FAA0F;AAC1F,eAAO,MAAM,GAAG,SAAgB,MAAM,EAAE,gBAAe,WAAW,KAAQ,OAAO,CAAC,MAAM,CAcvF,CAAA"}
|
package/dist/program.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { appendFileSync } from "node:fs";
|
|
2
|
-
import { exitCodeFor, processStreams } from "@wirecat/cli-
|
|
3
|
-
import { accountCommand, attachmentsCommand, botCommand, chatsCommand, commandsCommand, completeCommand, configCommand, contactsCommand, conversationsCommand, createProgram as create, doctorCommand, floodCommand, inboxCommand, mcpCommand, messagesCommand, metadataCommand, modelsCommand, pollsCommand, reactionsCommand, recipientsCommand, repliesCommand, reviewCommand, run as runCli, runsCommand, searchCommand, searchesCommand, sendsCommand, serveCommand, serverCommand, skillCommand, statsCommand, storeCommand, tagsCommand, tasksCommand, topicsCommand, watchCommand, } from "@wirecat/cli-messaging/cli";
|
|
2
|
+
import { exitCodeFor, processStreams } from "@wirecat/cli-base";
|
|
3
|
+
import { accountCommand, attachmentsCommand, botCommand, chatsCommand, commandsCommand, completeCommand, configCommand, contactsCommand, conversationsCommand, createProgram as create, doctorCommand, floodCommand, inboxCommand, mcpCommand, messagesCommand, metadataCommand, modelsCommand, 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-messaging/cli";
|
|
4
4
|
import { CONFIG, TG } from "./app.js";
|
|
5
5
|
import { TELEGRAM_BOT } from "./commands/bot.js";
|
|
6
6
|
import { telegramBotApiCommand } from "./commands/bot-api.js";
|
|
@@ -65,6 +65,7 @@ const definition = {
|
|
|
65
65
|
watchCommand(TELEGRAM),
|
|
66
66
|
serveCommand(TELEGRAM),
|
|
67
67
|
serverCommand(TELEGRAM, { unit: { noRestartOn: NO_RESTART_ON } }),
|
|
68
|
+
scheduleCommand(TELEGRAM),
|
|
68
69
|
storeCommand(TELEGRAM),
|
|
69
70
|
conversationsCommand(TELEGRAM),
|
|
70
71
|
attachmentsCommand(TELEGRAM),
|
package/dist/program.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"program.js","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,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,IAAI,MAAM,EACvB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,eAAe,EACf,eAAe,EACf,aAAa,EAEb,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,GAAG,IAAI,MAAM,EACb,WAAW,EACX,aAAa,EACb,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,aAAa,EACb,YAAY,GACb,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EAAoB,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AACzE,OAAO,EAAE,gBAAgB,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AE,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC;QACzD,IAAI,EAAE,CAAC,MAAM;YAAE,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAA;QACvC,KAAK,MAAM,MAAM,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;YAChC,MAAM,GAAG,GAAG,MAAM,CAAC,aAAa,EAAE,CAAA;YAClC,IAAI,EAAE,CAAC,oBAAoB,CAAC,GAAG,CAAC,KAAK,KAAK,IAAI,CAAC,MAAM,CAAC,IAAI;gBAAE,SAAQ;YACpE,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC;gBAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QACrF,CAAC;IACH,CAAC;IACD,cAAc,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,CAAA;AACpF,CAAC,CAAA"}
|
package/dist/proxy.d.ts
CHANGED
package/dist/proxy.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CliError } from "@wirecat/cli-
|
|
1
|
+
import { CliError } from "@wirecat/cli-base";
|
|
2
2
|
import * as v from "valibot";
|
|
3
3
|
const SHAPES = "socks5://host:port, http://host:port, https://host:port or an MTProxy link (tg://proxy?server=…)";
|
|
4
4
|
const TELEGRAM_HOSTS = new Set(["t.me", "telegram.me", "telegram.dog"]);
|
package/dist/telegram/adapter.js
CHANGED
|
@@ -2,7 +2,7 @@ import { chmodSync, existsSync, mkdirSync } from "node:fs";
|
|
|
2
2
|
import { dirname } from "node:path";
|
|
3
3
|
import { format } from "node:util";
|
|
4
4
|
import { ChatInviteLink, FileLocation, getMarkedPeerId, Long, MtcuteError, MtPeerNotFoundError, networkMiddlewares, PeersIndex, TelegramClient, Message as TgMessage, tl, User, } from "@mtcute/node";
|
|
5
|
-
import { CliError, isCliError } from "@wirecat/cli-
|
|
5
|
+
import { CliError, isCliError } from "@wirecat/cli-base";
|
|
6
6
|
import { observedCounters, pickChat, } from "@wirecat/cli-messaging";
|
|
7
7
|
import { commentsOf, discussionOf } from "./comments.js";
|
|
8
8
|
import { toCliError } from "./errors.js";
|
|
@@ -3,7 +3,7 @@ import { dirname } from "node:path";
|
|
|
3
3
|
import { setTimeout as sleep } from "node:timers/promises";
|
|
4
4
|
import { getMarkedPeerId, Long, MtPeerNotFoundError, TelegramClient } from "@mtcute/node";
|
|
5
5
|
import { links } from "@mtcute/node/utils.js";
|
|
6
|
-
import { CliError, isCliError } from "@wirecat/cli-
|
|
6
|
+
import { CliError, isCliError } from "@wirecat/cli-base";
|
|
7
7
|
import { toCliError } from "./errors.js";
|
|
8
8
|
import { toHistoryChannel, toHistoryMessages } from "./map.js";
|
|
9
9
|
import { proxiedTransport } from "./proxy.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getMarkedPeerId, Long, PeersIndex, Message as TgMessage, tl } from "@mtcute/node";
|
|
2
|
-
import { CliError } from "@wirecat/cli-
|
|
2
|
+
import { CliError } from "@wirecat/cli-base";
|
|
3
3
|
const PAGE = 100;
|
|
4
4
|
const noComments = () => new CliError("not_found", "this post takes no comments — the channel has no discussion, or the post is closed to them");
|
|
5
5
|
/**
|
package/dist/telegram/errors.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MtArgumentError, MtcuteError, MtEmptyError, MtInvalidPeerTypeError, MtMessageNotFoundError, MtPeerNotFoundError, MtSecurityError, MtTimeoutError, MtTypeAssertionError, MtUnsupportedError, tl, } from "@mtcute/node";
|
|
2
|
-
import { CliError, isCliError } from "@wirecat/cli-
|
|
2
|
+
import { CliError, isCliError } from "@wirecat/cli-base";
|
|
3
3
|
const { RpcError } = tl;
|
|
4
4
|
const NOT_FOUND = new Set([
|
|
5
5
|
"PEER_ID_INVALID",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { tl } from "@mtcute/node";
|
|
2
|
-
import { CliError } from "@wirecat/cli-
|
|
2
|
+
import { CliError } from "@wirecat/cli-base";
|
|
3
3
|
import { toMember } from "./map.js";
|
|
4
4
|
/** Newest first, as Telegram lists them; `total` counts every pending request, not just this page. */
|
|
5
5
|
export const joinRequestsOf = async (client, chatId, limit, { link, search } = {}) => {
|
package/dist/telegram/map.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { extname } from "node:path";
|
|
2
2
|
import { getMarkedPeerId, InputMedia, MessageReactions, PeersIndex, Message as TgMessage, } from "@mtcute/node";
|
|
3
|
-
import { CliError } from "@wirecat/cli-
|
|
3
|
+
import { CliError } from "@wirecat/cli-base";
|
|
4
4
|
import { rulesOf } from "./folder-rules.js";
|
|
5
5
|
const seconds = (at) => (at > 0 ? new Date(at * 1000).toISOString() : null);
|
|
6
6
|
export const toAccountSession = (session) => ({
|
package/dist/telegram/polls.js
CHANGED
package/dist/telegram/proxy.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type proxyTransportFromUrl } from "@mtcute/node";
|
|
2
|
-
import { CliError, type KeyringStore } from "@wirecat/cli-
|
|
2
|
+
import { CliError, type KeyringStore } from "@wirecat/cli-base";
|
|
3
3
|
import { type Settings } from "@wirecat/cli-messaging/cli";
|
|
4
4
|
import { type ProxyServer } from "../proxy.js";
|
|
5
5
|
type TelegramTransport = ReturnType<typeof proxyTransportFromUrl>;
|
|
@@ -14,8 +14,8 @@ export declare const proxySecrets: ({ env, keyring }: {
|
|
|
14
14
|
keyring?: KeyringStore;
|
|
15
15
|
}) => {
|
|
16
16
|
read: (profile: string | undefined) => string | undefined;
|
|
17
|
-
write: (profile: string | undefined, secret: string) => import("@wirecat/cli-
|
|
18
|
-
remove: (profile: string | undefined) => import("@wirecat/cli-
|
|
17
|
+
write: (profile: string | undefined, secret: string) => import("@wirecat/cli-base").CredentialSource;
|
|
18
|
+
remove: (profile: string | undefined) => import("@wirecat/cli-base").CredentialSource[];
|
|
19
19
|
};
|
|
20
20
|
export interface ProxyInUse {
|
|
21
21
|
proxy: ProxyServer;
|
package/dist/telegram/proxy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpProxyConnectionError, HttpProxyTcpTransport, MtProxyTcpTransport, SocksProxyConnectionError, SocksProxyTcpTransport, } from "@mtcute/node";
|
|
2
|
-
import { CliError, Credentials } from "@wirecat/cli-
|
|
2
|
+
import { CliError, Credentials } from "@wirecat/cli-base";
|
|
3
3
|
import { fromFile } from "@wirecat/cli-messaging/cli";
|
|
4
4
|
import { APP, isolated, pathsFor } from "../paths.js";
|
|
5
5
|
import { parseProxy, proxyError, proxyLabel } from "../proxy.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomBytes } from "node:crypto";
|
|
2
|
-
import { CliError, singleLine } from "@wirecat/cli-
|
|
2
|
+
import { CliError, singleLine } from "@wirecat/cli-base";
|
|
3
3
|
/**
|
|
4
4
|
* Registers the owner's app on my.telegram.org and reads its `api_id` and `api_hash` — the same
|
|
5
5
|
* page a person would fill in, driven without a browser.
|
package/dist/telegram/send-as.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getBasicPeerType, getMarkedPeerId, PeersIndex, tl } from "@mtcute/node";
|
|
2
|
-
import { CliError } from "@wirecat/cli-
|
|
2
|
+
import { CliError } from "@wirecat/cli-base";
|
|
3
3
|
/**
|
|
4
4
|
* Reads only. `messages.saveDefaultSendAs` would change the chat's saved choice for every client of
|
|
5
5
|
* the account, so the choice is made per send instead.
|
package/dist/telegram/upload.js
CHANGED
package/dist/update.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FetchLike } from "@wirecat/cli-
|
|
2
|
-
import { type Installer } from "@wirecat/cli-
|
|
1
|
+
import type { FetchLike } from "@wirecat/cli-base/http";
|
|
2
|
+
import { type Installer } from "@wirecat/cli-base/update";
|
|
3
3
|
export declare const PACKAGE = "@wirecat/tg-cli";
|
|
4
4
|
/** npm, the clock, the terminal and the package manager as `tg upgrade` sees them — faked in a test. */
|
|
5
5
|
export interface UpdateEnvironment {
|
package/dist/update.js
CHANGED
|
@@ -2,7 +2,7 @@ import { spawnSync } from "node:child_process";
|
|
|
2
2
|
import { realpathSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { installerOf, latestVersion, runUpdate as runPackageManager, updateNotice as sharedNotice, } from "@wirecat/cli-
|
|
5
|
+
import { installerOf, latestVersion, runUpdate as runPackageManager, updateNotice as sharedNotice, } from "@wirecat/cli-base/update";
|
|
6
6
|
import { resolveSettings } from "./app.js";
|
|
7
7
|
import { pathsFor } from "./paths.js";
|
|
8
8
|
import { VERSION } from "./version.js";
|
|
@@ -31,7 +31,7 @@ export const updateNotice = (argv, { tty, environment = {}, env = process.env, }
|
|
|
31
31
|
if (argv.includes("upgrade"))
|
|
32
32
|
return Promise.resolve(undefined);
|
|
33
33
|
const pretty = !argv.includes("--json") && !argv.includes("--jsonl") && (tty ?? process.stdout.isTTY === true);
|
|
34
|
-
// cli-
|
|
34
|
+
// cli-base 0.8 names the command `update` in its line; tg's is `upgrade`.
|
|
35
35
|
return sharedNotice({
|
|
36
36
|
argv,
|
|
37
37
|
packageName: PACKAGE,
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.51.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.51.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.51.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",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"spec/bot/LICENSE"
|
|
27
27
|
],
|
|
28
28
|
"scripts": {
|
|
29
|
-
"build": "tsc --build",
|
|
29
|
+
"build": "tsc --build --force",
|
|
30
30
|
"typecheck": "tsc --build --force --emitDeclarationOnly && tsc -p tsconfig.test.json && tsc -p tsconfig.scripts.json",
|
|
31
31
|
"lint": "biome check .",
|
|
32
32
|
"lint:fix": "biome check --write .",
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"security:no-leak": "cli-testing security no-leak . contracts/no-leak.json"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@mtcute/node": "0.32.
|
|
66
|
-
"@wirecat/cli-
|
|
67
|
-
"@wirecat/cli-messaging": "0.
|
|
65
|
+
"@mtcute/node": "0.32.4",
|
|
66
|
+
"@wirecat/cli-base": "0.21.0",
|
|
67
|
+
"@wirecat/cli-messaging": "0.253.0",
|
|
68
68
|
"commander": "15.0.0",
|
|
69
69
|
"undici": "7.30.0",
|
|
70
70
|
"valibot": "1.5.0"
|
|
@@ -74,16 +74,16 @@
|
|
|
74
74
|
"@cspell/dict-en-gb": "5.0.34",
|
|
75
75
|
"@cspell/dict-es-es": "3.0.9",
|
|
76
76
|
"@cspell/dict-ru_ru": "2.3.3",
|
|
77
|
-
"@napi-rs/canvas": "1.0.
|
|
77
|
+
"@napi-rs/canvas": "1.0.11",
|
|
78
78
|
"@types/node": "^22.20.4",
|
|
79
|
-
"@vitest/coverage-v8": "5.0.
|
|
80
|
-
"@wirecat/cli-testing": "0.
|
|
79
|
+
"@vitest/coverage-v8": "5.0.3",
|
|
80
|
+
"@wirecat/cli-testing": "0.4.0",
|
|
81
81
|
"cspell": "10.3.6",
|
|
82
82
|
"lefthook": "2.1.16",
|
|
83
83
|
"markdownlint-cli2": "0.23.3",
|
|
84
|
-
"rumdl": "^0.2.
|
|
84
|
+
"rumdl": "^0.2.79",
|
|
85
85
|
"typescript": "^7.0.2",
|
|
86
86
|
"unpdf": "1.8.1",
|
|
87
|
-
"vitest": "^5.0.
|
|
87
|
+
"vitest": "^5.0.3"
|
|
88
88
|
}
|
|
89
89
|
}
|
package/spec/bot/README.md
CHANGED
|
@@ -11,6 +11,6 @@ methods are marked sensitive and must never print their token. Financial mutatio
|
|
|
11
11
|
removals are guarded as destructive. No method is classified from its name during generation.
|
|
12
12
|
|
|
13
13
|
Generate and check offline with `pnpm bot:generate` and `pnpm bot:generate:check`.
|
|
14
|
-
Only the source adapter lives here; all generators come from cli-
|
|
14
|
+
Only the source adapter lives here; all generators come from cli-base.
|
|
15
15
|
|
|
16
16
|
The npm package includes `spec/bot/LICENSE` because generated artifacts derive from this snapshot.
|