@paigy/harness 0.1.3 → 0.1.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.
Files changed (2) hide show
  1. package/dist/cli.js +42 -5
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -30857,7 +30857,7 @@ async function setTaskState(notificationId, state, opts = {}) {
30857
30857
  // src/cli.ts
30858
30858
  var import_qrcode = __toESM(require_lib(), 1);
30859
30859
  import { hostname } from "os";
30860
- import { existsSync as existsSync5, mkdirSync as mkdirSync3, writeFileSync as writeFileSync3 } from "fs";
30860
+ import { existsSync as existsSync5, mkdirSync as mkdirSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "fs";
30861
30861
  import { execSync } from "child_process";
30862
30862
  import { homedir as homedir5 } from "os";
30863
30863
  import { join as join4 } from "path";
@@ -32386,7 +32386,7 @@ function startHost(opts) {
32386
32386
 
32387
32387
  // src/cli.ts
32388
32388
  function parseArgs(argv) {
32389
- const args = { harness: "claude", mode: "bypass", cwd: process.cwd(), doctor: false, host: false, pair: false, service: false, setup: false, grant: [], hatch: null, identity: null, graceSeconds: 90, prompt: "" };
32389
+ const args = { harness: "claude", mode: "bypass", cwd: process.cwd(), doctor: false, host: false, pair: false, service: false, setup: false, grant: [], hatch: null, voice: null, slot: null, identity: null, graceSeconds: 90, prompt: "" };
32390
32390
  const words = [];
32391
32391
  for (let i = 0; i < argv.length; i++) {
32392
32392
  const arg = argv[i];
@@ -32425,6 +32425,10 @@ function parseArgs(argv) {
32425
32425
  const v = next();
32426
32426
  if (!v) return { error: 'hatch needs a name: paigy-harness hatch "Voice bug hunter"' };
32427
32427
  args.hatch = v;
32428
+ } else if (arg === "--voice") {
32429
+ args.voice = next() ?? null;
32430
+ } else if (arg === "--slot") {
32431
+ args.slot = next() ?? null;
32428
32432
  } else if (arg === "--identity") {
32429
32433
  const v = next();
32430
32434
  if (!v) return { error: "--identity needs a hatched agent's name" };
@@ -32444,7 +32448,7 @@ async function main() {
32444
32448
  const parsed = parseArgs(process.argv.slice(2));
32445
32449
  if ("error" in parsed) {
32446
32450
  console.error(`paigy-harness: ${parsed.error}`);
32447
- console.error("usage: paigy-harness setup | pair | host [--grant DIR]\u2026 | service | hatch NAME | [--harness claude|codex] [--mode bypass|ask] [--cwd DIR] [--identity NAME] [--grace SECONDS] [--doctor] PROMPT\u2026");
32451
+ console.error("usage: paigy-harness setup | pair | host [--grant DIR]\u2026 | service | hatch NAME [--voice KEY] [--slot SLOT] | [--harness claude|codex] [--mode bypass|ask] [--cwd DIR] [--identity NAME] [--grace SECONDS] [--doctor] PROMPT\u2026");
32448
32452
  process.exit(2);
32449
32453
  }
32450
32454
  if (parsed.doctor) {
@@ -32502,6 +32506,39 @@ async function main() {
32502
32506
  console.log("service install failed \u2014 run `paigy-harness host` to host in the foreground");
32503
32507
  }
32504
32508
  } else console.log("start hosting with: paigy-harness host (keep it running under your init system)");
32509
+ const TERMINAL_AGENTS = [
32510
+ { cli: "claude", name: "Claude Code", slot: "mcp-agent", wire: "claude mcp add --scope user paigy -- npx -y @paigy/mcp@latest" },
32511
+ { cli: "codex", name: "Codex", slot: "codex", wire: "codex mcp add paigy -- npx -y @paigy/mcp@latest" },
32512
+ { cli: "antigravity", name: "Antigravity", slot: "antigravity" }
32513
+ ];
32514
+ for (const t of TERMINAL_AGENTS) {
32515
+ try {
32516
+ if (!which(t.cli) || readToken(t.slot)) continue;
32517
+ const minted = await hatch(t.name, null);
32518
+ saveToken({ access_token: minted.token, name: minted.name, device: null }, t.slot);
32519
+ console.log(`\u2713 hatched "${minted.name}" for ${t.cli} sessions (name/voice it on the phone)`);
32520
+ if (t.wire) {
32521
+ try {
32522
+ execSync(t.wire, { stdio: "ignore", shell: "/bin/sh" });
32523
+ console.log(`\u2713 paigy MCP registered for ${t.cli} (restart open sessions)`);
32524
+ } catch {
32525
+ }
32526
+ }
32527
+ } catch {
32528
+ }
32529
+ }
32530
+ try {
32531
+ const settings = join4(homedir5(), ".claude", "settings.json");
32532
+ if (which("claude") && existsSync5(settings)) {
32533
+ const cfg = JSON.parse(readFileSync3(settings, "utf8"));
32534
+ if (!cfg["statusLine"]) {
32535
+ cfg["statusLine"] = { type: "command", command: "npx -y -p @paigy/mcp@latest paigy-statusline" };
32536
+ writeFileSync3(settings, JSON.stringify(cfg, null, 2));
32537
+ console.log("\u2713 statusline wired");
32538
+ }
32539
+ }
32540
+ } catch {
32541
+ }
32505
32542
  console.log("\n\u2705 Done \u2014 look at your phone: Agents shows this machine with a green dot,");
32506
32543
  console.log(" and \u201C+ New session\u201D launches agents on it.");
32507
32544
  return;
@@ -32562,8 +32599,8 @@ async function main() {
32562
32599
  process.exit(1);
32563
32600
  }
32564
32601
  if (parsed.hatch) {
32565
- const minted = await hatch(parsed.hatch);
32566
- saveToken({ access_token: minted.token, name: minted.name, device: null }, minted.name);
32602
+ const minted = await hatch(parsed.hatch, parsed.voice ?? null);
32603
+ saveToken({ access_token: minted.token, name: minted.name, device: null }, parsed.slot ?? minted.name);
32567
32604
  console.log(`\u2713 hatched "${minted.name}" \u2014 it's on your phone's Agents screen now.`);
32568
32605
  console.log(` speak as it: PAIGY_AGENT="${minted.name}" <any paigy tool>`);
32569
32606
  console.log(` run with it: paigy-harness --identity "${minted.name}" --harness codex "\u2026"`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paigy/harness",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Run Claude Code / Codex on this machine, bridged to Paigy — launchable from your phone.",
5
5
  "license": "MIT",
6
6
  "type": "module",