@rbbtsn0w/adg 0.4.0-beta.1 → 0.4.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/dist/bin/adg.js +10 -726
- package/dist/src/agents/antigravity.js +3 -3
- package/dist/src/agents/base.js +16 -1
- package/dist/src/agents/claude.js +4 -4
- package/dist/src/agents/codex.js +3 -3
- package/dist/src/cli/handlers.js +454 -0
- package/dist/src/cli/index.js +319 -0
- package/dist/src/commands/marketplace.js +0 -42
- package/dist/src/commands/status.js +10 -1
- package/dist/src/commands/unlink.js +25 -6
- package/dist/src/render/plugins.js +5 -0
- package/package.json +1 -1
package/dist/bin/adg.js
CHANGED
|
@@ -1,737 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { parseArgs } from "node:util";
|
|
3
2
|
import { spawnSync } from "node:child_process";
|
|
4
|
-
import {
|
|
3
|
+
import { readFileSync, realpathSync } from "node:fs";
|
|
5
4
|
import { dirname, join, resolve } from "node:path";
|
|
6
5
|
import { fileURLToPath } from "node:url";
|
|
7
6
|
import { checkForUpdate, formatUpdateNotice } from "../src/update-check.js";
|
|
8
|
-
import { ADAPTER_TARGETS } from "../src/adapters/index.js";
|
|
9
|
-
import { initScaffold } from "../src/commands/init.js";
|
|
10
|
-
import { adaptPlugin } from "../src/commands/adapt.js";
|
|
11
|
-
import { addPlugins } from "../src/commands/install.js";
|
|
12
|
-
import { validatePlugin } from "../src/commands/validate.js";
|
|
13
|
-
import { listPlugins } from "../src/commands/list.js";
|
|
14
|
-
import { importSkills } from "../src/commands/import.js";
|
|
15
|
-
import { linkPlugins } from "../src/commands/link.js";
|
|
16
|
-
import { unlinkPlugins } from "../src/commands/unlink.js";
|
|
17
|
-
import { syncPlugins } from "../src/commands/sync.js";
|
|
18
|
-
import { removePlugin } from "../src/commands/remove.js";
|
|
19
|
-
import { migrateLayout } from "../src/commands/migrate.js";
|
|
20
|
-
import { pluginStatus } from "../src/commands/status.js";
|
|
21
|
-
import { marketplaceList, marketplaceRemove, marketplaceSync, marketplaceUpgrade, updatePlugins } from "../src/commands/marketplace.js";
|
|
22
|
-
import { selectTargetsInteractive } from "../src/commands/select-agents.js";
|
|
23
|
-
import { selectPluginsInteractive } from "../src/commands/select-plugins.js";
|
|
24
|
-
import { selectScopeInteractive, selectUpdateScopeInteractive } from "../src/commands/select-scope.js";
|
|
25
|
-
import { lockPath } from "../src/paths.js";
|
|
26
|
-
import { confirmFullInstall, selectComponentsInteractive } from "../src/commands/select-components.js";
|
|
27
|
-
import { globalPluginsDir, projectPluginsDir } from "../src/paths.js";
|
|
28
|
-
import { COMPONENT_TYPES } from "../src/types.js";
|
|
29
|
-
import { getAgent } from "../src/agents/index.js";
|
|
30
7
|
import { ui } from "../src/render/ui.js";
|
|
31
|
-
import {
|
|
32
|
-
|
|
33
|
-
// Short flags are first-letter aliases. Where several long flags share a
|
|
34
|
-
// first letter, the highest-frequency one wins the short and the rest stay
|
|
35
|
-
// long-only: d → dir (not description) a → all (not author/as)
|
|
36
|
-
// s → skill (not sparse) p → plugin (not path/project/prefix)
|
|
37
|
-
dir: { type: "string", short: "d", hint: "<dir>", help: "install into an explicit directory" },
|
|
38
|
-
global: { type: "boolean", short: "g", help: "use ~/.agents/plugins (across all projects)" },
|
|
39
|
-
project: { type: "boolean", help: "use <repo>/.agents/plugins (default)" },
|
|
40
|
-
target: { type: "string", short: "t", hint: "claude|codex|antigravity|all", help: "runtime(s) to adapt for" },
|
|
41
|
-
all: { type: "boolean", short: "a", help: "select all available plugins" },
|
|
42
|
-
plugin: { type: "string", short: "p", multiple: true, hint: "<name>", help: "select a specific plugin (repeatable)" },
|
|
43
|
-
"no-deps": { type: "boolean", short: "n", help: "don't install dependencies" },
|
|
44
|
-
path: { type: "string", hint: "<subdir>", help: "install only this subdir of the source" },
|
|
45
|
-
ref: { type: "string", short: "r", hint: "<ref>", help: "pin a git ref (branch/tag/sha)" },
|
|
46
|
-
sparse: { type: "string", multiple: true, hint: "<path>", help: "sparse-checkout path (repeatable)" },
|
|
47
|
-
"marketplace-name": { type: "string", hint: "<name>", help: "override the marketplace key" },
|
|
48
|
-
force: { type: "boolean", short: "f", help: "skip confirmation / force" },
|
|
49
|
-
description: { type: "string", hint: "<text>", help: "plugin description" },
|
|
50
|
-
author: { type: "string", hint: "<name>", help: "plugin author" },
|
|
51
|
-
type: { type: "string", hint: "plugin|marketplace|all", help: "init: which .agents/ artifact to scaffold (default plugin)" },
|
|
52
|
-
skill: { type: "string", short: "s", multiple: true, hint: "<name>", help: "skill name (init: seed one · add: limit to these)" },
|
|
53
|
-
only: { type: "string", hint: "<types>", help: "limit to these component types (skills,agents,commands,mcp,hooks,apps)" },
|
|
54
|
-
as: { type: "string", hint: "<name>", help: "plugin name to wrap the skills as" },
|
|
55
|
-
prefix: { type: "string", hint: "<p>", help: "prefix imported skill names" },
|
|
56
|
-
verbose: { type: "boolean", short: "v", help: "expand each component to its member names" },
|
|
57
|
-
};
|
|
58
|
-
// Scope flags recur on almost every command; name the group once.
|
|
59
|
-
const SCOPE = ["project", "global", "dir"];
|
|
60
|
-
function optionsFor(names) {
|
|
61
|
-
const out = {};
|
|
62
|
-
for (const n of names) {
|
|
63
|
-
const f = FLAGS[n];
|
|
64
|
-
out[n] = { type: f.type, ...(f.short ? { short: f.short } : {}), ...(f.multiple ? { multiple: true } : {}) };
|
|
65
|
-
}
|
|
66
|
-
return out;
|
|
67
|
-
}
|
|
68
|
-
const PLUGIN_COMMANDS = {
|
|
69
|
-
add: {
|
|
70
|
-
summary: "install plugins from a source",
|
|
71
|
-
synopsis: "adg plugins add <source>",
|
|
72
|
-
positional: "<source> = <local-dir> | <owner/repo[@ref]> | <github-url>",
|
|
73
|
-
blurb: "In a terminal, add guides you through: scope → plugins → agents → what to install.\n" +
|
|
74
|
-
"By default it installs everything; choose 'No, let me choose' to pick components,\n" +
|
|
75
|
-
"or pass the flags below to skip any prompt (e.g. for scripts/CI).",
|
|
76
|
-
flags: ["all", "plugin", "only", "skill", "target", "no-deps", "path", "ref", "sparse", "marketplace-name", ...SCOPE],
|
|
77
|
-
examples: [
|
|
78
|
-
"adg plugins add owner/repo # guided",
|
|
79
|
-
"adg plugins add owner/repo --all --global # all plugins, global, non-interactive",
|
|
80
|
-
"adg plugins add owner/repo --only skills # expose only the skills",
|
|
81
|
-
"adg plugins add owner/repo --skill brainstorming --skill writing-plans",
|
|
82
|
-
],
|
|
83
|
-
start: true,
|
|
84
|
-
},
|
|
85
|
-
list: {
|
|
86
|
-
summary: "list installed plugins",
|
|
87
|
-
synopsis: "adg plugins list",
|
|
88
|
-
blurb: "Each plugin shows a one-line summary of what it contains. Add --verbose\nto expand every component (skills, agents, commands, …) to its member names.",
|
|
89
|
-
flags: ["verbose", ...SCOPE],
|
|
90
|
-
},
|
|
91
|
-
status: {
|
|
92
|
-
summary: "show store-vs-agent drift per runtime",
|
|
93
|
-
synopsis: "adg plugins status [--target claude|codex|antigravity]",
|
|
94
|
-
blurb: "Query each agent's CLI live and diff it against the store: what's in\nsync, missing (needs `link`/`sync`), or present in the agent only. Each drift\nrow carries the command that repairs it. Inspects the active scope (--global →\nuser, else project). Name-level only — run `sync` if unsure.",
|
|
95
|
-
flags: ["target", ...SCOPE],
|
|
96
|
-
},
|
|
97
|
-
update: {
|
|
98
|
-
summary: "pull upstream changes for installed plugins",
|
|
99
|
-
synopsis: "adg plugins update [<source>]",
|
|
100
|
-
positional: "<source> limit to one source key from `adg plugins marketplace list` (default: all)",
|
|
101
|
-
blurb: "Re-fetches every remote source and refreshes the plugins installed from it,\n" +
|
|
102
|
-
"reporting what changed, what's unchanged, what was deleted upstream, and what's\n" +
|
|
103
|
-
"newly available (install those too with --all). Local-source plugins are\n" +
|
|
104
|
-
"rescanned in place. In a terminal, it asks whether to update project, global,\n" +
|
|
105
|
-
"or both; pass a scope flag to skip the prompt.\n\n" +
|
|
106
|
-
"This is the plugins-domain twin of `adg skills update`.",
|
|
107
|
-
flags: ["all", ...SCOPE],
|
|
108
|
-
examples: [
|
|
109
|
-
"adg plugins update # guided: project / global / both",
|
|
110
|
-
"adg plugins update --global # every global source",
|
|
111
|
-
"adg plugins update owner/repo # just one source",
|
|
112
|
-
"adg plugins update owner/repo --all # also install newly-added plugins",
|
|
113
|
-
],
|
|
114
|
-
},
|
|
115
|
-
remove: {
|
|
116
|
-
summary: "uninstall a plugin",
|
|
117
|
-
synopsis: "adg plugins remove <name>",
|
|
118
|
-
positional: "<name> an installed plugin name (see `adg plugins list`)",
|
|
119
|
-
flags: ["force", ...SCOPE],
|
|
120
|
-
},
|
|
121
|
-
init: {
|
|
122
|
-
summary: "scaffold a new plugin or marketplace (.agents/ only)",
|
|
123
|
-
synopsis: "adg plugins init <name> [--type plugin|marketplace|all]",
|
|
124
|
-
positional: "<name> directory name for the new plugin/marketplace",
|
|
125
|
-
flags: ["dir", "description", "author", "skill", "type"],
|
|
126
|
-
},
|
|
127
|
-
adapt: {
|
|
128
|
-
summary: "regenerate Claude/Codex manifests from .agents/.plugin.json",
|
|
129
|
-
synopsis: "adg plugins adapt [<dir>]",
|
|
130
|
-
positional: "<dir> plugin directory (default: current directory)",
|
|
131
|
-
flags: ["target"],
|
|
132
|
-
},
|
|
133
|
-
validate: {
|
|
134
|
-
summary: "check a directory is a valid ADG plugin",
|
|
135
|
-
synopsis: "adg plugins validate [<dir>]",
|
|
136
|
-
positional: "<dir> plugin directory (default: current directory)",
|
|
137
|
-
flags: [],
|
|
138
|
-
},
|
|
139
|
-
"import-skills": {
|
|
140
|
-
summary: "wrap an existing skills/ dir as a plugin",
|
|
141
|
-
synopsis: "adg plugins import-skills <skills-dir> --as <name>",
|
|
142
|
-
positional: "<skills-dir> a directory of SKILL.md folders",
|
|
143
|
-
flags: ["as", "prefix", "description", ...SCOPE],
|
|
144
|
-
},
|
|
145
|
-
link: {
|
|
146
|
-
summary: "link installed plugins into a runtime",
|
|
147
|
-
synopsis: "adg plugins link --target claude|codex|antigravity [name...]",
|
|
148
|
-
positional: "[name...] installed plugin names to link (default: all)",
|
|
149
|
-
blurb: "Project the store into one agent: (re)generate its manifests and enable\nthe plugins via that agent's CLI. The store is unchanged. The inverse is\n`adg plugins unlink`; to force an agent to match the store, use `adg plugins sync`.",
|
|
150
|
-
flags: ["target", ...SCOPE],
|
|
151
|
-
},
|
|
152
|
-
unlink: {
|
|
153
|
-
summary: "unlink plugins from a runtime (store kept)",
|
|
154
|
-
synopsis: "adg plugins unlink --target claude|codex|antigravity [name...]",
|
|
155
|
-
positional: "[name...] installed plugin names to unlink (default: all)",
|
|
156
|
-
blurb: "Disable the plugins in one agent without removing them from the store —\nthe per-agent inverse of `link`. To delete from the store and every agent\nat once, use `adg plugins remove`.",
|
|
157
|
-
flags: ["target", ...SCOPE],
|
|
158
|
-
examples: [
|
|
159
|
-
"adg plugins unlink --target antigravity asc # drop asc from agy only",
|
|
160
|
-
"adg plugins unlink --target codex # unlink everything from codex",
|
|
161
|
-
],
|
|
162
|
-
},
|
|
163
|
-
sync: {
|
|
164
|
-
summary: "reconcile a runtime's plugins with the store",
|
|
165
|
-
synopsis: "adg plugins sync --target claude|codex|antigravity [name...]",
|
|
166
|
-
positional: "[name...] installed plugin names to sync (default: all)",
|
|
167
|
-
blurb: "Make one agent's copy match the store: regenerate manifests and re-import,\nclearing components that were dropped since the last sync. Use this to repair\ndrift (e.g. residual skills). Only store-known plugins are touched.",
|
|
168
|
-
flags: ["target", ...SCOPE],
|
|
169
|
-
examples: [
|
|
170
|
-
"adg plugins sync --target antigravity asc # clear agy residual for asc",
|
|
171
|
-
"adg plugins sync --target claude # re-sync every plugin into Claude",
|
|
172
|
-
],
|
|
173
|
-
},
|
|
174
|
-
migrate: {
|
|
175
|
-
summary: "move flat installs into per-marketplace dirs",
|
|
176
|
-
synopsis: "adg plugins migrate",
|
|
177
|
-
flags: [...SCOPE],
|
|
178
|
-
},
|
|
179
|
-
marketplace: {
|
|
180
|
-
summary: "view installed plugins grouped by source",
|
|
181
|
-
synopsis: "adg plugins marketplace <list|upgrade|remove>",
|
|
182
|
-
flags: [],
|
|
183
|
-
delegated: true,
|
|
184
|
-
},
|
|
185
|
-
};
|
|
186
|
-
// Aliases tolerated for plugin verbs.
|
|
187
|
-
const PLUGIN_ALIASES = { rm: "remove", mp: "marketplace" };
|
|
8
|
+
import { TOP_USAGE, fail } from "../src/cli/index.js";
|
|
9
|
+
import { runPlugins } from "../src/cli/handlers.js";
|
|
188
10
|
// ---------------------------------------------------------------------------
|
|
189
|
-
//
|
|
11
|
+
// `adg` entry point: thin wire-up only.
|
|
12
|
+
//
|
|
13
|
+
// The CLI surface — flag table, command tables, help rendering, scope/target
|
|
14
|
+
// resolution, and the per-verb handlers — lives in `src/cli/` so it can be
|
|
15
|
+
// unit-tested without spawning a subprocess. This file owns just the bits that
|
|
16
|
+
// genuinely need the process: domain routing, the `skills` subprocess bridge,
|
|
17
|
+
// version/update reporting, and the direct-invocation guard.
|
|
190
18
|
// ---------------------------------------------------------------------------
|
|
191
|
-
const TOP_USAGE = `adg — Agent Directory Group toolkit
|
|
192
|
-
|
|
193
|
-
Group scattered skills and plugins, by source, into versioned and reproducible
|
|
194
|
-
plugin sets — and adapt each to both Claude and Codex runtimes from one manifest.
|
|
195
|
-
|
|
196
|
-
Quick start:
|
|
197
|
-
adg plugins add <owner/repo> install plugins from a source (guided in a terminal)
|
|
198
|
-
adg plugins list see what's installed
|
|
199
|
-
|
|
200
|
-
Two domains:
|
|
201
|
-
adg plugins <verb> manage plugins (run \`adg plugins -h\`)
|
|
202
|
-
adg skills <verb> manage skills (run \`adg skills -h\`)
|
|
203
|
-
|
|
204
|
-
Concepts & architecture: see README.md and docs/agents-spec.md`;
|
|
205
|
-
function flagLabel(name) {
|
|
206
|
-
const f = FLAGS[name];
|
|
207
|
-
const lead = f.short ? `-${f.short}, --${name}` : ` --${name}`;
|
|
208
|
-
return f.hint ? `${lead} ${f.hint}` : lead;
|
|
209
|
-
}
|
|
210
|
-
function renderFlags(names) {
|
|
211
|
-
if (names.length === 0)
|
|
212
|
-
return "";
|
|
213
|
-
const labels = names.map(flagLabel);
|
|
214
|
-
const width = Math.max(...labels.map((l) => l.length));
|
|
215
|
-
const lines = names.map((n, i) => ` ${labels[i].padEnd(width)} ${FLAGS[n].help}`);
|
|
216
|
-
return `Flags:\n${lines.join("\n")}`;
|
|
217
|
-
}
|
|
218
|
-
/** L1: `adg plugins -h` — overview of the domain and a one-line verb list. */
|
|
219
|
-
function renderPluginsHelp() {
|
|
220
|
-
const names = Object.keys(PLUGIN_COMMANDS);
|
|
221
|
-
const width = Math.max(...names.map((n) => n.length));
|
|
222
|
-
const rows = names.map((n) => {
|
|
223
|
-
const cmd = PLUGIN_COMMANDS[n];
|
|
224
|
-
const tag = cmd.start ? " ← start here" : "";
|
|
225
|
-
return ` ${n.padEnd(width)} ${cmd.summary}${tag}`;
|
|
226
|
-
});
|
|
227
|
-
return `adg plugins — manage agent plugins
|
|
228
|
-
|
|
229
|
-
A plugin bundles skills/agents/commands, installed from a source (a local dir, or
|
|
230
|
-
a GitHub repo holding one plugin or many). Authored once in .agents/.plugin.json,
|
|
231
|
-
then adapted to Claude and Codex automatically.
|
|
232
|
-
|
|
233
|
-
Commands (run \`adg plugins <verb> -h\` for details & flags):
|
|
234
|
-
${rows.join("\n")}
|
|
235
|
-
|
|
236
|
-
Scope (most commands): --project (default) | --global | --dir <dir>
|
|
237
|
-
--global honors XDG_STATE_HOME / ADG_PLUGINS_HOME. Only the plugins/ subtree is
|
|
238
|
-
touched; AGENTS.md and skills/ are never modified.`;
|
|
239
|
-
}
|
|
240
|
-
/** L2: `adg plugins <verb> -h` — just this command's region. */
|
|
241
|
-
function renderVerbHelp(name) {
|
|
242
|
-
const cmd = PLUGIN_COMMANDS[name];
|
|
243
|
-
const parts = [`adg plugins ${name} — ${cmd.summary}`, "", cmd.synopsis];
|
|
244
|
-
if (cmd.positional)
|
|
245
|
-
parts.push(` ${cmd.positional}`);
|
|
246
|
-
if (cmd.blurb)
|
|
247
|
-
parts.push("", cmd.blurb);
|
|
248
|
-
const flags = renderFlags(cmd.flags);
|
|
249
|
-
if (flags)
|
|
250
|
-
parts.push("", flags);
|
|
251
|
-
if (cmd.examples)
|
|
252
|
-
parts.push("", "Examples:", ...cmd.examples.map((e) => ` ${e}`));
|
|
253
|
-
return parts.join("\n");
|
|
254
|
-
}
|
|
255
|
-
function wantsHelp(args) {
|
|
256
|
-
return args.includes("-h") || args.includes("--help");
|
|
257
|
-
}
|
|
258
|
-
function fail(msg) {
|
|
259
|
-
console.error(`${ui.err("error:")} ${msg}\n`);
|
|
260
|
-
console.error(TOP_USAGE);
|
|
261
|
-
process.exit(1);
|
|
262
|
-
}
|
|
263
|
-
function resolveScopeDir(values) {
|
|
264
|
-
if (typeof values.dir === "string")
|
|
265
|
-
return resolve(values.dir);
|
|
266
|
-
return values.global ? globalPluginsDir() : projectPluginsDir();
|
|
267
|
-
}
|
|
268
|
-
/** Describe the active scope so "source not found" errors can name where they looked. */
|
|
269
|
-
function scopeInfo(values) {
|
|
270
|
-
const label = typeof values.dir === "string" ? resolve(values.dir) : values.global ? "global" : "project";
|
|
271
|
-
return { label, globalDir: globalPluginsDir() };
|
|
272
|
-
}
|
|
273
|
-
/** Map the active scope to an agent install scope (global → user, else project). */
|
|
274
|
-
function scopeOf(values) {
|
|
275
|
-
return values.global ? "user" : "project";
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
* Resolve which scope(s) `plugins update` should refresh, mirroring
|
|
279
|
-
* `adg skills update`: an explicit --dir is a single ad-hoc location; otherwise
|
|
280
|
-
* --project/--global (or both) win, a terminal prompts for project/global/both,
|
|
281
|
-
* and a non-interactive run defaults to project when a project lock exists.
|
|
282
|
-
*/
|
|
283
|
-
async function resolveUpdateScopes(values) {
|
|
284
|
-
if (typeof values.dir === "string") {
|
|
285
|
-
const dir = resolve(values.dir);
|
|
286
|
-
return [{ dir, agentScope: "project", label: dir }];
|
|
287
|
-
}
|
|
288
|
-
const project = { dir: projectPluginsDir(), agentScope: "project", label: "project" };
|
|
289
|
-
const global = { dir: globalPluginsDir(), agentScope: "user", label: "global" };
|
|
290
|
-
let choice;
|
|
291
|
-
if (values.global && values.project)
|
|
292
|
-
choice = "both";
|
|
293
|
-
else if (values.global)
|
|
294
|
-
choice = "global";
|
|
295
|
-
else if (values.project)
|
|
296
|
-
choice = "project";
|
|
297
|
-
else if (process.stdin.isTTY)
|
|
298
|
-
choice = await selectUpdateScopeInteractive();
|
|
299
|
-
else
|
|
300
|
-
choice = existsSync(lockPath(projectPluginsDir())) ? "project" : "global";
|
|
301
|
-
if (choice === "both") {
|
|
302
|
-
return [{ ...project, heading: "Project plugins" }, { ...global, heading: "Global plugins" }];
|
|
303
|
-
}
|
|
304
|
-
return [choice === "global" ? global : project];
|
|
305
|
-
}
|
|
306
|
-
/** Friendly `--target` aliases mapped onto canonical adapter target ids. */
|
|
307
|
-
const TARGET_ALIASES = {
|
|
308
|
-
anthropic: "claude",
|
|
309
|
-
openai: "codex",
|
|
310
|
-
agy: "antigravity",
|
|
311
|
-
gemini: "antigravity",
|
|
312
|
-
};
|
|
313
|
-
function resolveTargets(target) {
|
|
314
|
-
if (!target || target === "all")
|
|
315
|
-
return [...ADAPTER_TARGETS];
|
|
316
|
-
const t = TARGET_ALIASES[target] ?? target;
|
|
317
|
-
if (ADAPTER_TARGETS.includes(t))
|
|
318
|
-
return [t];
|
|
319
|
-
fail(`invalid --target "${target}" (expected ${[...ADAPTER_TARGETS, "all"].join("|")})`);
|
|
320
|
-
}
|
|
321
|
-
/** A single-agent projection verb (link/unlink/sync) needs exactly one --target. */
|
|
322
|
-
function requireSingleTarget(target, verb) {
|
|
323
|
-
if (target === undefined || target === "all") {
|
|
324
|
-
fail(`plugins ${verb} requires a single --target (${ADAPTER_TARGETS.join("|")})`);
|
|
325
|
-
}
|
|
326
|
-
return resolveTargets(target)[0]; // validates + maps aliases (agy → antigravity); always non-empty
|
|
327
|
-
}
|
|
328
|
-
/** Parse a `--only skills,commands` list into validated component types. */
|
|
329
|
-
function resolveComponents(only) {
|
|
330
|
-
if (only === undefined)
|
|
331
|
-
return undefined;
|
|
332
|
-
const parts = only.split(",").map((s) => s.trim()).filter(Boolean);
|
|
333
|
-
const bad = parts.filter((p) => !COMPONENT_TYPES.includes(p));
|
|
334
|
-
if (bad.length > 0)
|
|
335
|
-
fail(`invalid --only "${bad.join(", ")}" (expected ${COMPONENT_TYPES.join("|")})`);
|
|
336
|
-
return parts;
|
|
337
|
-
}
|
|
338
|
-
/**
|
|
339
|
-
* Parse a verb's args against only the flags it declares. An unknown flag (or a
|
|
340
|
-
* malformed value) prints that command's own help — so `-h` and a typo lead to
|
|
341
|
-
* the same place. Returns parsed values + positionals.
|
|
342
|
-
*/
|
|
343
|
-
function parseVerb(name, flags, rest) {
|
|
344
|
-
try {
|
|
345
|
-
const { values, positionals } = parseArgs({ args: rest, options: optionsFor(flags), allowPositionals: true });
|
|
346
|
-
return { values: values, positionals };
|
|
347
|
-
}
|
|
348
|
-
catch (err) {
|
|
349
|
-
console.error(`${ui.err("error:")} ${err instanceof Error ? err.message : String(err)}\n`);
|
|
350
|
-
console.error(renderVerbHelp(name));
|
|
351
|
-
process.exit(1);
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
async function runPlugins(rawVerb, rest) {
|
|
355
|
-
// `adg plugins` (no verb) or an explicit help request → the L1 overview.
|
|
356
|
-
if (rawVerb === undefined || rawVerb === "-h" || rawVerb === "--help" || rawVerb === "help") {
|
|
357
|
-
console.log(renderPluginsHelp());
|
|
358
|
-
return;
|
|
359
|
-
}
|
|
360
|
-
const verb = PLUGIN_ALIASES[rawVerb] ?? rawVerb;
|
|
361
|
-
const cmd = PLUGIN_COMMANDS[verb];
|
|
362
|
-
if (!cmd) {
|
|
363
|
-
console.error(`${ui.err("error:")} unknown plugins subcommand: ${rawVerb}\n`);
|
|
364
|
-
console.error(renderPluginsHelp());
|
|
365
|
-
process.exit(1);
|
|
366
|
-
}
|
|
367
|
-
// `adg plugins <verb> -h` → just this command's help. (marketplace handles
|
|
368
|
-
// its own sub-help, so let it through.)
|
|
369
|
-
if (!cmd.delegated && wantsHelp(rest)) {
|
|
370
|
-
console.log(renderVerbHelp(verb));
|
|
371
|
-
return;
|
|
372
|
-
}
|
|
373
|
-
switch (verb) {
|
|
374
|
-
case "init": {
|
|
375
|
-
const { values, positionals } = parseVerb(verb, cmd.flags, rest);
|
|
376
|
-
const name = positionals[0];
|
|
377
|
-
if (!name)
|
|
378
|
-
fail("plugins init requires a <name>");
|
|
379
|
-
const dir = values.dir ? resolve(values.dir) : resolve(process.cwd(), "plugins");
|
|
380
|
-
const type = (values.type ?? "plugin");
|
|
381
|
-
if (type !== "plugin" && type !== "marketplace" && type !== "all") {
|
|
382
|
-
fail(`invalid --type "${values.type}" (expected plugin|marketplace|all)`);
|
|
383
|
-
}
|
|
384
|
-
const res = initScaffold({ name, dir, type, description: values.description, author: values.author, skill: values.skill?.[0] });
|
|
385
|
-
console.log(`${ui.ok(`created ${type}`)} at ${ui.name(res.pluginDir)}`);
|
|
386
|
-
for (const f of res.created)
|
|
387
|
-
console.log(ui.meta(` + ${f}`));
|
|
388
|
-
return;
|
|
389
|
-
}
|
|
390
|
-
case "adapt": {
|
|
391
|
-
const { values, positionals } = parseVerb(verb, cmd.flags, rest);
|
|
392
|
-
const pluginDir = resolve(positionals[0] ?? process.cwd());
|
|
393
|
-
for (const r of adaptPlugin(pluginDir, resolveTargets(values.target))) {
|
|
394
|
-
console.log(`${ui.ok("adapted")} ${ui.name(r.target)} ${ui.meta(`-> ${r.file}`)}`);
|
|
395
|
-
}
|
|
396
|
-
return;
|
|
397
|
-
}
|
|
398
|
-
case "validate": {
|
|
399
|
-
const { positionals } = parseVerb(verb, cmd.flags, rest);
|
|
400
|
-
const pluginDir = resolve(positionals[0] ?? process.cwd());
|
|
401
|
-
const res = validatePlugin(pluginDir);
|
|
402
|
-
if (res.ok) {
|
|
403
|
-
console.log(`${ui.ok("ok:")} ${ui.name(pluginDir)} is a valid ADG plugin`);
|
|
404
|
-
}
|
|
405
|
-
else {
|
|
406
|
-
console.error(`${ui.err("invalid:")} ${ui.name(pluginDir)}`);
|
|
407
|
-
for (const i of res.issues)
|
|
408
|
-
console.error(ui.warn(` - ${i}`));
|
|
409
|
-
process.exit(1);
|
|
410
|
-
}
|
|
411
|
-
return;
|
|
412
|
-
}
|
|
413
|
-
case "add": {
|
|
414
|
-
const { values, positionals } = parseVerb(verb, cmd.flags, rest);
|
|
415
|
-
const spec = positionals[0];
|
|
416
|
-
if (!spec)
|
|
417
|
-
fail("plugins add requires a <plugin-dir | owner/repo[@ref] | github-url>");
|
|
418
|
-
const tty = process.stdin.isTTY;
|
|
419
|
-
// Scope: honor an explicit --dir/--global/--project, else ask in a terminal
|
|
420
|
-
// (defaulting to project non-interactively).
|
|
421
|
-
let global = Boolean(values.global);
|
|
422
|
-
if (!values.dir && values.global === undefined && values.project === undefined && tty) {
|
|
423
|
-
global = await selectScopeInteractive();
|
|
424
|
-
}
|
|
425
|
-
const pluginsDir = values.dir
|
|
426
|
-
? resolve(values.dir)
|
|
427
|
-
: global
|
|
428
|
-
? globalPluginsDir()
|
|
429
|
-
: projectPluginsDir();
|
|
430
|
-
// A source may hold one plugin or a whole marketplace. addPlugins discovers
|
|
431
|
-
// all of them; in a terminal the user picks scope, then plugins, then agents,
|
|
432
|
-
// then (unless --only/--skill narrow it) chooses what to install per plugin.
|
|
433
|
-
// --all / --plugin / --path / --only / --skill narrow non-interactively.
|
|
434
|
-
const only = resolveComponents(values.only);
|
|
435
|
-
const skillsSubset = values.skill && values.skill.length > 0 ? values.skill : undefined;
|
|
436
|
-
const narrowed = only !== undefined || skillsSubset !== undefined;
|
|
437
|
-
const { order, installed, converted, agents } = await addPlugins({
|
|
438
|
-
spec,
|
|
439
|
-
pluginsDir,
|
|
440
|
-
ref: values.ref,
|
|
441
|
-
sparse: values.sparse,
|
|
442
|
-
path: values.path,
|
|
443
|
-
all: values.all,
|
|
444
|
-
plugins: values.plugin,
|
|
445
|
-
only,
|
|
446
|
-
skillsSubset,
|
|
447
|
-
withDeps: !values["no-deps"],
|
|
448
|
-
marketplaceName: values["marketplace-name"],
|
|
449
|
-
targets: values.target !== undefined ? resolveTargets(values.target) : undefined,
|
|
450
|
-
selectPlugins: tty ? selectPluginsInteractive : undefined,
|
|
451
|
-
selectTargets: tty && values.target === undefined ? selectTargetsInteractive : undefined,
|
|
452
|
-
confirmFull: tty && !narrowed ? confirmFullInstall : undefined,
|
|
453
|
-
selectComponents: tty && !narrowed ? selectComponentsInteractive : undefined,
|
|
454
|
-
// Make the install actually usable in the chosen agents, not just stored.
|
|
455
|
-
activate: true,
|
|
456
|
-
scope: global ? "user" : "project",
|
|
457
|
-
});
|
|
458
|
-
for (const name of converted)
|
|
459
|
-
console.log(ui.meta(`converted native manifest -> .agents/.plugin.json: ${name}`));
|
|
460
|
-
if (order.length > 1)
|
|
461
|
-
console.log(ui.meta(`install order: ${order.join(" -> ")}`));
|
|
462
|
-
for (const res of installed) {
|
|
463
|
-
console.log(`${ui.ok("added")} ${ui.name(res.name)} ${ui.meta(`-> ${res.installedTo}`)}`);
|
|
464
|
-
console.log(ui.meta(` folderHash: ${res.folderHash}`));
|
|
465
|
-
for (const f of res.adapted)
|
|
466
|
-
console.log(ui.meta(` adapted: ${f}`));
|
|
467
|
-
}
|
|
468
|
-
for (const line of renderAgentReport(agents, "enabled"))
|
|
469
|
-
console.log(line);
|
|
470
|
-
return;
|
|
471
|
-
}
|
|
472
|
-
case "import-skills": {
|
|
473
|
-
const { values, positionals } = parseVerb(verb, cmd.flags, rest);
|
|
474
|
-
const dir = positionals[0];
|
|
475
|
-
if (!dir)
|
|
476
|
-
fail("plugins import-skills requires a <skills-dir>");
|
|
477
|
-
if (!values.as)
|
|
478
|
-
fail("plugins import-skills requires --as <plugin-name>");
|
|
479
|
-
const res = importSkills({
|
|
480
|
-
skillsDir: resolve(dir),
|
|
481
|
-
as: values.as,
|
|
482
|
-
prefix: values.prefix,
|
|
483
|
-
pluginsDir: resolveScopeDir(values),
|
|
484
|
-
description: values.description,
|
|
485
|
-
});
|
|
486
|
-
console.log(`${ui.ok("imported skills into")} ${ui.name(res.name)} ${ui.meta(`-> ${res.installedTo}`)}`);
|
|
487
|
-
return;
|
|
488
|
-
}
|
|
489
|
-
case "link": {
|
|
490
|
-
const { values, positionals } = parseVerb(verb, cmd.flags, rest);
|
|
491
|
-
const target = requireSingleTarget(values.target, "link");
|
|
492
|
-
const names = positionals.length > 0 ? positionals : undefined;
|
|
493
|
-
const res = linkPlugins({ pluginsDir: resolveScopeDir(values), target, global: Boolean(values.global), names });
|
|
494
|
-
for (const a of res.actions) {
|
|
495
|
-
console.log(`${ui.ok("linked")} ${ui.name(a.name)} ${ui.meta(`[${res.target}]`)}${a.linkedTo ? ui.meta(` -> ${a.linkedTo}`) : ""}`);
|
|
496
|
-
for (const f of a.adapted)
|
|
497
|
-
console.log(ui.meta(` adapted: ${f}`));
|
|
498
|
-
}
|
|
499
|
-
if (res.cliSkipped) {
|
|
500
|
-
console.log(ui.warn(`note: \`${target}\` CLI not found — manifests were generated, but nothing was enabled in ${target}.`));
|
|
501
|
-
}
|
|
502
|
-
return;
|
|
503
|
-
}
|
|
504
|
-
case "unlink": {
|
|
505
|
-
const { values, positionals } = parseVerb(verb, cmd.flags, rest);
|
|
506
|
-
const target = requireSingleTarget(values.target, "unlink");
|
|
507
|
-
const names = positionals.length > 0 ? positionals : undefined;
|
|
508
|
-
const res = unlinkPlugins({ pluginsDir: resolveScopeDir(values), target, global: Boolean(values.global), names });
|
|
509
|
-
for (const name of res.unlinked)
|
|
510
|
-
console.log(`${ui.ok("unlinked")} ${ui.name(name)} ${ui.meta(`[${res.target}]`)}`);
|
|
511
|
-
if (res.cliSkipped) {
|
|
512
|
-
console.log(ui.warn(`note: \`${target}\` CLI not found — nothing was unlinked from ${target}.`));
|
|
513
|
-
}
|
|
514
|
-
else if (res.unlinked.length === 0) {
|
|
515
|
-
console.log(ui.meta(`nothing to unlink from ${target}`));
|
|
516
|
-
}
|
|
517
|
-
return;
|
|
518
|
-
}
|
|
519
|
-
case "sync": {
|
|
520
|
-
const { values, positionals } = parseVerb(verb, cmd.flags, rest);
|
|
521
|
-
const target = requireSingleTarget(values.target, "sync");
|
|
522
|
-
const names = positionals.length > 0 ? positionals : undefined;
|
|
523
|
-
const res = syncPlugins({ pluginsDir: resolveScopeDir(values), target, global: Boolean(values.global), names });
|
|
524
|
-
for (const a of res.actions) {
|
|
525
|
-
const tail = a.synced ? ui.meta(` -> ${res.target}`) : "";
|
|
526
|
-
console.log(`${ui.ok("synced")} ${ui.name(a.name)} ${ui.meta(`[${res.target}]`)}${tail}`);
|
|
527
|
-
}
|
|
528
|
-
if (res.cliSkipped) {
|
|
529
|
-
console.log(ui.warn(`note: \`${target}\` CLI not found — manifests were regenerated, but nothing was re-synced in ${target}.`));
|
|
530
|
-
}
|
|
531
|
-
return;
|
|
532
|
-
}
|
|
533
|
-
case "update": {
|
|
534
|
-
const { values, positionals } = parseVerb(verb, cmd.flags, rest);
|
|
535
|
-
const source = positionals[0];
|
|
536
|
-
for (const sc of await resolveUpdateScopes(values)) {
|
|
537
|
-
if (sc.heading)
|
|
538
|
-
console.log(`${ui.name(sc.heading)}`);
|
|
539
|
-
try {
|
|
540
|
-
const result = await updatePlugins({
|
|
541
|
-
pluginsDir: sc.dir,
|
|
542
|
-
source,
|
|
543
|
-
all: values.all,
|
|
544
|
-
activate: true,
|
|
545
|
-
agentScope: sc.agentScope,
|
|
546
|
-
scope: { label: sc.label, globalDir: globalPluginsDir() },
|
|
547
|
-
});
|
|
548
|
-
for (const line of renderUpdateReport(result))
|
|
549
|
-
console.log(line);
|
|
550
|
-
for (const line of renderAgentReport(result.agents, "re-synced"))
|
|
551
|
-
console.log(line);
|
|
552
|
-
}
|
|
553
|
-
catch (err) {
|
|
554
|
-
console.error(`${ui.err("error:")} ${err instanceof Error ? err.message : String(err)}`);
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
return;
|
|
558
|
-
}
|
|
559
|
-
case "remove": {
|
|
560
|
-
const { values, positionals } = parseVerb(verb, cmd.flags, rest);
|
|
561
|
-
const name = positionals[0];
|
|
562
|
-
if (!name)
|
|
563
|
-
fail("plugins remove requires a <name>");
|
|
564
|
-
const res = removePlugin({
|
|
565
|
-
pluginsDir: resolveScopeDir(values),
|
|
566
|
-
name,
|
|
567
|
-
force: values.force,
|
|
568
|
-
deactivate: true,
|
|
569
|
-
scope: scopeOf(values),
|
|
570
|
-
});
|
|
571
|
-
if (res.removedDir)
|
|
572
|
-
console.log(`${ui.ok("removed")} ${ui.name(res.name)} ${ui.meta(`-> ${res.removedDir}`)}`);
|
|
573
|
-
else
|
|
574
|
-
console.log(`${ui.ok("removed")} ${ui.name(res.name)} ${ui.meta("(no directory on disk)")}`);
|
|
575
|
-
for (const link of res.unlinked)
|
|
576
|
-
console.log(ui.meta(` unlinked: ${link}`));
|
|
577
|
-
for (const r of res.agents ?? []) {
|
|
578
|
-
const display = getAgent(r.agent)?.displayName ?? r.agent;
|
|
579
|
-
if (r.affected.length > 0)
|
|
580
|
-
console.log(ui.meta(` disabled in ${display}`));
|
|
581
|
-
// CLI absent → the plugin may still be enabled there; surface the precise
|
|
582
|
-
// repair so a store-deleted plugin can't silently linger in that agent.
|
|
583
|
-
else if (r.skipped) {
|
|
584
|
-
console.log(ui.warn(` ${r.agent} CLI not found — if enabled there, run \`adg plugins unlink --target ${r.agent} ${res.name}\``));
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
if (!res.removedFromLock && !res.removedDir) {
|
|
588
|
-
console.log(ui.warn(` ${res.name} was not recorded in the lock`));
|
|
589
|
-
}
|
|
590
|
-
return;
|
|
591
|
-
}
|
|
592
|
-
case "list": {
|
|
593
|
-
const { values } = parseVerb(verb, cmd.flags, rest);
|
|
594
|
-
const pluginsDir = resolveScopeDir(values);
|
|
595
|
-
const plugins = listPlugins(pluginsDir);
|
|
596
|
-
for (const line of renderPluginList(plugins, pluginsDir, { verbose: values.verbose })) {
|
|
597
|
-
console.log(line);
|
|
598
|
-
}
|
|
599
|
-
return;
|
|
600
|
-
}
|
|
601
|
-
case "status": {
|
|
602
|
-
const { values } = parseVerb(verb, cmd.flags, rest);
|
|
603
|
-
const targets = values.target !== undefined ? resolveTargets(values.target) : undefined;
|
|
604
|
-
const statuses = pluginStatus({ pluginsDir: resolveScopeDir(values), scope: scopeOf(values), targets });
|
|
605
|
-
for (const line of renderStatus(statuses))
|
|
606
|
-
console.log(line);
|
|
607
|
-
return;
|
|
608
|
-
}
|
|
609
|
-
case "migrate": {
|
|
610
|
-
const { values } = parseVerb(verb, cmd.flags, rest);
|
|
611
|
-
const res = migrateLayout(resolveScopeDir(values));
|
|
612
|
-
for (const m of res.moved)
|
|
613
|
-
console.log(`${ui.ok("moved")} ${ui.name(m.name)}: ${ui.meta(`${m.from} -> ${m.to}`)}`);
|
|
614
|
-
for (const m of res.missing)
|
|
615
|
-
console.error(ui.warn(` ! missing directory for locked plugin: ${m}`));
|
|
616
|
-
if (res.moved.length === 0)
|
|
617
|
-
console.log(ui.meta(`nothing to migrate (${res.unchanged.length} already in place)`));
|
|
618
|
-
return;
|
|
619
|
-
}
|
|
620
|
-
case "marketplace":
|
|
621
|
-
return runMarketplace(rest);
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
const MARKETPLACE_USAGE = `adg plugins marketplace — view installed plugins by source, and re-sync
|
|
625
|
-
|
|
626
|
-
A marketplace is just your installed plugins grouped by where they came from
|
|
627
|
-
(no separate registry). You add sources with \`adg plugins add\`; these commands
|
|
628
|
-
look back over what you installed.
|
|
629
|
-
|
|
630
|
-
Commands:
|
|
631
|
-
adg plugins marketplace list [--verbose] [--global | --project | --dir <dir>]
|
|
632
|
-
Group installed plugins by source. --verbose expands each plugin to its
|
|
633
|
-
components (skills, agents, commands, …).
|
|
634
|
-
adg plugins marketplace remove <source> [--force] [--global | --project | --dir <dir>]
|
|
635
|
-
Uninstall every plugin that came from <source>.
|
|
636
|
-
adg plugins marketplace sync <source> --target <agent> [--global | --project | --dir <dir>]
|
|
637
|
-
Reconcile one agent's copy of every plugin from <source> with the store
|
|
638
|
-
(the source-scoped twin of \`adg plugins sync\`).
|
|
639
|
-
adg plugins marketplace upgrade … (deprecated → use \`adg plugins update\`)
|
|
640
|
-
Kept as an alias. To pull upstream changes, prefer \`adg plugins update\`.
|
|
641
|
-
|
|
642
|
-
<source> is a key from \`marketplace list\` (e.g. owner/repo).`;
|
|
643
|
-
async function runMarketplace(args) {
|
|
644
|
-
const [sub, ...rest] = args;
|
|
645
|
-
// `marketplace <sub> -h` → the marketplace help (it documents every sub + flags).
|
|
646
|
-
if (sub !== undefined && wantsHelp(rest)) {
|
|
647
|
-
console.log(MARKETPLACE_USAGE);
|
|
648
|
-
return;
|
|
649
|
-
}
|
|
650
|
-
switch (sub) {
|
|
651
|
-
case undefined:
|
|
652
|
-
case "-h":
|
|
653
|
-
case "--help":
|
|
654
|
-
case "help":
|
|
655
|
-
console.log(MARKETPLACE_USAGE);
|
|
656
|
-
return;
|
|
657
|
-
case "list": {
|
|
658
|
-
const { values } = parseVerb("marketplace", ["verbose", ...SCOPE], rest);
|
|
659
|
-
const dir = resolveScopeDir(values);
|
|
660
|
-
const groups = marketplaceList({ pluginsDir: dir });
|
|
661
|
-
// Verbose: drill each plugin down to its components (reuses `plugins list -v`).
|
|
662
|
-
const byName = values.verbose ? new Map(listPlugins(dir).map((p) => [p.name, p])) : undefined;
|
|
663
|
-
for (const line of renderMarketplaceList(groups, byName))
|
|
664
|
-
console.log(line);
|
|
665
|
-
return;
|
|
666
|
-
}
|
|
667
|
-
case "upgrade": {
|
|
668
|
-
console.error(ui.warn("note: `marketplace upgrade` is a deprecated alias for `adg plugins update`."));
|
|
669
|
-
const { values, positionals } = parseVerb("marketplace", ["all", "target", ...SCOPE], rest);
|
|
670
|
-
const results = await marketplaceUpgrade({
|
|
671
|
-
pluginsDir: resolveScopeDir(values),
|
|
672
|
-
scope: scopeInfo(values),
|
|
673
|
-
activate: true,
|
|
674
|
-
agentScope: scopeOf(values),
|
|
675
|
-
source: positionals[0],
|
|
676
|
-
all: values.all,
|
|
677
|
-
targets: resolveTargets(values.target),
|
|
678
|
-
});
|
|
679
|
-
for (const r of results) {
|
|
680
|
-
const conv = r.converted.length ? ` (${r.converted.length} converted from native)` : "";
|
|
681
|
-
console.log(`${ui.ok("upgraded")} ${ui.name(r.source)}: ${r.updated.length} plugin(s)${ui.meta(conv)}`);
|
|
682
|
-
for (const p of r.updated)
|
|
683
|
-
console.log(` ${ui.name(p.name)} ${ui.meta(`-> ${p.installedTo}`)}`);
|
|
684
|
-
if (r.available.length > 0) {
|
|
685
|
-
console.log(ui.meta(` ${r.available.length} more available (use --all): ${r.available.join(", ")}`));
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
return;
|
|
689
|
-
}
|
|
690
|
-
case "remove":
|
|
691
|
-
case "rm": {
|
|
692
|
-
const { values, positionals } = parseVerb("marketplace", ["force", ...SCOPE], rest);
|
|
693
|
-
const source = positionals[0];
|
|
694
|
-
if (!source)
|
|
695
|
-
fail("marketplace remove requires a <source>");
|
|
696
|
-
const res = marketplaceRemove({
|
|
697
|
-
pluginsDir: resolveScopeDir(values),
|
|
698
|
-
scope: scopeInfo(values),
|
|
699
|
-
agentScope: scopeOf(values),
|
|
700
|
-
source,
|
|
701
|
-
force: values.force,
|
|
702
|
-
deactivate: true,
|
|
703
|
-
});
|
|
704
|
-
console.log(`${ui.ok("removed")} ${res.removed.length} plugin(s) from ${ui.name(res.source)}: ${res.removed.join(", ")}`);
|
|
705
|
-
return;
|
|
706
|
-
}
|
|
707
|
-
case "sync": {
|
|
708
|
-
const { values, positionals } = parseVerb("marketplace", ["target", ...SCOPE], rest);
|
|
709
|
-
const source = positionals[0];
|
|
710
|
-
if (!source)
|
|
711
|
-
fail("marketplace sync requires a <source>");
|
|
712
|
-
const target = requireSingleTarget(values.target, "marketplace sync");
|
|
713
|
-
const res = marketplaceSync({
|
|
714
|
-
pluginsDir: resolveScopeDir(values),
|
|
715
|
-
scope: scopeInfo(values),
|
|
716
|
-
source,
|
|
717
|
-
target,
|
|
718
|
-
global: Boolean(values.global),
|
|
719
|
-
});
|
|
720
|
-
for (const a of res.actions) {
|
|
721
|
-
console.log(`${ui.ok("synced")} ${ui.name(a.name)} ${ui.meta(`[${res.target}]`)}${a.synced ? ui.meta(` -> ${res.target}`) : ""}`);
|
|
722
|
-
}
|
|
723
|
-
if (res.cliSkipped) {
|
|
724
|
-
console.log(ui.warn(`note: \`${target}\` CLI not found — manifests were regenerated, but nothing was re-synced in ${target}.`));
|
|
725
|
-
}
|
|
726
|
-
return;
|
|
727
|
-
}
|
|
728
|
-
default: {
|
|
729
|
-
console.error(`${ui.err("error:")} unknown marketplace subcommand: ${sub}\n`);
|
|
730
|
-
console.error(MARKETPLACE_USAGE);
|
|
731
|
-
process.exit(1);
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
19
|
/**
|
|
736
20
|
* Delegate to the vendored `skills` CLI (vendor/skills, a fork of
|
|
737
21
|
* vercel-labs/skills — see vendor/skills/PROVENANCE.md). We run its source
|