@cleocode/contracts 2.0.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/dist/adapter.d.ts +36 -0
- package/dist/adapter.d.ts.map +1 -0
- package/dist/adapter.js +8 -0
- package/dist/adapter.js.map +1 -0
- package/dist/archive.d.ts +100 -0
- package/dist/archive.d.ts.map +1 -0
- package/dist/archive.js +7 -0
- package/dist/archive.js.map +1 -0
- package/dist/brain.d.ts +36 -0
- package/dist/brain.d.ts.map +1 -0
- package/dist/brain.js +10 -0
- package/dist/brain.js.map +1 -0
- package/dist/capabilities.d.ts +21 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +7 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/config.d.ts +118 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +12 -0
- package/dist/config.js.map +1 -0
- package/dist/context-monitor.d.ts +16 -0
- package/dist/context-monitor.d.ts.map +1 -0
- package/dist/context-monitor.js +7 -0
- package/dist/context-monitor.js.map +1 -0
- package/dist/data-accessor.d.ts +167 -0
- package/dist/data-accessor.d.ts.map +1 -0
- package/dist/data-accessor.js +18 -0
- package/dist/data-accessor.js.map +1 -0
- package/dist/discovery.d.ts +29 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +7 -0
- package/dist/discovery.js.map +1 -0
- package/dist/exit-codes.d.ts +109 -0
- package/dist/exit-codes.d.ts.map +1 -0
- package/dist/exit-codes.js +158 -0
- package/dist/exit-codes.js.map +1 -0
- package/dist/hooks.d.ts +17 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +8 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/install.d.ts +26 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +8 -0
- package/dist/install.js.map +1 -0
- package/dist/lafs.d.ts +132 -0
- package/dist/lafs.d.ts.map +1 -0
- package/dist/lafs.js +26 -0
- package/dist/lafs.js.map +1 -0
- package/dist/memory.d.ts +51 -0
- package/dist/memory.d.ts.map +1 -0
- package/dist/memory.js +8 -0
- package/dist/memory.js.map +1 -0
- package/dist/operations/index.d.ts +17 -0
- package/dist/operations/index.d.ts.map +1 -0
- package/dist/operations/index.js +17 -0
- package/dist/operations/index.js.map +1 -0
- package/dist/operations/issues.d.ts +75 -0
- package/dist/operations/issues.d.ts.map +1 -0
- package/dist/operations/issues.js +10 -0
- package/dist/operations/issues.js.map +1 -0
- package/dist/operations/lifecycle.d.ts +141 -0
- package/dist/operations/lifecycle.d.ts.map +1 -0
- package/dist/operations/lifecycle.js +8 -0
- package/dist/operations/lifecycle.js.map +1 -0
- package/dist/operations/orchestrate.d.ts +202 -0
- package/dist/operations/orchestrate.d.ts.map +1 -0
- package/dist/operations/orchestrate.js +8 -0
- package/dist/operations/orchestrate.js.map +1 -0
- package/dist/operations/release.d.ts +97 -0
- package/dist/operations/release.d.ts.map +1 -0
- package/dist/operations/release.js +7 -0
- package/dist/operations/release.js.map +1 -0
- package/dist/operations/research.d.ts +126 -0
- package/dist/operations/research.d.ts.map +1 -0
- package/dist/operations/research.js +11 -0
- package/dist/operations/research.js.map +1 -0
- package/dist/operations/session.d.ts +99 -0
- package/dist/operations/session.d.ts.map +1 -0
- package/dist/operations/session.js +12 -0
- package/dist/operations/session.js.map +1 -0
- package/dist/operations/skills.d.ts +182 -0
- package/dist/operations/skills.d.ts.map +1 -0
- package/dist/operations/skills.js +10 -0
- package/dist/operations/skills.js.map +1 -0
- package/dist/operations/system.d.ts +147 -0
- package/dist/operations/system.d.ts.map +1 -0
- package/dist/operations/system.js +8 -0
- package/dist/operations/system.js.map +1 -0
- package/dist/operations/tasks.d.ts +231 -0
- package/dist/operations/tasks.d.ts.map +1 -0
- package/dist/operations/tasks.js +13 -0
- package/dist/operations/tasks.js.map +1 -0
- package/dist/operations/validate.d.ts +170 -0
- package/dist/operations/validate.d.ts.map +1 -0
- package/dist/operations/validate.js +8 -0
- package/dist/operations/validate.js.map +1 -0
- package/dist/provider-paths.d.ts +16 -0
- package/dist/provider-paths.d.ts.map +1 -0
- package/dist/provider-paths.js +7 -0
- package/dist/provider-paths.js.map +1 -0
- package/dist/results.d.ts +188 -0
- package/dist/results.d.ts.map +1 -0
- package/dist/results.js +10 -0
- package/dist/results.js.map +1 -0
- package/dist/session.d.ts +106 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +77 -0
- package/dist/session.js.map +1 -0
- package/dist/spawn-types.d.ts +119 -0
- package/dist/spawn-types.d.ts.map +1 -0
- package/dist/spawn-types.js +12 -0
- package/dist/spawn-types.js.map +1 -0
- package/dist/spawn.d.ts +30 -0
- package/dist/spawn.d.ts.map +1 -0
- package/dist/spawn.js +7 -0
- package/dist/spawn.js.map +1 -0
- package/dist/status-registry.d.ts +50 -0
- package/dist/status-registry.d.ts.map +1 -0
- package/dist/status-registry.js +125 -0
- package/dist/status-registry.js.map +1 -0
- package/dist/task-record.d.ts +67 -0
- package/dist/task-record.d.ts.map +1 -0
- package/dist/task-record.js +11 -0
- package/dist/task-record.js.map +1 -0
- package/dist/task-sync.d.ts +143 -0
- package/dist/task-sync.d.ts.map +1 -0
- package/dist/task-sync.js +11 -0
- package/dist/task-sync.js.map +1 -0
- package/dist/task.d.ts +294 -0
- package/dist/task.d.ts.map +1 -0
- package/dist/task.js +24 -0
- package/dist/task.js.map +1 -0
- package/dist/tessera.d.ts +32 -0
- package/dist/tessera.d.ts.map +1 -0
- package/dist/tessera.js +11 -0
- package/dist/tessera.js.map +1 -0
- package/dist/todowrite.d.ts +53 -0
- package/dist/todowrite.d.ts.map +1 -0
- package/dist/todowrite.js +7 -0
- package/dist/todowrite.js.map +1 -0
- package/dist/transport.d.ts +12 -0
- package/dist/transport.d.ts.map +1 -0
- package/dist/transport.js +7 -0
- package/dist/transport.js.map +1 -0
- package/dist/warp-chain.d.ts +121 -0
- package/dist/warp-chain.d.ts.map +1 -0
- package/dist/warp-chain.js +13 -0
- package/dist/warp-chain.js.map +1 -0
- package/package.json +29 -0
- package/src/adapter.ts +38 -0
- package/src/archive.ts +121 -0
- package/src/brain.ts +39 -0
- package/src/capabilities.ts +21 -0
- package/src/config.ts +135 -0
- package/src/context-monitor.ts +16 -0
- package/src/data-accessor.ts +239 -0
- package/src/discovery.ts +31 -0
- package/src/exit-codes.ts +175 -0
- package/src/hooks.ts +17 -0
- package/src/index.ts +298 -0
- package/src/install.ts +28 -0
- package/src/lafs.ts +194 -0
- package/src/memory.ts +57 -0
- package/src/operations/index.ts +17 -0
- package/src/operations/issues.ts +86 -0
- package/src/operations/lifecycle.ts +176 -0
- package/src/operations/orchestrate.ts +199 -0
- package/src/operations/release.ts +114 -0
- package/src/operations/research.ts +156 -0
- package/src/operations/session.ts +119 -0
- package/src/operations/skills.ts +210 -0
- package/src/operations/system.ts +174 -0
- package/src/operations/tasks.ts +279 -0
- package/src/operations/validate.ts +199 -0
- package/src/provider-paths.ts +16 -0
- package/src/results.ts +207 -0
- package/src/session.ts +157 -0
- package/src/spawn-types.ts +140 -0
- package/src/spawn.ts +32 -0
- package/src/status-registry.ts +166 -0
- package/src/task-record.ts +71 -0
- package/src/task-sync.ts +167 -0
- package/src/task.ts +387 -0
- package/src/tessera.ts +35 -0
- package/src/todowrite.ts +58 -0
- package/src/transport.ts +12 -0
- package/src/warp-chain.ts +174 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WarpChain Type System
|
|
3
|
+
*
|
|
4
|
+
* Defines the complete type system for WarpChain workflow definitions.
|
|
5
|
+
* Warp is the unyielding protocol chain: the synthesis of composable workflow
|
|
6
|
+
* shape (topology) and LOOM quality gates into a unified chain model.
|
|
7
|
+
*
|
|
8
|
+
* ProtocolType and GateName are inlined here (contracts has zero external deps).
|
|
9
|
+
*
|
|
10
|
+
* @task T5407
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// =============================================================================
|
|
14
|
+
// INLINED TYPES (from core/orchestration and core/validation)
|
|
15
|
+
// =============================================================================
|
|
16
|
+
|
|
17
|
+
/** All supported protocol types. */
|
|
18
|
+
export type ProtocolType =
|
|
19
|
+
| 'research'
|
|
20
|
+
| 'consensus'
|
|
21
|
+
| 'specification'
|
|
22
|
+
| 'decomposition'
|
|
23
|
+
| 'implementation'
|
|
24
|
+
| 'contribution'
|
|
25
|
+
| 'release'
|
|
26
|
+
| 'artifact-publish'
|
|
27
|
+
| 'provenance';
|
|
28
|
+
|
|
29
|
+
/** Verification gate names (ordered dependency chain). */
|
|
30
|
+
export type GateName =
|
|
31
|
+
| 'implemented'
|
|
32
|
+
| 'testsPassed'
|
|
33
|
+
| 'qaPassed'
|
|
34
|
+
| 'cleanupDone'
|
|
35
|
+
| 'securityPassed'
|
|
36
|
+
| 'documented';
|
|
37
|
+
|
|
38
|
+
// =============================================================================
|
|
39
|
+
// CHAIN SHAPE (Warp topology)
|
|
40
|
+
// =============================================================================
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* A single stage in the warp chain.
|
|
44
|
+
*
|
|
45
|
+
* The category union includes all canonical CLEO pipeline stages
|
|
46
|
+
* plus 'custom' for user-defined stages.
|
|
47
|
+
*/
|
|
48
|
+
export interface WarpStage {
|
|
49
|
+
id: string;
|
|
50
|
+
name: string;
|
|
51
|
+
category:
|
|
52
|
+
| 'research'
|
|
53
|
+
| 'consensus'
|
|
54
|
+
| 'architecture'
|
|
55
|
+
| 'specification'
|
|
56
|
+
| 'decomposition'
|
|
57
|
+
| 'implementation'
|
|
58
|
+
| 'validation'
|
|
59
|
+
| 'testing'
|
|
60
|
+
| 'release'
|
|
61
|
+
| 'contribution'
|
|
62
|
+
| 'custom';
|
|
63
|
+
skippable: boolean;
|
|
64
|
+
description?: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Connection between two stages in the chain. */
|
|
68
|
+
export interface WarpLink {
|
|
69
|
+
from: string;
|
|
70
|
+
to: string;
|
|
71
|
+
type: 'linear' | 'fork' | 'branch';
|
|
72
|
+
condition?: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** The topology/DAG of a workflow. */
|
|
76
|
+
export interface ChainShape {
|
|
77
|
+
stages: WarpStage[];
|
|
78
|
+
links: WarpLink[];
|
|
79
|
+
entryPoint: string;
|
|
80
|
+
exitPoints: string[];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// =============================================================================
|
|
84
|
+
// GATE SYSTEM (LOOM quality gates)
|
|
85
|
+
// =============================================================================
|
|
86
|
+
|
|
87
|
+
/** Discriminated union for gate check types. */
|
|
88
|
+
export type GateCheck =
|
|
89
|
+
| { type: 'stage_complete'; stageId: string }
|
|
90
|
+
| { type: 'artifact_exists'; artifactType: string; path?: string }
|
|
91
|
+
| { type: 'protocol_valid'; protocolType: ProtocolType }
|
|
92
|
+
| { type: 'verification_gate'; gateName: GateName }
|
|
93
|
+
| { type: 'custom'; validator: string; params?: Record<string, unknown> };
|
|
94
|
+
|
|
95
|
+
/** A quality gate embedded in the chain. */
|
|
96
|
+
export interface GateContract {
|
|
97
|
+
id: string;
|
|
98
|
+
name: string;
|
|
99
|
+
type: 'entry' | 'exit' | 'checkpoint';
|
|
100
|
+
stageId: string;
|
|
101
|
+
position: 'before' | 'after';
|
|
102
|
+
check: GateCheck;
|
|
103
|
+
severity: 'blocking' | 'warning' | 'info';
|
|
104
|
+
canForce: boolean;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// =============================================================================
|
|
108
|
+
// CHAIN DEFINITION
|
|
109
|
+
// =============================================================================
|
|
110
|
+
|
|
111
|
+
/** Complete chain definition combining shape and gates. */
|
|
112
|
+
export interface WarpChain {
|
|
113
|
+
id: string;
|
|
114
|
+
name: string;
|
|
115
|
+
version: string;
|
|
116
|
+
description: string;
|
|
117
|
+
shape: ChainShape;
|
|
118
|
+
gates: GateContract[];
|
|
119
|
+
tessera?: string;
|
|
120
|
+
metadata?: Record<string, unknown>;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// =============================================================================
|
|
124
|
+
// CHAIN VALIDATION
|
|
125
|
+
// =============================================================================
|
|
126
|
+
|
|
127
|
+
/** Result of validating a chain definition. */
|
|
128
|
+
export interface ChainValidation {
|
|
129
|
+
wellFormed: boolean;
|
|
130
|
+
gateSatisfiable: boolean;
|
|
131
|
+
artifactComplete: boolean;
|
|
132
|
+
errors: string[];
|
|
133
|
+
warnings: string[];
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// =============================================================================
|
|
137
|
+
// CHAIN INSTANCE (runtime binding)
|
|
138
|
+
// =============================================================================
|
|
139
|
+
|
|
140
|
+
/** A chain bound to a specific epic. */
|
|
141
|
+
export interface WarpChainInstance {
|
|
142
|
+
id: string;
|
|
143
|
+
chainId: string;
|
|
144
|
+
epicId: string;
|
|
145
|
+
variables: Record<string, unknown>;
|
|
146
|
+
stageToTask: Record<string, string>;
|
|
147
|
+
status: 'pending' | 'active' | 'completed' | 'failed' | 'cancelled';
|
|
148
|
+
currentStage: string;
|
|
149
|
+
createdAt: string;
|
|
150
|
+
createdBy: string;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// =============================================================================
|
|
154
|
+
// CHAIN EXECUTION (runtime state)
|
|
155
|
+
// =============================================================================
|
|
156
|
+
|
|
157
|
+
/** Result of evaluating a single gate. */
|
|
158
|
+
export interface GateResult {
|
|
159
|
+
gateId: string;
|
|
160
|
+
passed: boolean;
|
|
161
|
+
forced: boolean;
|
|
162
|
+
message?: string;
|
|
163
|
+
evaluatedAt: string;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/** Runtime state of a chain instance execution. */
|
|
167
|
+
export interface WarpChainExecution {
|
|
168
|
+
instanceId: string;
|
|
169
|
+
currentStage: string;
|
|
170
|
+
gateResults: GateResult[];
|
|
171
|
+
status: 'running' | 'paused' | 'completed' | 'failed';
|
|
172
|
+
startedAt: string;
|
|
173
|
+
completedAt?: string;
|
|
174
|
+
}
|