sysprom 1.0.0 → 1.0.6

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.
Files changed (148) hide show
  1. package/README.md +207 -0
  2. package/dist/schema.json +510 -0
  3. package/dist/src/canonical-json.d.ts +23 -0
  4. package/dist/src/canonical-json.js +120 -0
  5. package/dist/src/cli/commands/add.d.ts +22 -0
  6. package/dist/src/cli/commands/add.js +95 -0
  7. package/dist/src/cli/commands/check.d.ts +10 -0
  8. package/dist/src/cli/commands/check.js +33 -0
  9. package/dist/src/cli/commands/graph.d.ts +15 -0
  10. package/dist/src/cli/commands/graph.js +32 -0
  11. package/dist/src/cli/commands/init.d.ts +2 -0
  12. package/dist/src/cli/commands/init.js +44 -0
  13. package/dist/src/cli/commands/json2md.d.ts +2 -0
  14. package/dist/src/cli/commands/json2md.js +60 -0
  15. package/dist/src/cli/commands/md2json.d.ts +2 -0
  16. package/dist/src/cli/commands/md2json.js +29 -0
  17. package/dist/src/cli/commands/plan.d.ts +2 -0
  18. package/dist/src/cli/commands/plan.js +227 -0
  19. package/dist/src/cli/commands/query.d.ts +2 -0
  20. package/dist/src/cli/commands/query.js +275 -0
  21. package/dist/src/cli/commands/remove.d.ts +13 -0
  22. package/dist/src/cli/commands/remove.js +50 -0
  23. package/dist/src/cli/commands/rename.d.ts +14 -0
  24. package/dist/src/cli/commands/rename.js +34 -0
  25. package/dist/src/cli/commands/search.d.ts +11 -0
  26. package/dist/src/cli/commands/search.js +37 -0
  27. package/dist/src/cli/commands/speckit.d.ts +2 -0
  28. package/dist/src/cli/commands/speckit.js +318 -0
  29. package/dist/src/cli/commands/stats.d.ts +10 -0
  30. package/dist/src/cli/commands/stats.js +51 -0
  31. package/dist/src/cli/commands/task.d.ts +2 -0
  32. package/dist/src/cli/commands/task.js +162 -0
  33. package/dist/src/cli/commands/update.d.ts +2 -0
  34. package/dist/src/cli/commands/update.js +219 -0
  35. package/dist/src/cli/commands/validate.d.ts +10 -0
  36. package/dist/src/cli/commands/validate.js +30 -0
  37. package/dist/src/cli/define-command.d.ts +34 -0
  38. package/dist/src/cli/define-command.js +237 -0
  39. package/dist/src/cli/index.d.ts +2 -0
  40. package/dist/src/cli/index.js +3 -0
  41. package/dist/src/cli/program.d.ts +4 -0
  42. package/dist/src/cli/program.js +46 -0
  43. package/dist/src/cli/shared.d.ts +26 -0
  44. package/dist/src/cli/shared.js +41 -0
  45. package/dist/src/generate-schema.d.ts +1 -0
  46. package/dist/src/generate-schema.js +9 -0
  47. package/dist/src/index.d.ts +48 -0
  48. package/dist/src/index.js +99 -0
  49. package/dist/src/io.d.ts +22 -0
  50. package/dist/src/io.js +66 -0
  51. package/dist/src/json-to-md.d.ts +26 -0
  52. package/dist/src/json-to-md.js +498 -0
  53. package/dist/src/md-to-json.d.ts +22 -0
  54. package/dist/src/md-to-json.js +548 -0
  55. package/dist/src/operations/add-node.d.ts +887 -0
  56. package/dist/src/operations/add-node.js +21 -0
  57. package/dist/src/operations/add-plan-task.d.ts +594 -0
  58. package/dist/src/operations/add-plan-task.js +25 -0
  59. package/dist/src/operations/add-relationship.d.ts +635 -0
  60. package/dist/src/operations/add-relationship.js +25 -0
  61. package/dist/src/operations/check.d.ts +301 -0
  62. package/dist/src/operations/check.js +66 -0
  63. package/dist/src/operations/define-operation.d.ts +14 -0
  64. package/dist/src/operations/define-operation.js +21 -0
  65. package/dist/src/operations/graph.d.ts +303 -0
  66. package/dist/src/operations/graph.js +71 -0
  67. package/dist/src/operations/index.d.ts +38 -0
  68. package/dist/src/operations/index.js +45 -0
  69. package/dist/src/operations/init-document.d.ts +299 -0
  70. package/dist/src/operations/init-document.js +26 -0
  71. package/dist/src/operations/json-to-markdown.d.ts +298 -0
  72. package/dist/src/operations/json-to-markdown.js +13 -0
  73. package/dist/src/operations/mark-task-done.d.ts +594 -0
  74. package/dist/src/operations/mark-task-done.js +26 -0
  75. package/dist/src/operations/mark-task-undone.d.ts +594 -0
  76. package/dist/src/operations/mark-task-undone.js +26 -0
  77. package/dist/src/operations/markdown-to-json.d.ts +298 -0
  78. package/dist/src/operations/markdown-to-json.js +13 -0
  79. package/dist/src/operations/next-id.d.ts +322 -0
  80. package/dist/src/operations/next-id.js +29 -0
  81. package/dist/src/operations/node-history.d.ts +313 -0
  82. package/dist/src/operations/node-history.js +55 -0
  83. package/dist/src/operations/plan-add-task.d.ts +595 -0
  84. package/dist/src/operations/plan-add-task.js +18 -0
  85. package/dist/src/operations/plan-gate.d.ts +351 -0
  86. package/dist/src/operations/plan-gate.js +41 -0
  87. package/dist/src/operations/plan-init.d.ts +299 -0
  88. package/dist/src/operations/plan-init.js +17 -0
  89. package/dist/src/operations/plan-progress.d.ts +313 -0
  90. package/dist/src/operations/plan-progress.js +23 -0
  91. package/dist/src/operations/plan-status.d.ts +349 -0
  92. package/dist/src/operations/plan-status.js +41 -0
  93. package/dist/src/operations/query-node.d.ts +1065 -0
  94. package/dist/src/operations/query-node.js +27 -0
  95. package/dist/src/operations/query-nodes.d.ts +594 -0
  96. package/dist/src/operations/query-nodes.js +23 -0
  97. package/dist/src/operations/query-relationships.d.ts +343 -0
  98. package/dist/src/operations/query-relationships.js +27 -0
  99. package/dist/src/operations/remove-node.d.ts +895 -0
  100. package/dist/src/operations/remove-node.js +58 -0
  101. package/dist/src/operations/remove-relationship.d.ts +622 -0
  102. package/dist/src/operations/remove-relationship.js +26 -0
  103. package/dist/src/operations/rename.d.ts +594 -0
  104. package/dist/src/operations/rename.js +113 -0
  105. package/dist/src/operations/search.d.ts +593 -0
  106. package/dist/src/operations/search.js +39 -0
  107. package/dist/src/operations/speckit-diff.d.ts +330 -0
  108. package/dist/src/operations/speckit-diff.js +89 -0
  109. package/dist/src/operations/speckit-export.d.ts +300 -0
  110. package/dist/src/operations/speckit-export.js +17 -0
  111. package/dist/src/operations/speckit-import.d.ts +299 -0
  112. package/dist/src/operations/speckit-import.js +39 -0
  113. package/dist/src/operations/speckit-sync.d.ts +900 -0
  114. package/dist/src/operations/speckit-sync.js +116 -0
  115. package/dist/src/operations/state-at.d.ts +309 -0
  116. package/dist/src/operations/state-at.js +53 -0
  117. package/dist/src/operations/stats.d.ts +324 -0
  118. package/dist/src/operations/stats.js +85 -0
  119. package/dist/src/operations/task-list.d.ts +305 -0
  120. package/dist/src/operations/task-list.js +44 -0
  121. package/dist/src/operations/timeline.d.ts +312 -0
  122. package/dist/src/operations/timeline.js +46 -0
  123. package/dist/src/operations/trace-from-node.d.ts +1197 -0
  124. package/dist/src/operations/trace-from-node.js +36 -0
  125. package/dist/src/operations/update-metadata.d.ts +593 -0
  126. package/dist/src/operations/update-metadata.js +18 -0
  127. package/dist/src/operations/update-node.d.ts +957 -0
  128. package/dist/src/operations/update-node.js +24 -0
  129. package/dist/src/operations/update-plan-task.d.ts +595 -0
  130. package/dist/src/operations/update-plan-task.js +31 -0
  131. package/dist/src/operations/validate.d.ts +310 -0
  132. package/dist/src/operations/validate.js +82 -0
  133. package/dist/src/schema.d.ts +891 -0
  134. package/dist/src/schema.js +356 -0
  135. package/dist/src/speckit/generate.d.ts +7 -0
  136. package/dist/src/speckit/generate.js +546 -0
  137. package/dist/src/speckit/index.d.ts +4 -0
  138. package/dist/src/speckit/index.js +4 -0
  139. package/dist/src/speckit/parse.d.ts +11 -0
  140. package/dist/src/speckit/parse.js +712 -0
  141. package/dist/src/speckit/plan.d.ts +125 -0
  142. package/dist/src/speckit/plan.js +636 -0
  143. package/dist/src/speckit/project.d.ts +39 -0
  144. package/dist/src/speckit/project.js +141 -0
  145. package/dist/src/text.d.ts +23 -0
  146. package/dist/src/text.js +32 -0
  147. package/package.json +86 -8
  148. package/schema.json +510 -0
