@manehorizons/cadence-types 1.1.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/LICENSE +21 -0
- package/README.md +5 -0
- package/dist/anomaly.d.ts +42 -0
- package/dist/anomaly.d.ts.map +1 -0
- package/dist/anomaly.js +42 -0
- package/dist/anomaly.js.map +1 -0
- package/dist/config.d.ts +825 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +234 -0
- package/dist/config.js.map +1 -0
- package/dist/events.d.ts +30 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +20 -0
- package/dist/events.js.map +1 -0
- package/dist/host.d.ts +10 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +2 -0
- package/dist/host.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/intelligence.d.ts +1876 -0
- package/dist/intelligence.d.ts.map +1 -0
- package/dist/intelligence.js +321 -0
- package/dist/intelligence.js.map +1 -0
- package/dist/plan.d.ts +168 -0
- package/dist/plan.d.ts.map +1 -0
- package/dist/plan.js +36 -0
- package/dist/plan.js.map +1 -0
- package/dist/profile.d.ts +23 -0
- package/dist/profile.d.ts.map +1 -0
- package/dist/profile.js +32 -0
- package/dist/profile.js.map +1 -0
- package/dist/spec.d.ts +67 -0
- package/dist/spec.d.ts.map +1 -0
- package/dist/spec.js +19 -0
- package/dist/spec.js.map +1 -0
- package/dist/state.d.ts +256 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/state.js +81 -0
- package/dist/state.js.map +1 -0
- package/dist/summary.d.ts +283 -0
- package/dist/summary.d.ts.map +1 -0
- package/dist/summary.js +42 -0
- package/dist/summary.js.map +1 -0
- package/package.json +46 -0
package/dist/spec.d.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Phase 36.1 — the pre-DRAFT SPEC artifact (`<id>-SPEC.md`). Authored by the
|
|
4
|
+
* host agent/human (cadence is host-agnostic — it scaffolds + validates, it
|
|
5
|
+
* does not generate). Validated by the convergent spec-review gate at
|
|
6
|
+
* `cadence spec approve`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SpecZ: z.ZodObject<{
|
|
9
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
10
|
+
id: z.ZodString;
|
|
11
|
+
phase: z.ZodString;
|
|
12
|
+
objective: z.ZodString;
|
|
13
|
+
acceptanceCriteria: z.ZodArray<z.ZodObject<{
|
|
14
|
+
id: z.ZodString;
|
|
15
|
+
name: z.ZodDefault<z.ZodString>;
|
|
16
|
+
given: z.ZodString;
|
|
17
|
+
when: z.ZodString;
|
|
18
|
+
then: z.ZodString;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
given: string;
|
|
23
|
+
when: string;
|
|
24
|
+
then: string;
|
|
25
|
+
}, {
|
|
26
|
+
id: string;
|
|
27
|
+
given: string;
|
|
28
|
+
when: string;
|
|
29
|
+
then: string;
|
|
30
|
+
name?: string | undefined;
|
|
31
|
+
}>, "many">;
|
|
32
|
+
constraints: z.ZodArray<z.ZodString, "many">;
|
|
33
|
+
openQuestions: z.ZodArray<z.ZodString, "many">;
|
|
34
|
+
status: z.ZodEnum<["PENDING", "APPROVED"]>;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
status: "PENDING" | "APPROVED";
|
|
37
|
+
schemaVersion: 1;
|
|
38
|
+
id: string;
|
|
39
|
+
phase: string;
|
|
40
|
+
objective: string;
|
|
41
|
+
acceptanceCriteria: {
|
|
42
|
+
id: string;
|
|
43
|
+
name: string;
|
|
44
|
+
given: string;
|
|
45
|
+
when: string;
|
|
46
|
+
then: string;
|
|
47
|
+
}[];
|
|
48
|
+
constraints: string[];
|
|
49
|
+
openQuestions: string[];
|
|
50
|
+
}, {
|
|
51
|
+
status: "PENDING" | "APPROVED";
|
|
52
|
+
schemaVersion: 1;
|
|
53
|
+
id: string;
|
|
54
|
+
phase: string;
|
|
55
|
+
objective: string;
|
|
56
|
+
acceptanceCriteria: {
|
|
57
|
+
id: string;
|
|
58
|
+
given: string;
|
|
59
|
+
when: string;
|
|
60
|
+
then: string;
|
|
61
|
+
name?: string | undefined;
|
|
62
|
+
}[];
|
|
63
|
+
constraints: string[];
|
|
64
|
+
openQuestions: string[];
|
|
65
|
+
}>;
|
|
66
|
+
export type Spec = z.infer<typeof SpecZ>;
|
|
67
|
+
//# sourceMappingURL=spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../src/spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;GAKG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAShB,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC"}
|
package/dist/spec.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AcceptanceCriterionZ } from './plan.js';
|
|
3
|
+
/**
|
|
4
|
+
* Phase 36.1 — the pre-DRAFT SPEC artifact (`<id>-SPEC.md`). Authored by the
|
|
5
|
+
* host agent/human (cadence is host-agnostic — it scaffolds + validates, it
|
|
6
|
+
* does not generate). Validated by the convergent spec-review gate at
|
|
7
|
+
* `cadence spec approve`.
|
|
8
|
+
*/
|
|
9
|
+
export const SpecZ = z.object({
|
|
10
|
+
schemaVersion: z.literal(1),
|
|
11
|
+
id: z.string().regex(/^\d{2}-\d{2}$/),
|
|
12
|
+
phase: z.string(),
|
|
13
|
+
objective: z.string(),
|
|
14
|
+
acceptanceCriteria: z.array(AcceptanceCriterionZ),
|
|
15
|
+
constraints: z.array(z.string()),
|
|
16
|
+
openQuestions: z.array(z.string()),
|
|
17
|
+
status: z.enum(['PENDING', 'APPROVED']),
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=spec.js.map
|
package/dist/spec.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../src/spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC;IACrC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,kBAAkB,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC;IACjD,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAChC,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;CACxC,CAAC,CAAC"}
|
package/dist/state.d.ts
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const TierZ: z.ZodEnum<["quick-fix", "standard", "complex"]>;
|
|
3
|
+
export type Tier = z.infer<typeof TierZ>;
|
|
4
|
+
export declare const LoopPositionZ: z.ZodEnum<["SPEC", "DRAFT", "BUILD", "SETTLE", "IDLE"]>;
|
|
5
|
+
export type LoopPosition = z.infer<typeof LoopPositionZ>;
|
|
6
|
+
export declare const TaskStatusZ: z.ZodEnum<["PENDING", "IN_PROGRESS", "DONE", "DONE_WITH_CONCERNS", "NEEDS_CONTEXT", "BLOCKED"]>;
|
|
7
|
+
export type TaskStatus = z.infer<typeof TaskStatusZ>;
|
|
8
|
+
export declare const DecisionZ: z.ZodObject<{
|
|
9
|
+
id: z.ZodString;
|
|
10
|
+
phase: z.ZodString;
|
|
11
|
+
draft: z.ZodOptional<z.ZodString>;
|
|
12
|
+
title: z.ZodString;
|
|
13
|
+
rationale: z.ZodOptional<z.ZodString>;
|
|
14
|
+
decidedAt: z.ZodString;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
id: string;
|
|
17
|
+
phase: string;
|
|
18
|
+
title: string;
|
|
19
|
+
decidedAt: string;
|
|
20
|
+
draft?: string | undefined;
|
|
21
|
+
rationale?: string | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
id: string;
|
|
24
|
+
phase: string;
|
|
25
|
+
title: string;
|
|
26
|
+
decidedAt: string;
|
|
27
|
+
draft?: string | undefined;
|
|
28
|
+
rationale?: string | undefined;
|
|
29
|
+
}>;
|
|
30
|
+
export type Decision = z.infer<typeof DecisionZ>;
|
|
31
|
+
export declare const DeferredItemZ: z.ZodObject<{
|
|
32
|
+
id: z.ZodString;
|
|
33
|
+
from: z.ZodString;
|
|
34
|
+
title: z.ZodString;
|
|
35
|
+
type: z.ZodOptional<z.ZodString>;
|
|
36
|
+
createdAt: z.ZodString;
|
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
|
38
|
+
id: string;
|
|
39
|
+
title: string;
|
|
40
|
+
from: string;
|
|
41
|
+
createdAt: string;
|
|
42
|
+
type?: string | undefined;
|
|
43
|
+
}, {
|
|
44
|
+
id: string;
|
|
45
|
+
title: string;
|
|
46
|
+
from: string;
|
|
47
|
+
createdAt: string;
|
|
48
|
+
type?: string | undefined;
|
|
49
|
+
}>;
|
|
50
|
+
export type DeferredItem = z.infer<typeof DeferredItemZ>;
|
|
51
|
+
export declare const CadenceStateZ: z.ZodObject<{
|
|
52
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
53
|
+
project: z.ZodObject<{
|
|
54
|
+
name: z.ZodString;
|
|
55
|
+
createdAt: z.ZodString;
|
|
56
|
+
}, "strip", z.ZodTypeAny, {
|
|
57
|
+
createdAt: string;
|
|
58
|
+
name: string;
|
|
59
|
+
}, {
|
|
60
|
+
createdAt: string;
|
|
61
|
+
name: string;
|
|
62
|
+
}>;
|
|
63
|
+
activePhase: z.ZodNullable<z.ZodString>;
|
|
64
|
+
activeDraft: z.ZodNullable<z.ZodString>;
|
|
65
|
+
/** Active `<id>-SPEC.md` while `loopPosition==='SPEC'`; `null` otherwise. */
|
|
66
|
+
activeSpec: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
67
|
+
loopPosition: z.ZodEnum<["SPEC", "DRAFT", "BUILD", "SETTLE", "IDLE"]>;
|
|
68
|
+
tier: z.ZodNullable<z.ZodEnum<["quick-fix", "standard", "complex"]>>;
|
|
69
|
+
/**
|
|
70
|
+
* ISO8601 timestamp of the most recent successful `cadence draft approve`.
|
|
71
|
+
* The DRAFT-read mtime gate (Phase 23.1) refuses settle when the DRAFT.md
|
|
72
|
+
* file's mtime is newer than this — the human edited the draft after
|
|
73
|
+
* approving. `null` means no approve has happened yet (gate silently passes).
|
|
74
|
+
*/
|
|
75
|
+
draftReadAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
76
|
+
openDrafts: z.ZodArray<z.ZodObject<{
|
|
77
|
+
id: z.ZodString;
|
|
78
|
+
since: z.ZodString;
|
|
79
|
+
}, "strip", z.ZodTypeAny, {
|
|
80
|
+
id: string;
|
|
81
|
+
since: string;
|
|
82
|
+
}, {
|
|
83
|
+
id: string;
|
|
84
|
+
since: string;
|
|
85
|
+
}>, "many">;
|
|
86
|
+
decisions: z.ZodArray<z.ZodObject<{
|
|
87
|
+
id: z.ZodString;
|
|
88
|
+
phase: z.ZodString;
|
|
89
|
+
draft: z.ZodOptional<z.ZodString>;
|
|
90
|
+
title: z.ZodString;
|
|
91
|
+
rationale: z.ZodOptional<z.ZodString>;
|
|
92
|
+
decidedAt: z.ZodString;
|
|
93
|
+
}, "strip", z.ZodTypeAny, {
|
|
94
|
+
id: string;
|
|
95
|
+
phase: string;
|
|
96
|
+
title: string;
|
|
97
|
+
decidedAt: string;
|
|
98
|
+
draft?: string | undefined;
|
|
99
|
+
rationale?: string | undefined;
|
|
100
|
+
}, {
|
|
101
|
+
id: string;
|
|
102
|
+
phase: string;
|
|
103
|
+
title: string;
|
|
104
|
+
decidedAt: string;
|
|
105
|
+
draft?: string | undefined;
|
|
106
|
+
rationale?: string | undefined;
|
|
107
|
+
}>, "many">;
|
|
108
|
+
deferred: z.ZodArray<z.ZodObject<{
|
|
109
|
+
id: z.ZodString;
|
|
110
|
+
from: z.ZodString;
|
|
111
|
+
title: z.ZodString;
|
|
112
|
+
type: z.ZodOptional<z.ZodString>;
|
|
113
|
+
createdAt: z.ZodString;
|
|
114
|
+
}, "strip", z.ZodTypeAny, {
|
|
115
|
+
id: string;
|
|
116
|
+
title: string;
|
|
117
|
+
from: string;
|
|
118
|
+
createdAt: string;
|
|
119
|
+
type?: string | undefined;
|
|
120
|
+
}, {
|
|
121
|
+
id: string;
|
|
122
|
+
title: string;
|
|
123
|
+
from: string;
|
|
124
|
+
createdAt: string;
|
|
125
|
+
type?: string | undefined;
|
|
126
|
+
}>, "many">;
|
|
127
|
+
session: z.ZodObject<{
|
|
128
|
+
tokenUtilization: z.ZodNumber;
|
|
129
|
+
lastHandoff: z.ZodNullable<z.ZodString>;
|
|
130
|
+
subagentSpawns: z.ZodNumber;
|
|
131
|
+
}, "strip", z.ZodTypeAny, {
|
|
132
|
+
tokenUtilization: number;
|
|
133
|
+
lastHandoff: string | null;
|
|
134
|
+
subagentSpawns: number;
|
|
135
|
+
}, {
|
|
136
|
+
tokenUtilization: number;
|
|
137
|
+
lastHandoff: string | null;
|
|
138
|
+
subagentSpawns: number;
|
|
139
|
+
}>;
|
|
140
|
+
skillAudit: z.ZodObject<{
|
|
141
|
+
required: z.ZodArray<z.ZodString, "many">;
|
|
142
|
+
invoked: z.ZodArray<z.ZodString, "many">;
|
|
143
|
+
}, "strip", z.ZodTypeAny, {
|
|
144
|
+
required: string[];
|
|
145
|
+
invoked: string[];
|
|
146
|
+
}, {
|
|
147
|
+
required: string[];
|
|
148
|
+
invoked: string[];
|
|
149
|
+
}>;
|
|
150
|
+
activeTask: z.ZodNullable<z.ZodObject<{
|
|
151
|
+
id: z.ZodString;
|
|
152
|
+
status: z.ZodEnum<["PENDING", "IN_PROGRESS", "DONE", "DONE_WITH_CONCERNS", "NEEDS_CONTEXT", "BLOCKED"]>;
|
|
153
|
+
touchedFiles: z.ZodArray<z.ZodString, "many">;
|
|
154
|
+
}, "strip", z.ZodTypeAny, {
|
|
155
|
+
status: "PENDING" | "IN_PROGRESS" | "DONE" | "DONE_WITH_CONCERNS" | "NEEDS_CONTEXT" | "BLOCKED";
|
|
156
|
+
id: string;
|
|
157
|
+
touchedFiles: string[];
|
|
158
|
+
}, {
|
|
159
|
+
status: "PENDING" | "IN_PROGRESS" | "DONE" | "DONE_WITH_CONCERNS" | "NEEDS_CONTEXT" | "BLOCKED";
|
|
160
|
+
id: string;
|
|
161
|
+
touchedFiles: string[];
|
|
162
|
+
}>>;
|
|
163
|
+
}, "strip", z.ZodTypeAny, {
|
|
164
|
+
schemaVersion: 1;
|
|
165
|
+
skillAudit: {
|
|
166
|
+
required: string[];
|
|
167
|
+
invoked: string[];
|
|
168
|
+
};
|
|
169
|
+
tier: "standard" | "complex" | "quick-fix" | null;
|
|
170
|
+
activePhase: string | null;
|
|
171
|
+
activeDraft: string | null;
|
|
172
|
+
project: {
|
|
173
|
+
createdAt: string;
|
|
174
|
+
name: string;
|
|
175
|
+
};
|
|
176
|
+
activeSpec: string | null;
|
|
177
|
+
loopPosition: "SPEC" | "DRAFT" | "BUILD" | "SETTLE" | "IDLE";
|
|
178
|
+
draftReadAt: string | null;
|
|
179
|
+
openDrafts: {
|
|
180
|
+
id: string;
|
|
181
|
+
since: string;
|
|
182
|
+
}[];
|
|
183
|
+
decisions: {
|
|
184
|
+
id: string;
|
|
185
|
+
phase: string;
|
|
186
|
+
title: string;
|
|
187
|
+
decidedAt: string;
|
|
188
|
+
draft?: string | undefined;
|
|
189
|
+
rationale?: string | undefined;
|
|
190
|
+
}[];
|
|
191
|
+
deferred: {
|
|
192
|
+
id: string;
|
|
193
|
+
title: string;
|
|
194
|
+
from: string;
|
|
195
|
+
createdAt: string;
|
|
196
|
+
type?: string | undefined;
|
|
197
|
+
}[];
|
|
198
|
+
session: {
|
|
199
|
+
tokenUtilization: number;
|
|
200
|
+
lastHandoff: string | null;
|
|
201
|
+
subagentSpawns: number;
|
|
202
|
+
};
|
|
203
|
+
activeTask: {
|
|
204
|
+
status: "PENDING" | "IN_PROGRESS" | "DONE" | "DONE_WITH_CONCERNS" | "NEEDS_CONTEXT" | "BLOCKED";
|
|
205
|
+
id: string;
|
|
206
|
+
touchedFiles: string[];
|
|
207
|
+
} | null;
|
|
208
|
+
}, {
|
|
209
|
+
schemaVersion: 1;
|
|
210
|
+
skillAudit: {
|
|
211
|
+
required: string[];
|
|
212
|
+
invoked: string[];
|
|
213
|
+
};
|
|
214
|
+
tier: "standard" | "complex" | "quick-fix" | null;
|
|
215
|
+
activePhase: string | null;
|
|
216
|
+
activeDraft: string | null;
|
|
217
|
+
project: {
|
|
218
|
+
createdAt: string;
|
|
219
|
+
name: string;
|
|
220
|
+
};
|
|
221
|
+
loopPosition: "SPEC" | "DRAFT" | "BUILD" | "SETTLE" | "IDLE";
|
|
222
|
+
openDrafts: {
|
|
223
|
+
id: string;
|
|
224
|
+
since: string;
|
|
225
|
+
}[];
|
|
226
|
+
decisions: {
|
|
227
|
+
id: string;
|
|
228
|
+
phase: string;
|
|
229
|
+
title: string;
|
|
230
|
+
decidedAt: string;
|
|
231
|
+
draft?: string | undefined;
|
|
232
|
+
rationale?: string | undefined;
|
|
233
|
+
}[];
|
|
234
|
+
deferred: {
|
|
235
|
+
id: string;
|
|
236
|
+
title: string;
|
|
237
|
+
from: string;
|
|
238
|
+
createdAt: string;
|
|
239
|
+
type?: string | undefined;
|
|
240
|
+
}[];
|
|
241
|
+
session: {
|
|
242
|
+
tokenUtilization: number;
|
|
243
|
+
lastHandoff: string | null;
|
|
244
|
+
subagentSpawns: number;
|
|
245
|
+
};
|
|
246
|
+
activeTask: {
|
|
247
|
+
status: "PENDING" | "IN_PROGRESS" | "DONE" | "DONE_WITH_CONCERNS" | "NEEDS_CONTEXT" | "BLOCKED";
|
|
248
|
+
id: string;
|
|
249
|
+
touchedFiles: string[];
|
|
250
|
+
} | null;
|
|
251
|
+
activeSpec?: string | null | undefined;
|
|
252
|
+
draftReadAt?: string | null | undefined;
|
|
253
|
+
}>;
|
|
254
|
+
export type CadenceState = z.infer<typeof CadenceStateZ>;
|
|
255
|
+
export declare function emptyState(projectName?: string): CadenceState;
|
|
256
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,KAAK,iDAA+C,CAAC;AAClE,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC;AAEzC,eAAO,MAAM,aAAa,yDAAuD,CAAC;AAClF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEzD,eAAO,MAAM,WAAW,iGAOtB,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAErD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;EAOpB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAEjD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;EAMxB,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEzD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;IAKxB,6EAA6E;;;;IAI7E;;;;;OAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqBH,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEzD,wBAAgB,UAAU,CAAC,WAAW,SAAY,GAAG,YAAY,CAiBhE"}
|
package/dist/state.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const TierZ = z.enum(['quick-fix', 'standard', 'complex']);
|
|
3
|
+
export const LoopPositionZ = z.enum(['SPEC', 'DRAFT', 'BUILD', 'SETTLE', 'IDLE']);
|
|
4
|
+
export const TaskStatusZ = z.enum([
|
|
5
|
+
'PENDING',
|
|
6
|
+
'IN_PROGRESS',
|
|
7
|
+
'DONE',
|
|
8
|
+
'DONE_WITH_CONCERNS',
|
|
9
|
+
'NEEDS_CONTEXT',
|
|
10
|
+
'BLOCKED',
|
|
11
|
+
]);
|
|
12
|
+
export const DecisionZ = z.object({
|
|
13
|
+
id: z.string(),
|
|
14
|
+
phase: z.string(),
|
|
15
|
+
draft: z.string().optional(),
|
|
16
|
+
title: z.string(),
|
|
17
|
+
rationale: z.string().optional(),
|
|
18
|
+
decidedAt: z.string(),
|
|
19
|
+
});
|
|
20
|
+
export const DeferredItemZ = z.object({
|
|
21
|
+
id: z.string(),
|
|
22
|
+
from: z.string(),
|
|
23
|
+
title: z.string(),
|
|
24
|
+
type: z.string().optional(),
|
|
25
|
+
createdAt: z.string(),
|
|
26
|
+
});
|
|
27
|
+
export const CadenceStateZ = z.object({
|
|
28
|
+
schemaVersion: z.literal(1),
|
|
29
|
+
project: z.object({ name: z.string(), createdAt: z.string() }),
|
|
30
|
+
activePhase: z.string().nullable(),
|
|
31
|
+
activeDraft: z.string().nullable(),
|
|
32
|
+
/** Active `<id>-SPEC.md` while `loopPosition==='SPEC'`; `null` otherwise. */
|
|
33
|
+
activeSpec: z.string().nullable().default(null),
|
|
34
|
+
loopPosition: LoopPositionZ,
|
|
35
|
+
tier: TierZ.nullable(),
|
|
36
|
+
/**
|
|
37
|
+
* ISO8601 timestamp of the most recent successful `cadence draft approve`.
|
|
38
|
+
* The DRAFT-read mtime gate (Phase 23.1) refuses settle when the DRAFT.md
|
|
39
|
+
* file's mtime is newer than this — the human edited the draft after
|
|
40
|
+
* approving. `null` means no approve has happened yet (gate silently passes).
|
|
41
|
+
*/
|
|
42
|
+
draftReadAt: z.string().datetime({ offset: true }).nullable().default(null),
|
|
43
|
+
openDrafts: z.array(z.object({ id: z.string(), since: z.string() })),
|
|
44
|
+
decisions: z.array(DecisionZ),
|
|
45
|
+
deferred: z.array(DeferredItemZ),
|
|
46
|
+
session: z.object({
|
|
47
|
+
tokenUtilization: z.number().min(0).max(1),
|
|
48
|
+
lastHandoff: z.string().nullable(),
|
|
49
|
+
subagentSpawns: z.number().int().nonnegative(),
|
|
50
|
+
}),
|
|
51
|
+
skillAudit: z.object({
|
|
52
|
+
required: z.array(z.string()),
|
|
53
|
+
invoked: z.array(z.string()),
|
|
54
|
+
}),
|
|
55
|
+
activeTask: z
|
|
56
|
+
.object({
|
|
57
|
+
id: z.string(),
|
|
58
|
+
status: TaskStatusZ,
|
|
59
|
+
touchedFiles: z.array(z.string()),
|
|
60
|
+
})
|
|
61
|
+
.nullable(),
|
|
62
|
+
});
|
|
63
|
+
export function emptyState(projectName = 'unnamed') {
|
|
64
|
+
return {
|
|
65
|
+
schemaVersion: 1,
|
|
66
|
+
project: { name: projectName, createdAt: new Date().toISOString() },
|
|
67
|
+
activePhase: null,
|
|
68
|
+
activeDraft: null,
|
|
69
|
+
activeSpec: null,
|
|
70
|
+
loopPosition: 'IDLE',
|
|
71
|
+
tier: null,
|
|
72
|
+
openDrafts: [],
|
|
73
|
+
decisions: [],
|
|
74
|
+
deferred: [],
|
|
75
|
+
session: { tokenUtilization: 0, lastHandoff: null, subagentSpawns: 0 },
|
|
76
|
+
skillAudit: { required: [], invoked: [] },
|
|
77
|
+
activeTask: null,
|
|
78
|
+
draftReadAt: null,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;AAGlE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAGlF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC;IAChC,SAAS;IACT,aAAa;IACb,MAAM;IACN,oBAAoB;IACpB,eAAe;IACf,SAAS;CACV,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd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