@vibe-agent-toolkit/cli 0.1.0-rc.10
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 +125 -0
- package/dist/bin/vat.d.ts +18 -0
- package/dist/bin/vat.d.ts.map +1 -0
- package/dist/bin/vat.js +174 -0
- package/dist/bin/vat.js.map +1 -0
- package/dist/bin.d.ts +7 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +108 -0
- package/dist/bin.js.map +1 -0
- package/dist/commands/agent/audit.d.ts +9 -0
- package/dist/commands/agent/audit.d.ts.map +1 -0
- package/dist/commands/agent/audit.js +139 -0
- package/dist/commands/agent/audit.js.map +1 -0
- package/dist/commands/agent/build.d.ts +13 -0
- package/dist/commands/agent/build.d.ts.map +1 -0
- package/dist/commands/agent/build.js +52 -0
- package/dist/commands/agent/build.js.map +1 -0
- package/dist/commands/agent/help.d.ts +5 -0
- package/dist/commands/agent/help.d.ts.map +1 -0
- package/dist/commands/agent/help.js +10 -0
- package/dist/commands/agent/help.js.map +1 -0
- package/dist/commands/agent/import.d.ts +10 -0
- package/dist/commands/agent/import.d.ts.map +1 -0
- package/dist/commands/agent/import.js +50 -0
- package/dist/commands/agent/import.js.map +1 -0
- package/dist/commands/agent/index.d.ts +7 -0
- package/dist/commands/agent/index.d.ts.map +1 -0
- package/dist/commands/agent/index.js +293 -0
- package/dist/commands/agent/index.js.map +1 -0
- package/dist/commands/agent/install.d.ts +15 -0
- package/dist/commands/agent/install.d.ts.map +1 -0
- package/dist/commands/agent/install.js +107 -0
- package/dist/commands/agent/install.js.map +1 -0
- package/dist/commands/agent/installed.d.ts +13 -0
- package/dist/commands/agent/installed.d.ts.map +1 -0
- package/dist/commands/agent/installed.js +106 -0
- package/dist/commands/agent/installed.js.map +1 -0
- package/dist/commands/agent/list.d.ts +8 -0
- package/dist/commands/agent/list.d.ts.map +1 -0
- package/dist/commands/agent/list.js +41 -0
- package/dist/commands/agent/list.js.map +1 -0
- package/dist/commands/agent/run.d.ts +17 -0
- package/dist/commands/agent/run.d.ts.map +1 -0
- package/dist/commands/agent/run.js +44 -0
- package/dist/commands/agent/run.js.map +1 -0
- package/dist/commands/agent/uninstall.d.ts +13 -0
- package/dist/commands/agent/uninstall.d.ts.map +1 -0
- package/dist/commands/agent/uninstall.js +48 -0
- package/dist/commands/agent/uninstall.js.map +1 -0
- package/dist/commands/agent/validate.d.ts +8 -0
- package/dist/commands/agent/validate.d.ts.map +1 -0
- package/dist/commands/agent/validate.js +51 -0
- package/dist/commands/agent/validate.js.map +1 -0
- package/dist/commands/rag/clear-command.d.ts +10 -0
- package/dist/commands/rag/clear-command.d.ts.map +1 -0
- package/dist/commands/rag/clear-command.js +22 -0
- package/dist/commands/rag/clear-command.js.map +1 -0
- package/dist/commands/rag/command-helpers.d.ts +27 -0
- package/dist/commands/rag/command-helpers.d.ts.map +1 -0
- package/dist/commands/rag/command-helpers.js +58 -0
- package/dist/commands/rag/command-helpers.js.map +1 -0
- package/dist/commands/rag/help.d.ts +5 -0
- package/dist/commands/rag/help.d.ts.map +1 -0
- package/dist/commands/rag/help.js +10 -0
- package/dist/commands/rag/help.js.map +1 -0
- package/dist/commands/rag/index-command.d.ts +10 -0
- package/dist/commands/rag/index-command.d.ts.map +1 -0
- package/dist/commands/rag/index-command.js +49 -0
- package/dist/commands/rag/index-command.js.map +1 -0
- package/dist/commands/rag/index.d.ts +7 -0
- package/dist/commands/rag/index.d.ts.map +1 -0
- package/dist/commands/rag/index.js +168 -0
- package/dist/commands/rag/index.js.map +1 -0
- package/dist/commands/rag/query-command.d.ts +11 -0
- package/dist/commands/rag/query-command.d.ts.map +1 -0
- package/dist/commands/rag/query-command.js +54 -0
- package/dist/commands/rag/query-command.js.map +1 -0
- package/dist/commands/rag/stats-command.d.ts +10 -0
- package/dist/commands/rag/stats-command.d.ts.map +1 -0
- package/dist/commands/rag/stats-command.js +25 -0
- package/dist/commands/rag/stats-command.js.map +1 -0
- package/dist/commands/resources/command-helpers.d.ts +5 -0
- package/dist/commands/resources/command-helpers.d.ts.map +1 -0
- package/dist/commands/resources/command-helpers.js +6 -0
- package/dist/commands/resources/command-helpers.js.map +1 -0
- package/dist/commands/resources/help.d.ts +5 -0
- package/dist/commands/resources/help.d.ts.map +1 -0
- package/dist/commands/resources/help.js +10 -0
- package/dist/commands/resources/help.js.map +1 -0
- package/dist/commands/resources/index.d.ts +7 -0
- package/dist/commands/resources/index.d.ts.map +1 -0
- package/dist/commands/resources/index.js +64 -0
- package/dist/commands/resources/index.js.map +1 -0
- package/dist/commands/resources/scan.d.ts +9 -0
- package/dist/commands/resources/scan.d.ts.map +1 -0
- package/dist/commands/resources/scan.js +47 -0
- package/dist/commands/resources/scan.js.map +1 -0
- package/dist/commands/resources/validate.d.ts +9 -0
- package/dist/commands/resources/validate.d.ts.map +1 -0
- package/dist/commands/resources/validate.js +61 -0
- package/dist/commands/resources/validate.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/config.d.ts +1034 -0
- package/dist/schemas/config.d.ts.map +1 -0
- package/dist/schemas/config.js +135 -0
- package/dist/schemas/config.js.map +1 -0
- package/dist/utils/agent-discovery.d.ts +32 -0
- package/dist/utils/agent-discovery.d.ts.map +1 -0
- package/dist/utils/agent-discovery.js +108 -0
- package/dist/utils/agent-discovery.js.map +1 -0
- package/dist/utils/agent-runner.d.ts +22 -0
- package/dist/utils/agent-runner.d.ts.map +1 -0
- package/dist/utils/agent-runner.js +120 -0
- package/dist/utils/agent-runner.js.map +1 -0
- package/dist/utils/command-error.d.ts +19 -0
- package/dist/utils/command-error.d.ts.map +1 -0
- package/dist/utils/command-error.js +36 -0
- package/dist/utils/command-error.js.map +1 -0
- package/dist/utils/config-loader.d.ts +12 -0
- package/dist/utils/config-loader.d.ts.map +1 -0
- package/dist/utils/config-loader.js +39 -0
- package/dist/utils/config-loader.js.map +1 -0
- package/dist/utils/help-loader.d.ts +12 -0
- package/dist/utils/help-loader.d.ts.map +1 -0
- package/dist/utils/help-loader.js +39 -0
- package/dist/utils/help-loader.js.map +1 -0
- package/dist/utils/logger.d.ts +14 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +21 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/output.d.ts +20 -0
- package/dist/utils/output.d.ts.map +1 -0
- package/dist/utils/output.js +40 -0
- package/dist/utils/output.js.map +1 -0
- package/dist/utils/project-root.d.ts +11 -0
- package/dist/utils/project-root.d.ts.map +1 -0
- package/dist/utils/project-root.js +35 -0
- package/dist/utils/project-root.js.map +1 -0
- package/dist/utils/resource-loader.d.ts +30 -0
- package/dist/utils/resource-loader.d.ts.map +1 -0
- package/dist/utils/resource-loader.js +63 -0
- package/dist/utils/resource-loader.js.map +1 -0
- package/dist/utils/scope-locations.d.ts +17 -0
- package/dist/utils/scope-locations.d.ts.map +1 -0
- package/dist/utils/scope-locations.js +40 -0
- package/dist/utils/scope-locations.js.map +1 -0
- package/dist/utils/validate-help-files.d.ts +14 -0
- package/dist/utils/validate-help-files.d.ts.map +1 -0
- package/dist/utils/validate-help-files.js +61 -0
- package/dist/utils/validate-help-files.js.map +1 -0
- package/dist/version.d.ts +13 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +27 -0
- package/dist/version.js.map +1 -0
- package/docs/agent.md +100 -0
- package/docs/index.md +309 -0
- package/docs/rag.md +449 -0
- package/docs/resources.md +158 -0
- package/package.json +68 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent build command - Package agents for deployment targets
|
|
3
|
+
*/
|
|
4
|
+
import { buildClaudeSkill } from '@vibe-agent-toolkit/runtime-claude-skills';
|
|
5
|
+
import { resolveAgentPath } from '../../utils/agent-discovery.js';
|
|
6
|
+
import { handleCommandError } from '../../utils/command-error.js';
|
|
7
|
+
import { createLogger } from '../../utils/logger.js';
|
|
8
|
+
import { writeYamlOutput } from '../../utils/output.js';
|
|
9
|
+
/**
|
|
10
|
+
* Build an agent for a specific deployment target
|
|
11
|
+
*/
|
|
12
|
+
export async function buildCommand(pathOrName, options) {
|
|
13
|
+
const logger = createLogger(options.debug ? { debug: true } : {});
|
|
14
|
+
const startTime = Date.now();
|
|
15
|
+
try {
|
|
16
|
+
const target = options.target ?? 'skill';
|
|
17
|
+
logger.debug(`Building agent for target: ${target}`);
|
|
18
|
+
// Resolve agent path
|
|
19
|
+
const agentPath = await resolveAgentPath(pathOrName, logger);
|
|
20
|
+
logger.debug(`Agent path resolved: ${agentPath}`);
|
|
21
|
+
// Build based on target
|
|
22
|
+
let result;
|
|
23
|
+
if (target === 'skill') {
|
|
24
|
+
logger.info('Building Claude Skill...');
|
|
25
|
+
// Only pass outputPath if explicitly provided by user
|
|
26
|
+
const buildOptions = options.output
|
|
27
|
+
? { agentPath, target, outputPath: options.output }
|
|
28
|
+
: { agentPath, target };
|
|
29
|
+
result = await buildClaudeSkill(buildOptions);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
throw new Error(`Unsupported build target: ${target}`);
|
|
33
|
+
}
|
|
34
|
+
const duration = Date.now() - startTime;
|
|
35
|
+
// Output success result
|
|
36
|
+
writeYamlOutput({
|
|
37
|
+
status: 'success',
|
|
38
|
+
agent: result.agent.name,
|
|
39
|
+
target,
|
|
40
|
+
output: result.outputPath,
|
|
41
|
+
files: result.files,
|
|
42
|
+
duration: `${duration}ms`,
|
|
43
|
+
});
|
|
44
|
+
logger.info(`Build completed in ${duration}ms`);
|
|
45
|
+
logger.info(`Output: ${result.outputPath}`);
|
|
46
|
+
process.exit(0);
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
handleCommandError(error, logger, startTime, 'AgentBuild');
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.js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G,MAAM,gBAAgB,CAAC,YAAY,CAAC,CAAC;QAChD,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,6BAA6B,MAAM,EAAE,CAAC,CAAC;QACzD,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;QAExC,wBAAwB;QACxB,eAAe,CAAC;YACd,MAAM,EAAE,SAAS;YACjB,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI;YACxB,MAAM;YACN,MAAM,EAAE,MAAM,CAAC,UAAU;YACzB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,QAAQ,EAAE,GAAG,QAAQ,IAAI;SAC1B,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,sBAAsB,QAAQ,IAAI,CAAC,CAAC;QAChD,MAAM,CAAC,IAAI,CAAC,WAAW,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;QAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;IAC7D,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../../src/commands/agent/help.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,wBAAgB,oBAAoB,IAAI,IAAI,CAI3C"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Verbose help for agent commands
|
|
3
|
+
*/
|
|
4
|
+
import { loadVerboseHelp } from '../../utils/help-loader.js';
|
|
5
|
+
export function showAgentVerboseHelp() {
|
|
6
|
+
const helpContent = loadVerboseHelp('agent'); // Loads from docs/agent.md
|
|
7
|
+
process.stdout.write(helpContent);
|
|
8
|
+
process.stdout.write('\n');
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=help.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../../src/commands/agent/help.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,MAAM,UAAU,oBAAoB;IAClC,MAAM,WAAW,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,2BAA2B;IACzE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent import command - convert SKILL.md to agent.yaml
|
|
3
|
+
*/
|
|
4
|
+
export interface ImportCommandOptions {
|
|
5
|
+
debug?: boolean;
|
|
6
|
+
output?: string;
|
|
7
|
+
force?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function importCommand(skillPath: string, options: ImportCommandOptions): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=import.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../../src/commands/agent/import.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,wBAAsB,aAAa,CACjC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,IAAI,CAAC,CA+Cf"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent import command - convert SKILL.md to agent.yaml
|
|
3
|
+
*/
|
|
4
|
+
import * as path from 'node:path';
|
|
5
|
+
import { importSkillToAgent } from '@vibe-agent-toolkit/runtime-claude-skills';
|
|
6
|
+
import { handleCommandError } from '../../utils/command-error.js';
|
|
7
|
+
import { createLogger } from '../../utils/logger.js';
|
|
8
|
+
import { writeYamlOutput } from '../../utils/output.js';
|
|
9
|
+
export async function importCommand(skillPath, options) {
|
|
10
|
+
const logger = createLogger(options.debug ? { debug: true } : {});
|
|
11
|
+
const startTime = Date.now();
|
|
12
|
+
try {
|
|
13
|
+
// Resolve path
|
|
14
|
+
const resolvedSkillPath = path.resolve(skillPath);
|
|
15
|
+
logger.debug(`Importing Claude Skill: ${resolvedSkillPath}`);
|
|
16
|
+
// Import SKILL.md to agent.yaml
|
|
17
|
+
const importOptions = {
|
|
18
|
+
skillPath: resolvedSkillPath,
|
|
19
|
+
force: options.force ?? false,
|
|
20
|
+
};
|
|
21
|
+
if (options.output) {
|
|
22
|
+
importOptions.outputPath = path.resolve(options.output);
|
|
23
|
+
}
|
|
24
|
+
const result = await importSkillToAgent(importOptions);
|
|
25
|
+
if (!result.success) {
|
|
26
|
+
// Import failed
|
|
27
|
+
const output = {
|
|
28
|
+
status: 'error',
|
|
29
|
+
error: result.error,
|
|
30
|
+
duration: `${Date.now() - startTime}ms`,
|
|
31
|
+
};
|
|
32
|
+
writeYamlOutput(output);
|
|
33
|
+
logger.error(`Import failed: ${result.error}`);
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
// Import successful
|
|
37
|
+
const output = {
|
|
38
|
+
status: 'success',
|
|
39
|
+
agentPath: result.agentPath,
|
|
40
|
+
duration: `${Date.now() - startTime}ms`,
|
|
41
|
+
};
|
|
42
|
+
writeYamlOutput(output);
|
|
43
|
+
logger.info(`Successfully imported Claude Skill to: ${result.agentPath}`);
|
|
44
|
+
process.exit(0);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
handleCommandError(error, logger, startTime, 'AgentImport');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=import.js.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gBACf,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,QAAQ,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,IAAI;aACxC,CAAC;YAEF,eAAe,CAAC,MAAM,CAAC,CAAC;YACxB,MAAM,CAAC,KAAK,CAAC,kBAAkB,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;YAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,oBAAoB;QACpB,MAAM,MAAM,GAAG;YACb,MAAM,EAAE,SAAS;YACjB,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,QAAQ,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,IAAI;SACxC,CAAC;QAEF,eAAe,CAAC,MAAM,CAAC,CAAC;QACxB,MAAM,CAAC,IAAI,CAAC,0CAA0C,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QAC1E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/agent/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqBpC,wBAAgB,kBAAkB,IAAI,OAAO,CAsT5C;AAED,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent command group
|
|
3
|
+
*/
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
import { auditCommand } from './audit.js';
|
|
6
|
+
import { buildCommand } from './build.js';
|
|
7
|
+
import { importCommand } from './import.js';
|
|
8
|
+
import { installAgent } from './install.js';
|
|
9
|
+
import { installedCommand } from './installed.js';
|
|
10
|
+
import { listCommand } from './list.js';
|
|
11
|
+
import { runCommand } from './run.js';
|
|
12
|
+
import { uninstallAgent } from './uninstall.js';
|
|
13
|
+
import { validateCommand } from './validate.js';
|
|
14
|
+
const DEBUG_OPTION_DESC = 'Enable debug logging';
|
|
15
|
+
const SCOPE_OPTION = '--scope <scope>';
|
|
16
|
+
const SCOPE_OPTION_DESC = 'Installation scope (user, project)';
|
|
17
|
+
const SCOPE_DEFAULT = 'user';
|
|
18
|
+
const RUNTIME_OPTION = '--runtime <name>';
|
|
19
|
+
const RUNTIME_OPTION_DESC = 'Target runtime';
|
|
20
|
+
const RUNTIME_DEFAULT = 'claude-skill';
|
|
21
|
+
const DEV_MODE_DESC = 'Development mode (symlink instead of copy)';
|
|
22
|
+
export function createAgentCommand() {
|
|
23
|
+
const agent = new Command('agent');
|
|
24
|
+
agent
|
|
25
|
+
.description('Manage and execute AI agents')
|
|
26
|
+
.option('--verbose', 'Show verbose help')
|
|
27
|
+
.helpCommand(false)
|
|
28
|
+
.addHelpText('after', `
|
|
29
|
+
Description:
|
|
30
|
+
Define AI agents using Kubernetes-style YAML manifests with LLM
|
|
31
|
+
configuration, tools, prompts, and resources.
|
|
32
|
+
|
|
33
|
+
Example:
|
|
34
|
+
$ vat agent list # List discovered agents
|
|
35
|
+
$ vat agent validate agent-generator # Validate by name
|
|
36
|
+
$ vat agent build agent-generator # Build as Claude Skill
|
|
37
|
+
$ vat agent run agent-generator "Create a PR review agent" # Execute agent
|
|
38
|
+
|
|
39
|
+
Configuration:
|
|
40
|
+
Create agent.yaml in your agent directory. See --help --verbose for details.
|
|
41
|
+
`);
|
|
42
|
+
agent
|
|
43
|
+
.command('list')
|
|
44
|
+
.description('List all discovered agents')
|
|
45
|
+
.option('--debug', DEBUG_OPTION_DESC)
|
|
46
|
+
.action(listCommand)
|
|
47
|
+
.addHelpText('after', `
|
|
48
|
+
Description:
|
|
49
|
+
Discovers agents in common locations and lists them with their metadata.
|
|
50
|
+
|
|
51
|
+
Search paths:
|
|
52
|
+
- packages/vat-development-agents/agents/
|
|
53
|
+
- agents/
|
|
54
|
+
- . (current directory)
|
|
55
|
+
|
|
56
|
+
Example:
|
|
57
|
+
$ vat agent list # List all agents
|
|
58
|
+
$ vat agent list --debug # Show discovery details
|
|
59
|
+
`);
|
|
60
|
+
agent
|
|
61
|
+
.command('build <pathOrName>')
|
|
62
|
+
.description('Build agent for deployment target')
|
|
63
|
+
.option('--target <type>', 'Build target (skill, langchain, etc.)', 'skill')
|
|
64
|
+
.option('--output <path>', 'Output directory (default: dist/vat-bundles/<target>/<agent>)')
|
|
65
|
+
.option('--debug', DEBUG_OPTION_DESC)
|
|
66
|
+
.action(buildCommand)
|
|
67
|
+
.addHelpText('after', `
|
|
68
|
+
Description:
|
|
69
|
+
Packages an agent for a specific deployment target. Converts agent manifest,
|
|
70
|
+
prompts, and resources into target-specific format.
|
|
71
|
+
|
|
72
|
+
Argument: agent name OR path to agent directory/manifest file
|
|
73
|
+
|
|
74
|
+
Targets:
|
|
75
|
+
- skill: Claude Skills (for Claude Desktop/Code)
|
|
76
|
+
- More targets coming soon (langchain, etc.)
|
|
77
|
+
|
|
78
|
+
Output:
|
|
79
|
+
Default location: dist/vat-bundles/<target>/<agent-name>/
|
|
80
|
+
|
|
81
|
+
Exit Codes:
|
|
82
|
+
0 - Success | 1 - Build error | 2 - System error
|
|
83
|
+
|
|
84
|
+
Examples:
|
|
85
|
+
$ vat agent build agent-generator # Build as Claude Skill
|
|
86
|
+
$ vat agent build agent-generator --target skill # Explicit target
|
|
87
|
+
$ vat agent build ./my-agent --output ./my-skill # Custom output path
|
|
88
|
+
`);
|
|
89
|
+
agent
|
|
90
|
+
.command('run <pathOrName> <userInput>')
|
|
91
|
+
.description('Execute an agent with user input')
|
|
92
|
+
.option('--debug', DEBUG_OPTION_DESC)
|
|
93
|
+
.action(runCommand)
|
|
94
|
+
.addHelpText('after', `
|
|
95
|
+
Description:
|
|
96
|
+
Executes an agent by loading its manifest, prompts, and calling the
|
|
97
|
+
configured LLM provider with the user input. Response is output to stdout.
|
|
98
|
+
|
|
99
|
+
Argument: agent name OR path to agent directory/manifest file
|
|
100
|
+
User input: The input text/query for the agent
|
|
101
|
+
|
|
102
|
+
Exit Codes:
|
|
103
|
+
0 - Success | 1 - Execution error | 2 - System error
|
|
104
|
+
|
|
105
|
+
Examples:
|
|
106
|
+
$ vat agent run agent-generator "Create a code review agent"
|
|
107
|
+
$ vat agent run ./my-agent "analyze this code"
|
|
108
|
+
$ vat agent run my-agent "help me with..." --debug
|
|
109
|
+
|
|
110
|
+
Requirements:
|
|
111
|
+
- ANTHROPIC_API_KEY environment variable (for Anthropic-based agents)
|
|
112
|
+
- Valid agent manifest with prompts configured
|
|
113
|
+
`);
|
|
114
|
+
agent
|
|
115
|
+
.command('validate <pathOrName>')
|
|
116
|
+
.description('Validate agent manifest and prerequisites')
|
|
117
|
+
.option('--debug', DEBUG_OPTION_DESC)
|
|
118
|
+
.action(validateCommand)
|
|
119
|
+
.addHelpText('after', `
|
|
120
|
+
Description:
|
|
121
|
+
Validates agent manifest schema (using @vibe-agent-toolkit/agent-schema),
|
|
122
|
+
LLM configuration, tool definitions, and resource availability. Outputs
|
|
123
|
+
YAML validation report to stdout, errors to stderr.
|
|
124
|
+
|
|
125
|
+
Argument: agent name OR path to agent directory/manifest file
|
|
126
|
+
|
|
127
|
+
Validation Checks:
|
|
128
|
+
- Manifest schema (apiVersion, kind, metadata, spec)
|
|
129
|
+
- LLM provider and model configuration
|
|
130
|
+
- Tool configurations (RAG databases)
|
|
131
|
+
- Resource files (prompts, docs, templates)
|
|
132
|
+
- Prompt references ($ref paths)
|
|
133
|
+
|
|
134
|
+
Exit Codes:
|
|
135
|
+
0 - Valid | 1 - Validation errors | 2 - System error
|
|
136
|
+
|
|
137
|
+
Examples:
|
|
138
|
+
$ vat agent validate agent-generator # Validate by name
|
|
139
|
+
$ vat agent validate ./my-agent # Validate by path
|
|
140
|
+
$ vat agent validate ./agent.yaml # Validate specific file
|
|
141
|
+
`);
|
|
142
|
+
agent
|
|
143
|
+
.command('audit [path]')
|
|
144
|
+
.description('Audit Claude Skills for quality and compatibility')
|
|
145
|
+
.option('-r, --recursive', 'Scan directories recursively for SKILL.md files')
|
|
146
|
+
.option('--debug', DEBUG_OPTION_DESC)
|
|
147
|
+
.action(auditCommand)
|
|
148
|
+
.addHelpText('after', `
|
|
149
|
+
Description:
|
|
150
|
+
Audits Claude Skills (SKILL.md files) for quality, correctness, and
|
|
151
|
+
console compatibility. Validates frontmatter, links, naming conventions,
|
|
152
|
+
and warns about console-incompatible features. Outputs YAML report to
|
|
153
|
+
stdout, errors/warnings to stderr.
|
|
154
|
+
|
|
155
|
+
Path can be: directory, single SKILL.md file, or VAT agent directory
|
|
156
|
+
Default: current directory
|
|
157
|
+
|
|
158
|
+
Validation Checks:
|
|
159
|
+
Errors (must fix):
|
|
160
|
+
- Missing or invalid frontmatter (name, description)
|
|
161
|
+
- Broken links to other files
|
|
162
|
+
- Reserved words in names (anthropic, claude)
|
|
163
|
+
- XML tags in frontmatter fields
|
|
164
|
+
- Windows-style backslashes in paths
|
|
165
|
+
|
|
166
|
+
Warnings (should fix):
|
|
167
|
+
- Skill exceeds recommended length (>5000 lines)
|
|
168
|
+
- References console-incompatible tools (Write, Edit, Bash)
|
|
169
|
+
|
|
170
|
+
Exit Codes:
|
|
171
|
+
0 - Success | 1 - Errors found | 2 - System error
|
|
172
|
+
|
|
173
|
+
Examples:
|
|
174
|
+
$ vat agent audit # Audit current directory
|
|
175
|
+
$ vat agent audit ./my-skill/SKILL.md # Audit single skill
|
|
176
|
+
$ vat agent audit ./skills --recursive # Audit all skills recursively
|
|
177
|
+
`);
|
|
178
|
+
agent
|
|
179
|
+
.command('import <skillPath>')
|
|
180
|
+
.description('Import Claude Skill (SKILL.md) to VAT agent format (agent.yaml)')
|
|
181
|
+
.option('-o, --output <path>', 'Output path for agent.yaml (default: same directory as SKILL.md)')
|
|
182
|
+
.option('-f, --force', 'Overwrite existing agent.yaml')
|
|
183
|
+
.option('--debug', DEBUG_OPTION_DESC)
|
|
184
|
+
.action(importCommand)
|
|
185
|
+
.addHelpText('after', `
|
|
186
|
+
Description:
|
|
187
|
+
Converts a third-party Claude Skill (SKILL.md) to VAT agent format
|
|
188
|
+
(agent.yaml). Validates the skill frontmatter and creates a proper VAT
|
|
189
|
+
agent manifest with the claude-skills runtime.
|
|
190
|
+
|
|
191
|
+
Use this to import existing Claude Skills into your VAT project for
|
|
192
|
+
further customization or to use with VAT's build and deployment tools.
|
|
193
|
+
|
|
194
|
+
Conversion:
|
|
195
|
+
- Extracts name, description, license from SKILL.md frontmatter
|
|
196
|
+
- Creates agent.yaml with runtime: claude-skills
|
|
197
|
+
- Preserves version from metadata.version or defaults to 0.1.0
|
|
198
|
+
- Validates frontmatter before conversion
|
|
199
|
+
|
|
200
|
+
Exit Codes:
|
|
201
|
+
0 - Success | 1 - Validation/conversion error | 2 - System error
|
|
202
|
+
|
|
203
|
+
Examples:
|
|
204
|
+
$ vat agent import ./my-skill/SKILL.md # Import to same directory
|
|
205
|
+
$ vat agent import ./SKILL.md -o ./agent.yaml # Custom output path
|
|
206
|
+
$ vat agent import ./SKILL.md --force # Overwrite existing
|
|
207
|
+
`);
|
|
208
|
+
agent
|
|
209
|
+
.command('install <agentName>')
|
|
210
|
+
.description('Install agent to Claude Skills directory')
|
|
211
|
+
.option(SCOPE_OPTION, SCOPE_OPTION_DESC, SCOPE_DEFAULT)
|
|
212
|
+
.option('--dev', DEV_MODE_DESC)
|
|
213
|
+
.option('--force', 'Overwrite existing installation')
|
|
214
|
+
.option(RUNTIME_OPTION, RUNTIME_OPTION_DESC, RUNTIME_DEFAULT)
|
|
215
|
+
.option('--debug', DEBUG_OPTION_DESC)
|
|
216
|
+
.action(installAgent)
|
|
217
|
+
.addHelpText('after', `
|
|
218
|
+
Description:
|
|
219
|
+
Installs a built agent skill to Claude Skills directory. By default,
|
|
220
|
+
copies to user scope (~/.claude/skills/). Use --dev for symlink mode
|
|
221
|
+
(rapid development iteration).
|
|
222
|
+
|
|
223
|
+
Scopes:
|
|
224
|
+
- user: ~/.claude/skills/ (default, personal skills)
|
|
225
|
+
- project: ./.claude/skills/ (project-local skills)
|
|
226
|
+
|
|
227
|
+
Exit Codes:
|
|
228
|
+
0 - Success | 1 - Installation error | 2 - System error
|
|
229
|
+
|
|
230
|
+
Examples:
|
|
231
|
+
$ vat agent install agent-generator # Install to user scope
|
|
232
|
+
$ vat agent install agent-generator --scope project # Install to project
|
|
233
|
+
$ vat agent install agent-generator --dev # Symlink for dev mode
|
|
234
|
+
$ vat agent install agent-generator --force # Overwrite existing
|
|
235
|
+
|
|
236
|
+
Note: --dev (symlink) not supported on Windows. Use WSL for development.
|
|
237
|
+
`);
|
|
238
|
+
agent
|
|
239
|
+
.command('uninstall <agentName>')
|
|
240
|
+
.description('Uninstall agent from Claude Skills directory')
|
|
241
|
+
.option(SCOPE_OPTION, SCOPE_OPTION_DESC, SCOPE_DEFAULT)
|
|
242
|
+
.option(RUNTIME_OPTION, RUNTIME_OPTION_DESC, RUNTIME_DEFAULT)
|
|
243
|
+
.option('--debug', DEBUG_OPTION_DESC)
|
|
244
|
+
.action(uninstallAgent)
|
|
245
|
+
.addHelpText('after', `
|
|
246
|
+
Description:
|
|
247
|
+
Removes an installed agent skill from Claude Skills directory.
|
|
248
|
+
Handles both copied installations and symlinks.
|
|
249
|
+
|
|
250
|
+
Scopes:
|
|
251
|
+
- user: ~/.claude/skills/ (default)
|
|
252
|
+
- project: ./.claude/skills/
|
|
253
|
+
|
|
254
|
+
Exit Codes:
|
|
255
|
+
0 - Success | 1 - Not installed | 2 - System error
|
|
256
|
+
|
|
257
|
+
Examples:
|
|
258
|
+
$ vat agent uninstall agent-generator # Remove from user scope
|
|
259
|
+
$ vat agent uninstall agent-generator --scope project # Remove from project
|
|
260
|
+
`);
|
|
261
|
+
agent
|
|
262
|
+
.command('installed')
|
|
263
|
+
.description('List installed agent skills')
|
|
264
|
+
.option(SCOPE_OPTION, 'Filter by scope (user, project, all)', 'all')
|
|
265
|
+
.option(RUNTIME_OPTION, RUNTIME_OPTION_DESC, RUNTIME_DEFAULT)
|
|
266
|
+
.option('--debug', DEBUG_OPTION_DESC)
|
|
267
|
+
.action(installedCommand)
|
|
268
|
+
.addHelpText('after', `
|
|
269
|
+
Description:
|
|
270
|
+
Lists all installed agent skills across scopes. Shows installation
|
|
271
|
+
type (copied or symlinked) and location.
|
|
272
|
+
|
|
273
|
+
Scopes:
|
|
274
|
+
- all: Scan all scopes (default)
|
|
275
|
+
- user: Only ~/.claude/skills/
|
|
276
|
+
- project: Only ./.claude/skills/
|
|
277
|
+
|
|
278
|
+
Output:
|
|
279
|
+
YAML summary → stdout (for programmatic parsing)
|
|
280
|
+
Human-readable list → stderr
|
|
281
|
+
|
|
282
|
+
Exit Codes:
|
|
283
|
+
0 - Success | 2 - System error
|
|
284
|
+
|
|
285
|
+
Examples:
|
|
286
|
+
$ vat agent installed # List all installed skills
|
|
287
|
+
$ vat agent installed --scope user # Only user scope
|
|
288
|
+
$ vat agent installed --scope project # Only project scope
|
|
289
|
+
`);
|
|
290
|
+
return agent;
|
|
291
|
+
}
|
|
292
|
+
export { showAgentVerboseHelp } from './help.js';
|
|
293
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/agent/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,O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+
scope?: 'user' | 'project';
|
|
6
|
+
dev?: boolean;
|
|
7
|
+
force?: boolean;
|
|
8
|
+
runtime?: string;
|
|
9
|
+
debug?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Install agent command
|
|
13
|
+
*/
|
|
14
|
+
export declare function installAgent(agentName: string, options: InstallOptions): Promise<void>;
|
|
15
|
+
//# sourceMappingURL=install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/commands/agent/install.ts"],"names":[],"mappings":"AAAA;;GAEG;AAaH,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,wBAAsB,YAAY,CAChC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,IAAI,CAAC,CA6Df"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Install agent to Claude Skills directory
|
|
3
|
+
*/
|
|
4
|
+
import fs from 'node:fs/promises';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { loadAgentManifest } from '@vibe-agent-toolkit/agent-config';
|
|
7
|
+
import { copyDirectory } from '@vibe-agent-toolkit/utils';
|
|
8
|
+
import { resolveAgentPath } from '../../utils/agent-discovery.js';
|
|
9
|
+
import { handleCommandError } from '../../utils/command-error.js';
|
|
10
|
+
import { createLogger } from '../../utils/logger.js';
|
|
11
|
+
import { validateAndGetScopeLocation } from '../../utils/scope-locations.js';
|
|
12
|
+
/**
|
|
13
|
+
* Install agent command
|
|
14
|
+
*/
|
|
15
|
+
export async function installAgent(agentName, options) {
|
|
16
|
+
const logger = createLogger(options.debug ? { debug: true } : {});
|
|
17
|
+
const startTime = Date.now();
|
|
18
|
+
try {
|
|
19
|
+
const { runtime = 'claude-skill', scope = 'user', dev = false, force = false } = options;
|
|
20
|
+
// Windows check for dev mode
|
|
21
|
+
if (dev && process.platform === 'win32') {
|
|
22
|
+
throw new Error('--dev (symlink) not supported on Windows.\n' +
|
|
23
|
+
'Use copy mode (omit --dev) or WSL for development.');
|
|
24
|
+
}
|
|
25
|
+
// Validate scope and get target location
|
|
26
|
+
const targetLocation = validateAndGetScopeLocation(runtime, scope);
|
|
27
|
+
// Find built skill
|
|
28
|
+
const builtSkillPath = await findBuiltSkill(agentName, runtime, logger);
|
|
29
|
+
const installPath = path.join(targetLocation, agentName);
|
|
30
|
+
// Ensure target directory exists
|
|
31
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename -- Path constructed from validated scope location
|
|
32
|
+
await fs.mkdir(targetLocation, { recursive: true });
|
|
33
|
+
// Check if already installed
|
|
34
|
+
try {
|
|
35
|
+
await fs.access(installPath);
|
|
36
|
+
if (!force) {
|
|
37
|
+
logger.error(`\n${agentName} already installed at ${installPath}\n` +
|
|
38
|
+
`Use --force to overwrite\n`);
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
// Remove existing if force flag is set
|
|
42
|
+
await fs.rm(installPath, { recursive: true, force: true });
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
// Not installed, continue
|
|
46
|
+
}
|
|
47
|
+
if (dev) {
|
|
48
|
+
// Symlink for development
|
|
49
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename -- Paths from validated sources
|
|
50
|
+
await fs.symlink(builtSkillPath, installPath, 'dir');
|
|
51
|
+
logger.info(`✓ Symlinked ${agentName} to ${installPath} (dev mode)`);
|
|
52
|
+
logger.info(` Rebuild agent to see changes immediately`);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
// Copy for production
|
|
56
|
+
await copyDirectory(builtSkillPath, installPath);
|
|
57
|
+
logger.info(`✓ Installed ${agentName} to ${installPath}`);
|
|
58
|
+
}
|
|
59
|
+
const duration = Date.now() - startTime;
|
|
60
|
+
logger.debug(`Install completed in ${duration}ms`);
|
|
61
|
+
process.exit(0);
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
handleCommandError(error, logger, startTime, 'Install');
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Find built skill bundle
|
|
69
|
+
*/
|
|
70
|
+
async function findBuiltSkill(agentName, runtime, logger) {
|
|
71
|
+
// Resolve agent path
|
|
72
|
+
const agentPath = await resolveAgentPath(agentName, logger);
|
|
73
|
+
const manifest = await loadAgentManifest(agentPath);
|
|
74
|
+
// Find package root by walking up from manifest path
|
|
75
|
+
const packageRoot = await findAgentPackageRoot(manifest.__manifestPath ?? agentPath);
|
|
76
|
+
// Runtime-specific bundle location
|
|
77
|
+
const runtimeDir = runtime === 'claude-skill' ? 'skill' : runtime;
|
|
78
|
+
const builtPath = path.join(packageRoot, 'dist', 'vat-bundles', runtimeDir, manifest.metadata.name);
|
|
79
|
+
try {
|
|
80
|
+
await fs.access(builtPath);
|
|
81
|
+
return builtPath;
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
throw new Error(`Built skill not found at ${builtPath}\n` +
|
|
85
|
+
`Run: vat agent build ${agentName} --runtime ${runtime}`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Find the agent package root (directory containing package.json)
|
|
90
|
+
*/
|
|
91
|
+
async function findAgentPackageRoot(manifestPath) {
|
|
92
|
+
let currentDir = path.dirname(path.resolve(manifestPath));
|
|
93
|
+
// Walk up until we find a package.json or hit the filesystem root
|
|
94
|
+
while (currentDir !== path.dirname(currentDir)) {
|
|
95
|
+
const packageJsonPath = path.join(currentDir, 'package.json');
|
|
96
|
+
try {
|
|
97
|
+
await fs.access(packageJsonPath);
|
|
98
|
+
return currentDir;
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
currentDir = path.dirname(currentDir);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
throw new Error(`Could not find package.json for agent at ${manifestPath}. ` +
|
|
105
|
+
`Agent must be within an npm package to install.`);
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=install.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../src/commands/agent/install.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAU7E;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,SAAiB,EACjB,OAAuB;IAEvB,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAClE,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAE7B,IAAI,CAAC;QACH,MAAM,EAAE,OAAO,GAAG,cAAc,EAAE,KAAK,GAAG,MAAM,EAAE,GAAG,GAAG,KAAK,EAAE,KAAK,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC;QAEzF,6BAA6B;QAC7B,IAAI,GAAG,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;YACx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AC3D,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,oBAAoB,CAAC,YAAoB;IACtD,IAAI,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;IAE1D,kEAAkE;IAClE,OAAO,UAAU,KAAK,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/C,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QAC9D,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;YACjC,OAAO,UAAU,CAAC;QACpB,CAAC;QAAC,MAAM,CAAC;YACP,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;IAED,MAAM,IAAI,KAAK,CACb,4CAA4C,YAAY,IAAI;QAC1D,iDAAiD,CACpD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List installed agents command
|
|
3
|
+
*/
|
|
4
|
+
export interface InstalledCommandOptions {
|
|
5
|
+
scope?: 'user' | 'project' | 'all';
|
|
6
|
+
runtime?: string;
|
|
7
|
+
debug?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* List installed agents command
|
|
11
|
+
*/
|
|
12
|
+
export declare function installedCommand(options: InstalledCommandOptions): Promise<void>;
|
|
13
|
+
//# sourceMappingURL=installed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installed.d.ts","sourceRoot":"","sources":["../../../src/commands/agent/installed.ts"],"names":[],"mappings":"AAAA;;GAEG;AAWH,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,KAAK,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AASD;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoEtF"}
|