@wrongstack/telegram 0.284.0 → 0.285.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.
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Replace sensitive flag values and env-style secrets with `[REDACTED]`.
3
+ * Pure: never mutates the input. Safe to call on already-redacted text
4
+ * (idempotent — `[REDACTED]` does not match any pattern).
5
+ */
6
+ export declare function redactSecrets(text: string): string;
7
+ //# sourceMappingURL=redact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../src/redact.ts"],"names":[],"mappings":"AAsCA;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA6BlD"}
@@ -0,0 +1,8 @@
1
+ import type { PluginAPI, SlashCommand } from '@wrongstack/core';
2
+ import type { TelegramBot } from '../bot.js';
3
+ import type { TelegramPluginConfig } from '../config.js';
4
+ export declare function tgHealthCommand(bot: TelegramBot, cfg: TelegramPluginConfig): SlashCommand;
5
+ export declare function tgSendCommand(bot: TelegramBot, defaultChatId: string | number | undefined): SlashCommand;
6
+ export declare function tgChatIdCommand(defaultChatId?: string | number): SlashCommand;
7
+ export declare function registerSlashCommands(api: PluginAPI, bot: TelegramBot, cfg: TelegramPluginConfig): string[];
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/slash-commands/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAMzD,wBAAgB,eAAe,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,oBAAoB,GAAG,YAAY,CA0BzF;AAMD,wBAAgB,aAAa,CAC3B,GAAG,EAAE,WAAW,EAChB,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GACzC,YAAY,CA+Cd;AAMD,wBAAgB,eAAe,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,CAgB7E;AAMD,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,SAAS,EACd,GAAG,EAAE,WAAW,EAChB,GAAG,EAAE,oBAAoB,GACxB,MAAM,EAAE,CAQV"}
@@ -0,0 +1,42 @@
1
+ import type { Tool } from '@wrongstack/core';
2
+ import type { Logger } from '@wrongstack/core';
3
+ import type { TelegramBot } from '../bot.js';
4
+ interface TelegramApproveInput {
5
+ /** Short label for what's being approved (≤ 60 chars). Shown as the prompt heading. */
6
+ prompt: string;
7
+ /** Optional details (≤ 1000 chars). Shown under the heading. */
8
+ details?: string | undefined;
9
+ /** Chat to post the prompt to. Falls back to notifyChatId. */
10
+ chat_id?: string | number | undefined;
11
+ /** How long to wait for a button press before auto-denying. Default 60s, max 600s. */
12
+ timeout_ms?: number | undefined;
13
+ }
14
+ interface TelegramApproveOutput {
15
+ approved: boolean;
16
+ from: string;
17
+ prompt_message_id?: number | undefined;
18
+ }
19
+ /**
20
+ * Post a yes/no inline-keyboard prompt to a chat and block until the user
21
+ * taps a button (or until `timeout_ms` elapses, in which case the call
22
+ * auto-denies). Useful when the agent wants explicit approval before
23
+ * continuing and the user is on their phone rather than the TUI.
24
+ *
25
+ * The agent calls this tool directly. It does not replace the host-level
26
+ * `permission: 'confirm'` flow — for that, see the future B4 work.
27
+ *
28
+ * Permission: `auto` (NOT `confirm`). This is intentional — the tool's
29
+ * purpose IS to obtain user approval; gating it behind another host-level
30
+ * confirm dialog would be circular and would block the agent in
31
+ * headless mode. The user-side approval (Telegram button press) is
32
+ * the only confirm gate. The 600 s tool `timeoutMs` ceiling is the
33
+ * safety net for the case where the user never responds.
34
+ */
35
+ export declare function makeTelegramApproveTool(opts: {
36
+ bot: TelegramBot;
37
+ getDefaultChatId(): string | number | undefined;
38
+ maxMessageLength: number;
39
+ log: Logger;
40
+ }): Tool<TelegramApproveInput, TelegramApproveOutput>;
41
+ export {};
42
+ //# sourceMappingURL=telegram-approve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telegram-approve.d.ts","sourceRoot":"","sources":["../../src/tools/telegram-approve.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG7C,UAAU,oBAAoB;IAC5B,uFAAuF;IACvF,MAAM,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACtC,sFAAsF;IACtF,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC;AAED,UAAU,qBAAqB;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACxC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,GAAG,EAAE,WAAW,CAAC;IACjB,gBAAgB,IAAI,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAChD,gBAAgB,EAAE,MAAM,CAAC;IACzB,GAAG,EAAE,MAAM,CAAC;CACb,GAAG,IAAI,CAAC,oBAAoB,EAAE,qBAAqB,CAAC,CAmFpD"}
@@ -0,0 +1,18 @@
1
+ import type { Tool } from '@wrongstack/core';
2
+ import type { TelegramBot } from '../bot.js';
3
+ interface TelegramReadInput {
4
+ /** Filter to messages from a specific chat/user ID. Omit to see all chats. */
5
+ chat_id?: string | number | undefined;
6
+ /** Max messages to return (default: 10, max: 50). */
7
+ limit?: number | undefined;
8
+ /**
9
+ * If a message_id is provided, acknowledge all messages up to and
10
+ * including this ID (mark them as processed / remove from buffer).
11
+ */
12
+ ack_last?: number | undefined;
13
+ }
14
+ export declare function makeTelegramReadTool(opts: {
15
+ bot: TelegramBot;
16
+ }): Tool<TelegramReadInput>;
17
+ export {};
18
+ //# sourceMappingURL=telegram-read.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telegram-read.d.ts","sourceRoot":"","sources":["../../src/tools/telegram-read.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,UAAU,iBAAiB;IACzB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACtC,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,GAAG,EAAE,WAAW,CAAC;CAClB,GAAG,IAAI,CAAC,iBAAiB,CAAC,CA0D1B"}
@@ -0,0 +1,18 @@
1
+ import type { Tool } from '@wrongstack/core';
2
+ import type { Logger } from '@wrongstack/core';
3
+ import type { TelegramBot } from '../bot.js';
4
+ interface TelegramSendInput {
5
+ /** Chat or user ID to send the message to. Falls back to config.notifyChatId when omitted. */
6
+ chat_id?: string | number | undefined;
7
+ /** Message text. */
8
+ message: string;
9
+ }
10
+ export declare function makeTelegramSendTool(opts: {
11
+ bot: TelegramBot;
12
+ /** Resolved at every execute() call so config changes take effect without restart. */
13
+ getDefaultChatId(): string | number | undefined;
14
+ maxMessageLength: number;
15
+ log: Logger;
16
+ }): Tool<TelegramSendInput>;
17
+ export {};
18
+ //# sourceMappingURL=telegram-send.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telegram-send.d.ts","sourceRoot":"","sources":["../../src/tools/telegram-send.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG7C,UAAU,iBAAiB;IACzB,8FAA8F;IAC9F,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACtC,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,GAAG,EAAE,WAAW,CAAC;IACjB,sFAAsF;IACtF,gBAAgB,IAAI,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAChD,gBAAgB,EAAE,MAAM,CAAC;IACzB,GAAG,EAAE,MAAM,CAAC;CACb,GAAG,IAAI,CAAC,iBAAiB,CAAC,CAqD1B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/telegram",
3
- "version": "0.284.0",
3
+ "version": "0.285.0",
4
4
  "license": "MIT",
5
5
  "description": "WrongStack plugin — Telegram bridge: send messages, receive prompts, get notified.",
6
6
  "repository": {
@@ -25,19 +25,18 @@
25
25
  "dist"
26
26
  ],
27
27
  "peerDependencies": {
28
- "@wrongstack/core": "0.284.0"
28
+ "@wrongstack/core": "0.285.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/node": "^26.0.1",
32
- "tsup": "^8.5.1",
33
- "typescript": "^6.0.3",
34
- "@wrongstack/core": "0.284.0"
32
+ "typescript": "^7.0.2",
33
+ "@wrongstack/core": "0.285.0"
35
34
  },
36
35
  "publishConfig": {
37
36
  "access": "public"
38
37
  },
39
38
  "scripts": {
40
- "build": "tsup",
39
+ "build": "node ../../scripts/build-package.mjs",
41
40
  "typecheck": "tsc --noEmit",
42
41
  "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\""
43
42
  }