@zswarm/core 0.2.6 → 0.2.8

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/schema.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { ZellijError } from "./errors.js";
2
+ import { HARNESS_NAMES } from "./harness.js";
2
3
  /**
3
4
  * One description of the zswarm surface. The MCP tool schema, the CLI flags,
4
5
  * and the CLI help text are all generated from it, so they cannot drift apart.
@@ -15,6 +16,7 @@ export const OP_NAMES = [
15
16
  "keys",
16
17
  "interrupt",
17
18
  "spawn",
19
+ "restart",
18
20
  "close",
19
21
  "worktrees",
20
22
  "unworktree",
@@ -42,6 +44,7 @@ export const TARGET_OPS = [
42
44
  "status",
43
45
  "keys",
44
46
  "interrupt",
47
+ "restart",
45
48
  "close",
46
49
  "rename",
47
50
  "focus",
@@ -245,6 +248,28 @@ export const PARAMS = [
245
248
  cliOnly: true,
246
249
  description: "send: read UTF-8 on the caller from PATH, or - for stdin; cannot combine with --body/--text",
247
250
  },
251
+ {
252
+ name: "handoff",
253
+ type: "string",
254
+ flags: [],
255
+ ops: ["restart"],
256
+ description: "restart: handoff text to deliver to the relaunched agent (MCP inline form; the CLI fills this from --handoff-file)",
257
+ },
258
+ {
259
+ name: "handoffFile",
260
+ type: "string",
261
+ flags: ["--handoff-file"],
262
+ ops: ["restart"],
263
+ cliOnly: true,
264
+ description: "restart: read the handoff UTF-8 on the caller from PATH, or - for stdin; a short handoff is pasted, a long one becomes a pointer line, and --handoff-self writes the agent's handoff to this path",
265
+ },
266
+ {
267
+ name: "handoffSelf",
268
+ type: "boolean",
269
+ flags: ["--handoff-self"],
270
+ ops: ["restart"],
271
+ description: "restart: before exiting, ask the running agent to write its handoff to the file and print a marker, then deliver it after relaunch",
272
+ },
248
273
  {
249
274
  name: "text",
250
275
  type: "string",
@@ -333,8 +358,8 @@ export const PARAMS = [
333
358
  name: "timeoutMs",
334
359
  type: "number",
335
360
  flags: ["--timeout-ms"],
336
- ops: ["wait", "status", "spawn", "doctor", "serve", "send", "dump", "tail", "keys", "interrupt", "close", "await"],
337
- description: "wait: timeout (default 60000); status/spawn: overall deadline (default 30000); doctor: overall deadline (default 10000), including Tailscale/SSH/hello/host checks; serve --install: overall install/readiness deadline (default 30000)",
361
+ ops: ["wait", "status", "spawn", "restart", "doctor", "serve", "send", "dump", "tail", "keys", "interrupt", "close", "await"],
362
+ description: "wait: timeout (default 60000); status/spawn/restart: overall deadline (default 30000); doctor: overall deadline (default 10000), including Tailscale/SSH/hello/host checks; serve --install: overall install/readiness deadline (default 30000)",
338
363
  },
339
364
  {
340
365
  name: "keys",
@@ -369,8 +394,8 @@ export const PARAMS = [
369
394
  name: "command",
370
395
  type: "stringOrArray",
371
396
  flags: ["--command", "--cmd", "-c"],
372
- ops: ["spawn"],
373
- description: "spawn: program to run in the new pane, argv-style (no shell). Empty starts a plain shell.",
397
+ ops: ["spawn", "restart"],
398
+ description: "spawn: program to run in the new pane, argv-style (no shell). Empty starts a plain shell. restart: command to type in a shell pane instead of the profile's launch command",
374
399
  },
375
400
  {
376
401
  name: "cwd",
@@ -450,6 +475,13 @@ export const PARAMS = [
450
475
  ops: ["send", "broadcast"],
451
476
  description: 'send/broadcast: after the send, dump once more and report what it sees; paste again only on "not-delivered" (positive evidence nothing landed), press Enter when the body is still in the composer, and never paste the body twice',
452
477
  },
478
+ {
479
+ name: "harness",
480
+ type: "string",
481
+ flags: ["--harness"],
482
+ ops: ["send", "restart"],
483
+ description: `send/restart: override the harness inferred from the pane's command/title for wrapper-launched panes (known: ${HARNESS_NAMES.join(", ")})`,
484
+ },
453
485
  {
454
486
  name: "ifIdle",
455
487
  type: "boolean",
@@ -546,8 +578,8 @@ export const PARAMS = [
546
578
  name: "force",
547
579
  type: "boolean",
548
580
  flags: ["--force"],
549
- ops: ["send", "keys", "unworktree", "bus", "interrupt", "broadcast"],
550
- description: "send/keys: write to a pane whose command has exited; unworktree: remove a busy or dirty worktree; bus: close orphan bus panes and reload this session's plugin",
581
+ ops: ["send", "keys", "unworktree", "bus", "interrupt", "broadcast", "restart"],
582
+ description: "send/keys: write to a pane whose command has exited; restart: restart a pane that a relay has leased; unworktree: remove a busy or dirty worktree; bus: close orphan bus panes and reload this session's plugin",
551
583
  },
552
584
  {
553
585
  name: "listen",
@@ -600,7 +632,7 @@ export function mcpInputSchema() {
600
632
  }
601
633
  export const MCP_TOOL_DESCRIPTION = `zSwarm Zellij pane coordination (op=${OP_NAMES.join("|")}). ` +
602
634
  "List panes, send text into a CLI pane (paste+Enter), block until a pane goes idle or prints a match, " +
603
- "send raw keys, open or close panes, and give a peer its own git worktree. " +
635
+ "send raw keys, open or close panes, restart an agent in its pane with an optional handoff, and give a peer its own git worktree. " +
604
636
  "Same host as Zellij, or ZSWARM_SSH / ZSWARM_SERVE for a remote crew.";
605
637
  const FLAG_INDEX = new Map(PARAMS.flatMap((p) => p.flags.map((flag) => [flag, p])));
606
638
  export function cliUsage() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zswarm/core",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
4
4
  "type": "module",
5
5
  "description": "zSwarm Zellij client and shared ops dispatch",
6
6
  "exports": {