loadout-ai 0.7.0 → 0.9.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.
Files changed (108) hide show
  1. package/CHANGELOG.md +148 -1
  2. package/README.md +160 -315
  3. package/SECURITY.md +21 -1
  4. package/catalog/discovered.json +31269 -26003
  5. package/catalog/packages.json +4 -4
  6. package/dist/src/cli.js +13 -0
  7. package/dist/src/commands/agents.js +3 -1
  8. package/dist/src/commands/catalog-candidate.js +150 -0
  9. package/dist/src/commands/catalog-workflows.js +147 -0
  10. package/dist/src/commands/catalog.js +9 -367
  11. package/dist/src/commands/coordinate.js +586 -0
  12. package/dist/src/commands/coordination-discussions.js +194 -0
  13. package/dist/src/commands/coordination-sessions.js +197 -0
  14. package/dist/src/commands/inventory.js +4 -2
  15. package/dist/src/core/agents/agent-inspection.js +26 -4
  16. package/dist/src/core/{routing → agents}/model-config.js +7 -2
  17. package/dist/src/core/catalog/catalog.js +1 -0
  18. package/dist/src/core/catalog/registry.js +44 -10
  19. package/dist/src/core/catalog/safety.js +36 -7
  20. package/dist/src/core/coordination/adapters/claude-code.js +154 -0
  21. package/dist/src/core/coordination/adapters/codex.js +137 -0
  22. package/dist/src/core/coordination/adapters/types.js +64 -0
  23. package/dist/src/core/coordination/auth.js +59 -0
  24. package/dist/src/core/coordination/bridge-lease.js +79 -0
  25. package/dist/src/core/coordination/conflict-preview.js +167 -0
  26. package/dist/src/core/coordination/contract-diff.js +106 -0
  27. package/dist/src/core/coordination/coordinator.js +552 -0
  28. package/dist/src/core/coordination/crash-recovery.js +169 -0
  29. package/dist/src/core/coordination/daemon.js +667 -0
  30. package/dist/src/core/coordination/discussion.js +340 -0
  31. package/dist/src/core/coordination/events.js +161 -0
  32. package/dist/src/core/coordination/http-api.js +118 -0
  33. package/dist/src/core/coordination/interrupt-policy.js +89 -0
  34. package/dist/src/core/coordination/lock.js +110 -0
  35. package/dist/src/core/coordination/mcp-server.js +424 -0
  36. package/dist/src/core/coordination/redaction.js +85 -0
  37. package/dist/src/core/coordination/replay.js +188 -0
  38. package/dist/src/core/coordination/retention.js +128 -0
  39. package/dist/src/core/coordination/runtime.js +21 -0
  40. package/dist/src/core/coordination/session-manager.js +366 -0
  41. package/dist/src/core/coordination/watcher.js +128 -0
  42. package/dist/src/core/{routing → delegation}/first-party-skills.js +25 -13
  43. package/dist/src/core/{routing → delegation}/handoff.js +130 -63
  44. package/dist/src/core/discovery/candidate-intelligence-evidence.js +108 -0
  45. package/dist/src/core/discovery/candidate-intelligence-types.js +1 -0
  46. package/dist/src/core/discovery/candidate-intelligence-validation.js +108 -0
  47. package/dist/src/core/discovery/candidate-intelligence.js +3 -214
  48. package/dist/src/core/discovery/community.js +12 -4
  49. package/dist/src/core/discovery/github-discovery.js +6 -2
  50. package/dist/src/core/discovery/private-discovery.js +6 -2
  51. package/dist/src/core/install/reconcile.js +1 -1
  52. package/dist/src/core/install/source.js +21 -7
  53. package/dist/src/core/install/uninstall.js +39 -3
  54. package/dist/src/core/reporting/cli-guide.js +10 -6
  55. package/dist/src/core/reporting/completion.js +61 -109
  56. package/dist/src/core/reporting/doctor.js +4 -6
  57. package/dist/src/core/runtime/bounded-json.js +65 -0
  58. package/dist/src/core/runtime/github.js +30 -16
  59. package/dist/src/core/runtime/mcp-recipes.js +1 -1
  60. package/dist/src/core/workspace/active-policy.js +1 -1
  61. package/docs/CANDIDATE_INTELLIGENCE.md +9 -2
  62. package/docs/CATALOG.md +1 -1
  63. package/docs/CREDENTIAL_AND_UPDATE_POLICY.md +1 -1
  64. package/docs/DEMO_SCRIPT.md +19 -23
  65. package/docs/DISCOVERED.md +251 -250
  66. package/docs/FEATURE_TEST_MATRIX.md +10 -263
  67. package/docs/GITHUB_AUTHORIZATION.md +5 -0
  68. package/docs/LIVE_COLLABORATION.md +234 -0
  69. package/docs/PROVENANCE_AND_COMPARISON.md +1 -1
  70. package/docs/REFERENCE.md +163 -0
  71. package/docs/RELEASE_REVIEW.md +1 -2
  72. package/docs/TESTING.md +17 -1
  73. package/docs/USER_TEST_GUIDE.md +138 -3
  74. package/docs/assets/loadout-discover-activate.webp +0 -0
  75. package/docs/assets/loadout-handoff-coordinate.webp +0 -0
  76. package/docs/assets/loadout-social-preview.png +0 -0
  77. package/docs/decisions/001-coordination-jsonl-locking.md +35 -0
  78. package/docs/decisions/002-local-daemon-authentication.md +32 -0
  79. package/docs/decisions/003-bounded-agent-discussions.md +91 -0
  80. package/docs/specs/BOUNDED_AGENT_DISCUSSIONS.md +169 -0
  81. package/docs/superpowers/plans/2026-09-03-coordination-hardening.md +231 -0
  82. package/docs/superpowers/plans/2026-09-03-release-readiness.md +232 -0
  83. package/docs/superpowers/plans/2026-09-04-bounded-agent-discussions.md +121 -0
  84. package/package.json +18 -7
  85. package/skills/loadout-handoff/SKILL.md +238 -0
  86. package/MASTER_PLAN.md +0 -2207
  87. package/dist/src/core/routing/route.js +0 -539
  88. package/docs/ACTIVE_SET.md +0 -53
  89. package/docs/COMPATIBILITY_POLICY.md +0 -22
  90. package/docs/CONVERSION_AND_SANDBOX.md +0 -27
  91. package/docs/EVALUATION_PROTOCOL_V1.md +0 -300
  92. package/docs/HEAD_TO_HEAD_EVALUATION.md +0 -79
  93. package/docs/PROVIDER_CONFIGURATION.md +0 -45
  94. package/docs/README_RESEARCH.md +0 -36
  95. package/docs/REPOSITORY_STABILIZATION.md +0 -190
  96. package/docs/SAFE_UPDATE_DEMO.md +0 -25
  97. package/docs/SCHEMA_DECISIONS.md +0 -25
  98. package/docs/SUBMISSION_COPY.md +0 -90
  99. package/docs/TEAM_POLICY.md +0 -18
  100. package/docs/assets/loadout-workflow.png +0 -0
  101. package/docs/superpowers/plans/2026-07-19-relatable-readme-hero.md +0 -283
  102. package/docs/superpowers/plans/2026-07-20-loadout-readme-explainer.md +0 -116
  103. package/docs/superpowers/plans/2026-07-20-project-activation-safety.md +0 -469
  104. package/docs/superpowers/specs/2026-07-19-relatable-readme-hero-design.md +0 -80
  105. package/docs/superpowers/specs/2026-07-20-loadout-readme-explainer-design.md +0 -55
  106. package/docs/superpowers/specs/2026-07-20-project-activation-safety-design.md +0 -228
  107. package/skills/loadout-router/SKILL.md +0 -120
  108. /package/dist/src/core/{routing → agents}/credentials.js +0 -0
