@coinseeker/opencode-telegram-plugin 1.1.3 → 1.1.4
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/README.md +4 -4
- package/dist/telegram-remote.js +12 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,15 +15,15 @@ Configure the npm package in `~/.config/opencode/opencode.json`:
|
|
|
15
15
|
|
|
16
16
|
```json
|
|
17
17
|
{
|
|
18
|
-
"plugin": ["@coinseeker/opencode-telegram-plugin@1.1.
|
|
18
|
+
"plugin": ["@coinseeker/opencode-telegram-plugin@1.1.4"]
|
|
19
19
|
}
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
Current stable version: `@coinseeker/opencode-telegram-plugin@1.1.
|
|
22
|
+
Current stable version: `@coinseeker/opencode-telegram-plugin@1.1.4`.
|
|
23
23
|
|
|
24
24
|
Restart OpenCode after editing the config. OpenCode resolves npm package plugins on startup.
|
|
25
25
|
|
|
26
|
-
To update an existing install, replace the previous pinned package entry with `@coinseeker/opencode-telegram-plugin@1.1.
|
|
26
|
+
To update an existing install, replace the previous pinned package entry with `@coinseeker/opencode-telegram-plugin@1.1.4`, keep the rest of the `plugin` array unchanged, and restart OpenCode.
|
|
27
27
|
|
|
28
28
|
## Configure Telegram
|
|
29
29
|
|
|
@@ -62,7 +62,7 @@ Keep this file private. Never commit or share your Telegram bot token.
|
|
|
62
62
|
- Multi-session-safe Telegram polling through a file-lock leader model.
|
|
63
63
|
- Log file output instead of stdout terminal spam.
|
|
64
64
|
- Cross-process remote session listing via `/sessions`, `/status N`, `/start_work N`, `/help` slash commands.
|
|
65
|
-
- Safety-gated remote `/start-work` execution: verifies agent
|
|
65
|
+
- Safety-gated remote `/start-work` execution: verifies a raw `plan` agent or Prometheus Plan Builder label, idle status, incomplete plan, and no active boulder before dispatching.
|
|
66
66
|
|
|
67
67
|
## Logs
|
|
68
68
|
|
package/dist/telegram-remote.js
CHANGED
|
@@ -1429,6 +1429,13 @@ async function handleSessionError(event, ctx) {
|
|
|
1429
1429
|
ctx.logger.info("session abort recorded", { sessionId: event.properties.sessionID ?? "global" });
|
|
1430
1430
|
}
|
|
1431
1431
|
|
|
1432
|
+
// src/lib/plan-agent.ts
|
|
1433
|
+
function isPlanSessionAgent(agent) {
|
|
1434
|
+
if (!agent) return false;
|
|
1435
|
+
const normalized = agent.trim().replace(/[–—]/g, "-").replace(/\s+/g, " ").toLowerCase();
|
|
1436
|
+
return normalized === "plan" || normalized === "prometheus" || normalized === "prometheus - plan builder" || normalized === "prometheus (plan builder)";
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1432
1439
|
// src/lib/pending-start-work.ts
|
|
1433
1440
|
import { createHash as createHash4 } from "crypto";
|
|
1434
1441
|
import { mkdir as mkdir5, readdir as readdir5, readFile as readFile4, rename as rename4, unlink as unlink5, writeFile as writeFile4 } from "fs/promises";
|
|
@@ -1655,7 +1662,7 @@ async function sendIdleNotification(sessionId, ctx) {
|
|
|
1655
1662
|
if (!claimed) return;
|
|
1656
1663
|
const title = ctx.sessionTitleService.getSessionTitle(sessionId);
|
|
1657
1664
|
const agent = ctx.sessionTitleService.getSessionAgent(sessionId);
|
|
1658
|
-
const isPlanSession = agent
|
|
1665
|
+
const isPlanSession = isPlanSessionAgent(agent);
|
|
1659
1666
|
const text = isPlanSession ? planCompleteMessage(title) : agentFinishedMessage(title, agent);
|
|
1660
1667
|
try {
|
|
1661
1668
|
if (isPlanSession) {
|
|
@@ -2409,7 +2416,7 @@ function createStatusDispatcher(deps) {
|
|
|
2409
2416
|
projectRoot,
|
|
2410
2417
|
sessionId: entry.sessionId,
|
|
2411
2418
|
planHint: rawTitle,
|
|
2412
|
-
allowLatestFallback: rawAgent
|
|
2419
|
+
allowLatestFallback: isPlanSessionAgent(rawAgent)
|
|
2413
2420
|
});
|
|
2414
2421
|
const userSnippet = buildSnippet(findLastByRole(messages, "user"));
|
|
2415
2422
|
const assistantSnippet = buildSnippet(findLastByRole(messages, "assistant"));
|
|
@@ -2528,10 +2535,10 @@ function createStartWorkCommandDispatcher(deps) {
|
|
|
2528
2535
|
return;
|
|
2529
2536
|
}
|
|
2530
2537
|
const agent = deps.sessionTitleService.getSessionAgent(sessionId) ?? agentFromSession3(session) ?? entry.agent;
|
|
2531
|
-
if (agent
|
|
2538
|
+
if (!isPlanSessionAgent(agent)) {
|
|
2532
2539
|
await sendPlain(
|
|
2533
2540
|
bot,
|
|
2534
|
-
`${index}\uBC88 \uC138\uC158\uC758 \uC5D0\uC774\uC804\uD2B8\uB294
|
|
2541
|
+
`${index}\uBC88 \uC138\uC158\uC758 \uC5D0\uC774\uC804\uD2B8\uB294 plan builder \uAC00 \uC544\uB2D9\uB2C8\uB2E4 (\uD604\uC7AC: ${agent ?? "unknown"}). /start_work \uB294 plan \uC138\uC158\uC5D0\uC11C\uB9CC \uAC00\uB2A5\uD569\uB2C8\uB2E4`
|
|
2535
2542
|
);
|
|
2536
2543
|
return;
|
|
2537
2544
|
}
|
|
@@ -2577,7 +2584,7 @@ var HELP_TEXT = `<b>OpenCode Telegram Plugin \u2014 \uBA85\uB839 \uB3C4\uC6C0\uB
|
|
|
2577
2584
|
|
|
2578
2585
|
<b>/start_work <\uBC88\uD638></b>
|
|
2579
2586
|
\uD574\uB2F9 \uC138\uC158\uC5D0 opencode <code>/start-work</code> \uC2AC\uB798\uC2DC \uCEE4\uB9E8\uB4DC \uC804\uC1A1.
|
|
2580
|
-
\uC548\uC804 \uAC8C\uC774\uD2B8:
|
|
2587
|
+
\uC548\uC804 \uAC8C\uC774\uD2B8: raw plan agent \uB610\uB294 Prometheus Plan Builder \uB77C\uBCA8 AND status=idle AND .omo/plans \uC5D0 \uBBF8\uC644\uB8CC plan \uC874\uC7AC AND .omo/boulder.json \uBD80\uC7AC.
|
|
2581
2588
|
\uC870\uAC74 \uBBF8\uCDA9\uC871\uC2DC \uAD6C\uCCB4\uC801 \uC0AC\uC720 \uC548\uB0B4.
|
|
2582
2589
|
(Telegram \uBD07 \uBA85\uB839\uC740 <code>/start_work</code>, \uB0B4\uBD80 \uD2B8\uB9AC\uAC70 \uB300\uC0C1\uC740 opencode \uC758 <code>/start-work</code>)
|
|
2583
2590
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinseeker/opencode-telegram-plugin",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "Control and monitor OpenCode from Telegram with notifications, question replies, and subagent-aware completion.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/telegram-remote.js",
|