switchroom 0.19.15 → 0.19.16
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/cli/switchroom.js +1 -1
- package/dist/host-control/main.js +1 -1
- package/package.json +1 -1
- package/telegram-plugin/dist/bridge/bridge.js +30 -1
- package/telegram-plugin/dist/gateway/gateway.js +693 -433
- package/telegram-plugin/dist/server.js +30 -1
- package/telegram-plugin/gateway/background-shell-liveness.ts +65 -0
- package/telegram-plugin/gateway/gateway.ts +7 -58
- package/telegram-plugin/gateway/outbound-send-path.ts +25 -23
- package/telegram-plugin/gateway/outbox-listen-markup.ts +67 -0
- package/telegram-plugin/gateway/outbox-sweep.ts +92 -18
- package/telegram-plugin/gateway/rich-message-handler.ts +10 -4
- package/telegram-plugin/gateway/silence-poke-session-event.ts +89 -0
- package/telegram-plugin/session-tail.ts +88 -1
- package/telegram-plugin/silence-poke.ts +118 -1
- package/telegram-plugin/tests/background-shell-liveness.test.ts +72 -0
- package/telegram-plugin/tests/feed-survival.test.ts +7 -1
- package/telegram-plugin/tests/fixtures/bg-shell-liveness-3519.jsonl +3 -0
- package/telegram-plugin/tests/forwarded-rich-message-coalesce.test.ts +290 -0
- package/telegram-plugin/tests/outbox-sweep-listen-button.test.ts +253 -0
- package/telegram-plugin/tests/session-tail.test.ts +91 -1
- package/telegram-plugin/tests/silence-poke.test.ts +280 -0
- package/telegram-plugin/tests/tts-normalize.test.ts +66 -0
- package/telegram-plugin/tests/voice-normalize-text.test.ts +82 -1
- package/telegram-plugin/tts-normalize.ts +12 -0
- package/telegram-plugin/voice-normalize-text.ts +100 -0
- package/telegram-plugin/voice-ondemand.ts +71 -0
package/dist/cli/switchroom.js
CHANGED
|
@@ -2120,7 +2120,7 @@ var init_esm = __esm(() => {
|
|
|
2120
2120
|
});
|
|
2121
2121
|
|
|
2122
2122
|
// src/build-info.ts
|
|
2123
|
-
var VERSION = "0.19.
|
|
2123
|
+
var VERSION = "0.19.16", COMMIT_SHA = "e905f237";
|
|
2124
2124
|
|
|
2125
2125
|
// src/cli/resolve-version.ts
|
|
2126
2126
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -26664,7 +26664,7 @@ import { existsSync as existsSync9, readFileSync as readFileSync7 } from "node:f
|
|
|
26664
26664
|
import { dirname as dirname5, join as join7 } from "node:path";
|
|
26665
26665
|
|
|
26666
26666
|
// src/build-info.ts
|
|
26667
|
-
var VERSION = "0.19.
|
|
26667
|
+
var VERSION = "0.19.16";
|
|
26668
26668
|
|
|
26669
26669
|
// src/cli/resolve-version.ts
|
|
26670
26670
|
function readPackageVersion() {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "switchroom",
|
|
3
3
|
"//version": "NOT the release version — source of truth is the git tag, resolved by scripts/build.mjs:resolveVersion() (see CLAUDE.md > Standard release process). This field is stale by design and only the Layer-4 dev/non-tag fallback for build.mjs + src/cli/resolve-version.ts; do NOT bump it expecting a release to pick it up. npm-pack tarball naming needs a real version — do that as an UNCOMMITTED pack-time bump (see release step 6), never a committed one.",
|
|
4
|
-
"version": "0.19.
|
|
4
|
+
"version": "0.19.16",
|
|
5
5
|
"description": "Run Claude Code 24/7 on your Claude Pro/Max subscription over Telegram. Open-source alternative to OpenClaw and NanoClaw — no API keys.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
@@ -23284,6 +23284,29 @@ function extractToolResultErrorText(content) {
|
|
|
23284
23284
|
}
|
|
23285
23285
|
return "";
|
|
23286
23286
|
}
|
|
23287
|
+
function parseBackgroundTaskId(obj) {
|
|
23288
|
+
const tur = obj.toolUseResult;
|
|
23289
|
+
if (typeof tur === "object" && tur != null) {
|
|
23290
|
+
const id = tur.backgroundTaskId;
|
|
23291
|
+
if (typeof id === "string" && id.length > 0)
|
|
23292
|
+
return id;
|
|
23293
|
+
}
|
|
23294
|
+
return null;
|
|
23295
|
+
}
|
|
23296
|
+
function parseBackgroundLaunchString(content) {
|
|
23297
|
+
const text = typeof content === "string" ? content : extractToolResultErrorText(content);
|
|
23298
|
+
const m = text.match(/Command running in background with ID: (\w+)/);
|
|
23299
|
+
return m != null ? m[1] : null;
|
|
23300
|
+
}
|
|
23301
|
+
function parseTaskNotification(content) {
|
|
23302
|
+
if (!content.includes("<task-notification>"))
|
|
23303
|
+
return null;
|
|
23304
|
+
const idM = content.match(/<task-id>([^<]+)<\/task-id>/);
|
|
23305
|
+
const stM = content.match(/<status>([^<]+)<\/status>/);
|
|
23306
|
+
if (idM == null || stM == null)
|
|
23307
|
+
return null;
|
|
23308
|
+
return { taskId: idM[1].trim(), status: stM[1].trim() };
|
|
23309
|
+
}
|
|
23287
23310
|
function projectAssistantTextBlocks(content, make) {
|
|
23288
23311
|
const out = new Map;
|
|
23289
23312
|
let lastToolUseIdx = -1;
|
|
@@ -23341,6 +23364,10 @@ function projectTranscriptLine(line) {
|
|
|
23341
23364
|
const op = obj.operation;
|
|
23342
23365
|
if (op === "enqueue") {
|
|
23343
23366
|
const content = obj.content ?? "";
|
|
23367
|
+
const notif = parseTaskNotification(content);
|
|
23368
|
+
if (notif != null) {
|
|
23369
|
+
return [{ kind: "task_notification", taskId: notif.taskId, status: notif.status }];
|
|
23370
|
+
}
|
|
23344
23371
|
const { chatId, messageId, threadId } = parseChannelMeta(content);
|
|
23345
23372
|
return [{ kind: "enqueue", chatId, messageId, threadId, rawContent: content }];
|
|
23346
23373
|
}
|
|
@@ -23398,6 +23425,7 @@ function projectTranscriptLine(line) {
|
|
|
23398
23425
|
const content = message?.content;
|
|
23399
23426
|
if (!Array.isArray(content))
|
|
23400
23427
|
return [];
|
|
23428
|
+
const backgroundTaskId = parseBackgroundTaskId(obj);
|
|
23401
23429
|
const events = [];
|
|
23402
23430
|
for (const c of content) {
|
|
23403
23431
|
if (c.type === "tool_result") {
|
|
@@ -23407,7 +23435,8 @@ function projectTranscriptLine(line) {
|
|
|
23407
23435
|
toolUseId: c.tool_use_id ?? "",
|
|
23408
23436
|
toolName: null,
|
|
23409
23437
|
isError,
|
|
23410
|
-
errorText: isError ? extractToolResultErrorText(c.content) : undefined
|
|
23438
|
+
errorText: isError ? extractToolResultErrorText(c.content) : undefined,
|
|
23439
|
+
backgroundTaskId: backgroundTaskId ?? parseBackgroundLaunchString(c.content) ?? undefined
|
|
23411
23440
|
});
|
|
23412
23441
|
}
|
|
23413
23442
|
}
|