@@ -116,7 +116,7 @@
116
116
  "description": "Skills Catalog for Codex.",
117
117
  "category": "agent-skills",
118
118
  "tier": "official",
119
- "license": "NOASSERTION",
119
+ "license": "MIT",
120
120
  "components": ["skill"],
121
121
  "operatingSystems": ["windows", "macos", "linux"],
122
122
  "stars": 23702,
@@ -139,7 +139,7 @@
139
139
  "description": "Public repository for Agent Skills.",
140
140
  "category": "agent-skills",
141
141
  "tier": "official",
142
- "license": "NOASSERTION",
142
+ "license": "MIT",
143
143
  "components": ["skill"],
144
144
  "operatingSystems": ["windows", "macos", "linux"],
145
145
  "stars": 161108,
@@ -185,7 +185,7 @@
185
185
  "description": "Vercel's official collection of agent skills.",
186
186
  "category": "frontend-development",
187
187
  "tier": "official",
188
- "license": "NOASSERTION",
188
+ "license": "Apache-2.0",
189
189
  "components": ["skill"],
190
190
  "operatingSystems": ["windows", "macos", "linux"],
191
191
  "stars": 29060,
@@ -810,7 +810,7 @@
810
810
  "description": "Official reference MCP servers for filesystem, Git, memory, fetching, time, and protocol testing.",
