@phnx-labs/agents-cli 1.16.0 → 1.17.1
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/CHANGELOG.md +71 -0
- package/dist/commands/browser.js +248 -9
- package/dist/commands/cloud.js +8 -0
- package/dist/commands/exec.js +70 -1
- package/dist/commands/import.d.ts +24 -0
- package/dist/commands/import.js +203 -0
- package/dist/commands/plugins.js +179 -5
- package/dist/commands/prune.js +6 -0
- package/dist/commands/secrets.js +117 -19
- package/dist/commands/view.js +21 -8
- package/dist/commands/workflows.d.ts +10 -0
- package/dist/commands/workflows.js +457 -0
- package/dist/index.js +34 -16
- package/dist/lib/browser/cdp.js +7 -4
- package/dist/lib/browser/chrome.d.ts +10 -0
- package/dist/lib/browser/chrome.js +37 -2
- package/dist/lib/browser/drivers/local.js +13 -2
- package/dist/lib/browser/input.d.ts +1 -0
- package/dist/lib/browser/input.js +3 -0
- package/dist/lib/browser/ipc.js +14 -0
- package/dist/lib/browser/profiles.d.ts +5 -0
- package/dist/lib/browser/profiles.js +45 -0
- package/dist/lib/browser/service.d.ts +10 -0
- package/dist/lib/browser/service.js +29 -1
- package/dist/lib/browser/types.d.ts +11 -1
- package/dist/lib/cloud/rush.d.ts +28 -1
- package/dist/lib/cloud/rush.js +68 -13
- package/dist/lib/commands.d.ts +0 -15
- package/dist/lib/commands.js +5 -5
- package/dist/lib/hooks.js +24 -11
- package/dist/lib/import.d.ts +91 -0
- package/dist/lib/import.js +179 -0
- package/dist/lib/migrate.js +59 -1
- package/dist/lib/permissions.d.ts +0 -58
- package/dist/lib/permissions.js +10 -10
- package/dist/lib/plugins.d.ts +75 -34
- package/dist/lib/plugins.js +640 -133
- package/dist/lib/resource-patterns.d.ts +41 -0
- package/dist/lib/resource-patterns.js +82 -0
- package/dist/lib/resources/index.d.ts +17 -0
- package/dist/lib/resources/index.js +7 -0
- package/dist/lib/resources/types.d.ts +1 -1
- package/dist/lib/resources/workflows.d.ts +24 -0
- package/dist/lib/resources/workflows.js +110 -0
- package/dist/lib/resources.d.ts +6 -1
- package/dist/lib/resources.js +12 -2
- package/dist/lib/session/db.d.ts +18 -0
- package/dist/lib/session/db.js +106 -7
- package/dist/lib/session/discover.d.ts +6 -0
- package/dist/lib/session/discover.js +28 -17
- package/dist/lib/shims.d.ts +3 -51
- package/dist/lib/shims.js +18 -10
- package/dist/lib/sqlite.js +10 -4
- package/dist/lib/state.d.ts +15 -2
- package/dist/lib/state.js +29 -8
- package/dist/lib/types.d.ts +43 -14
- package/dist/lib/versions.d.ts +3 -0
- package/dist/lib/versions.js +139 -27
- package/dist/lib/workflows.d.ts +79 -0
- package/dist/lib/workflows.js +233 -0
- package/package.json +1 -5
- package/scripts/postinstall.js +59 -58
- package/dist/commands/fork.d.ts +0 -10
- package/dist/commands/fork.js +0 -146
|
@@ -8,10 +8,6 @@ export declare const CODEX_RULES_FILENAME = "agents-deny.rules";
|
|
|
8
8
|
* E.g. "Bash(git reset:*)" -> prefix_rule(pattern=["git", "reset"], decision="forbidden")
|
|
9
9
|
*/
|
|
10
10
|
export declare function convertDenyToCodexRules(deny: string[]): string | null;
|
|
11
|
-
/**
|
|
12
|
-
* Ensure central permissions directory exists.
|
|
13
|
-
*/
|
|
14
|
-
export declare function ensurePermissionsDir(): void;
|
|
15
11
|
/**
|
|
16
12
|
* Parse a permission set from a YAML file.
|
|
17
13
|
*/
|
|
@@ -76,10 +72,6 @@ export declare function buildPermissionsFromGroups(groupNames: string[]): Permis
|
|
|
76
72
|
* same-named override.
|
|
77
73
|
*/
|
|
78
74
|
export declare function listInstalledPermissions(): InstalledPermission[];
|
|
79
|
-
/**
|
|
80
|
-
* Get a specific permission set by name. Searches user dir first, then system.
|
|
81
|
-
*/
|
|
82
|
-
export declare function getPermissionSet(name: string): InstalledPermission | null;
|
|
83
75
|
/**
|
|
84
76
|
* Install a permission set to user-level central storage.
|
|
85
77
|
*/
|
|
@@ -110,24 +102,6 @@ export declare function convertToOpenCodeFormat(set: PermissionSet): OpenCodePer
|
|
|
110
102
|
* Codex uses coarse-grained modes, so we infer the best fit.
|
|
111
103
|
*/
|
|
112
104
|
export declare function convertToCodexFormat(set: PermissionSet, cwd?: string): CodexPermissions;
|
|
113
|
-
/**
|
|
114
|
-
* Read Claude's current permissions from settings.json.
|
|
115
|
-
*/
|
|
116
|
-
export declare function readClaudePermissions(scope?: 'user' | 'project', cwd?: string, options?: {
|
|
117
|
-
home?: string;
|
|
118
|
-
}): ClaudePermissions | null;
|
|
119
|
-
/**
|
|
120
|
-
* Read OpenCode's current permissions from opencode.jsonc.
|
|
121
|
-
*/
|
|
122
|
-
export declare function readOpenCodePermissions(scope?: 'user' | 'project', cwd?: string, options?: {
|
|
123
|
-
home?: string;
|
|
124
|
-
}): OpenCodePermissions | null;
|
|
125
|
-
/**
|
|
126
|
-
* Read Codex's current permissions from config.toml.
|
|
127
|
-
*/
|
|
128
|
-
export declare function readCodexPermissions(scope?: 'user' | 'project', cwd?: string, options?: {
|
|
129
|
-
home?: string;
|
|
130
|
-
}): CodexPermissions | null;
|
|
131
105
|
/**
|
|
132
106
|
* Read agent permissions based on agent ID.
|
|
133
107
|
*/
|
|
@@ -141,27 +115,6 @@ export declare function applyClaudePermissions(set: PermissionSet, scope?: 'user
|
|
|
141
115
|
success: boolean;
|
|
142
116
|
error?: string;
|
|
143
117
|
};
|
|
144
|
-
/**
|
|
145
|
-
* Apply a permission set to OpenCode's opencode.jsonc.
|
|
146
|
-
*/
|
|
147
|
-
export declare function applyOpenCodePermissions(set: PermissionSet, scope?: 'user' | 'project', cwd?: string, merge?: boolean): {
|
|
148
|
-
success: boolean;
|
|
149
|
-
error?: string;
|
|
150
|
-
};
|
|
151
|
-
/**
|
|
152
|
-
* Apply a permission set to Codex's config.toml.
|
|
153
|
-
*/
|
|
154
|
-
export declare function applyCodexPermissions(set: PermissionSet, scope?: 'user' | 'project', cwd?: string, merge?: boolean): {
|
|
155
|
-
success: boolean;
|
|
156
|
-
error?: string;
|
|
157
|
-
};
|
|
158
|
-
/**
|
|
159
|
-
* Apply a permission set to an agent (global config).
|
|
160
|
-
*/
|
|
161
|
-
export declare function applyPermissionsToAgent(agentId: AgentId, set: PermissionSet, scope?: 'user' | 'project', cwd?: string, merge?: boolean): {
|
|
162
|
-
success: boolean;
|
|
163
|
-
error?: string;
|
|
164
|
-
};
|
|
165
118
|
/**
|
|
166
119
|
* Apply a permission set to a specific version's home directory.
|
|
167
120
|
* This writes to {versionHome}/.{agent}/settings.json (or equivalent).
|
|
@@ -182,22 +135,11 @@ export declare function openCodeToCanonical(perms: OpenCodePermissions): Permiss
|
|
|
182
135
|
* Convert Codex permissions back to canonical format (approximation).
|
|
183
136
|
*/
|
|
184
137
|
export declare function codexToCanonical(perms: CodexPermissions): PermissionSet;
|
|
185
|
-
/**
|
|
186
|
-
* Export agent's current permissions to canonical format.
|
|
187
|
-
*/
|
|
188
|
-
export declare function exportAgentPermissions(agentId: AgentId, scope?: 'user' | 'project', cwd?: string): PermissionSet | null;
|
|
189
138
|
/**
|
|
190
139
|
* Export permissions from a specific config file path to canonical format.
|
|
191
140
|
* Auto-detects agent type from file path/name.
|
|
192
141
|
*/
|
|
193
142
|
export declare function exportPermissionsFromPath(filePath: string): PermissionSet | null;
|
|
194
|
-
/**
|
|
195
|
-
* Save a permission set to central storage.
|
|
196
|
-
*/
|
|
197
|
-
export declare function savePermissionSet(set: PermissionSet): {
|
|
198
|
-
success: boolean;
|
|
199
|
-
error?: string;
|
|
200
|
-
};
|
|
201
143
|
/**
|
|
202
144
|
* Get the default permission set from central storage.
|
|
203
145
|
*/
|
package/dist/lib/permissions.js
CHANGED
|
@@ -44,7 +44,7 @@ export function convertDenyToCodexRules(deny) {
|
|
|
44
44
|
/**
|
|
45
45
|
* Ensure central permissions directory exists.
|
|
46
46
|
*/
|
|
47
|
-
|
|
47
|
+
function ensurePermissionsDir() {
|
|
48
48
|
const dir = getUserPermissionsDir();
|
|
49
49
|
if (!fs.existsSync(dir)) {
|
|
50
50
|
fs.mkdirSync(dir, { recursive: true });
|
|
@@ -295,7 +295,7 @@ export function listInstalledPermissions() {
|
|
|
295
295
|
/**
|
|
296
296
|
* Get a specific permission set by name. Searches user dir first, then system.
|
|
297
297
|
*/
|
|
298
|
-
|
|
298
|
+
function getPermissionSet(name) {
|
|
299
299
|
for (const dir of [getUserPermissionsDir(), getPermissionsDir()]) {
|
|
300
300
|
for (const ext of ['.yml', '.yaml']) {
|
|
301
301
|
const filePath = safeJoin(dir, name + ext);
|
|
@@ -504,7 +504,7 @@ function stripJsonComments(content) {
|
|
|
504
504
|
/**
|
|
505
505
|
* Read Claude's current permissions from settings.json.
|
|
506
506
|
*/
|
|
507
|
-
|
|
507
|
+
function readClaudePermissions(scope = 'user', cwd, options) {
|
|
508
508
|
const home = options?.home || HOME;
|
|
509
509
|
const configPath = scope === 'user'
|
|
510
510
|
? path.join(home, '.claude', 'settings.json')
|
|
@@ -532,7 +532,7 @@ export function readClaudePermissions(scope = 'user', cwd, options) {
|
|
|
532
532
|
/**
|
|
533
533
|
* Read OpenCode's current permissions from opencode.jsonc.
|
|
534
534
|
*/
|
|
535
|
-
|
|
535
|
+
function readOpenCodePermissions(scope = 'user', cwd, options) {
|
|
536
536
|
const home = options?.home || HOME;
|
|
537
537
|
const configPath = scope === 'user'
|
|
538
538
|
? path.join(home, '.opencode', 'opencode.jsonc')
|
|
@@ -559,7 +559,7 @@ export function readOpenCodePermissions(scope = 'user', cwd, options) {
|
|
|
559
559
|
/**
|
|
560
560
|
* Read Codex's current permissions from config.toml.
|
|
561
561
|
*/
|
|
562
|
-
|
|
562
|
+
function readCodexPermissions(scope = 'user', cwd, options) {
|
|
563
563
|
const home = options?.home || HOME;
|
|
564
564
|
const configPath = scope === 'user'
|
|
565
565
|
? path.join(home, '.codex', 'config.toml')
|
|
@@ -649,7 +649,7 @@ export function applyClaudePermissions(set, scope = 'user', cwd, merge = true) {
|
|
|
649
649
|
/**
|
|
650
650
|
* Apply a permission set to OpenCode's opencode.jsonc.
|
|
651
651
|
*/
|
|
652
|
-
|
|
652
|
+
function applyOpenCodePermissions(set, scope = 'user', cwd, merge = true) {
|
|
653
653
|
const configDir = scope === 'user'
|
|
654
654
|
? path.join(HOME, '.opencode')
|
|
655
655
|
: path.join(cwd || process.cwd(), '.opencode');
|
|
@@ -690,7 +690,7 @@ export function applyOpenCodePermissions(set, scope = 'user', cwd, merge = true)
|
|
|
690
690
|
/**
|
|
691
691
|
* Apply a permission set to Codex's config.toml.
|
|
692
692
|
*/
|
|
693
|
-
|
|
693
|
+
function applyCodexPermissions(set, scope = 'user', cwd, merge = true) {
|
|
694
694
|
const configDir = scope === 'user'
|
|
695
695
|
? path.join(HOME, '.codex')
|
|
696
696
|
: path.join(cwd || process.cwd(), '.codex');
|
|
@@ -739,7 +739,7 @@ export function applyCodexPermissions(set, scope = 'user', cwd, merge = true) {
|
|
|
739
739
|
/**
|
|
740
740
|
* Apply a permission set to an agent (global config).
|
|
741
741
|
*/
|
|
742
|
-
|
|
742
|
+
function applyPermissionsToAgent(agentId, set, scope = 'user', cwd, merge = true) {
|
|
743
743
|
switch (agentId) {
|
|
744
744
|
case 'claude':
|
|
745
745
|
return applyClaudePermissions(set, scope, cwd, merge);
|
|
@@ -912,7 +912,7 @@ export function codexToCanonical(perms) {
|
|
|
912
912
|
/**
|
|
913
913
|
* Export agent's current permissions to canonical format.
|
|
914
914
|
*/
|
|
915
|
-
|
|
915
|
+
function exportAgentPermissions(agentId, scope = 'user', cwd) {
|
|
916
916
|
const perms = readAgentPermissions(agentId, scope, cwd);
|
|
917
917
|
if (!perms)
|
|
918
918
|
return null;
|
|
@@ -1017,7 +1017,7 @@ export function exportPermissionsFromPath(filePath) {
|
|
|
1017
1017
|
/**
|
|
1018
1018
|
* Save a permission set to central storage.
|
|
1019
1019
|
*/
|
|
1020
|
-
|
|
1020
|
+
function savePermissionSet(set) {
|
|
1021
1021
|
ensurePermissionsDir();
|
|
1022
1022
|
const filePath = safeJoin(getUserPermissionsDir(), set.name + '.yml');
|
|
1023
1023
|
try {
|
package/dist/lib/plugins.d.ts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Plugin discovery, validation, and syncing.
|
|
3
3
|
*
|
|
4
|
-
* Plugins are bundles in ~/.agents/plugins/ that package skills, hooks,
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Plugins are bundles in ~/.agents/.cache/plugins/ that package skills, hooks,
|
|
5
|
+
* commands, agents, bin scripts, MCP servers, and settings under a single
|
|
6
|
+
* manifest (plugin.json). This module discovers plugins, validates their
|
|
7
|
+
* manifests, and syncs their contents into agent version homes.
|
|
7
8
|
*/
|
|
8
9
|
import type { AgentId, DiscoveredPlugin, PluginManifest } from './types.js';
|
|
9
10
|
/**
|
|
10
|
-
* Discover all plugins in ~/.agents/plugins/.
|
|
11
|
+
* Discover all plugins in ~/.agents/.cache/plugins/.
|
|
11
12
|
* A valid plugin has a .claude-plugin/plugin.json manifest.
|
|
12
13
|
*/
|
|
13
14
|
export declare function discoverPlugins(): DiscoveredPlugin[];
|
|
15
|
+
export declare function buildDiscoveredPlugin(pluginRoot: string, manifest: PluginManifest): DiscoveredPlugin;
|
|
14
16
|
/**
|
|
15
17
|
* Load a plugin manifest from a plugin directory.
|
|
16
18
|
*/
|
|
@@ -25,57 +27,81 @@ export declare function getPlugin(name: string): DiscoveredPlugin | null;
|
|
|
25
27
|
* Otherwise defaults to all plugin-capable agents.
|
|
26
28
|
*/
|
|
27
29
|
export declare function pluginSupportsAgent(plugin: DiscoveredPlugin, agent: AgentId): boolean;
|
|
30
|
+
/** Discover command .md files inside a plugin's commands/ directory. */
|
|
31
|
+
export declare function discoverPluginCommands(pluginRoot: string): string[];
|
|
32
|
+
/** Discover agent definition .md files inside a plugin's agents/ directory. */
|
|
33
|
+
export declare function discoverPluginAgentDefs(pluginRoot: string): string[];
|
|
34
|
+
/** Discover executable files in a plugin's bin/ directory. */
|
|
35
|
+
export declare function discoverPluginBin(pluginRoot: string): string[];
|
|
28
36
|
/**
|
|
29
37
|
* Expand plugin variables in a string.
|
|
30
38
|
*
|
|
31
39
|
* Variables:
|
|
32
|
-
* ${CLAUDE_PLUGIN_ROOT}
|
|
33
|
-
* ${CLAUDE_PLUGIN_DATA}
|
|
40
|
+
* ${CLAUDE_PLUGIN_ROOT} -> absolute path to plugin directory
|
|
41
|
+
* ${CLAUDE_PLUGIN_DATA} -> per-version data directory for this plugin
|
|
42
|
+
* ${user_config.<key>} -> value from plugin's .user-config.json
|
|
34
43
|
*/
|
|
35
|
-
export declare function expandPluginVars(str: string, pluginRoot: string, pluginName: string, agentId: AgentId, versionHome: string): string;
|
|
44
|
+
export declare function expandPluginVars(str: string, pluginRoot: string, pluginName: string, agentId: AgentId, versionHome: string, userConfig?: Record<string, string>): string;
|
|
45
|
+
/**
|
|
46
|
+
* Load persisted user config for a plugin from .user-config.json.
|
|
47
|
+
*/
|
|
48
|
+
export declare function loadUserConfig(pluginName: string): Record<string, string>;
|
|
49
|
+
/**
|
|
50
|
+
* Persist user config for a plugin to .user-config.json.
|
|
51
|
+
*/
|
|
52
|
+
export declare function saveUserConfig(pluginName: string, config: Record<string, string>): void;
|
|
53
|
+
/**
|
|
54
|
+
* Check plugin dependencies against installed plugins.
|
|
55
|
+
* Returns names of missing dependencies (warning only — not a hard error).
|
|
56
|
+
*/
|
|
57
|
+
export declare function checkPluginDependencies(manifest: PluginManifest): string[];
|
|
36
58
|
/**
|
|
37
59
|
* Sync a plugin to a specific agent version's home directory.
|
|
38
60
|
*
|
|
39
61
|
* For Claude:
|
|
40
|
-
* 1. Copy plugin skills into version's skills dir (prefixed: pluginName
|
|
41
|
-
* 2.
|
|
42
|
-
* 3.
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
62
|
+
* 1. Copy plugin skills into version's skills dir (prefixed: pluginName--skillName)
|
|
63
|
+
* 2. Copy plugin commands into version's commands dir (prefixed: pluginName--cmdName.md)
|
|
64
|
+
* 3. Copy plugin agent defs into version's agents dir (prefixed: pluginName--agentName.md)
|
|
65
|
+
* 4. Copy plugin bin/ into version home plugin-bin/<pluginName>/, note path in settings
|
|
66
|
+
* 5. Read hooks/hooks.json, expand vars, merge into settings.json hooks
|
|
67
|
+
* 6. Read .mcp.json, expand vars, merge mcpServers into settings.json
|
|
68
|
+
* 7. Read settings.json, merge non-permission keys non-destructively into settings.json
|
|
69
|
+
* 8. Read settings.json permissions, expand vars, merge into settings.json
|
|
46
70
|
*/
|
|
47
71
|
export declare function syncPluginToVersion(plugin: DiscoveredPlugin, agent: AgentId, versionHome: string): {
|
|
48
72
|
success: boolean;
|
|
49
73
|
skills: string[];
|
|
74
|
+
commands: string[];
|
|
75
|
+
agentDefs: string[];
|
|
76
|
+
bin: string[];
|
|
50
77
|
hooks: string[];
|
|
51
78
|
permissions: boolean;
|
|
79
|
+
mcp: boolean;
|
|
80
|
+
settings: boolean;
|
|
52
81
|
};
|
|
53
82
|
/**
|
|
54
83
|
* Check if a plugin is synced to a version by inspecting the version home.
|
|
55
|
-
* Checks
|
|
56
|
-
* and plugin permissions in settings.json.
|
|
84
|
+
* Checks skills, commands, agent defs, bin, hook commands, and permissions.
|
|
57
85
|
*/
|
|
58
86
|
export declare function isPluginSynced(plugin: DiscoveredPlugin, agent: AgentId, versionHome: string): boolean;
|
|
59
87
|
/**
|
|
60
88
|
* Remove a plugin from a specific agent version's home directory.
|
|
61
|
-
* Inverse of syncPluginToVersion
|
|
62
|
-
* 1. Delete synced skill directories (pluginName--*)
|
|
63
|
-
* 2. Strip hook entries whose commands reference the plugin root
|
|
64
|
-
* 3. Strip permission rules that reference the plugin root
|
|
89
|
+
* Inverse of syncPluginToVersion.
|
|
65
90
|
*
|
|
66
|
-
* Works whether or not the plugin source still exists on disk
|
|
67
|
-
* matches by the plugin's name and root path rather than re-reading manifests.
|
|
91
|
+
* Works whether or not the plugin source still exists on disk.
|
|
68
92
|
*/
|
|
69
93
|
export declare function removePluginFromVersion(pluginName: string, pluginRoot: string, agent: AgentId, versionHome: string): {
|
|
70
94
|
skills: string[];
|
|
95
|
+
commands: string[];
|
|
96
|
+
agentDefs: string[];
|
|
97
|
+
bin: string[];
|
|
71
98
|
hooks: string[];
|
|
72
99
|
permissions: number;
|
|
100
|
+
mcp: number;
|
|
73
101
|
};
|
|
74
102
|
/**
|
|
75
103
|
* Remove orphaned plugin skill directories from a version home.
|
|
76
104
|
* Soft-deletes to ~/.agents/.trash/plugins/.
|
|
77
|
-
* An orphan is a skill dir with the plugin prefix pattern (name--skill)
|
|
78
|
-
* where the plugin no longer exists in ~/.agents/plugins/.
|
|
79
105
|
*/
|
|
80
106
|
export declare function cleanOrphanedPluginSkills(agent: AgentId, versionHome: string, activePluginNames: Set<string>, version?: string): string[];
|
|
81
107
|
export interface VersionPluginDiff {
|
|
@@ -83,14 +109,7 @@ export interface VersionPluginDiff {
|
|
|
83
109
|
version: string;
|
|
84
110
|
orphans: string[];
|
|
85
111
|
}
|
|
86
|
-
/**
|
|
87
|
-
* Compare a version home's plugin skills against discovered plugins.
|
|
88
|
-
* Returns orphan plugin skill names (pattern: pluginName--skillName).
|
|
89
|
-
*/
|
|
90
112
|
export declare function diffVersionPlugins(agent: AgentId, version: string): VersionPluginDiff;
|
|
91
|
-
/**
|
|
92
|
-
* Iterate all (agent, version) pairs that support plugins and are installed.
|
|
93
|
-
*/
|
|
94
113
|
export declare function iterPluginsCapableVersions(filter?: {
|
|
95
114
|
agent?: AgentId;
|
|
96
115
|
version?: string;
|
|
@@ -98,11 +117,33 @@ export declare function iterPluginsCapableVersions(filter?: {
|
|
|
98
117
|
agent: AgentId;
|
|
99
118
|
version: string;
|
|
100
119
|
}>;
|
|
101
|
-
/**
|
|
102
|
-
* Remove a single orphan plugin skill from a version home.
|
|
103
|
-
* Soft-deletes to ~/.agents/.trash/plugins/.
|
|
104
|
-
*/
|
|
105
120
|
export declare function removePluginSkillFromVersion(agent: AgentId, version: string, skillName: string): {
|
|
106
121
|
success: boolean;
|
|
107
122
|
error?: string;
|
|
108
123
|
};
|
|
124
|
+
/**
|
|
125
|
+
* Parse an install spec of the form `name@source` or just `source`.
|
|
126
|
+
* Source can be a git URL or an absolute/relative local path.
|
|
127
|
+
*/
|
|
128
|
+
export declare function parseInstallSpec(spec: string): {
|
|
129
|
+
name: string | null;
|
|
130
|
+
source: string;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Install a plugin from a git URL or local path.
|
|
134
|
+
* Clones/copies to ~/.agents/.cache/plugins/<name>/.
|
|
135
|
+
* Returns the installed plugin name and root path.
|
|
136
|
+
*/
|
|
137
|
+
export declare function installPlugin(spec: string): Promise<{
|
|
138
|
+
name: string;
|
|
139
|
+
root: string;
|
|
140
|
+
isNew: boolean;
|
|
141
|
+
}>;
|
|
142
|
+
/**
|
|
143
|
+
* Update an installed plugin by re-pulling from its original source.
|
|
144
|
+
* Returns true if the update succeeded.
|
|
145
|
+
*/
|
|
146
|
+
export declare function updatePlugin(name: string): Promise<{
|
|
147
|
+
success: boolean;
|
|
148
|
+
error?: string;
|
|
149
|
+
}>;
|