@agentplugins/cli 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli.d.ts +14 -5
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +135 -9
- package/dist/cli.js.map +1 -1
- package/dist/commands/add.d.ts +11 -0
- package/dist/commands/add.d.ts.map +1 -0
- package/dist/commands/add.js +123 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/build.d.ts +26 -0
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +81 -45
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/doctor.d.ts +10 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +62 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/info.d.ts +11 -0
- package/dist/commands/info.d.ts.map +1 -0
- package/dist/commands/info.js +84 -0
- package/dist/commands/info.js.map +1 -0
- package/dist/commands/init.d.ts +6 -3
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +277 -72
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/lint.d.ts +13 -0
- package/dist/commands/lint.d.ts.map +1 -0
- package/dist/commands/lint.js +56 -0
- package/dist/commands/lint.js.map +1 -0
- package/dist/commands/list.d.ts +10 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +47 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/preview.d.ts +14 -0
- package/dist/commands/preview.d.ts.map +1 -0
- package/dist/commands/preview.js +110 -0
- package/dist/commands/preview.js.map +1 -0
- package/dist/commands/remove.d.ts +11 -0
- package/dist/commands/remove.d.ts.map +1 -0
- package/dist/commands/remove.js +31 -0
- package/dist/commands/remove.js.map +1 -0
- package/dist/commands/update.d.ts +11 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +58 -0
- package/dist/commands/update.js.map +1 -0
- package/package.json +18 -17
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @agentplugins/cli
|
|
2
2
|
|
|
3
|
-
> Build, validate, and scaffold [AgentPlugins](https://github.com/
|
|
3
|
+
> Build, validate, and scaffold [AgentPlugins](https://github.com/sigilco/agentplugins) plugins.
|
|
4
4
|
|
|
5
5
|
`@agentplugins/cli` is the `agentplugins` command-line tool. It compiles a universal `PluginManifest` into platform-native outputs for all 7 supported agent harnesses.
|
|
6
6
|
|
package/dist/cli.d.ts
CHANGED
|
@@ -4,11 +4,20 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Build AI agent plugins once, ship to any harness.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
7
|
+
* Distribution commands:
|
|
8
|
+
* agentplugins add <github-url> # Install a plugin to the store + all agents
|
|
9
|
+
* agentplugins remove <name> # Remove a plugin
|
|
10
|
+
* agentplugins list # List installed plugins
|
|
11
|
+
* agentplugins update [name] # Update plugin(s) from source
|
|
12
|
+
* agentplugins info <name> # Show plugin details
|
|
13
|
+
* agentplugins doctor # Run diagnostics
|
|
14
|
+
*
|
|
15
|
+
* Codegen commands:
|
|
16
|
+
* agentplugins build # Build plugin for target platforms
|
|
17
|
+
* agentplugins validate # Validate plugin without building
|
|
18
|
+
* agentplugins init # Scaffold a new plugin (interactive)
|
|
19
|
+
* agentplugins lint # Static analysis of plugin manifest
|
|
20
|
+
* agentplugins preview # Preview compile output without writing
|
|
12
21
|
*/
|
|
13
22
|
export {};
|
|
14
23
|
//# sourceMappingURL=cli.d.ts.map
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;GAmBG"}
|
package/dist/cli.js
CHANGED
|
@@ -4,19 +4,109 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Build AI agent plugins once, ship to any harness.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
7
|
+
* Distribution commands:
|
|
8
|
+
* agentplugins add <github-url> # Install a plugin to the store + all agents
|
|
9
|
+
* agentplugins remove <name> # Remove a plugin
|
|
10
|
+
* agentplugins list # List installed plugins
|
|
11
|
+
* agentplugins update [name] # Update plugin(s) from source
|
|
12
|
+
* agentplugins info <name> # Show plugin details
|
|
13
|
+
* agentplugins doctor # Run diagnostics
|
|
14
|
+
*
|
|
15
|
+
* Codegen commands:
|
|
16
|
+
* agentplugins build # Build plugin for target platforms
|
|
17
|
+
* agentplugins validate # Validate plugin without building
|
|
18
|
+
* agentplugins init # Scaffold a new plugin (interactive)
|
|
19
|
+
* agentplugins lint # Static analysis of plugin manifest
|
|
20
|
+
* agentplugins preview # Preview compile output without writing
|
|
12
21
|
*/
|
|
13
22
|
import { cac } from 'cac';
|
|
14
23
|
import chalk from 'chalk';
|
|
15
24
|
import { build } from './commands/build.js';
|
|
16
25
|
import { validate } from './commands/validate.js';
|
|
17
26
|
import { init } from './commands/init.js';
|
|
27
|
+
import { lint } from './commands/lint.js';
|
|
28
|
+
import { preview } from './commands/preview.js';
|
|
29
|
+
import { add } from './commands/add.js';
|
|
30
|
+
import { remove } from './commands/remove.js';
|
|
31
|
+
import { list } from './commands/list.js';
|
|
32
|
+
import { update } from './commands/update.js';
|
|
33
|
+
import { info } from './commands/info.js';
|
|
34
|
+
import { doctor } from './commands/doctor.js';
|
|
18
35
|
import { loadConfig } from './config.js';
|
|
19
36
|
const cli = cac('agentplugins');
|
|
37
|
+
// ─── Distribution Commands ───────────────────────────────────────────────────
|
|
38
|
+
cli
|
|
39
|
+
.command('add <source>', 'Install a plugin from GitHub to the store + all agents')
|
|
40
|
+
.action(async (source) => {
|
|
41
|
+
try {
|
|
42
|
+
await add({ source });
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
console.error(chalk.red('Add failed:'), err instanceof Error ? err.message : String(err));
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
cli
|
|
50
|
+
.command('remove <name>', 'Remove a plugin from the store and unlink all symlinks')
|
|
51
|
+
.option('-f, --force', 'Skip confirmation', { default: false })
|
|
52
|
+
.action(async (name, options) => {
|
|
53
|
+
try {
|
|
54
|
+
await remove({ name, force: options.force });
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
console.error(chalk.red('Remove failed:'), err instanceof Error ? err.message : String(err));
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
cli
|
|
62
|
+
.command('list', 'List installed plugins')
|
|
63
|
+
.option('--json', 'Output as JSON')
|
|
64
|
+
.action(async (options) => {
|
|
65
|
+
try {
|
|
66
|
+
await list({ json: options.json });
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
console.error(chalk.red('List failed:'), err instanceof Error ? err.message : String(err));
|
|
70
|
+
process.exit(1);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
cli
|
|
74
|
+
.command('update [name]', 'Update plugin(s) from source')
|
|
75
|
+
.option('-a, --all', 'Update all installed plugins')
|
|
76
|
+
.action(async (name, options) => {
|
|
77
|
+
try {
|
|
78
|
+
await update({ name, all: options.all });
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
console.error(chalk.red('Update failed:'), err instanceof Error ? err.message : String(err));
|
|
82
|
+
process.exit(1);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
cli
|
|
86
|
+
.command('info <name>', 'Show detailed information about an installed plugin')
|
|
87
|
+
.option('--json', 'Output as JSON')
|
|
88
|
+
.action(async (name, options) => {
|
|
89
|
+
try {
|
|
90
|
+
await info({ name, json: options.json });
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
console.error(chalk.red('Info failed:'), err instanceof Error ? err.message : String(err));
|
|
94
|
+
process.exit(1);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
cli
|
|
98
|
+
.command('doctor', 'Run diagnostics on store, agents, and symlinks')
|
|
99
|
+
.option('--json', 'Output as JSON')
|
|
100
|
+
.action(async (options) => {
|
|
101
|
+
try {
|
|
102
|
+
await doctor({ json: options.json });
|
|
103
|
+
}
|
|
104
|
+
catch (err) {
|
|
105
|
+
console.error(chalk.red('Doctor failed:'), err instanceof Error ? err.message : String(err));
|
|
106
|
+
process.exit(1);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
// ─── Codegen Commands ────────────────────────────────────────────────────────
|
|
20
110
|
cli
|
|
21
111
|
.command('build', 'Build plugin for target platforms')
|
|
22
112
|
.option('-t, --target <targets>', 'Comma-separated target platforms (claude,codex,copilot,gemini,kimi,opencode,pimono)')
|
|
@@ -60,12 +150,16 @@ cli
|
|
|
60
150
|
});
|
|
61
151
|
cli
|
|
62
152
|
.command('init [name]', 'Scaffold a new AgentPlugins plugin')
|
|
63
|
-
.option('--
|
|
153
|
+
.option('-y, --yes', 'Skip prompts and use defaults')
|
|
154
|
+
.option('-t, --template <name>', 'Template: minimal | logger | security-guard | formatter')
|
|
155
|
+
.option('--target <targets>', 'Target platforms (comma-separated)')
|
|
64
156
|
.action(async (name, options) => {
|
|
65
157
|
try {
|
|
66
158
|
await init({
|
|
67
|
-
name
|
|
68
|
-
|
|
159
|
+
name,
|
|
160
|
+
yes: options.yes || false,
|
|
161
|
+
template: options.template,
|
|
162
|
+
target: options.target,
|
|
69
163
|
});
|
|
70
164
|
}
|
|
71
165
|
catch (err) {
|
|
@@ -73,7 +167,39 @@ cli
|
|
|
73
167
|
process.exit(1);
|
|
74
168
|
}
|
|
75
169
|
});
|
|
170
|
+
cli
|
|
171
|
+
.command('lint', 'Static analysis of plugin manifest')
|
|
172
|
+
.option('--config <file>', 'Config file path', { default: 'agentplugins.config.ts' })
|
|
173
|
+
.option('--json', 'Output as JSON')
|
|
174
|
+
.action(async (options) => {
|
|
175
|
+
try {
|
|
176
|
+
const config = await loadConfig(options.config);
|
|
177
|
+
await lint({ config, json: options.json || false });
|
|
178
|
+
}
|
|
179
|
+
catch (err) {
|
|
180
|
+
console.error(chalk.red('Lint failed:'), err instanceof Error ? err.message : String(err));
|
|
181
|
+
process.exit(1);
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
cli
|
|
185
|
+
.command('preview', 'Preview compile output without writing to disk')
|
|
186
|
+
.option('--config <file>', 'Config file path', { default: 'agentplugins.config.ts' })
|
|
187
|
+
.option('-t, --target <targets>', 'Comma-separated target platforms')
|
|
188
|
+
.option('--diff', 'Show diff against existing dist/ output')
|
|
189
|
+
.action(async (options) => {
|
|
190
|
+
try {
|
|
191
|
+
const config = await loadConfig(options.config);
|
|
192
|
+
const targets = options.target
|
|
193
|
+
? options.target.split(',').map((t) => t.trim())
|
|
194
|
+
: undefined;
|
|
195
|
+
await preview({ config, targets, diff: options.diff || false });
|
|
196
|
+
}
|
|
197
|
+
catch (err) {
|
|
198
|
+
console.error(chalk.red('Preview failed:'), err instanceof Error ? err.message : String(err));
|
|
199
|
+
process.exit(1);
|
|
200
|
+
}
|
|
201
|
+
});
|
|
76
202
|
cli.help();
|
|
77
|
-
cli.version('0.
|
|
203
|
+
cli.version('0.2.0');
|
|
78
204
|
cli.parse();
|
|
79
205
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EA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,CAAC;QAC9F,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,GAAG,CAAC,IAAI,EAAE,CAAC;AACX,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAErB,GAAG,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentPlugins Add Command
|
|
3
|
+
*
|
|
4
|
+
* Clones a plugin from GitHub, installs it to the universal store,
|
|
5
|
+
* and symlinks it into every detected agent harness.
|
|
6
|
+
*/
|
|
7
|
+
export interface AddOptions {
|
|
8
|
+
source: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function add(options: AddOptions): Promise<void>;
|
|
11
|
+
//# sourceMappingURL=add.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAkBH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,GAAG,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CA+E5D"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentPlugins Add Command
|
|
3
|
+
*
|
|
4
|
+
* Clones a plugin from GitHub, installs it to the universal store,
|
|
5
|
+
* and symlinks it into every detected agent harness.
|
|
6
|
+
*/
|
|
7
|
+
import chalk from 'chalk';
|
|
8
|
+
import { initStore, normalizeSource, extractRepoName, cloneRepo, findManifestInDir, installPlugin, getDetectedAgents, getStorePath, getSkillsCompatPath, getPluginStorePath, } from '@agentplugins/core';
|
|
9
|
+
import { join } from 'node:path';
|
|
10
|
+
import { existsSync, rmSync, mkdirSync, symlinkSync, unlinkSync } from 'node:fs';
|
|
11
|
+
export async function add(options) {
|
|
12
|
+
const source = normalizeSource(options.source);
|
|
13
|
+
const repoName = extractRepoName(source);
|
|
14
|
+
console.log(chalk.bold('\n📥 AgentPlugins Add\n'));
|
|
15
|
+
console.log(chalk.gray(`Source: ${source}`));
|
|
16
|
+
console.log(chalk.gray(`Store: ${getStorePath()}\n`));
|
|
17
|
+
initStore();
|
|
18
|
+
// Clone to temp dir
|
|
19
|
+
const tempDir = join(getStorePath(), `.tmp-${repoName}-${Date.now()}`);
|
|
20
|
+
if (existsSync(tempDir))
|
|
21
|
+
rmSync(tempDir, { recursive: true, force: true });
|
|
22
|
+
console.log(chalk.blue('Cloning repository...'));
|
|
23
|
+
let commit;
|
|
24
|
+
try {
|
|
25
|
+
commit = cloneRepo(source, tempDir);
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
29
|
+
console.error(chalk.red(`\nFailed to clone: ${msg}`));
|
|
30
|
+
rmSync(tempDir, { recursive: true, force: true });
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
console.log(chalk.gray(`Commit: ${commit}`));
|
|
34
|
+
// Find manifest — try JSON/SKILL.md first
|
|
35
|
+
let manifestResult = findManifestInDir(tempDir);
|
|
36
|
+
// Fallback: try TypeScript config via jiti
|
|
37
|
+
if (!manifestResult) {
|
|
38
|
+
manifestResult = await tryTsConfig(tempDir);
|
|
39
|
+
}
|
|
40
|
+
if (!manifestResult) {
|
|
41
|
+
console.error(chalk.red('\nNo plugin manifest found in repository.'));
|
|
42
|
+
console.error(chalk.gray('Expected one of: agentplugins.config.ts, agentplugins.config.json, manifest.json, package.json, SKILL.md'));
|
|
43
|
+
rmSync(tempDir, { recursive: true, force: true });
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
const name = manifestResult.manifest['name'];
|
|
47
|
+
const version = manifestResult.manifest['version'] || '0.0.0';
|
|
48
|
+
console.log(chalk.cyan(`\nPlugin: ${name} v${version}`));
|
|
49
|
+
console.log(chalk.gray(`Manifest: ${manifestResult.path} (${manifestResult.type})`));
|
|
50
|
+
// Detect agents
|
|
51
|
+
const agents = getDetectedAgents();
|
|
52
|
+
if (agents.length === 0) {
|
|
53
|
+
console.log(chalk.yellow('\n⚠ No agent harnesses detected. Plugin will be stored but not symlinked.'));
|
|
54
|
+
console.log(chalk.gray('Install Claude, Codex, or another supported agent to enable symlinking.'));
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
console.log(chalk.gray(`Detected ${agents.length} agent${agents.length > 1 ? 's' : ''}: ${agents.map((a) => a.displayName).join(', ')}`));
|
|
58
|
+
}
|
|
59
|
+
// Install
|
|
60
|
+
const result = installPlugin(tempDir, {
|
|
61
|
+
source,
|
|
62
|
+
name,
|
|
63
|
+
commit,
|
|
64
|
+
manifestPath: manifestResult.path,
|
|
65
|
+
version,
|
|
66
|
+
});
|
|
67
|
+
// Also symlink to skills-compat for Skills.sh
|
|
68
|
+
symlinkToSkillsCompat(name);
|
|
69
|
+
// Summary
|
|
70
|
+
console.log(chalk.green(`\n✅ Installed ${name} v${version}`));
|
|
71
|
+
console.log(chalk.gray(` Store: ${getStorePath()}/${name}`));
|
|
72
|
+
if (result.symlinks.length > 0) {
|
|
73
|
+
console.log(chalk.gray('\nSymlinked to:'));
|
|
74
|
+
for (const s of result.symlinks) {
|
|
75
|
+
console.log(chalk.gray(` ${s.agentDisplayName}: ${s.linkPath}`));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
console.log();
|
|
79
|
+
}
|
|
80
|
+
/** Try loading a TypeScript config via jiti */
|
|
81
|
+
async function tryTsConfig(dir) {
|
|
82
|
+
const candidates = ['agentplugins.config.ts', 'agentplugins.config.js', 'agentplugins.config.mjs'];
|
|
83
|
+
for (const candidate of candidates) {
|
|
84
|
+
const fullPath = join(dir, candidate);
|
|
85
|
+
if (!existsSync(fullPath))
|
|
86
|
+
continue;
|
|
87
|
+
try {
|
|
88
|
+
const jiti = (await import('jiti')).default;
|
|
89
|
+
const loader = jiti(fullPath, { interopDefault: true, esmResolve: true });
|
|
90
|
+
const mod = await loader.import(fullPath, { default: true });
|
|
91
|
+
const exported = mod?.['default'] ?? mod;
|
|
92
|
+
const manifest = typeof exported === 'function'
|
|
93
|
+
? await exported()
|
|
94
|
+
: exported;
|
|
95
|
+
if (manifest && typeof manifest['name'] === 'string') {
|
|
96
|
+
return { path: candidate, manifest, type: 'json' };
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
/** Symlink plugin to ~/.agents/skills/ for Skills.sh compatibility */
|
|
106
|
+
function symlinkToSkillsCompat(name) {
|
|
107
|
+
const skillsPath = join(getSkillsCompatPath(), name);
|
|
108
|
+
const targetPath = getPluginStorePath(name);
|
|
109
|
+
try {
|
|
110
|
+
mkdirSync(getSkillsCompatPath(), { recursive: true });
|
|
111
|
+
if (existsSync(skillsPath)) {
|
|
112
|
+
try {
|
|
113
|
+
unlinkSync(skillsPath);
|
|
114
|
+
}
|
|
115
|
+
catch { /* ignore */ }
|
|
116
|
+
}
|
|
117
|
+
symlinkSync(targetPath, skillsPath, 'dir');
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
// Non-fatal — skills compat is best-effort
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=add.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,SAAS,EACT,eAAe,EACf,eAAe,EACf,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,IA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YACrD,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,SAAS;QACX,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,sEAAsE;AACtE,SAAS,qBAAqB,CAAC,IAAY;IACzC,MAAM,UAAU,GAAG,IAAI,CAAC,mBAAmB,EAAE,EAAE,IAAI,CAAC,CAAC;IACrD,MAAM,UAAU,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC5C,IAAI,CAAC;QACH,SAAS,CAAC,mBAAmB,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAC3B,IAAI,CAAC;gBAAC,UAAU,CAAC,UAAU,CAAC,CAAC;YAAC,CAAC;YAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC;QACxD,CAAC;QACD,WAAW,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;IAC7C,CAAC;IAAC,MAAM,CAAC;QACP,2CAA2C;IAC7C,CAAC;AACH,CAAC"}
|
package/dist/commands/build.d.ts
CHANGED
|
@@ -3,7 +3,33 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Compiles a universal plugin into platform-specific packages.
|
|
5
5
|
*/
|
|
6
|
+
import { type TargetPlatform, type PluginManifest } from '@agentplugins/core';
|
|
6
7
|
import type { LoadedConfig } from '../config.js';
|
|
8
|
+
export interface CompileFile {
|
|
9
|
+
path: string;
|
|
10
|
+
content: string;
|
|
11
|
+
}
|
|
12
|
+
export interface CompileResult {
|
|
13
|
+
target: TargetPlatform;
|
|
14
|
+
files: CompileFile[];
|
|
15
|
+
warnings: string[];
|
|
16
|
+
postInstall?: string[];
|
|
17
|
+
skipped: boolean;
|
|
18
|
+
error?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface CompileOptions {
|
|
21
|
+
manifest: PluginManifest;
|
|
22
|
+
targets?: TargetPlatform[];
|
|
23
|
+
write?: boolean;
|
|
24
|
+
outDir?: string;
|
|
25
|
+
silent?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Run the compilation pipeline for one or more targets.
|
|
29
|
+
* If `write` is true, files are written to `outDir/<target>/`.
|
|
30
|
+
* Returns per-target results.
|
|
31
|
+
*/
|
|
32
|
+
export declare function compile(options: CompileOptions): Promise<CompileResult[]>;
|
|
7
33
|
export interface BuildOptions {
|
|
8
34
|
config: LoadedConfig;
|
|
9
35
|
targets?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAIjD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,cAAc,CAAC;IACvB,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAgCD;;;;GAIG;AACH,wBAAsB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAgE/E;AAID,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,wBAAsB,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA4ChE"}
|
package/dist/commands/build.js
CHANGED
|
@@ -34,76 +34,112 @@ async function getAdapterFactory(target) {
|
|
|
34
34
|
throw new Error(`Unknown target: ${target}`);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Run the compilation pipeline for one or more targets.
|
|
39
|
+
* If `write` is true, files are written to `outDir/<target>/`.
|
|
40
|
+
* Returns per-target results.
|
|
41
|
+
*/
|
|
42
|
+
export async function compile(options) {
|
|
43
|
+
const { manifest, write = false, outDir, silent = false } = options;
|
|
41
44
|
const targetList = (options.targets || manifest.targets || ALL_TARGETS);
|
|
42
|
-
|
|
43
|
-
console.log(chalk.gray(`Plugin: ${manifest.name} v${manifest.version}`));
|
|
44
|
-
console.log(chalk.gray(`Targets: ${targetList.join(', ')}`));
|
|
45
|
-
console.log(chalk.gray(`Output: ${resolve(outDir)}\n`));
|
|
46
|
-
// ─── Universal Validation ─────────────────────────────────────────────────
|
|
47
|
-
console.log(chalk.blue('🔍 Running universal validation...'));
|
|
48
|
-
const universalIssues = validateUniversal(manifest);
|
|
49
|
-
printIssues(universalIssues);
|
|
50
|
-
const hasErrors = universalIssues.some(i => i.severity === 'error');
|
|
51
|
-
if (hasErrors) {
|
|
52
|
-
throw new Error('Universal validation failed. Fix errors before building.');
|
|
53
|
-
}
|
|
54
|
-
// ─── Platform-Specific Compilation ────────────────────────────────────────
|
|
55
|
-
const outRoot = resolve(outDir);
|
|
45
|
+
const results = [];
|
|
56
46
|
for (const target of targetList) {
|
|
57
47
|
let factory;
|
|
58
48
|
try {
|
|
59
49
|
factory = await getAdapterFactory(target);
|
|
60
50
|
}
|
|
61
|
-
catch
|
|
62
|
-
|
|
51
|
+
catch {
|
|
52
|
+
results.push({ target, files: [], warnings: [], skipped: true });
|
|
63
53
|
continue;
|
|
64
54
|
}
|
|
65
|
-
|
|
66
|
-
|
|
55
|
+
if (!silent)
|
|
56
|
+
console.log(chalk.blue(`\n📦 Building for ${target}...`));
|
|
67
57
|
const platformIssues = validateForPlatform(manifest, target);
|
|
68
|
-
printIssues(platformIssues);
|
|
69
58
|
const platformErrors = platformIssues.filter(i => i.severity === 'error');
|
|
70
59
|
if (platformErrors.length > 0) {
|
|
71
|
-
|
|
60
|
+
const msg = `${platformErrors.length} validation error${platformErrors.length > 1 ? 's' : ''}`;
|
|
61
|
+
if (!silent)
|
|
62
|
+
console.log(chalk.red(` ✗ Build failed for ${target} (${msg})`));
|
|
63
|
+
results.push({ target, files: [], warnings: [], skipped: true, error: msg });
|
|
72
64
|
continue;
|
|
73
65
|
}
|
|
74
|
-
// Compile
|
|
75
66
|
try {
|
|
76
67
|
const adapter = factory();
|
|
77
68
|
const output = adapter.compile(manifest);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
// Print results
|
|
87
|
-
console.log(chalk.green(` ✓ Built ${output.files.length} file${output.files.length > 1 ? 's' : ''}`));
|
|
88
|
-
if (output.warnings.length > 0) {
|
|
89
|
-
for (const w of output.warnings) {
|
|
90
|
-
console.log(chalk.yellow(` ⚠ ${w}`));
|
|
69
|
+
if (write && outDir) {
|
|
70
|
+
const targetDir = join(resolve(outDir), target);
|
|
71
|
+
await mkdir(targetDir, { recursive: true });
|
|
72
|
+
for (const file of output.files) {
|
|
73
|
+
const filePath = join(targetDir, file.path);
|
|
74
|
+
await mkdir(resolve(filePath, '..'), { recursive: true });
|
|
75
|
+
await writeFile(filePath, file.content, 'utf-8');
|
|
91
76
|
}
|
|
92
77
|
}
|
|
93
|
-
if (
|
|
94
|
-
console.log(chalk.
|
|
78
|
+
if (!silent) {
|
|
79
|
+
console.log(chalk.green(` ✓ Built ${output.files.length} file${output.files.length > 1 ? 's' : ''}`));
|
|
80
|
+
if (output.warnings.length > 0) {
|
|
81
|
+
for (const w of output.warnings)
|
|
82
|
+
console.log(chalk.yellow(` ⚠ ${w}`));
|
|
83
|
+
}
|
|
84
|
+
if (output.postInstall) {
|
|
85
|
+
console.log(chalk.cyan(` ⓘ ${output.postInstall.join('\n ⓘ ')}`));
|
|
86
|
+
}
|
|
95
87
|
}
|
|
88
|
+
results.push({
|
|
89
|
+
target,
|
|
90
|
+
files: output.files,
|
|
91
|
+
warnings: output.warnings || [],
|
|
92
|
+
postInstall: output.postInstall,
|
|
93
|
+
skipped: false,
|
|
94
|
+
});
|
|
96
95
|
}
|
|
97
96
|
catch (err) {
|
|
98
|
-
|
|
97
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
98
|
+
if (!silent)
|
|
99
|
+
console.log(chalk.red(` ✗ Build failed for ${target}: ${msg}`));
|
|
100
|
+
results.push({ target, files: [], warnings: [], skipped: true, error: msg });
|
|
99
101
|
}
|
|
100
102
|
}
|
|
101
|
-
|
|
103
|
+
return results;
|
|
104
|
+
}
|
|
105
|
+
export async function build(options) {
|
|
106
|
+
const { config, outDir } = options;
|
|
107
|
+
const manifest = config.manifest;
|
|
108
|
+
const targetList = (options.targets || manifest.targets || ALL_TARGETS);
|
|
109
|
+
console.log(chalk.bold('\n🌉 AgentPlugins Build\n'));
|
|
110
|
+
console.log(chalk.gray(`Plugin: ${manifest.name} v${manifest.version}`));
|
|
111
|
+
console.log(chalk.gray(`Targets: ${targetList.join(', ')}`));
|
|
112
|
+
console.log(chalk.gray(`Output: ${resolve(outDir)}\n`));
|
|
113
|
+
// Universal validation
|
|
114
|
+
console.log(chalk.blue('🔍 Running universal validation...'));
|
|
115
|
+
const universalIssues = validateUniversal(manifest);
|
|
116
|
+
printIssues(universalIssues);
|
|
117
|
+
const hasErrors = universalIssues.some(i => i.severity === 'error');
|
|
118
|
+
if (hasErrors) {
|
|
119
|
+
throw new Error('Universal validation failed. Fix errors before building.');
|
|
120
|
+
}
|
|
121
|
+
// Compile + write
|
|
122
|
+
const results = await compile({
|
|
123
|
+
manifest,
|
|
124
|
+
targets: targetList,
|
|
125
|
+
write: true,
|
|
126
|
+
outDir,
|
|
127
|
+
});
|
|
128
|
+
// Strict mode: fail on warnings
|
|
129
|
+
if (options.strict) {
|
|
130
|
+
const allWarnings = results.flatMap(r => r.warnings);
|
|
131
|
+
if (allWarnings.length > 0) {
|
|
132
|
+
throw new Error(`Strict mode: ${allWarnings.length} warning(s) found.`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
// Summary
|
|
102
136
|
console.log(chalk.bold('\n✅ Build complete!\n'));
|
|
103
137
|
console.log(chalk.gray('Install your plugins:'));
|
|
104
|
-
for (const
|
|
105
|
-
|
|
106
|
-
|
|
138
|
+
for (const r of results) {
|
|
139
|
+
if (r.skipped)
|
|
140
|
+
continue;
|
|
141
|
+
const cmd = getInstallCommand(r.target, manifest.name);
|
|
142
|
+
console.log(chalk.gray(` ${r.target}: ${cmd}`));
|
|
107
143
|
}
|
|
108
144
|
console.log();
|
|
109
145
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,WAAW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