ahead-pi 0.1.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 +112 -0
- package/dist/ahead_wasm.wasm +0 -0
- package/generated/product-change/ai-audit.md +33 -0
- package/generated/product-change/ai-review.md +33 -0
- package/generated/product-change/decision.md +33 -0
- package/generated/product-change/define.md +33 -0
- package/generated/product-change/deploy.md +33 -0
- package/generated/product-change/human-review.md +33 -0
- package/generated/product-change/implement.md +35 -0
- package/generated/product-change/manifest.json +24 -0
- package/generated/product-change/options.md +35 -0
- package/generated/product-change/outcome.md +33 -0
- package/generated/product-change/plan.md +35 -0
- package/generated/product-change/questions.md +34 -0
- package/generated/product-change/research.md +33 -0
- package/generated/product-change/verify.md +33 -0
- package/package.json +60 -0
- package/src/engine.ts +112 -0
- package/src/index.ts +463 -0
- package/src/storage.ts +112 -0
- package/src/types.ts +99 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
export type ActorKind = "human" | "ai" | "system";
|
|
2
|
+
export type ActorRule = "human" | "ai" | "any";
|
|
3
|
+
export type Capability = "inspect" | "search" | "analyze" | "modify" | "execute" | "record";
|
|
4
|
+
|
|
5
|
+
export interface Actor {
|
|
6
|
+
kind: ActorKind;
|
|
7
|
+
identity: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface ArtifactDefinition {
|
|
11
|
+
kind: string;
|
|
12
|
+
title: string;
|
|
13
|
+
actor: ActorRule;
|
|
14
|
+
required: boolean;
|
|
15
|
+
independent_of?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface PhaseDefinition {
|
|
19
|
+
id: string;
|
|
20
|
+
title: string;
|
|
21
|
+
owner: ActorKind;
|
|
22
|
+
artifacts: ArtifactDefinition[];
|
|
23
|
+
gate: { id: string; title: string; accepted_by_artifact?: string };
|
|
24
|
+
next: string | null;
|
|
25
|
+
returns_to: string[];
|
|
26
|
+
ai_unlock_artifacts: string[];
|
|
27
|
+
ai_capabilities: Capability[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface WorkflowDefinition {
|
|
31
|
+
id: string;
|
|
32
|
+
version: string;
|
|
33
|
+
title: string;
|
|
34
|
+
initial_phase: string;
|
|
35
|
+
phases: PhaseDefinition[];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface Event {
|
|
39
|
+
sequence: number;
|
|
40
|
+
timestamp: string;
|
|
41
|
+
actor: Actor;
|
|
42
|
+
type: "run_started" | "artifact_recorded" | "gate_accepted" | "phase_transitioned" | "run_closed";
|
|
43
|
+
phase?: string;
|
|
44
|
+
kind?: string;
|
|
45
|
+
path?: string;
|
|
46
|
+
gate?: string;
|
|
47
|
+
from?: string;
|
|
48
|
+
to?: string;
|
|
49
|
+
direction?: "advance" | "return";
|
|
50
|
+
reason?: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface Run {
|
|
54
|
+
api_version: string;
|
|
55
|
+
id: string;
|
|
56
|
+
title: string;
|
|
57
|
+
workflow_id: string;
|
|
58
|
+
workflow_version: string;
|
|
59
|
+
owner: string;
|
|
60
|
+
events: Event[];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface ArtifactState extends ArtifactDefinition {
|
|
64
|
+
present: boolean;
|
|
65
|
+
path: string | null;
|
|
66
|
+
recorded_by: Actor | null;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface RunState {
|
|
70
|
+
run_id: string;
|
|
71
|
+
title: string;
|
|
72
|
+
workflow_id: string;
|
|
73
|
+
workflow_version: string;
|
|
74
|
+
phase: { id: string; title: string; visit: number; next: string | null };
|
|
75
|
+
artifacts: ArtifactState[];
|
|
76
|
+
gate: { id: string; title: string; accepted: boolean; accepted_by: Actor | null };
|
|
77
|
+
blockers: string[];
|
|
78
|
+
allowed_ai_capabilities: Capability[];
|
|
79
|
+
return_targets: string[];
|
|
80
|
+
can_advance: boolean;
|
|
81
|
+
closed: boolean;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface EngineErrorShape {
|
|
85
|
+
code: string;
|
|
86
|
+
message: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export type EventAction =
|
|
90
|
+
| { type: "artifact_recorded"; phase: string; kind: string; path: string }
|
|
91
|
+
| { type: "gate_accepted"; phase: string; gate: string }
|
|
92
|
+
| {
|
|
93
|
+
type: "phase_transitioned";
|
|
94
|
+
from: string;
|
|
95
|
+
to: string;
|
|
96
|
+
direction: "advance" | "return";
|
|
97
|
+
reason?: string;
|
|
98
|
+
}
|
|
99
|
+
| { type: "run_closed"; phase: string };
|