811
811
  "category": "mcp-reference",
812
812
  "tier": "official",
813
- "license": "NOASSERTION",
813
+ "license": "MIT",
814
814
  "components": ["mcp"],
815
815
  "operatingSystems": ["windows", "macos", "linux"],
816
816
  "stars": 88530,
package/dist/src/cli.js CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command, CommanderError } from "commander";
3
3
  import { HIDDEN_FROM_FIRST_SCREEN } from "./core/reporting/cli-guide.js";
4
+ import { registerCompletionCommands } from "./core/reporting/completion.js";
4
5
  import { recoverPendingTransactions } from "./core/install/transaction.js";
5
6
  import { LOADOUT_VERSION, printBeginnerGuide, runWizard, } from "./commands/support.js";
6
7
  import { registerSetup } from "./commands/setup.js";
@@ -11,6 +12,7 @@ import { registerInventory } from "./commands/inventory.js";
11
12
  import { registerCatalog } from "./commands/catalog.js";
12
13
  import { registerMcp } from "./commands/mcp.js";
13
14
  import { registerLifecycle } from "./commands/lifecycle.js";
15
+ import { registerCoordinate } from "./commands/coordinate.js";
14
16
  const program = new Command();
15
17
  program
16
18
  .name("loadout")
@@ -34,6 +36,17 @@ registerInventory(program);
34
36
  registerCatalog(program);
35
37
  registerMcp(program);
36
38
  registerLifecycle(program);
39
+ registerCoordinate(program);
40
+ registerCompletionCommands(program.commands.flatMap((command) => {
41
+ const subcommands = command.commands.flatMap((subcommand) => [
42
+ subcommand.name(),
43
+ ...subcommand.aliases(),
44
+ ]);
45
+ return [command.name(), ...command.aliases()].map((name) => ({
46
+ name,
47
+ subcommands,
48
+ }));
49
+ }));
37
50
  for (const command of program.commands)
38
51
  // Commander supports `hidden` when a command is created. These commands are
39
52
  // registered by separate feature blocks, so use the same runtime flag here
@@ -37,7 +37,9 @@ export function registerAgents(program) {
37
37
  const snapshotId = await applyProjectActivation(plan);
38
38
  console.log(options.json
39
39
  ? JSON.stringify({ plan, snapshotId }, null, 2)
40
- : `${formatProjectActivation(plan)}\nApplied and verified. Snapshot: ${snapshotId}\nRollback: loadout rollback --snapshot ${snapshotId}`);
40
+ : snapshotId
41
+ ? `${formatProjectActivation(plan)}\nApplied and verified. Snapshot: ${snapshotId}\nRollback: loadout rollback --snapshot ${snapshotId}`
42
+ : `${formatProjectActivation(plan)}\nAlready within the requested active-set limit. No changes or snapshot were needed.`);
41
43
  });
42
44
  }
