pi-straw-boss 0.9.4 → 0.9.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/package.json +1 -1
- package/src/index.ts +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-straw-boss",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.5",
|
|
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
|
@@ -29,6 +29,8 @@ const REFRESH_MS = 4 * 60_000;
|
|
|
29
29
|
const KID_MARK_MS = [3_000, 15_000];
|
|
30
30
|
const NUDGE_MS = 15_000;
|
|
31
31
|
const CLAIM_MS = 5000;
|
|
32
|
+
/** What Tab completes after /boss; a bare /boss (take over as the main agent) has nothing to complete. */
|
|
33
|
+
const BOSS_ARGUMENTS = Object.entries({ status: "Show the coordinators", tower: "Open and focus the workspace tower", gui: "Open the net in the browser", "gui stop": "Close the browser GUI", "gui remote": "Open the GUI to your phone over Tailscale", "gui remote off": "Close the Tailscale entry" }).map(([value, description]) => ({ value, label: value, description }));
|
|
32
34
|
const CONNECT_MS = 15_000;
|
|
33
35
|
const SEND_MS = 30_000;
|
|
34
36
|
const SETTLE_MS = 2000;
|
|
@@ -534,6 +536,11 @@ export function createStrawBoss({ run = herdrRun, api = herdrApi(), call = herdr
|
|
|
534
536
|
|
|
535
537
|
pi.registerCommand("boss", {
|
|
536
538
|
description: "Take over as this tab's main agent (every session already joins as a member). /boss status shows the coordinators; /boss tower opens and focuses the workspace tower; /boss gui opens the net in the browser (/boss gui stop closes it; /boss gui remote opens it to your phone over Tailscale, /boss gui remote off closes that).",
|
|
539
|
+
// pi passes the whole argument text and replaces it with the chosen value, so each value is a full argument line.
|
|
540
|
+
getArgumentCompletions: (prefix) => {
|
|
541
|
+
const items = BOSS_ARGUMENTS.filter((item) => item.value.startsWith(prefix.trimStart()));
|
|
542
|
+
return items.length ? items : null;
|
|
543
|
+
},
|
|
537
544
|
handler: async (args, ctx) => {
|
|
538
545
|
ui = ctx.ui;
|
|
539
546
|
try {
|