@lore-co/cli 0.1.9 → 0.1.11

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
@@ -1,11 +1,11 @@
1
1
  # Lore CLI
2
2
 
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.
3
+ The Lore connector installs native Codex, Claude Code, Cursor, and Polytoken
4
+ lifecycle hooks plus the Lore OpenCode plugin. For each supported prompt, Lore
5
+ attempts to retrieve relevant engineering context. A first prompt is observed
6
+ on its own; later prompts are paired with the previous assistant response when
7
+ valid pending state is available. Integration and network failures fail open so they
8
+ do not block the agent.
9
9
 
10
10
  ## Install and connect
11
11
 
@@ -13,20 +13,32 @@ block the agent.
13
13
  pnpm install --global @lore-co/cli
14
14
 
15
15
  lore connect \
16
- --url https://api.uselore.co \
17
16
  --token "$LORE_WORKSPACE_TOKEN" \
18
17
  --agent claude \
19
18
  --agent codex \
20
- --agent opencode
19
+ --agent cursor \
20
+ --agent opencode \
21
+ --agent polytoken
21
22
 
22
23
  lore doctor
23
24
  ```
24
25
 
25
26
  The package requires Node.js 22 or newer and installs the `lore` command.
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.
28
+ `connect` auto-detects the `codex`, `claude`, `cursor`, `opencode`, and
29
+ `polytoken` executables plus existing Cursor, OpenCode, and Polytoken
30
+ configuration directories.
31
+ Repeat `--agent claude`, `--agent codex`, `--agent cursor`, or
32
+ `--agent opencode` for an explicit headless install. `--agent polytoken`
33
+ updates `$XDG_CONFIG_HOME/polytoken/hooks.json` (normally
34
+ `~/.config/polytoken/hooks.json`). `--agent t3code` detects and configures the
35
+ supported Claude, Codex, Cursor, or OpenCode provider instances that T3 Code
36
+ delegates to. It reads `$T3CODE_HOME/userdata/settings.json` or
37
+ `~/.t3/userdata/settings.json`, follows custom provider homes, and does not
38
+ modify T3 settings or secrets. External OpenCode servers must be configured on
39
+ the server. Cursor ACP sessions require a live canary because Cursor does not
40
+ guarantee lifecycle hooks in ACP mode. Lore does not install a duplicate T3
41
+ lifecycle layer.
30
42
  Configuration is stored in `~/.lore/config.json` with mode `0600`.
31
43
  Before writing that file or any agent integration, `connect` calls the
32
44
  authenticated workspace identity endpoint and validates the strict response
@@ -34,6 +46,10 @@ and server version. Revoked credentials, unreachable servers, timeouts, and
34
46
  incompatible servers leave local configuration untouched. Either
35
47
  `LORE_WORKSPACE_TOKEN` or the legacy `LORE_TOKEN` can provide the token; if
36
48
  both are set, they must match.
49
+ New token connections default to `https://api.uselore.co` and use
50
+ `https://uselore.co` for receipt links. Self-hosted deployments must pass
51
+ `--url` and may pass `--dashboard-url`; reconnecting without a new token keeps
52
+ the existing self-hosted endpoints.
37
53
  For a review-first rollout in a personal vault or component catalog, follow the
38
54
  [OpenCode pilot runbook](../../docs/opencode-pilot.md).
39
55
 
@@ -41,7 +57,7 @@ For a review-first rollout in a personal vault or component catalog, follow the
41
57
 
42
58
  ```sh
43
59
  lore update
44
- lore update --version v0.1.9
60
+ lore update --version v0.1.11
45
61
  ```
46
62
 
47
63
  `update` resolves the latest release to an exact tag, or uses the exact
@@ -51,11 +67,12 @@ version before replacing the current target. `LORE_REPO` selects another
51
67
  GitHub repository and `LORE_RELEASE_BASE_URL` selects an HTTPS release mirror;
52
68
  `LORE_BIN_DIR` overrides the standalone install directory.
53
69
 
54
- The command merges Lore-owned entries into `~/.codex/hooks.json` and
55
- `~/.claude/settings.json`, and merges `@lore-co/opencode` into the
56
- `plugin` array in `~/.config/opencode/opencode.json`. Existing settings, hooks,
57
- keys, and plugins are retained. Changed agent config files receive timestamped
58
- backups, and rerunning `connect` does not duplicate entries or backups.
70
+ The command merges Lore-owned entries into `~/.codex/hooks.json`,
71
+ `~/.claude/settings.json`, and `~/.cursor/hooks.json`, and merges
72
+ `@lore-co/opencode` into the `plugin` array in
73
+ `~/.config/opencode/opencode.json`. Existing settings, hooks, keys, and plugins
74
+ are retained. Changed agent config files receive timestamped backups, and
75
+ rerunning `connect` does not duplicate entries or backups.
59
76
 
60
77
  ## Inspect or remove
61
78
 
@@ -102,14 +119,19 @@ command has subcommand-specific `--help`, and `up`, `down`, and `status` support
102
119
 
103
120
  ## Runtime behavior
104
121
 
105
- The Claude/Codex command-hook handler:
122
+ The Claude/Codex/Cursor/Polytoken command-hook handler:
106
123
 
107
- - reads native hook JSON from standard input;
124
+ - reads native hook JSON from standard input and normalizes Cursor and
125
+ Polytoken event names;
108
126
  - observes and enriches the first prompt in a new session;
109
- - uses `last_assistant_message`, not a potentially stale transcript;
127
+ - uses `last_assistant_message`, Cursor's `afterAgentResponse`, or Polytoken's
128
+ `post_model_turn`, not a potentially stale transcript;
110
129
  - stores pending state and failed turn requests under `~/.lore`;
