@lore-co/cli 0.1.13 → 0.1.15
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 +19 -2
- package/dist/api.d.ts +8 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +52 -0
- package/dist/api.js.map +1 -0
- package/dist/ask.d.ts +3 -0
- package/dist/ask.d.ts.map +1 -0
- package/dist/ask.js +194 -0
- package/dist/ask.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +37 -0
- package/dist/cli.js.map +1 -1
- package/dist/devin-client.d.ts +1 -1
- package/dist/generated-assets.d.ts +4 -4
- package/dist/generated-assets.js +4 -4
- package/dist/handoff.d.ts +4 -0
- package/dist/handoff.d.ts.map +1 -0
- package/dist/handoff.js +227 -0
- package/dist/handoff.js.map +1 -0
- package/dist/live.d.ts +28 -0
- package/dist/live.d.ts.map +1 -0
- package/dist/live.js +597 -0
- package/dist/live.js.map +1 -0
- package/dist/machine.d.ts +19 -0
- package/dist/machine.d.ts.map +1 -0
- package/dist/machine.js +102 -0
- package/dist/machine.js.map +1 -0
- package/dist/pty.d.ts +22 -0
- package/dist/pty.d.ts.map +1 -0
- package/dist/pty.js +148 -0
- package/dist/pty.js.map +1 -0
- package/dist/runtime.d.ts +15 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +45 -7
- package/dist/runtime.js.map +1 -1
- package/dist/self-host.d.ts +1 -1
- package/dist/self-host.js +2 -2
- package/dist/update.js +3 -3
- package/package.json +7 -3
package/dist/handoff.js
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { execFile as execFileCallback, spawn } from "node:child_process";
|
|
2
|
+
import { promisify } from "node:util";
|
|
3
|
+
import { HandoffResponseSchema } from "@lore-co/core";
|
|
4
|
+
import { loreApiRequest } from "./api.js";
|
|
5
|
+
import { ensureMachineRegistered } from "./machine.js";
|
|
6
|
+
import { repositoryScopeFromGitRoot } from "./repository.js";
|
|
7
|
+
import { hostLiveRuntime } from "./live.js";
|
|
8
|
+
const execFile = promisify(execFileCallback);
|
|
9
|
+
const RESUME_HELP = `lore resume
|
|
10
|
+
Continue previous work with saved Lore context. Same work, new execution.
|
|
11
|
+
|
|
12
|
+
Usage:
|
|
13
|
+
lore resume [options]
|
|
14
|
+
|
|
15
|
+
Options:
|
|
16
|
+
--on <agent> Tool to launch: claude, codex, or opencode
|
|
17
|
+
(default: the tool that ran the previous session)
|
|
18
|
+
--session <uuid> Resume a specific work session (default: latest for repo)
|
|
19
|
+
--repo <repo> Repository to resume work in (default: detected from cwd)
|
|
20
|
+
--project <name> Project to resume work in
|
|
21
|
+
--live Host the launched tool as a live session (lore attach)
|
|
22
|
+
--print Print the handoff brief instead of launching a tool
|
|
23
|
+
--json Print the machine-readable handoff
|
|
24
|
+
--help Show this command's help
|
|
25
|
+
|
|
26
|
+
Examples:
|
|
27
|
+
lore resume
|
|
28
|
+
lore resume --on claude
|
|
29
|
+
lore resume --print
|
|
30
|
+
`;
|
|
31
|
+
const CONTINUE_HELP = `lore continue
|
|
32
|
+
Hand the current work to a different agent. Same work, different tool.
|
|
33
|
+
|
|
34
|
+
Usage:
|
|
35
|
+
lore continue --on <agent> [options]
|
|
36
|
+
|
|
37
|
+
Options:
|
|
38
|
+
--on <agent> Target tool: claude, codex, or opencode (required)
|
|
39
|
+
--session <uuid> Continue a specific work session (default: latest for repo)
|
|
40
|
+
--repo <repo> Repository the work belongs to (default: detected from cwd)
|
|
41
|
+
--project <name> Project the work belongs to
|
|
42
|
+
--live Host the launched tool as a live session (lore attach)
|
|
43
|
+
--print Print the handoff brief instead of launching a tool
|
|
44
|
+
--json Print the machine-readable handoff
|
|
45
|
+
--help Show this command's help
|
|
46
|
+
|
|
47
|
+
Examples:
|
|
48
|
+
lore continue --on codex
|
|
49
|
+
lore continue --on opencode --repo acme/billing
|
|
50
|
+
`;
|
|
51
|
+
/** Tools `lore resume` / `lore continue` can launch interactively. */
|
|
52
|
+
const LAUNCHABLE_AGENTS = ["claude", "codex", "opencode"];
|
|
53
|
+
function isLaunchable(value) {
|
|
54
|
+
return LAUNCHABLE_AGENTS.includes(value);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Interactive launch argv for each supported tool: start the tool's normal
|
|
58
|
+
* interactive surface with the handoff brief as the initial prompt.
|
|
59
|
+
*/
|
|
60
|
+
function launchArgv(agent, brief) {
|
|
61
|
+
switch (agent) {
|
|
62
|
+
case "claude":
|
|
63
|
+
return ["claude", brief];
|
|
64
|
+
case "codex":
|
|
65
|
+
return ["codex", brief];
|
|
66
|
+
case "opencode":
|
|
67
|
+
return ["opencode", "--prompt", brief];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function parseHandoffArguments(args, help) {
|
|
71
|
+
const parsed = { live: false, print: false, json: false };
|
|
72
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
73
|
+
const argument = args[index];
|
|
74
|
+
if (argument === "--help" || argument === "-h") {
|
|
75
|
+
process.stdout.write(help);
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
if (argument === "--live") {
|
|
79
|
+
parsed.live = true;
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (argument === "--print") {
|
|
83
|
+
parsed.print = true;
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
if (argument === "--json") {
|
|
87
|
+
parsed.json = true;
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (argument === "--on" ||
|
|
91
|
+
argument === "--session" ||
|
|
92
|
+
argument === "--repo" ||
|
|
93
|
+
argument === "--project") {
|
|
94
|
+
const value = args[index + 1];
|
|
95
|
+
if (value === undefined) {
|
|
96
|
+
throw new Error(`Missing value for ${argument}`);
|
|
97
|
+
}
|
|
98
|
+
index += 1;
|
|
99
|
+
if (argument === "--on") {
|
|
100
|
+
parsed.on = value;
|
|
101
|
+
}
|
|
102
|
+
else if (argument === "--session") {
|
|
103
|
+
parsed.session = value;
|
|
104
|
+
}
|
|
105
|
+
else if (argument === "--repo") {
|
|
106
|
+
parsed.repo = value;
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
parsed.project = value;
|
|
110
|
+
}
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
throw new Error(`Unknown option: ${String(argument)}`);
|
|
114
|
+
}
|
|
115
|
+
return parsed;
|
|
116
|
+
}
|
|
117
|
+
async function detectRepoScope() {
|
|
118
|
+
try {
|
|
119
|
+
const { stdout } = await execFile("git", ["rev-parse", "--show-toplevel"], { timeout: 5_000 });
|
|
120
|
+
const root = stdout.trim();
|
|
121
|
+
if (root === "") {
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
return await repositoryScopeFromGitRoot(root);
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
return undefined;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
async function fetchHandoff(config, parsed, targetAgent) {
|
|
131
|
+
const repo = parsed.repo ?? (await detectRepoScope());
|
|
132
|
+
if (parsed.session === undefined &&
|
|
133
|
+
repo === undefined &&
|
|
134
|
+
parsed.project === undefined) {
|
|
135
|
+
throw new Error("No repository detected. Run inside a git repository or pass --repo/--project/--session.");
|
|
136
|
+
}
|
|
137
|
+
return loreApiRequest(config, "POST", "/v1/sessions/handoff", HandoffResponseSchema, {
|
|
138
|
+
...(parsed.session === undefined ? {} : { sessionId: parsed.session }),
|
|
139
|
+
...(parsed.session !== undefined || repo === undefined ? {} : { repo }),
|
|
140
|
+
...(parsed.project === undefined ? {} : { project: parsed.project }),
|
|
141
|
+
...(targetAgent === undefined ? {} : { targetAgent }),
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
async function launchAgent(agent, handoff, config, paths, live) {
|
|
145
|
+
const [command, ...commandArgs] = launchArgv(agent, handoff.brief);
|
|
146
|
+
if (command === undefined) {
|
|
147
|
+
throw new Error(`No launch command for ${agent}`);
|
|
148
|
+
}
|
|
149
|
+
const env = {
|
|
150
|
+
...process.env,
|
|
151
|
+
LORE_PARENT_SESSION_ID: handoff.parentSessionId,
|
|
152
|
+
};
|
|
153
|
+
if (live) {
|
|
154
|
+
await hostLiveRuntime({
|
|
155
|
+
config,
|
|
156
|
+
paths,
|
|
157
|
+
command,
|
|
158
|
+
args: commandArgs,
|
|
159
|
+
agent,
|
|
160
|
+
env: { LORE_PARENT_SESSION_ID: handoff.parentSessionId },
|
|
161
|
+
...(handoff.session.repo === null ? {} : { repo: handoff.session.repo }),
|
|
162
|
+
...(handoff.session.project === null
|
|
163
|
+
? {}
|
|
164
|
+
: { project: handoff.session.project }),
|
|
165
|
+
attach: true,
|
|
166
|
+
});
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
process.stdout.write(`Launching ${agent} with Lore context (parent session ${handoff.parentSessionId.slice(0, 8)}…)\n`);
|
|
170
|
+
await new Promise((resolvePromise, rejectPromise) => {
|
|
171
|
+
const child = spawn(command, commandArgs, {
|
|
172
|
+
stdio: "inherit",
|
|
173
|
+
env,
|
|
174
|
+
});
|
|
175
|
+
child.on("error", (error) => {
|
|
176
|
+
rejectPromise(error.code === "ENOENT"
|
|
177
|
+
? new Error(`The ${agent} CLI is not installed or not on PATH. Use --print to get the handoff brief instead.`)
|
|
178
|
+
: error);
|
|
179
|
+
});
|
|
180
|
+
child.on("exit", (code) => {
|
|
181
|
+
process.exitCode = code ?? 0;
|
|
182
|
+
resolvePromise();
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
async function runHandoffCommand(args, config, paths, mode) {
|
|
187
|
+
const parsed = parseHandoffArguments(args, mode === "resume" ? RESUME_HELP : CONTINUE_HELP);
|
|
188
|
+
if (parsed === null) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
if (config === null) {
|
|
192
|
+
throw new Error("Lore is not connected. Run: lore connect --token <workspace-token>");
|
|
193
|
+
}
|
|
194
|
+
if (mode === "continue" && parsed.on === undefined) {
|
|
195
|
+
throw new Error("lore continue requires a target. Try: lore continue --on codex");
|
|
196
|
+
}
|
|
197
|
+
const handoff = await fetchHandoff(config, parsed, parsed.on);
|
|
198
|
+
// Resume defaults to the tool that ran the previous session.
|
|
199
|
+
const targetAgent = parsed.on ?? handoff.session.agent;
|
|
200
|
+
if (parsed.json) {
|
|
201
|
+
process.stdout.write(`${JSON.stringify(handoff, null, 2)}\n`);
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
if (parsed.print || !isLaunchable(targetAgent)) {
|
|
205
|
+
if (!parsed.print) {
|
|
206
|
+
process.stdout.write(`Lore cannot launch "${targetAgent}" directly. Give this brief to your tool:\n\n`);
|
|
207
|
+
}
|
|
208
|
+
process.stdout.write(`${handoff.brief}\n`);
|
|
209
|
+
process.stdout.write(`\nTo record lineage, run the tool with LORE_PARENT_SESSION_ID=${handoff.parentSessionId}\n`);
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
// Machine registration is best-effort provenance; never block a handoff.
|
|
213
|
+
try {
|
|
214
|
+
await ensureMachineRegistered(config, paths);
|
|
215
|
+
}
|
|
216
|
+
catch {
|
|
217
|
+
// Older servers may not support machines.
|
|
218
|
+
}
|
|
219
|
+
await launchAgent(targetAgent, handoff, config, paths, parsed.live);
|
|
220
|
+
}
|
|
221
|
+
export async function runResumeCommand(args, config, paths) {
|
|
222
|
+
await runHandoffCommand(args, config, paths, "resume");
|
|
223
|
+
}
|
|
224
|
+
export async function runContinueCommand(args, config, paths) {
|
|
225
|
+
await runHandoffCommand(args, config, paths, "continue");
|
|
226
|
+
}
|
|
227
|
+
//# sourceMappingURL=handoff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handoff.js","sourceRoot":"","sources":["../src/handoff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,gBAAgB,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,SAAS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AAuB,EACvB,MAA8B,EAC9B,KAAgB;IAEhB,MAAM,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,IAAuB,EACvB,MAA8B,EAC9B,KAAgB;IAEhB,MAAM,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;AAC3D,CAAC"}
|
package/dist/live.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ConnectorConfig, LorePaths } from "./cli.js";
|
|
2
|
+
export interface HostLiveRuntimeOptions {
|
|
3
|
+
config: ConnectorConfig;
|
|
4
|
+
paths: LorePaths;
|
|
5
|
+
command: string;
|
|
6
|
+
args: string[];
|
|
7
|
+
agent: string;
|
|
8
|
+
env?: Record<string, string>;
|
|
9
|
+
repo?: string;
|
|
10
|
+
project?: string;
|
|
11
|
+
attach: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Starts a detached daemon that owns the process. The daemon — not this
|
|
15
|
+
* command — is the process's parent, so closing this terminal never kills
|
|
16
|
+
* the live session. Optionally attaches immediately.
|
|
17
|
+
*/
|
|
18
|
+
export declare function hostLiveRuntime(options: HostLiveRuntimeOptions): Promise<void>;
|
|
19
|
+
/** Internal command: the detached daemon hosting the PTY. */
|
|
20
|
+
export declare function runLiveHostCommand(args: readonly string[], config: ConnectorConfig | null, paths: LorePaths): Promise<void>;
|
|
21
|
+
export declare function runAttachCommand(args: readonly string[], config: ConnectorConfig | null, paths: LorePaths): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Hidden helper for starting an arbitrary command as a live session; used by
|
|
24
|
+
* integration tests and power users. Normal flows go through
|
|
25
|
+
* `lore resume --live` / `lore continue --on <agent> --live`.
|
|
26
|
+
*/
|
|
27
|
+
export declare function runLiveRunCommand(args: readonly string[], config: ConnectorConfig | null, paths: LorePaths): Promise<void>;
|
|
28
|
+
//# sourceMappingURL=live.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../src/live.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAoM3D,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,IAAI,CAAC,CA6Cf;AAED,6DAA6D;AAC7D,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,MAAM,EAAE,eAAe,GAAG,IAAI,EAC9B,KAAK,EAAE,SAAS,GACf,OAAO,CAAC,IAAI,CAAC,CA6Lf;AA0JD,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,MAAM,EAAE,eAAe,GAAG,IAAI,EAC9B,KAAK,EAAE,SAAS,GACf,OAAO,CAAC,IAAI,CAAC,CA4Gf;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,MAAM,EAAE,eAAe,GAAG,IAAI,EAC9B,KAAK,EAAE,SAAS,GACf,OAAO,CAAC,IAAI,CAAC,CAwBf"}
|