43
45
  for (const action of [
@@ -0,0 +1,150 @@
1
+ import { readFile } from "node:fs/promises";
2
+ import { resolve } from "node:path";
3
+ import { loadEffectiveCatalog, promoteCatalogCandidate, validateCatalog, } from "../core/catalog/catalog.js";
4
+ import { buildCandidateDossier, buildCatalogProposal, formatCandidateDossier, formatCandidateSummaries, listDiscoveryCandidates, readCandidateDossier, verifyCandidateDossierSource, writeCandidateDossier, } from "../core/discovery/candidate-intelligence.js";
5
+ import { markPromoted } from "../core/discovery/review-queue.js";
6
+ import { writeFileAtomically } from "../core/install/atomic-file.js";
7
+ export function registerCandidateCommands(program) {
8
+ const candidate = program
9
+ .command("candidate")
10
+ .description("Triage and statically inspect daily discovery candidates; never auto-promotes");
11
+ candidate
12
+ .command("list")
13
+ .allowExcessArguments(false)
14
+ .description("Rank discovery leads for human triage, not as universal quality")
15
+ .option("--limit <count>", "maximum candidates", "20")
16
+ .option("--query <words>", "require all search words")
17
+ .option("--include-reviewed", "include repositories already in the catalog")
18
+ .option("--feed <path>", "alternate discovered.json evidence feed")
19
+ .option("--json", "emit machine-readable JSON")
20
+ .action(async (options) => {
21
+ const limit = Number(options.limit);
22
+ if (!Number.isInteger(limit) || limit < 1 || limit > 500)
23
+ throw new Error("--limit must be an integer from 1 to 500");
24
+ const result = await listDiscoveryCandidates({
25
+ limit,
26
+ query: options.query,
27
+ includeReviewed: options.includeReviewed,
28
+ path: options.feed,
29
+ });
30
+ console.log(options.json
31
+ ? JSON.stringify(result, null, 2)
32
+ : formatCandidateSummaries(result));
33
+ });
34
+ candidate
35
+ .command("inspect")
36
+ .allowExcessArguments(false)
37
+ .description("Clone one lead at an immutable commit and build a static evidence dossier")
38
+ .argument("<repository>", "owner/repository present in the discovery feed")
39
+ .option("--feed <path>", "alternate discovered.json evidence feed")
40
+ .option("--write", "persist the dossier in private Loadout state")
41
+ .option("--output <path>", "persist at an explicit path (implies --write)")
42
+ .option("--json", "emit the complete dossier as JSON")
43
+ .action(async (repository, options) => {
44
+ const dossier = await buildCandidateDossier(repository, {
45
+ discoveryPath: options.feed,
46
+ });
47
+ const path = options.write || options.output
48
+ ? await writeCandidateDossier(dossier, options.output)
49
+ : undefined;
50
+ if (options.json)
51
+ return console.log(JSON.stringify({
52
+ dossier,
53
+ persisted: Boolean(path),
54
+ ...(path ? { path } : {}),
55
+ }, null, 2));
56
+ console.log(formatCandidateDossier(dossier));
57
+ if (path)
58
+ console.log(`Dossier: ${path}`);
59
+ else {
60
+ console.log("Preview only. Re-run with --write to persist this dossier.");
61
+ }
62
+ });
63
+ candidate
64
+ .command("propose")
65
+ .allowExcessArguments(false)
66
+ .description("Convert a reviewed dossier into a catalog-record proposal; never edits the catalog")
67
+ .argument("<dossier>", "persisted candidate dossier JSON")
68
+ .requiredOption("--id <id>", "lowercase kebab-case catalog id")
69
+ .requiredOption("--category <category>", "inspected catalog category")
70
+ .requiredOption("--platforms <ids>", "explicitly reviewed comma-separated platforms: windows,macos,linux")
71
+ .option("--display-name <name>", "reviewed display name")
72
+ .option("--description <text>", "reviewed description")
73
+ .option("--license <spdx>", "human-reviewed license override")
74
+ .option("--tier <tier>", "official, stable, trending, or community", "community")
75
+ .option("--approve", "confirm human review and write the proposal")
76
+ .option("--output <path>", "proposal JSON output path; required with --approve")
77
+ .option("--json", "emit machine-readable JSON")
78
+ .action(async (dossierPath, options) => {
79
+ const platforms = options.platforms
80
+ .split(",")
81
+ .map((item) => item.trim())
82
+ .filter(Boolean);
83
+ const knownPlatforms = new Set(["windows", "macos", "linux"]);
84
+ if (platforms.some((item) => !knownPlatforms.has(item)))
85
+ throw new Error("--platforms supports only windows, macos, and linux");
86
+ const knownTiers = new Set([
87
+ "official",
88
+ "stable",
89
+ "trending",
90
+ "community",
91
+ ]);
92
+ if (!knownTiers.has(options.tier))
93
+ throw new Error("--tier is invalid");
94
+ if (options.approve && !options.output)
95
+ throw new Error("--approve requires --output so catalog mutation stays separate");
96
+ const proposal = buildCatalogProposal(await verifyCandidateDossierSource(await readCandidateDossier(dossierPath)), {
97
+ id: options.id,
98
+ category: options.category,
99
+ operatingSystems: platforms,
100
+ tier: options.tier,
101
+ displayName: options.displayName,
102
+ description: options.description,
103
+ license: options.license,
104
+ }, await loadEffectiveCatalog());
105
+ const output = options.approve ? resolve(options.output) : undefined;
106
+ if (output)
107
+ await writeFileAtomically(output, `${JSON.stringify(proposal, null, 2)}\n`);
108
+ if (options.json)
109
+ return console.log(JSON.stringify({
110
+ proposal,
111
+ approved: Boolean(output),
112
+ catalogMutated: false,
113
+ ...(output ? { output } : {}),
114
+ }, null, 2));
115
+ console.log(JSON.stringify(proposal, null, 2));
116
+ if (!output)
117
+ console.log("Proposal preview only. Human review is still required; use --approve --output <path> to persist it.");
118
+ else
119
+ console.log(`Approved proposal written to ${output}.`);
120
+ });
121
+ candidate
122
+ .command("promote")
123
+ .allowExcessArguments(false)
124
+ .description("Merge a reviewed proposal into the local catalog; requires --approve")
125
+ .argument("<proposal>", "proposal JSON file from `candidate propose --approve`")
126
+ .option("--approve", "confirm human review and write to catalog")
127
+ .option("--json", "emit machine-readable JSON")
128
+ .action(async (proposalPath, options) => {
129
+ const proposal = JSON.parse(await readFile(resolve(proposalPath), "utf8"));
130
+ validateCatalog([proposal], { requireEvidence: true });
131
+ if (!options.approve) {
132
+ if (options.json)
133
+ return console.log(JSON.stringify({ proposal, promoted: false, catalogMutated: false }, null, 2));
134
+ console.log(JSON.stringify(proposal, null, 2));
135
+ console.log("Preview only. Re-run with --approve to merge into the catalog.");
136
+ return;
137
+ }
138
+ const result = await promoteCatalogCandidate(proposal);
139
+ const item = await markPromoted(proposal.repository);
140
+ if (options.json)
141
+ return console.log(JSON.stringify({
142
+ proposal,
143
+ promoted: true,
144
+ catalogMutated: true,
145
+ ...result,
146
+ reviewQueue: item,
147
+ }, null, 2));
148
+ console.log(`Promoted '${proposal.id}' into ${result.catalogPath} (${result.totalRecords} records). Review queue: ${item.repository} marked promoted.`);
149
+ });
150
+ }
@@ -0,0 +1,147 @@
1
+ import { parseAgentSelection } from "../core/agents/paths.js";
2
+ import { applyFirstPartySkill, FIRST_PARTY_SKILLS, formatFirstPartySkillList, formatFirstPartySkillPlan, installedFirstPartySkills, planFirstPartySkill, removeFirstPartySkill, } from "../core/delegation/first-party-skills.js";
3
+ import { applyPickup, formatHandoffStatus, formatInbox, getHandoffState, initHandoff, isHandoffInitialized, isPickupTarget, markDone, planPickup, readInbox, sendHandoff, } from "../core/delegation/handoff.js";
4
+ import { completionCommandPaths, parseCompletionShell, renderShellCompletion, } from "../core/reporting/completion.js";
5
+ export function registerWorkflowCommands(program) {
6
+ const skills = program
7
+ .command("skills")
8
+ .description("Install the skills Loadout ships so your agents can use Loadout from inside a conversation");
9
+ skills
10
+ .command("list", { isDefault: true })
11
+ .description("Show the skills Loadout ships and whether they are installed")
12
+ .option("--json", "emit machine-readable JSON")
13
+ .action(async (options) => {
14
+ const installed = await installedFirstPartySkills();
15
+ console.log(options.json
16
+ ? JSON.stringify(FIRST_PARTY_SKILLS.map((skill) => ({
17
+ ...skill,
18
+ installed: installed.has(skill.id),
19
+ })), null, 2)
20
+ : formatFirstPartySkillList(installed));
21
+ });
22
+ skills
23
+ .command("install")
24
+ .description("Preview or install one Loadout skill into detected agents")
25
+ .argument("<id>", "skill id, for example loadout-handoff")
26
+ .option("--agents <ids>", "comma-separated agent ids; defaults to all detected")
27
+ .option("--yes", "apply after previewing")
28
+ .action(async (id, options) => {
29
+ const plan = await planFirstPartySkill(id, {
30
+ ...(options.agents
31
+ ? { agents: parseAgentSelection(options.agents) }
32
+ : {}),
33
+ });
34
+ console.log(formatFirstPartySkillPlan(plan));
35
+ if (!plan.targets.length)
36
+ return;
37
+ if (!options.yes) {
38
+ console.log("\nPreview only. Re-run with --yes to install.");
39
+ return;
40
+ }
41
+ const snapshotId = await applyFirstPartySkill(plan);
42
+ console.log(`\nInstalled '${plan.skill.id}' for ${plan.targets.length} agent(s). Snapshot: ${snapshotId}\nStart a new agent session to pick it up.`);
43
+ });
44
+ skills
45
+ .command("remove")
46
+ .description("Preview or remove one Loadout skill from detected agents")
47
+ .argument("<id>", "skill id")
48
+ .option("--agents <ids>", "comma-separated agent ids; defaults to all detected")
49
+ .option("--yes", "apply after previewing")
50
+ .action(async (id, options) => {
51
+ const plan = await planFirstPartySkill(id, {
52
+ ...(options.agents
53
+ ? { agents: parseAgentSelection(options.agents) }
54
+ : {}),
55
+ });
56
+ const present = plan.targets.filter((target) => target.replacing);
57
+ if (!present.length) {
58
+ console.log(`'${id}' is not installed for any detected agent.`);
59
+ return;
60
+ }
61
+ for (const target of present)
62
+ console.log(` remove → ${target.destination} [${target.displayName}]`);
63
+ if (!options.yes) {
64
+ console.log("\nPreview only. Re-run with --yes to remove.");
65
+ return;
66
+ }
67
+ const snapshotId = await removeFirstPartySkill(plan);
68
+ console.log(`\nRemoved '${id}' from ${present.length} agent(s). Snapshot: ${snapshotId}`);
69
+ });
70
+ const handoff = program
71
+ .command("handoff")
72
+ .description("Hand a task to your other agent, or see what has been handed to you");
73
+ handoff
74
+ .argument("[agent]", "who should do it, for example codex")
75
+ .argument("[task...]", "what they should do")
76
+ .option("--context <text>", "anything they need that is not in the task")
77
+ .option("--from <agent>", "who is sending", "user")
78
+ .option("--done <id>", "mark a task finished")
79
+ .option("--json", "emit machine-readable JSON")
80
+ .action(async (agent, taskWords, options) => {
81
+ const cwd = process.cwd();
82
+ if (options.done) {
83
+ const message = await markDone(cwd, options.done);
84
+ console.log(options.json
85
+ ? JSON.stringify(message, null, 2)
86
+ : `Marked ${options.done} done.`);
87
+ return;
88
+ }
89
+ // No agent named: show what is waiting, for everyone.
90
+ if (!agent) {
91
+ const state = await getHandoffState(cwd);
92
+ console.log(options.json
93
+ ? JSON.stringify(state, null, 2)
94
+ : formatHandoffStatus(state));
95
+ return;
96
+ }
97
+ // An agent with no task means "show me my inbox".
98
+ const task = taskWords.join(" ").trim();
99
+ if (!task) {
100
+ const messages = await readInbox(cwd, agent);
101
+ console.log(options.json
102
+ ? JSON.stringify(messages, null, 2)
103
+ : formatInbox(agent, messages));
104
+ return;
105
+ }
106
+ // Sending is the common case, so it sets itself up rather than failing
107
+ // with instructions to run two other commands first.
108
+ const setup = [];
109
+ if (!(await isHandoffInitialized(cwd))) {
110
+ await initHandoff(cwd);
111
+ setup.push("created .handoff/");
112
+ }
113
+ for (const target of [options.from, agent]) {
114
+ if (!isPickupTarget(target))
115
+ continue;
116
+ const plan = await planPickup(cwd, target);
117
+ if (!plan.replacing) {
118
+ await applyPickup(plan);
119
+ setup.push(`told ${target} to check its inbox`);
120
+ }
121
+ }
122
+ const message = await sendHandoff(cwd, agent, task, {
123
+ from: options.from,
124
+ ...(options.context ? { context: options.context } : {}),
125
+ });
126
+ if (options.json) {
127
+ console.log(JSON.stringify({ message, setup }, null, 2));
128
+ return;
129
+ }
130
+ for (const line of setup)
131
+ console.log(` ${line}`);
132
+ console.log(`Sent to ${agent}: ${task}`);
133
+ console.log(`It will pick this up next session, or now with: loadout handoff ${agent}`);
134
+ });
135
+ program
136
+ .command("completion")
137
+ .description("Print a shell-completion script; redirect it to your shell profile")
138
+ .argument("[shell]", "bash, zsh, fish, or powershell")
139
+ .option("--commands-json", "print registered command paths as JSON for tooling")
140
+ .action((shell, options) => {
141
+ if (options.commandsJson) {
142
+ console.log(JSON.stringify(completionCommandPaths(), null, 2));
143
+ return;
144
+ }
145
+ process.stdout.write(renderShellCompletion(parseCompletionShell(shell ?? "")));
146
+ });
147
+ }