@evomap/evolver-cli 2.0.46 → 2.0.48

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.
Files changed (57) hide show
  1. package/dist/autoexec.d.ts +1 -2
  2. package/dist/autoexec.js +3 -7
  3. package/dist/cliEntry.js +8 -0
  4. package/dist/commandCatalog.d.ts +4 -0
  5. package/dist/commandCatalog.js +4 -0
  6. package/dist/dispatch.js +8 -0
  7. package/dist/experience.d.ts +2 -0
  8. package/dist/experience.js +229 -0
  9. package/dist/feedbackDestinationIdentity.d.ts +1 -0
  10. package/dist/feedbackDestinationIdentity.js +8 -0
  11. package/dist/feedbackOutbox.js +11 -1
  12. package/dist/kernelTriggerFeedback.d.ts +13 -0
  13. package/dist/kernelTriggerFeedback.js +65 -0
  14. package/dist/lifecycle.js +4 -1
  15. package/dist/lifecycleBootstrapTransaction.js +13 -7
  16. package/dist/localMemoryGraph.d.ts +38 -0
  17. package/dist/localMemoryGraph.js +192 -7
  18. package/dist/localPublishBinding.js +5 -1
  19. package/dist/localTriggerFeedback.d.ts +30 -0
  20. package/dist/localTriggerFeedback.js +126 -0
  21. package/dist/mcpStdio.d.ts +1 -0
  22. package/dist/mcpStdio.js +9 -0
  23. package/dist/plugin.d.ts +8 -0
  24. package/dist/plugin.js +140 -0
  25. package/dist/pluginBundle.d.ts +4 -0
  26. package/dist/pluginBundle.js +93 -0
  27. package/dist/pluginDshStore.d.ts +7 -0
  28. package/dist/pluginDshStore.js +84 -0
  29. package/dist/pluginHosts.d.ts +52 -0
  30. package/dist/pluginHosts.js +146 -0
  31. package/dist/pluginInspection.d.ts +24 -0
  32. package/dist/pluginInspection.js +248 -0
  33. package/dist/pluginInstall.d.ts +20 -0
  34. package/dist/pluginInstall.js +103 -0
  35. package/dist/pluginLock.d.ts +4 -0
  36. package/dist/pluginLock.js +52 -0
  37. package/dist/pluginRuntime.d.ts +32 -0
  38. package/dist/pluginRuntime.js +193 -0
  39. package/dist/recipe.d.ts +1 -1
  40. package/dist/recipe.js +14 -5
  41. package/dist/setupHooks.js +5 -3
  42. package/dist/setupHooksLifecycle.d.ts +2 -0
  43. package/dist/setupHooksLifecycle.js +52 -52
  44. package/dist/sourceQualification.js +6 -2
  45. package/dist/triggerFeedbackCli.d.ts +15 -0
  46. package/dist/triggerFeedbackCli.js +146 -0
  47. package/dist/triggerFeedbackDelivery.d.ts +9 -0
  48. package/dist/triggerFeedbackDelivery.js +29 -0
  49. package/dist/triggerFeedbackHub.d.ts +7 -0
  50. package/dist/triggerFeedbackHub.js +62 -0
  51. package/dist/triggerFeedbackRecovery.d.ts +15 -0
  52. package/dist/triggerFeedbackRecovery.js +124 -0
  53. package/dist/triggerFeedbackSync.d.ts +23 -0
  54. package/dist/triggerFeedbackSync.js +98 -0
  55. package/dist/triggerFeedbackSyncState.d.ts +42 -0
  56. package/dist/triggerFeedbackSyncState.js +112 -0
  57. package/package.json +7 -7
