@lore-co/cli 0.2.28 → 0.2.30
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 +6 -5
- package/dist/approach-guidance.d.ts +2 -2
- package/dist/approach-guidance.d.ts.map +1 -1
- package/dist/approach-guidance.js +8 -8
- package/dist/approach-guidance.js.map +1 -1
- package/dist/approach.d.ts +1 -1
- package/dist/approach.d.ts.map +1 -1
- package/dist/approach.js +18 -12
- package/dist/approach.js.map +1 -1
- package/dist/cli.js +8 -4
- package/dist/cli.js.map +1 -1
- package/dist/command-help.d.ts +6 -3
- package/dist/command-help.d.ts.map +1 -1
- package/dist/command-help.js +40 -7
- package/dist/command-help.js.map +1 -1
- package/dist/generated-assets.d.ts +8 -8
- package/dist/generated-assets.d.ts.map +1 -1
- package/dist/generated-assets.js +8 -8
- package/dist/generated-assets.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 +4 -4
package/README.md
CHANGED
|
@@ -65,8 +65,9 @@ requirements, permissions, and hook approval still apply.
|
|
|
65
65
|
|
|
66
66
|
## Find the right command
|
|
67
67
|
|
|
68
|
-
Run `lore help` for
|
|
69
|
-
|
|
68
|
+
Run `lore help` for everyday commands, `lore help --all` for every command,
|
|
69
|
+
`lore help <command>` for its use case, options and examples, or
|
|
70
|
+
`lore help self-host up` for a subcommand.
|
|
70
71
|
`lore <command> --help` works too. Help does not require a workspace connection.
|
|
71
72
|
|
|
72
73
|
Use `ask` to find existing knowledge, `remember` to save a reusable lesson,
|
|
@@ -426,7 +427,7 @@ content-free `guard_check` audit event.
|
|
|
426
427
|
|
|
427
428
|
```sh
|
|
428
429
|
lore update
|
|
429
|
-
lore update --version v0.2.
|
|
430
|
+
lore update --version v0.2.30
|
|
430
431
|
```
|
|
431
432
|
|
|
432
433
|
`update` resolves the latest release to an exact tag, or uses the exact
|
|
@@ -449,7 +450,7 @@ receive timestamped backups, and customer-edited skill files are preserved with
|
|
|
449
450
|
a warning. The report is by agent and lists only what you need to do:
|
|
450
451
|
|
|
451
452
|
```text
|
|
452
|
-
✓ Lore 0.2.
|
|
453
|
+
✓ Lore 0.2.30 is installed
|
|
453
454
|
✓ Updated Lore for Claude Code and Codex
|
|
454
455
|
|
|
455
456
|
Next
|
|
@@ -822,7 +823,7 @@ same-repository, non-draft pull requests bearing the corresponding
|
|
|
822
823
|
`lore:codex-review` or `lore:devin-review` label.
|
|
823
824
|
|
|
824
825
|
Generated jobs require a published standalone binary release and default to
|
|
825
|
-
`treadiehq/lore-releases` at `v0.2.
|
|
826
|
+
`treadiehq/lore-releases` at `v0.2.30`. Set `LORE_CLI_REPOSITORY` to the publicly
|
|
826
827
|
readable `owner/repository` and `LORE_CLI_VERSION` to an existing release tag
|
|
827
828
|
when using another release source.
|
|
828
829
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/** A request to save the current work as a reusable
|
|
1
|
+
/** A request to save the current work as a reusable runbook starts the save workflow. */
|
|
2
2
|
export declare function approachWorkflowRequested(prompt: string): boolean;
|
|
3
3
|
/**
|
|
4
|
-
* `workflowStarted` is true once this session asked to save
|
|
4
|
+
* `workflowStarted` is true once this session asked to save a runbook, so a
|
|
5
5
|
* continuation such as "go ahead and save it" after compaction still gets the
|
|
6
6
|
* detailed instructions back.
|
|
7
7
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approach-guidance.d.ts","sourceRoot":"","sources":["../src/approach-guidance.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"approach-guidance.d.ts","sourceRoot":"","sources":["../src/approach-guidance.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEjE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,GAAE,SAAS,MAAM,EAAO,EAAE,eAAe,UAAQ,GAAG,MAAM,GAAG,SAAS,CAmBhK"}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/** A request to save the current work as a reusable
|
|
1
|
+
/** A request to save the current work as a reusable runbook starts the save workflow. */
|
|
2
2
|
export function approachWorkflowRequested(prompt) {
|
|
3
|
-
return /\bmake (?:this|that|it|the work) repeatable\b|\b(?:saved|reusable) approach\b/iu.test(prompt);
|
|
3
|
+
return /\bmake (?:this|that|it|the work) repeatable\b|\bmake (?:a|(?:this|that|it) (?:into )?a) runbook\b|\b(?:save|turn) (?:this|that|it) (?:as|into) a runbook\b|\b(?:saved|reusable) (?:approach|runbook)\b/iu.test(prompt);
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
|
-
* `workflowStarted` is true once this session asked to save
|
|
6
|
+
* `workflowStarted` is true once this session asked to save a runbook, so a
|
|
7
7
|
* continuation such as "go ahead and save it" after compaction still gets the
|
|
8
8
|
* detailed instructions back.
|
|
9
9
|
*/
|
|
10
10
|
export function approachGuidance(prompt, agent, sessionId, retained = [], workflowStarted = false) {
|
|
11
11
|
// A capability cue lets the agent recognize ordinary requests itself. Reuse
|
|
12
12
|
// must not depend on the user knowing a feature name or a trigger phrase.
|
|
13
|
-
const discovery = `Lore can save and reuse reviewed
|
|
13
|
+
const discovery = `Lore can save and reuse reviewed runbooks in Learnings (its tools and API call them approaches). If the user asks to repeat earlier work or do it the way it was done before, list active runbooks in this repository and choose by the task, without requiring an exact name. Prefer the Lore MCP tools when your host offers them (search_approaches, get_approach, use_approach, report_approach_run, decide_approach_run); they record the run without a shell command. Otherwise run \`lore runbook --help\` and pass each request through \`--input <file>\` from a temporary JSON file; never pipe runbook JSON inline or put its free-text values on the command line. 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 })}.`;
|
|
14
14
|
const detailed = workflowStarted || approachWorkflowRequested(prompt);
|
|
15
|
-
const instructions = ["Prefer the Lore MCP
|
|
15
|
+
const instructions = ["Prefer the Lore MCP runbook tools when your host offers them; prepare_approach, draft_approach, and save_approach carry the same contract as the CLI operations. Otherwise run `lore runbook --help` for the JSON command contract, write each request to a temporary JSON file, and pass its path with `--input`; do not pipe the JSON inline, so summaries, notes, and other free text stay off the command line. Both paths use this folder's existing connection.",
|
|
16
16
|
`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.`,
|
|
17
17
|
"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. Agent saves are proposals and need owner or admin approval in Learnings before reuse.",
|
|
18
|
-
"For sources: when a correction in the session was already captured as an active learning in this repository, pass its id in learningIds and cite it from the step, prerequisite, check, or stop condition it supports. Pass further captured sessions in sessionIds. Cite only ids that prepare returned under sources. Do not create learnings while saving
|
|
18
|
+
"For sources: when a correction in the session was already captured as an active learning in this repository, pass its id in learningIds and cite it from the step, prerequisite, check, or stop condition it supports. Pass further captured sessions in sessionIds. Cite only ids that prepare returned under sources. Do not create learnings while saving a runbook; an uncaptured correction stays an uncited item for the reviewer.",
|
|
19
19
|
"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.",
|
|
20
20
|
"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.",
|
|
21
|
-
"For reuse: list active
|
|
21
|
+
"For reuse: list active runbooks 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 runbook is a separate reviewed revision.",
|
|
22
22
|
].join("\n");
|
|
23
23
|
// Confirm each complete part in the host's current context. New workflow
|
|
24
24
|
// instructions still go out after discovery; compaction restores both, and
|
|
25
|
-
// the instructions too once the session has started saving
|
|
25
|
+
// the instructions too once the session has started saving a runbook.
|
|
26
26
|
return [discovery, ...(detailed ? [instructions] : [])]
|
|
27
27
|
.filter(part => !retained.some(text => text.includes(part)))
|
|
28
28
|
.join("\n\n") || undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approach-guidance.js","sourceRoot":"","sources":["../src/approach-guidance.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"approach-guidance.js","sourceRoot":"","sources":["../src/approach-guidance.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,MAAM,UAAU,yBAAyB,CAAC,MAAc;IACtD,OAAO,0MAA0M,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACjO,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAc,EAAE,KAAa,EAAE,SAAiB,EAAE,WAA8B,EAAE,EAAE,eAAe,GAAG,KAAK;IAC1I,4EAA4E;IAC5E,0EAA0E;IAC1E,MAAM,SAAS,GAAG,w2BAAw2B,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC;IACl6B,MAAM,QAAQ,GAAG,eAAe,IAAI,yBAAyB,CAAC,MAAM,CAAC,CAAC;IACtE,MAAM,YAAY,GAAG,CAAC,ucAAuc;QAC3d,oIAAoI,IAAI,CAAC,SAAS,CAAC,EAAE,iBAAiB,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,kJAAkJ;QAC7U,kUAAkU;QAClU,0aAA0a;QAC1a,irBAAirB;QACjrB,4QAA4Q;QAC5Q,6hBAA6hB;KAC9hB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACb,yEAAyE;IACzE,2EAA2E;IAC3E,sEAAsE;IACtE,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"}
|
package/dist/approach.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LoreClient } from "@lore-co/sdk";
|
|
2
2
|
import type { ConnectorConfig } from "./cli.js";
|
|
3
|
-
export declare const APPROACH_HELP = "lore
|
|
3
|
+
export declare const APPROACH_HELP = "lore runbook \u2014 save and reuse a reviewed runbook\n\nUsage: lore runbook <operation> --input <JSON-file|->\n (lore approach is the same command; runbooks were called approaches)\n\nWrite the request to a temporary JSON file and pass its path. Standard input (-)\nis for programs that pipe JSON; an agent should not put runbook JSON or its\nfree-text values on the command line. Hosts that offer the Lore MCP tools\n(search_approaches, get_approach, prepare_approach, use_approach,\nreport_approach_run, decide_approach_run) record the same operations without a\nshell command; prefer them when available.\n\nOperations (JSON response):\n prepare {repo?, scope?, sessionId?, externalSessionId?, agent?, sessionIds?, learningIds?, notes?, task?}\n Reads captured source work. sessionId is Lore's UUID; externalSessionId\n resolves the current native agent session. sessionIds adds further\n captured sessions (10 at most) and learningIds adds active learnings\n from the same repository (50 at most). Pass notes for missing work.\n The response lists every source under \"sources\" with its current state.\n scope \"workspace\" makes a runbook for the whole workspace, such as a\n release or incident runbook: sources may come from any repository\n where Lore is on, and an owner or admin approves it.\n draft {repo?, scope?, 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 Submits for owner or admin approval in Learnings before reuse.\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[],\n stopAtSteps?: [{condition, step}] (a stop condition about one step),\n citations?: [{field: steps|prerequisites|checks|stopConditions, index,\n sources: [{kind: session|learning, id}]}]}\nCite the learning or session an item rests on; cite only ids from prepare's\nsources. Items without a citation are allowed and are shown as unsupported for\nreview. Citing never creates a learning: capture a missing correction separately.\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 runbook supports.\nUse the exact prerequisite/check text in reports. Missing evidence is unknown;\nGuard authorization is not proof of execution. Describe any step you changed in\nthe report's adjustment; reviewers are offered it for the next version, and the\nshared runbook changes only when they approve one. 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
4
|
export declare function runApproachCommand(args: readonly string[], config: ConnectorConfig | null): Promise<void>;
|
|
5
5
|
export declare function executeApproachCommand(client: LoreClient, operation: string, value: Record<string, unknown>, repo: string): Promise<unknown>;
|
|
6
6
|
//# sourceMappingURL=approach.d.ts.map
|
package/dist/approach.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approach.d.ts","sourceRoot":"","sources":["../src/approach.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAwB,MAAM,cAAc,CAAC;AAEhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAIhD,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"approach.d.ts","sourceRoot":"","sources":["../src/approach.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAwB,MAAM,cAAc,CAAC;AAEhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAIhD,eAAO,MAAM,aAAa,61IAgEzB,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
CHANGED
|
@@ -3,25 +3,29 @@ import { LoreClient, SharedMemoryApiError } from "@lore-co/sdk";
|
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { repositoryScopeFromDirectory } from "@lore-co/core/repository-location";
|
|
5
5
|
import { openNoFollow } from "@lore-co/core/no-follow";
|
|
6
|
-
export const APPROACH_HELP = `lore
|
|
6
|
+
export const APPROACH_HELP = `lore runbook — save and reuse a reviewed runbook
|
|
7
7
|
|
|
8
|
-
Usage: lore
|
|
8
|
+
Usage: lore runbook <operation> --input <JSON-file|->
|
|
9
|
+
(lore approach is the same command; runbooks were called approaches)
|
|
9
10
|
|
|
10
11
|
Write the request to a temporary JSON file and pass its path. Standard input (-)
|
|
11
|
-
is for programs that pipe JSON; an agent should not put
|
|
12
|
+
is for programs that pipe JSON; an agent should not put runbook JSON or its
|
|
12
13
|
free-text values on the command line. Hosts that offer the Lore MCP tools
|
|
13
14
|
(search_approaches, get_approach, prepare_approach, use_approach,
|
|
14
15
|
report_approach_run, decide_approach_run) record the same operations without a
|
|
15
16
|
shell command; prefer them when available.
|
|
16
17
|
|
|
17
18
|
Operations (JSON response):
|
|
18
|
-
prepare {repo?, sessionId?, externalSessionId?, agent?, sessionIds?, learningIds?, notes?, task?}
|
|
19
|
+
prepare {repo?, scope?, sessionId?, externalSessionId?, agent?, sessionIds?, learningIds?, notes?, task?}
|
|
19
20
|
Reads captured source work. sessionId is Lore's UUID; externalSessionId
|
|
20
21
|
resolves the current native agent session. sessionIds adds further
|
|
21
22
|
captured sessions (10 at most) and learningIds adds active learnings
|
|
22
23
|
from the same repository (50 at most). Pass notes for missing work.
|
|
23
24
|
The response lists every source under "sources" with its current state.
|
|
24
|
-
|
|
25
|
+
scope "workspace" makes a runbook for the whole workspace, such as a
|
|
26
|
+
release or incident runbook: sources may come from any repository
|
|
27
|
+
where Lore is on, and an owner or admin approves it.
|
|
28
|
+
draft {repo?, scope?, document, source, agent, requestId}
|
|
25
29
|
Keeps a draft using the exact source from prepare. Does not activate it.
|
|
26
30
|
list {repo?, query?, status?} (defaults to active in the current repository)
|
|
27
31
|
get {id, version?}
|
|
@@ -43,6 +47,7 @@ Operations (JSON response):
|
|
|
43
47
|
|
|
44
48
|
Document: {name, purpose, inputs: [{name, description, required}], steps: string[],
|
|
45
49
|
prerequisites: string[], checks: string[], stopConditions: string[],
|
|
50
|
+
stopAtSteps?: [{condition, step}] (a stop condition about one step),
|
|
46
51
|
citations?: [{field: steps|prerequisites|checks|stopConditions, index,
|
|
47
52
|
sources: [{kind: session|learning, id}]}]}
|
|
48
53
|
Cite the learning or session an item rests on; cite only ids from prepare's
|
|
@@ -55,10 +60,11 @@ not incidental tool failures or the original task's chosen input values.
|
|
|
55
60
|
Aim for 3–7 essential steps. Every result check is REQUIRED for every supported
|
|
56
61
|
use. Put optional diagnostics in steps, not checks; reproducing the source
|
|
57
62
|
defect must not block new work with no prior defect.
|
|
58
|
-
Stop conditions must not contradict the inputs the
|
|
63
|
+
Stop conditions must not contradict the inputs the runbook supports.
|
|
59
64
|
Use the exact prerequisite/check text in reports. Missing evidence is unknown;
|
|
60
|
-
Guard authorization is not proof of execution.
|
|
61
|
-
|
|
65
|
+
Guard authorization is not proof of execution. Describe any step you changed in
|
|
66
|
+
the report's adjustment; reviewers are offered it for the next version, and the
|
|
67
|
+
shared runbook changes only when they approve one. Request IDs are UUIDs; reuse them on uncertain retries.
|
|
62
68
|
Use source snapshots returned by prepare, never construct them yourself.
|
|
63
69
|
These commands use the current folder's existing Lore connection.
|
|
64
70
|
`;
|
|
@@ -69,7 +75,7 @@ export async function runApproachCommand(args, config) {
|
|
|
69
75
|
}
|
|
70
76
|
const [operation, flag, path] = args;
|
|
71
77
|
if (!operation || flag !== "--input" || !path || args.length !== 3)
|
|
72
|
-
throw new Error("Usage: lore
|
|
78
|
+
throw new Error("Usage: lore runbook <operation> --input <JSON-file|->. See lore runbook --help.");
|
|
73
79
|
if (!config)
|
|
74
80
|
throw new Error("Lore is not connected. Run lore connect --login.");
|
|
75
81
|
let raw = "";
|
|
@@ -77,7 +83,7 @@ export async function runApproachCommand(args, config) {
|
|
|
77
83
|
for await (const chunk of process.stdin) {
|
|
78
84
|
raw += String(chunk);
|
|
79
85
|
if (Buffer.byteLength(raw) > 256000)
|
|
80
|
-
throw new Error("
|
|
86
|
+
throw new Error("Runbook input is too large.");
|
|
81
87
|
}
|
|
82
88
|
}
|
|
83
89
|
else {
|
|
@@ -100,7 +106,7 @@ export async function runApproachCommand(args, config) {
|
|
|
100
106
|
}
|
|
101
107
|
catch (error) {
|
|
102
108
|
if (error instanceof SharedMemoryApiError)
|
|
103
|
-
throw new Error(`Lore
|
|
109
|
+
throw new Error(`Lore runbook ${operation} failed (HTTP ${error.status}). Check the source, current version, permissions, and workspace review policy. No success was confirmed.`);
|
|
104
110
|
throw error;
|
|
105
111
|
}
|
|
106
112
|
}
|
|
@@ -130,7 +136,7 @@ export async function executeApproachCommand(client, operation, value, repo) {
|
|
|
130
136
|
case "report": return client.reportApproachRun(identity(), input);
|
|
131
137
|
case "decide": return client.decideApproachRun(identity(), input);
|
|
132
138
|
case "runs": return client.listApproachRuns(identity());
|
|
133
|
-
default: throw new Error("Unknown
|
|
139
|
+
default: throw new Error("Unknown runbook operation. See lore runbook --help.");
|
|
134
140
|
}
|
|
135
141
|
}
|
|
136
142
|
//# sourceMappingURL=approach.js.map
|
package/dist/approach.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approach.js","sourceRoot":"","sources":["../src/approach.ts"],"names":[],"mappings":"AAAA,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;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,MAAM,CAAC,MAAM,aAAa,GAAG
|
|
1
|
+
{"version":3,"file":"approach.js","sourceRoot":"","sources":["../src/approach.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,UA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,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IAClF,CAAC;AACH,CAAC"}
|
package/dist/cli.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { parseDirectoryRules, checkDirectory, checkDirectoryRules, checkLoreAccess, checkWorkspaceRepository, capturePauseMessage, LORE_DISABLED_MESSAGE, loreDisabled } from "./directory-policy.js";
|
|
3
3
|
import { reportCommand, runTelemetryCommand, telemetryEnabled, trackedCommand, TELEMETRY_HELP } from "./telemetry.js";
|
|
4
4
|
import { secureWindowsDirectory, windowsPermissionsArePrivate } from "./windows-permissions.js";
|
|
5
|
-
import { COMMAND_GUIDES, ROOT_HELP, helpTopic } from "./command-help.js";
|
|
5
|
+
import { ALL_HELP, COMMAND_GUIDES, ROOT_HELP, helpTopic } from "./command-help.js";
|
|
6
6
|
import { runShareCommand } from "./share.js";
|
|
7
7
|
import { resolveConnectProject, validateConnectProjectOptions } from "./connect-project.js";
|
|
8
8
|
import { captureDirectories } from "./capture-scope.js";
|
|
@@ -3914,7 +3914,7 @@ async function printCommandHelp(path) {
|
|
|
3914
3914
|
case "drafts":
|
|
3915
3915
|
await runDraftsCommand(args, null);
|
|
3916
3916
|
return;
|
|
3917
|
-
case "
|
|
3917
|
+
case "runbook":
|
|
3918
3918
|
await runApproachCommand(args, null);
|
|
3919
3919
|
return;
|
|
3920
3920
|
case "skill":
|
|
@@ -3987,6 +3987,8 @@ async function executeCli(args = process.argv.slice(2)) {
|
|
|
3987
3987
|
const path = args.slice(1);
|
|
3988
3988
|
if (!path.length || (path.length === 1 && ["--help", "-h"].includes(path[0])))
|
|
3989
3989
|
process.stdout.write(ROOT_HELP);
|
|
3990
|
+
else if (path.length === 1 && path[0] === "--all")
|
|
3991
|
+
process.stdout.write(ALL_HELP);
|
|
3990
3992
|
else
|
|
3991
3993
|
await printCommandHelp(path);
|
|
3992
3994
|
return;
|
|
@@ -4008,8 +4010,8 @@ async function executeCli(args = process.argv.slice(2)) {
|
|
|
4008
4010
|
return;
|
|
4009
4011
|
}
|
|
4010
4012
|
const commandArgs = args.slice(1);
|
|
4011
|
-
if (["ask", "chat", "learnings", "review", "remember", "drafts", "share", "resume", "continue", "approach", "skill"].includes(command) && !(command === "skill" && commandArgs[0] === "discover")) {
|
|
4012
|
-
const decision = await checkDirectory(process.cwd(), getLorePaths(["approach", "skill"].includes(command) ? process.env.LORE_HOME : undefined).home);
|
|
4013
|
+
if (["ask", "chat", "learnings", "review", "remember", "drafts", "share", "resume", "continue", "approach", "runbook", "skill"].includes(command) && !(command === "skill" && commandArgs[0] === "discover")) {
|
|
4014
|
+
const decision = await checkDirectory(process.cwd(), getLorePaths(["approach", "runbook", "skill"].includes(command) ? process.env.LORE_HOME : undefined).home);
|
|
4013
4015
|
if (!decision.allowed)
|
|
4014
4016
|
throw new Error(`Lore is off in this folder. ${decision.reason}`);
|
|
4015
4017
|
}
|
|
@@ -4066,7 +4068,9 @@ async function executeCli(args = process.argv.slice(2)) {
|
|
|
4066
4068
|
case "drafts":
|
|
4067
4069
|
await runDraftsCommand(commandArgs, await readConnectorConfig(getLorePaths(), process.cwd()));
|
|
4068
4070
|
return;
|
|
4071
|
+
// Runbooks were called approaches; both commands stay.
|
|
4069
4072
|
case "approach":
|
|
4073
|
+
case "runbook":
|
|
4070
4074
|
await runApproachCommand(commandArgs, await readConnectorConfig(getLorePaths(process.env.LORE_HOME), process.cwd()));
|
|
4071
4075
|
return;
|
|
4072
4076
|
case "skill":
|