@evo-dev/core 0.0.1-alpha
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/assets/agents/review/code-reviewer/examples.md +19 -0
- package/assets/agents/review/code-reviewer/manifest.json +10 -0
- package/assets/agents/review/code-reviewer/prompt.md +59 -0
- package/assets/agents/review/code-reviewer/verification.md +11 -0
- package/assets/skills/coding/engineering-discipline/SKILL.md +63 -0
- package/assets/skills/coding/engineering-discipline/anti-patterns.md +21 -0
- package/assets/skills/coding/engineering-discipline/examples.md +19 -0
- package/assets/skills/coding/engineering-discipline/manifest.json +10 -0
- package/assets/skills/coding/engineering-discipline/verification.md +11 -0
- package/assets/workflows/rd-bug-fix/WORKFLOW.json +45 -0
- package/assets/workflows/rd-code-review/WORKFLOW.json +45 -0
- package/assets/workflows/rd-docs-update/WORKFLOW.json +45 -0
- package/assets/workflows/rd-feature-implementation/WORKFLOW.json +45 -0
- package/assets/workflows/rd-refactor/WORKFLOW.json +45 -0
- package/assets/workflows/rd-release-readiness/WORKFLOW.json +49 -0
- package/assets/workflows/rd-security-boundary-review/WORKFLOW.json +45 -0
- package/assets/workflows/rd-test-generation/WORKFLOW.json +45 -0
- package/dist/assets/index.js +209 -0
- package/dist/config/index.js +601 -0
- package/dist/index.js +4879 -0
- package/dist/plugins/index.js +265 -0
- package/package.json +30 -0
- package/src/.gitkeep +0 -0
- package/src/agents/index.ts +561 -0
- package/src/assets/errors.ts +21 -0
- package/src/assets/index.ts +18 -0
- package/src/assets/manifest.ts +109 -0
- package/src/assets/scanner.ts +189 -0
- package/src/config/errors.ts +21 -0
- package/src/config/index.ts +26 -0
- package/src/config/paths.ts +43 -0
- package/src/config/registry.ts +84 -0
- package/src/config/settings.ts +212 -0
- package/src/config/state.ts +130 -0
- package/src/config/store.ts +166 -0
- package/src/daemon/index.ts +414 -0
- package/src/hooks/index.ts +1023 -0
- package/src/index.ts +14 -0
- package/src/learning/index.ts +714 -0
- package/src/observability/index.ts +272 -0
- package/src/pack/index.ts +779 -0
- package/src/plugins/capabilities.ts +347 -0
- package/src/plugins/index.ts +41 -0
- package/src/plugins/registry.ts +60 -0
- package/src/plugins/types.ts +123 -0
- package/src/project/index.ts +507 -0
- package/src/protected-zones/index.ts +137 -0
- package/src/sync/index.ts +7 -0
- package/src/sync/orchestrator.ts +298 -0
- package/src/task/index.ts +840 -0
- package/src/workflow/index.ts +137 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { readFile, readdir } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import type { TaskContract } from "../task/index.ts";
|
|
4
|
+
|
|
5
|
+
export type WorkflowMode = "minimal" | "standard" | "rigorous";
|
|
6
|
+
|
|
7
|
+
export interface WorkflowManifest {
|
|
8
|
+
id: string;
|
|
9
|
+
version: string;
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
modes: WorkflowMode[];
|
|
13
|
+
steps: WorkflowStep[];
|
|
14
|
+
requiredEvidence: string[];
|
|
15
|
+
verification: {
|
|
16
|
+
policy: "fail-closed";
|
|
17
|
+
antiCriteria: string[];
|
|
18
|
+
};
|
|
19
|
+
privacy: {
|
|
20
|
+
metadataOnly: true;
|
|
21
|
+
storesRawPrompts: false;
|
|
22
|
+
storesSourceContent: false;
|
|
23
|
+
storesRawCommandOutput: false;
|
|
24
|
+
usesNetwork: false;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface WorkflowStep {
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
actor: "human" | "agent" | "tool" | "reviewer";
|
|
32
|
+
required: boolean;
|
|
33
|
+
evidence: string[];
|
|
34
|
+
summary: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface WorkflowPlan {
|
|
38
|
+
workflow: WorkflowManifest;
|
|
39
|
+
taskId?: string;
|
|
40
|
+
mode: WorkflowMode | null;
|
|
41
|
+
steps: Array<WorkflowStep & { plannedOnly: true }>;
|
|
42
|
+
requiredEvidence: string[];
|
|
43
|
+
warnings: string[];
|
|
44
|
+
blockers: string[];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export async function scanWorkflowManifests(workflowsDir: string): Promise<WorkflowManifest[]> {
|
|
48
|
+
const manifests: WorkflowManifest[] = [];
|
|
49
|
+
const entries = await readdir(workflowsDir, { withFileTypes: true });
|
|
50
|
+
|
|
51
|
+
for (const entry of entries) {
|
|
52
|
+
if (!entry.isDirectory()) continue;
|
|
53
|
+
const manifestPath = join(workflowsDir, entry.name, "WORKFLOW.json");
|
|
54
|
+
manifests.push(parseWorkflowManifest(JSON.parse(await readFile(manifestPath, "utf8"))));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return manifests.sort((left, right) => left.id.localeCompare(right.id));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function parseWorkflowManifest(value: unknown): WorkflowManifest {
|
|
61
|
+
if (!isRecord(value)) throw new Error("Workflow manifest must be an object.");
|
|
62
|
+
const manifest = value as unknown as WorkflowManifest;
|
|
63
|
+
if (typeof manifest.id !== "string" || typeof manifest.version !== "string") {
|
|
64
|
+
throw new Error("Workflow manifest missing id/version.");
|
|
65
|
+
}
|
|
66
|
+
if (!Array.isArray(manifest.modes) || !Array.isArray(manifest.steps)) {
|
|
67
|
+
throw new Error(`Workflow manifest ${manifest.id} missing modes/steps.`);
|
|
68
|
+
}
|
|
69
|
+
if (
|
|
70
|
+
manifest.privacy?.metadataOnly !== true ||
|
|
71
|
+
manifest.privacy.usesNetwork !== false ||
|
|
72
|
+
manifest.privacy.storesRawPrompts !== false ||
|
|
73
|
+
manifest.privacy.storesSourceContent !== false ||
|
|
74
|
+
manifest.privacy.storesRawCommandOutput !== false
|
|
75
|
+
) {
|
|
76
|
+
throw new Error(`Workflow manifest ${manifest.id} violates privacy requirements.`);
|
|
77
|
+
}
|
|
78
|
+
return manifest;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function planWorkflow(input: {
|
|
82
|
+
workflow: WorkflowManifest;
|
|
83
|
+
contract?: TaskContract;
|
|
84
|
+
}): WorkflowPlan {
|
|
85
|
+
const mode = input.contract?.route.mode ?? null;
|
|
86
|
+
const warnings: string[] = [];
|
|
87
|
+
const blockers: string[] = [];
|
|
88
|
+
|
|
89
|
+
if (mode !== null && !input.workflow.modes.includes(mode)) {
|
|
90
|
+
blockers.push(`Workflow ${input.workflow.id} does not support task mode ${mode}.`);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
workflow: input.workflow,
|
|
95
|
+
taskId: input.contract?.taskId,
|
|
96
|
+
mode,
|
|
97
|
+
steps: input.workflow.steps.map((step) => ({ ...step, plannedOnly: true })),
|
|
98
|
+
requiredEvidence: input.workflow.requiredEvidence,
|
|
99
|
+
warnings,
|
|
100
|
+
blockers,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function formatWorkflowList(manifests: WorkflowManifest[]): string {
|
|
105
|
+
return [
|
|
106
|
+
"EvoDev workflows",
|
|
107
|
+
"",
|
|
108
|
+
...manifests.map(
|
|
109
|
+
(workflow) => `- ${workflow.id} (${workflow.modes.join(", ")}): ${workflow.description}`,
|
|
110
|
+
),
|
|
111
|
+
].join("\n");
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export function formatWorkflowPlan(plan: WorkflowPlan): string {
|
|
115
|
+
return [
|
|
116
|
+
"EvoDev workflow dry-run",
|
|
117
|
+
"",
|
|
118
|
+
`Workflow: ${plan.workflow.id}`,
|
|
119
|
+
`Task: ${plan.taskId ?? "none"}`,
|
|
120
|
+
`Mode: ${plan.mode ?? "not routed"}`,
|
|
121
|
+
"",
|
|
122
|
+
"Steps:",
|
|
123
|
+
...plan.steps.map(
|
|
124
|
+
(step) =>
|
|
125
|
+
` - ${step.id}: ${step.name} [${step.actor}] evidence=${step.evidence.join(",") || "none"}`,
|
|
126
|
+
),
|
|
127
|
+
"",
|
|
128
|
+
"Required evidence:",
|
|
129
|
+
...plan.requiredEvidence.map((item) => ` - ${item}`),
|
|
130
|
+
...plan.warnings.map((warning) => `Warning: ${warning}`),
|
|
131
|
+
...plan.blockers.map((blocker) => `Blocker: ${blocker}`),
|
|
132
|
+
].join("\n");
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
136
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
137
|
+
}
|