@lore-co/cli 0.1.22 → 0.1.24

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
@@ -83,11 +83,19 @@ Dashboard self-hosting uses `lore self-host up`, human signup, then:
83
83
  lore connect --login --url http://127.0.0.1:3001 \
84
84
  --dashboard-url http://127.0.0.1:3000
85
85
  ```
86
- For a review-first rollout in a personal vault or component catalog, follow the
87
- [OpenCode pilot runbook](../../docs/opencode-pilot.md).
86
+ For a review-first OpenCode rollout, follow the
87
+ [plugin guide](../opencode-plugin/README.md#review-first-use).
88
88
 
89
89
  ## Query shared context
90
90
 
91
+ Use `lore connect --fallback <agent>` or set independent routes with
92
+ `lore recovery enable --from opencode --to devin`, then open a new terminal.
93
+ Local destinations are Claude, Codex, OpenCode, Devin CLI, Cursor Agent and
94
+ Copilot CLI, plus Polytoken. Claude and OpenCode support automatic offers for documented failure
95
+ conditions; Claude/Codex/OpenCode/Devin also support a manual Ctrl+] switch.
96
+ Setup adds reversible shell wrappers and separate checkpoint integrations.
97
+ See the [recovery guide](../../docs/recovery.md) for exact coverage and evidence.
98
+
91
99
  ```sh
92
100
  lore ask "How should payment retries work?"
93
101
  lore ask "What did the previous agent already try?" --repo acme/billing
@@ -156,7 +164,7 @@ content-free `guard_check` audit event.
156
164
 
157
165
  ```sh
158
166
  lore update
159
- lore update --version v0.1.22
167
+ lore update --version v0.1.24
160
168
  ```
161
169
 
162
170
  `update` resolves the latest release to an exact tag, or uses the exact
@@ -419,7 +427,7 @@ same-repository, non-draft pull requests bearing the corresponding
419
427
  `lore:codex-review` or `lore:devin-review` label.
420
428
 
421
429
  Generated jobs require a published standalone binary release and default to
422
- `treadiehq/lore-releases` at `v0.1.22`. Set `LORE_CLI_REPOSITORY` to the publicly
430
+ `treadiehq/lore-releases` at `v0.1.24`. Set `LORE_CLI_REPOSITORY` to the publicly
423
431
  readable `owner/repository` and `LORE_CLI_VERSION` to an existing release tag
424
432
  when using another release source.
425
433
 
@@ -452,4 +460,4 @@ The correction and current behavior go here.
452
460
  and update it deliberately.
453
461
 
454
462
  For source builds, self-hosting, tests, and release internals, see the
