@evomap/evolver-cli 2.0.51 → 2.0.52
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/dist/plugin.d.ts +1 -1
- package/dist/plugin.js +15 -5
- package/dist/pluginBundle.d.ts +2 -0
- package/dist/pluginBundle.js +37 -9
- package/dist/pluginHosts.d.ts +13 -2
- package/dist/pluginHosts.js +88 -29
- package/dist/pluginInspection.d.ts +2 -2
- package/dist/pluginInspection.js +25 -19
- package/dist/pluginInstall.js +16 -12
- package/dist/pluginLauncher.d.ts +7 -0
- package/dist/pluginLauncher.js +40 -0
- package/dist/pluginLocalInspection.d.ts +7 -0
- package/dist/pluginLocalInspection.js +46 -0
- package/dist/pluginRuntime.d.ts +2 -1
- package/dist/pluginRuntime.js +10 -4
- package/package.json +7 -7
package/dist/plugin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type PluginRuntime } from './pluginRuntime.js';
|
|
2
|
-
export declare const PLUGIN_USAGE = "Usage: evolver plugin list [--json]\n evolver plugin install [--host <host>] [--scope user|project] [--root <dir>]\n [--profile <dsh-profile>] [--trust] [--dry-run] [--json]\n\nHosts: claude-code, codex, grok, qoder, antigravity, opencode, dsh,\n cursor, workbuddy, mcp-generic\nDefault scope: user. dsh default profile: dsh-tui.\n--trust says you trust the plugin's hooks; only hosts that require it (grok) accept it.\nWith no host, only a single discovered native host is selected; otherwise choose --host.\nCursor, WorkBuddy and generic MCP return manual_required without writing client config.\nDry-run performs no download, host command or config write and proves no installed state.\nInstallation uses EvoMap/evolver-agent-plugin and does not replace setup-hooks.\nExit codes: 0 verified install/already-installed/list/preview; 2 action required\n(including trust_required and profile_store_mismatch); 1 conflict or failure.\n";
|
|
2
|
+
export declare const PLUGIN_USAGE = "Usage: evolver plugin list [--json]\n evolver plugin install [--host <host>] [--scope user|project] [--root <dir>]\n [--profile <dsh-profile>] [--trust] [--dry-run] [--json]\n\nHosts: claude-code, codex, grok, qoder, antigravity, opencode, dsh, zcode,\n kimi, stepcode, minimax, cursor, workbuddy, mcp-generic\nDefault scope: user. dsh default profile: dsh-tui.\n--trust says you trust the plugin's hooks; only hosts that require it (grok) accept it.\nWith no host, only a single discovered native host is selected; otherwise choose --host.\nCursor, WorkBuddy and generic MCP return manual_required without writing client config.\nKimi Code and Step Code install on Windows only; ZCode on Windows and macOS.\nDry-run performs no download, host command or config write and proves no installed state.\nInstallation uses EvoMap/evolver-agent-plugin and does not replace setup-hooks.\nExit codes: 0 verified install/already-installed/list/preview; 2 action required\n(including trust_required and profile_store_mismatch); 1 conflict or failure.\n";
|
|
3
3
|
export interface PluginCommandDeps {
|
|
4
4
|
runtime?: PluginRuntime;
|
|
5
5
|
stdout?: (text: string) => void;
|
package/dist/plugin.js
CHANGED
|
@@ -2,17 +2,19 @@ import { realpathSync, statSync } from 'node:fs';
|
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
3
|
import { PLUGIN_HOSTS, pluginHostNamed } from './pluginHosts.js';
|
|
4
4
|
import { installAgentPlugin } from './pluginInstall.js';
|
|
5
|
+
import { expectedHostLauncher, hostLauncher } from './pluginLauncher.js';
|
|
5
6
|
import { createPluginRuntime, PluginInstallError } from './pluginRuntime.js';
|
|
6
7
|
export const PLUGIN_USAGE = `Usage: evolver plugin list [--json]
|
|
7
8
|
evolver plugin install [--host <host>] [--scope user|project] [--root <dir>]
|
|
8
9
|
[--profile <dsh-profile>] [--trust] [--dry-run] [--json]
|
|
9
10
|
|
|
10
|
-
Hosts: claude-code, codex, grok, qoder, antigravity, opencode, dsh,
|
|
11
|
-
cursor, workbuddy, mcp-generic
|
|
11
|
+
Hosts: claude-code, codex, grok, qoder, antigravity, opencode, dsh, zcode,
|
|
12
|
+
kimi, stepcode, minimax, cursor, workbuddy, mcp-generic
|
|
12
13
|
Default scope: user. dsh default profile: dsh-tui.
|
|
13
14
|
--trust says you trust the plugin's hooks; only hosts that require it (grok) accept it.
|
|
14
15
|
With no host, only a single discovered native host is selected; otherwise choose --host.
|
|
15
16
|
Cursor, WorkBuddy and generic MCP return manual_required without writing client config.
|
|
17
|
+
Kimi Code and Step Code install on Windows only; ZCode on Windows and macOS.
|
|
16
18
|
Dry-run performs no download, host command or config write and proves no installed state.
|
|
17
19
|
Installation uses EvoMap/evolver-agent-plugin and does not replace setup-hooks.
|
|
18
20
|
Exit codes: 0 verified install/already-installed/list/preview; 2 action required
|
|
@@ -68,7 +70,7 @@ function installOptions(flags, runtime) {
|
|
|
68
70
|
if (flags.host && !host)
|
|
69
71
|
throw new PluginInstallError('invalid_arguments', 'Unknown plugin host. Use evolver plugin list to see supported entries.');
|
|
70
72
|
if (!host) {
|
|
71
|
-
const found = PLUGIN_HOSTS.filter(candidate => candidate.kind !== 'manual' && candidate
|
|
73
|
+
const found = PLUGIN_HOSTS.filter(candidate => candidate.kind !== 'manual' && supportsPlatform(candidate, runtime) && hostLauncher(runtime, candidate));
|
|
72
74
|
if (found.length !== 1)
|
|
73
75
|
throw new PluginInstallError('selection_required', found.length === 0
|
|
74
76
|
? 'No native plugin host was found on PATH. Choose --host explicitly; plugin list includes manual entries.'
|
|
@@ -89,6 +91,8 @@ function installOptions(flags, runtime) {
|
|
|
89
91
|
const profile = flags.profile ?? 'dsh-tui';
|
|
90
92
|
if (!/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/.test(profile))
|
|
91
93
|
throw new PluginInstallError('invalid_arguments', '--profile must be a simple dsh profile name, not a path or command.');
|
|
94
|
+
if (!supportsPlatform(host, runtime))
|
|
95
|
+
throw new PluginInstallError('unsupported_capability', `${host.label} plugin installation is supported on ${host.platforms.map(platformName).join(' and ')} only; this machine runs ${platformName(runtime.platform)}.`);
|
|
92
96
|
let root = resolve(runtime.cwd, flags.root ?? '.');
|
|
93
97
|
if (!flags.dryRun && host.kind !== 'manual') {
|
|
94
98
|
try {
|
|
@@ -100,7 +104,13 @@ function installOptions(flags, runtime) {
|
|
|
100
104
|
throw new PluginInstallError('invalid_arguments', '--root must identify an existing project/working directory.');
|
|
101
105
|
}
|
|
102
106
|
}
|
|
103
|
-
|
|
107
|
+
const launcher = hostLauncher(runtime, host) ?? expectedHostLauncher(runtime, host);
|
|
108
|
+
return { host, scope: scope, root, profile, dryRun: flags.dryRun, trust: flags.trust, launcher };
|
|
109
|
+
}
|
|
110
|
+
const PLATFORM_NAMES = { win32: 'Windows', darwin: 'macOS', linux: 'Linux' };
|
|
111
|
+
const platformName = (platform) => PLATFORM_NAMES[platform] ?? platform;
|
|
112
|
+
function supportsPlatform(host, runtime) {
|
|
113
|
+
return !host.platforms || host.platforms.includes(runtime.platform);
|
|
104
114
|
}
|
|
105
115
|
export async function runPluginCommand(argv, deps = {}) {
|
|
106
116
|
const stdout = deps.stdout ?? (text => { process.stdout.write(text); });
|
|
@@ -115,7 +125,7 @@ export async function runPluginCommand(argv, deps = {}) {
|
|
|
115
125
|
return 0;
|
|
116
126
|
}
|
|
117
127
|
if (flags.action === 'list') {
|
|
118
|
-
const hosts = PLUGIN_HOSTS.map(host => ({ id: host.id, label: host.label, mode: host.kind === 'manual' ? 'manual' : 'native', cli: host.command ?? null, cliFound: Boolean(
|
|
128
|
+
const hosts = PLUGIN_HOSTS.map(host => ({ id: host.id, label: host.label, mode: host.kind === 'manual' ? 'manual' : 'native', cli: host.command ?? null, cliFound: Boolean(hostLauncher(runtime, host)), minimumVersion: host.minimumVersion ?? null, requiresTrust: Boolean(host.requiresTrust), scopes: host.scopes, platforms: host.platforms ?? null, instructions: host.instructions }));
|
|
119
129
|
stdout(json ? `${JSON.stringify({ ok: true, action: 'list', hosts })}\n` : `${hosts.map(host => `${host.id.padEnd(14)} ${host.mode.padEnd(7)} ${host.cliFound ? 'CLI found' : 'CLI not found / not required'}; scopes=${host.scopes.join('|')}`).join('\n')}\nCLI detection is not installation or version verification.\n`);
|
|
120
130
|
return 0;
|
|
121
131
|
}
|
package/dist/pluginBundle.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type PluginHost } from './pluginHosts.js';
|
|
2
2
|
import { type PluginRuntime } from './pluginRuntime.js';
|
|
3
3
|
export declare function validatePackedBundle(bundle: string, host: PluginHost): void;
|
|
4
|
+
/** A host-registered folder is trusted only as a valid packed bundle inside a release checkout this installer owns. */
|
|
5
|
+
export declare function isManagedPackedBundle(runtime: PluginRuntime, host: PluginHost, folder: string): boolean;
|
|
4
6
|
export declare function ensureAgentPluginBundle(runtime: PluginRuntime, host: PluginHost): Promise<string>;
|
package/dist/pluginBundle.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { withOwnedPluginLock } from './pluginLock.js';
|
|
2
2
|
import { existsSync, lstatSync, mkdirSync, mkdtempSync, readdirSync, realpathSync, renameSync, rmSync, writeFileSync } from 'node:fs';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
import { AGENT_PLUGIN_GIT_URL, AGENT_PLUGIN_NAME, AGENT_PLUGIN_REPOSITORY, AGENT_PLUGIN_RELEASE } from './pluginHosts.js';
|
|
5
|
-
import { agentPluginRepositoryMatches } from './pluginInspection.js';
|
|
3
|
+
import { join, relative, sep } from 'node:path';
|
|
4
|
+
import { AGENT_PLUGIN_GIT_URL, AGENT_PLUGIN_NAME, AGENT_PLUGIN_REPOSITORY, AGENT_PLUGIN_RELEASE, agentPluginRepositoryMatches } from './pluginHosts.js';
|
|
6
5
|
import { assertPluginManagedPath, checkedPluginCommand, pluginHome, PluginInstallError, readPluginJson, readPluginText } from './pluginRuntime.js';
|
|
7
6
|
const RECEIPT = '.evolver-plugin-checkout.json';
|
|
8
7
|
export function validatePackedBundle(bundle, host) {
|
|
@@ -10,15 +9,14 @@ export function validatePackedBundle(bundle, host) {
|
|
|
10
9
|
if (root.isSymbolicLink() || !root.isDirectory())
|
|
11
10
|
throw new PluginInstallError('failed', 'The plugin bundle root is not an ordinary owned directory.');
|
|
12
11
|
const manifest = readPluginJson(join(bundle, host.manifest));
|
|
13
|
-
const expectedName = host.
|
|
12
|
+
const expectedName = host.packageName ?? AGENT_PLUGIN_NAME;
|
|
14
13
|
if (readPluginText(join(bundle, '.evolver-packed'))?.trim() !== host.id || manifest?.['name'] !== expectedName || typeof manifest['version'] !== 'string') {
|
|
15
14
|
throw new PluginInstallError('failed', `The release branch has no valid packed ${host.label} plugin. No host installation was attempted.`);
|
|
16
15
|
}
|
|
17
16
|
const repository = typeof manifest['repository'] === 'string' ? manifest['repository'] : manifest['repository']?.url;
|
|
18
17
|
if (!agentPluginRepositoryMatches(repository))
|
|
19
18
|
throw new PluginInstallError('failed', 'The packed plugin manifest identifies another repository.');
|
|
20
|
-
|
|
21
|
-
if (entries.some(entry => readPluginText(join(bundle, entry)) === undefined))
|
|
19
|
+
if (host.entries.some(entry => readPluginText(join(bundle, entry)) === undefined))
|
|
22
20
|
throw new PluginInstallError('failed', 'The packed plugin is missing an entry module.');
|
|
23
21
|
const queue = [bundle];
|
|
24
22
|
let count = 0;
|
|
@@ -34,8 +32,37 @@ export function validatePackedBundle(bundle, host) {
|
|
|
34
32
|
}
|
|
35
33
|
}
|
|
36
34
|
}
|
|
35
|
+
function agentPluginCacheBase(runtime) {
|
|
36
|
+
return join(realpathSync(pluginHome(runtime)), '.evolver', 'plugins', 'evolver-agent-plugin');
|
|
37
|
+
}
|
|
38
|
+
/** A host-registered folder is trusted only as a valid packed bundle inside a release checkout this installer owns. */
|
|
39
|
+
export function isManagedPackedBundle(runtime, host, folder) {
|
|
40
|
+
try {
|
|
41
|
+
const parts = relative(agentPluginCacheBase(runtime), realpathSync(folder)).split(sep);
|
|
42
|
+
if (parts.length !== 4 || !/^[a-f0-9]{40}$/.test(parts[0]) || parts[1] !== host.id || parts[2] !== 'dist' || parts[3] !== host.id)
|
|
43
|
+
return false;
|
|
44
|
+
validatePackedBundle(folder, host);
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/** `git status` must not run a command configured inside the cached checkout, so fsmonitor is forced off. */
|
|
52
|
+
async function assertPristineCheckout(runtime, checkout, commit) {
|
|
53
|
+
const git = ['-C', checkout, '-c', 'core.fsmonitor=false'];
|
|
54
|
+
const head = await checkedPluginCommand(runtime, 'git', [...git, 'rev-parse', 'HEAD']);
|
|
55
|
+
const changes = await checkedPluginCommand(runtime, 'git', [...git, 'status', '--porcelain', '--untracked-files=all', '--', '.', `:(exclude)${RECEIPT}`]);
|
|
56
|
+
if (head.stdout.trim() !== commit || changes.stdout.trim() !== '') {
|
|
57
|
+
throw new PluginInstallError('conflict', `The cached release checkout ${checkout} was modified after download; remove it and retry.`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/** A script host's installer imports the checkout's scripts, shared lib and host adapters next to its packed folder. */
|
|
61
|
+
function checkoutPaths(host) {
|
|
62
|
+
return host.kind === 'script' ? [`dist/${host.id}`, 'scripts', 'lib', 'hosts'] : [`dist/${host.id}`];
|
|
63
|
+
}
|
|
37
64
|
export async function ensureAgentPluginBundle(runtime, host) {
|
|
38
|
-
if (host.kind !== 'bundle')
|
|
65
|
+
if (host.kind !== 'bundle' && host.kind !== 'script')
|
|
39
66
|
throw new PluginInstallError('unsupported_capability', 'This host uses its native source installer, not the packed-checkout download path.');
|
|
40
67
|
if (!runtime.available('git'))
|
|
41
68
|
throw new PluginInstallError('host_missing', 'Git is required to fetch the packed plugin release.');
|
|
@@ -44,7 +71,7 @@ export async function ensureAgentPluginBundle(runtime, host) {
|
|
|
44
71
|
if (matches.length !== 1)
|
|
45
72
|
throw new PluginInstallError('failed', 'The plugin release branch did not resolve to one commit.');
|
|
46
73
|
const commit = matches[0][1];
|
|
47
|
-
const base =
|
|
74
|
+
const base = agentPluginCacheBase(runtime);
|
|
48
75
|
assertPluginManagedPath(base);
|
|
49
76
|
mkdirSync(base, { recursive: true, mode: 0o700 });
|
|
50
77
|
const lockPath = join(base, `${host.id}.lock`);
|
|
@@ -60,6 +87,7 @@ export async function ensureAgentPluginBundle(runtime, host) {
|
|
|
60
87
|
throw new PluginInstallError('conflict', 'The plugin cache directory is not an owned, matching release checkout.');
|
|
61
88
|
}
|
|
62
89
|
validatePackedBundle(join(checkout, 'dist', host.id), host);
|
|
90
|
+
await assertPristineCheckout(runtime, checkout, commit);
|
|
63
91
|
return join(checkout, 'dist');
|
|
64
92
|
}
|
|
65
93
|
stage = mkdtempSync(join(base, `.${host.id}-`));
|
|
@@ -69,7 +97,7 @@ export async function ensureAgentPluginBundle(runtime, host) {
|
|
|
69
97
|
const noHooks = join(stage, 'no-hooks');
|
|
70
98
|
mkdirSync(noHooks, { mode: 0o700 });
|
|
71
99
|
await checkedPluginCommand(runtime, 'git', ['-c', `core.hooksPath=${noHooks}`, 'clone', '--depth', '1', '--branch', AGENT_PLUGIN_RELEASE, '--filter=blob:none', '--sparse', AGENT_PLUGIN_GIT_URL, source], runtime.cwd, 120_000);
|
|
72
|
-
await checkedPluginCommand(runtime, 'git', ['-C', source, '-c', `core.hooksPath=${noHooks}`, 'sparse-checkout', 'set',
|
|
100
|
+
await checkedPluginCommand(runtime, 'git', ['-C', source, '-c', `core.hooksPath=${noHooks}`, 'sparse-checkout', 'set', ...checkoutPaths(host)], runtime.cwd, 120_000);
|
|
73
101
|
const head = await checkedPluginCommand(runtime, 'git', ['-C', source, 'rev-parse', 'HEAD']);
|
|
74
102
|
if (head.stdout.trim() !== commit)
|
|
75
103
|
throw new PluginInstallError('failed', 'The plugin release changed while downloading. Retry to use a consistent release.');
|
package/dist/pluginHosts.d.ts
CHANGED
|
@@ -3,18 +3,27 @@ export declare const AGENT_PLUGIN_GIT_URL = "https://github.com/EvoMap/evolver-a
|
|
|
3
3
|
export declare const AGENT_PLUGIN_NAME = "evolver-plugin";
|
|
4
4
|
export declare const AGENT_PLUGIN_RELEASE = "release";
|
|
5
5
|
export declare const DSH_PLUGIN_SOURCE = "github:EvoMap/evolver-agent-plugin#release&path:dist/dsh";
|
|
6
|
+
export declare function agentPluginRepositoryMatches(value: unknown): boolean;
|
|
6
7
|
export type PluginScope = 'user' | 'project';
|
|
7
|
-
type PluginHostId = 'claude-code' | 'codex' | 'grok' | 'qoder' | 'antigravity' | 'opencode' | 'dsh' | 'cursor' | 'workbuddy' | 'mcp-generic';
|
|
8
|
+
type PluginHostId = 'claude-code' | 'codex' | 'grok' | 'qoder' | 'antigravity' | 'opencode' | 'dsh' | 'zcode' | 'kimi' | 'stepcode' | 'minimax' | 'cursor' | 'workbuddy' | 'mcp-generic';
|
|
8
9
|
export interface PluginHost {
|
|
9
10
|
id: PluginHostId;
|
|
10
11
|
label: string;
|
|
11
12
|
command?: string;
|
|
12
13
|
minimumVersion?: string;
|
|
13
|
-
|
|
14
|
+
/** `script` runs the release checkout's own installer for the host. */
|
|
15
|
+
kind: 'marketplace' | 'bundle' | 'script' | 'profile' | 'manual';
|
|
14
16
|
scopes: readonly PluginScope[];
|
|
17
|
+
/** Hosts whose adapter is accepted only on these platforms. */
|
|
18
|
+
platforms?: readonly NodeJS.Platform[];
|
|
15
19
|
management?: 'plugin' | 'plugins';
|
|
16
20
|
marketplace?: string;
|
|
17
21
|
manifest?: string;
|
|
22
|
+
packageName?: string;
|
|
23
|
+
/** Files an installed (and packed) plugin must contain besides its manifest. */
|
|
24
|
+
entries: readonly string[];
|
|
25
|
+
/** The release checkout's installer, for `script` hosts. */
|
|
26
|
+
installer?: string;
|
|
18
27
|
/** Where the packed plugin sits inside the checkout path the host's inventory reports. */
|
|
19
28
|
packedSubdir?: string;
|
|
20
29
|
/** The host's installer refuses to install hooks/MCP/skills until the user passes its trust flag. */
|
|
@@ -31,6 +40,8 @@ export interface PluginInstallOptions {
|
|
|
31
40
|
profile: string;
|
|
32
41
|
dryRun: boolean;
|
|
33
42
|
trust: boolean;
|
|
43
|
+
/** The host CLI's argv prefix: its command, or node plus a CLI script for hosts that ship one. */
|
|
44
|
+
launcher: readonly string[];
|
|
34
45
|
}
|
|
35
46
|
export interface PluginCommandStep {
|
|
36
47
|
name: string;
|
package/dist/pluginHosts.js
CHANGED
|
@@ -1,49 +1,86 @@
|
|
|
1
|
+
import { dirname, join } from 'node:path';
|
|
1
2
|
export const AGENT_PLUGIN_REPOSITORY = 'EvoMap/evolver-agent-plugin';
|
|
2
3
|
export const AGENT_PLUGIN_GIT_URL = `https://github.com/${AGENT_PLUGIN_REPOSITORY}.git`;
|
|
3
4
|
export const AGENT_PLUGIN_NAME = 'evolver-plugin';
|
|
4
5
|
export const AGENT_PLUGIN_RELEASE = 'release';
|
|
5
6
|
export const DSH_PLUGIN_SOURCE = `github:${AGENT_PLUGIN_REPOSITORY}#${AGENT_PLUGIN_RELEASE}&path:dist/dsh`;
|
|
7
|
+
export function agentPluginRepositoryMatches(value) {
|
|
8
|
+
if (typeof value !== 'string')
|
|
9
|
+
return false;
|
|
10
|
+
const source = value.trim().toLowerCase().replace(/^git\+/, '').replace(/^git@github\.com:/, 'https://github.com/').replace(/^ssh:\/\/git@github\.com\//, 'https://github.com/').replace(/\/$/, '').replace(/\.git$/, '');
|
|
11
|
+
return source === AGENT_PLUGIN_GIT_URL.toLowerCase().replace(/\.git$/, '') || source === AGENT_PLUGIN_REPOSITORY.toLowerCase();
|
|
12
|
+
}
|
|
6
13
|
export const PLUGIN_HOSTS = [
|
|
7
14
|
{
|
|
8
15
|
id: 'claude-code', label: 'Claude Code', command: 'claude', minimumVersion: '2.1.286',
|
|
9
16
|
kind: 'marketplace', management: 'plugin', marketplace: 'evolver-agent-plugin',
|
|
10
|
-
scopes: ['user', 'project'], manifest: '.claude-plugin/plugin.json',
|
|
17
|
+
scopes: ['user', 'project'], manifest: '.claude-plugin/plugin.json', entries: ['hooks/hooks.json', 'hooks/register.ts', 'bin/relay.mjs'],
|
|
11
18
|
legacyNames: ['evolver', 'evolver-mods', 'evolver-agent-plugin'],
|
|
12
19
|
instructions: ['Restart Claude Code. Installed hooks modules also require the host rollout flag; an installed plugin is not proof that recall is active.'],
|
|
13
20
|
},
|
|
14
21
|
{
|
|
15
22
|
id: 'codex', label: 'Codex', command: 'codex', minimumVersion: '0.164.0', kind: 'marketplace', management: 'plugin', marketplace: 'evomap',
|
|
16
|
-
scopes: ['user'], manifest: '.codex-plugin/plugin.json', legacyNames: ['evolver'],
|
|
23
|
+
scopes: ['user'], manifest: '.codex-plugin/plugin.json', entries: ['hooks/hooks.json', 'bin/hook.mjs'], legacyNames: ['evolver'],
|
|
17
24
|
instructions: ['Open /hooks in Codex, review and trust the Evolver hooks, then start a new thread.'],
|
|
18
25
|
},
|
|
19
26
|
{
|
|
20
27
|
id: 'grok', label: 'Grok CLI', command: 'grok', minimumVersion: '1.0.70',
|
|
21
|
-
kind: 'marketplace', management: 'plugin', marketplace: 'evolver-agent-plugin', scopes: ['user'], manifest: '.grok-plugin/plugin.json',
|
|
28
|
+
kind: 'marketplace', management: 'plugin', marketplace: 'evolver-agent-plugin', scopes: ['user'], manifest: '.grok-plugin/plugin.json', entries: ['hooks/hooks.json', 'bin/hook.mjs'],
|
|
22
29
|
packedSubdir: 'dist/grok', requiresTrust: true, legacyNames: ['evolver', 'evolver-grok-plugin'],
|
|
23
30
|
instructions: ['Restart Grok and review its hook trust settings. Recall reaches the first tool result; a turn without tools receives no strategy.'],
|
|
24
31
|
},
|
|
25
32
|
{
|
|
26
33
|
id: 'qoder', label: 'Qoder CLI', command: 'qodercli', minimumVersion: '1.1.79',
|
|
27
|
-
kind: 'marketplace', management: 'plugins', marketplace: 'evomap', scopes: ['user'], manifest: '.qoder-plugin/plugin.json',
|
|
34
|
+
kind: 'marketplace', management: 'plugins', marketplace: 'evomap', scopes: ['user'], manifest: '.qoder-plugin/plugin.json', entries: ['hooks/hooks.json', 'bin/hook.mjs'],
|
|
28
35
|
legacyNames: ['evolver', 'evolver-qoder-plugin'], instructions: ['Start a new Qoder session or run /plugins reload.'],
|
|
29
36
|
},
|
|
30
37
|
{
|
|
31
38
|
id: 'antigravity', label: 'Antigravity', command: 'agy', kind: 'bundle', management: 'plugin',
|
|
32
|
-
scopes: ['user'], manifest: 'plugin.json', legacyNames: ['evolver-antigravity-plugin'],
|
|
39
|
+
scopes: ['user'], manifest: 'plugin.json', entries: ['hooks.json', 'bin/hook.mjs'], legacyNames: ['evolver-antigravity-plugin'],
|
|
33
40
|
instructions: ['Restart Antigravity. Its commands run from the installed plugin with node bin/command.mjs antigravity <command>.'],
|
|
34
41
|
},
|
|
35
42
|
{
|
|
36
43
|
id: 'opencode', label: 'OpenCode', command: 'opencode', minimumVersion: '1.19.4', kind: 'bundle',
|
|
37
|
-
scopes: ['user', 'project'], manifest: 'package.json',
|
|
44
|
+
scopes: ['user', 'project'], manifest: 'package.json', packageName: '@evomap/evolver-opencode', entries: ['server.mjs', 'tui.mjs'],
|
|
45
|
+
legacyNames: ['evolver-opencode-plugin'],
|
|
38
46
|
instructions: ['Restart OpenCode. Both the server entry in opencode.json and the TUI entry in tui.json must be registered.'],
|
|
39
47
|
},
|
|
40
48
|
{
|
|
41
49
|
id: 'dsh', label: 'DeepSeek Harness', command: 'dsh', minimumVersion: '0.1.5', kind: 'profile',
|
|
42
|
-
scopes: ['user'], manifest: 'package.json', legacyNames: ['@evomap/dsh-evolver'],
|
|
50
|
+
scopes: ['user'], manifest: 'package.json', packageName: '@evomap/dsh-evolver', entries: ['plugin.mjs'], legacyNames: ['@evomap/dsh-evolver'],
|
|
43
51
|
instructions: ['Restart dsh. Installation applies only to the selected profile; repeat for other profiles. DSH Desktop requires its own bundled CLI/profile.'],
|
|
44
52
|
},
|
|
45
53
|
{
|
|
46
|
-
id: '
|
|
54
|
+
id: 'zcode', label: 'ZCode', command: 'zcode', kind: 'bundle', management: 'plugins', marketplace: 'evolver-zcode-local',
|
|
55
|
+
scopes: ['user'], platforms: ['win32', 'darwin'], manifest: '.zcode-plugin/plugin.json', entries: ['hooks/hooks.json', 'bin/hook.mjs'], legacyNames: [],
|
|
56
|
+
instructions: [
|
|
57
|
+
'Start a new ZCode session. ZCode CLI and Desktop share this installation; plugins and hooks must be enabled in ZCode.',
|
|
58
|
+
'Evolver runs the CLI shipped with ZCode Desktop, or the standalone zcode.cjs named by ZCODE_CLI_PATH.',
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: 'kimi', label: 'Kimi Code', command: 'kimi', kind: 'script', installer: 'scripts/install-kimi.mjs',
|
|
63
|
+
scopes: ['user'], platforms: ['win32'], manifest: 'kimi.plugin.json', entries: ['bin/hook.mjs'], legacyNames: [],
|
|
64
|
+
instructions: [
|
|
65
|
+
'Close Kimi Code before installing or updating, then start a new CLI or Desktop session.',
|
|
66
|
+
'KIMI_CODE_HOME selects the profile root; start Kimi with the same value.',
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: 'stepcode', label: 'Step Code', command: 'step', kind: 'bundle', scopes: ['user'], platforms: ['win32'],
|
|
71
|
+
manifest: 'package.json', packageName: '@evomap/stepcode-evolver', entries: ['plugin.mjs'], legacyNames: [],
|
|
72
|
+
instructions: ['Start a new Step Code session. The adapter is a Windows draft for Step Code CLI 0.1.7; STEP_CODING_AGENT_DIR selects the profile.'],
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: 'minimax', label: 'MiniMax Code', command: 'mcode', kind: 'script', installer: 'scripts/install-minimax.mjs',
|
|
76
|
+
scopes: ['user'], manifest: '.minimax-plugin/plugin.json', entries: ['hooks/hooks.json', 'bin/hook.mjs'], legacyNames: [],
|
|
77
|
+
instructions: [
|
|
78
|
+
'Start a new MiniMax task. MINIMAX_DATA_DIR selects the data root; keep it the same for mcode.',
|
|
79
|
+
'To pause the plugin: mcode plugin disable evolver-plugin@local --json',
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: 'cursor', label: 'Cursor', command: 'cursor-agent', kind: 'manual', scopes: ['user'], entries: [],
|
|
47
84
|
legacyNames: ['evolver-cursor-plugin'],
|
|
48
85
|
instructions: [
|
|
49
86
|
`In Cursor's plugin marketplace, add ${AGENT_PLUGIN_REPOSITORY} and install evolver-plugin.`,
|
|
@@ -52,7 +89,7 @@ export const PLUGIN_HOSTS = [
|
|
|
52
89
|
],
|
|
53
90
|
},
|
|
54
91
|
{
|
|
55
|
-
id: 'workbuddy', label: 'WorkBuddy / CodeBuddy', command: 'codebuddy', kind: 'manual', scopes: ['user', 'project'],
|
|
92
|
+
id: 'workbuddy', label: 'WorkBuddy / CodeBuddy', command: 'codebuddy', kind: 'manual', scopes: ['user', 'project'], entries: [],
|
|
56
93
|
legacyNames: ['evolver'],
|
|
57
94
|
instructions: [
|
|
58
95
|
'In WorkBuddy, if the standalone plugin is installed: /plugin uninstall evolver@evomap-workbuddy --keep-data (repeat with --scope project where applicable).',
|
|
@@ -63,7 +100,7 @@ export const PLUGIN_HOSTS = [
|
|
|
63
100
|
],
|
|
64
101
|
},
|
|
65
102
|
{
|
|
66
|
-
id: 'mcp-generic', label: 'Generic MCP client', kind: 'manual', scopes: ['user'], legacyNames: [],
|
|
103
|
+
id: 'mcp-generic', label: 'Generic MCP client', kind: 'manual', scopes: ['user'], entries: [], legacyNames: [],
|
|
67
104
|
instructions: [
|
|
68
105
|
`git clone --depth 1 --branch release ${AGENT_PLUGIN_GIT_URL}`,
|
|
69
106
|
'In that checkout, run npm ci; the stdio server requires the MCP SDK.',
|
|
@@ -73,36 +110,50 @@ export const PLUGIN_HOSTS = [
|
|
|
73
110
|
},
|
|
74
111
|
];
|
|
75
112
|
export function pluginHostNamed(name) {
|
|
76
|
-
const aliases = {
|
|
113
|
+
const aliases = {
|
|
114
|
+
claude: 'claude-code', codebuddy: 'workbuddy', 'deepseek-harness': 'dsh', mcp: 'mcp-generic', 'kimi-code': 'kimi', step: 'stepcode', mcode: 'minimax',
|
|
115
|
+
};
|
|
77
116
|
return PLUGIN_HOSTS.find(host => host.id === (aliases[name] ?? name));
|
|
78
117
|
}
|
|
118
|
+
function marketplaceInstallSteps({ host, scope, trust }, step) {
|
|
119
|
+
const management = host.management;
|
|
120
|
+
const selector = host.id === 'grok' ? AGENT_PLUGIN_NAME : `${AGENT_PLUGIN_NAME}@${host.marketplace}`;
|
|
121
|
+
const install = host.id === 'codex'
|
|
122
|
+
? [management, 'add', selector, '--json']
|
|
123
|
+
: [management, 'install', selector, ...(host.id === 'claude-code' ? ['--scope', scope, '--json'] : []), ...(host.requiresTrust && trust ? ['--trust'] : [])];
|
|
124
|
+
return [step('marketplace', [management, 'marketplace', 'add', AGENT_PLUGIN_REPOSITORY]), step('install', install)];
|
|
125
|
+
}
|
|
126
|
+
function scriptInstallSteps(host, bundle, step) {
|
|
127
|
+
const installer = { name: 'install', command: 'node', args: [join(dirname(bundle), host.installer), 'install'] };
|
|
128
|
+
return host.id === 'minimax' ? [installer, step('enable', ['plugin', 'enable', `${AGENT_PLUGIN_NAME}@local`, '--json'])] : [installer];
|
|
129
|
+
}
|
|
79
130
|
export function pluginInstallSteps(options, bundle = '<release-checkout>/dist') {
|
|
80
|
-
const { host, scope, profile
|
|
81
|
-
const command =
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
: [management, 'install', selector, ...(host.id === 'claude-code' ? ['--scope', scope, '--json'] : []), ...(host.requiresTrust && trust ? ['--trust'] : [])];
|
|
131
|
+
const { host, scope, profile } = options;
|
|
132
|
+
const [command = '', ...prefix] = options.launcher;
|
|
133
|
+
const step = (name, args) => ({ name, command, args: [...prefix, ...args] });
|
|
134
|
+
if (host.kind === 'marketplace')
|
|
135
|
+
return marketplaceInstallSteps(options, step);
|
|
136
|
+
if (host.kind === 'script')
|
|
137
|
+
return scriptInstallSteps(host, bundle, step);
|
|
138
|
+
if (host.id === 'zcode') {
|
|
89
139
|
return [
|
|
90
|
-
|
|
91
|
-
|
|
140
|
+
step('marketplace', ['plugins', 'marketplace', 'add', join(bundle, 'zcode'), '--json']),
|
|
141
|
+
step('install', ['plugins', 'install', `${AGENT_PLUGIN_NAME}@${host.marketplace}`, '--scope', scope, '--json']),
|
|
92
142
|
];
|
|
93
143
|
}
|
|
94
144
|
if (host.id === 'antigravity')
|
|
95
|
-
return [
|
|
145
|
+
return [step('install', ['plugin', 'install', `${bundle}/antigravity`])];
|
|
96
146
|
if (host.id === 'opencode')
|
|
97
|
-
return [
|
|
147
|
+
return [step('install', ['plugin', `${bundle}/opencode`, ...(scope === 'user' ? ['-g'] : [])])];
|
|
148
|
+
if (host.id === 'stepcode')
|
|
149
|
+
return [step('install', ['install', join(bundle, 'stepcode')])];
|
|
98
150
|
if (host.id === 'dsh')
|
|
99
|
-
return [
|
|
100
|
-
name: 'install', command, args: ['plugin', '--profile', profile, 'add', '-w', DSH_PLUGIN_SOURCE],
|
|
101
|
-
}];
|
|
151
|
+
return [step('install', ['plugin', '--profile', profile, 'add', '-w', DSH_PLUGIN_SOURCE])];
|
|
102
152
|
return [];
|
|
103
153
|
}
|
|
104
|
-
export function pluginRollbackInstructions(options, bundle) {
|
|
154
|
+
export function pluginRollbackInstructions(options, bundle = '<release-checkout>/dist') {
|
|
105
155
|
const { host, scope, profile } = options;
|
|
156
|
+
const cli = options.launcher.map(part => (/\s/.test(part) ? JSON.stringify(part) : part)).join(' ');
|
|
106
157
|
if (host.id === 'claude-code')
|
|
107
158
|
return [`claude plugin uninstall ${AGENT_PLUGIN_NAME}@${host.marketplace} --scope ${scope} --keep-data`];
|
|
108
159
|
if (host.id === 'codex')
|
|
@@ -116,7 +167,15 @@ export function pluginRollbackInstructions(options, bundle) {
|
|
|
116
167
|
if (host.id === 'dsh')
|
|
117
168
|
return [`dsh plugin --profile ${profile} remove @evomap/dsh-evolver`];
|
|
118
169
|
if (host.id === 'opencode')
|
|
119
|
-
return [`Remove only this plugin's ${bundle
|
|
170
|
+
return [`Remove only this plugin's ${bundle}/opencode/server.mjs and tui.mjs entries from opencode.json and tui.json; preserve neighboring configuration.`];
|
|
171
|
+
if (host.id === 'zcode')
|
|
172
|
+
return [`${cli} plugins uninstall ${AGENT_PLUGIN_NAME}@${host.marketplace} --scope ${scope}`];
|
|
173
|
+
if (host.id === 'kimi')
|
|
174
|
+
return [`node ${join(dirname(bundle), host.installer)} remove`];
|
|
175
|
+
if (host.id === 'stepcode')
|
|
176
|
+
return [`step remove ${join(bundle, 'stepcode')}`];
|
|
177
|
+
if (host.id === 'minimax')
|
|
178
|
+
return [`mcode plugin remove ${AGENT_PLUGIN_NAME}@local --json`];
|
|
120
179
|
return [];
|
|
121
180
|
}
|
|
122
181
|
const SHELL_SAFE_ARGUMENT = /^[A-Za-z0-9@._/][A-Za-z0-9@._/-]*$/;
|
|
@@ -18,7 +18,7 @@ export interface PluginInspection {
|
|
|
18
18
|
migrations: string[];
|
|
19
19
|
}
|
|
20
20
|
export declare function installedPluginsFromJson(value: unknown, host: PluginHost): InstalledAgentPlugin[];
|
|
21
|
-
export declare function agentPluginRepositoryMatches(value: unknown): boolean;
|
|
22
21
|
export declare function verifyPluginManifest(runtime: PluginRuntime, options: PluginInstallOptions, plugin: InstalledAgentPlugin, installAnswer?: unknown): string;
|
|
23
22
|
export declare function inspectOpenCodePlugin(runtime: PluginRuntime, options: PluginInstallOptions): PluginInspection;
|
|
24
|
-
|
|
23
|
+
/** `bundle` is the release checkout's dist folder, which a `script` host's own status command needs. */
|
|
24
|
+
export declare function inspectAgentPlugin(runtime: PluginRuntime, options: PluginInstallOptions, bundle?: string): Promise<PluginInspection>;
|
package/dist/pluginInspection.js
CHANGED
|
@@ -2,7 +2,9 @@ import { resolveOpenCodeConfig } from '@evomap/evolver-mcp';
|
|
|
2
2
|
import { existsSync } from 'node:fs';
|
|
3
3
|
import { dirname, join, resolve } from 'node:path';
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
|
-
import {
|
|
5
|
+
import { agentPluginRepositoryMatches, AGENT_PLUGIN_NAME, AGENT_PLUGIN_REPOSITORY, standalonePluginRemoval } from './pluginHosts.js';
|
|
6
|
+
import { isManagedPackedBundle } from './pluginBundle.js';
|
|
7
|
+
import { inspectScriptPlugin, inspectStepCodePlugin } from './pluginLocalInspection.js';
|
|
6
8
|
import { checkedPluginCommand, objectOf, pluginHome, pluginJson, pluginVersionAtLeast, PluginInstallError, readPluginJson, readPluginText } from './pluginRuntime.js';
|
|
7
9
|
function listRecords(value, key, label) {
|
|
8
10
|
const list = Array.isArray(value) ? value : objectOf(value)?.[key];
|
|
@@ -21,16 +23,10 @@ export function installedPluginsFromJson(value, host) {
|
|
|
21
23
|
throw new PluginInstallError('unsupported_capability', `${host.label} plugin list has an unnamed entry.`);
|
|
22
24
|
return {
|
|
23
25
|
id, name, version: stringOf(raw['version']) ?? '', enabled: raw['enabled'] !== false,
|
|
24
|
-
scope: stringOf(raw['scope']), path: stringOf(raw['installPath']) ?? stringOf(raw['installedPath']) ?? stringOf(raw['path']), raw,
|
|
26
|
+
scope: stringOf(raw['scope']), path: stringOf(raw['installPath']) ?? stringOf(raw['installedPath']) ?? stringOf(raw['rootPath']) ?? stringOf(raw['path']), raw,
|
|
25
27
|
};
|
|
26
28
|
});
|
|
27
29
|
}
|
|
28
|
-
export function agentPluginRepositoryMatches(value) {
|
|
29
|
-
if (typeof value !== 'string')
|
|
30
|
-
return false;
|
|
31
|
-
const source = value.trim().toLowerCase().replace(/^git\+/, '').replace(/^git@github\.com:/, 'https://github.com/').replace(/^ssh:\/\/git@github\.com\//, 'https://github.com/').replace(/\/$/, '').replace(/\.git$/, '');
|
|
32
|
-
return source === AGENT_PLUGIN_GIT_URL.toLowerCase().replace(/\.git$/, '') || source === AGENT_PLUGIN_REPOSITORY.toLowerCase();
|
|
33
|
-
}
|
|
34
30
|
function packageRepositoryOf(value) {
|
|
35
31
|
return typeof value === 'string' ? value : objectOf(value)?.['url'];
|
|
36
32
|
}
|
|
@@ -38,9 +34,14 @@ function repositoryOf(record) {
|
|
|
38
34
|
return record['repo'] ?? objectOf(record['marketplaceSource'])?.['source']
|
|
39
35
|
?? objectOf(record['source'])?.['url'] ?? (typeof record['source'] === 'string' ? record['source'] : undefined);
|
|
40
36
|
}
|
|
41
|
-
async function marketplaceMatches(runtime, record) {
|
|
37
|
+
async function marketplaceMatches(runtime, host, record) {
|
|
42
38
|
if (agentPluginRepositoryMatches(repositoryOf(record)))
|
|
43
39
|
return true;
|
|
40
|
+
const source = objectOf(record['source']);
|
|
41
|
+
if (source?.['source'] === 'directory') {
|
|
42
|
+
const folder = stringOf(source['path']);
|
|
43
|
+
return folder !== undefined && isManagedPackedBundle(runtime, host, folder);
|
|
44
|
+
}
|
|
44
45
|
const root = stringOf(record['root']) ?? stringOf(record['installLocation']);
|
|
45
46
|
if (!root)
|
|
46
47
|
return false;
|
|
@@ -85,14 +86,15 @@ function hasForeignInstalledScope(plugin, scope) {
|
|
|
85
86
|
async function inspectMarketplacePlugin(runtime, options) {
|
|
86
87
|
const { host, scope } = options;
|
|
87
88
|
const management = host.management;
|
|
88
|
-
const
|
|
89
|
+
const [command, ...prefix] = options.launcher;
|
|
90
|
+
const pluginResult = await checkedPluginCommand(runtime, command, [...prefix, management, 'list', '--json'], options.root);
|
|
89
91
|
const plugins = installedPluginsFromJson(pluginJson(pluginResult.stdout, `${host.label} plugin list`), host);
|
|
90
|
-
const marketResult = await checkedPluginCommand(runtime,
|
|
92
|
+
const marketResult = await checkedPluginCommand(runtime, command, [...prefix, management, 'marketplace', 'list', '--json'], options.root);
|
|
91
93
|
const markets = listRecords(pluginJson(marketResult.stdout, `${host.label} marketplace list`), 'marketplaces', `${host.label} marketplace list`);
|
|
92
94
|
const market = markets.find(record => record['name'] === host.marketplace);
|
|
93
95
|
const conflicts = oldHookConflicts(runtime, options);
|
|
94
96
|
const migrations = [];
|
|
95
|
-
if (market && !await marketplaceMatches(runtime, market))
|
|
97
|
+
if (market && !await marketplaceMatches(runtime, host, market))
|
|
96
98
|
conflicts.push(`Marketplace ${host.marketplace} belongs to another source. Review its plugins before replacing it with ${AGENT_PLUGIN_REPOSITORY}.`);
|
|
97
99
|
for (const plugin of plugins) {
|
|
98
100
|
if (host.legacyNames.includes(plugin.name) && plugin.enabled) {
|
|
@@ -122,8 +124,7 @@ export function verifyPluginManifest(runtime, options, plugin, installAnswer) {
|
|
|
122
124
|
if (!path || !host.manifest)
|
|
123
125
|
throw new PluginInstallError('failed', 'The host did not identify a verifiable installed plugin directory.');
|
|
124
126
|
const manifest = readPluginJson(join(path, host.manifest));
|
|
125
|
-
|
|
126
|
-
if (!manifest || manifest['name'] !== expectedName || manifest['version'] !== plugin.version) {
|
|
127
|
+
if (!manifest || manifest['name'] !== (host.packageName ?? AGENT_PLUGIN_NAME) || manifest['version'] !== plugin.version) {
|
|
127
128
|
throw new PluginInstallError('failed', 'The host registration and installed plugin manifest do not agree; installation was not confirmed.');
|
|
128
129
|
}
|
|
129
130
|
const repository = packageRepositoryOf(manifest?.['repository']);
|
|
@@ -131,8 +132,7 @@ export function verifyPluginManifest(runtime, options, plugin, installAnswer) {
|
|
|
131
132
|
throw new PluginInstallError('conflict', 'The installed plugin manifest does not identify the unified Evolver plugin source.');
|
|
132
133
|
if (readPluginText(join(path, '.evolver-packed'))?.trim() !== host.id)
|
|
133
134
|
throw new PluginInstallError('failed', 'The installed plugin is not the packed artifact for the selected host.');
|
|
134
|
-
|
|
135
|
-
if (entries.some(entry => !existsSync(join(path, entry))))
|
|
135
|
+
if (host.entries.some(entry => !existsSync(join(path, entry))))
|
|
136
136
|
throw new PluginInstallError('failed', 'The installed plugin is missing its hook/plugin entry files.');
|
|
137
137
|
return path;
|
|
138
138
|
}
|
|
@@ -227,14 +227,20 @@ function inspectDshPlugin(runtime, options) {
|
|
|
227
227
|
? { id: AGENT_PLUGIN_NAME, name: AGENT_PLUGIN_NAME, version: manifest['version'], enabled: true, path, raw: manifest } : undefined;
|
|
228
228
|
return { installed, marketplacePresent: false, conflicts, migrations };
|
|
229
229
|
}
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
/** `bundle` is the release checkout's dist folder, which a `script` host's own status command needs. */
|
|
231
|
+
export async function inspectAgentPlugin(runtime, options, bundle) {
|
|
232
|
+
if (options.host.marketplace)
|
|
232
233
|
return inspectMarketplacePlugin(runtime, options);
|
|
234
|
+
if (options.host.kind === 'script')
|
|
235
|
+
return inspectScriptPlugin(runtime, options, bundle);
|
|
236
|
+
if (options.host.id === 'stepcode')
|
|
237
|
+
return inspectStepCodePlugin(runtime, options);
|
|
233
238
|
if (options.host.id === 'opencode')
|
|
234
239
|
return inspectOpenCodePlugin(runtime, options);
|
|
235
240
|
if (options.host.id === 'dsh')
|
|
236
241
|
return inspectDshPlugin(runtime, options);
|
|
237
|
-
const
|
|
242
|
+
const [command, ...prefix] = options.launcher;
|
|
243
|
+
const result = await checkedPluginCommand(runtime, command, [...prefix, 'plugin', 'list', '--json'], options.root);
|
|
238
244
|
const plugins = installedPluginsFromJson(pluginJson(result.stdout, 'Antigravity plugin list'), options.host);
|
|
239
245
|
const installed = plugins.find(plugin => plugin.name === AGENT_PLUGIN_NAME);
|
|
240
246
|
const standalone = plugins.filter(plugin => options.host.legacyNames.includes(plugin.name) && plugin.enabled);
|
package/dist/pluginInstall.js
CHANGED
|
@@ -2,11 +2,19 @@ import { ensureAgentPluginBundle } from './pluginBundle.js';
|
|
|
2
2
|
import { assertDshProfileStoreMatches } from './pluginDshStore.js';
|
|
3
3
|
import { AGENT_PLUGIN_NAME, AGENT_PLUGIN_REPOSITORY, pluginInstallSteps, pluginRollbackInstructions } from './pluginHosts.js';
|
|
4
4
|
import { inspectAgentPlugin, verifyPluginManifest } from './pluginInspection.js';
|
|
5
|
+
import { hostLauncher } from './pluginLauncher.js';
|
|
5
6
|
import { withPluginInstallLock } from './pluginLock.js';
|
|
6
7
|
import { checkedPluginCommand, checkPluginHostVersion, PluginInstallError } from './pluginRuntime.js';
|
|
7
8
|
function trustInstruction(host) {
|
|
8
9
|
return `${host.label} asks you to trust a plugin before it installs. Review ${AGENT_PLUGIN_REPOSITORY}, then rerun with --trust: evolver plugin install --host ${host.id} --trust`;
|
|
9
10
|
}
|
|
11
|
+
async function useReleaseCheckout(runtime, options, result) {
|
|
12
|
+
const bundle = await ensureAgentPluginBundle(runtime, options.host);
|
|
13
|
+
result.completed.push('download');
|
|
14
|
+
result.commands = pluginInstallSteps(options, bundle);
|
|
15
|
+
result.rollback = pluginRollbackInstructions(options, bundle);
|
|
16
|
+
return bundle;
|
|
17
|
+
}
|
|
10
18
|
function assertNoConflicts(inspection) {
|
|
11
19
|
if (inspection.conflicts.length > 0)
|
|
12
20
|
throw new PluginInstallError('conflict', inspection.conflicts.join('\n'), inspection.migrations);
|
|
@@ -39,15 +47,16 @@ export async function installAgentPlugin(runtime, options) {
|
|
|
39
47
|
return { ...result, status: 'trust_required', error: `${host.label} installs plugin hooks, MCP servers and skills only after you trust the plugin. No host command was run.`, instructions: [trustInstruction(host)] };
|
|
40
48
|
}
|
|
41
49
|
try {
|
|
42
|
-
await checkPluginHostVersion(runtime, host);
|
|
43
|
-
let
|
|
50
|
+
await checkPluginHostVersion(runtime, host, hostLauncher(runtime, host));
|
|
51
|
+
let bundle = host.kind === 'script' ? await useReleaseCheckout(runtime, options, result) : undefined;
|
|
52
|
+
let inspection = await inspectAgentPlugin(runtime, options, bundle);
|
|
44
53
|
assertNoConflicts(inspection);
|
|
45
54
|
if (inspection.installed) {
|
|
46
55
|
const installedPath = verifyPluginManifest(runtime, options, inspection.installed);
|
|
47
56
|
return { ...result, ok: true, status: 'already_installed', verified: true, version: inspection.installed.version, installedPath, commands: [] };
|
|
48
57
|
}
|
|
49
58
|
return await withPluginInstallLock(runtime, options, async () => {
|
|
50
|
-
inspection = await inspectAgentPlugin(runtime, options);
|
|
59
|
+
inspection = await inspectAgentPlugin(runtime, options, bundle);
|
|
51
60
|
assertNoConflicts(inspection);
|
|
52
61
|
if (inspection.installed) {
|
|
53
62
|
const installedPath = verifyPluginManifest(runtime, options, inspection.installed);
|
|
@@ -55,13 +64,8 @@ export async function installAgentPlugin(runtime, options) {
|
|
|
55
64
|
}
|
|
56
65
|
if (host.id === 'dsh')
|
|
57
66
|
await assertDshProfileStoreMatches(runtime, options);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
bundle = await ensureAgentPluginBundle(runtime, host);
|
|
61
|
-
result.completed.push('download');
|
|
62
|
-
result.commands = pluginInstallSteps(options, bundle);
|
|
63
|
-
result.rollback = pluginRollbackInstructions(options, bundle);
|
|
64
|
-
}
|
|
67
|
+
if (host.kind === 'bundle')
|
|
68
|
+
bundle = await useReleaseCheckout(runtime, options, result);
|
|
65
69
|
let installAnswer;
|
|
66
70
|
for (const step of result.commands) {
|
|
67
71
|
if (step.name === 'marketplace' && inspection.marketplacePresent)
|
|
@@ -69,7 +73,7 @@ export async function installAgentPlugin(runtime, options) {
|
|
|
69
73
|
const executed = await checkedPluginCommand(runtime, step.command, step.args, options.root, 120_000);
|
|
70
74
|
result.completed.push(step.name);
|
|
71
75
|
if (step.name === 'marketplace') {
|
|
72
|
-
inspection = await inspectAgentPlugin(runtime, options);
|
|
76
|
+
inspection = await inspectAgentPlugin(runtime, options, bundle);
|
|
73
77
|
if (!inspection.marketplacePresent || inspection.conflicts.length > 0) {
|
|
74
78
|
throw new PluginInstallError('conflict', 'The registered marketplace could not be confirmed as the unified plugin source. No plugin install was attempted.');
|
|
75
79
|
}
|
|
@@ -81,7 +85,7 @@ export async function installAgentPlugin(runtime, options) {
|
|
|
81
85
|
catch { /* Some native installers report human-readable progress; the final inventory is authoritative. */ }
|
|
82
86
|
}
|
|
83
87
|
}
|
|
84
|
-
inspection = await inspectAgentPlugin(runtime, options);
|
|
88
|
+
inspection = await inspectAgentPlugin(runtime, options, bundle);
|
|
85
89
|
assertNoConflicts(inspection);
|
|
86
90
|
if (!inspection.installed)
|
|
87
91
|
throw new PluginInstallError('failed', `The ${AGENT_PLUGIN_NAME} command completed, but the selected host/scope did not register it. Installation was not confirmed.`);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PluginHost } from './pluginHosts.js';
|
|
2
|
+
import { type PluginRuntime } from './pluginRuntime.js';
|
|
3
|
+
/** The argv prefix that runs the host's own CLI, or undefined when it is not present on this machine. ZCode's CLI is
|
|
4
|
+
* a Node script, never a `zcode` executable on PATH. */
|
|
5
|
+
export declare function hostLauncher(runtime: PluginRuntime, host: PluginHost): string[] | undefined;
|
|
6
|
+
/** What a preview shows when the host CLI is absent: the command a real install would run. */
|
|
7
|
+
export declare function expectedHostLauncher(runtime: PluginRuntime, host: PluginHost): string[];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { statSync } from 'node:fs';
|
|
2
|
+
import { isAbsolute, join } from 'node:path';
|
|
3
|
+
import { pluginHome } from './pluginRuntime.js';
|
|
4
|
+
const ZCODE_DESKTOP_CLI = ['resources', 'glm', 'zcode.cjs'];
|
|
5
|
+
const ZCODE_MAC_CLI = ['ZCode.app', 'Contents', 'Resources', 'glm', 'zcode.cjs'];
|
|
6
|
+
const isFile = (path) => {
|
|
7
|
+
try {
|
|
8
|
+
return statSync(path).isFile();
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
/** ZCode ships its CLI as a Node script inside Desktop; ZCODE_CLI_PATH names another copy of that zcode.cjs script. */
|
|
15
|
+
function zcodeCliCandidates(runtime) {
|
|
16
|
+
const explicit = runtime.env['ZCODE_CLI_PATH']?.trim();
|
|
17
|
+
if (explicit)
|
|
18
|
+
return isAbsolute(explicit) ? [explicit] : [];
|
|
19
|
+
const home = pluginHome(runtime);
|
|
20
|
+
if (runtime.platform === 'win32')
|
|
21
|
+
return [join(runtime.env['LOCALAPPDATA'] || join(home, 'AppData', 'Local'), 'Programs', 'ZCode', ...ZCODE_DESKTOP_CLI)];
|
|
22
|
+
if (runtime.platform === 'darwin')
|
|
23
|
+
return [join(home, 'Applications', ...ZCODE_MAC_CLI), join('/Applications', ...ZCODE_MAC_CLI)];
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
/** The argv prefix that runs the host's own CLI, or undefined when it is not present on this machine. ZCode's CLI is
|
|
27
|
+
* a Node script, never a `zcode` executable on PATH. */
|
|
28
|
+
export function hostLauncher(runtime, host) {
|
|
29
|
+
if (host.id === 'zcode') {
|
|
30
|
+
const cli = zcodeCliCandidates(runtime).find(isFile);
|
|
31
|
+
return cli && runtime.available('node') ? ['node', cli] : undefined;
|
|
32
|
+
}
|
|
33
|
+
return host.command && runtime.available(host.command) ? [host.command] : undefined;
|
|
34
|
+
}
|
|
35
|
+
/** What a preview shows when the host CLI is absent: the command a real install would run. */
|
|
36
|
+
export function expectedHostLauncher(runtime, host) {
|
|
37
|
+
if (host.id === 'zcode')
|
|
38
|
+
return ['node', zcodeCliCandidates(runtime)[0] ?? '<ZCode Desktop>/resources/glm/zcode.cjs'];
|
|
39
|
+
return host.command ? [host.command] : [];
|
|
40
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type PluginInstallOptions } from './pluginHosts.js';
|
|
2
|
+
import type { PluginInspection } from './pluginInspection.js';
|
|
3
|
+
import { type PluginRuntime } from './pluginRuntime.js';
|
|
4
|
+
/** Kimi and MiniMax are installed by the release checkout's own installer, whose `status` is the registration record. */
|
|
5
|
+
export declare function inspectScriptPlugin(runtime: PluginRuntime, options: PluginInstallOptions, bundle: string): Promise<PluginInspection>;
|
|
6
|
+
/** Step Code lists installed extension packages in its agent settings; local sources are folder paths. */
|
|
7
|
+
export declare function inspectStepCodePlugin(runtime: PluginRuntime, options: PluginInstallOptions): PluginInspection;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { dirname, isAbsolute, join, resolve } from 'node:path';
|
|
2
|
+
import { AGENT_PLUGIN_NAME } from './pluginHosts.js';
|
|
3
|
+
import { checkedPluginCommand, objectOf, pluginHome, pluginJson, PluginInstallError, readPluginJson } from './pluginRuntime.js';
|
|
4
|
+
const DISABLED = 'The plugin is installed but disabled. Enable it explicitly in the host rather than installing another copy.';
|
|
5
|
+
function installedRecord(version, path, enabled, raw) {
|
|
6
|
+
if (typeof version !== 'string' || typeof path !== 'string' || !isAbsolute(path))
|
|
7
|
+
return undefined;
|
|
8
|
+
return { id: AGENT_PLUGIN_NAME, name: AGENT_PLUGIN_NAME, version, enabled, path, raw };
|
|
9
|
+
}
|
|
10
|
+
/** Kimi and MiniMax are installed by the release checkout's own installer, whose `status` is the registration record. */
|
|
11
|
+
export async function inspectScriptPlugin(runtime, options, bundle) {
|
|
12
|
+
const { host } = options;
|
|
13
|
+
const { stdout } = await checkedPluginCommand(runtime, 'node', [join(dirname(bundle), host.installer), 'status'], options.root);
|
|
14
|
+
const status = objectOf(pluginJson(stdout, `${host.label} installer status`));
|
|
15
|
+
if (typeof status?.['installed'] !== 'boolean')
|
|
16
|
+
throw new PluginInstallError('unsupported_capability', `${host.label} installer status has an unsupported shape; no installed state can be inferred.`);
|
|
17
|
+
const installed = status['installed'] ? installedRecord(status['version'], status['path'], status['enabled'] !== false, status) : undefined;
|
|
18
|
+
if (status['installed'] && !installed)
|
|
19
|
+
throw new PluginInstallError('unsupported_capability', `${host.label} installer status reports an installation without its version and path.`);
|
|
20
|
+
return { installed, marketplacePresent: false, conflicts: installed && !installed.enabled ? [DISABLED] : [], migrations: [] };
|
|
21
|
+
}
|
|
22
|
+
function stepAgentDir(runtime) {
|
|
23
|
+
const configured = runtime.env['STEP_CODING_AGENT_DIR'];
|
|
24
|
+
if (configured === undefined)
|
|
25
|
+
return join(pluginHome(runtime), '.stepcode', 'agent');
|
|
26
|
+
if (!isAbsolute(configured))
|
|
27
|
+
throw new PluginInstallError('invalid_arguments', 'STEP_CODING_AGENT_DIR must be an absolute directory, as Step Code requires.');
|
|
28
|
+
return configured;
|
|
29
|
+
}
|
|
30
|
+
/** Step Code lists installed extension packages in its agent settings; local sources are folder paths. */
|
|
31
|
+
export function inspectStepCodePlugin(runtime, options) {
|
|
32
|
+
const agentDir = stepAgentDir(runtime);
|
|
33
|
+
const packages = readPluginJson(join(agentDir, 'settings.json'))?.['packages'] ?? [];
|
|
34
|
+
if (!Array.isArray(packages))
|
|
35
|
+
throw new PluginInstallError('unsupported_capability', 'Step Code settings list packages in an unsupported shape; no installed state can be inferred.');
|
|
36
|
+
const ours = packages.flatMap(entry => {
|
|
37
|
+
const source = typeof entry === 'string' ? entry : objectOf(entry)?.['source'];
|
|
38
|
+
if (typeof source !== 'string' || /^(?:npm|git|https?):/.test(source))
|
|
39
|
+
return [];
|
|
40
|
+
const path = resolve(agentDir, source);
|
|
41
|
+
const manifest = readPluginJson(join(path, 'package.json'));
|
|
42
|
+
return manifest && manifest['name'] === options.host.packageName ? [installedRecord(manifest['version'], path, true, manifest)] : [];
|
|
43
|
+
}).filter(plugin => plugin !== undefined);
|
|
44
|
+
const conflicts = ours.length > 1 ? ['Multiple Step Code Evolver packages are installed; remove all but one with step remove <path>.'] : [];
|
|
45
|
+
return { installed: ours[0], marketplacePresent: false, conflicts, migrations: [] };
|
|
46
|
+
}
|
package/dist/pluginRuntime.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export declare function objectOf(value: unknown): Record<string, unknown> | unde
|
|
|
27
27
|
export declare function readPluginText(path: string, maxBytes?: number): string | undefined;
|
|
28
28
|
export declare function readPluginJson(path: string): Record<string, unknown> | undefined;
|
|
29
29
|
export declare function pluginVersionAtLeast(current: string, minimum: string): boolean;
|
|
30
|
-
|
|
30
|
+
/** `launcher` is the host CLI found on this machine (see hostLauncher), or undefined when it is missing. */
|
|
31
|
+
export declare function checkPluginHostVersion(runtime: PluginRuntime, host: PluginHost, launcher: readonly string[] | undefined): Promise<void>;
|
|
31
32
|
/** Only installer-owned descendants are written; a symlink may not redirect the cache or lock. */
|
|
32
33
|
export declare function assertPluginManagedPath(path: string): void;
|
package/dist/pluginRuntime.js
CHANGED
|
@@ -157,12 +157,18 @@ export function pluginVersionAtLeast(current, minimum) {
|
|
|
157
157
|
}
|
|
158
158
|
return true;
|
|
159
159
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
/** `launcher` is the host CLI found on this machine (see hostLauncher), or undefined when it is missing. */
|
|
161
|
+
export async function checkPluginHostVersion(runtime, host, launcher) {
|
|
162
|
+
if (!launcher)
|
|
163
|
+
throw new PluginInstallError('host_missing', host.id === 'zcode'
|
|
164
|
+
? 'ZCode CLI was not found: install ZCode Desktop, or set ZCODE_CLI_PATH to an absolute standalone zcode.cjs, with node on PATH.'
|
|
165
|
+
: `${host.label} CLI (${host.command ?? 'none'}) was not found on PATH.`);
|
|
166
|
+
if (host.kind === 'script' && !runtime.available('node'))
|
|
167
|
+
throw new PluginInstallError('host_missing', `${host.label} is installed by a Node.js script; node was not found on PATH.`);
|
|
163
168
|
if (!host.minimumVersion)
|
|
164
169
|
return;
|
|
165
|
-
const
|
|
170
|
+
const [command, ...prefix] = launcher;
|
|
171
|
+
const { stdout } = await checkedPluginCommand(runtime, command, [...prefix, '--version']);
|
|
166
172
|
const version = /(?:^|\s)v?(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?)(?:\s|$)/.exec(stdout.trim())?.[1];
|
|
167
173
|
if (!version || !pluginVersionAtLeast(version, host.minimumVersion)) {
|
|
168
174
|
throw new PluginInstallError('unsupported_version', `${host.label} requires ${host.minimumVersion}+; ${version ?? 'an unknown version'} was observed. Upgrade the host CLI before installing.`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evomap/evolver-cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.52",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@evomap/evolver-core": "2.0.
|
|
31
|
-
"@evomap/evolver-adapter-public": "2.0.
|
|
32
|
-
"@evomap/evolver-mcp": "2.0.
|
|
33
|
-
"@evomap/evolver-proxy": "2.0.
|
|
34
|
-
"@evomap/evolver-runtime-adapters": "2.0.
|
|
35
|
-
"@evomap/evolver-webui": "2.0.
|
|
30
|
+
"@evomap/evolver-core": "2.0.52",
|
|
31
|
+
"@evomap/evolver-adapter-public": "2.0.52",
|
|
32
|
+
"@evomap/evolver-mcp": "2.0.52",
|
|
33
|
+
"@evomap/evolver-proxy": "2.0.52",
|
|
34
|
+
"@evomap/evolver-runtime-adapters": "2.0.52",
|
|
35
|
+
"@evomap/evolver-webui": "2.0.52"
|
|
36
36
|
},
|
|
37
37
|
"repository": {
|
|
38
38
|
"type": "git",
|