@lore-co/cli 0.1.3 → 0.1.4
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 +72 -24
- package/dist/cli.d.ts +11 -3
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +279 -78
- package/dist/cli.js.map +1 -1
- package/dist/demo.d.ts +1 -1
- package/dist/demo.d.ts.map +1 -1
- package/dist/generated-assets.d.ts +4 -3
- package/dist/generated-assets.d.ts.map +1 -1
- package/dist/generated-assets.js +4 -3
- package/dist/generated-assets.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/runtime.d.ts +7 -5
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +12 -7
- package/dist/runtime.js.map +1 -1
- package/dist/self-host.d.ts +7 -0
- package/dist/self-host.d.ts.map +1 -0
- package/dist/self-host.js +981 -0
- package/dist/self-host.js.map +1 -0
- package/dist/update.js +3 -3
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# Lore CLI
|
|
2
2
|
|
|
3
|
-
The Lore connector installs native Codex and Claude Code lifecycle hooks
|
|
4
|
-
each supported prompt, Lore attempts to retrieve
|
|
5
|
-
A first prompt is observed on its own; later
|
|
6
|
-
previous assistant response when valid pending
|
|
7
|
-
network failures fail open so they do not
|
|
3
|
+
The Lore connector installs native Codex and Claude Code lifecycle hooks and
|
|
4
|
+
the Lore OpenCode plugin. For each supported prompt, Lore attempts to retrieve
|
|
5
|
+
relevant engineering context. A first prompt is observed on its own; later
|
|
6
|
+
prompts are paired with the previous assistant response when valid pending
|
|
7
|
+
state is available. Integration and network failures fail open so they do not
|
|
8
|
+
block the agent.
|
|
8
9
|
|
|
9
10
|
## Install and connect
|
|
10
11
|
|
|
@@ -15,21 +16,32 @@ lore connect \
|
|
|
15
16
|
--url https://lore.example.com \
|
|
16
17
|
--token "$LORE_WORKSPACE_TOKEN" \
|
|
17
18
|
--agent claude \
|
|
18
|
-
--agent codex
|
|
19
|
+
--agent codex \
|
|
20
|
+
--agent opencode
|
|
19
21
|
|
|
20
22
|
lore doctor
|
|
21
23
|
```
|
|
22
24
|
|
|
23
25
|
The package requires Node.js 22 or newer and installs the `lore` command.
|
|
24
26
|
|
|
25
|
-
`connect` auto-detects `codex` and `
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
`connect` auto-detects the `codex`, `claude`, and `opencode` executables and an
|
|
28
|
+
existing `~/.config/opencode/opencode.json`. Repeat `--agent claude`,
|
|
29
|
+
`--agent codex`, or `--agent opencode` for an explicit headless install.
|
|
30
|
+
Configuration is stored in `~/.lore/config.json` with mode `0600`.
|
|
31
|
+
Before writing that file or any agent integration, `connect` calls the
|
|
32
|
+
authenticated workspace identity endpoint and validates the strict response
|
|
33
|
+
and server version. Revoked credentials, unreachable servers, timeouts, and
|
|
34
|
+
incompatible servers leave local configuration untouched. Either
|
|
35
|
+
`LORE_WORKSPACE_TOKEN` or the legacy `LORE_TOKEN` can provide the token; if
|
|
36
|
+
both are set, they must match.
|
|
37
|
+
For a review-first rollout in a personal vault or component catalog, follow the
|
|
38
|
+
[OpenCode pilot runbook](../../docs/opencode-pilot.md).
|
|
28
39
|
|
|
29
40
|
The command merges Lore-owned entries into `~/.codex/hooks.json` and
|
|
30
|
-
`~/.claude/settings.json
|
|
31
|
-
|
|
32
|
-
|
|
41
|
+
`~/.claude/settings.json`, and merges `@lore-co/opencode` into the
|
|
42
|
+
`plugin` array in `~/.config/opencode/opencode.json`. Existing settings, hooks,
|
|
43
|
+
keys, and plugins are retained. Changed agent config files receive timestamped
|
|
44
|
+
backups, and rerunning `connect` does not duplicate entries or backups.
|
|
33
45
|
|
|
34
46
|
## Inspect or remove
|
|
35
47
|
|
|
@@ -39,14 +51,43 @@ lore doctor
|
|
|
39
51
|
lore disconnect
|
|
40
52
|
```
|
|
41
53
|
|
|
42
|
-
The three commands above also support `--json`. `
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
54
|
+
The three commands above also support `--json`. `doctor` checks public
|
|
55
|
+
`/health/ready` separately from authenticated workspace identity so unreachable,
|
|
56
|
+
unready, and unauthorized states remain distinct. `disconnect` removes only hook
|
|
57
|
+
handlers marked as Lore-owned and Lore's OpenCode plugin entry, then deletes
|
|
58
|
+
Lore's credential, legacy hook runtime, pending state, and retry queue. It does
|
|
59
|
+
not remove the installed `lore` binary or restore a whole backup over newer
|
|
60
|
+
agent settings.
|
|
61
|
+
|
|
62
|
+
## One-command self-hosting
|
|
63
|
+
|
|
64
|
+
The published CLI embeds the canonical production Compose asset, so no
|
|
65
|
+
repository clone is needed:
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
lore self-host up
|
|
69
|
+
lore self-host status --json
|
|
70
|
+
lore self-host reset-owner-password --email owner@example.com
|
|
71
|
+
lore self-host down
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
`up` creates `~/.lore/self-host` with mode `0700` and stores its Compose,
|
|
75
|
+
environment, and state files with mode `0600`. It generates independent
|
|
76
|
+
PostgreSQL, workspace, and owner-bootstrap secrets, starts semver-pinned images,
|
|
77
|
+
waits for `/health/ready`, and prints the setup URL and owner bootstrap token.
|
|
78
|
+
The bootstrap token is printed only by the first successful `up`; retries reuse
|
|
79
|
+
all state and secrets. Use `--headless`, `--state-dir`, `--image-tag`,
|
|
80
|
+
`--api-port`, `--dashboard-port`, `--origin`, `--organization`, and `--name`
|
|
81
|
+
for automated deployments. Every command has subcommand-specific `--help`, and
|
|
82
|
+
`up`, `down`, and `status` support `--json`.
|
|
83
|
+
|
|
84
|
+
`down` preserves the PostgreSQL volume. Destructive removal requires both
|
|
85
|
+
`--volumes --yes`. Password reset links are printed once or can be written to a
|
|
86
|
+
new mode-`0600` file with `--output`.
|
|
46
87
|
|
|
47
88
|
## Runtime behavior
|
|
48
89
|
|
|
49
|
-
The hook handler:
|
|
90
|
+
The Claude/Codex command-hook handler:
|
|
50
91
|
|
|
51
92
|
- reads native hook JSON from standard input;
|
|
52
93
|
- observes and enriches the first prompt in a new session;
|
|
@@ -58,12 +99,19 @@ The hook handler:
|
|
|
58
99
|
|
|
59
100
|
First prompts use `POST /v1/observations` and audited
|
|
60
101
|
`POST /v1/context/deliveries`. Paired turns use `POST /v1/turns` with a
|
|
61
|
-
workspace bearer token and an `Idempotency-Key` header.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
102
|
+
workspace bearer token and an `Idempotency-Key` header. Automatic teachings
|
|
103
|
+
default to repository scope and follow the workspace learning policy. In
|
|
104
|
+
`proposal_only` mode, every automatic capture remains proposed and cannot be
|
|
105
|
+
retrieved or injected until dashboard review activates it. Rejected,
|
|
106
|
+
suppressed, superseded, and deleted learnings are also excluded. Dirty files
|
|
107
|
+
and the current directory remain task relevance evidence and do not narrow
|
|
108
|
+
every learning. A reconciled correction inherits its target's scope. Only an
|
|
109
|
+
explicit correction with clear team-, company-, organization-, or
|
|
110
|
+
all-repositories evidence may become organization-only and apply across
|
|
111
|
+
repositories. Native retrieval still requires a strong lexical, structural,
|
|
112
|
+
symbol, or semantic match. Observations, paired turns, OpenCode plugin events,
|
|
113
|
+
and deliveries are visible through Lore activity. OpenCode uses its plugin
|
|
114
|
+
lifecycle and never runs through the Claude/Codex command-hook parser.
|
|
67
115
|
|
|
68
116
|
## External hosts
|
|
69
117
|
|
|
@@ -163,7 +211,7 @@ same-repository, non-draft pull requests bearing the corresponding
|
|
|
163
211
|
`lore:codex-review` or `lore:devin-review` label.
|
|
164
212
|
|
|
165
213
|
Generated jobs require a published standalone binary release and default to
|
|
166
|
-
`treadiehq/lore` at `v0.1.
|
|
214
|
+
`treadiehq/lore` at `v0.1.4`. Set `LORE_CLI_REPOSITORY` to the publicly
|
|
167
215
|
readable `owner/repository` and `LORE_CLI_VERSION` to an existing release tag
|
|
168
216
|
when using another release source.
|
|
169
217
|
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { type
|
|
2
|
+
import { type CommandHookAgentName } from "./runtime.js";
|
|
3
|
+
export declare const LORE_OPENCODE_PLUGIN = "@lore-co/opencode";
|
|
4
|
+
declare const CONFIGURED_AGENT_NAMES: readonly ["claude", "codex", "opencode"];
|
|
5
|
+
export type ConfiguredAgentName = (typeof CONFIGURED_AGENT_NAMES)[number];
|
|
3
6
|
export interface LorePaths {
|
|
4
7
|
home: string;
|
|
5
8
|
loreDirectory: string;
|
|
@@ -11,19 +14,24 @@ export interface LorePaths {
|
|
|
11
14
|
queue: string;
|
|
12
15
|
codexHooks: string;
|
|
13
16
|
claudeSettings: string;
|
|
17
|
+
openCodeConfig: string;
|
|
14
18
|
}
|
|
15
19
|
export interface ConnectorConfig {
|
|
16
20
|
version: 1;
|
|
17
21
|
apiUrl: string;
|
|
18
22
|
dashboardUrl?: string;
|
|
19
23
|
token: string;
|
|
20
|
-
agents:
|
|
24
|
+
agents: ConfiguredAgentName[];
|
|
21
25
|
connectedAt: string;
|
|
22
26
|
timeoutMs: number;
|
|
23
27
|
}
|
|
24
28
|
export declare function getLorePaths(home?: string): LorePaths;
|
|
25
|
-
export declare function mergeLoreHooks(input: Record<string, unknown>, agent:
|
|
29
|
+
export declare function mergeLoreHooks(input: Record<string, unknown>, agent: CommandHookAgentName, paths: LorePaths): Record<string, unknown>;
|
|
26
30
|
export declare function removeLoreHooks(input: Record<string, unknown>): Record<string, unknown>;
|
|
27
31
|
export declare function countLoreHooks(input: Record<string, unknown>): number;
|
|
32
|
+
export declare function mergeLoreOpenCodePlugin(input: Record<string, unknown>): Record<string, unknown>;
|
|
33
|
+
export declare function removeLoreOpenCodePlugin(input: Record<string, unknown>): Record<string, unknown>;
|
|
34
|
+
export declare function countLoreOpenCodePlugins(input: Record<string, unknown>): number;
|
|
28
35
|
export declare function runCli(args?: readonly string[]): Promise<void>;
|
|
36
|
+
export {};
|
|
29
37
|
//# sourceMappingURL=cli.d.ts.map
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAuBA,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,cAAc,CAAC;AAUtB,eAAO,MAAM,oBAAoB,sBAAsB,CAAC;AACxD,QAAA,MAAM,sBAAsB,0CAA2C,CAAC;AACxE,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAI1E,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,CAAC,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,mBAAmB,EAAE,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAmID,wBAAgB,YAAY,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAqBrD;AAuED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,KAAK,EAAE,oBAAoB,EAC3B,KAAK,EAAE,SAAS,GACf,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiBzB;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAsBzB;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAiBrE;AASD,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAazB;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAczB;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,MAAM,CAIR;AAu1BD,wBAAsB,MAAM,CAC1B,IAAI,GAAE,SAAS,MAAM,EAA0B,GAC9C,OAAO,CAAC,IAAI,CAAC,CAuDf"}
|