pi-straw-boss 0.7.2 → 0.7.3
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/index.ts +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-straw-boss",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"description": "Straw Boss coordination for pi in Herdr: sessions join a tab's net by choice, the first joiner is its main agent, a workspace tower opens on demand with a live monitoring dashboard, and boss_broadcast reaches the rest",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/src/index.ts
CHANGED
|
@@ -22,6 +22,7 @@ const NAMESPACE = /^[a-z0-9][a-z0-9._/-]{0,63}$/;
|
|
|
22
22
|
const ENTRY = "straw-boss";
|
|
23
23
|
const PROMPTS = ["main", "tower", "member", "member-no-main"];
|
|
24
24
|
const REFRESH_MS = 4 * 60_000;
|
|
25
|
+
const KID_MARK_MS = [3_000, 15_000];
|
|
25
26
|
const CLAIM_MS = 5000;
|
|
26
27
|
const CONNECT_MS = 15_000;
|
|
27
28
|
const SEND_MS = 30_000;
|
|
@@ -390,6 +391,11 @@ export function createStrawBoss({ run = herdrRun, api = herdrApi(), call = herdr
|
|
|
390
391
|
}
|
|
391
392
|
});
|
|
392
393
|
|
|
394
|
+
// A launched subagent is marked within seconds, once its pane shows its session file, instead of at the next 4 minute refresh.
|
|
395
|
+
pi.on("tool_result", (event) => {
|
|
396
|
+
if (["subagent", "subagent_resume"].includes(event.toolName) && !isTower && !barred && role()) for (const ms of KID_MARK_MS) setTimeout(() => void publish(), ms).unref();
|
|
397
|
+
});
|
|
398
|
+
|
|
393
399
|
pi.on("session_shutdown", async () => {
|
|
394
400
|
if (gui) await switchRemote(gui, false, guiDir, ts).catch(() => {});
|
|
395
401
|
await gui?.stop();
|