@@ -0,0 +1,93 @@
1
+ import { withOwnedPluginLock } from './pluginLock.js';
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';
6
+ import { assertPluginManagedPath, checkedPluginCommand, pluginHome, PluginInstallError, readPluginJson, readPluginText } from './pluginRuntime.js';
7
+ const RECEIPT = '.evolver-plugin-checkout.json';
8
+ export function validatePackedBundle(bundle, host) {
9
+ const root = lstatSync(bundle);
10
+ if (root.isSymbolicLink() || !root.isDirectory())
11
+ throw new PluginInstallError('failed', 'The plugin bundle root is not an ordinary owned directory.');
12
+ const manifest = readPluginJson(join(bundle, host.manifest));
13
+ const expectedName = host.id === 'opencode' ? '@evomap/evolver-opencode' : AGENT_PLUGIN_NAME;
14
+ if (readPluginText(join(bundle, '.evolver-packed'))?.trim() !== host.id || manifest?.['name'] !== expectedName || typeof manifest['version'] !== 'string') {
15
+ throw new PluginInstallError('failed', `The release branch has no valid packed ${host.label} plugin. No host installation was attempted.`);
16
+ }
17
+ const repository = typeof manifest['repository'] === 'string' ? manifest['repository'] : manifest['repository']?.url;
18
+ if (!agentPluginRepositoryMatches(repository))
19
+ throw new PluginInstallError('failed', 'The packed plugin manifest identifies another repository.');
20
+ const entries = host.id === 'opencode' ? ['server.mjs', 'tui.mjs'] : ['bin/hook.mjs', `hosts/${host.id}/profile.js`];
21
+ if (entries.some(entry => readPluginText(join(bundle, entry)) === undefined))
22
+ throw new PluginInstallError('failed', 'The packed plugin is missing an entry module.');
23
+ const queue = [bundle];
24
+ let count = 0;
25
+ while (queue.length > 0) {
26
+ const directory = queue.pop();
27
+ for (const entry of readdirSync(directory, { withFileTypes: true })) {
28
+ if (++count > 10_000 || entry.isSymbolicLink())
29
+ throw new PluginInstallError('failed', 'The plugin bundle contains an unsafe link or exceeds the file limit.');
30
+ if (entry.isDirectory())
31
+ queue.push(join(directory, entry.name));
32
+ else if (!entry.isFile())
33
+ throw new PluginInstallError('failed', 'The plugin bundle contains a non-regular file.');
34
+ }
35
+ }
36
+ }
37
+ export async function ensureAgentPluginBundle(runtime, host) {
38
+ if (host.kind !== 'bundle')
39
+ throw new PluginInstallError('unsupported_capability', 'This host uses its native source installer, not the packed-checkout download path.');
40
+ if (!runtime.available('git'))
41
+ throw new PluginInstallError('host_missing', 'Git is required to fetch the packed plugin release.');
42
+ const remote = await checkedPluginCommand(runtime, 'git', ['ls-remote', '--heads', AGENT_PLUGIN_GIT_URL, AGENT_PLUGIN_RELEASE], runtime.cwd, 30_000);
43
+ const matches = remote.stdout.trim().split('\n').map(line => /^([a-f0-9]{40})\s+refs\/heads\/release$/.exec(line.trim())).filter(Boolean);
44
+ if (matches.length !== 1)
45
+ throw new PluginInstallError('failed', 'The plugin release branch did not resolve to one commit.');
46
+ const commit = matches[0][1];
47
+ const base = join(realpathSync(pluginHome(runtime)), '.evolver', 'plugins', 'evolver-agent-plugin');
48
+ assertPluginManagedPath(base);
49
+ mkdirSync(base, { recursive: true, mode: 0o700 });
50
+ const lockPath = join(base, `${host.id}.lock`);
51
+ return withOwnedPluginLock(lockPath, async () => {
52
+ const checkout = join(base, commit, host.id);
53
+ let stage;
54
+ let stageIdentity;
55
+ try {
56
+ assertPluginManagedPath(checkout);
57
+ if (existsSync(checkout)) {
58
+ const receipt = readPluginJson(join(checkout, RECEIPT));
59
+ if (receipt?.['repository'] !== AGENT_PLUGIN_REPOSITORY || receipt['commit'] !== commit || receipt['host'] !== host.id) {
60
+ throw new PluginInstallError('conflict', 'The plugin cache directory is not an owned, matching release checkout.');
61
+ }
62
+ validatePackedBundle(join(checkout, 'dist', host.id), host);
63
+ return join(checkout, 'dist');
64
+ }
65
+ stage = mkdtempSync(join(base, `.${host.id}-`));
66
+ const identity = lstatSync(stage);
67
+ stageIdentity = { dev: identity.dev, ino: identity.ino };
68
+ const source = join(stage, 'checkout');
69
+ const noHooks = join(stage, 'no-hooks');
70
+ mkdirSync(noHooks, { mode: 0o700 });
71
+ 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', `dist/${host.id}`], runtime.cwd, 120_000);
73
+ const head = await checkedPluginCommand(runtime, 'git', ['-C', source, 'rev-parse', 'HEAD']);
74
+ if (head.stdout.trim() !== commit)
75
+ throw new PluginInstallError('failed', 'The plugin release changed while downloading. Retry to use a consistent release.');
76
+ validatePackedBundle(join(source, 'dist', host.id), host);
77
+ writeFileSync(join(source, RECEIPT), `${JSON.stringify({ repository: AGENT_PLUGIN_REPOSITORY, commit, host: host.id })}\n`, { flag: 'wx', mode: 0o600 });
78
+ assertPluginManagedPath(checkout);
79
+ if (existsSync(checkout))
80
+ throw new PluginInstallError('conflict', 'The plugin cache destination appeared during the download; it was not overwritten.');
81
+ mkdirSync(join(base, commit), { recursive: true, mode: 0o700 });
82
+ renameSync(source, checkout);
83
+ return join(checkout, 'dist');
84
+ }
85
+ finally {
86
+ if (stage && stageIdentity && existsSync(stage)) {
87
+ const current = lstatSync(stage);
88
+ if (!current.isSymbolicLink() && current.dev === stageIdentity.dev && current.ino === stageIdentity.ino)
89
+ rmSync(stage, { recursive: true, force: true });
90
+ }
91
+ }
92
+ });
93
+ }
@@ -0,0 +1,7 @@
1
+ import { type PluginInstallOptions } from './pluginHosts.js';
2
+ import { type PluginRuntime } from './pluginRuntime.js';
3
+ /**
4
+ * The dsh CLI runs the pnpm on PATH, while the dsh app uses its bundled pnpm. A profile installed by another
5
+ * pnpm major or into another store makes pnpm fail with ERR_PNPM_UNEXPECTED_STORE.
6
+ */
7
+ export declare function assertDshProfileStoreMatches(runtime: PluginRuntime, options: PluginInstallOptions): Promise<void>;
@@ -0,0 +1,84 @@
1
+ import { realpathSync } from 'node:fs';
2
+ import { join, resolve } from 'node:path';
3
+ import { DSH_PLUGIN_SOURCE } from './pluginHosts.js';
4
+ import { checkedPluginCommand, objectOf, pluginHome, PluginInstallError, readPluginText } from './pluginRuntime.js';
5
+ const PNPM_MAJOR = /^pnpm@(\d+)\./;
6
+ function yamlScalar(text, key) {
7
+ const value = new RegExp(`^${key}:[ \\t]*(.+?)[ \\t]*$`, 'm').exec(text)?.[1];
8
+ return value?.replace(/^(["'])(.*)\1$/, '$2');
9
+ }
10
+ function recordedProfileStore(text) {
11
+ let parsed;
12
+ try {
13
+ parsed = objectOf(JSON.parse(text));
14
+ }
15
+ catch {
16
+ parsed = undefined;
17
+ }
18
+ const packageManager = parsed ? parsed['packageManager'] : yamlScalar(text, 'packageManager');
19
+ const storeDir = parsed ? parsed['storeDir'] : yamlScalar(text, 'storeDir');
20
+ return {
21
+ pnpmMajor: typeof packageManager === 'string' ? PNPM_MAJOR.exec(packageManager)?.[1] : undefined,
22
+ storeDir: typeof storeDir === 'string' && storeDir.trim() ? storeDir.trim() : undefined,
23
+ };
24
+ }
25
+ function comparableStorePath(path, base, platform) {
26
+ let absolute = resolve(base, path);
27
+ try {
28
+ absolute = realpathSync(absolute);
29
+ }
30
+ catch { /* A store that does not exist yet still has a comparable path. */ }
31
+ const trimmed = absolute.length > 1 ? absolute.replace(/[\\/]+$/, '') : absolute;
32
+ return platform === 'win32' ? trimmed.toLowerCase() : trimmed;
33
+ }
34
+ async function pathPnpmMajor(runtime, root) {
35
+ if (!runtime.available('pnpm'))
36
+ throw new PluginInstallError('host_missing', 'The dsh CLI installs plugins with the pnpm on PATH, and no pnpm was found. No dsh install command was run.');
37
+ const { stdout } = await checkedPluginCommand(runtime, 'pnpm', ['--version'], root, 30_000);
38
+ const major = /^(\d+)\.\d+\.\d+/.exec(stdout.trim())?.[1];
39
+ if (!major)
40
+ throw new PluginInstallError('unsupported_version', 'The pnpm on PATH reported an unrecognized version. No dsh install command was run.');
41
+ return major;
42
+ }
43
+ async function pathPnpmStore(runtime, profileDir) {
44
+ try {
45
+ const { stdout } = await checkedPluginCommand(runtime, 'pnpm', ['store', 'path'], profileDir, 30_000);
46
+ return stdout.trim().split(/\r?\n/).at(-1)?.trim() || undefined;
47
+ }
48
+ catch {
49
+ return undefined;
50
+ }
51
+ }
52
+ function storeMismatch(options, recordedMajor, problem) {
53
+ return new PluginInstallError('profile_store_mismatch', `dsh profile ${options.profile} ${problem} No dsh install command was run.`, [
54
+ `This profile is managed by pnpm ${recordedMajor}. Do one of these:`,
55
+ `- In dsh's own plugin screen, paste ${DSH_PLUGIN_SOURCE}`,
56
+ `- Put pnpm ${recordedMajor} with the profile's store on PATH, then rerun: evolver plugin install --host dsh --profile ${options.profile}`,
57
+ 'Evolver does not reinstall the profile or edit its pnpm-workspace.yaml.',
58
+ ]);
59
+ }
60
+ /**
61
+ * The dsh CLI runs the pnpm on PATH, while the dsh app uses its bundled pnpm. A profile installed by another
62
+ * pnpm major or into another store makes pnpm fail with ERR_PNPM_UNEXPECTED_STORE.
63
+ */
64
+ export async function assertDshProfileStoreMatches(runtime, options) {
65
+ const profileDir = join(pluginHome(runtime), '.dsh', 'profiles', options.profile);
66
+ const modules = readPluginText(join(profileDir, 'node_modules', '.modules.yaml'));
67
+ if (modules === undefined)
68
+ return;
69
+ const recorded = recordedProfileStore(modules);
70
+ if (recorded.pnpmMajor === undefined)
71
+ return;
72
+ const onPath = await pathPnpmMajor(runtime, options.root);
73
+ if (onPath !== recorded.pnpmMajor)
74
+ throw storeMismatch(options, recorded.pnpmMajor, `is managed by pnpm ${recorded.pnpmMajor}, but the dsh CLI would use pnpm ${onPath} from PATH.`);
75
+ if (recorded.storeDir === undefined)
76
+ return;
77
+ const pathStore = await pathPnpmStore(runtime, profileDir);
78
+ if (pathStore === undefined)
79
+ return;
80
+ const base = join(profileDir, 'node_modules');
81
+ if (comparableStorePath(recorded.storeDir, base, runtime.platform) !== comparableStorePath(pathStore, profileDir, runtime.platform)) {
82
+ throw storeMismatch(options, recorded.pnpmMajor, `uses the pnpm store ${recorded.storeDir}, but the pnpm on PATH uses ${pathStore}.`);
83
+ }
84
+ }
@@ -0,0 +1,52 @@
1
+ export declare const AGENT_PLUGIN_REPOSITORY = "EvoMap/evolver-agent-plugin";
2
+ export declare const AGENT_PLUGIN_GIT_URL = "https://github.com/EvoMap/evolver-agent-plugin.git";
3
+ export declare const AGENT_PLUGIN_NAME = "evolver-plugin";
4
+ export declare const AGENT_PLUGIN_RELEASE = "release";
5
+ export declare const DSH_PLUGIN_SOURCE = "github:EvoMap/evolver-agent-plugin#release&path:dist/dsh";
6
+ export type PluginScope = 'user' | 'project';
7
+ type PluginHostId = 'claude-code' | 'codex' | 'grok' | 'qoder' | 'antigravity' | 'opencode' | 'dsh' | 'cursor' | 'workbuddy' | 'mcp-generic';
8
+ export interface PluginHost {
9
+ id: PluginHostId;
10
+ label: string;
11
+ command?: string;
12
+ minimumVersion?: string;
13
+ kind: 'marketplace' | 'bundle' | 'profile' | 'manual';
14
+ scopes: readonly PluginScope[];
15
+ management?: 'plugin' | 'plugins';
16
+ marketplace?: string;
17
+ manifest?: string;
18
+ /** Where the packed plugin sits inside the checkout path the host's inventory reports. */
19
+ packedSubdir?: string;
20
+ /** The host's installer refuses to install hooks/MCP/skills until the user passes its trust flag. */
21
+ requiresTrust?: boolean;
22
+ legacyNames: readonly string[];
23
+ instructions: readonly string[];
24
+ }
25
+ export declare const PLUGIN_HOSTS: readonly PluginHost[];
26
+ export declare function pluginHostNamed(name: string): PluginHost | undefined;
27
+ export interface PluginInstallOptions {
28
+ host: PluginHost;
29
+ scope: PluginScope;
30
+ root: string;
31
+ profile: string;
32
+ dryRun: boolean;
33
+ trust: boolean;
34
+ }
35
+ export interface PluginCommandStep {
36
+ name: string;
37
+ command: string;
38
+ args: readonly string[];
39
+ }
40
+ export declare function pluginInstallSteps(options: PluginInstallOptions, bundle?: string): PluginCommandStep[];
41
+ export declare function pluginRollbackInstructions(options: PluginInstallOptions, bundle?: string): string[];
42
+ export interface StandalonePlugin {
43
+ id: string;
44
+ name: string;
45
+ scope?: string;
46
+ }
47
+ /**
48
+ * The host's own removal command for an old plugin, keeping its data where the host has a flag for that.
49
+ * Inventory values are host data, so a value that is not a plain argument never reaches a suggested command.
50
+ */
51
+ export declare function standalonePluginRemoval(options: PluginInstallOptions, plugin: StandalonePlugin): string;
52
+ export {};
@@ -0,0 +1,146 @@
1
+ export const AGENT_PLUGIN_REPOSITORY = 'EvoMap/evolver-agent-plugin';
2
+ export const AGENT_PLUGIN_GIT_URL = `https://github.com/${AGENT_PLUGIN_REPOSITORY}.git`;
3
+ export const AGENT_PLUGIN_NAME = 'evolver-plugin';
4
+ export const AGENT_PLUGIN_RELEASE = 'release';
5
+ export const DSH_PLUGIN_SOURCE = `github:${AGENT_PLUGIN_REPOSITORY}#${AGENT_PLUGIN_RELEASE}&path:dist/dsh`;
6
+ export const PLUGIN_HOSTS = [
7
+ {
8
+ id: 'claude-code', label: 'Claude Code', command: 'claude', minimumVersion: '2.1.286',
9
+ kind: 'marketplace', management: 'plugin', marketplace: 'evolver-agent-plugin',
10
+ scopes: ['user', 'project'], manifest: '.claude-plugin/plugin.json',
11
+ legacyNames: ['evolver', 'evolver-mods', 'evolver-agent-plugin'],
12
+ instructions: ['Restart Claude Code. Installed hooks modules also require the host rollout flag; an installed plugin is not proof that recall is active.'],
13
+ },
14
+ {
15
+ 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'],
17
+ instructions: ['Open /hooks in Codex, review and trust the Evolver hooks, then start a new thread.'],
18
+ },
19
+ {
20
+ 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',
22
+ packedSubdir: 'dist/grok', requiresTrust: true, legacyNames: ['evolver', 'evolver-grok-plugin'],
23
+ instructions: ['Restart Grok and review its hook trust settings. Recall reaches the first tool result; a turn without tools receives no strategy.'],
24
+ },
25
+ {
26
+ 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',
28
+ legacyNames: ['evolver', 'evolver-qoder-plugin'], instructions: ['Start a new Qoder session or run /plugins reload.'],
29
+ },
30
+ {
31
+ id: 'antigravity', label: 'Antigravity', command: 'agy', kind: 'bundle', management: 'plugin',
32
+ scopes: ['user'], manifest: 'plugin.json', legacyNames: ['evolver-antigravity-plugin'],
33
+ instructions: ['Restart Antigravity. Its commands run from the installed plugin with node bin/command.mjs antigravity <command>.'],
34
+ },
35
+ {
36
+ id: 'opencode', label: 'OpenCode', command: 'opencode', minimumVersion: '1.19.4', kind: 'bundle',
37
+ scopes: ['user', 'project'], manifest: 'package.json', legacyNames: ['evolver-opencode-plugin'],
38
+ instructions: ['Restart OpenCode. Both the server entry in opencode.json and the TUI entry in tui.json must be registered.'],
39
+ },
40
+ {
41
+ id: 'dsh', label: 'DeepSeek Harness', command: 'dsh', minimumVersion: '0.1.5', kind: 'profile',
42
+ scopes: ['user'], manifest: 'package.json', legacyNames: ['@evomap/dsh-evolver'],
43
+ instructions: ['Restart dsh. Installation applies only to the selected profile; repeat for other profiles. DSH Desktop requires its own bundled CLI/profile.'],
44
+ },
45
+ {
46
+ id: 'cursor', label: 'Cursor', command: 'cursor-agent', kind: 'manual', scopes: ['user'],
47
+ legacyNames: ['evolver-cursor-plugin'],
48
+ instructions: [
49
+ `In Cursor's plugin marketplace, add ${AGENT_PLUGIN_REPOSITORY} and install evolver-plugin.`,
50
+ 'Remove or disable the standalone Evolver plugin first to avoid duplicate recall and reports; keep its data.',
51
+ 'Reload the Cursor window and inspect Settings → Hooks. The current Cursor CLI has no verified plugin-install command.',
52
+ ],
53
+ },
54
+ {
55
+ id: 'workbuddy', label: 'WorkBuddy / CodeBuddy', command: 'codebuddy', kind: 'manual', scopes: ['user', 'project'],
56
+ legacyNames: ['evolver'],
57
+ instructions: [
58
+ 'In WorkBuddy, if the standalone plugin is installed: /plugin uninstall evolver@evomap-workbuddy --keep-data (repeat with --scope project where applicable).',
59
+ 'Remove the old marketplace only after reviewing its other plugins: /plugin marketplace remove evomap-workbuddy',
60
+ `/plugin marketplace add ${AGENT_PLUGIN_REPOSITORY}`,
61
+ '/plugin install evolver-plugin@evomap-workbuddy',
62
+ 'Restart WorkBuddy. These are commands in its plugin UI, not a verified codebuddy shell subcommand.',
63
+ ],
64
+ },
65
+ {
66
+ id: 'mcp-generic', label: 'Generic MCP client', kind: 'manual', scopes: ['user'], legacyNames: [],
67
+ instructions: [
68
+ `git clone --depth 1 --branch release ${AGENT_PLUGIN_GIT_URL}`,
69
+ 'In that checkout, run npm ci; the stdio server requires the MCP SDK.',
70
+ 'Register node <absolute-checkout>/bin/mcp.mjs mcp-generic using the selected client\'s own MCP configuration/CLI.',
71
+ 'The client must call recall/report/distill itself. Registration and agent-reported checks are not automatic hook integration.',
72
+ ],
73
+ },
74
+ ];
75
+ export function pluginHostNamed(name) {
76
+ const aliases = { claude: 'claude-code', codebuddy: 'workbuddy', 'deepseek-harness': 'dsh', mcp: 'mcp-generic' };
77
+ return PLUGIN_HOSTS.find(host => host.id === (aliases[name] ?? name));
78
+ }
79
+ export function pluginInstallSteps(options, bundle = '<release-checkout>/dist') {
80
+ const { host, scope, profile, trust } = options;
81
+ const command = host.command ?? '';
82
+ if (host.kind === 'marketplace') {
83
+ const management = host.management;
84
+ const selector = host.id === 'grok' ? AGENT_PLUGIN_NAME : `${AGENT_PLUGIN_NAME}@${host.marketplace}`;
85
+ const add = [management, 'marketplace', 'add', AGENT_PLUGIN_REPOSITORY];
86
+ const install = host.id === 'codex'
87
+ ? [management, 'add', selector, '--json']
88
+ : [management, 'install', selector, ...(host.id === 'claude-code' ? ['--scope', scope, '--json'] : []), ...(host.requiresTrust && trust ? ['--trust'] : [])];
89
+ return [
90
+ { name: 'marketplace', command, args: add },
91
+ { name: 'install', command, args: install },
92
+ ];
93
+ }
94
+ if (host.id === 'antigravity')
95
+ return [{ name: 'install', command, args: ['plugin', 'install', `${bundle}/antigravity`] }];
96
+ if (host.id === 'opencode')
97
+ return [{ name: 'install', command, args: ['plugin', `${bundle}/opencode`, ...(scope === 'user' ? ['-g'] : [])] }];
98
+ if (host.id === 'dsh')
99
+ return [{
100
+ name: 'install', command, args: ['plugin', '--profile', profile, 'add', '-w', DSH_PLUGIN_SOURCE],
101
+ }];
102
+ return [];
103
+ }
104
+ export function pluginRollbackInstructions(options, bundle) {
105
+ const { host, scope, profile } = options;
106
+ if (host.id === 'claude-code')
107
+ return [`claude plugin uninstall ${AGENT_PLUGIN_NAME}@${host.marketplace} --scope ${scope} --keep-data`];
108
+ if (host.id === 'codex')
109
+ return [`codex plugin remove ${AGENT_PLUGIN_NAME}@${host.marketplace}`];
110
+ if (host.id === 'grok')
111
+ return ['grok plugin uninstall evolver-plugin --keep-data'];
112
+ if (host.id === 'qoder')
113
+ return ['qodercli plugins uninstall evolver-plugin@evomap --keep-data'];
114
+ if (host.id === 'antigravity')
115
+ return ['agy plugin uninstall evolver-plugin'];
116
+ if (host.id === 'dsh')
117
+ return [`dsh plugin --profile ${profile} remove @evomap/dsh-evolver`];
118
+ if (host.id === 'opencode')
119
+ return [`Remove only this plugin's ${bundle ?? '<installed-bundle>'}/opencode/server.mjs and tui.mjs entries from opencode.json and tui.json; preserve neighboring configuration.`];
120
+ return [];
121
+ }
122
+ const SHELL_SAFE_ARGUMENT = /^[A-Za-z0-9@._/][A-Za-z0-9@._/-]*$/;
123
+ /**
124
+ * The host's own removal command for an old plugin, keeping its data where the host has a flag for that.
125
+ * Inventory values are host data, so a value that is not a plain argument never reaches a suggested command.
126
+ */
127
+ export function standalonePluginRemoval(options, plugin) {
128
+ const { host, profile } = options;
129
+ const scope = plugin.scope ?? options.scope;
130
+ if ([plugin.id, plugin.name, scope].some(value => !SHELL_SAFE_ARGUMENT.test(value))) {
131
+ return `Remove the standalone Evolver plugin through ${host.label}'s own plugin manager, keeping its data; its inventory name is not a plain command argument, so no command is suggested.`;
132
+ }
133
+ if (host.id === 'claude-code')
134
+ return `claude plugin uninstall ${plugin.id} --scope ${scope} --keep-data`;
135
+ if (host.id === 'codex')
136
+ return `codex plugin remove ${plugin.id}`;
137
+ if (host.id === 'grok')
138
+ return `grok plugin uninstall ${plugin.name} --keep-data`;
139
+ if (host.id === 'qoder')
140
+ return `qodercli plugins uninstall ${plugin.id} --scope ${scope} --keep-data`;
141
+ if (host.id === 'antigravity')
142
+ return `agy plugin uninstall ${plugin.name}`;
143
+ if (host.id === 'dsh')
144
+ return `dsh plugin --profile ${profile} remove ${plugin.name}`;
145
+ return `Remove only the ${plugin.name} entries from the OpenCode opencode.json and tui.json; keep the rest of the configuration.`;
146
+ }
@@ -0,0 +1,24 @@
1
+ import { type PluginInstallOptions, type PluginHost } from './pluginHosts.js';
2
+ import { type PluginRuntime } from './pluginRuntime.js';
3
+ export interface InstalledAgentPlugin {
4
+ id: string;
5
+ name: string;
6
+ version: string;
7
+ enabled: boolean;
8
+ scope?: string;
9
+ path?: string;
10
+ raw: Record<string, unknown>;
11
+ }
12
+ /** A host registration snapshot; only verifyPluginManifest confirms a usable installed artifact. */
13
+ export interface PluginInspection {
14
+ installed?: InstalledAgentPlugin;
15
+ marketplacePresent: boolean;
16
+ conflicts: string[];
17
+ /** Native commands the user can run to remove a conflicting standalone plugin; never run automatically. */
18
+ migrations: string[];
19
+ }
20
+ export declare function installedPluginsFromJson(value: unknown, host: PluginHost): InstalledAgentPlugin[];
21
+ export declare function agentPluginRepositoryMatches(value: unknown): boolean;
22
+ export declare function verifyPluginManifest(runtime: PluginRuntime, options: PluginInstallOptions, plugin: InstalledAgentPlugin, installAnswer?: unknown): string;
23
+ export declare function inspectOpenCodePlugin(runtime: PluginRuntime, options: PluginInstallOptions): PluginInspection;
24
+ export declare function inspectAgentPlugin(runtime: PluginRuntime, options: PluginInstallOptions): Promise<PluginInspection>;