455
- [technical and development guide](../../docs/detailed.md).
463
+ [documentation index](../../docs/README.md).
@@ -0,0 +1,16 @@
1
+ /** Local terminal clients. Cloud and desktop surfaces need different transports. */
2
+ export declare const LAUNCHABLE_AGENTS: readonly ["claude", "codex", "opencode", "devin", "cursor", "copilot-cli", "polytoken"];
3
+ export type LaunchableAgent = (typeof LAUNCHABLE_AGENTS)[number];
4
+ export declare const RECOVERY_SOURCES: readonly ["claude", "codex", "opencode", "devin"];
5
+ export type RecoverySource = (typeof RECOVERY_SOURCES)[number];
6
+ export declare const AGENTS: Record<LaunchableAgent, {
7
+ label: string;
8
+ commands: readonly string[];
9
+ automatic: string | null;
10
+ }>;
11
+ export declare const isLaunchable: (value: string) => value is LaunchableAgent;
12
+ export declare const isRecoverySource: (value: string) => value is RecoverySource;
13
+ export declare function launchArguments(agent: LaunchableAgent, brief: string): string[];
14
+ export declare function findAgentExecutable(agent: LaunchableAgent, env?: NodeJS.ProcessEnv): Promise<string>;
15
+ export declare function isInteractiveAgent(agent: RecoverySource, args: readonly string[], stdinIsTty: boolean, stdoutIsTty: boolean): boolean;
16
+ //# sourceMappingURL=agents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAIA,oFAAoF;AACpF,eAAO,MAAM,iBAAiB,yFAA0F,CAAC;AACzH,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AACjE,eAAO,MAAM,gBAAgB,mDAAoD,CAAC;AAClF,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAC/D,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,eAAe,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAQpH,CAAC;AACF,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,KAAK,IAAI,eAA2E,CAAC;AAClI,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,KAAG,KAAK,IAAI,cAAyE,CAAC;AAEpI,wBAAgB,eAAe,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAM/E;AAED,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,eAAe,EAAE,GAAG,oBAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CASpG;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,GAAG,OAAO,CA6BrI"}
package/dist/agents.js ADDED
@@ -0,0 +1,80 @@
1
+ import { constants } from "node:fs";
2
+ import { access, realpath, stat } from "node:fs/promises";
3
+ import { delimiter, resolve } from "node:path";
4
+ /** Local terminal clients. Cloud and desktop surfaces need different transports. */
5
+ export const LAUNCHABLE_AGENTS = ["claude", "codex", "opencode", "devin", "cursor", "copilot-cli", "polytoken"];
6
+ export const RECOVERY_SOURCES = ["claude", "codex", "opencode", "devin"];
7
+ export const AGENTS = {
8
+ claude: { label: "Claude", commands: ["claude"], automatic: "StopFailure: rate_limit" },
9
+ codex: { label: "Codex", commands: ["codex"], automatic: null },
10
+ opencode: { label: "OpenCode", commands: ["opencode"], automatic: "APIError: HTTP 429, or 3 provider retries" },
11
+ devin: { label: "Devin CLI", commands: ["devin"], automatic: null },
12
+ cursor: { label: "Cursor Agent", commands: ["cursor-agent", "agent"], automatic: null },
13
+ "copilot-cli": { label: "Copilot CLI", commands: ["copilot"], automatic: null },
14
+ polytoken: { label: "Polytoken", commands: ["polytoken"], automatic: null },
15
+ };
16
+ export const isLaunchable = (value) => LAUNCHABLE_AGENTS.includes(value);
17
+ export const isRecoverySource = (value) => RECOVERY_SOURCES.includes(value);
18
+ export function launchArguments(agent, brief) {
19
+ if (agent === "opencode")
20
+ return ["--prompt", brief];
21
+ if (agent === "copilot-cli")
22
+ return ["--interactive", brief];
23
+ if (agent === "devin")
24
+ return ["--", brief];
25
+ if (agent === "polytoken")
26
+ return ["new", "--prompt", brief];
27
+ return [brief];
28
+ }
29
+ export async function findAgentExecutable(agent, env = process.env) {
30
+ for (const command of AGENTS[agent].commands) {
31
+ for (const directory of (env.PATH ?? "").split(delimiter)) {
32
+ if (!directory)
33
+ continue;
34
+ const path = resolve(directory, command);
35
+ try {
36
+ await access(path, constants.X_OK);
37
+ if ((await stat(path)).isFile())
38
+ return await realpath(path);
39
+ }
40
+ catch { /* next PATH entry */ }
41
+ }
42
+ }
43
+ throw new Error(`${AGENTS[agent].label} is not installed or is not on PATH (expected ${AGENTS[agent].commands.join(" or ")}).`);
44
+ }
45
+ export function isInteractiveAgent(agent, args, stdinIsTty, stdoutIsTty) {
46
+ if (!stdinIsTty || !stdoutIsTty)
47
+ return false;
48
+ const common = ["--help", "-h", "--version", "-v", "-V", "--print", "-p"];
49
+ const bypass = {
50
+ claude: ["--bg", "--background", "--cloud", "--bare", "--safe-mode", "--worktree", "-w", "--tmux"],
51
+ codex: ["--cd", "-C", "--remote", "--remote-session"],
52
+ devin: ["--config"],
53
+ opencode: [],
54
+ };
55
+ const beforeDelimiter = args.slice(0, args.indexOf("--") < 0 ? args.length : args.indexOf("--"));
56
+ if (beforeDelimiter.some((arg) => [...common, ...bypass[agent]].includes(arg.split("=")[0] ?? arg)))
57
+ return false;
58
+ const commands = {
59
+ claude: ["auth", "mcp", "plugin", "plugins", "install", "update", "upgrade", "doctor", "setup-token", "agents", "attach", "logs", "rm", "stop", "kill", "respawn", "gateway", "import", "project", "ultrareview"],
60
+ codex: ["exec", "e", "review", "login", "logout", "mcp", "mcp-server", "app-server", "app", "completion", "sandbox", "debug", "apply", "a", "resume", "fork", "cloud", "features", "help"],
61
+ devin: ["auth", "mcp", "models", "rules", "skills", "plugins", "cloud", "list", "ls", "update", "version", "migrate", "sandbox", "setup", "uninstall", "acp", "help"],
62
+ opencode: ["completion", "acp", "mcp", "attach", "run", "debug", "providers", "auth", "agent", "upgrade", "uninstall", "serve", "web", "models", "stats", "export", "import", "github", "pr", "session", "db"],
63
+ };
64
+ if (commands[agent].includes(args[0] ?? ""))
65
+ return false;
66
+ // OpenCode's positional argument selects another directory. Keep wrappers
67
+ // scoped to their existing cwd; flags with values are still supported.
68
+ if (agent === "opencode") {
69
+ const valued = ["--prompt", "--model", "-m", "--session", "-s", "--agent", "--port", "--hostname", "--log-level", "--mdns-domain", "--cors"];
70
+ for (let i = 0; i < args.length; i++) {
71
+ const arg = args[i];
72
+ if (!arg.startsWith("-"))
73
+ return false;
74
+ if (valued.includes(arg))
75
+ i++;
76
+ }
77
+ }
78
+ return true;
79
+ }
80
+ //# sourceMappingURL=agents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.js","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE/C,oFAAoF;AACpF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,CAAU,CAAC;AAEzH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,CAAU,CAAC;AAElF,MAAM,CAAC,MAAM,MAAM,GAAsG;IACvH,MA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CAAC;YACrB,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC;gBAAE,OAAO,KAAK,CAAC;YACvC,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC;gBAAE,CAAC,EAAE,CAAC;QAChC,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
package/dist/cli.d.ts CHANGED
@@ -78,6 +78,7 @@ export interface AgentInstallation {
78
78
  }
