dot-agents 0.2.0 → 0.3.1
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/commands/list.d.ts.map +1 -1
- package/dist/cli/commands/list.js +21 -7
- package/dist/cli/commands/list.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
|
@@ -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,aAAa,GACd,MAAM,YAAY,CAAC;AAEpB,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAEtC;;GAEG;AACH,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AAE9E;;GAEG;AACH,MAAM,iBAAiB,GAA2B;IAChD,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,KAAK;IAClB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,6BAA6B;CACrC,CAAC;AAEF;;GAEG;AACH,SAAS,gBAAgB,CAAC,OAAe;IAIvC,MAAM,gBAAgB,GAAG,6CAA6C,CAAC;IACvE,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAE9C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC;IACpC,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,SAAS,CAAC,WAAW,CAA4B,CAAC;QACtE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;IAC5C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;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,CAChC,CACF,CAAC;gBACJ,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,IAAI,CACT,aAAa,CAAC,eAAe,EAAE,GAAG,EAAE,kBAAkB,GAAG,GAAG,CAAC,CAC9D,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,IAAI,CACT,WAAW,CACT,eAAe,EACf,MAAM,EACN,2BAA4B,KAAe,CAAC,OAAO,EAAE,CACtD,CACF,CAAC;IACJ,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;AAE1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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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ValidationResult } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Validate a workflow file
|
|
4
|
+
*/
|
|
5
|
+
export declare function validateWorkflow(workflowPath: string): Promise<ValidationResult>;
|
|
6
|
+
/**
|
|
7
|
+
* Get the persona referenced by a workflow (for cross-validation)
|
|
8
|
+
*/
|
|
9
|
+
export declare function getWorkflowPersonaRef(workflowPath: string): Promise<string | null>;
|
|
10
|
+
//# sourceMappingURL=workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../../src/lib/validation/workflow.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,gBAAgB,EAIjB,MAAM,YAAY,CAAC;AAgMpB;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,gBAAgB,CAAC,CAyM3B;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAexB"}
|
|
@@ -0,0 +1,242 @@
|
|
|
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
|
+
import { validateCron, suggestCronFromHint } from "./cron.js";
|
|
6
|
+
const WORKFLOW_FILENAME = "WORKFLOW.md";
|
|
7
|
+
/**
|
|
8
|
+
* Known workflow frontmatter fields
|
|
9
|
+
*/
|
|
10
|
+
const KNOWN_FIELDS = new Set([
|
|
11
|
+
"name",
|
|
12
|
+
"description",
|
|
13
|
+
"persona",
|
|
14
|
+
"on",
|
|
15
|
+
"inputs",
|
|
16
|
+
"outputs",
|
|
17
|
+
"env",
|
|
18
|
+
"timeout",
|
|
19
|
+
"retry",
|
|
20
|
+
"working_dir",
|
|
21
|
+
]);
|
|
22
|
+
/**
|
|
23
|
+
* Common legacy/misnamed fields and their correct names
|
|
24
|
+
*/
|
|
25
|
+
const FIELD_SUGGESTIONS = {
|
|
26
|
+
goal: "description",
|
|
27
|
+
skills_used: "persona (skills belong in the persona definition)",
|
|
28
|
+
skills: "persona (skills belong in the persona definition)",
|
|
29
|
+
schedule: "on.schedule",
|
|
30
|
+
trigger: "on",
|
|
31
|
+
triggers: "on",
|
|
32
|
+
command: "persona (command belongs in the persona definition)",
|
|
33
|
+
cmd: "persona (command belongs in the persona definition)",
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Parse frontmatter from markdown content without full validation
|
|
37
|
+
*/
|
|
38
|
+
function parseFrontmatter(content) {
|
|
39
|
+
const frontmatterRegex = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/;
|
|
40
|
+
const match = content.match(frontmatterRegex);
|
|
41
|
+
if (!match) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
const [, yamlContent, body] = match;
|
|
45
|
+
try {
|
|
46
|
+
const frontmatter = parseYaml(yamlContent);
|
|
47
|
+
return { frontmatter, body: body.trim() };
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Validate the 'on' trigger configuration
|
|
55
|
+
*/
|
|
56
|
+
function validateTriggers(on, issues) {
|
|
57
|
+
if (on === undefined || on === null) {
|
|
58
|
+
return; // 'on' is optional
|
|
59
|
+
}
|
|
60
|
+
if (typeof on !== "object" || Array.isArray(on)) {
|
|
61
|
+
issues.push(createError("invalid_type", "on", "'on' must be an object with trigger configurations", "Example: on: { manual: true, schedule: [{cron: '0 9 * * *'}] }"));
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const triggers = on;
|
|
65
|
+
// Validate schedule
|
|
66
|
+
if (triggers.schedule !== undefined) {
|
|
67
|
+
if (typeof triggers.schedule === "string") {
|
|
68
|
+
// Common mistake: using a string instead of array
|
|
69
|
+
const hint = suggestCronFromHint(triggers.schedule);
|
|
70
|
+
issues.push(createError("invalid_type", "on.schedule", "'schedule' must be an array of {cron: string} objects, got string", hint
|
|
71
|
+
? `Use: schedule: [{ cron: "${hint}" }]`
|
|
72
|
+
: "Use: schedule: [{ cron: \"0 9 * * *\" }]"));
|
|
73
|
+
}
|
|
74
|
+
else if (!Array.isArray(triggers.schedule)) {
|
|
75
|
+
issues.push(createError("invalid_type", "on.schedule", "'schedule' must be an array", "Use: schedule: [{ cron: \"0 9 * * *\" }]"));
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
// Validate each schedule entry
|
|
79
|
+
triggers.schedule.forEach((entry, index) => {
|
|
80
|
+
if (typeof entry !== "object" || entry === null) {
|
|
81
|
+
issues.push(createError("invalid_type", `on.schedule[${index}]`, "Schedule entry must be an object with 'cron' field", "Use: { cron: \"0 9 * * *\" }"));
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const scheduleEntry = entry;
|
|
85
|
+
if (typeof scheduleEntry.cron !== "string") {
|
|
86
|
+
issues.push(createError("missing_field", `on.schedule[${index}].cron`, "Schedule entry missing required 'cron' field", "Add: cron: \"0 9 * * *\""));
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
// Validate cron expression
|
|
90
|
+
const cronResult = validateCron(scheduleEntry.cron);
|
|
91
|
+
if (!cronResult.valid) {
|
|
92
|
+
issues.push(createError("invalid_value", `on.schedule[${index}].cron`, `Invalid cron expression: ${cronResult.error}`, "Format: minute hour day-of-month month day-of-week (e.g., \"30 9 * * 1-5\")"));
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// Validate manual trigger
|
|
98
|
+
if (triggers.manual !== undefined) {
|
|
99
|
+
if (typeof triggers.manual !== "boolean" &&
|
|
100
|
+
typeof triggers.manual !== "object") {
|
|
101
|
+
issues.push(createError("invalid_type", "on.manual", "'manual' must be true/false or an object with input overrides", "Use: manual: true"));
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// Check for unknown trigger types
|
|
105
|
+
const knownTriggers = new Set([
|
|
106
|
+
"schedule",
|
|
107
|
+
"manual",
|
|
108
|
+
"file_change",
|
|
109
|
+
"webhook",
|
|
110
|
+
"workflow_complete",
|
|
111
|
+
"git",
|
|
112
|
+
"github",
|
|
113
|
+
]);
|
|
114
|
+
for (const key of Object.keys(triggers)) {
|
|
115
|
+
if (!knownTriggers.has(key)) {
|
|
116
|
+
issues.push(createWarning("unknown_field", `on.${key}`, `Unknown trigger type '${key}'`, `Known triggers: ${Array.from(knownTriggers).join(", ")}`));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Validate a workflow file
|
|
122
|
+
*/
|
|
123
|
+
export async function validateWorkflow(workflowPath) {
|
|
124
|
+
const filePath = workflowPath.endsWith(WORKFLOW_FILENAME)
|
|
125
|
+
? workflowPath
|
|
126
|
+
: join(workflowPath, WORKFLOW_FILENAME);
|
|
127
|
+
const issues = [];
|
|
128
|
+
let name;
|
|
129
|
+
try {
|
|
130
|
+
const content = await readFile(filePath, "utf-8");
|
|
131
|
+
const parsed = parseFrontmatter(content);
|
|
132
|
+
if (!parsed) {
|
|
133
|
+
issues.push(createError("invalid_value", "frontmatter", "No valid YAML frontmatter found", "File must start with --- followed by YAML and another ---"));
|
|
134
|
+
return {
|
|
135
|
+
path: filePath,
|
|
136
|
+
valid: false,
|
|
137
|
+
issues,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
const { frontmatter, body } = parsed;
|
|
141
|
+
name = frontmatter.name;
|
|
142
|
+
// Check required fields
|
|
143
|
+
if (!frontmatter.name) {
|
|
144
|
+
issues.push(createError("missing_field", "name", "Missing required 'name' field", "Add: name: my-workflow"));
|
|
145
|
+
}
|
|
146
|
+
else if (typeof frontmatter.name !== "string") {
|
|
147
|
+
issues.push(createError("invalid_type", "name", "'name' must be a string"));
|
|
148
|
+
}
|
|
149
|
+
if (!frontmatter.description) {
|
|
150
|
+
// Check if they used 'goal' instead
|
|
151
|
+
if (frontmatter.goal) {
|
|
152
|
+
issues.push(createError("missing_field", "description", "Missing required 'description' field", "Rename 'goal' to 'description'"));
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
issues.push(createError("missing_field", "description", "Missing required 'description' field", "Add: description: What this workflow does"));
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
else if (typeof frontmatter.description !== "string") {
|
|
159
|
+
issues.push(createError("invalid_type", "description", "'description' must be a string"));
|
|
160
|
+
}
|
|
161
|
+
if (!frontmatter.persona) {
|
|
162
|
+
issues.push(createError("missing_field", "persona", "Missing required 'persona' field", "Add: persona: claude"));
|
|
163
|
+
}
|
|
164
|
+
else if (typeof frontmatter.persona !== "string") {
|
|
165
|
+
issues.push(createError("invalid_type", "persona", "'persona' must be a string"));
|
|
166
|
+
}
|
|
167
|
+
// Check for task body
|
|
168
|
+
if (!body) {
|
|
169
|
+
issues.push(createError("missing_field", "body", "Missing task body after frontmatter", "Add the task/prompt content after the --- delimiter"));
|
|
170
|
+
}
|
|
171
|
+
// Validate triggers
|
|
172
|
+
validateTriggers(frontmatter.on, issues);
|
|
173
|
+
// Check for unknown/legacy fields
|
|
174
|
+
for (const key of Object.keys(frontmatter)) {
|
|
175
|
+
if (!KNOWN_FIELDS.has(key)) {
|
|
176
|
+
const suggestion = FIELD_SUGGESTIONS[key];
|
|
177
|
+
if (suggestion) {
|
|
178
|
+
issues.push(createWarning("unknown_field", key, `Unknown field '${key}'`, `Did you mean '${suggestion}'?`));
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
issues.push(createWarning("unknown_field", key, `Unknown field '${key}'`));
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
// Validate inputs if present
|
|
186
|
+
if (frontmatter.inputs !== undefined) {
|
|
187
|
+
if (!Array.isArray(frontmatter.inputs)) {
|
|
188
|
+
issues.push(createError("invalid_type", "inputs", "'inputs' must be an array", "Use: inputs: [{ name: 'myInput', type: 'string' }]"));
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
frontmatter.inputs.forEach((input, index) => {
|
|
192
|
+
if (typeof input !== "object" || input === null) {
|
|
193
|
+
issues.push(createError("invalid_type", `inputs[${index}]`, "Input definition must be an object"));
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
const inputDef = input;
|
|
197
|
+
if (!inputDef.name || typeof inputDef.name !== "string") {
|
|
198
|
+
issues.push(createError("missing_field", `inputs[${index}].name`, "Input definition missing required 'name' field"));
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
// Validate env if present
|
|
204
|
+
if (frontmatter.env !== undefined) {
|
|
205
|
+
if (typeof frontmatter.env !== "object" ||
|
|
206
|
+
Array.isArray(frontmatter.env) ||
|
|
207
|
+
frontmatter.env === null) {
|
|
208
|
+
issues.push(createError("invalid_type", "env", "'env' must be an object", "Use: env: { KEY: 'value' }"));
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
catch (error) {
|
|
213
|
+
issues.push(createError("invalid_value", "file", `Failed to read workflow: ${error.message}`));
|
|
214
|
+
}
|
|
215
|
+
const hasErrors = issues.some((i) => i.severity === "error");
|
|
216
|
+
return {
|
|
217
|
+
path: dirname(filePath),
|
|
218
|
+
name,
|
|
219
|
+
valid: !hasErrors,
|
|
220
|
+
issues,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Get the persona referenced by a workflow (for cross-validation)
|
|
225
|
+
*/
|
|
226
|
+
export async function getWorkflowPersonaRef(workflowPath) {
|
|
227
|
+
const filePath = workflowPath.endsWith(WORKFLOW_FILENAME)
|
|
228
|
+
? workflowPath
|
|
229
|
+
: join(workflowPath, WORKFLOW_FILENAME);
|
|
230
|
+
try {
|
|
231
|
+
const content = await readFile(filePath, "utf-8");
|
|
232
|
+
const parsed = parseFrontmatter(content);
|
|
233
|
+
if (parsed && typeof parsed.frontmatter.persona === "string") {
|
|
234
|
+
return parsed.frontmatter.persona;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
catch {
|
|
238
|
+
// Ignore errors
|
|
239
|
+
}
|
|
240
|
+
return null;
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../../src/lib/validation/workflow.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,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAE9D,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAExC;;GAEG;AACH,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC;IAC3B,MAAM;IACN,aAAa;IACb,SAAS;IACT,IAAI;IACJ,QAAQ;IACR,SAAS;IACT,KAAK;IACL,SAAS;IACT,OAAO;IACP,aAAa;CACd,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,iBAAiB,GAA2B;IAChD,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,mDAAmD;IAChE,MAAM,EAAE,mDAAmD;IAC3D,QAAQ,EAAE,aAAa;IACvB,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,qDAAqD;IAC9D,GAAG,EAAE,qDAAqD;CAC3D,CAAC;AAEF;;GAEG;AACH,SAAS,gBAAgB,CAAC,OAAe;IAIvC,MAAM,gBAAgB,GAAG,6CAA6C,CAAC;IACvE,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAE9C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,GAAG,KAAK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