@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,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logger utility for CLI - writes only to stderr
|
|
3
|
+
* stdout is reserved for structured YAML/JSON output
|
|
4
|
+
*/
|
|
5
|
+
export interface Logger {
|
|
6
|
+
info: (message: string) => void;
|
|
7
|
+
error: (message: string) => void;
|
|
8
|
+
debug: (message: string) => void;
|
|
9
|
+
}
|
|
10
|
+
export interface LoggerOptions {
|
|
11
|
+
debug?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function createLogger(options?: LoggerOptions): Logger;
|
|
14
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,wBAAgB,YAAY,CAAC,OAAO,GAAE,aAAkB,GAAG,MAAM,CAgBhE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logger utility for CLI - writes only to stderr
|
|
3
|
+
* stdout is reserved for structured YAML/JSON output
|
|
4
|
+
*/
|
|
5
|
+
export function createLogger(options = {}) {
|
|
6
|
+
const debug = options.debug ?? false;
|
|
7
|
+
return {
|
|
8
|
+
info: (message) => {
|
|
9
|
+
process.stderr.write(`${message}\n`);
|
|
10
|
+
},
|
|
11
|
+
error: (message) => {
|
|
12
|
+
process.stderr.write(`${message}\n`);
|
|
13
|
+
},
|
|
14
|
+
debug: (message) => {
|
|
15
|
+
if (debug) {
|
|
16
|
+
process.stderr.write(`[DEBUG] ${message}\n`);
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH,MAAM,UAAU,YAAY,CAAC,UAAyB,EAAE;IACtD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC;IAErC,OAAO;QACL,IAAI,EAAE,CAAC,OAAe,EAAE,EAAE;YACxB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC;QACvC,CAAC;QACD,KAAK,EAAE,CAAC,OAAe,EAAE,EAAE;YACzB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC;QACvC,CAAC;QACD,KAAK,EAAE,CAAC,OAAe,EAAE,EAAE;YACzB,IAAI,KAAK,EAAE,CAAC;gBACV,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,OAAO,IAAI,CAAC,CAAC;YAC/C,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output utilities for structured data
|
|
3
|
+
* YAML output on stdout, logs on stderr
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Write YAML output to stdout with document markers
|
|
7
|
+
* @param data - Data to serialize as YAML
|
|
8
|
+
*/
|
|
9
|
+
export declare function writeYamlOutput(data: unknown): void;
|
|
10
|
+
/**
|
|
11
|
+
* Flush stdout before writing to stderr
|
|
12
|
+
* Prevents output corruption when streams are merged
|
|
13
|
+
*/
|
|
14
|
+
export declare function flushStdout(): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Write test-format error to stderr
|
|
17
|
+
* Format: file:line:column: message
|
|
18
|
+
*/
|
|
19
|
+
export declare function writeTestFormatError(file: string, line: number, column: number, message: string): void;
|
|
20
|
+
//# sourceMappingURL=output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/utils/output.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAQnD;AAED;;;GAGG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAQjD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GACd,IAAI,CAEN"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output utilities for structured data
|
|
3
|
+
* YAML output on stdout, logs on stderr
|
|
4
|
+
*/
|
|
5
|
+
import * as yaml from 'js-yaml';
|
|
6
|
+
/**
|
|
7
|
+
* Write YAML output to stdout with document markers
|
|
8
|
+
* @param data - Data to serialize as YAML
|
|
9
|
+
*/
|
|
10
|
+
export function writeYamlOutput(data) {
|
|
11
|
+
process.stdout.write('---\n');
|
|
12
|
+
process.stdout.write(yaml.dump(data, {
|
|
13
|
+
indent: 2,
|
|
14
|
+
lineWidth: 120,
|
|
15
|
+
noRefs: true,
|
|
16
|
+
}));
|
|
17
|
+
process.stdout.write('---\n');
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Flush stdout before writing to stderr
|
|
21
|
+
* Prevents output corruption when streams are merged
|
|
22
|
+
*/
|
|
23
|
+
export async function flushStdout() {
|
|
24
|
+
return new Promise((resolve) => {
|
|
25
|
+
if (process.stdout.writableNeedDrain) {
|
|
26
|
+
process.stdout.once('drain', resolve);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
resolve();
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Write test-format error to stderr
|
|
35
|
+
* Format: file:line:column: message
|
|
36
|
+
*/
|
|
37
|
+
export function writeTestFormatError(file, line, column, message) {
|
|
38
|
+
process.stderr.write(`${file}:${line}:${column}: ${message}\n`);
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/utils/output.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,IAAa;IAC3C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC9B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;QACnC,MAAM,EAAE,CAAC;QACT,SAAS,EAAE,GAAG;QACd,MAAM,EAAE,IAAI;KACb,CAAC,CAAC,CAAC;IACJ,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;QACnC,IAAI,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC;YACrC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxC,CAAC;aAAM,CAAC;YACN,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAClC,IAAY,EACZ,IAAY,EACZ,MAAc,EACd,OAAe;IAEf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,IAAI,IAAI,MAAM,KAAK,OAAO,IAAI,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project root detection utility
|
|
3
|
+
* Walks up directory tree to find .git or vibe-agent-toolkit.config.yaml
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Find project root by walking up directory tree
|
|
7
|
+
* @param startDir - Directory to start search from
|
|
8
|
+
* @returns Project root path or null if not found
|
|
9
|
+
*/
|
|
10
|
+
export declare function findProjectRoot(startDir: string): string | null;
|
|
11
|
+
//# sourceMappingURL=project-root.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-root.d.ts","sourceRoot":"","sources":["../../src/utils/project-root.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA0B/D"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project root detection utility
|
|
3
|
+
* Walks up directory tree to find .git or vibe-agent-toolkit.config.yaml
|
|
4
|
+
*/
|
|
5
|
+
import * as fs from 'node:fs';
|
|
6
|
+
import * as path from 'node:path';
|
|
7
|
+
/**
|
|
8
|
+
* Find project root by walking up directory tree
|
|
9
|
+
* @param startDir - Directory to start search from
|
|
10
|
+
* @returns Project root path or null if not found
|
|
11
|
+
*/
|
|
12
|
+
export function findProjectRoot(startDir) {
|
|
13
|
+
let current = path.resolve(startDir);
|
|
14
|
+
const root = path.parse(current).root;
|
|
15
|
+
while (current !== root) {
|
|
16
|
+
// Check for .git directory
|
|
17
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename -- path walking is intentional
|
|
18
|
+
if (fs.existsSync(path.join(current, '.git'))) {
|
|
19
|
+
return current;
|
|
20
|
+
}
|
|
21
|
+
// Check for config file
|
|
22
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename -- path walking is intentional
|
|
23
|
+
if (fs.existsSync(path.join(current, 'vibe-agent-toolkit.config.yaml'))) {
|
|
24
|
+
return current;
|
|
25
|
+
}
|
|
26
|
+
// Move up one directory
|
|
27
|
+
const parent = path.dirname(current);
|
|
28
|
+
if (parent === current) {
|
|
29
|
+
break; // Reached root
|
|
30
|
+
}
|
|
31
|
+
current = parent;
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=project-root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-root.js","sourceRoot":"","sources":["../../src/utils/project-root.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC;IAEtC,OAAO,OAAO,KAAK,IAAI,EAAE,CAAC;QACxB,2BAA2B;QAC3B,kGAAkG;QAClG,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;YAC9C,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,wBAAwB;QACxB,kGAAkG;QAClG,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,gCAAgC,CAAC,CAAC,EAAE,CAAC;YACxE,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,wBAAwB;QACxB,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACrC,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;YACvB,MAAM,CAAC,eAAe;QACxB,CAAC;QACD,OAAO,GAAG,MAAM,CAAC;IACnB,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for loading and crawling resources
|
|
3
|
+
*/
|
|
4
|
+
import { ResourceRegistry } from '@vibe-agent-toolkit/resources';
|
|
5
|
+
import type { ProjectConfig } from '../schemas/config.js';
|
|
6
|
+
import type { Logger } from './logger.js';
|
|
7
|
+
export interface ResourceLoadResult {
|
|
8
|
+
scanPath: string;
|
|
9
|
+
projectRoot: string | null;
|
|
10
|
+
config: ProjectConfig | undefined;
|
|
11
|
+
registry: ResourceRegistry;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Load resources from a path with config support
|
|
15
|
+
*
|
|
16
|
+
* Common pattern for CLI commands that need to:
|
|
17
|
+
* 1. Determine scan path
|
|
18
|
+
* 2. Find project root and load config
|
|
19
|
+
* 3. Create registry and crawl
|
|
20
|
+
*
|
|
21
|
+
* Behavior:
|
|
22
|
+
* - When path argument provided: use as baseDir, ignore config patterns (use defaults)
|
|
23
|
+
* - When no path argument: use project root/cwd as baseDir, apply config patterns
|
|
24
|
+
*
|
|
25
|
+
* @param pathArg - Path argument from CLI (optional)
|
|
26
|
+
* @param logger - Logger instance
|
|
27
|
+
* @returns Resource load result with registry and metadata
|
|
28
|
+
*/
|
|
29
|
+
export declare function loadResourcesWithConfig(pathArg: string | undefined, logger: Logger): Promise<ResourceLoadResult>;
|
|
30
|
+
//# sourceMappingURL=resource-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-loader.d.ts","sourceRoot":"","sources":["../../src/utils/resource-loader.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAG1C,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,aAAa,GAAG,SAAS,CAAC;IAClC,QAAQ,EAAE,gBAAgB,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,kBAAkB,CAAC,CA8C7B"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for loading and crawling resources
|
|
3
|
+
*/
|
|
4
|
+
import { ResourceRegistry } from '@vibe-agent-toolkit/resources';
|
|
5
|
+
import { loadConfig } from './config-loader.js';
|
|
6
|
+
import { findProjectRoot } from './project-root.js';
|
|
7
|
+
/**
|
|
8
|
+
* Load resources from a path with config support
|
|
9
|
+
*
|
|
10
|
+
* Common pattern for CLI commands that need to:
|
|
11
|
+
* 1. Determine scan path
|
|
12
|
+
* 2. Find project root and load config
|
|
13
|
+
* 3. Create registry and crawl
|
|
14
|
+
*
|
|
15
|
+
* Behavior:
|
|
16
|
+
* - When path argument provided: use as baseDir, ignore config patterns (use defaults)
|
|
17
|
+
* - When no path argument: use project root/cwd as baseDir, apply config patterns
|
|
18
|
+
*
|
|
19
|
+
* @param pathArg - Path argument from CLI (optional)
|
|
20
|
+
* @param logger - Logger instance
|
|
21
|
+
* @returns Resource load result with registry and metadata
|
|
22
|
+
*/
|
|
23
|
+
export async function loadResourcesWithConfig(pathArg, logger) {
|
|
24
|
+
// Find project root and load config
|
|
25
|
+
const projectRoot = findProjectRoot(process.cwd());
|
|
26
|
+
const config = projectRoot ? loadConfig(projectRoot) : undefined;
|
|
27
|
+
if (config) {
|
|
28
|
+
logger.debug(`Loaded config from ${projectRoot ?? 'unknown'}`);
|
|
29
|
+
}
|
|
30
|
+
// Create registry and crawl
|
|
31
|
+
const registry = new ResourceRegistry();
|
|
32
|
+
let crawlOptions;
|
|
33
|
+
if (pathArg) {
|
|
34
|
+
// Path argument provided: crawl from that directory with default patterns
|
|
35
|
+
// Ignore config patterns because they're relative to project root
|
|
36
|
+
logger.debug(`Path argument provided: ${pathArg}`);
|
|
37
|
+
logger.debug('Using default patterns (ignoring config)');
|
|
38
|
+
crawlOptions = {
|
|
39
|
+
baseDir: pathArg,
|
|
40
|
+
// Use defaults from ResourceRegistry.crawl (will use **/*.md)
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
// No path argument: crawl from project root (or cwd) with config patterns
|
|
45
|
+
const scanPath = projectRoot ?? process.cwd();
|
|
46
|
+
logger.debug(`No path argument, using: ${scanPath}`);
|
|
47
|
+
crawlOptions = {
|
|
48
|
+
baseDir: scanPath,
|
|
49
|
+
// Apply include patterns from config (if specified)
|
|
50
|
+
...(config?.resources?.include ? { include: config.resources.include } : {}),
|
|
51
|
+
// Apply exclude patterns from config (if specified)
|
|
52
|
+
...(config?.resources?.exclude ? { exclude: config.resources.exclude } : {}),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
await registry.crawl(crawlOptions);
|
|
56
|
+
return {
|
|
57
|
+
scanPath: pathArg ?? (projectRoot ?? process.cwd()),
|
|
58
|
+
projectRoot,
|
|
59
|
+
config,
|
|
60
|
+
registry,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=resource-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-loader.js","sourceRoot":"","sources":["../../src/utils/resource-loader.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AASpD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,OAA2B,EAC3B,MAAc;IAEd,oCAAoC;IACpC,MAAM,WAAW,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACnD,MAAM,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEjE,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,CAAC,KAAK,CAAC,sBAAsB,WAAW,IAAI,SAAS,EAAE,CAAC,CAAC;IACjE,CAAC;IAED,4BAA4B;IAC5B,MAAM,QAAQ,GAAG,IAAI,gBAAgB,EAAE,CAAC;IAExC,IAAI,YAAY,CAAC;IAEjB,IAAI,OAAO,EAAE,CAAC;QACZ,0EAA0E;QAC1E,kEAAkE;QAClE,MAAM,CAAC,KAAK,CAAC,2BAA2B,OAAO,EAAE,CAAC,CAAC;QACnD,MAAM,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;QAEzD,YAAY,GAAG;YACb,OAAO,EAAE,OAAO;YAChB,8DAA8D;SAC/D,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,0EAA0E;QAC1E,MAAM,QAAQ,GAAG,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAC9C,MAAM,CAAC,KAAK,CAAC,4BAA4B,QAAQ,EAAE,CAAC,CAAC;QAErD,YAAY,GAAG;YACb,OAAO,EAAE,QAAQ;YACjB,oDAAoD;YACpD,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5E,oDAAoD;YACpD,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC7E,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAEnC,OAAO;QACL,QAAQ,EAAE,OAAO,IAAI,CAAC,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QACnD,WAAW;QACX,MAAM;QACN,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scope locations and validation for agent installation
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Map of runtime to scope locations
|
|
6
|
+
*/
|
|
7
|
+
export declare const SCOPE_LOCATIONS: Record<string, Record<string, string>>;
|
|
8
|
+
/**
|
|
9
|
+
* Map of runtime to valid scopes
|
|
10
|
+
*/
|
|
11
|
+
export declare const VALID_SCOPES: Record<string, string[]>;
|
|
12
|
+
/**
|
|
13
|
+
* Validate scope for a given runtime and return the target location
|
|
14
|
+
* @throws Error if scope is invalid or not implemented
|
|
15
|
+
*/
|
|
16
|
+
export declare function validateAndGetScopeLocation(runtime: string, scope: string): string;
|
|
17
|
+
//# sourceMappingURL=scope-locations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope-locations.d.ts","sourceRoot":"","sources":["../../src/utils/scope-locations.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAKlE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAEjD,CAAC;AAEF;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GACZ,MAAM,CAkBR"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scope locations and validation for agent installation
|
|
3
|
+
*/
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
/**
|
|
7
|
+
* Map of runtime to scope locations
|
|
8
|
+
*/
|
|
9
|
+
export const SCOPE_LOCATIONS = {
|
|
10
|
+
'claude-skill': {
|
|
11
|
+
user: path.join(os.homedir(), '.claude', 'skills'),
|
|
12
|
+
project: path.join(process.cwd(), '.claude', 'skills'),
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Map of runtime to valid scopes
|
|
17
|
+
*/
|
|
18
|
+
export const VALID_SCOPES = {
|
|
19
|
+
'claude-skill': ['user', 'project'],
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Validate scope for a given runtime and return the target location
|
|
23
|
+
* @throws Error if scope is invalid or not implemented
|
|
24
|
+
*/
|
|
25
|
+
export function validateAndGetScopeLocation(runtime, scope) {
|
|
26
|
+
// Validate scope for runtime
|
|
27
|
+
const validScopes = VALID_SCOPES[runtime];
|
|
28
|
+
if (!validScopes?.includes(scope)) {
|
|
29
|
+
const available = validScopes?.join(', ') ?? 'none';
|
|
30
|
+
throw new Error(`Invalid scope '${scope}' for runtime '${runtime}'.\n` +
|
|
31
|
+
`Valid scopes: ${available}`);
|
|
32
|
+
}
|
|
33
|
+
// Get scope location
|
|
34
|
+
const targetLocation = SCOPE_LOCATIONS[runtime]?.[scope];
|
|
35
|
+
if (!targetLocation) {
|
|
36
|
+
throw new Error(`Scope '${scope}' not implemented for runtime '${runtime}'`);
|
|
37
|
+
}
|
|
38
|
+
return targetLocation;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=scope-locations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope-locations.js","sourceRoot":"","sources":["../../src/utils/scope-locations.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAA2C;IACrE,cAAc,EAAE;QACd,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,QAAQ,CAAC;QAClD,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,QAAQ,CAAC;KACvD;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAA6B;IACpD,cAAc,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC;CACpC,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CACzC,OAAe,EACf,KAAa;IAEb,6BAA6B;IAC7B,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IAC1C,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAClC,MAAM,SAAS,GAAG,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC;QACpD,MAAM,IAAI,KAAK,CACb,kBAAkB,KAAK,kBAAkB,OAAO,MAAM;YACpD,iBAAiB,SAAS,EAAE,CAC/B,CAAC;IACJ,CAAC;IAED,qBAAqB;IACrB,MAAM,cAAc,GAAG,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IACzD,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,UAAU,KAAK,kCAAkC,OAAO,GAAG,CAAC,CAAC;IAC/E,CAAC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build-time validator for help documentation files
|
|
3
|
+
*
|
|
4
|
+
* Ensures all required markdown help files exist before build completes.
|
|
5
|
+
* This provides "fail fast" behavior - missing help files cause build failure
|
|
6
|
+
* rather than runtime errors when users request verbose help.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Validate that all required help files exist
|
|
10
|
+
*
|
|
11
|
+
* @throws {Error} If any required help file is missing
|
|
12
|
+
*/
|
|
13
|
+
export declare function validateHelpFiles(): void;
|
|
14
|
+
//# sourceMappingURL=validate-help-files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-help-files.d.ts","sourceRoot":"","sources":["../../src/utils/validate-help-files.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAiBH;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAuBxC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build-time validator for help documentation files
|
|
3
|
+
*
|
|
4
|
+
* Ensures all required markdown help files exist before build completes.
|
|
5
|
+
* This provides "fail fast" behavior - missing help files cause build failure
|
|
6
|
+
* rather than runtime errors when users request verbose help.
|
|
7
|
+
*/
|
|
8
|
+
import { existsSync } from 'node:fs';
|
|
9
|
+
import { dirname, join } from 'node:path';
|
|
10
|
+
import { fileURLToPath } from 'node:url';
|
|
11
|
+
/**
|
|
12
|
+
* Required help documentation files
|
|
13
|
+
* Each entry maps to a file in packages/cli/docs/
|
|
14
|
+
*/
|
|
15
|
+
const REQUIRED_HELP_FILES = [
|
|
16
|
+
'index.md', // Root-level verbose help (vat --help --verbose)
|
|
17
|
+
'resources.md', // Resources command verbose help (vat resources --help --verbose)
|
|
18
|
+
'rag.md', // RAG command verbose help (vat rag --help --verbose)
|
|
19
|
+
'agent.md', // Agent command verbose help (vat agent --help --verbose)
|
|
20
|
+
];
|
|
21
|
+
/**
|
|
22
|
+
* Validate that all required help files exist
|
|
23
|
+
*
|
|
24
|
+
* @throws {Error} If any required help file is missing
|
|
25
|
+
*/
|
|
26
|
+
export function validateHelpFiles() {
|
|
27
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
28
|
+
const packageRoot = join(__dirname, '../..');
|
|
29
|
+
const docsDir = join(packageRoot, 'docs');
|
|
30
|
+
const missingFiles = [];
|
|
31
|
+
for (const filename of REQUIRED_HELP_FILES) {
|
|
32
|
+
const helpPath = join(docsDir, filename);
|
|
33
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename -- path is constructed from known safe components
|
|
34
|
+
if (!existsSync(helpPath)) {
|
|
35
|
+
missingFiles.push(filename);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (missingFiles.length > 0) {
|
|
39
|
+
const fileList = missingFiles.map(f => ` - docs/${f}`).join('\n');
|
|
40
|
+
throw new Error(`Missing required help documentation files:\n${fileList}\n\n` +
|
|
41
|
+
`These files must exist for verbose help (--help --verbose) to work.\n` +
|
|
42
|
+
`Create them before building the CLI package.`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Run validation if this file is executed directly
|
|
47
|
+
* (via tsx or node during build process)
|
|
48
|
+
*/
|
|
49
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
50
|
+
try {
|
|
51
|
+
validateHelpFiles();
|
|
52
|
+
console.log('✓ All required help documentation files exist');
|
|
53
|
+
process.exit(0);
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
console.error('✗ Help file validation failed:');
|
|
57
|
+
console.error(error.message);
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=validate-help-files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-help-files.js","sourceRoot":"","sources":["../../src/utils/validate-help-files.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;GAGG;AACH,MAAM,mBAAmB,GAAG;IAC1B,UAAU,EAAO,iDAAiD;IAClE,cAAc,EAAG,kEAAkE;IACnF,QAAQ,EAAS,sDAAsD;IACvE,UAAU,EAAO,0DAA0D;CACnE,CAAC;AAEX;;;;GAIG;AACH,MAAM,UAAU,iBAAiB;IAC/B,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1D,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC7C,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAE1C,MAAM,YAAY,GAAa,EAAE,CAAC;IAElC,KAAK,MAAM,QAAQ,IAAI,mBAAmB,EAAE,CAAC;QAC3C,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACzC,qHAAqH;QACrH,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC1B,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;IAED,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnE,MAAM,IAAI,KAAK,CACb,+CAA+C,QAAQ,MAAM;YAC7D,uEAAuE;YACvE,8CAA8C,CAC/C,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,UAAU,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IACpD,IAAI,CAAC;QACH,iBAAiB,EAAE,CAAC;QACpB,OAAO,CAAC,GAAG,CAAC,+CAA+C,CAAC,CAAC;QAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;QAChD,OAAO,CAAC,KAAK,CAAE,KAAe,CAAC,OAAO,CAAC,CAAC;QACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version information and context detection
|
|
3
|
+
*/
|
|
4
|
+
export declare const version: string;
|
|
5
|
+
export interface VersionContext {
|
|
6
|
+
type: 'dev' | 'local' | 'global';
|
|
7
|
+
path?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Format version string with optional context
|
|
11
|
+
*/
|
|
12
|
+
export declare function getVersionString(ver: string, context: VersionContext | null): string;
|
|
13
|
+
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;GAEG;AAaH,eAAO,MAAM,OAAO,EAAE,MAA4B,CAAC;AAEnD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,cAAc,GAAG,IAAI,GAC7B,MAAM,CAaR"}
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version information and context detection
|
|
3
|
+
*/
|
|
4
|
+
import { readFileSync } from 'node:fs';
|
|
5
|
+
import { resolve, dirname } from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
// Read version from package.json at build time
|
|
9
|
+
const packageJson = JSON.parse(readFileSync(resolve(__dirname, '../package.json'), 'utf-8'));
|
|
10
|
+
export const version = packageJson.version;
|
|
11
|
+
/**
|
|
12
|
+
* Format version string with optional context
|
|
13
|
+
*/
|
|
14
|
+
export function getVersionString(ver, context) {
|
|
15
|
+
if (!context) {
|
|
16
|
+
return ver;
|
|
17
|
+
}
|
|
18
|
+
switch (context.type) {
|
|
19
|
+
case 'dev':
|
|
20
|
+
return `${ver}-dev (${context.path ?? 'unknown'})`;
|
|
21
|
+
case 'local':
|
|
22
|
+
return `${ver} (local: ${context.path ?? 'unknown'})`;
|
|
23
|
+
case 'global':
|
|
24
|
+
return ver;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D,+CAA+C;AAC/C,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAC5B,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,iBAAiB,CAAC,EAAE,OAAO,CAAC,CAC7D,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAW,WAAW,CAAC,OAAO,CAAC;AAOnD;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,GAAW,EACX,OAA8B;IAE9B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,GAAG,CAAC;IACb,CAAC;IAED,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;QACrB,KAAK,KAAK;YACR,OAAO,GAAG,GAAG,SAAS,OAAO,CAAC,IAAI,IAAI,SAAS,GAAG,CAAC;QACrD,KAAK,OAAO;YACV,OAAO,GAAG,GAAG,YAAY,OAAO,CAAC,IAAI,IAAI,SAAS,GAAG,CAAC;QACxD,KAAK,QAAQ;YACX,OAAO,GAAG,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/docs/agent.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Agent Commands
|
|
2
|
+
|
|
3
|
+
Manage and execute AI agents defined in agent.yaml manifests.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
VAT agents are defined using Kubernetes-style YAML manifests that specify:
|
|
8
|
+
- Agent metadata (name, version, description)
|
|
9
|
+
- LLM configuration (provider, model, parameters)
|
|
10
|
+
- Tools (RAG, functions, APIs)
|
|
11
|
+
- Prompts (system, user templates)
|
|
12
|
+
- Resources (documentation, templates, examples)
|
|
13
|
+
|
|
14
|
+
## Commands
|
|
15
|
+
|
|
16
|
+
### `vat agent validate <path>`
|
|
17
|
+
|
|
18
|
+
Validate agent manifest and check prerequisites.
|
|
19
|
+
|
|
20
|
+
**Usage**:
|
|
21
|
+
```bash
|
|
22
|
+
vat agent validate ./my-agent
|
|
23
|
+
vat agent validate ./my-agent/agent.yaml
|
|
24
|
+
vat agent validate packages/vat-development-agents/agents/agent-generator
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Validation checks**:
|
|
28
|
+
- Manifest schema validation (apiVersion, kind, metadata, spec)
|
|
29
|
+
- LLM provider and model configuration
|
|
30
|
+
- Tool configurations (RAG databases, function files)
|
|
31
|
+
- Resource file existence (prompts, docs, templates)
|
|
32
|
+
- Prompt references ($ref paths)
|
|
33
|
+
|
|
34
|
+
**Output**: YAML to stdout with validation results
|
|
35
|
+
**Exit codes**: 0 = valid, 1 = validation errors, 2 = system error
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Manifest Format
|
|
40
|
+
|
|
41
|
+
VAT uses Kubernetes-style manifests for agent configuration:
|
|
42
|
+
|
|
43
|
+
```yaml
|
|
44
|
+
apiVersion: vat.dev/v1
|
|
45
|
+
kind: Agent
|
|
46
|
+
|
|
47
|
+
metadata:
|
|
48
|
+
name: "agent-name"
|
|
49
|
+
version: "0.1.0"
|
|
50
|
+
description: "Agent description"
|
|
51
|
+
|
|
52
|
+
spec:
|
|
53
|
+
llm:
|
|
54
|
+
provider: anthropic
|
|
55
|
+
model: claude-sonnet-4.5
|
|
56
|
+
temperature: 0.7
|
|
57
|
+
|
|
58
|
+
prompts:
|
|
59
|
+
system:
|
|
60
|
+
$ref: ./prompts/system.md
|
|
61
|
+
|
|
62
|
+
tools:
|
|
63
|
+
- name: tool_name
|
|
64
|
+
type: library
|
|
65
|
+
description: Tool description
|
|
66
|
+
|
|
67
|
+
resources:
|
|
68
|
+
resource_id:
|
|
69
|
+
path: ./path/to/file
|
|
70
|
+
type: template
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
See `@vibe-agent-toolkit/agent-schema` for complete schema reference.
|
|
74
|
+
|
|
75
|
+
## Examples
|
|
76
|
+
|
|
77
|
+
### Example 1: Validate agent-generator
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
cd packages/vat-development-agents
|
|
81
|
+
vat agent validate agents/agent-generator
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Example 2: Validate with custom path
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
vat agent validate ./my-custom-agent/agent.yaml
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Environment Variables
|
|
91
|
+
|
|
92
|
+
- `ANTHROPIC_API_KEY` - API key for Anthropic (Claude)
|
|
93
|
+
- `OPENAI_API_KEY` - API key for OpenAI
|
|
94
|
+
- `GOOGLE_API_KEY` - API key for Google (Gemini)
|
|
95
|
+
|
|
96
|
+
## See Also
|
|
97
|
+
|
|
98
|
+
- [@vibe-agent-toolkit/agent-schema](../../agent-schema/README.md) - Schema reference
|
|
99
|
+
- [agent-generator](../../vat-development-agents/agents/agent-generator/README.md) - Example agent
|
|
100
|
+
- [RAG Commands](./rag.md) - Indexing documentation for RAG tools
|