@gorlitzer-labs/seldon 0.20.0 → 0.21.0

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 CHANGED
@@ -48,6 +48,8 @@ Every agent, on every machine, beside the one you're talking to. One key to swit
48
48
  | `Alt-h` | home: the full panel on the right |
49
49
  | `Alt-q` | leave. Agents keep running |
50
50
 
51
+ In the list: `n` **new agent** (type the task, pick 1 claude · 2 codex · 3 opencode), `⏎` open, `tab` next ⚑.
52
+
51
53
  - **Real terminals.** The right side is the agent itself, not a copy.
52
54
  - **Switching never stops anything.** Leave, reconnect from anywhere, it's all still there.
53
55
  - **Both laptops, one list.** Agents on `seldon machines` open over ssh in the same pane. A sleeping one shows ☾ and waits.
package/bin/seldon.js CHANGED
@@ -908,7 +908,7 @@ const pad = (text, width, color = (x) => x) => color(String(text)) + " ".repeat(
908
908
  // grouped by the project it works on, the ones waiting on you first. Lanes are read from the
909
909
  // harnesses themselves (lib/agents.mjs), not from rooms, so the panel works with or without
910
910
  // factory and apiary; when factory is there its projects and plans are shown too.
911
- async function panel() {
911
+ async function panel({ newFor = null } = {}) {
912
912
  ensureSiblingPath();
913
913
  let groups = [], state = null, rows = [], cur = 0, note = "";
914
914
  let lastState = 0;
@@ -1158,6 +1158,14 @@ async function panel() {
1158
1158
  },
1159
1159
  };
1160
1160
 
1161
+ // Opened by the workspace's n: go straight to "new agent" for the project of the agent that
1162
+ // was selected there (or the repo seldon runs in), so starting one is one key from the list.
1163
+ if (newFor !== null) {
1164
+ const projects = rows.filter((r) => r.type === "project").map((r) => r.project);
1165
+ const p = projects.find((x) => (x.lanes || []).some((l) => l.key === newFor)) || projects.find((x) => sameDir(x.root, here)) || projects[0];
1166
+ if (p) ask(`NEW AGENT · ${p.name}`, "task ›", (task) => pickHarness(p, task));
1167
+ }
1168
+
1161
1169
  await rawSession({
1162
1170
  draw,
1163
1171
  onError: (e) => { note = C.red("error: ") + (e?.message || String(e)); mode = { name: "home" }; },
@@ -1570,6 +1578,14 @@ function wsOpen(row) {
1570
1578
  wsSave(WS_CURRENT, row.off ? "" : row.key);
1571
1579
  wsFocus(main);
1572
1580
  }
1581
+ // n in the list: the panel, on the right, already asking for the new agent's task.
1582
+ function wsNewAgent(row) {
1583
+ const main = wsOpt("@main");
1584
+ const argv = ["panel", "--new", ...(row && !row.off ? ["--for", row.key] : [])].map(shq).join(" ");
1585
+ wsTmux(["respawn-pane", "-k", "-t", main, `sh -c ${shq(`${wsSelf()} ${argv}; exec ${wsHome()}`)}`]);
1586
+ wsSave(WS_CURRENT, "");
1587
+ wsFocus(main);
1588
+ }
1573
1589
  function wsGoHome() {
1574
1590
  const main = wsOpt("@main");
1575
1591
  wsTmux(["respawn-pane", "-k", "-t", main, wsHome()]);
@@ -1602,7 +1618,7 @@ async function wsSidebar() {
1602
1618
  const width = process.stdout.columns || 38, height = process.stdout.rows || 40;
1603
1619
  const open = wsCurrent(), h = wsHeadline(rows);
1604
1620
  const head = [` ${C.bold("SELDON")} ${h.need ? C.gold(`⚑ ${h.need}`) : C.dim("⚑ 0")} ${C.green(`● ${h.busy}`)}`, ""];
1605
- const foot = ["", C.dim(" ⏎ open · n next ⚑ · h home"), C.dim(" Alt-1…9 from any pane · q leave"), ...(note ? [" " + note] : [])];
1621
+ const foot = ["", C.dim(" ⏎ open · n new agent · tab next ⚑ · h home"), C.dim(" Alt-1…9 from any pane · q leave"), ...(note ? [" " + note] : [])];
1606
1622
  const body = []; let curLine = 0, last = null;
1607
1623
  if (!rows.length) body.push(C.dim(" no agents running"), C.dim(" h, then n starts one"));
1608
1624
  const faces = assignEmoji(rows.map((r) => r.name));
@@ -1631,7 +1647,8 @@ async function wsSidebar() {
1631
1647
  else if (key?.name === "down" || str === "j") cur = Math.min(rows.length - 1, cur + 1);
1632
1648
  else if (key?.name === "return") openRow(rows[cur]);
1633
1649
  else if (/^[1-9]$/.test(str || "")) openRow(findRow(rows, str));
1634
- else if (str === "n") { const r = nextNeeding(rows, wsCurrent()); if (r) openRow(r); else note = C.dim("nobody is waiting on you"); }
1650
+ else if (str === "n") wsNewAgent(rows[cur]);
1651
+ else if (key?.name === "tab") { const r = nextNeeding(rows, wsCurrent()); if (r) openRow(r); else note = C.dim("nobody is waiting on you"); }
1635
1652
  else if (str === "h") wsGoHome();
1636
1653
  else if (str === "r") load();
1637
1654
  else if (str === "q" || (key?.ctrl && key.name === "c")) wsTmux(["detach-client"]);
@@ -1983,7 +2000,7 @@ const ids = tokens.filter((id) => byId[id]); // only the valid module
1983
2000
  if (cmd === "tell") return tellCmd(tokens, flags);
1984
2001
  if (cmd === "inbox") return inboxCmd(flags);
1985
2002
  if (cmd === "setup") return setupCmd(tokens[0], flags);
1986
- if (cmd === "panel") return panel();
2003
+ if (cmd === "panel") return panel({ newFor: flags.new ? (typeof flags.for === "string" ? flags.for : "") : null });
1987
2004
  if (cmd && cmd !== "install") { help(); process.exitCode = 1; return; }
1988
2005
  if (cmd === "install") return install_picker({ dev }); // `install` with no ids
1989
2006
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gorlitzer-labs/seldon",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "description": "Install the Seldon stack — pick your tools from a checklist; each installs via its native method.",
5
5
  "type": "module",
6
6
  "bin": {