79
79
  export declare function t3CodeProviderInstallations(settings: unknown, paths: LorePaths): AgentInstallation[];
80
80
  export interface ConnectWithCredentialOptions {
81
+ fallback?: string;
81
82
  /** Explicit installation root for embedded callers and isolated acceptance tests. */
82
83
  home?: string;
83
84
  /** Repository root for project-local integrations such as VS Code. */
@@ -89,6 +90,7 @@ export interface ConnectWithCredentialOptions {
89
90
  timeoutMs?: number;
90
91
  }
91
92
  export interface ConnectResult {
93
+ recoveryNotice?: string;
92
94
  connected: true;
93
95
  apiUrl: string;
94
96
  identity: WorkspaceIdentityResponse;
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAsBA,OAAO,EAwBL,KAAK,yBAAyB,EAC/B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,cAAc,CAAC;AA8BtB,eAAO,MAAM,oBAAoB,sBAAsB,CAAC;AACxD,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAC/D,eAAO,MAAM,4BAA4B,uBAAuB,CAAC;AACjE,QAAA,MAAM,sBAAsB,kGAA4B,CAAC;AACzD,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAC1E,MAAM,MAAM,gBAAgB,GACxB,mBAAmB,GACnB,SAAS,GACT,QAAQ,GACR,QAAQ,CAAC;AAiCb,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,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IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,IAAI,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,yBAAyB,CAAC;IACpC,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,aAAa,CAAC,CAiJxB;AA6LD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAKvE;AAED,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,MAAM,CAKR;AAywBD,wBAAsB,MAAM,CAC1B,IAAI,GAAE,SAAS,MAAM,EAA0B,GAC9C,OAAO,CAAC,IAAI,CAAC,CAqJf"}
package/dist/cli.js CHANGED
@@ -14,6 +14,8 @@ import { runAskCommand } from "./ask.js";
14
14
  import { runRememberCommand } from "./remember.js";
15
15
  import { runGuardCommand } from "./guard.js";
16
16
  import { runContinueCommand, runResumeCommand } from "./handoff.js";
17
+ import { disableRecovery, prepareRecoveryInstallation, runRecoveryCommand, runRecoveryHook, runWrappedAgent } from "./recovery.js";
18
+ import { LAUNCHABLE_AGENTS, isLaunchable, isRecoverySource } from "./agents.js";
17
19
  import { runAttachCommand, runLiveHostCommand, runLiveRunCommand, } from "./live.js";
18
20
  import { runMachinesCommand } from "./machine.js";
19
21
  import { connectGithub, runGithubCommand } from "./github.js";
@@ -86,6 +88,8 @@ Commands:
86
88
  guard Control Context Guard (off, assist, enforce)
87
89
  resume Continue previous work with saved Lore context
88
90
  continue Hand the current work to a different agent (--on <agent>)
91
+ run Run a coding agent with configured recovery
92
+ recovery Inspect recovery metrics, record feedback, or disable recovery
89
93
  attach Reconnect to a live Lore-managed session (--from <machine>)
90
94
  machines List registered machines and their live sessions
91
95
  github Prepare/post GitHub reviews and observe corrections
@@ -141,6 +145,7 @@ Options:
141
145
  --token <token> Workspace bearer token (or LORE_WORKSPACE_TOKEN/LORE_TOKEN)
142
146
  --agent <name> claude, codex, copilot, copilot-cli, copilot-vscode, cowork, cursor, opencode, polytoken, or t3code
143
147
  --timeout-ms <ms> Hook request timeout, 250-10000 (default: 2500)
148
+ --fallback <agent> claude, codex, opencode, devin, cursor, copilot-cli, polytoken
144
149
  --json Print machine-readable output
145
150
  --help Show this command's help
146
151
 
@@ -1552,12 +1557,18 @@ function parseConnectArguments(args) {
1552
1557
  argument !== "--dashboard-url" &&
1553
1558
  argument !== "--token" &&
1554
1559
  argument !== "--agent" &&
1560
+ argument !== "--fallback" &&
1555
1561
  argument !== "--timeout-ms") {
1556
1562
  throw new Error(`Unknown connect option: ${argument ?? ""}`);
1557
1563
  }
1558
1564
  const [value, valueIndex] = valueAfter(args, index, argument);
1559
1565
  index = valueIndex;
1560
- if (argument === "--url") {
1566
+ if (argument === "--fallback") {
1567
+ if (!isLaunchable(value))
1568
+ throw new Error(`--fallback must be ${LAUNCHABLE_AGENTS.join(", ")}`);
1569
+ parsed.fallback = value;
1570
+ }
1571
+ else if (argument === "--url") {
1561
1572
  parsed.apiUrl = value;
1562
1573
  }
1563
1574
  else if (argument === "--dashboard-url") {
@@ -1613,6 +1624,8 @@ export async function connectWithCredential(options) {
1613
1624
  throw new Error("Lore agent integrations currently support macOS and Linux");
1614
1625
  }
1615
1626
  const paths = getLorePaths(options.home, options.home === undefined ? process.env : {}, options.cwd);
1627
+ const installRecovery = options.fallback === undefined ? undefined :
1628
+ await prepareRecoveryInstallation(paths, options.fallback, options.home === undefined ? process.env : { ...process.env, ZDOTDIR: paths.home });
1616
1629
  const existing = await readConnectorConfig(paths);
1617
1630
  const apiUrl = normalizeApiUrl(options.apiUrl);
1618
1631
  const dashboardUrl = options.dashboardUrl === undefined
@@ -1624,9 +1637,12 @@ export async function connectWithCredential(options) {
1624
1637
  }
1625
1638
  const timeoutMs = options.timeoutMs ?? existing?.timeoutMs ?? 2_500;
1626
1639
  const identity = await authenticatedIdentity(apiUrl, token.trim(), timeoutMs);
1627
- const requestedExpansion = options.agents.length === 0
1640
+ const recoveryAgents = installRecovery ? [...installRecovery.sources, installRecovery.fallback]
1641
+ .filter((agent) => agent !== "devin") : [];
1642
+ const requestedAgents = [...new Set([...options.agents, ...recoveryAgents])];
1643
+ const requestedExpansion = requestedAgents.length === 0
1628
1644
  ? { installations: [], warnings: [] }
1629
- : await expandConnectInstallations(options.agents, paths);
1645
+ : await expandConnectInstallations(requestedAgents, paths);
1630
1646
  const detectedAgents = options.agents.length === 0 ? await detectAgents(paths) : [];
1631
1647
  const installations = uniqueInstallations([
1632
1648
  ...configuredInstallations(existing, paths),
@@ -1713,6 +1729,7 @@ export async function connectWithCredential(options) {
1713
1729
  await credentialStore.transferPendingTo(reliabilityStore);
1714
1730
  }
1715
1731
  await reliabilityStore.releaseAuthBlocked(now);
1732
+ const recoveryNotice = installRecovery ? await installRecovery() : undefined;
1716
1733
  return {
1717
1734
  connected: true,
1718
1735
  apiUrl: config.apiUrl,
@@ -1722,6 +1739,7 @@ export async function connectWithCredential(options) {
1722
1739
  changedHookFiles,
1723
1740
  backups,
1724
1741
  warnings: requestedExpansion.warnings,
1742
+ ...(recoveryNotice ? { recoveryNotice } : {}),
1725
1743
  };
1726
1744
  }
1727
1745
  async function requestDeviceAuthorization(input) {
@@ -1854,13 +1872,14 @@ async function connectCommand(args) {
1854
1872
  throw new Error("Workspace token is required. Use --login, --token <token>, LORE_WORKSPACE_TOKEN, or LORE_TOKEN.");
1855
1873
  }
1856
1874
  const result = await connectWithCredential({
1875
+ ...(parsed.fallback === undefined ? {} : { fallback: parsed.fallback }),
1857
1876
  apiUrl,
1858
1877
  ...(dashboardUrl === undefined ? {} : { dashboardUrl }),
1859
1878
  token,
1860
1879
  agents: parsed.agents,
1861
1880
  ...(parsed.timeoutMs === undefined ? {} : { timeoutMs: parsed.timeoutMs }),
1862
1881
  });
1863
- writeResult(result, parsed.json, `connected: ${result.agents.join(", ")}\napi_url: ${result.apiUrl}\nconfig: ${result.config}\n${result.warnings.map((warning) => `warning: ${warning}\n`).join("")}`);
1882
+ writeResult(result, parsed.json, `connected: ${result.agents.join(", ")}\napi_url: ${result.apiUrl}\nconfig: ${result.config}\n${result.recoveryNotice ? `${result.recoveryNotice}\n` : ""}${result.warnings.map((warning) => `warning: ${warning}\n`).join("")}`);
1864
1883
  }
1865
1884
  async function queueCount(paths) {
1866
1885
  try {
@@ -2181,6 +2200,7 @@ async function disconnectCommand(args) {
2181
2200
  return;
2182
2201
  }
2183
2202
  const paths = getLorePaths();
2203
+ await disableRecovery(paths.home);
2184
2204
  const config = await readConnectorConfig(paths);
2185
2205
  const now = new Date();
2186
2206
  const changedHookFiles = [];
@@ -2517,6 +2537,20 @@ export async function runCli(args = process.argv.slice(2)) {
2517
2537
  case "continue":
2518
2538
  await runContinueCommand(commandArgs, await readConnectorConfig(getLorePaths()), getLorePaths());
2519
2539
  return;
2540
+ case "run":
2541
+ await runWrappedAgent(commandArgs, getLorePaths(process.env.LORE_HOME));
2542
+ return;
2543
+ case "recovery":
2544
+ await runRecoveryCommand(commandArgs, getLorePaths(process.env.LORE_HOME));
2545
+ return;
2546
+ case "recovery-hook":
2547
+ {
2548
+ const agent = commandArgs.includes("--agent") ? commandArgs[commandArgs.indexOf("--agent") + 1] : "claude";
2549
+ if (!agent || !isRecoverySource(agent))
2550
+ throw new Error("Unknown recovery hook agent.");
2551
+ await runRecoveryHook(getLorePaths(process.env.LORE_HOME).home, agent);
2552
+ }
2553
+ return;
2520
2554
  case "attach":
2521
2555
  await runAttachCommand(commandArgs, await readConnectorConfig(getLorePaths()), getLorePaths());
2522
2556
  return;