@wrongstack/telegram 1.0.3 → 1.0.5
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/index.js
CHANGED
|
@@ -799,7 +799,7 @@ function truncateForTelegram(text, maxLen = 4e3) {
|
|
|
799
799
|
const effectiveMaxLen = Math.min(maxLen, MAX_TELEGRAM_MESSAGE_LENGTH);
|
|
800
800
|
if (text.length <= effectiveMaxLen) return text;
|
|
801
801
|
const cutoff = effectiveMaxLen - 30;
|
|
802
|
-
if (cutoff <= 0) return `${text.slice(0, effectiveMaxLen - 1)}\u2026`;
|
|
802
|
+
if (cutoff <= 0) return `${text.slice(0, Math.max(0, effectiveMaxLen - 1))}\u2026`;
|
|
803
803
|
const paraSearchEnd = effectiveMaxLen - 3;
|
|
804
804
|
const paraIdx = text.lastIndexOf("\n\n", paraSearchEnd);
|
|
805
805
|
if (paraIdx > cutoff) {
|
|
@@ -1628,7 +1628,7 @@ function makeTelegramApproveTool(opts) {
|
|
|
1628
1628
|
},
|
|
1629
1629
|
required: ["prompt"]
|
|
1630
1630
|
},
|
|
1631
|
-
permission: "
|
|
1631
|
+
permission: "confirm",
|
|
1632
1632
|
mutating: true,
|
|
1633
1633
|
riskTier: "standard",
|
|
1634
1634
|
capabilities: [TELEGRAM_APPROVAL_CAPABILITY],
|
|
@@ -27,15 +27,14 @@ interface TelegramApproveOutput {
|
|
|
27
27
|
* auto-denies). Useful when the agent wants explicit approval before
|
|
28
28
|
* continuing and the user is on their phone rather than the TUI.
|
|
29
29
|
*
|
|
30
|
-
* The
|
|
31
|
-
*
|
|
30
|
+
* The Telegram button is the remote authorization for the proposed action;
|
|
31
|
+
* it does not authorize sending the outbound approval request itself.
|
|
32
32
|
*
|
|
33
|
-
* Permission: `
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* safety net for the case where the user never responds.
|
|
33
|
+
* Permission: `confirm`. Sending a persistent approval request to a remote
|
|
34
|
+
* user is a high-impact external side effect, so the host must confirm it
|
|
35
|
+
* before dispatch. After that confirmation, the Telegram button remains the
|
|
36
|
+
* only remote authorization for the proposed action. The 600 s tool
|
|
37
|
+
* `timeoutMs` ceiling auto-denies when the user never responds.
|
|
39
38
|
*/
|
|
40
39
|
export declare function makeTelegramApproveTool(opts: {
|
|
41
40
|
bot: TelegramBot;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrongstack/telegram",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "WrongStack plugin — Telegram bridge: send messages, receive prompts, get notified.",
|
|
6
6
|
"repository": {
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"!dist/**/*.map"
|
|
27
27
|
],
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@wrongstack/core": "1.0.
|
|
29
|
+
"@wrongstack/core": "1.0.5"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/node": "^26.2.0",
|
|
33
|
-
"@wrongstack/core": "1.0.
|
|
33
|
+
"@wrongstack/core": "1.0.5",
|
|
34
34
|
"typescript": "^7.0.2"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|