@@ -0,0 +1,351 @@
1
+ import * as z from "zod";
2
+ export declare const GateIssueSchema: z.ZodUnion<readonly [z.ZodObject<{
3
+ kind: z.ZodLiteral<"previous_tasks_incomplete">;
4
+ phase: z.ZodNumber;
5
+ remaining: z.ZodNumber;
6
+ }, z.core.$strip>, z.ZodObject<{
7
+ kind: z.ZodLiteral<"user_story_no_change">;
8
+ storyId: z.ZodString;
9
+ }, z.core.$strip>, z.ZodObject<{
10
+ kind: z.ZodLiteral<"user_story_no_acceptance_criteria">;
11
+ storyId: z.ZodString;
12
+ }, z.core.$strip>, z.ZodObject<{
13
+ kind: z.ZodLiteral<"fr_no_change">;
14
+ frId: z.ZodString;
15
+ }, z.core.$strip>]>;
16
+ export type GateIssueResult = z.infer<typeof GateIssueSchema>;
17
+ export declare const GateResultSchema: z.ZodObject<{
18
+ phase: z.ZodNumber;
19
+ ready: z.ZodBoolean;
20
+ issues: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
21
+ kind: z.ZodLiteral<"previous_tasks_incomplete">;
22
+ phase: z.ZodNumber;
23
+ remaining: z.ZodNumber;
24
+ }, z.core.$strip>, z.ZodObject<{
25
+ kind: z.ZodLiteral<"user_story_no_change">;
26
+ storyId: z.ZodString;
27
+ }, z.core.$strip>, z.ZodObject<{
28
+ kind: z.ZodLiteral<"user_story_no_acceptance_criteria">;
29
+ storyId: z.ZodString;
30
+ }, z.core.$strip>, z.ZodObject<{
31
+ kind: z.ZodLiteral<"fr_no_change">;
32
+ frId: z.ZodString;
33
+ }, z.core.$strip>]>>;
34
+ }, z.core.$strip>;
35
+ export type GateResultOutput = z.infer<typeof GateResultSchema>;
36
+ export declare const planGateOp: import("./define-operation.js").DefinedOperation<z.ZodObject<{
37
+ doc: z.ZodObject<{
38
+ $schema: z.ZodOptional<z.ZodString>;
39
+ metadata: z.ZodOptional<z.ZodObject<{
40
+ title: z.ZodOptional<z.ZodString>;
41
+ doc_type: z.ZodOptional<z.ZodString>;
42
+ scope: z.ZodOptional<z.ZodString>;
43
+ status: z.ZodOptional<z.ZodString>;
44
+ version: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
45
+ }, z.core.$loose> & {
46
+ is(value: unknown): value is {
47
+ [x: string]: unknown;
48
+ title?: string | undefined;
49
+ doc_type?: string | undefined;
50
+ scope?: string | undefined;
51
+ status?: string | undefined;
52
+ version?: string | number | undefined;
53
+ };
54
+ }>;
55
+ nodes: z.ZodArray<z.ZodObject<{
56
+ id: z.ZodString;
57
+ type: z.ZodEnum<{
58
+ intent: "intent";
59
+ concept: "concept";
60
+ capability: "capability";
61
+ element: "element";
62
+ realisation: "realisation";
63
+ invariant: "invariant";
64
+ principle: "principle";
65
+ policy: "policy";
66
+ protocol: "protocol";
67
+ stage: "stage";
68
+ role: "role";
69
+ gate: "gate";
70
+ mode: "mode";
71
+ artefact: "artefact";
72
+ artefact_flow: "artefact_flow";
73
+ decision: "decision";
74
+ change: "change";
75
+ view: "view";
76
+ milestone: "milestone";
77
+ version: "version";
78
+ }> & {
79
+ is(value: unknown): value is "intent" | "concept" | "capability" | "element" | "realisation" | "invariant" | "principle" | "policy" | "protocol" | "stage" | "role" | "gate" | "mode" | "artefact" | "artefact_flow" | "decision" | "change" | "view" | "milestone" | "version";
80
+ };
81
+ name: z.ZodString;
82
+ description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
83
+ is(value: unknown): value is string | string[];
84
+ }>;
85
+ status: z.ZodOptional<z.ZodEnum<{
86
+ deprecated: "deprecated";
87
+ proposed: "proposed";
88
+ accepted: "accepted";
89
+ active: "active";
90
+ implemented: "implemented";
91
+ adopted: "adopted";
92
+ defined: "defined";
93
+ introduced: "introduced";
94
+ in_progress: "in_progress";
95
+ complete: "complete";
96
+ consolidated: "consolidated";
97
+ experimental: "experimental";
98
+ retired: "retired";
99
+ superseded: "superseded";
100
+ abandoned: "abandoned";
101
+ deferred: "deferred";
102
+ }> & {
103
+ is(value: unknown): value is "deprecated" | "proposed" | "accepted" | "active" | "implemented" | "adopted" | "defined" | "introduced" | "in_progress" | "complete" | "consolidated" | "experimental" | "retired" | "superseded" | "abandoned" | "deferred";
104
+ }>;
105
+ lifecycle: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>>;
106
+ context: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
107
+ is(value: unknown): value is string | string[];
108
+ }>;
109
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
110
+ id: z.ZodString;
111
+ description: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
112
+ is(value: unknown): value is string | string[];
113
+ };
114
+ }, z.core.$loose> & {
115
+ is(value: unknown): value is {
116
+ [x: string]: unknown;
117
+ id: string;
118
+ description: string | string[];
119
+ };
120
+ }>>;
121
+ selected: z.ZodOptional<z.ZodString>;
122
+ rationale: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
123
+ is(value: unknown): value is string | string[];
124
+ }>;
125
+ scope: z.ZodOptional<z.ZodArray<z.ZodString>>;
126
+ operations: z.ZodOptional<z.ZodArray<z.ZodObject<{
127
+ type: z.ZodEnum<{
128
+ link: "link";
129
+ add: "add";
130
+ update: "update";
131
+ remove: "remove";
132
+ }>;
133
+ target: z.ZodOptional<z.ZodString>;
134
+ description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
135
+ is(value: unknown): value is string | string[];
136
+ }>;
137
+ }, z.core.$loose> & {
138
+ is(value: unknown): value is {
139
+ [x: string]: unknown;
140
+ type: "link" | "add" | "update" | "remove";
141
+ target?: string | undefined;
142
+ description?: string | string[] | undefined;
143
+ };
144
+ }>>;
145
+ plan: z.ZodOptional<z.ZodArray<z.ZodObject<{
146
+ description: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
147
+ is(value: unknown): value is string | string[];
148
+ };
149
+ done: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
150
+ }, z.core.$loose> & {
151
+ is(value: unknown): value is {
152
+ [x: string]: unknown;
153
+ description: string | string[];
154
+ done?: boolean | undefined;
155
+ };
156
+ }>>;
157
+ propagation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
158
+ includes: z.ZodOptional<z.ZodArray<z.ZodString>>;
159
+ input: z.ZodOptional<z.ZodString>;
160
+ output: z.ZodOptional<z.ZodString>;
161
+ external_references: z.ZodOptional<z.ZodArray<z.ZodObject<{
162
+ role: z.ZodEnum<{
163
+ output: "output";
164
+ input: "input";
165
+ context: "context";
166
+ evidence: "evidence";
167
+ source: "source";
168
+ standard: "standard";
169
+ prior_art: "prior_art";
170
+ }> & {
171
+ is(value: unknown): value is "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
172
+ };
173
+ identifier: z.ZodString;
174
+ description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
175
+ is(value: unknown): value is string | string[];
176
+ }>;
177
+ node_id: z.ZodOptional<z.ZodString>;
178
+ internalised: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
179
+ is(value: unknown): value is string | string[];
180
+ }>;
181
+ }, z.core.$strip> & {
182
+ is(value: unknown): value is {
183
+ role: "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
184
+ identifier: string;
185
+ description?: string | string[] | undefined;
186
+ node_id?: string | undefined;
187
+ internalised?: string | string[] | undefined;
188
+ };
189
+ }>>;
190
+ readonly subsystem: z.ZodOptional<z.ZodObject</*elided*/ any, z.core.$strip>>;
191
+ }, z.core.$loose>>;
192
+ relationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
193
+ from: z.ZodString;
194
+ to: z.ZodString;
195
+ type: z.ZodEnum<{
196
+ refines: "refines";
197
+ realises: "realises";
198
+ implements: "implements";
199
+ depends_on: "depends_on";
200
+ constrained_by: "constrained_by";
201
+ affects: "affects";
202
+ supersedes: "supersedes";
203
+ must_preserve: "must_preserve";
204
+ performs: "performs";
205
+ part_of: "part_of";
206
+ precedes: "precedes";
207
+ must_follow: "must_follow";
208
+ blocks: "blocks";
209
+ routes_to: "routes_to";
210
+ governed_by: "governed_by";
211
+ modifies: "modifies";
212
+ triggered_by: "triggered_by";
213
+ applies_to: "applies_to";
214
+ produces: "produces";
215
+ consumes: "consumes";
216
+ transforms_into: "transforms_into";
217
+ selects: "selects";
218
+ requires: "requires";
219
+ disables: "disables";
220
+ }> & {
221
+ is(value: unknown): value is "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "performs" | "part_of" | "precedes" | "must_follow" | "blocks" | "routes_to" | "governed_by" | "modifies" | "triggered_by" | "applies_to" | "produces" | "consumes" | "transforms_into" | "selects" | "requires" | "disables";
222
+ };
223
+ description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
224
+ is(value: unknown): value is string | string[];
225
+ }>;
226
+ }, z.core.$loose> & {
227
+ is(value: unknown): value is {
228
+ [x: string]: unknown;
229
+ from: string;
230
+ to: string;
231
+ type: "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "performs" | "part_of" | "precedes" | "must_follow" | "blocks" | "routes_to" | "governed_by" | "modifies" | "triggered_by" | "applies_to" | "produces" | "consumes" | "transforms_into" | "selects" | "requires" | "disables";
232
+ description?: string | string[] | undefined;
233
+ };
234
+ }>>;
235
+ external_references: z.ZodOptional<z.ZodArray<z.ZodObject<{
236
+ role: z.ZodEnum<{
237
+ output: "output";
238
+ input: "input";
239
+ context: "context";
240
+ evidence: "evidence";
241
+ source: "source";
242
+ standard: "standard";
243
+ prior_art: "prior_art";
244
+ }> & {
245
+ is(value: unknown): value is "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
246
+ };
247
+ identifier: z.ZodString;
248
+ description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
249
+ is(value: unknown): value is string | string[];
250
+ }>;
251
+ node_id: z.ZodOptional<z.ZodString>;
252
+ internalised: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
253
+ is(value: unknown): value is string | string[];
254
+ }>;
255
+ }, z.core.$strip> & {
256
+ is(value: unknown): value is {
257
+ role: "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
258
+ identifier: string;
259
+ description?: string | string[] | undefined;
260
+ node_id?: string | undefined;
261
+ internalised?: string | string[] | undefined;
262
+ };
263
+ }>>;
264
+ }, z.core.$strip> & {
265
+ is(value: unknown): value is {
266
+ nodes: {
267
+ [x: string]: unknown;
268
+ id: string;
269
+ type: "intent" | "concept" | "capability" | "element" | "realisation" | "invariant" | "principle" | "policy" | "protocol" | "stage" | "role" | "gate" | "mode" | "artefact" | "artefact_flow" | "decision" | "change" | "view" | "milestone" | "version";
270
+ name: string;
271
+ description?: string | string[] | undefined;
272
+ status?: "deprecated" | "proposed" | "accepted" | "active" | "implemented" | "adopted" | "defined" | "introduced" | "in_progress" | "complete" | "consolidated" | "experimental" | "retired" | "superseded" | "abandoned" | "deferred" | undefined;
273
+ lifecycle?: Record<string, string | boolean> | undefined;
274
+ context?: string | string[] | undefined;
275
+ options?: {
276
+ [x: string]: unknown;
277
+ id: string;
278
+ description: string | string[];
279
+ }[] | undefined;
280
+ selected?: string | undefined;
281
+ rationale?: string | string[] | undefined;
282
+ scope?: string[] | undefined;
283
+ operations?: {
284
+ [x: string]: unknown;
285
+ type: "link" | "add" | "update" | "remove";
286
+ target?: string | undefined;
287
+ description?: string | string[] | undefined;
288
+ }[] | undefined;
289
+ plan?: {
290
+ [x: string]: unknown;
291
+ description: string | string[];
292
+ done?: boolean | undefined;
293
+ }[] | undefined;
294
+ propagation?: Record<string, boolean> | undefined;
295
+ includes?: string[] | undefined;
296
+ input?: string | undefined;
297
+ output?: string | undefined;
298
+ external_references?: {
299
+ role: "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
300
+ identifier: string;
301
+ description?: string | string[] | undefined;
302
+ node_id?: string | undefined;
303
+ internalised?: string | string[] | undefined;
304
+ }[] | undefined;
305
+ subsystem?: /*elided*/ any | undefined;
306
+ }[];
307
+ $schema?: string | undefined;
308
+ metadata?: {
309
+ [x: string]: unknown;
310
+ title?: string | undefined;
311
+ doc_type?: string | undefined;
312
+ scope?: string | undefined;
313
+ status?: string | undefined;
314
+ version?: string | number | undefined;
315
+ } | undefined;
316
+ relationships?: {
317
+ [x: string]: unknown;
318
+ from: string;
319
+ to: string;
320
+ type: "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "performs" | "part_of" | "precedes" | "must_follow" | "blocks" | "routes_to" | "governed_by" | "modifies" | "triggered_by" | "applies_to" | "produces" | "consumes" | "transforms_into" | "selects" | "requires" | "disables";
321
+ description?: string | string[] | undefined;
322
+ }[] | undefined;
323
+ external_references?: {
324
+ role: "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
325
+ identifier: string;
326
+ description?: string | string[] | undefined;
327
+ node_id?: string | undefined;
328
+ internalised?: string | string[] | undefined;
329
+ }[] | undefined;
330
+ };
331
+ };
332
+ prefix: z.ZodString;
333
+ phase: z.ZodNumber;
334
+ }, z.core.$strip>, z.ZodObject<{
335
+ phase: z.ZodNumber;
336
+ ready: z.ZodBoolean;
337
+ issues: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
338
+ kind: z.ZodLiteral<"previous_tasks_incomplete">;
339
+ phase: z.ZodNumber;
340
+ remaining: z.ZodNumber;
341
+ }, z.core.$strip>, z.ZodObject<{
342
+ kind: z.ZodLiteral<"user_story_no_change">;
343
+ storyId: z.ZodString;
344
+ }, z.core.$strip>, z.ZodObject<{
345
+ kind: z.ZodLiteral<"user_story_no_acceptance_criteria">;
346
+ storyId: z.ZodString;
347
+ }, z.core.$strip>, z.ZodObject<{
348
+ kind: z.ZodLiteral<"fr_no_change">;
349
+ frId: z.ZodString;
350
+ }, z.core.$strip>]>>;
351
+ }, z.core.$strip>>;
@@ -0,0 +1,41 @@
1
+ import * as z from "zod";
2
+ import { defineOperation } from "./define-operation.js";
3
+ import { SysProMDocument } from "../schema.js";
4
+ import { checkGate } from "../speckit/plan.js";
5
+ export const GateIssueSchema = z.union([
6
+ z.object({
7
+ kind: z.literal("previous_tasks_incomplete"),
8
+ phase: z.number(),
9
+ remaining: z.number(),
10
+ }),
11
+ z.object({
12
+ kind: z.literal("user_story_no_change"),
13
+ storyId: z.string(),
14
+ }),
15
+ z.object({
16
+ kind: z.literal("user_story_no_acceptance_criteria"),
17
+ storyId: z.string(),
18
+ }),
19
+ z.object({
20
+ kind: z.literal("fr_no_change"),
21
+ frId: z.string(),
22
+ }),
23
+ ]);
24
+ export const GateResultSchema = z.object({
25
+ phase: z.number(),
26
+ ready: z.boolean(),
27
+ issues: z.array(GateIssueSchema),
28
+ });
29
+ export const planGateOp = defineOperation({
30
+ name: "planGate",
31
+ description: "Check gate criteria for phase entry",
32
+ input: z.object({
33
+ doc: SysProMDocument,
34
+ prefix: z.string().describe("Plan prefix"),
35
+ phase: z.number().int().positive().describe("Phase number (1-indexed)"),
36
+ }),
37
+ output: GateResultSchema,
38
+ fn({ doc, prefix, phase }) {
39
+ return checkGate(doc, prefix, phase);
40
+ },
41
+ });