openlore 2.0.1 → 2.0.2
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 +29 -0
- package/dist/cli/index.js +15 -9
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/install/adapters/agents-md.d.ts +8 -0
- package/dist/cli/install/adapters/agents-md.d.ts.map +1 -0
- package/dist/cli/install/adapters/agents-md.js +21 -0
- package/dist/cli/install/adapters/agents-md.js.map +1 -0
- package/dist/cli/install/adapters/claude-code.d.ts +8 -0
- package/dist/cli/install/adapters/claude-code.d.ts.map +1 -0
- package/dist/cli/install/adapters/claude-code.js +184 -0
- package/dist/cli/install/adapters/claude-code.js.map +1 -0
- package/dist/cli/install/adapters/cline.d.ts +6 -0
- package/dist/cli/install/adapters/cline.d.ts.map +1 -0
- package/dist/cli/install/adapters/cline.js +19 -0
- package/dist/cli/install/adapters/cline.js.map +1 -0
- package/dist/cli/install/adapters/continue.d.ts +13 -0
- package/dist/cli/install/adapters/continue.d.ts.map +1 -0
- package/dist/cli/install/adapters/continue.js +119 -0
- package/dist/cli/install/adapters/continue.js.map +1 -0
- package/dist/cli/install/adapters/cursor.d.ts +8 -0
- package/dist/cli/install/adapters/cursor.d.ts.map +1 -0
- package/dist/cli/install/adapters/cursor.js +195 -0
- package/dist/cli/install/adapters/cursor.js.map +1 -0
- package/dist/cli/install/adapters/markdown-block.d.ts +20 -0
- package/dist/cli/install/adapters/markdown-block.d.ts.map +1 -0
- package/dist/cli/install/adapters/markdown-block.js +114 -0
- package/dist/cli/install/adapters/markdown-block.js.map +1 -0
- package/dist/cli/install/adapters/types.d.ts +39 -0
- package/dist/cli/install/adapters/types.d.ts.map +1 -0
- package/dist/cli/install/adapters/types.js +10 -0
- package/dist/cli/install/adapters/types.js.map +1 -0
- package/dist/cli/install/block.d.ts +53 -0
- package/dist/cli/install/block.d.ts.map +1 -0
- package/dist/cli/install/block.js +106 -0
- package/dist/cli/install/block.js.map +1 -0
- package/dist/cli/install/detect.d.ts +23 -0
- package/dist/cli/install/detect.d.ts.map +1 -0
- package/dist/cli/install/detect.js +115 -0
- package/dist/cli/install/detect.js.map +1 -0
- package/dist/cli/install/diff.d.ts +12 -0
- package/dist/cli/install/diff.d.ts.map +1 -0
- package/dist/cli/install/diff.js +51 -0
- package/dist/cli/install/diff.js.map +1 -0
- package/dist/cli/install/index.d.ts +19 -0
- package/dist/cli/install/index.d.ts.map +1 -0
- package/dist/cli/install/index.js +133 -0
- package/dist/cli/install/index.js.map +1 -0
- package/dist/cli/install/json-managed.d.ts +43 -0
- package/dist/cli/install/json-managed.d.ts.map +1 -0
- package/dist/cli/install/json-managed.js +137 -0
- package/dist/cli/install/json-managed.js.map +1 -0
- package/dist/cli/install/templates/agent-instructions.md +12 -0
- package/dist/cli/install/templates/cursor-openlore.mdc +7 -0
- package/dist/cli/preflight/diff.d.ts +42 -0
- package/dist/cli/preflight/diff.d.ts.map +1 -0
- package/dist/cli/preflight/diff.js +162 -0
- package/dist/cli/preflight/diff.js.map +1 -0
- package/dist/cli/preflight/index.d.ts +31 -0
- package/dist/cli/preflight/index.d.ts.map +1 -0
- package/dist/cli/preflight/index.js +126 -0
- package/dist/cli/preflight/index.js.map +1 -0
- package/dist/cli/preflight/report.d.ts +50 -0
- package/dist/cli/preflight/report.d.ts.map +1 -0
- package/dist/cli/preflight/report.js +174 -0
- package/dist/cli/preflight/report.js.map +1 -0
- package/dist/cli/preflight/score.d.ts +43 -0
- package/dist/cli/preflight/score.d.ts.map +1 -0
- package/dist/cli/preflight/score.js +102 -0
- package/dist/cli/preflight/score.js.map +1 -0
- package/dist/core/analyzer/file-walker.d.ts.map +1 -1
- package/dist/core/analyzer/file-walker.js +20 -13
- package/dist/core/analyzer/file-walker.js.map +1 -1
- package/dist/core/analyzer/vector-index.d.ts +2 -0
- package/dist/core/analyzer/vector-index.d.ts.map +1 -1
- package/dist/core/analyzer/vector-index.js +30 -20
- package/dist/core/analyzer/vector-index.js.map +1 -1
- package/dist/core/services/mcp-handlers/utils.d.ts +2 -0
- package/dist/core/services/mcp-handlers/utils.d.ts.map +1 -1
- package/dist/core/services/mcp-handlers/utils.js +18 -2
- package/dist/core/services/mcp-handlers/utils.js.map +1 -1
- package/examples/ci/openlore-preflight.gitlab.yml +16 -0
- package/examples/ci/openlore-preflight.sh +16 -0
- package/examples/ci/openlore-preflight.yml +30 -0
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -65,9 +65,12 @@ npm install -g openlore
|
|
|
65
65
|
cd /path/to/your-project
|
|
66
66
|
|
|
67
67
|
openlore analyze # build call graph, clusters, CODEBASE.md
|
|
68
|
+
openlore install # auto-configure your agent (Claude Code, Cursor, …)
|
|
68
69
|
openlore mcp # start MCP server
|
|
69
70
|
```
|
|
70
71
|
|
|
72
|
+
`openlore install` auto-detects which agent surfaces are present (Claude Code, Cursor, Cline, Continue, AGENTS.md) and wires each one to call `orient()` automatically — no manual `CLAUDE.md` editing needed. See [docs/install.md](docs/install.md).
|
|
73
|
+
|
|
71
74
|
Then ask your agent: **`orient("add a new payment method")`**
|
|
72
75
|
|
|
73
76
|
That single call returns the relevant functions, their call neighbours, matching spec sections, and insertion-point candidates — preserving architectural continuity across sessions instead of forcing the agent to repeatedly reconstruct context from raw file reads. In practice, this often reduces orientation cost from ~30,000 exploratory tokens to ~1,000 targeted tokens.
|
|
@@ -146,6 +149,22 @@ One graph query replaces most exploratory file reads. The agent knows exactly wh
|
|
|
146
149
|
|
|
147
150
|
---
|
|
148
151
|
|
|
152
|
+
## Use OpenLore as a Claude Code Skill
|
|
153
|
+
|
|
154
|
+
OpenLore ships a canonical [Claude Code Skill](https://docs.claude.com/en/docs/claude-code/skills) at [`skills/openlore-orient/`](skills/openlore-orient/). Install it once and Claude Code will automatically call `orient()` at the start of every task — no `CLAUDE.md` editing required.
|
|
155
|
+
|
|
156
|
+
```sh
|
|
157
|
+
# From the OpenLore repo root:
|
|
158
|
+
npm run skill:install-local # → ~/.claude/skills/openlore-orient/
|
|
159
|
+
|
|
160
|
+
# Or copy into a single project's .claude/skills/:
|
|
161
|
+
cp -R skills/openlore-orient /path/to/your-project/.claude/skills/
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
The skill bundle ships a `SKILL.md` manifest, POSIX + PowerShell wrappers, a worked example, and a redacted real `orient()` JSON output so the model knows the response shape. See [`skills/openlore-orient/README.md`](skills/openlore-orient/README.md) for details.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
149
168
|
## Core Features
|
|
150
169
|
|
|
151
170
|
**Analyze** (no API key)
|
|
@@ -162,6 +181,14 @@ Sends the analysis to an LLM in 6 structured stages: project survey → entity e
|
|
|
162
181
|
|
|
163
182
|
Compares git changes against spec mappings in milliseconds. Detects: Gap (code changed, spec not updated), Uncovered (new file, no spec), Stale (spec references deleted files), ADR gap (code changed in an ADR-referenced domain). Installs as a pre-commit hook.
|
|
164
183
|
|
|
184
|
+
**Install** (no API key)
|
|
185
|
+
|
|
186
|
+
`openlore install` auto-wires the popular agent surfaces (Claude Code, Cursor, Cline, Continue, AGENTS.md) so they call `orient()` automatically — no `CLAUDE.md` editing required. Each integration uses a fingerprinted managed block so re-runs are idempotent and hand-edits are detected. `--dry-run` previews diffs; `--uninstall` cleanly removes everything. See [docs/install.md](docs/install.md).
|
|
187
|
+
|
|
188
|
+
**Preflight** (no API key)
|
|
189
|
+
|
|
190
|
+
`openlore preflight` is a CI staleness gate: any pull request that edits files in the graph fails the check until the graph is refreshed. Drop-in templates for GitHub Actions, GitLab CI, and generic shell live in [`examples/ci/`](examples/ci/). Weighted scoring surfaces hubs first so a one-line leaf edit doesn't fail the same way a refactor of a top-of-stack module does. See [docs/preflight.md](docs/preflight.md).
|
|
191
|
+
|
|
165
192
|
**MCP** (no API key)
|
|
166
193
|
|
|
167
194
|
45 graph-native tools exposed over stdio. Together they act as a persistent architectural runtime for coding agents: orientation, graph traversal, semantic retrieval, drift awareness, decision context, and structural risk analysis.
|
|
@@ -251,10 +278,12 @@ The graph and the OpenSpec spec layer are co-equal: the graph makes orientation
|
|
|
251
278
|
|-------|-----|
|
|
252
279
|
| MCP tools reference (45 tools + parameters) | [docs/mcp-tools.md](docs/mcp-tools.md) |
|
|
253
280
|
| Agent setup (Claude Code, Cline, OpenCode, Vibe…) | [docs/agent-setup.md](docs/agent-setup.md) |
|
|
281
|
+
| `openlore install` — auto-configure agent surfaces | [docs/install.md](docs/install.md) |
|
|
254
282
|
| LLM providers + embedding config | [docs/providers.md](docs/providers.md) |
|
|
255
283
|
| Drift detection in depth | [docs/drift-detection.md](docs/drift-detection.md) |
|
|
256
284
|
| Spec-driven tests + spec digest | [docs/spec-tests.md](docs/spec-tests.md) |
|
|
257
285
|
| CI/CD integration | [docs/ci-cd.md](docs/ci-cd.md) |
|
|
286
|
+
| Preflight CI staleness gate | [docs/preflight.md](docs/preflight.md) |
|
|
258
287
|
| CLI command reference | [docs/cli-reference.md](docs/cli-reference.md) |
|
|
259
288
|
| Interactive graph viewer | [docs/viewer.md](docs/viewer.md) |
|
|
260
289
|
| Analysis output files | [docs/output.md](docs/output.md) |
|
package/dist/cli/index.js
CHANGED
|
@@ -23,6 +23,8 @@ import { testCommand } from './commands/test.js';
|
|
|
23
23
|
import { digestCommand } from './commands/digest.js';
|
|
24
24
|
import { decisionsCommand } from './commands/decisions.js';
|
|
25
25
|
import { telemetryCommand } from './commands/telemetry.js';
|
|
26
|
+
import { installCommand } from './install/index.js';
|
|
27
|
+
import { preflightCommand } from './preflight/index.js';
|
|
26
28
|
import { configureLogger } from '../utils/logger.js';
|
|
27
29
|
// Read version from package.json at runtime so it never drifts from the published version
|
|
28
30
|
const require = createRequire(import.meta.url);
|
|
@@ -63,15 +65,17 @@ program
|
|
|
63
65
|
.addHelpText('after', `
|
|
64
66
|
Workflow:
|
|
65
67
|
1. openlore init Detect project type, create config
|
|
66
|
-
2. openlore
|
|
67
|
-
3. openlore analyze
|
|
68
|
-
4. openlore
|
|
69
|
-
5. openlore
|
|
70
|
-
6. openlore
|
|
71
|
-
7. openlore
|
|
72
|
-
8. openlore
|
|
73
|
-
9. openlore
|
|
74
|
-
10. openlore
|
|
68
|
+
2. openlore install Auto-configure agent surfaces to call orient()
|
|
69
|
+
3. openlore analyze Scan codebase, build dependency graph
|
|
70
|
+
4. openlore analyze --ai-configs Generate context files (CLAUDE.md, .cursorrules…)
|
|
71
|
+
5. openlore setup Install workflow skills (Vibe, Cline, GSD)
|
|
72
|
+
6. openlore view Review visually the dependency graph
|
|
73
|
+
7. openlore generate Create OpenSpec files using LLM
|
|
74
|
+
8. openlore verify Validate specs against source code
|
|
75
|
+
9. openlore drift Detect when code outpaces specs
|
|
76
|
+
10. openlore test Generate spec-driven tests or check coverage
|
|
77
|
+
11. openlore digest Plain-English summary of specs for human review
|
|
78
|
+
12. openlore preflight CI staleness gate: fail PRs when the graph is out of date
|
|
75
79
|
|
|
76
80
|
Quick start:
|
|
77
81
|
$ cd your-project
|
|
@@ -116,5 +120,7 @@ program.addCommand(testCommand);
|
|
|
116
120
|
program.addCommand(digestCommand);
|
|
117
121
|
program.addCommand(decisionsCommand);
|
|
118
122
|
program.addCommand(telemetryCommand);
|
|
123
|
+
program.addCommand(installCommand);
|
|
124
|
+
program.addCommand(preflightCommand);
|
|
119
125
|
program.parse();
|
|
120
126
|
//# sourceMappingURL=index.js.map
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE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;AAChC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AACnC,OAAO,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;AACpC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AACjC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AAC/B,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AAC/B,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAChC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AACjC,OAAO,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;AAC1C,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AACjC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAChC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;AACrC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;AACrC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AACnC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;AAErC,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* agents-md adapter — universal fallback that writes an AGENTS.md file at
|
|
3
|
+
* the project root. This is the convention OpenAI Codex (and an increasing
|
|
4
|
+
* number of other tools) read, so it's the safest "always do this" target.
|
|
5
|
+
*/
|
|
6
|
+
import type { Adapter } from './types.js';
|
|
7
|
+
export declare const agentsMdAdapter: Adapter;
|
|
8
|
+
//# sourceMappingURL=agents-md.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents-md.d.ts","sourceRoot":"","sources":["../../../../src/cli/install/adapters/agents-md.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAgB,MAAM,YAAY,CAAC;AAIxD,eAAO,MAAM,eAAe,EAAE,OAY7B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* agents-md adapter — universal fallback that writes an AGENTS.md file at
|
|
3
|
+
* the project root. This is the convention OpenAI Codex (and an increasing
|
|
4
|
+
* number of other tools) read, so it's the safest "always do this" target.
|
|
5
|
+
*/
|
|
6
|
+
import { applyMarkdownBlock, uninstallMarkdownBlock } from './markdown-block.js';
|
|
7
|
+
const FILE_NAME = 'AGENTS.md';
|
|
8
|
+
export const agentsMdAdapter = {
|
|
9
|
+
name: 'agents-md',
|
|
10
|
+
async apply(ctx) {
|
|
11
|
+
return applyMarkdownBlock(ctx, {
|
|
12
|
+
fileName: FILE_NAME,
|
|
13
|
+
createIfMissing: true,
|
|
14
|
+
blockBody: ctx.instructionTemplate,
|
|
15
|
+
});
|
|
16
|
+
},
|
|
17
|
+
async uninstall(ctx) {
|
|
18
|
+
return uninstallMarkdownBlock(ctx, FILE_NAME, true);
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=agents-md.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents-md.js","sourceRoot":"","sources":["../../../../src/cli/install/adapters/agents-md.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAGjF,MAAM,SAAS,GAAG,WAAW,CAAC;AAE9B,MAAM,CAAC,MAAM,eAAe,GAAY;IACtC,IAAI,EAAE,WAAW;IACjB,KAAK,CAAC,KAAK,CAAC,GAAiB;QAC3B,OAAO,kBAAkB,CAAC,GAAG,EAAE;YAC7B,QAAQ,EAAE,SAAS;YACnB,eAAe,EAAE,IAAI;YACrB,SAAS,EAAE,GAAG,CAAC,mBAAmB;SACnC,CAAC,CAAC;IACL,CAAC;IACD,KAAK,CAAC,SAAS,CAAC,GAAiB;QAC/B,OAAO,sBAAsB,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* claude-code adapter — appends the OpenLore instruction block to CLAUDE.md
|
|
3
|
+
* (creating it if absent) and adds a SessionStart hook + MCP server
|
|
4
|
+
* registration to `.claude/settings.json`.
|
|
5
|
+
*/
|
|
6
|
+
import type { Adapter } from './types.js';
|
|
7
|
+
export declare const claudeCodeAdapter: Adapter;
|
|
8
|
+
//# sourceMappingURL=claude-code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../../../src/cli/install/adapters/claude-code.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,OAAO,KAAK,EAAE,OAAO,EAA4C,MAAM,YAAY,CAAC;AAiEpF,eAAO,MAAM,iBAAiB,EAAE,OAyH/B,CAAC"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* claude-code adapter — appends the OpenLore instruction block to CLAUDE.md
|
|
3
|
+
* (creating it if absent) and adds a SessionStart hook + MCP server
|
|
4
|
+
* registration to `.claude/settings.json`.
|
|
5
|
+
*/
|
|
6
|
+
import { mkdir, readFile, writeFile, unlink } from 'node:fs/promises';
|
|
7
|
+
import { dirname, join } from 'node:path';
|
|
8
|
+
import { applyMarkdownBlock, uninstallMarkdownBlock } from './markdown-block.js';
|
|
9
|
+
import { mergeEntries, readMeta, removeManaged, isHandEdited } from '../json-managed.js';
|
|
10
|
+
import { previewCreate, previewDiff } from '../diff.js';
|
|
11
|
+
const MD_FILE = 'CLAUDE.md';
|
|
12
|
+
const SETTINGS_PATH = '.claude/settings.json';
|
|
13
|
+
const MCP_ENTRY = {
|
|
14
|
+
command: 'npx',
|
|
15
|
+
args: ['--yes', 'openlore', 'mcp'],
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Our SessionStart entry is marked with `_openlore: true` so we can identify
|
|
19
|
+
* (and replace, or remove on uninstall) just our group without touching any
|
|
20
|
+
* other SessionStart hooks the user may have configured. Claude Code ignores
|
|
21
|
+
* unknown fields on matcher groups.
|
|
22
|
+
*/
|
|
23
|
+
const ORIENT_COMMAND = 'npx --yes openlore orient --json';
|
|
24
|
+
const SESSION_HOOK = {
|
|
25
|
+
matcher: '',
|
|
26
|
+
_openlore: true,
|
|
27
|
+
hooks: [
|
|
28
|
+
{
|
|
29
|
+
type: 'command',
|
|
30
|
+
command: ORIENT_COMMAND,
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
};
|
|
34
|
+
function isOurSessionEntry(entry) {
|
|
35
|
+
if (!entry || typeof entry !== 'object')
|
|
36
|
+
return false;
|
|
37
|
+
return entry._openlore === true;
|
|
38
|
+
}
|
|
39
|
+
function mergeSessionStart(existing) {
|
|
40
|
+
const arr = Array.isArray(existing) ? existing : [];
|
|
41
|
+
const withoutOurs = arr.filter((e) => !isOurSessionEntry(e));
|
|
42
|
+
return [...withoutOurs, SESSION_HOOK];
|
|
43
|
+
}
|
|
44
|
+
function stripOurSessionStart(existing) {
|
|
45
|
+
const arr = Array.isArray(existing) ? existing : [];
|
|
46
|
+
return arr.filter((e) => !isOurSessionEntry(e));
|
|
47
|
+
}
|
|
48
|
+
async function readJsonOrEmpty(path) {
|
|
49
|
+
try {
|
|
50
|
+
const raw = await readFile(path, 'utf8');
|
|
51
|
+
const parsed = JSON.parse(raw);
|
|
52
|
+
return parsed && typeof parsed === 'object' && !Array.isArray(parsed)
|
|
53
|
+
? parsed
|
|
54
|
+
: {};
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return {};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
async function fileExists(path) {
|
|
61
|
+
try {
|
|
62
|
+
await readFile(path);
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export const claudeCodeAdapter = {
|
|
70
|
+
name: 'claude-code',
|
|
71
|
+
async apply(ctx) {
|
|
72
|
+
const mdResult = await applyMarkdownBlock(ctx, {
|
|
73
|
+
fileName: MD_FILE,
|
|
74
|
+
createIfMissing: true,
|
|
75
|
+
blockBody: ctx.instructionTemplate,
|
|
76
|
+
});
|
|
77
|
+
const settingsPath = join(ctx.root, SETTINGS_PATH);
|
|
78
|
+
const existing = await readJsonOrEmpty(settingsPath);
|
|
79
|
+
const had = await fileExists(settingsPath);
|
|
80
|
+
const prevMeta = readMeta(existing);
|
|
81
|
+
if (prevMeta && isHandEdited(existing, prevMeta) && !ctx.force) {
|
|
82
|
+
mdResult.changes.push({
|
|
83
|
+
path: settingsPath,
|
|
84
|
+
kind: 'noop',
|
|
85
|
+
summary: `${SETTINGS_PATH}: refused to overwrite hand-edited OpenLore entries (use --force)`,
|
|
86
|
+
});
|
|
87
|
+
mdResult.warnings.push(`${SETTINGS_PATH} has hand-edits in OpenLore-managed paths — pass --force to overwrite`);
|
|
88
|
+
mdResult.conflict = true;
|
|
89
|
+
return mdResult;
|
|
90
|
+
}
|
|
91
|
+
// SessionStart is computed imperatively (preserving any user-defined
|
|
92
|
+
// entries) and written through mergeEntries, but only mcpServers.openlore
|
|
93
|
+
// is tracked in our meta — we identify our SessionStart entry by its
|
|
94
|
+
// `_openlore: true` marker, not by claiming the whole array.
|
|
95
|
+
const currentSessionStart = existing.hooks?.SessionStart ?? [];
|
|
96
|
+
const nextSessionStart = mergeSessionStart(currentSessionStart);
|
|
97
|
+
const { next, action } = mergeEntries(existing, [
|
|
98
|
+
{ path: 'mcpServers.openlore', value: MCP_ENTRY },
|
|
99
|
+
]);
|
|
100
|
+
// Apply the SessionStart update outside the managed-paths set.
|
|
101
|
+
if (!next.hooks || typeof next.hooks !== 'object')
|
|
102
|
+
next.hooks = {};
|
|
103
|
+
next.hooks.SessionStart = nextSessionStart;
|
|
104
|
+
// Re-derive action: if existing already had identical SessionStart + meta noop, it's noop.
|
|
105
|
+
const sessionChanged = JSON.stringify(currentSessionStart) !== JSON.stringify(nextSessionStart);
|
|
106
|
+
const finalAction = action === 'noop' && !sessionChanged ? 'noop' : action === 'created' ? 'created' : 'updated';
|
|
107
|
+
const before = had ? JSON.stringify(existing, null, 2) + '\n' : '';
|
|
108
|
+
const after = JSON.stringify(next, null, 2) + '\n';
|
|
109
|
+
const change = {
|
|
110
|
+
path: settingsPath,
|
|
111
|
+
kind: !had ? 'create' : finalAction === 'noop' ? 'noop' : 'update',
|
|
112
|
+
summary: !had
|
|
113
|
+
? `create ${SETTINGS_PATH} with SessionStart hook + mcpServers.openlore`
|
|
114
|
+
: finalAction === 'noop'
|
|
115
|
+
? `${SETTINGS_PATH}: already up to date`
|
|
116
|
+
: `update SessionStart hook + mcpServers.openlore in ${SETTINGS_PATH}`,
|
|
117
|
+
preview: !had
|
|
118
|
+
? previewCreate(settingsPath, after)
|
|
119
|
+
: finalAction === 'noop'
|
|
120
|
+
? undefined
|
|
121
|
+
: previewDiff(settingsPath, before, after),
|
|
122
|
+
};
|
|
123
|
+
if (!ctx.dryRun && (finalAction !== 'noop' || !had)) {
|
|
124
|
+
await mkdir(dirname(settingsPath), { recursive: true });
|
|
125
|
+
await writeFile(settingsPath, JSON.stringify(next, null, 2) + '\n', 'utf8');
|
|
126
|
+
}
|
|
127
|
+
mdResult.changes.push(change);
|
|
128
|
+
return mdResult;
|
|
129
|
+
},
|
|
130
|
+
async uninstall(ctx) {
|
|
131
|
+
const md = await uninstallMarkdownBlock(ctx, MD_FILE, false);
|
|
132
|
+
const settingsPath = join(ctx.root, SETTINGS_PATH);
|
|
133
|
+
let parsed;
|
|
134
|
+
try {
|
|
135
|
+
parsed = JSON.parse(await readFile(settingsPath, 'utf8'));
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
return md;
|
|
139
|
+
}
|
|
140
|
+
// Strip our SessionStart entry first (it's identified by _openlore marker,
|
|
141
|
+
// not by the managed-paths meta).
|
|
142
|
+
const hooksObj = parsed.hooks;
|
|
143
|
+
if (hooksObj && Array.isArray(hooksObj.SessionStart)) {
|
|
144
|
+
const filtered = stripOurSessionStart(hooksObj.SessionStart);
|
|
145
|
+
if (filtered.length === 0) {
|
|
146
|
+
delete hooksObj.SessionStart;
|
|
147
|
+
if (Object.keys(hooksObj).length === 0)
|
|
148
|
+
delete parsed.hooks;
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
hooksObj.SessionStart = filtered;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
const { next, removed } = removeManaged(parsed);
|
|
155
|
+
if (!removed && parsed.hooks === undefined) {
|
|
156
|
+
// We may have only stripped a SessionStart entry — that still counts as work.
|
|
157
|
+
}
|
|
158
|
+
else if (!removed) {
|
|
159
|
+
return md;
|
|
160
|
+
}
|
|
161
|
+
// If file is now empty (only had our entries), delete it.
|
|
162
|
+
const isEmpty = Object.keys(next).length === 0;
|
|
163
|
+
if (isEmpty) {
|
|
164
|
+
if (!ctx.dryRun)
|
|
165
|
+
await unlink(settingsPath);
|
|
166
|
+
md.changes.push({
|
|
167
|
+
path: settingsPath,
|
|
168
|
+
kind: 'delete',
|
|
169
|
+
summary: `remove ${SETTINGS_PATH} (was OpenLore-only)`,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
if (!ctx.dryRun)
|
|
174
|
+
await writeFile(settingsPath, JSON.stringify(next, null, 2) + '\n', 'utf8');
|
|
175
|
+
md.changes.push({
|
|
176
|
+
path: settingsPath,
|
|
177
|
+
kind: 'update',
|
|
178
|
+
summary: `strip OpenLore entries from ${SETTINGS_PATH}`,
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
return md;
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
//# sourceMappingURL=claude-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../../../src/cli/install/adapters/claude-code.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGxD,MAAM,OAAO,GAAG,WAAW,CAAC;AAC5B,MAAM,aAAa,GAAG,uBAAuB,CAAC;AAE9C,MAAM,SAAS,GAAG;IAChB,OAAO,EAAE,KAAK;IACd,IAAI,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC;CACnC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,cAAc,GAAG,kCAAkC,CAAC;AAC1D,MAAM,YAAY,GAAG;IACnB,OAAO,EAAE,EAAE;IACX,SAAS,EAAE,IAAI;IACf,KAAK,EAAE;QACL;YACE,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,cAAc;SACxB;KACF;CACF,CAAC;AAEF,SAAS,iBAAiB,CAAC,KAAc;IACvC,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACtD,OAAQ,KAAiC,CAAC,SAAS,KAAK,IAAI,CAAC;AAC/D,CAAC;AAED,SAAS,iBAAiB,CAAC,QAAiB;IAC1C,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CA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C;IACZ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cline.d.ts","sourceRoot":"","sources":["../../../../src/cli/install/adapters/cline.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAgB,MAAM,YAAY,CAAC;AAIxD,eAAO,MAAM,YAAY,EAAE,OAY1B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cline adapter — appends the OpenLore instruction block to `.clinerules`.
|
|
3
|
+
*/
|
|
4
|
+
import { applyMarkdownBlock, uninstallMarkdownBlock } from './markdown-block.js';
|
|
5
|
+
const FILE_NAME = '.clinerules';
|
|
6
|
+
export const clineAdapter = {
|
|
7
|
+
name: 'cline',
|
|
8
|
+
async apply(ctx) {
|
|
9
|
+
return applyMarkdownBlock(ctx, {
|
|
10
|
+
fileName: FILE_NAME,
|
|
11
|
+
createIfMissing: true,
|
|
12
|
+
blockBody: ctx.instructionTemplate,
|
|
13
|
+
});
|
|
14
|
+
},
|
|
15
|
+
async uninstall(ctx) {
|
|
16
|
+
return uninstallMarkdownBlock(ctx, FILE_NAME, true);
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=cline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cline.js","sourceRoot":"","sources":["../../../../src/cli/install/adapters/cline.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAGjF,MAAM,SAAS,GAAG,aAAa,CAAC;AAEhC,MAAM,CAAC,MAAM,YAAY,GAAY;IACnC,IAAI,EAAE,OAAO;IACb,KAAK,CAAC,KAAK,CAAC,GAAiB;QAC3B,OAAO,kBAAkB,CAAC,GAAG,EAAE;YAC7B,QAAQ,EAAE,SAAS;YACnB,eAAe,EAAE,IAAI;YACrB,SAAS,EAAE,GAAG,CAAC,mBAAmB;SACnC,CAAC,CAAC;IACL,CAAC;IACD,KAAK,CAAC,SAAS,CAAC,GAAiB;QAC/B,OAAO,sBAAsB,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* continue adapter — adds an "/orient" slash command entry to
|
|
3
|
+
* `.continue/config.json`. The Continue config schema accepts a top-level
|
|
4
|
+
* `slashCommands` array; we add (or replace) an entry whose `name === 'orient'`.
|
|
5
|
+
*
|
|
6
|
+
* Continue's MCP integration path differs across recent versions; rather than
|
|
7
|
+
* guess and silently write to the wrong key, we leave a TODO and warn the user
|
|
8
|
+
* (per spec-01 "do not guess" rule). MCP server registration for Continue is
|
|
9
|
+
* gated behind a follow-up TODO.
|
|
10
|
+
*/
|
|
11
|
+
import type { Adapter } from './types.js';
|
|
12
|
+
export declare const continueAdapter: Adapter;
|
|
13
|
+
//# sourceMappingURL=continue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continue.d.ts","sourceRoot":"","sources":["../../../../src/cli/install/adapters/continue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,KAAK,EAAE,OAAO,EAA4C,MAAM,YAAY,CAAC;AAUpF,eAAO,MAAM,eAAe,EAAE,OAyG7B,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* continue adapter — adds an "/orient" slash command entry to
|
|
3
|
+
* `.continue/config.json`. The Continue config schema accepts a top-level
|
|
4
|
+
* `slashCommands` array; we add (or replace) an entry whose `name === 'orient'`.
|
|
5
|
+
*
|
|
6
|
+
* Continue's MCP integration path differs across recent versions; rather than
|
|
7
|
+
* guess and silently write to the wrong key, we leave a TODO and warn the user
|
|
8
|
+
* (per spec-01 "do not guess" rule). MCP server registration for Continue is
|
|
9
|
+
* gated behind a follow-up TODO.
|
|
10
|
+
*/
|
|
11
|
+
import { mkdir, readFile, writeFile, unlink } from 'node:fs/promises';
|
|
12
|
+
import { dirname, join } from 'node:path';
|
|
13
|
+
import { mergeEntries, readMeta, removeManaged, isHandEdited } from '../json-managed.js';
|
|
14
|
+
import { previewCreate, previewDiff } from '../diff.js';
|
|
15
|
+
const CONFIG_PATH = '.continue/config.json';
|
|
16
|
+
const SLASH_COMMAND = {
|
|
17
|
+
name: 'orient',
|
|
18
|
+
description: 'Call openlore orient() for the current task context',
|
|
19
|
+
run: 'npx --yes openlore orient --json',
|
|
20
|
+
};
|
|
21
|
+
export const continueAdapter = {
|
|
22
|
+
name: 'continue',
|
|
23
|
+
async apply(ctx) {
|
|
24
|
+
const configPath = join(ctx.root, CONFIG_PATH);
|
|
25
|
+
let had = true;
|
|
26
|
+
let existing;
|
|
27
|
+
try {
|
|
28
|
+
existing = JSON.parse(await readFile(configPath, 'utf8'));
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
existing = {};
|
|
32
|
+
had = false;
|
|
33
|
+
}
|
|
34
|
+
const prevMeta = readMeta(existing);
|
|
35
|
+
if (prevMeta && isHandEdited(existing, prevMeta) && !ctx.force) {
|
|
36
|
+
return {
|
|
37
|
+
changes: [
|
|
38
|
+
{
|
|
39
|
+
path: configPath,
|
|
40
|
+
kind: 'noop',
|
|
41
|
+
summary: `${CONFIG_PATH}: refused to overwrite hand-edited OpenLore entries (use --force)`,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
warnings: [`${CONFIG_PATH} has hand-edits in OpenLore-managed paths — pass --force to overwrite`],
|
|
45
|
+
conflict: true,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
// Preserve any non-OpenLore slashCommands already present.
|
|
49
|
+
const existingSlash = Array.isArray(existing.slashCommands) ? existing.slashCommands : [];
|
|
50
|
+
const otherSlash = existingSlash.filter((c) => c?.name !== 'orient');
|
|
51
|
+
const nextSlash = [...otherSlash, SLASH_COMMAND];
|
|
52
|
+
const { next, action } = mergeEntries(existing, [
|
|
53
|
+
{ path: 'slashCommands', value: nextSlash },
|
|
54
|
+
]);
|
|
55
|
+
const before = had ? JSON.stringify(existing, null, 2) + '\n' : '';
|
|
56
|
+
const after = JSON.stringify(next, null, 2) + '\n';
|
|
57
|
+
const change = {
|
|
58
|
+
path: configPath,
|
|
59
|
+
kind: !had ? 'create' : action === 'noop' ? 'noop' : 'update',
|
|
60
|
+
summary: !had
|
|
61
|
+
? `create ${CONFIG_PATH} with /orient slash command`
|
|
62
|
+
: action === 'noop'
|
|
63
|
+
? `${CONFIG_PATH}: already up to date`
|
|
64
|
+
: `add /orient slash command to ${CONFIG_PATH}`,
|
|
65
|
+
preview: !had
|
|
66
|
+
? previewCreate(configPath, after)
|
|
67
|
+
: action === 'noop'
|
|
68
|
+
? undefined
|
|
69
|
+
: previewDiff(configPath, before, after),
|
|
70
|
+
};
|
|
71
|
+
const warnings = [
|
|
72
|
+
// TODO(openlore-spec-01): verify Continue MCP server registration path; not written here.
|
|
73
|
+
'continue: MCP server registration is not yet wired (path varies by Continue version) — slash command only',
|
|
74
|
+
];
|
|
75
|
+
if (!ctx.dryRun && (action !== 'noop' || !had)) {
|
|
76
|
+
await mkdir(dirname(configPath), { recursive: true });
|
|
77
|
+
await writeFile(configPath, JSON.stringify(next, null, 2) + '\n', 'utf8');
|
|
78
|
+
}
|
|
79
|
+
return { changes: [change], warnings, conflict: false };
|
|
80
|
+
},
|
|
81
|
+
async uninstall(ctx) {
|
|
82
|
+
const configPath = join(ctx.root, CONFIG_PATH);
|
|
83
|
+
let parsed;
|
|
84
|
+
try {
|
|
85
|
+
parsed = JSON.parse(await readFile(configPath, 'utf8'));
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
return { changes: [], warnings: [], conflict: false };
|
|
89
|
+
}
|
|
90
|
+
const beforeSlash = Array.isArray(parsed.slashCommands) ? parsed.slashCommands : [];
|
|
91
|
+
const filteredSlash = beforeSlash.filter((c) => c?.name !== 'orient');
|
|
92
|
+
if (filteredSlash.length === beforeSlash.length && !readMeta(parsed)) {
|
|
93
|
+
return { changes: [], warnings: [], conflict: false };
|
|
94
|
+
}
|
|
95
|
+
parsed.slashCommands = filteredSlash;
|
|
96
|
+
const { next } = removeManaged(parsed);
|
|
97
|
+
if (Array.isArray(next.slashCommands) && next.slashCommands.length === 0) {
|
|
98
|
+
delete next.slashCommands;
|
|
99
|
+
}
|
|
100
|
+
const isEmpty = Object.keys(next).length === 0;
|
|
101
|
+
if (isEmpty) {
|
|
102
|
+
if (!ctx.dryRun)
|
|
103
|
+
await unlink(configPath);
|
|
104
|
+
return {
|
|
105
|
+
changes: [{ path: configPath, kind: 'delete', summary: `remove ${CONFIG_PATH} (was OpenLore-only)` }],
|
|
106
|
+
warnings: [],
|
|
107
|
+
conflict: false,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
if (!ctx.dryRun)
|
|
111
|
+
await writeFile(configPath, JSON.stringify(next, null, 2) + '\n', 'utf8');
|
|
112
|
+
return {
|
|
113
|
+
changes: [{ path: configPath, kind: 'update', summary: `strip OpenLore entries from ${CONFIG_PATH}` }],
|
|
114
|
+
warnings: [],
|
|
115
|
+
conflict: false,
|
|
116
|
+
};
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
//# sourceMappingURL=continue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continue.js","sourceRoot":"","sources":["../../../../src/cli/install/adapters/continue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,EAAE,a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
/**
|
|
2
|
+
* cursor adapter — writes an OpenLore-managed block to `.cursorrules`, a
|
|
3
|
+
* companion `.cursor/rules/openlore.mdc` file describing the orient() workflow,
|
|
4
|
+
* and registers the OpenLore MCP server in `.cursor/mcp.json`.
|
|
5
|
+
*/
|
|
6
|
+
import type { Adapter } from './types.js';
|
|
7
|
+
export declare const cursorAdapter: Adapter;
|
|
8
|
+
//# sourceMappingURL=cursor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../../../src/cli/install/adapters/cursor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,KAAK,EAAE,OAAO,EAA4C,MAAM,YAAY,CAAC;AAoCpF,eAAO,MAAM,aAAa,EAAE,OA0J3B,CAAC"}
|