@tritard/waterbrother 0.16.105 → 0.16.106
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/package.json +1 -1
- package/src/cli.js +31 -2
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -3190,6 +3190,16 @@ function formatTelegramRemoteActor(request = {}) {
|
|
|
3190
3190
|
return username || userId || "telegram";
|
|
3191
3191
|
}
|
|
3192
3192
|
|
|
3193
|
+
function parseTerminalLabelIntent(text = "") {
|
|
3194
|
+
const value = String(text || "").trim();
|
|
3195
|
+
if (!value) return null;
|
|
3196
|
+
const match = value.match(/^(?:name|label|rename|call)\s+(?:this\s+|my\s+)?(?:terminal|tui|session)(?:\s+(?:to|as))?\s+(.+?)\s*$/i);
|
|
3197
|
+
if (!match?.[1]) return null;
|
|
3198
|
+
const label = String(match[1] || "").trim().replace(/^["'`]+|["'`]+$/g, "").trim();
|
|
3199
|
+
if (!label) return null;
|
|
3200
|
+
return { action: "label-terminal", label };
|
|
3201
|
+
}
|
|
3202
|
+
|
|
3193
3203
|
async function planTelegramVerificationCommands(cwd) {
|
|
3194
3204
|
const packageJsonPath = path.join(cwd, "package.json");
|
|
3195
3205
|
let scripts = {};
|
|
@@ -7637,7 +7647,7 @@ Be concrete about surfaces — name actual pages/flows. Choose the best stack fo
|
|
|
7637
7647
|
autonomy: agent.getAutonomyMode(),
|
|
7638
7648
|
profile: agent.getProfile()
|
|
7639
7649
|
});
|
|
7640
|
-
|
|
7650
|
+
let telegramBridgeLabel = `${telegramBridgeOperator.name} terminal ${String(currentSession.id || "").trim().slice(-6)}`.trim();
|
|
7641
7651
|
await registerTelegramBridgeHost({
|
|
7642
7652
|
sessionId: currentSession.id,
|
|
7643
7653
|
cwd: context.cwd,
|
|
@@ -7779,7 +7789,7 @@ Be concrete about surfaces — name actual pages/flows. Choose the best stack fo
|
|
|
7779
7789
|
await touchTelegramBridgeHost({
|
|
7780
7790
|
sessionId: currentSession.id,
|
|
7781
7791
|
cwd: context.cwd,
|
|
7782
|
-
label:
|
|
7792
|
+
label: telegramBridgeLabel,
|
|
7783
7793
|
surface: "live-tui",
|
|
7784
7794
|
ownerId: telegramBridgeOperator.id,
|
|
7785
7795
|
ownerName: telegramBridgeOperator.name,
|
|
@@ -7901,6 +7911,25 @@ Be concrete about surfaces — name actual pages/flows. Choose the best stack fo
|
|
|
7901
7911
|
continue;
|
|
7902
7912
|
}
|
|
7903
7913
|
|
|
7914
|
+
const terminalLabelIntent = parseTerminalLabelIntent(line);
|
|
7915
|
+
if (terminalLabelIntent) {
|
|
7916
|
+
telegramBridgeLabel = terminalLabelIntent.label;
|
|
7917
|
+
await touchTelegramBridgeHost({
|
|
7918
|
+
sessionId: currentSession.id,
|
|
7919
|
+
cwd: context.cwd,
|
|
7920
|
+
label: telegramBridgeLabel,
|
|
7921
|
+
surface: "live-tui",
|
|
7922
|
+
ownerId: telegramBridgeOperator.id,
|
|
7923
|
+
ownerName: telegramBridgeOperator.name,
|
|
7924
|
+
provider: context.runtime.provider,
|
|
7925
|
+
model: context.runtime.model,
|
|
7926
|
+
runtimeProfile: currentSession.runtimeProfile || "",
|
|
7927
|
+
actor: { id: telegramBridgeOperator.id, name: telegramBridgeOperator.name }
|
|
7928
|
+
});
|
|
7929
|
+
console.log(`terminal label -> ${telegramBridgeLabel}`);
|
|
7930
|
+
continue;
|
|
7931
|
+
}
|
|
7932
|
+
|
|
7904
7933
|
const lowerLine = line.toLowerCase();
|
|
7905
7934
|
if (/^gateway\b/.test(lowerLine)) {
|
|
7906
7935
|
console.log("That looks like a shell subcommand. Run it in your terminal, not at the you> prompt.");
|