111
130
  - retries one queued request on a later prompt;
112
- - redacts common API keys, bearer tokens, passwords, and private keys;
131
+ - redacts common and contextual credentials, authenticated URLs, authorization
132
+ headers, cookies, provider tokens, and private keys before transport;
133
+ - re-scans returned context immediately before Claude, Codex, Cursor, or Polytoken
134
+ injection and preserves `[REDACTED:<KIND>]` audit markers;
113
135
  - times out network calls and always fails open without writing hook errors.
114
136
 
115
137
  First prompts use `POST /v1/observations` and audited
@@ -126,7 +148,7 @@ all-repositories evidence may become organization-only and apply across
126
148
  repositories. Native retrieval still requires a strong lexical, structural,
127
149
  symbol, or semantic match. Observations, paired turns, OpenCode plugin events,
128
150
  and deliveries are visible through Lore activity. OpenCode uses its plugin
129
- lifecycle and never runs through the Claude/Codex command-hook parser.
151
+ lifecycle and never runs through the command-hook parser.
130
152
 
131
153
  ## External hosts
132
154
 
@@ -226,7 +248,7 @@ same-repository, non-draft pull requests bearing the corresponding
226
248
  `lore:codex-review` or `lore:devin-review` label.
227
249
 
228
250
  Generated jobs require a published standalone binary release and default to
229
- `treadiehq/lore` at `v0.1.9`. Set `LORE_CLI_REPOSITORY` to the publicly
251
+ `treadiehq/lore` at `v0.1.11`. Set `LORE_CLI_REPOSITORY` to the publicly
230
252
  readable `owner/repository` and `LORE_CLI_VERSION` to an existing release tag
231
253
  when using another release source.
232
254
 
package/dist/cli.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { type CommandHookAgentName } from "./runtime.js";
3
3
  export declare const LORE_OPENCODE_PLUGIN = "@lore-co/opencode";
4
- declare const CONFIGURED_AGENT_NAMES: readonly ["claude", "codex", "opencode"];
4
+ export declare const DEFAULT_HOSTED_API_URL = "https://api.uselore.co";
5
+ export declare const DEFAULT_HOSTED_DASHBOARD_URL = "https://uselore.co";
6
+ declare const CONFIGURED_AGENT_NAMES: readonly ["claude", "codex", "cursor", "opencode", "polytoken"];
5
7
  export type ConfiguredAgentName = (typeof CONFIGURED_AGENT_NAMES)[number];
6
8
  export interface LorePaths {
7
9
  home: string;
@@ -14,7 +16,11 @@ export interface LorePaths {
14
16
  queue: string;
15
17
  codexHooks: string;
16
18
  claudeSettings: string;
19
+ cursorHooks: string;
20
+ cursorUserData: string;
17
21
  openCodeConfig: string;
22
+ polytokenHooks: string;
23
+ t3Settings: string;
18
24
  }
19
25
  export interface ConnectorConfig {
20
26
  version: 1;
@@ -22,16 +28,35 @@ export interface ConnectorConfig {
22
28
  dashboardUrl?: string;
23
29
  token: string;
24
30
  agents: ConfiguredAgentName[];
31
+ agentConfigPaths?: Partial<Record<ConfiguredAgentName, string[]>>;
25
32
  connectedAt: string;
26
33
  timeoutMs: number;
27
34
  }
28
- export declare function getLorePaths(home?: string): LorePaths;
35
+ export declare function getLorePaths(home?: string, environment?: NodeJS.ProcessEnv): LorePaths;
29
36
  export declare function mergeLoreHooks(input: Record<string, unknown>, agent: CommandHookAgentName, paths: LorePaths): Record<string, unknown>;
30
37
  export declare function removeLoreHooks(input: Record<string, unknown>): Record<string, unknown>;
31
38
  export declare function countLoreHooks(input: Record<string, unknown>): number;
39
+ export declare function mergeLoreCursorHooks(input: Record<string, unknown>, paths: LorePaths): Record<string, unknown>;
40
+ export declare function removeLoreCursorHooks(input: Record<string, unknown>): Record<string, unknown>;
41
+ export declare function countLoreCursorHooks(input: Record<string, unknown>): number;
42
+ export declare function mergeLorePolytokenHooks(input: unknown, paths: LorePaths): unknown[];
43
+ export declare function removeLorePolytokenHooks(input: unknown): unknown[];
44
+ export declare function countLorePolytokenHooks(input: unknown): number;
32
45
  export declare function mergeLoreOpenCodePlugin(input: Record<string, unknown>): Record<string, unknown>;
33
46
  export declare function removeLoreOpenCodePlugin(input: Record<string, unknown>): Record<string, unknown>;
34
47
  export declare function countLoreOpenCodePlugins(input: Record<string, unknown>): number;
48
+ export declare function resolveConnectEndpoints(options?: {
49
+ apiUrl?: string;
50
+ dashboardUrl?: string;
51
+ environment?: NodeJS.ProcessEnv;
52
+ existing?: Pick<ConnectorConfig, "apiUrl" | "dashboardUrl"> | null;
53
+ preferHostedDefault?: boolean;
54
+ }): Pick<ConnectorConfig, "apiUrl" | "dashboardUrl">;
55
+ export interface AgentInstallation {
56
+ agent: ConfiguredAgentName;
57
+ configPath: string;
58
+ }
59
+ export declare function t3CodeProviderInstallations(settings: unknown, paths: LorePaths): AgentInstallation[];
35
60
  export declare function runCli(args?: readonly string[]): Promise<void>;
36
61
  export {};
37
62
  //# 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":";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,GA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