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,299 @@
1
+ import * as z from "zod";
2
+ export declare const planInitOp: import("./define-operation.js").DefinedOperation<z.ZodObject<{
3
+ prefix: z.ZodString;
4
+ name: z.ZodOptional<z.ZodString>;
5
+ }, z.core.$strip>, z.ZodObject<{
6
+ $schema: z.ZodOptional<z.ZodString>;
7
+ metadata: z.ZodOptional<z.ZodObject<{
8
+ title: z.ZodOptional<z.ZodString>;
9
+ doc_type: z.ZodOptional<z.ZodString>;
10
+ scope: z.ZodOptional<z.ZodString>;
11
+ status: z.ZodOptional<z.ZodString>;
12
+ version: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
13
+ }, z.core.$loose> & {
14
+ is(value: unknown): value is {
15
+ [x: string]: unknown;
16
+ title?: string | undefined;
17
+ doc_type?: string | undefined;
18
+ scope?: string | undefined;
19
+ status?: string | undefined;
20
+ version?: string | number | undefined;
21
+ };
22
+ }>;
23
+ nodes: z.ZodArray<z.ZodObject<{
24
+ id: z.ZodString;
25
+ type: z.ZodEnum<{
26
+ intent: "intent";
27
+ concept: "concept";
28
+ capability: "capability";
29
+ element: "element";
30
+ realisation: "realisation";
31
+ invariant: "invariant";
32
+ principle: "principle";
33
+ policy: "policy";
34
+ protocol: "protocol";
35
+ stage: "stage";
36
+ role: "role";
37
+ gate: "gate";
38
+ mode: "mode";
39
+ artefact: "artefact";
40
+ artefact_flow: "artefact_flow";
41
+ decision: "decision";
42
+ change: "change";
43
+ view: "view";
44
+ milestone: "milestone";
45
+ version: "version";
46
+ }> & {
47
+ 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";
48
+ };
49
+ name: z.ZodString;
50
+ description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
51
+ is(value: unknown): value is string | string[];
52
+ }>;
53
+ status: z.ZodOptional<z.ZodEnum<{
54
+ deprecated: "deprecated";
55
+ proposed: "proposed";
56
+ accepted: "accepted";
57
+ active: "active";
58
+ implemented: "implemented";
59
+ adopted: "adopted";
60
+ defined: "defined";
61
+ introduced: "introduced";
62
+ in_progress: "in_progress";
63
+ complete: "complete";
64
+ consolidated: "consolidated";
65
+ experimental: "experimental";
66
+ retired: "retired";
67
+ superseded: "superseded";
68
+ abandoned: "abandoned";
69
+ deferred: "deferred";
70
+ }> & {
71
+ is(value: unknown): value is "deprecated" | "proposed" | "accepted" | "active" | "implemented" | "adopted" | "defined" | "introduced" | "in_progress" | "complete" | "consolidated" | "experimental" | "retired" | "superseded" | "abandoned" | "deferred";
72
+ }>;
73
+ lifecycle: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>>;
74
+ context: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
75
+ is(value: unknown): value is string | string[];
76
+ }>;
77
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
78
+ id: z.ZodString;
79
+ description: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
80
+ is(value: unknown): value is string | string[];
81
+ };
82
+ }, z.core.$loose> & {
83
+ is(value: unknown): value is {
84
+ [x: string]: unknown;
85
+ id: string;
86
+ description: string | string[];
87
+ };
88
+ }>>;
89
+ selected: z.ZodOptional<z.ZodString>;
90
+ rationale: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
91
+ is(value: unknown): value is string | string[];
92
+ }>;
93
+ scope: z.ZodOptional<z.ZodArray<z.ZodString>>;
94
+ operations: z.ZodOptional<z.ZodArray<z.ZodObject<{
95
+ type: z.ZodEnum<{
96
+ link: "link";
97
+ add: "add";
98
+ update: "update";
99
+ remove: "remove";
100
+ }>;
101
+ target: z.ZodOptional<z.ZodString>;
102
+ description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
103
+ is(value: unknown): value is string | string[];
104
+ }>;
105
+ }, z.core.$loose> & {
106
+ is(value: unknown): value is {
107
+ [x: string]: unknown;
108
+ type: "link" | "add" | "update" | "remove";
109
+ target?: string | undefined;
110
+ description?: string | string[] | undefined;
111
+ };
112
+ }>>;
113
+ plan: z.ZodOptional<z.ZodArray<z.ZodObject<{
114
+ description: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
115
+ is(value: unknown): value is string | string[];
116
+ };
117
+ done: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
118
+ }, z.core.$loose> & {
119
+ is(value: unknown): value is {
120
+ [x: string]: unknown;
121
+ description: string | string[];
122
+ done?: boolean | undefined;
123
+ };
124
+ }>>;
125
+ propagation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
126
+ includes: z.ZodOptional<z.ZodArray<z.ZodString>>;
127
+ input: z.ZodOptional<z.ZodString>;
128
+ output: z.ZodOptional<z.ZodString>;
129
+ external_references: z.ZodOptional<z.ZodArray<z.ZodObject<{
130
+ role: z.ZodEnum<{
131
+ output: "output";
132
+ input: "input";
133
+ context: "context";
134
+ evidence: "evidence";
135
+ source: "source";
136
+ standard: "standard";
137
+ prior_art: "prior_art";
138
+ }> & {
139
+ is(value: unknown): value is "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
140
+ };
141
+ identifier: z.ZodString;
142
+ description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
143
+ is(value: unknown): value is string | string[];
144
+ }>;
145
+ node_id: z.ZodOptional<z.ZodString>;
146
+ internalised: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
147
+ is(value: unknown): value is string | string[];
148
+ }>;
149
+ }, z.core.$strip> & {
150
+ is(value: unknown): value is {
151
+ role: "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
152
+ identifier: string;
153
+ description?: string | string[] | undefined;
154
+ node_id?: string | undefined;
155
+ internalised?: string | string[] | undefined;
156
+ };
157
+ }>>;
158
+ readonly subsystem: z.ZodOptional<z.ZodObject</*elided*/ any, z.core.$strip>>;
159
+ }, z.core.$loose>>;
160
+ relationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
161
+ from: z.ZodString;
162
+ to: z.ZodString;
163
+ type: z.ZodEnum<{
164
+ refines: "refines";
165
+ realises: "realises";
166
+ implements: "implements";
167
+ depends_on: "depends_on";
168
+ constrained_by: "constrained_by";
169
+ affects: "affects";
170
+ supersedes: "supersedes";
171
+ must_preserve: "must_preserve";
172
+ performs: "performs";
173
+ part_of: "part_of";
174
+ precedes: "precedes";
175
+ must_follow: "must_follow";
176
+ blocks: "blocks";
177
+ routes_to: "routes_to";
178
+ governed_by: "governed_by";
179
+ modifies: "modifies";
180
+ triggered_by: "triggered_by";
181
+ applies_to: "applies_to";
182
+ produces: "produces";
183
+ consumes: "consumes";
184
+ transforms_into: "transforms_into";
185
+ selects: "selects";
186
+ requires: "requires";
187
+ disables: "disables";
188
+ }> & {
189
+ 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";
190
+ };
191
+ description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
192
+ is(value: unknown): value is string | string[];
193
+ }>;
194
+ }, z.core.$loose> & {
195
+ is(value: unknown): value is {
196
+ [x: string]: unknown;
197
+ from: string;
198
+ to: string;
199
+ 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";
200
+ description?: string | string[] | undefined;
201
+ };
202
+ }>>;
203
+ external_references: z.ZodOptional<z.ZodArray<z.ZodObject<{
204
+ role: z.ZodEnum<{
205
+ output: "output";
206
+ input: "input";
207
+ context: "context";
208
+ evidence: "evidence";
209
+ source: "source";
210
+ standard: "standard";
211
+ prior_art: "prior_art";
212
+ }> & {
213
+ is(value: unknown): value is "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
214
+ };
215
+ identifier: z.ZodString;
216
+ description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
217
+ is(value: unknown): value is string | string[];
218
+ }>;
219
+ node_id: z.ZodOptional<z.ZodString>;
220
+ internalised: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
221
+ is(value: unknown): value is string | string[];
222
+ }>;
223
+ }, z.core.$strip> & {
224
+ is(value: unknown): value is {
225
+ role: "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
226
+ identifier: string;
227
+ description?: string | string[] | undefined;
228
+ node_id?: string | undefined;
229
+ internalised?: string | string[] | undefined;
230
+ };
231
+ }>>;
232
+ }, z.core.$strip> & {
233
+ is(value: unknown): value is {
234
+ nodes: {
235
+ [x: string]: unknown;
236
+ id: string;
237
+ type: "intent" | "concept" | "capability" | "element" | "realisation" | "invariant" | "principle" | "policy" | "protocol" | "stage" | "role" | "gate" | "mode" | "artefact" | "artefact_flow" | "decision" | "change" | "view" | "milestone" | "version";
238
+ name: string;
239
+ description?: string | string[] | undefined;
240
+ status?: "deprecated" | "proposed" | "accepted" | "active" | "implemented" | "adopted" | "defined" | "introduced" | "in_progress" | "complete" | "consolidated" | "experimental" | "retired" | "superseded" | "abandoned" | "deferred" | undefined;
241
+ lifecycle?: Record<string, string | boolean> | undefined;
242
+ context?: string | string[] | undefined;
243
+ options?: {
244
+ [x: string]: unknown;
245
+ id: string;
246
+ description: string | string[];
247
+ }[] | undefined;
248
+ selected?: string | undefined;
249
+ rationale?: string | string[] | undefined;
250
+ scope?: string[] | undefined;
251
+ operations?: {
252
+ [x: string]: unknown;
253
+ type: "link" | "add" | "update" | "remove";
254
+ target?: string | undefined;
255
+ description?: string | string[] | undefined;
256
+ }[] | undefined;
257
+ plan?: {
258
+ [x: string]: unknown;
259
+ description: string | string[];
260
+ done?: boolean | undefined;
261
+ }[] | undefined;
262
+ propagation?: Record<string, boolean> | undefined;
263
+ includes?: string[] | undefined;
264
+ input?: string | undefined;
265
+ output?: string | undefined;
266
+ external_references?: {
267
+ role: "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
268
+ identifier: string;
269
+ description?: string | string[] | undefined;
270
+ node_id?: string | undefined;
271
+ internalised?: string | string[] | undefined;
272
+ }[] | undefined;
273
+ subsystem?: /*elided*/ any | undefined;
274
+ }[];
275
+ $schema?: string | undefined;
276
+ metadata?: {
277
+ [x: string]: unknown;
278
+ title?: string | undefined;
279
+ doc_type?: string | undefined;
280
+ scope?: string | undefined;
281
+ status?: string | undefined;
282
+ version?: string | number | undefined;
283
+ } | undefined;
284
+ relationships?: {
285
+ [x: string]: unknown;
286
+ from: string;
287
+ to: string;
288
+ 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";
289
+ description?: string | string[] | undefined;
290
+ }[] | undefined;
291
+ external_references?: {
292
+ role: "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
293
+ identifier: string;
294
+ description?: string | string[] | undefined;
295
+ node_id?: string | undefined;
296
+ internalised?: string | string[] | undefined;
297
+ }[] | undefined;
298
+ };
299
+ }>;
@@ -0,0 +1,17 @@
1
+ import * as z from "zod";
2
+ import { defineOperation } from "./define-operation.js";
3
+ import { SysProMDocument } from "../schema.js";
4
+ import { initDocument } from "../speckit/plan.js";
5
+ export const planInitOp = defineOperation({
6
+ name: "planInit",
7
+ description: "Initialise a new SysProM plan document with standard structure",
8
+ input: z.object({
9
+ prefix: z.string().describe("Plan prefix (e.g. PLAN)"),
10
+ name: z.string().optional().describe("Plan name (defaults to prefix)"),
11
+ }),
12
+ output: SysProMDocument,
13
+ fn({ prefix, name }) {
14
+ const planName = name ?? prefix;
15
+ return initDocument(prefix, planName);
16
+ },
17
+ });
@@ -0,0 +1,313 @@
1
+ import * as z from "zod";
2
+ export declare const PhaseProgressSchema: z.ZodObject<{
3
+ phase: z.ZodNumber;
4
+ name: z.ZodString;
5
+ done: z.ZodNumber;
6
+ total: z.ZodNumber;
7
+ percent: z.ZodNumber;
8
+ }, z.core.$strip>;
9
+ export type PhaseProgressResult = z.infer<typeof PhaseProgressSchema>;
10
+ export declare const planProgressOp: import("./define-operation.js").DefinedOperation<z.ZodObject<{
11
+ doc: z.ZodObject<{
12
+ $schema: z.ZodOptional<z.ZodString>;
13
+ metadata: z.ZodOptional<z.ZodObject<{
14
+ title: z.ZodOptional<z.ZodString>;
15
+ doc_type: z.ZodOptional<z.ZodString>;
16
+ scope: z.ZodOptional<z.ZodString>;
17
+ status: z.ZodOptional<z.ZodString>;
18
+ version: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
19
+ }, z.core.$loose> & {
20
+ is(value: unknown): value is {
21
+ [x: string]: unknown;
22
+ title?: string | undefined;
23
+ doc_type?: string | undefined;
24
+ scope?: string | undefined;
25
+ status?: string | undefined;
26
+ version?: string | number | undefined;
27
+ };
28
+ }>;
29
+ nodes: z.ZodArray<z.ZodObject<{
30
+ id: z.ZodString;
31
+ type: z.ZodEnum<{
32
+ intent: "intent";
33
+ concept: "concept";
34
+ capability: "capability";
35
+ element: "element";
36
+ realisation: "realisation";
37
+ invariant: "invariant";
38
+ principle: "principle";
39
+ policy: "policy";
40
+ protocol: "protocol";
41
+ stage: "stage";
42
+ role: "role";
43
+ gate: "gate";
44
+ mode: "mode";
45
+ artefact: "artefact";
46
+ artefact_flow: "artefact_flow";
47
+ decision: "decision";
48
+ change: "change";
49
+ view: "view";
50
+ milestone: "milestone";
51
+ version: "version";
52
+ }> & {
53
+ 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";
54
+ };
55
+ name: z.ZodString;
56
+ description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
57
+ is(value: unknown): value is string | string[];
58
+ }>;
59
+ status: z.ZodOptional<z.ZodEnum<{
60
+ deprecated: "deprecated";
61
+ proposed: "proposed";
62
+ accepted: "accepted";
63
+ active: "active";
64
+ implemented: "implemented";
65
+ adopted: "adopted";
66
+ defined: "defined";
67
+ introduced: "introduced";
68
+ in_progress: "in_progress";
69
+ complete: "complete";
70
+ consolidated: "consolidated";
71
+ experimental: "experimental";
72
+ retired: "retired";
73
+ superseded: "superseded";
74
+ abandoned: "abandoned";
75
+ deferred: "deferred";
76
+ }> & {
77
+ is(value: unknown): value is "deprecated" | "proposed" | "accepted" | "active" | "implemented" | "adopted" | "defined" | "introduced" | "in_progress" | "complete" | "consolidated" | "experimental" | "retired" | "superseded" | "abandoned" | "deferred";
78
+ }>;
79
+ lifecycle: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>>;
80
+ context: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
81
+ is(value: unknown): value is string | string[];
82
+ }>;
83
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
84
+ id: z.ZodString;
85
+ description: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
86
+ is(value: unknown): value is string | string[];
87
+ };
88
+ }, z.core.$loose> & {
89
+ is(value: unknown): value is {
90
+ [x: string]: unknown;
91
+ id: string;
92
+ description: string | string[];
93
+ };
94
+ }>>;
95
+ selected: z.ZodOptional<z.ZodString>;
96
+ rationale: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
97
+ is(value: unknown): value is string | string[];
98
+ }>;
99
+ scope: z.ZodOptional<z.ZodArray<z.ZodString>>;
100
+ operations: z.ZodOptional<z.ZodArray<z.ZodObject<{
101
+ type: z.ZodEnum<{
102
+ link: "link";
103
+ add: "add";
104
+ update: "update";
105
+ remove: "remove";
106
+ }>;
107
+ target: z.ZodOptional<z.ZodString>;
108
+ description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
109
+ is(value: unknown): value is string | string[];
110
+ }>;
111
+ }, z.core.$loose> & {
112
+ is(value: unknown): value is {
113
+ [x: string]: unknown;
114
+ type: "link" | "add" | "update" | "remove";
115
+ target?: string | undefined;
116
+ description?: string | string[] | undefined;
117
+ };
118
+ }>>;
119
+ plan: z.ZodOptional<z.ZodArray<z.ZodObject<{
120
+ description: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
121
+ is(value: unknown): value is string | string[];
122
+ };
123
+ done: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
124
+ }, z.core.$loose> & {
125
+ is(value: unknown): value is {
126
+ [x: string]: unknown;
127
+ description: string | string[];
128
+ done?: boolean | undefined;
129
+ };
130
+ }>>;
131
+ propagation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
132
+ includes: z.ZodOptional<z.ZodArray<z.ZodString>>;
133
+ input: z.ZodOptional<z.ZodString>;
134
+ output: z.ZodOptional<z.ZodString>;
135
+ external_references: z.ZodOptional<z.ZodArray<z.ZodObject<{
136
+ role: z.ZodEnum<{
137
+ output: "output";
138
+ input: "input";
139
+ context: "context";
140
+ evidence: "evidence";
141
+ source: "source";
142
+ standard: "standard";
143
+ prior_art: "prior_art";
144
+ }> & {
145
+ is(value: unknown): value is "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
146
+ };
147
+ identifier: z.ZodString;
148
+ description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
149
+ is(value: unknown): value is string | string[];
150
+ }>;
151
+ node_id: z.ZodOptional<z.ZodString>;
152
+ internalised: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
153
+ is(value: unknown): value is string | string[];
154
+ }>;
155
+ }, z.core.$strip> & {
156
+ is(value: unknown): value is {
157
+ role: "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
158
+ identifier: string;
159
+ description?: string | string[] | undefined;
160
+ node_id?: string | undefined;
161
+ internalised?: string | string[] | undefined;
162
+ };
163
+ }>>;
164
+ readonly subsystem: z.ZodOptional<z.ZodObject</*elided*/ any, z.core.$strip>>;
165
+ }, z.core.$loose>>;
166
+ relationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
167
+ from: z.ZodString;
168
+ to: z.ZodString;
169
+ type: z.ZodEnum<{
170
+ refines: "refines";
171
+ realises: "realises";
172
+ implements: "implements";
173
+ depends_on: "depends_on";
174
+ constrained_by: "constrained_by";
175
+ affects: "affects";
176
+ supersedes: "supersedes";
177
+ must_preserve: "must_preserve";
178
+ performs: "performs";
179
+ part_of: "part_of";
180
+ precedes: "precedes";
181
+ must_follow: "must_follow";
182
+ blocks: "blocks";
183
+ routes_to: "routes_to";
184
+ governed_by: "governed_by";
185
+ modifies: "modifies";
186
+ triggered_by: "triggered_by";
187
+ applies_to: "applies_to";
188
+ produces: "produces";
189
+ consumes: "consumes";
190
+ transforms_into: "transforms_into";
191
+ selects: "selects";
192
+ requires: "requires";
193
+ disables: "disables";
194
+ }> & {
195
+ 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";
196
+ };
197
+ description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
198
+ is(value: unknown): value is string | string[];
199
+ }>;
200
+ }, z.core.$loose> & {
201
+ is(value: unknown): value is {
202
+ [x: string]: unknown;
203
+ from: string;
204
+ to: string;
205
+ 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";
206
+ description?: string | string[] | undefined;
207
+ };
208
+ }>>;
209
+ external_references: z.ZodOptional<z.ZodArray<z.ZodObject<{
210
+ role: z.ZodEnum<{
211
+ output: "output";
212
+ input: "input";
213
+ context: "context";
214
+ evidence: "evidence";
215
+ source: "source";
216
+ standard: "standard";
217
+ prior_art: "prior_art";
218
+ }> & {
219
+ is(value: unknown): value is "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
220
+ };
221
+ identifier: z.ZodString;
222
+ description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
223
+ is(value: unknown): value is string | string[];
224
+ }>;
225
+ node_id: z.ZodOptional<z.ZodString>;
226
+ internalised: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
227
+ is(value: unknown): value is string | string[];
228
+ }>;
229
+ }, z.core.$strip> & {
230
+ is(value: unknown): value is {
231
+ role: "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
232
+ identifier: string;
233
+ description?: string | string[] | undefined;
234
+ node_id?: string | undefined;
235
+ internalised?: string | string[] | undefined;
236
+ };
237
+ }>>;
238
+ }, z.core.$strip> & {
239
+ is(value: unknown): value is {
240
+ nodes: {
241
+ [x: string]: unknown;
242
+ id: string;
243
+ type: "intent" | "concept" | "capability" | "element" | "realisation" | "invariant" | "principle" | "policy" | "protocol" | "stage" | "role" | "gate" | "mode" | "artefact" | "artefact_flow" | "decision" | "change" | "view" | "milestone" | "version";
244
+ name: string;
245
+ description?: string | string[] | undefined;
246
+ status?: "deprecated" | "proposed" | "accepted" | "active" | "implemented" | "adopted" | "defined" | "introduced" | "in_progress" | "complete" | "consolidated" | "experimental" | "retired" | "superseded" | "abandoned" | "deferred" | undefined;
247
+ lifecycle?: Record<string, string | boolean> | undefined;
248
+ context?: string | string[] | undefined;
249
+ options?: {
250
+ [x: string]: unknown;
251
+ id: string;
252
+ description: string | string[];
253
+ }[] | undefined;
254
+ selected?: string | undefined;
255
+ rationale?: string | string[] | undefined;
256
+ scope?: string[] | undefined;
257
+ operations?: {
258
+ [x: string]: unknown;
259
+ type: "link" | "add" | "update" | "remove";
260
+ target?: string | undefined;
261
+ description?: string | string[] | undefined;
262
+ }[] | undefined;
263
+ plan?: {
264
+ [x: string]: unknown;
265
+ description: string | string[];
266
+ done?: boolean | undefined;
267
+ }[] | undefined;
268
+ propagation?: Record<string, boolean> | undefined;
269
+ includes?: string[] | undefined;
270
+ input?: string | undefined;
271
+ output?: string | undefined;
272
+ external_references?: {
273
+ role: "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
274
+ identifier: string;
275
+ description?: string | string[] | undefined;
276
+ node_id?: string | undefined;
277
+ internalised?: string | string[] | undefined;
278
+ }[] | undefined;
279
+ subsystem?: /*elided*/ any | undefined;
280
+ }[];
281
+ $schema?: string | undefined;
282
+ metadata?: {
283
+ [x: string]: unknown;
284
+ title?: string | undefined;
285
+ doc_type?: string | undefined;
286
+ scope?: string | undefined;
287
+ status?: string | undefined;
288
+ version?: string | number | undefined;
289
+ } | undefined;
290
+ relationships?: {
291
+ [x: string]: unknown;
292
+ from: string;
293
+ to: string;
294
+ 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";
295
+ description?: string | string[] | undefined;
296
+ }[] | undefined;
297
+ external_references?: {
298
+ role: "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
299
+ identifier: string;
300
+ description?: string | string[] | undefined;
301
+ node_id?: string | undefined;
302
+ internalised?: string | string[] | undefined;
303
+ }[] | undefined;
304
+ };
305
+ };
306
+ prefix: z.ZodString;
307
+ }, z.core.$strip>, z.ZodArray<z.ZodObject<{
308
+ phase: z.ZodNumber;
309
+ name: z.ZodString;
310
+ done: z.ZodNumber;
311
+ total: z.ZodNumber;
312
+ percent: z.ZodNumber;
313
+ }, z.core.$strip>>>;
@@ -0,0 +1,23 @@
1
+ import * as z from "zod";
2
+ import { defineOperation } from "./define-operation.js";
3
+ import { SysProMDocument } from "../schema.js";
4
+ import { planProgress } from "../speckit/plan.js";
5
+ export const PhaseProgressSchema = z.object({
6
+ phase: z.number(),
7
+ name: z.string(),
8
+ done: z.number(),
9
+ total: z.number(),
10
+ percent: z.number(),
11
+ });
12
+ export const planProgressOp = defineOperation({
13
+ name: "planProgress",
14
+ description: "Get per-phase progress breakdown",
15
+ input: z.object({
16
+ doc: SysProMDocument,
17
+ prefix: z.string().describe("Plan prefix"),
18
+ }),
19
+ output: z.array(PhaseProgressSchema),
20
+ fn({ doc, prefix }) {
21
+ return planProgress(doc, prefix);
22
+ },
23
+ });