dot-agents 0.2.0 → 0.3.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 +151 -7
- package/dist/cli/commands/check.d.ts +3 -0
- package/dist/cli/commands/check.d.ts.map +1 -0
- package/dist/cli/commands/check.js +152 -0
- package/dist/cli/commands/check.js.map +1 -0
- package/dist/cli/commands/index.d.ts +1 -0
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +1 -0
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +58 -52
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/index.js +3 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +2 -0
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/validation/cron.d.ts +29 -0
- package/dist/lib/validation/cron.d.ts.map +1 -0
- package/dist/lib/validation/cron.js +159 -0
- package/dist/lib/validation/cron.js.map +1 -0
- package/dist/lib/validation/index.d.ts +18 -0
- package/dist/lib/validation/index.d.ts.map +1 -0
- package/dist/lib/validation/index.js +135 -0
- package/dist/lib/validation/index.js.map +1 -0
- package/dist/lib/validation/persona.d.ts +9 -0
- package/dist/lib/validation/persona.d.ts.map +1 -0
- package/dist/lib/validation/persona.js +143 -0
- package/dist/lib/validation/persona.js.map +1 -0
- package/dist/lib/validation/types.d.ts +64 -0
- package/dist/lib/validation/types.d.ts.map +1 -0
- package/dist/lib/validation/types.js +25 -0
- package/dist/lib/validation/types.js.map +1 -0
- package/dist/lib/validation/workflow.d.ts +10 -0
- package/dist/lib/validation/workflow.d.ts.map +1 -0
- package/dist/lib/validation/workflow.js +242 -0
- package/dist/lib/validation/workflow.js.map +1 -0
- package/package.json +1 -1
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AAGjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AAGjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAG5B,cAAc,uBAAuB,CAAC"}
|
package/dist/lib/index.js
CHANGED
package/dist/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,kBAAkB,CAAC;AAEjC,oBAAoB;AACpB,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,kBAAkB,CAAC;AAEjC,oBAAoB;AACpB,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAE5B,aAAa;AACb,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate cron expression syntax
|
|
3
|
+
*
|
|
4
|
+
* Supports standard 5-field cron format:
|
|
5
|
+
* minute hour day-of-month month day-of-week
|
|
6
|
+
*
|
|
7
|
+
* Each field can be:
|
|
8
|
+
* - asterisk (any value)
|
|
9
|
+
* - number (specific value)
|
|
10
|
+
* - range (1-5)
|
|
11
|
+
* - step (star/15 or 1-5/2)
|
|
12
|
+
* - list (1,3,5)
|
|
13
|
+
* - combinations of above
|
|
14
|
+
*/
|
|
15
|
+
interface CronValidationResult {
|
|
16
|
+
valid: boolean;
|
|
17
|
+
error?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Validate a cron expression
|
|
21
|
+
*/
|
|
22
|
+
export declare function validateCron(expression: string): CronValidationResult;
|
|
23
|
+
/**
|
|
24
|
+
* Parse a human-readable schedule hint into a cron suggestion
|
|
25
|
+
* This is best-effort for common patterns
|
|
26
|
+
*/
|
|
27
|
+
export declare function suggestCronFromHint(hint: string): string | null;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=cron.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cron.d.ts","sourceRoot":"","sources":["../../../src/lib/validation/cron.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,UAAU,oBAAoB;IAC5B,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAuFD;;GAEG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,oBAAoB,CA0BrE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA2C/D"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate cron expression syntax
|
|
3
|
+
*
|
|
4
|
+
* Supports standard 5-field cron format:
|
|
5
|
+
* minute hour day-of-month month day-of-week
|
|
6
|
+
*
|
|
7
|
+
* Each field can be:
|
|
8
|
+
* - asterisk (any value)
|
|
9
|
+
* - number (specific value)
|
|
10
|
+
* - range (1-5)
|
|
11
|
+
* - step (star/15 or 1-5/2)
|
|
12
|
+
* - list (1,3,5)
|
|
13
|
+
* - combinations of above
|
|
14
|
+
*/
|
|
15
|
+
const FIELD_RANGES = {
|
|
16
|
+
minute: [0, 59],
|
|
17
|
+
hour: [0, 23],
|
|
18
|
+
dayOfMonth: [1, 31],
|
|
19
|
+
month: [1, 12],
|
|
20
|
+
dayOfWeek: [0, 7], // 0 and 7 both represent Sunday
|
|
21
|
+
};
|
|
22
|
+
const FIELD_NAMES = ["minute", "hour", "dayOfMonth", "month", "dayOfWeek"];
|
|
23
|
+
/**
|
|
24
|
+
* Validate a single cron field value
|
|
25
|
+
*/
|
|
26
|
+
function validateField(value, fieldName) {
|
|
27
|
+
const [min, max] = FIELD_RANGES[fieldName];
|
|
28
|
+
// Handle wildcard
|
|
29
|
+
if (value === "*") {
|
|
30
|
+
return { valid: true };
|
|
31
|
+
}
|
|
32
|
+
// Handle step values (*/n or range/n)
|
|
33
|
+
if (value.includes("/")) {
|
|
34
|
+
const [base, step] = value.split("/");
|
|
35
|
+
if (!step || isNaN(Number(step)) || Number(step) < 1) {
|
|
36
|
+
return { valid: false, error: `Invalid step value: ${step}` };
|
|
37
|
+
}
|
|
38
|
+
// Validate the base part
|
|
39
|
+
if (base !== "*") {
|
|
40
|
+
const baseResult = validateField(base, fieldName);
|
|
41
|
+
if (!baseResult.valid) {
|
|
42
|
+
return baseResult;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return { valid: true };
|
|
46
|
+
}
|
|
47
|
+
// Handle lists (1,2,3)
|
|
48
|
+
if (value.includes(",")) {
|
|
49
|
+
const parts = value.split(",");
|
|
50
|
+
for (const part of parts) {
|
|
51
|
+
const result = validateField(part.trim(), fieldName);
|
|
52
|
+
if (!result.valid) {
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return { valid: true };
|
|
57
|
+
}
|
|
58
|
+
// Handle ranges (1-5)
|
|
59
|
+
if (value.includes("-")) {
|
|
60
|
+
const [start, end] = value.split("-").map(Number);
|
|
61
|
+
if (isNaN(start) || isNaN(end)) {
|
|
62
|
+
return { valid: false, error: `Invalid range: ${value}` };
|
|
63
|
+
}
|
|
64
|
+
if (start < min || start > max || end < min || end > max) {
|
|
65
|
+
return {
|
|
66
|
+
valid: false,
|
|
67
|
+
error: `Range ${value} out of bounds (${min}-${max})`,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
if (start > end) {
|
|
71
|
+
return { valid: false, error: `Invalid range: start > end in ${value}` };
|
|
72
|
+
}
|
|
73
|
+
return { valid: true };
|
|
74
|
+
}
|
|
75
|
+
// Handle single number
|
|
76
|
+
const num = Number(value);
|
|
77
|
+
if (isNaN(num)) {
|
|
78
|
+
return { valid: false, error: `Invalid value: ${value}` };
|
|
79
|
+
}
|
|
80
|
+
if (num < min || num > max) {
|
|
81
|
+
return {
|
|
82
|
+
valid: false,
|
|
83
|
+
error: `Value ${num} out of bounds (${min}-${max})`,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
return { valid: true };
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Validate a cron expression
|
|
90
|
+
*/
|
|
91
|
+
export function validateCron(expression) {
|
|
92
|
+
if (!expression || typeof expression !== "string") {
|
|
93
|
+
return { valid: false, error: "Cron expression must be a non-empty string" };
|
|
94
|
+
}
|
|
95
|
+
const trimmed = expression.trim();
|
|
96
|
+
const fields = trimmed.split(/\s+/);
|
|
97
|
+
if (fields.length !== 5) {
|
|
98
|
+
return {
|
|
99
|
+
valid: false,
|
|
100
|
+
error: `Expected 5 fields (minute hour day month weekday), got ${fields.length}`,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
for (let i = 0; i < fields.length; i++) {
|
|
104
|
+
const result = validateField(fields[i], FIELD_NAMES[i]);
|
|
105
|
+
if (!result.valid) {
|
|
106
|
+
return {
|
|
107
|
+
valid: false,
|
|
108
|
+
error: `Invalid ${FIELD_NAMES[i]}: ${result.error}`,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return { valid: true };
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Parse a human-readable schedule hint into a cron suggestion
|
|
116
|
+
* This is best-effort for common patterns
|
|
117
|
+
*/
|
|
118
|
+
export function suggestCronFromHint(hint) {
|
|
119
|
+
const lower = hint.toLowerCase();
|
|
120
|
+
// Common patterns
|
|
121
|
+
if (lower.includes("hourly")) {
|
|
122
|
+
return "0 * * * *";
|
|
123
|
+
}
|
|
124
|
+
if (lower.includes("daily")) {
|
|
125
|
+
// Try to extract time
|
|
126
|
+
const timeMatch = lower.match(/(\d{1,2}):?(\d{2})?\s*(am|pm)?/i);
|
|
127
|
+
if (timeMatch) {
|
|
128
|
+
let hour = parseInt(timeMatch[1], 10);
|
|
129
|
+
const minute = timeMatch[2] ? parseInt(timeMatch[2], 10) : 0;
|
|
130
|
+
const meridiem = timeMatch[3]?.toLowerCase();
|
|
131
|
+
if (meridiem === "pm" && hour < 12)
|
|
132
|
+
hour += 12;
|
|
133
|
+
if (meridiem === "am" && hour === 12)
|
|
134
|
+
hour = 0;
|
|
135
|
+
return `${minute} ${hour} * * *`;
|
|
136
|
+
}
|
|
137
|
+
return "0 9 * * *"; // Default to 9 AM
|
|
138
|
+
}
|
|
139
|
+
if (lower.includes("weekly")) {
|
|
140
|
+
return "0 9 * * 1"; // Monday 9 AM
|
|
141
|
+
}
|
|
142
|
+
if (lower.includes("monthly")) {
|
|
143
|
+
return "0 9 1 * *"; // 1st of month 9 AM
|
|
144
|
+
}
|
|
145
|
+
// Try to extract "every N hours/minutes"
|
|
146
|
+
const everyMatch = lower.match(/every\s+(\d+)\s+(hour|minute|min)/i);
|
|
147
|
+
if (everyMatch) {
|
|
148
|
+
const n = parseInt(everyMatch[1], 10);
|
|
149
|
+
const unit = everyMatch[2].toLowerCase();
|
|
150
|
+
if (unit.startsWith("hour")) {
|
|
151
|
+
return `0 */${n} * * *`;
|
|
152
|
+
}
|
|
153
|
+
if (unit.startsWith("min")) {
|
|
154
|
+
return `*/${n} * * * *`;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=cron.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cron.js","sourceRoot":"","sources":["../../../src/lib/validation/cron.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH,MAAM,YAAY,GAAqC;IACrD,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;IACf,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;IACb,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;IACnB,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;IACd,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,gCAAgC;CACpD,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;AAE3E;;GAEG;AACH,SAAS,aAAa,CACpB,KAAa,EACb,SAAiB;IAEjB,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IAE3C,kBAAkB;IAClB,IAAI,KAAK,KAAK,GAAG,EAAE,CAAC;QAClB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACzB,CAAC;IAED,sCAAsC;IACtC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACtC,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,G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.js";
|
|
4
|
+
export { validatePersona } from "./persona.js";
|
|
5
|
+
export { validateCron } from "./cron.js";
|
|
6
|
+
/**
|
|
7
|
+
* Validate all workflows in a directory
|
|
8
|
+
*/
|
|
9
|
+
export declare function validateAllWorkflows(workflowsDir: string, personasDir?: string): Promise<ValidationResult[]>;
|
|
10
|
+
/**
|
|
11
|
+
* Validate all personas in a directory
|
|
12
|
+
*/
|
|
13
|
+
export declare function validateAllPersonas(personasDir: string): Promise<ValidationResult[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Validate entire .agents directory
|
|
16
|
+
*/
|
|
17
|
+
export declare function validateAll(agentsDir: string): Promise<ValidationSummary>;
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/validation/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EAElB,MAAM,YAAY,CAAC;AAIpB,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAuFzC;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,YAAY,EAAE,MAAM,EACpB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,gBAAgB,EAAE,CAAC,CA8B7B;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAc7B;AAED;;GAEG;AACH,wBAAsB,WAAW,CAC/B,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,iBAAiB,CAAC,CAyB5B"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { readdir, stat } from "node:fs/promises";
|
|
2
|
+
import { join, relative } from "node:path";
|
|
3
|
+
import { createError, } from "./types.js";
|
|
4
|
+
import { validateWorkflow, getWorkflowPersonaRef } from "./workflow.js";
|
|
5
|
+
import { validatePersona } from "./persona.js";
|
|
6
|
+
export * from "./types.js";
|
|
7
|
+
export { validateWorkflow } from "./workflow.js";
|
|
8
|
+
export { validatePersona } from "./persona.js";
|
|
9
|
+
export { validateCron } from "./cron.js";
|
|
10
|
+
const PERSONA_FILENAME = "PERSONA.md";
|
|
11
|
+
const WORKFLOW_FILENAME = "WORKFLOW.md";
|
|
12
|
+
/**
|
|
13
|
+
* Check if a directory contains a specific file
|
|
14
|
+
*/
|
|
15
|
+
async function hasFile(dirPath, filename) {
|
|
16
|
+
try {
|
|
17
|
+
const filePath = join(dirPath, filename);
|
|
18
|
+
const stats = await stat(filePath);
|
|
19
|
+
return stats.isFile();
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Recursively find all directories containing a specific file
|
|
27
|
+
*/
|
|
28
|
+
async function findDirectoriesWithFile(root, filename) {
|
|
29
|
+
const results = [];
|
|
30
|
+
async function scanDir(dir) {
|
|
31
|
+
try {
|
|
32
|
+
const entries = await readdir(dir, { withFileTypes: true });
|
|
33
|
+
for (const entry of entries) {
|
|
34
|
+
if (entry.isDirectory()) {
|
|
35
|
+
const subDir = join(dir, entry.name);
|
|
36
|
+
if (await hasFile(subDir, filename)) {
|
|
37
|
+
results.push(subDir);
|
|
38
|
+
}
|
|
39
|
+
await scanDir(subDir);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// Directory doesn't exist or not readable
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
await scanDir(root);
|
|
48
|
+
return results;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Check if a persona path exists
|
|
52
|
+
*/
|
|
53
|
+
async function personaExists(personaRef, personasDir) {
|
|
54
|
+
const personaPath = join(personasDir, personaRef);
|
|
55
|
+
return hasFile(personaPath, PERSONA_FILENAME);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Determine if a persona is a root persona (no parent with PERSONA.md)
|
|
59
|
+
*/
|
|
60
|
+
async function isRootPersona(personaPath, personasRoot) {
|
|
61
|
+
const relativePath = relative(personasRoot, personaPath);
|
|
62
|
+
const parts = relativePath.split("/").filter(Boolean);
|
|
63
|
+
// If it's directly under personasRoot, it's a root persona
|
|
64
|
+
if (parts.length <= 1) {
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
// Check if any parent directory has a PERSONA.md
|
|
68
|
+
let currentPath = personasRoot;
|
|
69
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
70
|
+
currentPath = join(currentPath, parts[i]);
|
|
71
|
+
if (await hasFile(currentPath, PERSONA_FILENAME)) {
|
|
72
|
+
return false; // Has a parent persona
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Validate all workflows in a directory
|
|
79
|
+
*/
|
|
80
|
+
export async function validateAllWorkflows(workflowsDir, personasDir) {
|
|
81
|
+
const workflowPaths = await findDirectoriesWithFile(workflowsDir, WORKFLOW_FILENAME);
|
|
82
|
+
const results = [];
|
|
83
|
+
for (const workflowPath of workflowPaths) {
|
|
84
|
+
const result = await validateWorkflow(workflowPath);
|
|
85
|
+
// Cross-validate persona reference if personasDir provided
|
|
86
|
+
if (personasDir && result.valid) {
|
|
87
|
+
const personaRef = await getWorkflowPersonaRef(workflowPath);
|
|
88
|
+
if (personaRef && !(await personaExists(personaRef, personasDir))) {
|
|
89
|
+
result.issues.push(createError("reference_not_found", "persona", `Persona '${personaRef}' not found`, `Create persona at: ${join(personasDir, personaRef, PERSONA_FILENAME)}`));
|
|
90
|
+
result.valid = false;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
results.push(result);
|
|
94
|
+
}
|
|
95
|
+
return results;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Validate all personas in a directory
|
|
99
|
+
*/
|
|
100
|
+
export async function validateAllPersonas(personasDir) {
|
|
101
|
+
const personaPaths = await findDirectoriesWithFile(personasDir, PERSONA_FILENAME);
|
|
102
|
+
const results = [];
|
|
103
|
+
for (const personaPath of personaPaths) {
|
|
104
|
+
const isRoot = await isRootPersona(personaPath, personasDir);
|
|
105
|
+
const result = await validatePersona(personaPath, isRoot);
|
|
106
|
+
results.push(result);
|
|
107
|
+
}
|
|
108
|
+
return results;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Validate entire .agents directory
|
|
112
|
+
*/
|
|
113
|
+
export async function validateAll(agentsDir) {
|
|
114
|
+
const personasDir = join(agentsDir, "personas");
|
|
115
|
+
const workflowsDir = join(agentsDir, "workflows");
|
|
116
|
+
const personaResults = await validateAllPersonas(personasDir);
|
|
117
|
+
const workflowResults = await validateAllWorkflows(workflowsDir, personasDir);
|
|
118
|
+
const validPersonas = personaResults.filter((r) => r.valid).length;
|
|
119
|
+
const validWorkflows = workflowResults.filter((r) => r.valid).length;
|
|
120
|
+
return {
|
|
121
|
+
personas: {
|
|
122
|
+
total: personaResults.length,
|
|
123
|
+
valid: validPersonas,
|
|
124
|
+
results: personaResults,
|
|
125
|
+
},
|
|
126
|
+
workflows: {
|
|
127
|
+
total: workflowResults.length,
|
|
128
|
+
valid: validWorkflows,
|
|
129
|
+
results: workflowResults,
|
|
130
|
+
},
|
|
131
|
+
valid: validPersonas === personaResults.length &&
|
|
132
|
+
validWorkflows === workflowResults.length,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/validation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAk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AC7D,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAC1D,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,SAAiB;IAEjB,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAChD,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAElD,MAAM,cAAc,GAAG,MAAM,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAC9D,MAAM,eAAe,GAAG,MAAM,oBAAoB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;IAE9E,MAAM,aAAa,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;IACnE,MAAM,cAAc,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;IAErE,OAAO;QACL,QAAQ,EAAE;YACR,KAAK,EAAE,cAAc,CAAC,MAAM;YAC5B,KAAK,EAAE,aAAa;YACpB,OAAO,EAAE,cAAc;SACxB;QACD,SAAS,EAAE;YACT,KAAK,EAAE,eAAe,CAAC,MAAM;YAC7B,KAAK,EAAE,cAAc;YACrB,OAAO,EAAE,eAAe;SACzB;QACD,KAAK,EACH,aAAa,KAAK,cAAc,CAAC,MAAM;YACvC,cAAc,KAAK,eAAe,CAAC,MAAM;KAC5C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ValidationResult } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Validate a persona file
|
|
4
|
+
*
|
|
5
|
+
* @param personaPath Path to the persona directory or PERSONA.md file
|
|
6
|
+
* @param isRootPersona Whether this is a root persona (requires cmd)
|
|
7
|
+
*/
|
|
8
|
+
export declare function validatePersona(personaPath: string, isRootPersona?: boolean): Promise<ValidationResult>;
|
|
9
|
+
//# sourceMappingURL=persona.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persona.d.ts","sourceRoot":"","sources":["../../../src/lib/validation/persona.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,gBAAgB,EAIjB,MAAM,YAAY,CAAC;AA4CpB;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,WAAW,EAAE,MAAM,EACnB,aAAa,GAAE,OAAc,GAC5B,OAAO,CAAC,gBAAgB,CAAC,CAyL3B"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { join, dirname } from "node:path";
|
|
3
|
+
import { parse as parseYaml } from "yaml";
|
|
4
|
+
import { createError, createWarning, } from "./types.js";
|
|
5
|
+
const PERSONA_FILENAME = "PERSONA.md";
|
|
6
|
+
/**
|
|
7
|
+
* Known persona frontmatter fields
|
|
8
|
+
*/
|
|
9
|
+
const KNOWN_FIELDS = new Set(["name", "description", "cmd", "env", "skills"]);
|
|
10
|
+
/**
|
|
11
|
+
* Common legacy/misnamed fields and their correct names
|
|
12
|
+
*/
|
|
13
|
+
const FIELD_SUGGESTIONS = {
|
|
14
|
+
command: "cmd",
|
|
15
|
+
commands: "cmd",
|
|
16
|
+
skill: "skills",
|
|
17
|
+
environment: "env",
|
|
18
|
+
variables: "env",
|
|
19
|
+
model: "env.CLAUDE_MODEL or similar",
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Parse frontmatter from markdown content without full validation
|
|
23
|
+
*/
|
|
24
|
+
function parseFrontmatter(content) {
|
|
25
|
+
const frontmatterRegex = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/;
|
|
26
|
+
const match = content.match(frontmatterRegex);
|
|
27
|
+
if (!match) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
const [, yamlContent, body] = match;
|
|
31
|
+
try {
|
|
32
|
+
const frontmatter = parseYaml(yamlContent);
|
|
33
|
+
return { frontmatter, body: body.trim() };
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Validate a persona file
|
|
41
|
+
*
|
|
42
|
+
* @param personaPath Path to the persona directory or PERSONA.md file
|
|
43
|
+
* @param isRootPersona Whether this is a root persona (requires cmd)
|
|
44
|
+
*/
|
|
45
|
+
export async function validatePersona(personaPath, isRootPersona = true) {
|
|
46
|
+
const filePath = personaPath.endsWith(PERSONA_FILENAME)
|
|
47
|
+
? personaPath
|
|
48
|
+
: join(personaPath, PERSONA_FILENAME);
|
|
49
|
+
const issues = [];
|
|
50
|
+
let name;
|
|
51
|
+
try {
|
|
52
|
+
const content = await readFile(filePath, "utf-8");
|
|
53
|
+
const parsed = parseFrontmatter(content);
|
|
54
|
+
if (!parsed) {
|
|
55
|
+
issues.push(createError("invalid_value", "frontmatter", "No valid YAML frontmatter found", "File must start with --- followed by YAML and another ---"));
|
|
56
|
+
return {
|
|
57
|
+
path: filePath,
|
|
58
|
+
valid: false,
|
|
59
|
+
issues,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
const { frontmatter } = parsed;
|
|
63
|
+
name = frontmatter.name;
|
|
64
|
+
// Check required fields
|
|
65
|
+
if (!frontmatter.name) {
|
|
66
|
+
issues.push(createError("missing_field", "name", "Missing required 'name' field", "Add: name: my-persona"));
|
|
67
|
+
}
|
|
68
|
+
else if (typeof frontmatter.name !== "string") {
|
|
69
|
+
issues.push(createError("invalid_type", "name", "'name' must be a string"));
|
|
70
|
+
}
|
|
71
|
+
// cmd is required for root personas, optional for child personas (inherited)
|
|
72
|
+
if (isRootPersona && !frontmatter.cmd) {
|
|
73
|
+
issues.push(createError("missing_field", "cmd", "Missing required 'cmd' field for root persona", "Add: cmd: \"claude --print\" or cmd: [\"claude --print\", \"claude -p\"]"));
|
|
74
|
+
}
|
|
75
|
+
// Validate cmd type if present
|
|
76
|
+
if (frontmatter.cmd !== undefined) {
|
|
77
|
+
if (typeof frontmatter.cmd !== "string" &&
|
|
78
|
+
!Array.isArray(frontmatter.cmd)) {
|
|
79
|
+
issues.push(createError("invalid_type", "cmd", "'cmd' must be a string or array of strings", "Use: cmd: \"claude --print\" or cmd: [\"claude --print\"]"));
|
|
80
|
+
}
|
|
81
|
+
else if (Array.isArray(frontmatter.cmd)) {
|
|
82
|
+
frontmatter.cmd.forEach((c, index) => {
|
|
83
|
+
if (typeof c !== "string") {
|
|
84
|
+
issues.push(createError("invalid_type", `cmd[${index}]`, "Command must be a string"));
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// Validate env if present
|
|
90
|
+
if (frontmatter.env !== undefined) {
|
|
91
|
+
if (typeof frontmatter.env !== "object" ||
|
|
92
|
+
Array.isArray(frontmatter.env) ||
|
|
93
|
+
frontmatter.env === null) {
|
|
94
|
+
issues.push(createError("invalid_type", "env", "'env' must be an object", "Use: env: { CLAUDE_MODEL: 'sonnet' }"));
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
// Check that all env values are strings
|
|
98
|
+
const env = frontmatter.env;
|
|
99
|
+
for (const [key, value] of Object.entries(env)) {
|
|
100
|
+
if (typeof value !== "string") {
|
|
101
|
+
issues.push(createWarning("unknown_field", `env.${key}`, `Environment variable '${key}' should be a string, got ${typeof value}`, "Convert to string or use ${VAR} expansion"));
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
// Validate skills if present
|
|
107
|
+
if (frontmatter.skills !== undefined) {
|
|
108
|
+
if (!Array.isArray(frontmatter.skills)) {
|
|
109
|
+
issues.push(createError("invalid_type", "skills", "'skills' must be an array of glob patterns", "Use: skills: [\"productivity/**\", \"!experimental/*\"]"));
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
frontmatter.skills.forEach((skill, index) => {
|
|
113
|
+
if (typeof skill !== "string") {
|
|
114
|
+
issues.push(createError("invalid_type", `skills[${index}]`, "Skill pattern must be a string"));
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// Check for unknown/legacy fields
|
|
120
|
+
for (const key of Object.keys(frontmatter)) {
|
|
121
|
+
if (!KNOWN_FIELDS.has(key)) {
|
|
122
|
+
const suggestion = FIELD_SUGGESTIONS[key];
|
|
123
|
+
if (suggestion) {
|
|
124
|
+
issues.push(createWarning("unknown_field", key, `Unknown field '${key}'`, `Did you mean '${suggestion}'?`));
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
issues.push(createWarning("unknown_field", key, `Unknown field '${key}'`));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
issues.push(createError("invalid_value", "file", `Failed to read persona: ${error.message}`));
|
|
134
|
+
}
|
|
135
|
+
const hasErrors = issues.some((i) => i.severity === "error");
|
|
136
|
+
return {
|
|
137
|
+
path: dirname(filePath),
|
|
138
|
+
name,
|
|
139
|
+
valid: !hasErrors,
|
|
140
|
+
issues,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=persona.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persona.js","sourceRoot":"","sources":["../../../src/lib/validation/persona.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAGL,WAAW,EACX,aAA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,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC;IAE7D,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC;QACvB,IAAI;QACJ,KAAK,EAAE,CAAC,SAAS;QACjB,MAAM;KACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Severity levels for validation issues
|
|
3
|
+
*/
|
|
4
|
+
export type ValidationSeverity = "error" | "warning";
|
|
5
|
+
/**
|
|
6
|
+
* Types of validation errors
|
|
7
|
+
*/
|
|
8
|
+
export type ValidationErrorType = "missing_field" | "invalid_type" | "invalid_value" | "reference_not_found";
|
|
9
|
+
/**
|
|
10
|
+
* Types of validation warnings
|
|
11
|
+
*/
|
|
12
|
+
export type ValidationWarningType = "unknown_field" | "deprecated_field";
|
|
13
|
+
/**
|
|
14
|
+
* A validation issue (error or warning)
|
|
15
|
+
*/
|
|
16
|
+
export interface ValidationIssue {
|
|
17
|
+
severity: ValidationSeverity;
|
|
18
|
+
type: ValidationErrorType | ValidationWarningType;
|
|
19
|
+
/** Path to the problematic field (e.g., "on.schedule[0].cron") */
|
|
20
|
+
path: string;
|
|
21
|
+
/** Human-readable error message */
|
|
22
|
+
message: string;
|
|
23
|
+
/** Suggestion for how to fix the issue */
|
|
24
|
+
suggestion?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Result of validating a single resource
|
|
28
|
+
*/
|
|
29
|
+
export interface ValidationResult {
|
|
30
|
+
/** Path to the resource */
|
|
31
|
+
path: string;
|
|
32
|
+
/** Resource name (if available) */
|
|
33
|
+
name?: string;
|
|
34
|
+
/** Whether the resource is valid (no errors, warnings are ok) */
|
|
35
|
+
valid: boolean;
|
|
36
|
+
/** All issues found */
|
|
37
|
+
issues: ValidationIssue[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Summary of validation across multiple resources
|
|
41
|
+
*/
|
|
42
|
+
export interface ValidationSummary {
|
|
43
|
+
workflows: {
|
|
44
|
+
total: number;
|
|
45
|
+
valid: number;
|
|
46
|
+
results: ValidationResult[];
|
|
47
|
+
};
|
|
48
|
+
personas: {
|
|
49
|
+
total: number;
|
|
50
|
+
valid: number;
|
|
51
|
+
results: ValidationResult[];
|
|
52
|
+
};
|
|
53
|
+
/** Overall validity (all resources valid) */
|
|
54
|
+
valid: boolean;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Helper to create an error issue
|
|
58
|
+
*/
|
|
59
|
+
export declare function createError(type: ValidationErrorType, path: string, message: string, suggestion?: string): ValidationIssue;
|
|
60
|
+
/**
|
|
61
|
+
* Helper to create a warning issue
|
|
62
|
+
*/
|
|
63
|
+
export declare function createWarning(type: ValidationWarningType, path: string, message: string, suggestion?: string): ValidationIssue;
|
|
64
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/validation/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAC3B,eAAe,GACf,cAAc,GACd,eAAe,GACf,qBAAqB,CAAC;AAE1B;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,eAAe,GAAG,kBAAkB,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,IAAI,EAAE,mBAAmB,GAAG,qBAAqB,CAAC;IAClD,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,KAAK,EAAE,OAAO,CAAC;IACf,uBAAuB;IACvB,MAAM,EAAE,eAAe,EAAE,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE;QACT,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,gBAAgB,EAAE,CAAC;KAC7B,CAAC;IACF,QAAQ,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,gBAAgB,EAAE,CAAC;KAC7B,CAAC;IACF,6CAA6C;IAC7C,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,mBAAmB,EACzB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,MAAM,GAClB,eAAe,CAQjB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,qBAAqB,EAC3B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,MAAM,GAClB,eAAe,CAQjB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper to create an error issue
|
|
3
|
+
*/
|
|
4
|
+
export function createError(type, path, message, suggestion) {
|
|
5
|
+
return {
|
|
6
|
+
severity: "error",
|
|
7
|
+
type,
|
|
8
|
+
path,
|
|
9
|
+
message,
|
|
10
|
+
suggestion,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Helper to create a warning issue
|
|
15
|
+
*/
|
|
16
|
+
export function createWarning(type, path, message, suggestion) {
|
|
17
|
+
return {
|
|
18
|
+
severity: "warning",
|
|
19
|
+
type,
|
|
20
|
+
path,
|
|
21
|
+
message,
|
|
22
|
+
suggestion,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/lib/validation/types.ts"],"names":[],"mappings":"AAiEA;;GAEG;AACH,MAAM,UAAU,WAAW,CACzB,IAAyB,EACzB,IAAY,EACZ,OAAe,EACf,UAAmB;IAEnB,OAAO;QACL,QAAQ,EAAE,OAAO;QACjB,IAAI;QACJ,IAAI;QACJ,OAAO;QACP,UAAU;KACX,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAC3B,IAA2B,EAC3B,IAAY,EACZ,OAAe,EACf,UAAmB;IAEnB,OAAO;QACL,QAAQ,EAAE,SAAS;QACnB,IAAI;QACJ,IAAI;QACJ,OAAO;QACP,UAAU;KACX,CAAC;AACJ,CAAC"}
|