@lore-co/cli 0.2.7 → 0.2.9
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 +15 -2
- package/dist/approach-guidance.d.ts +2 -0
- package/dist/approach-guidance.d.ts.map +1 -0
- package/dist/approach-guidance.js +19 -0
- package/dist/approach-guidance.js.map +1 -0
- package/dist/approach.d.ts +6 -0
- package/dist/approach.d.ts.map +1 -0
- package/dist/approach.js +121 -0
- package/dist/approach.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +23 -2
- package/dist/cli.js.map +1 -1
- package/dist/command-help.d.ts +2 -1
- package/dist/command-help.d.ts.map +1 -1
- package/dist/command-help.js +2 -0
- package/dist/command-help.js.map +1 -1
- package/dist/generated-assets.d.ts +4 -4
- package/dist/generated-assets.js +4 -4
- package/dist/image-capture.d.ts +3 -0
- package/dist/image-capture.d.ts.map +1 -1
- package/dist/image-capture.js +22 -3
- package/dist/image-capture.js.map +1 -1
- package/dist/retained-context.d.ts +19 -0
- package/dist/retained-context.d.ts.map +1 -0
- package/dist/retained-context.js +136 -0
- package/dist/retained-context.js.map +1 -0
- package/dist/runtime.d.ts +1 -0
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +36 -15
- 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 +3 -3
package/README.md
CHANGED
|
@@ -194,6 +194,19 @@ an existing learning when the server deduplicates it. `--json` returns the full
|
|
|
194
194
|
`{ memory, inserted }` response for scripts. Use `--` before statement text that
|
|
195
195
|
begins with a dash. Manual saves do not require agent hooks or MCP write tools.
|
|
196
196
|
|
|
197
|
+
## Make this repeatable
|
|
198
|
+
|
|
199
|
+
After completing a task in a connected native agent, say **“Make this repeatable.”**
|
|
200
|
+
Lore's prompt hook supplies instructions for reviewing the recorded work and
|
|
201
|
+
saving an approach in **Learnings**. To reuse it, ask your agent to use the saved
|
|
202
|
+
approach for the next task. The agent asks for new inputs, checks prerequisites,
|
|
203
|
+
and records its result against the saved version.
|
|
204
|
+
|
|
205
|
+
`lore approach --help` describes the JSON commands used by agents. These require
|
|
206
|
+
an updated CLI and API. MCP hosts can use the equivalent tools with writes
|
|
207
|
+
enabled. See [Make this repeatable](../../docs/guides/repeatable-work.md) for the
|
|
208
|
+
workflow and its limits.
|
|
209
|
+
|
|
197
210
|
## Context Guard
|
|
198
211
|
|
|
199
212
|
```sh
|
|
@@ -224,7 +237,7 @@ content-free `guard_check` audit event.
|
|
|
224
237
|
|
|
225
238
|
```sh
|
|
226
239
|
lore update
|
|
227
|
-
lore update --version v0.2.
|
|
240
|
+
lore update --version v0.2.9
|
|
228
241
|
```
|
|
229
242
|
|
|
230
243
|
`update` resolves the latest release to an exact tag, or uses the exact
|
|
@@ -570,7 +583,7 @@ same-repository, non-draft pull requests bearing the corresponding
|
|
|
570
583
|
`lore:codex-review` or `lore:devin-review` label.
|
|
571
584
|
|
|
572
585
|
Generated jobs require a published standalone binary release and default to
|
|
573
|
-
`treadiehq/lore-releases` at `v0.2.
|
|
586
|
+
`treadiehq/lore-releases` at `v0.2.9`. Set `LORE_CLI_REPOSITORY` to the publicly
|
|
574
587
|
readable `owner/repository` and `LORE_CLI_VERSION` to an existing release tag
|
|
575
588
|
when using another release source.
|
|
576
589
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approach-guidance.d.ts","sourceRoot":"","sources":["../src/approach-guidance.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,GAAE,SAAS,MAAM,EAAO,GAAG,MAAM,GAAG,SAAS,CAiBvI"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function approachGuidance(prompt, agent, sessionId, retained = []) {
|
|
2
|
+
// A capability cue lets the agent recognize ordinary requests itself. Reuse
|
|
3
|
+
// must not depend on the user knowing a feature name or a trigger phrase.
|
|
4
|
+
const discovery = `Lore can save and reuse reviewed approaches in Learnings. If the user asks to repeat earlier work or do it the way it was done before, run \`lore approach --help\`, list active approaches in this repository, and choose by the task, without requiring an exact name. Infer inputs from the request and repository; ask only for missing information or an ambiguous match. Use the saved version, check prerequisites before editing, and record the actual result. Your native session is ${JSON.stringify({ agent, sessionId })}.`;
|
|
5
|
+
const detailed = /\bmake (?:this|that|it|the work) repeatable\b|\b(?:saved|reusable) approach\b/iu.test(prompt);
|
|
6
|
+
const instructions = ["Run `lore approach --help` for the JSON command contract. These commands use this folder's existing connection.",
|
|
7
|
+
`For source preparation, use an explicit Lore source session if the user supplied one. Otherwise your native session reference is ${JSON.stringify({ externalSessionId: sessionId, agent })}. Resolve it with prepare; never invent a Lore session UUID. If it is not captured yet, use explicit source notes and describe missing evidence.`,
|
|
8
|
+
"For saving: prepare the source, preserve human corrections, show the name, inputs, steps, prerequisites, and checks, then keep a draft. Save only after the user reviews and asks to save. Missing final work or checks must stay a draft. Policy can require human review in Learnings.",
|
|
9
|
+
"Separate task inputs from repository dependencies: resource names, fields, and sort direction can vary per run. Preserve the actual helper names, module paths, and required contracts in prerequisites; do not turn existing helpers into unconstrained inputs. A renamed or replaced helper needs a decision. Aim for 3–7 essential steps and durable constraints, excluding incidental tool failures and restrictions specific to the original task. Required result checks must apply to every supported use; keep optional diagnostics in the steps, not in checks. Do not require reproducing a historical defect when adding new work. Check that stop conditions do not contradict the declared inputs.",
|
|
10
|
+
"Keep the user experience short: show a plain-language preview of what will repeat and ask to save. Keep command contracts, source IDs, version bookkeeping, and reporting internal. Derive inputs and checks yourself; ask the user only for information you cannot infer.",
|
|
11
|
+
"For reuse: list active approaches in this repository, choose by the task without requiring an exact name, infer the inputs from the request and repository, and use its exact version. Ask only when information is missing or the match is ambiguous. Check prerequisites before editing. Changed or unknown prerequisites require needs_input and a specific user decision. Execute with your normal tools and permissions, report actual artifacts/checks, and keep missing evidence unknown. Updating the shared approach is a separate reviewed revision.",
|
|
12
|
+
].join("\n");
|
|
13
|
+
// Confirm each complete part in the host's current context. New workflow
|
|
14
|
+
// instructions still go out after discovery; compaction restores both.
|
|
15
|
+
return [discovery, ...(detailed ? [instructions] : [])]
|
|
16
|
+
.filter(part => !retained.some(text => text.includes(part)))
|
|
17
|
+
.join("\n\n") || undefined;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=approach-guidance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approach-guidance.js","sourceRoot":"","sources":["../src/approach-guidance.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,gBAAgB,CAAC,MAAc,EAAE,KAAa,EAAE,SAAiB,EAAE,WAA8B,EAAE;IACjH,4EAA4E;IAC5E,0EAA0E;IAC1E,MAAM,SAAS,GAAG,keAAke,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC;IAC5hB,MAAM,QAAQ,GAAG,iFAAiF,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAChH,MAAM,YAAY,GAAG,CAAC,iHAAiH;QACrI,oIAAoI,IAAI,CAAC,SAAS,CAAC,EAAE,iBAAiB,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,kJAAkJ;QAC7U,0RAA0R;QAC1R,irBAAirB;QACjrB,4QAA4Q;QAC5Q,giBAAgiB;KACjiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACb,yEAAyE;IACzE,uEAAuE;IACvE,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SACpD,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;SAC3D,IAAI,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LoreClient } from "@lore-co/sdk";
|
|
2
|
+
import type { ConnectorConfig } from "./cli.js";
|
|
3
|
+
export declare const APPROACH_HELP = "lore approach \u2014 save and reuse a reviewed way of working\n\nUsage: lore approach <operation> --input <JSON-file|->\n\nOperations (JSON response):\n prepare {repo?, sessionId?, externalSessionId?, agent?, notes?, task?}\n Reads captured source work. sessionId is Lore's UUID; externalSessionId\n resolves the current native agent session. Pass notes for missing work.\n draft {repo?, document, source, agent, requestId}\n Keeps a draft using the exact source from prepare. Does not activate it.\n list {repo?, query?, status?} (defaults to active in the current repository)\n get {id, version?}\n revise {id, expectedVersion, document} (creates a separate draft version)\n save {id, expectedVersion, validation}\n Only after the user reviews and asks to save. Describe the actual final\n artifact and checks; keep a draft when these are missing.\n Workspace policy may require human approval in Learnings.\n use {id, version, repo?, agent, sessionId, inputs, requestId}\n Returns steps and records a run. Check current prerequisites BEFORE\n editing. The agent executes with its normal tools and permissions.\n report {id, outcome, summary, prerequisiteChecks, checks, artifacts, adjustment?}\n Outcomes: needs_input, completed, failed, unknown, stopped.\n Each prerequisite: {prerequisite, result: passed|changed|unknown, detail}\n Each check: {check, result: passed|failed|unknown, output}\n decide {id, action: continue|stop, reason}\n Record the user's explicit decision for a paused run; never infer it.\n runs {id}\n\nDocument: {name, purpose, inputs: [{name, description, required}], steps: string[],\n prerequisites: string[], checks: string[], stopConditions: string[]}\nDraft variable task values (resource, fields, ordering) as inputs. Preserve actual\nrepository helper names, module paths, and contracts as prerequisites; replacing\na dependency requires a decision. Keep essential steps and durable constraints,\nnot incidental tool failures or the original task's chosen input values.\nAim for 3\u20137 essential steps. Every result check is REQUIRED for every supported\nuse. Put optional diagnostics in steps, not checks; reproducing the source\ndefect must not block new work with no prior defect.\nStop conditions must not contradict the inputs the approach supports.\nUse the exact prerequisite/check text in reports. Missing evidence is unknown;\nGuard authorization is not proof of execution. A one-run adjustment does not\nchange the shared approach. Request IDs are UUIDs; reuse them on uncertain retries.\nUse source snapshots returned by prepare, never construct them yourself.\nThese commands use the current folder's existing Lore connection.\n";
|
|
4
|
+
export declare function runApproachCommand(args: readonly string[], config: ConnectorConfig | null): Promise<void>;
|
|
5
|
+
export declare function executeApproachCommand(client: LoreClient, operation: string, value: Record<string, unknown>, repo: string): Promise<unknown>;
|
|
6
|
+
//# sourceMappingURL=approach.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approach.d.ts","sourceRoot":"","sources":["../src/approach.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAwB,MAAM,cAAc,CAAC;AAEhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhD,eAAO,MAAM,aAAa,uyFA2CzB,CAAC;AAEF,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAqB/G;AAED,wBAAsB,sBAAsB,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CA0BlJ"}
|
package/dist/approach.js
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { open } from "node:fs/promises";
|
|
2
|
+
import { constants } from "node:fs";
|
|
3
|
+
import { LoreClient, SharedMemoryApiError } from "@lore-co/sdk";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { repositoryScopeFromDirectory } from "@lore-co/core/repository-location";
|
|
6
|
+
export const APPROACH_HELP = `lore approach — save and reuse a reviewed way of working
|
|
7
|
+
|
|
8
|
+
Usage: lore approach <operation> --input <JSON-file|->
|
|
9
|
+
|
|
10
|
+
Operations (JSON response):
|
|
11
|
+
prepare {repo?, sessionId?, externalSessionId?, agent?, notes?, task?}
|
|
12
|
+
Reads captured source work. sessionId is Lore's UUID; externalSessionId
|
|
13
|
+
resolves the current native agent session. Pass notes for missing work.
|
|
14
|
+
draft {repo?, document, source, agent, requestId}
|
|
15
|
+
Keeps a draft using the exact source from prepare. Does not activate it.
|
|
16
|
+
list {repo?, query?, status?} (defaults to active in the current repository)
|
|
17
|
+
get {id, version?}
|
|
18
|
+
revise {id, expectedVersion, document} (creates a separate draft version)
|
|
19
|
+
save {id, expectedVersion, validation}
|
|
20
|
+
Only after the user reviews and asks to save. Describe the actual final
|
|
21
|
+
artifact and checks; keep a draft when these are missing.
|
|
22
|
+
Workspace policy may require human approval in Learnings.
|
|
23
|
+
use {id, version, repo?, agent, sessionId, inputs, requestId}
|
|
24
|
+
Returns steps and records a run. Check current prerequisites BEFORE
|
|
25
|
+
editing. The agent executes with its normal tools and permissions.
|
|
26
|
+
report {id, outcome, summary, prerequisiteChecks, checks, artifacts, adjustment?}
|
|
27
|
+
Outcomes: needs_input, completed, failed, unknown, stopped.
|
|
28
|
+
Each prerequisite: {prerequisite, result: passed|changed|unknown, detail}
|
|
29
|
+
Each check: {check, result: passed|failed|unknown, output}
|
|
30
|
+
decide {id, action: continue|stop, reason}
|
|
31
|
+
Record the user's explicit decision for a paused run; never infer it.
|
|
32
|
+
runs {id}
|
|
33
|
+
|
|
34
|
+
Document: {name, purpose, inputs: [{name, description, required}], steps: string[],
|
|
35
|
+
prerequisites: string[], checks: string[], stopConditions: string[]}
|
|
36
|
+
Draft variable task values (resource, fields, ordering) as inputs. Preserve actual
|
|
37
|
+
repository helper names, module paths, and contracts as prerequisites; replacing
|
|
38
|
+
a dependency requires a decision. Keep essential steps and durable constraints,
|
|
39
|
+
not incidental tool failures or the original task's chosen input values.
|
|
40
|
+
Aim for 3–7 essential steps. Every result check is REQUIRED for every supported
|
|
41
|
+
use. Put optional diagnostics in steps, not checks; reproducing the source
|
|
42
|
+
defect must not block new work with no prior defect.
|
|
43
|
+
Stop conditions must not contradict the inputs the approach supports.
|
|
44
|
+
Use the exact prerequisite/check text in reports. Missing evidence is unknown;
|
|
45
|
+
Guard authorization is not proof of execution. A one-run adjustment does not
|
|
46
|
+
change the shared approach. Request IDs are UUIDs; reuse them on uncertain retries.
|
|
47
|
+
Use source snapshots returned by prepare, never construct them yourself.
|
|
48
|
+
These commands use the current folder's existing Lore connection.
|
|
49
|
+
`;
|
|
50
|
+
export async function runApproachCommand(args, config) {
|
|
51
|
+
if (args.includes("--help") || args.includes("-h")) {
|
|
52
|
+
process.stdout.write(APPROACH_HELP);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const [operation, flag, path] = args;
|
|
56
|
+
if (!operation || flag !== "--input" || !path || args.length !== 3)
|
|
57
|
+
throw new Error("Usage: lore approach <operation> --input <JSON-file|->. See lore approach --help.");
|
|
58
|
+
if (!config)
|
|
59
|
+
throw new Error("Lore is not connected. Run lore connect --login.");
|
|
60
|
+
let raw = "";
|
|
61
|
+
if (path === "-") {
|
|
62
|
+
for await (const chunk of process.stdin) {
|
|
63
|
+
raw += String(chunk);
|
|
64
|
+
if (Buffer.byteLength(raw) > 256000)
|
|
65
|
+
throw new Error("Approach input is too large.");
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
const file = await open(path, constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
70
|
+
try {
|
|
71
|
+
const stat = await file.stat();
|
|
72
|
+
if (!stat.isFile() || stat.size > 256000)
|
|
73
|
+
throw new Error("Use a JSON file no larger than 256 KB.");
|
|
74
|
+
raw = await file.readFile("utf8");
|
|
75
|
+
}
|
|
76
|
+
finally {
|
|
77
|
+
await file.close();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const value = z.record(z.string(), z.unknown()).parse(JSON.parse(raw));
|
|
81
|
+
const client = new LoreClient({ baseUrl: config.apiUrl, headers: { authorization: `Bearer ${config.token}` } });
|
|
82
|
+
const repo = await repositoryScopeFromDirectory(process.cwd());
|
|
83
|
+
try {
|
|
84
|
+
process.stdout.write(`${JSON.stringify(await executeApproachCommand(client, operation, value, repo), null, 2)}\n`);
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
if (error instanceof SharedMemoryApiError)
|
|
88
|
+
throw new Error(`Lore approach ${operation} failed (HTTP ${error.status}). Check the source, current version, permissions, and workspace review policy. No success was confirmed.`);
|
|
89
|
+
throw error;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
export async function executeApproachCommand(client, operation, value, repo) {
|
|
93
|
+
const { id, ...input } = value;
|
|
94
|
+
const identity = () => z.uuid().parse(id);
|
|
95
|
+
switch (operation) {
|
|
96
|
+
case "prepare": {
|
|
97
|
+
const { externalSessionId, agent, ...request } = value;
|
|
98
|
+
if (externalSessionId) {
|
|
99
|
+
if (request.sessionId)
|
|
100
|
+
throw new Error("Choose sessionId or externalSessionId, not both.");
|
|
101
|
+
const sessions = await client.listSessions({ externalSessionId: z.string().parse(externalSessionId), ...(agent ? { agent: z.string().parse(agent) } : {}), limit: 2 });
|
|
102
|
+
if (sessions.sessions.length !== 1)
|
|
103
|
+
throw new Error("The source session is missing or ambiguous. Use a Lore session UUID or explicit notes.");
|
|
104
|
+
request.sessionId = sessions.sessions[0].id;
|
|
105
|
+
request.repo ??= sessions.sessions[0].repo ?? repo;
|
|
106
|
+
}
|
|
107
|
+
return client.prepareApproach({ repo, ...request });
|
|
108
|
+
}
|
|
109
|
+
case "draft": return client.createApproach({ repo, ...value });
|
|
110
|
+
case "list": return client.listApproaches({ repo, status: "active", ...value });
|
|
111
|
+
case "get": return client.getApproach(identity(), value.version === undefined ? undefined : z.number().int().positive().parse(value.version));
|
|
112
|
+
case "revise": return client.reviseApproach(identity(), input);
|
|
113
|
+
case "save": return client.saveApproach(identity(), input);
|
|
114
|
+
case "use": return client.startApproachRun(identity(), { repo, ...input });
|
|
115
|
+
case "report": return client.reportApproachRun(identity(), input);
|
|
116
|
+
case "decide": return client.decideApproachRun(identity(), input);
|
|
117
|
+
case "runs": return client.listApproachRuns(identity());
|
|
118
|
+
default: throw new Error("Unknown approach operation. See lore approach --help.");
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=approach.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approach.js","sourceRoot":"","sources":["../src/approach.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2C5B,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,IAAuB,EAAE,MAA8B;IAC9F,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QAAC,OAAO;IAAC,CAAC;IACpG,MAAM,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC;IACrC,IAAI,CAAC,SAAS,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,mFAAmF,CAAC,CAAC;IACzK,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;IAC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C,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,KAAK,EAAmD,CAAC,CAAC;QAC5H,KAAK,QAAQ,CAAC,CAAC,OAAO,MAAM,CAAC,iBAAiB,CAAC,QAAQ,EAAE,EAAE,KAAuD,CAAC,CAAC;QACpH,KAAK,QAAQ,CAAC,CAAC,OAAO,MAAM,CAAC,iBAAiB,CAAC,QAAQ,EAAE,EAAE,KAAuD,CAAC,CAAC;QACpH,KAAK,MAAM,CAAC,CAAC,OAAO,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,CAAC;QACxD,OAAO,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;IACpF,CAAC;AACH,CAAC"}
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAwD,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAMlH,OAAO,EAAgD,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AA0B/G,OAAO,EAwBL,KAAK,yBAAyB,EAC/B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAwD,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAMlH,OAAO,EAAgD,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AA0B/G,OAAO,EAwBL,KAAK,yBAAyB,EAC/B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,cAAc,CAAC;AAkCtB,eAAO,MAAM,oBAAoB,sBAAsB,CAAC;AACxD,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAC/D,eAAO,MAAM,4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import { readInvocationHealthWriteInput, runInvocationHealthWrite, } from "./invocation-health-writer.js";
|
|
24
24
|
import { runAskCommand } from "./ask.js";
|
|
25
25
|
import { runRememberCommand } from "./remember.js";
|
|
26
|
+
import { runApproachCommand } from "./approach.js";
|
|
26
27
|
import { runGuardCommand } from "./guard.js";
|
|
27
28
|
import { runContinueCommand, runResumeCommand } from "./handoff.js";
|
|
28
29
|
import { disableRecovery, prepareAutomaticRecovery, prepareRecoveryInstallation, runRecoveryCommand, runRecoveryHook, runWrappedAgent } from "./recovery.js";
|
|
@@ -1410,6 +1411,7 @@ async function installRuntime(paths) {
|
|
|
1410
1411
|
await Promise.all([
|
|
1411
1412
|
rm(paths.runtime, { force: true }),
|
|
1412
1413
|
rm(paths.runtimeRepository, { force: true }),
|
|
1414
|
+
rm(resolve(dirname(paths.runtime), "repository-address.js"), { force: true }),
|
|
1413
1415
|
rm(resolve(dirname(paths.runtime), "directory-policy.js"), { force: true }),
|
|
1414
1416
|
rm(paths.runtimeReliabilityStore, { force: true }),
|
|
1415
1417
|
rm(resolve(dirname(paths.runtime), "windows-permissions.js"), { force: true }),
|
|
@@ -1418,6 +1420,8 @@ async function installRuntime(paths) {
|
|
|
1418
1420
|
rm(resolve(dirname(paths.runtime), "guard-evaluation.js"), { force: true }),
|
|
1419
1421
|
rm(resolve(dirname(paths.runtime), "image-bytes.js"), { force: true }),
|
|
1420
1422
|
rm(resolve(dirname(paths.runtime), "image-capture.js"), { force: true }),
|
|
1423
|
+
rm(resolve(dirname(paths.runtime), "retained-context.js"), { force: true }),
|
|
1424
|
+
rm(resolve(dirname(paths.runtime), "approach-guidance.js"), { force: true }),
|
|
1421
1425
|
rm(paths.runtimeContextFallback, { force: true }),
|
|
1422
1426
|
rm(paths.runtimeInvocationHealthWriter, { force: true }),
|
|
1423
1427
|
rm(paths.runtimeVersion, { force: true }),
|
|
@@ -1449,7 +1453,10 @@ async function installRuntime(paths) {
|
|
|
1449
1453
|
"guard-evaluation.js": guardEvaluation,
|
|
1450
1454
|
"image-bytes.js": imageBytes,
|
|
1451
1455
|
"image-capture.js": imageCapture,
|
|
1456
|
+
"retained-context.js": await readFile(resolve(sourceDirectory, "retained-context.js"), "utf8"),
|
|
1457
|
+
"approach-guidance.js": await readFile(resolve(sourceDirectory, "approach-guidance.js"), "utf8"),
|
|
1452
1458
|
"repository.js": repository,
|
|
1459
|
+
"repository-address.js": await readFile(resolve(dirname(fileURLToPath(import.meta.resolve("@lore-co/core/repository-location"))), "repository-address.js"), "utf8"),
|
|
1453
1460
|
"directory-policy.js": (await readFile(fileURLToPath(import.meta.resolve("@lore-co/core/local-scope")), "utf8")).replaceAll("./repository-location.js", "./repository.js"),
|
|
1454
1461
|
"reliability-store.js": reliabilityStore,
|
|
1455
1462
|
"windows-permissions.js": await readFile(resolve(sourceDirectory, "windows-permissions.js"), "utf8"),
|
|
@@ -1473,7 +1480,10 @@ async function installRuntime(paths) {
|
|
|
1473
1480
|
atomicWrite(resolve(dirname(paths.runtime), "guard-evaluation.js"), guardEvaluation, 0o600),
|
|
1474
1481
|
atomicWrite(resolve(dirname(paths.runtime), "image-bytes.js"), imageBytes, 0o600),
|
|
1475
1482
|
atomicWrite(resolve(dirname(paths.runtime), "image-capture.js"), imageCapture, 0o600),
|
|
1483
|
+
atomicWrite(resolve(dirname(paths.runtime), "retained-context.js"), runtimeFiles["retained-context.js"], 0o600),
|
|
1484
|
+
atomicWrite(resolve(dirname(paths.runtime), "approach-guidance.js"), runtimeFiles["approach-guidance.js"], 0o600),
|
|
1476
1485
|
atomicWrite(paths.runtimeRepository, repository, 0o600),
|
|
1486
|
+
atomicWrite(resolve(dirname(paths.runtime), "repository-address.js"), runtimeFiles["repository-address.js"], 0o600),
|
|
1477
1487
|
atomicWrite(resolve(dirname(paths.runtime), "directory-policy.js"), runtimeFiles["directory-policy.js"], 0o600),
|
|
1478
1488
|
atomicWrite(paths.runtimeReliabilityStore, reliabilityStore, 0o600),
|
|
1479
1489
|
atomicWrite(resolve(dirname(paths.runtime), "windows-permissions.js"), runtimeFiles["windows-permissions.js"], 0o600),
|
|
@@ -2041,7 +2051,10 @@ async function inspectRuntimeInstallation(required, paths) {
|
|
|
2041
2051
|
"guard-evaluation.js": resolve(dirname(paths.runtime), "guard-evaluation.js"),
|
|
2042
2052
|
"image-bytes.js": resolve(dirname(paths.runtime), "image-bytes.js"),
|
|
2043
2053
|
"image-capture.js": resolve(dirname(paths.runtime), "image-capture.js"),
|
|
2054
|
+
"retained-context.js": resolve(dirname(paths.runtime), "retained-context.js"),
|
|
2055
|
+
"approach-guidance.js": resolve(dirname(paths.runtime), "approach-guidance.js"),
|
|
2044
2056
|
"repository.js": paths.runtimeRepository,
|
|
2057
|
+
"repository-address.js": resolve(dirname(paths.runtime), "repository-address.js"),
|
|
2045
2058
|
"directory-policy.js": resolve(dirname(paths.runtime), "directory-policy.js"),
|
|
2046
2059
|
"reliability-store.js": paths.runtimeReliabilityStore,
|
|
2047
2060
|
"windows-permissions.js": resolve(dirname(paths.runtime), "windows-permissions.js"),
|
|
@@ -2328,6 +2341,7 @@ export async function disconnectInstallation(paths = getLorePaths(), preservePen
|
|
|
2328
2341
|
rm(resolve(paths.loreDirectory, "connections"), { recursive: true, force: true }),
|
|
2329
2342
|
rm(paths.runtime, { force: true }),
|
|
2330
2343
|
rm(paths.runtimeRepository, { force: true }),
|
|
2344
|
+
rm(resolve(dirname(paths.runtime), "repository-address.js"), { force: true }),
|
|
2331
2345
|
rm(resolve(dirname(paths.runtime), "directory-policy.js"), { force: true }),
|
|
2332
2346
|
rm(paths.runtimeReliabilityStore, { force: true }),
|
|
2333
2347
|
rm(paths.runtimeSignedSnapshot, { force: true }),
|
|
@@ -2336,6 +2350,7 @@ export async function disconnectInstallation(paths = getLorePaths(), preservePen
|
|
|
2336
2350
|
rm(resolve(dirname(paths.runtime), "guard-evaluation.js"), { force: true }),
|
|
2337
2351
|
rm(resolve(dirname(paths.runtime), "image-bytes.js"), { force: true }),
|
|
2338
2352
|
rm(resolve(dirname(paths.runtime), "image-capture.js"), { force: true }),
|
|
2353
|
+
rm(resolve(dirname(paths.runtime), "retained-context.js"), { force: true }),
|
|
2339
2354
|
rm(paths.runtimeInvocationHealthWriter, { force: true }),
|
|
2340
2355
|
rm(paths.runtimeVersion, { force: true }),
|
|
2341
2356
|
rm(paths.runtimePackage, { force: true }),
|
|
@@ -2646,6 +2661,9 @@ async function printCommandHelp(path) {
|
|
|
2646
2661
|
case "remember":
|
|
2647
2662
|
await runRememberCommand(args, null);
|
|
2648
2663
|
return;
|
|
2664
|
+
case "approach":
|
|
2665
|
+
await runApproachCommand(args, null);
|
|
2666
|
+
return;
|
|
2649
2667
|
case "guard":
|
|
2650
2668
|
await runGuardCommand(args, null);
|
|
2651
2669
|
return;
|
|
@@ -2734,8 +2752,8 @@ async function executeCli(args = process.argv.slice(2)) {
|
|
|
2734
2752
|
return;
|
|
2735
2753
|
}
|
|
2736
2754
|
const commandArgs = args.slice(1);
|
|
2737
|
-
if (["ask", "remember", "share", "resume", "continue"].includes(command)) {
|
|
2738
|
-
const decision = await checkDirectory(process.cwd(), getLorePaths().home);
|
|
2755
|
+
if (["ask", "remember", "share", "resume", "continue", "approach"].includes(command)) {
|
|
2756
|
+
const decision = await checkDirectory(process.cwd(), getLorePaths(command === "approach" ? process.env.LORE_HOME : undefined).home);
|
|
2739
2757
|
if (!decision.allowed)
|
|
2740
2758
|
throw new Error(`Lore is off in this folder. ${decision.reason}`);
|
|
2741
2759
|
}
|
|
@@ -2777,6 +2795,9 @@ async function executeCli(args = process.argv.slice(2)) {
|
|
|
2777
2795
|
case "remember":
|
|
2778
2796
|
await runRememberCommand(commandArgs, await readConnectorConfig(getLorePaths(), process.cwd()));
|
|
2779
2797
|
return;
|
|
2798
|
+
case "approach":
|
|
2799
|
+
await runApproachCommand(commandArgs, await readConnectorConfig(getLorePaths(process.env.LORE_HOME), process.cwd()));
|
|
2800
|
+
return;
|
|
2780
2801
|
case "guard":
|
|
2781
2802
|
await runGuardCommand(commandArgs, await readConnectorConfig(getLorePaths(), process.cwd()));
|
|
2782
2803
|
return;
|