@aron98/load-lock 1.5.0 → 1.6.0
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 +61 -14
- package/dist/cli/copies.d.ts +3 -2
- package/dist/cli/copies.js +32 -3
- package/dist/cli/hook.js +48 -4
- package/dist/cli/install.d.ts +2 -0
- package/dist/cli/install.js +67 -13
- package/dist/cli/main.js +62 -5
- package/dist/cli/setup.d.ts +131 -0
- package/dist/cli/setup.js +942 -0
- package/dist/cli/update.d.ts +5 -1
- package/dist/cli/update.js +16 -3
- package/dist/core/daemon.d.ts +29 -3
- package/dist/core/daemon.js +111 -11
- package/dist/core/persist.d.ts +3 -0
- package/dist/core/persist.js +49 -10
- package/dist/core/state.d.ts +9 -0
- package/dist/core/state.js +41 -3
- package/dist/mcp/server.d.ts +4 -3
- package/dist/mcp/server.js +29 -6
- package/dist/policy/text.d.ts +13 -3
- package/dist/policy/text.js +14 -3
- package/dist/shared/agent-guide.d.ts +3 -0
- package/dist/shared/agent-guide.js +16 -0
- package/dist/shared/client.js +5 -3
- package/dist/shared/drift.d.ts +4 -2
- package/dist/shared/drift.js +24 -6
- package/dist/shared/identity.d.ts +51 -0
- package/dist/shared/identity.js +116 -0
- package/dist/shared/pkginfo.d.ts +9 -0
- package/dist/shared/pkginfo.js +16 -0
- package/dist/shared/protocol.d.ts +22 -0
- package/dist/shared/protocol.js +15 -0
- package/dist/shared/runtimes.d.ts +41 -0
- package/dist/shared/runtimes.js +81 -0
- package/dist/shared/version.d.ts +6 -0
- package/dist/shared/version.js +9 -1
- package/dist/test/ace-mcp.test.d.ts +1 -0
- package/dist/test/ace-mcp.test.js +157 -0
- package/dist/test/ace-opencode.test.d.ts +1 -0
- package/dist/test/ace-opencode.test.js +287 -0
- package/dist/test/check-pins.test.d.ts +1 -0
- package/dist/test/check-pins.test.js +108 -0
- package/dist/test/compat.test.d.ts +1 -0
- package/dist/test/compat.test.js +190 -0
- package/dist/test/hook.test.js +179 -1
- package/dist/test/identity.test.d.ts +1 -0
- package/dist/test/identity.test.js +155 -0
- package/dist/test/install.test.js +135 -1
- package/dist/test/launcher.test.d.ts +1 -0
- package/dist/test/launcher.test.js +222 -0
- package/dist/test/mcp.test.js +76 -7
- package/dist/test/plugin.test.d.ts +1 -0
- package/dist/test/plugin.test.js +144 -0
- package/dist/test/runtimes.test.d.ts +1 -0
- package/dist/test/runtimes.test.js +282 -0
- package/dist/test/setup.test.d.ts +1 -0
- package/dist/test/setup.test.js +354 -0
- package/dist/test/update-command.test.js +71 -0
- package/dist/test/update.test.js +33 -1
- package/docs/ADAPTERS.md +3 -2
- package/docs/AGENT_GUIDE.md +36 -2
- package/docs/ARCHITECTURE.md +122 -7
- package/docs/COMPATIBILITY.md +142 -13
- package/docs/OPERATIONS.md +292 -14
- package/package.json +3 -2
- package/skills/load-lock/SKILL.md +62 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { type InstalledCopy } from "./copies.js";
|
|
2
|
+
import { type RuntimeCopy } from "../shared/runtimes.js";
|
|
3
|
+
/**
|
|
4
|
+
* Name of the Claude Code plugin (decided on #61: the plugin is not called
|
|
5
|
+
* `load-lock`, so it never collides with the standalone skill). Matched as
|
|
6
|
+
* `<name>@<marketplace>` in `enabledPlugins`, whatever the marketplace.
|
|
7
|
+
*/
|
|
8
|
+
export declare const CLAUDE_PLUGIN_NAME = "load-lock-plugin";
|
|
9
|
+
export declare const HARNESSES: readonly ["claude-code", "opencode", "codex", "cursor", "gemini-cli", "copilot-cli", "cline", "roo-code", "goose", "omac"];
|
|
10
|
+
export type Harness = (typeof HARNESSES)[number];
|
|
11
|
+
export type IntegrationKind = "plugin" | "hooks" | "mcp" | "policy" | "skill" | "grants";
|
|
12
|
+
/**
|
|
13
|
+
* Who wrote the entry: `installer` = `load-lock install` (exact shape it
|
|
14
|
+
* writes), `harness` = the harness's own plugin state (e.g. Claude Code
|
|
15
|
+
* `enabledPlugins`), `ace` = an ACE install (`.ace.json` stamp next to it),
|
|
16
|
+
* `other` = anything else (manual edits, npx entries, foreign tools).
|
|
17
|
+
*/
|
|
18
|
+
export type Owner = "installer" | "harness" | "ace" | "other";
|
|
19
|
+
export interface Integration {
|
|
20
|
+
kind: IntegrationKind;
|
|
21
|
+
scope: "user" | "project";
|
|
22
|
+
/** File (or directory) the entry lives in. */
|
|
23
|
+
file: string;
|
|
24
|
+
/** Short description of the entry (key, events, ...). */
|
|
25
|
+
detail: string;
|
|
26
|
+
owner: Owner;
|
|
27
|
+
/** Package root of the load-lock copy the entry runs, when it names one. */
|
|
28
|
+
copy?: string;
|
|
29
|
+
/** True when that copy no longer exists on disk. */
|
|
30
|
+
stale?: boolean;
|
|
31
|
+
/** Plugins only: the harness's enabled flag. */
|
|
32
|
+
enabled?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Rung on the ladder (#47): `plugin` = harness plugin active, `loose` =
|
|
36
|
+
* `load-lock install` wiring (hooks / policy / grants), `mcp` = only an MCP
|
|
37
|
+
* registration, `skill` = only the skill, `none` = nothing found.
|
|
38
|
+
*/
|
|
39
|
+
export type Rung = "plugin" | "loose" | "mcp" | "skill" | "none";
|
|
40
|
+
export interface HarnessInventory {
|
|
41
|
+
harness: Harness;
|
|
42
|
+
rung: Rung;
|
|
43
|
+
integrations: Integration[];
|
|
44
|
+
/** Duplicates, stale entries and other problems worth fixing. */
|
|
45
|
+
findings: string[];
|
|
46
|
+
}
|
|
47
|
+
export interface Inventory {
|
|
48
|
+
home: string;
|
|
49
|
+
project: string;
|
|
50
|
+
harnesses: HarnessInventory[];
|
|
51
|
+
runtime: {
|
|
52
|
+
/** Copies detectable on disk (copies.ts). */
|
|
53
|
+
copies: InstalledCopy[];
|
|
54
|
+
/** The copy the daemon last recorded in daemon.json (#52). */
|
|
55
|
+
daemon: {
|
|
56
|
+
path: string;
|
|
57
|
+
version: string | null;
|
|
58
|
+
} | null;
|
|
59
|
+
/** Copies the daemon has seen via the client handshake (#52). */
|
|
60
|
+
known: RuntimeCopy[];
|
|
61
|
+
};
|
|
62
|
+
findings: string[];
|
|
63
|
+
}
|
|
64
|
+
export interface InventoryOptions {
|
|
65
|
+
project: string;
|
|
66
|
+
home?: string;
|
|
67
|
+
env?: NodeJS.ProcessEnv;
|
|
68
|
+
platform?: NodeJS.Platform;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Who owns a skill directory: `ace` when ACE stamped it (`.ace.json`),
|
|
72
|
+
* `installer` when it is the dir `load-lock install` writes (a real
|
|
73
|
+
* directory, not a symlink to someone's checkout), else `other`.
|
|
74
|
+
* `install` / `uninstall` only write or remove an `installer` dir (#89).
|
|
75
|
+
*/
|
|
76
|
+
export declare function skillDirOwner(dir: string, installerDir?: string): Owner;
|
|
77
|
+
/** A plugin entry the harness will actually load (ACE skills-dir plugins are unverified, #63). */
|
|
78
|
+
export declare function activePlugin(i: Integration): boolean;
|
|
79
|
+
/** Inventory of one harness only (no runtime copies). */
|
|
80
|
+
export declare function inventoryHarness(h: Harness, opts: InventoryOptions): HarnessInventory;
|
|
81
|
+
/**
|
|
82
|
+
* Claude Code's mode (#62): `plugin` (the plugin is active), `loose`
|
|
83
|
+
* (`load-lock install` wiring: MCP server, hooks or CLAUDE.md section),
|
|
84
|
+
* `both`, or `none`. The skill doesn't count: the plugin ships none.
|
|
85
|
+
*/
|
|
86
|
+
export type ClaudeCodeMode = "plugin" | "loose" | "both" | "none";
|
|
87
|
+
export declare function claudeCodeMode(h: HarnessInventory): ClaudeCodeMode;
|
|
88
|
+
export declare function inventory(opts: InventoryOptions): Inventory;
|
|
89
|
+
/** Human-readable inventory. */
|
|
90
|
+
export declare function formatInventory(inv: Inventory): string;
|
|
91
|
+
export interface PlanStep {
|
|
92
|
+
harness: Harness;
|
|
93
|
+
/**
|
|
94
|
+
* `install`: run `load-lock install --harness <h>` (after removing
|
|
95
|
+
* installer-shaped hooks of other/missing copies, and a stale codex MCP
|
|
96
|
+
* block, which `install` alone would keep). `remove-loose`: drop the
|
|
97
|
+
* loose Claude Code wiring an active plugin replaces (MCP server, hooks,
|
|
98
|
+
* CLAUDE.md section; the skill stays). `manual`: printed, never applied.
|
|
99
|
+
*/
|
|
100
|
+
action: "install" | "remove-loose" | "manual";
|
|
101
|
+
detail: string;
|
|
102
|
+
}
|
|
103
|
+
export interface Plan {
|
|
104
|
+
steps: PlanStep[];
|
|
105
|
+
/** One-time hints (upgrade path), not actions. */
|
|
106
|
+
hints: string[];
|
|
107
|
+
}
|
|
108
|
+
export interface PlanOptions {
|
|
109
|
+
/** Package root of the copy running setup; null when unknown. */
|
|
110
|
+
selfCopy: string | null;
|
|
111
|
+
/** True when that copy lives in a cache npm/opencode may prune. */
|
|
112
|
+
selfEphemeral: boolean;
|
|
113
|
+
}
|
|
114
|
+
/** The running copy, and whether it sits in the npx / opencode cache. */
|
|
115
|
+
export declare function selfCopy(platform?: NodeJS.Platform, env?: NodeJS.ProcessEnv): PlanOptions;
|
|
116
|
+
export declare function planConverge(inv: Inventory, opts: PlanOptions): Plan;
|
|
117
|
+
/**
|
|
118
|
+
* Drop the loose Claude Code wiring (installer-shaped entries only); keep
|
|
119
|
+
* the skill. Shared by `setup --yes` (`remove-loose`) and `install` when
|
|
120
|
+
* the plugin is enabled (#62).
|
|
121
|
+
*/
|
|
122
|
+
export declare function removeClaudeLoose(h: HarnessInventory): string[];
|
|
123
|
+
export interface ApplyOptions {
|
|
124
|
+
project: string;
|
|
125
|
+
/** dist/ of the running copy (what `install` is called with). */
|
|
126
|
+
binDir?: string;
|
|
127
|
+
}
|
|
128
|
+
/** Apply the non-manual steps in order; returns what was done. */
|
|
129
|
+
export declare function applyPlan(inv: Inventory, plan: Plan, opts: ApplyOptions): Promise<string[]>;
|
|
130
|
+
/** Human-readable plan. */
|
|
131
|
+
export declare function formatPlan(plan: Plan, applied?: string[]): string;
|