sysprom 1.21.2 → 1.22.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.
Files changed (82) hide show
  1. package/dist/schema.json +0 -31
  2. package/dist/src/cli/commands/plan.js +54 -3
  3. package/dist/src/cli/commands/speckit.js +0 -1
  4. package/dist/src/cli/program.js +0 -2
  5. package/dist/src/index.d.ts +2 -2
  6. package/dist/src/index.js +2 -2
  7. package/dist/src/json-to-md.js +0 -8
  8. package/dist/src/mcp/server.js +0 -1
  9. package/dist/src/md-to-json.js +0 -10
  10. package/dist/src/operations/add-node.d.ts +0 -51
  11. package/dist/src/operations/add-relationship.d.ts +0 -34
  12. package/dist/src/operations/check.d.ts +0 -17
  13. package/dist/src/operations/graph-decision.d.ts +0 -17
  14. package/dist/src/operations/graph-dependency.d.ts +0 -17
  15. package/dist/src/operations/graph-refinement.d.ts +0 -17
  16. package/dist/src/operations/graph.d.ts +0 -17
  17. package/dist/src/operations/index.d.ts +3 -5
  18. package/dist/src/operations/index.js +3 -5
  19. package/dist/src/operations/infer-completeness.d.ts +0 -17
  20. package/dist/src/operations/infer-completeness.js +0 -4
  21. package/dist/src/operations/infer-derived.d.ts +0 -17
  22. package/dist/src/operations/infer-impact.d.ts +0 -119
  23. package/dist/src/operations/infer-lifecycle.d.ts +0 -17
  24. package/dist/src/operations/init-document.d.ts +0 -17
  25. package/dist/src/operations/json-to-markdown.d.ts +0 -17
  26. package/dist/src/operations/markdown-to-json.d.ts +0 -17
  27. package/dist/src/operations/next-id.d.ts +0 -17
  28. package/dist/src/operations/node-history.d.ts +0 -17
  29. package/dist/src/operations/plan-add-task.d.ts +0 -34
  30. package/dist/src/operations/{mark-task-done.d.ts → plan-complete-task.d.ts} +4 -41
  31. package/dist/src/operations/plan-complete-task.js +18 -0
  32. package/dist/src/operations/plan-gate.d.ts +0 -17
  33. package/dist/src/operations/plan-init.d.ts +0 -17
  34. package/dist/src/operations/plan-progress.d.ts +18 -17
  35. package/dist/src/operations/plan-progress.js +6 -0
  36. package/dist/src/operations/{mark-task-undone.d.ts → plan-reopen-task.d.ts} +4 -41
  37. package/dist/src/operations/plan-reopen-task.js +18 -0
  38. package/dist/src/operations/{add-plan-task.d.ts → plan-start-task.d.ts} +4 -41
  39. package/dist/src/operations/plan-start-task.js +18 -0
  40. package/dist/src/operations/plan-status.d.ts +22 -17
  41. package/dist/src/operations/plan-status.js +8 -0
  42. package/dist/src/operations/query-node.d.ts +0 -51
  43. package/dist/src/operations/query-nodes.d.ts +0 -34
  44. package/dist/src/operations/query-relationships.d.ts +0 -17
  45. package/dist/src/operations/remove-node.d.ts +0 -51
  46. package/dist/src/operations/remove-relationship.d.ts +0 -34
  47. package/dist/src/operations/rename.d.ts +0 -34
  48. package/dist/src/operations/search.d.ts +0 -34
  49. package/dist/src/operations/speckit-diff.d.ts +0 -17
  50. package/dist/src/operations/speckit-export.d.ts +0 -17
  51. package/dist/src/operations/speckit-import.d.ts +0 -17
  52. package/dist/src/operations/speckit-sync.d.ts +0 -51
  53. package/dist/src/operations/speckit-sync.js +0 -1
  54. package/dist/src/operations/state-at.d.ts +0 -17
  55. package/dist/src/operations/stats.d.ts +0 -17
  56. package/dist/src/operations/sync.d.ts +0 -51
  57. package/dist/src/operations/timeline.d.ts +0 -17
  58. package/dist/src/operations/trace-from-node.d.ts +0 -51
  59. package/dist/src/operations/update-metadata.d.ts +0 -34
  60. package/dist/src/operations/update-node.d.ts +0 -58
  61. package/dist/src/operations/validate.d.ts +0 -17
  62. package/dist/src/operations/validate.js +71 -0
  63. package/dist/src/schema.d.ts +0 -61
  64. package/dist/src/schema.js +0 -11
  65. package/dist/src/speckit/generate.js +17 -20
  66. package/dist/src/speckit/index.d.ts +1 -1
  67. package/dist/src/speckit/index.js +1 -1
  68. package/dist/src/speckit/parse.d.ts +1 -1
  69. package/dist/src/speckit/parse.js +20 -14
  70. package/dist/src/speckit/plan.d.ts +29 -7
  71. package/dist/src/speckit/plan.js +181 -47
  72. package/package.json +1 -1
  73. package/schema.json +0 -31
  74. package/dist/src/cli/commands/task.d.ts +0 -2
  75. package/dist/src/cli/commands/task.js +0 -157
  76. package/dist/src/operations/add-plan-task.js +0 -29
  77. package/dist/src/operations/mark-task-done.js +0 -30
  78. package/dist/src/operations/mark-task-undone.js +0 -30
  79. package/dist/src/operations/task-list.d.ts +0 -288
  80. package/dist/src/operations/task-list.js +0 -49
  81. package/dist/src/operations/update-plan-task.d.ts +0 -555
  82. package/dist/src/operations/update-plan-task.js +0 -35
@@ -1,555 +0,0 @@
1
- import * as z from "zod";
2
- /**
3
- * Set the done status of a task in a change node's plan array. Returns a new document.
4
- * @throws {Error} If the change node is not found or the task index is out of range.
5
- */
6
- export declare const updatePlanTaskOp: import("./define-operation.js").DefinedOperation<z.ZodObject<{
7
- doc: z.ZodObject<{
8
- $schema: z.ZodOptional<z.ZodString>;
9
- metadata: z.ZodOptional<z.ZodObject<{
10
- title: z.ZodOptional<z.ZodString>;
11
- doc_type: z.ZodOptional<z.ZodString>;
12
- scope: z.ZodOptional<z.ZodString>;
13
- status: z.ZodOptional<z.ZodString>;
14
- version: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
15
- }, z.core.$loose> & {
16
- is(value: unknown): value is {
17
- [x: string]: unknown;
18
- title?: string | undefined;
19
- doc_type?: string | undefined;
20
- scope?: string | undefined;
21
- status?: string | undefined;
22
- version?: string | number | undefined;
23
- };
24
- }>;
25
- nodes: z.ZodArray<z.ZodObject<{
26
- id: z.ZodString;
27
- type: z.ZodEnum<{
28
- intent: "intent";
29
- concept: "concept";
30
- capability: "capability";
31
- element: "element";
32
- realisation: "realisation";
33
- invariant: "invariant";
34
- principle: "principle";
35
- policy: "policy";
36
- protocol: "protocol";
37
- stage: "stage";
38
- role: "role";
39
- gate: "gate";
40
- mode: "mode";
41
- artefact: "artefact";
42
- decision: "decision";
43
- change: "change";
44
- view: "view";
45
- milestone: "milestone";
46
- }> & {
47
- is(value: unknown): value is "intent" | "concept" | "capability" | "element" | "realisation" | "invariant" | "principle" | "policy" | "protocol" | "stage" | "role" | "gate" | "mode" | "artefact" | "decision" | "change" | "view" | "milestone";
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.ZodNever>;
54
- lifecycle: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>>;
55
- context: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
56
- is(value: unknown): value is string | string[];
57
- }>;
58
- options: z.ZodOptional<z.ZodArray<z.ZodObject<{
59
- id: z.ZodString;
60
- description: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
61
- is(value: unknown): value is string | string[];
62
- };
63
- }, z.core.$loose> & {
64
- is(value: unknown): value is {
65
- [x: string]: unknown;
66
- id: string;
67
- description: string | string[];
68
- };
69
- }>>;
70
- selected: z.ZodOptional<z.ZodString>;
71
- rationale: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
72
- is(value: unknown): value is string | string[];
73
- }>;
74
- scope: z.ZodOptional<z.ZodArray<z.ZodString>>;
75
- operations: z.ZodOptional<z.ZodArray<z.ZodObject<{
76
- type: z.ZodEnum<{
77
- link: "link";
78
- add: "add";
79
- update: "update";
80
- remove: "remove";
81
- }>;
82
- target: z.ZodOptional<z.ZodString>;
83
- description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
84
- is(value: unknown): value is string | string[];
85
- }>;
86
- }, z.core.$loose> & {
87
- is(value: unknown): value is {
88
- [x: string]: unknown;
89
- type: "link" | "add" | "update" | "remove";
90
- target?: string | undefined;
91
- description?: string | string[] | undefined;
92
- };
93
- }>>;
94
- plan: z.ZodOptional<z.ZodArray<z.ZodObject<{
95
- description: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
96
- is(value: unknown): value is string | string[];
97
- };
98
- done: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
99
- }, z.core.$loose> & {
100
- is(value: unknown): value is {
101
- [x: string]: unknown;
102
- description: string | string[];
103
- done?: boolean | undefined;
104
- };
105
- }>>;
106
- propagation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
107
- includes: z.ZodOptional<z.ZodArray<z.ZodString>>;
108
- external_references: z.ZodOptional<z.ZodArray<z.ZodObject<{
109
- role: z.ZodEnum<{
110
- output: "output";
111
- input: "input";
112
- context: "context";
113
- evidence: "evidence";
114
- source: "source";
115
- standard: "standard";
116
- prior_art: "prior_art";
117
- }> & {
118
- is(value: unknown): value is "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
119
- };
120
- identifier: z.ZodString;
121
- description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
122
- is(value: unknown): value is string | string[];
123
- }>;
124
- node_id: z.ZodOptional<z.ZodString>;
125
- internalised: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
126
- is(value: unknown): value is string | string[];
127
- }>;
128
- }, z.core.$strip> & {
129
- is(value: unknown): value is {
130
- role: "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
131
- identifier: string;
132
- description?: string | string[] | undefined;
133
- node_id?: string | undefined;
134
- internalised?: string | string[] | undefined;
135
- };
136
- }>>;
137
- readonly subsystem: z.ZodOptional<z.ZodObject</*elided*/ any, z.core.$strip>>;
138
- }, z.core.$loose>>;
139
- relationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
140
- from: z.ZodString;
141
- to: z.ZodString;
142
- type: z.ZodEnum<{
143
- refines: "refines";
144
- realises: "realises";
145
- implements: "implements";
146
- depends_on: "depends_on";
147
- constrained_by: "constrained_by";
148
- affects: "affects";
149
- supersedes: "supersedes";
150
- must_preserve: "must_preserve";
151
- part_of: "part_of";
152
- precedes: "precedes";
153
- must_follow: "must_follow";
154
- governed_by: "governed_by";
155
- modifies: "modifies";
156
- produces: "produces";
157
- }> & {
158
- is(value: unknown): value is "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "part_of" | "precedes" | "must_follow" | "governed_by" | "modifies" | "produces";
159
- };
160
- description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
161
- is(value: unknown): value is string | string[];
162
- }>;
163
- polarity: z.ZodOptional<z.ZodEnum<{
164
- positive: "positive";
165
- negative: "negative";
166
- neutral: "neutral";
167
- uncertain: "uncertain";
168
- }> & {
169
- is(value: unknown): value is "positive" | "negative" | "neutral" | "uncertain";
170
- }>;
171
- strength: z.ZodOptional<z.ZodNumber>;
172
- }, z.core.$loose> & {
173
- is(value: unknown): value is {
174
- [x: string]: unknown;
175
- from: string;
176
- to: string;
177
- type: "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "part_of" | "precedes" | "must_follow" | "governed_by" | "modifies" | "produces";
178
- description?: string | string[] | undefined;
179
- polarity?: "positive" | "negative" | "neutral" | "uncertain" | undefined;
180
- strength?: number | undefined;
181
- };
182
- }>>;
183
- external_references: z.ZodOptional<z.ZodArray<z.ZodObject<{
184
- role: z.ZodEnum<{
185
- output: "output";
186
- input: "input";
187
- context: "context";
188
- evidence: "evidence";
189
- source: "source";
190
- standard: "standard";
191
- prior_art: "prior_art";
192
- }> & {
193
- is(value: unknown): value is "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
194
- };
195
- identifier: z.ZodString;
196
- description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
197
- is(value: unknown): value is string | string[];
198
- }>;
199
- node_id: z.ZodOptional<z.ZodString>;
200
- internalised: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
201
- is(value: unknown): value is string | string[];
202
- }>;
203
- }, z.core.$strip> & {
204
- is(value: unknown): value is {
205
- role: "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
206
- identifier: string;
207
- description?: string | string[] | undefined;
208
- node_id?: string | undefined;
209
- internalised?: string | string[] | undefined;
210
- };
211
- }>>;
212
- }, z.core.$strip> & {
213
- is(value: unknown): value is {
214
- nodes: {
215
- [x: string]: unknown;
216
- id: string;
217
- type: "intent" | "concept" | "capability" | "element" | "realisation" | "invariant" | "principle" | "policy" | "protocol" | "stage" | "role" | "gate" | "mode" | "artefact" | "decision" | "change" | "view" | "milestone";
218
- name: string;
219
- description?: string | string[] | undefined;
220
- status?: undefined;
221
- lifecycle?: Record<string, string | boolean> | undefined;
222
- context?: string | string[] | undefined;
223
- options?: {
224
- [x: string]: unknown;
225
- id: string;
226
- description: string | string[];
227
- }[] | undefined;
228
- selected?: string | undefined;
229
- rationale?: string | string[] | undefined;
230
- scope?: string[] | undefined;
231
- operations?: {
232
- [x: string]: unknown;
233
- type: "link" | "add" | "update" | "remove";
234
- target?: string | undefined;
235
- description?: string | string[] | undefined;
236
- }[] | undefined;
237
- plan?: {
238
- [x: string]: unknown;
239
- description: string | string[];
240
- done?: boolean | undefined;
241
- }[] | undefined;
242
- propagation?: Record<string, boolean> | undefined;
243
- includes?: string[] | undefined;
244
- external_references?: {
245
- role: "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
246
- identifier: string;
247
- description?: string | string[] | undefined;
248
- node_id?: string | undefined;
249
- internalised?: string | string[] | undefined;
250
- }[] | undefined;
251
- subsystem?: /*elided*/ any | undefined;
252
- }[];
253
- $schema?: string | undefined;
254
- metadata?: {
255
- [x: string]: unknown;
256
- title?: string | undefined;
257
- doc_type?: string | undefined;
258
- scope?: string | undefined;
259
- status?: string | undefined;
260
- version?: string | number | undefined;
261
- } | undefined;
262
- relationships?: {
263
- [x: string]: unknown;
264
- from: string;
265
- to: string;
266
- type: "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "part_of" | "precedes" | "must_follow" | "governed_by" | "modifies" | "produces";
267
- description?: string | string[] | undefined;
268
- polarity?: "positive" | "negative" | "neutral" | "uncertain" | undefined;
269
- strength?: number | undefined;
270
- }[] | undefined;
271
- external_references?: {
272
- role: "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
273
- identifier: string;
274
- description?: string | string[] | undefined;
275
- node_id?: string | undefined;
276
- internalised?: string | string[] | undefined;
277
- }[] | undefined;
278
- };
279
- };
280
- changeId: z.ZodString;
281
- taskIndex: z.ZodNumber;
282
- done: z.ZodBoolean;
283
- }, z.core.$strip>, z.ZodObject<{
284
- $schema: z.ZodOptional<z.ZodString>;
285
- metadata: z.ZodOptional<z.ZodObject<{
286
- title: z.ZodOptional<z.ZodString>;
287
- doc_type: z.ZodOptional<z.ZodString>;
288
- scope: z.ZodOptional<z.ZodString>;
289
- status: z.ZodOptional<z.ZodString>;
290
- version: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
291
- }, z.core.$loose> & {
292
- is(value: unknown): value is {
293
- [x: string]: unknown;
294
- title?: string | undefined;
295
- doc_type?: string | undefined;
296
- scope?: string | undefined;
297
- status?: string | undefined;
298
- version?: string | number | undefined;
299
- };
300
- }>;
301
- nodes: z.ZodArray<z.ZodObject<{
302
- id: z.ZodString;
303
- type: z.ZodEnum<{
304
- intent: "intent";
305
- concept: "concept";
306
- capability: "capability";
307
- element: "element";
308
- realisation: "realisation";
309
- invariant: "invariant";
310
- principle: "principle";
311
- policy: "policy";
312
- protocol: "protocol";
313
- stage: "stage";
314
- role: "role";
315
- gate: "gate";
316
- mode: "mode";
317
- artefact: "artefact";
318
- decision: "decision";
319
- change: "change";
320
- view: "view";
321
- milestone: "milestone";
322
- }> & {
323
- is(value: unknown): value is "intent" | "concept" | "capability" | "element" | "realisation" | "invariant" | "principle" | "policy" | "protocol" | "stage" | "role" | "gate" | "mode" | "artefact" | "decision" | "change" | "view" | "milestone";
324
- };
325
- name: z.ZodString;
326
- description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
327
- is(value: unknown): value is string | string[];
328
- }>;
329
- status: z.ZodOptional<z.ZodNever>;
330
- lifecycle: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>>;
331
- context: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
332
- is(value: unknown): value is string | string[];
333
- }>;
334
- options: z.ZodOptional<z.ZodArray<z.ZodObject<{
335
- id: z.ZodString;
336
- description: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
337
- is(value: unknown): value is string | string[];
338
- };
339
- }, z.core.$loose> & {
340
- is(value: unknown): value is {
341
- [x: string]: unknown;
342
- id: string;
343
- description: string | string[];
344
- };
345
- }>>;
346
- selected: z.ZodOptional<z.ZodString>;
347
- rationale: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
348
- is(value: unknown): value is string | string[];
349
- }>;
350
- scope: z.ZodOptional<z.ZodArray<z.ZodString>>;
351
- operations: z.ZodOptional<z.ZodArray<z.ZodObject<{
352
- type: z.ZodEnum<{
353
- link: "link";
354
- add: "add";
355
- update: "update";
356
- remove: "remove";
357
- }>;
358
- target: z.ZodOptional<z.ZodString>;
359
- description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
360
- is(value: unknown): value is string | string[];
361
- }>;
362
- }, z.core.$loose> & {
363
- is(value: unknown): value is {
364
- [x: string]: unknown;
365
- type: "link" | "add" | "update" | "remove";
366
- target?: string | undefined;
367
- description?: string | string[] | undefined;
368
- };
369
- }>>;
370
- plan: z.ZodOptional<z.ZodArray<z.ZodObject<{
371
- description: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
372
- is(value: unknown): value is string | string[];
373
- };
374
- done: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
375
- }, z.core.$loose> & {
376
- is(value: unknown): value is {
377
- [x: string]: unknown;
378
- description: string | string[];
379
- done?: boolean | undefined;
380
- };
381
- }>>;
382
- propagation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
383
- includes: z.ZodOptional<z.ZodArray<z.ZodString>>;
384
- external_references: z.ZodOptional<z.ZodArray<z.ZodObject<{
385
- role: z.ZodEnum<{
386
- output: "output";
387
- input: "input";
388
- context: "context";
389
- evidence: "evidence";
390
- source: "source";
391
- standard: "standard";
392
- prior_art: "prior_art";
393
- }> & {
394
- is(value: unknown): value is "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
395
- };
396
- identifier: z.ZodString;
397
- description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
398
- is(value: unknown): value is string | string[];
399
- }>;
400
- node_id: z.ZodOptional<z.ZodString>;
401
- internalised: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
402
- is(value: unknown): value is string | string[];
403
- }>;
404
- }, z.core.$strip> & {
405
- is(value: unknown): value is {
406
- role: "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
407
- identifier: string;
408
- description?: string | string[] | undefined;
409
- node_id?: string | undefined;
410
- internalised?: string | string[] | undefined;
411
- };
412
- }>>;
413
- readonly subsystem: z.ZodOptional<z.ZodObject</*elided*/ any, z.core.$strip>>;
414
- }, z.core.$loose>>;
415
- relationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
416
- from: z.ZodString;
417
- to: z.ZodString;
418
- type: z.ZodEnum<{
419
- refines: "refines";
420
- realises: "realises";
421
- implements: "implements";
422
- depends_on: "depends_on";
423
- constrained_by: "constrained_by";
424
- affects: "affects";
425
- supersedes: "supersedes";
426
- must_preserve: "must_preserve";
427
- part_of: "part_of";
428
- precedes: "precedes";
429
- must_follow: "must_follow";
430
- governed_by: "governed_by";
431
- modifies: "modifies";
432
- produces: "produces";
433
- }> & {
434
- is(value: unknown): value is "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "part_of" | "precedes" | "must_follow" | "governed_by" | "modifies" | "produces";
435
- };
436
- description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
437
- is(value: unknown): value is string | string[];
438
- }>;
439
- polarity: z.ZodOptional<z.ZodEnum<{
440
- positive: "positive";
441
- negative: "negative";
442
- neutral: "neutral";
443
- uncertain: "uncertain";
444
- }> & {
445
- is(value: unknown): value is "positive" | "negative" | "neutral" | "uncertain";
446
- }>;
447
- strength: z.ZodOptional<z.ZodNumber>;
448
- }, z.core.$loose> & {
449
- is(value: unknown): value is {
450
- [x: string]: unknown;
451
- from: string;
452
- to: string;
453
- type: "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "part_of" | "precedes" | "must_follow" | "governed_by" | "modifies" | "produces";
454
- description?: string | string[] | undefined;
455
- polarity?: "positive" | "negative" | "neutral" | "uncertain" | undefined;
456
- strength?: number | undefined;
457
- };
458
- }>>;
459
- external_references: z.ZodOptional<z.ZodArray<z.ZodObject<{
460
- role: z.ZodEnum<{
461
- output: "output";
462
- input: "input";
463
- context: "context";
464
- evidence: "evidence";
465
- source: "source";
466
- standard: "standard";
467
- prior_art: "prior_art";
468
- }> & {
469
- is(value: unknown): value is "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
470
- };
471
- identifier: z.ZodString;
472
- description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
473
- is(value: unknown): value is string | string[];
474
- }>;
475
- node_id: z.ZodOptional<z.ZodString>;
476
- internalised: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
477
- is(value: unknown): value is string | string[];
478
- }>;
479
- }, z.core.$strip> & {
480
- is(value: unknown): value is {
481
- role: "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
482
- identifier: string;
483
- description?: string | string[] | undefined;
484
- node_id?: string | undefined;
485
- internalised?: string | string[] | undefined;
486
- };
487
- }>>;
488
- }, z.core.$strip> & {
489
- is(value: unknown): value is {
490
- nodes: {
491
- [x: string]: unknown;
492
- id: string;
493
- type: "intent" | "concept" | "capability" | "element" | "realisation" | "invariant" | "principle" | "policy" | "protocol" | "stage" | "role" | "gate" | "mode" | "artefact" | "decision" | "change" | "view" | "milestone";
494
- name: string;
495
- description?: string | string[] | undefined;
496
- status?: undefined;
497
- lifecycle?: Record<string, string | boolean> | undefined;
498
- context?: string | string[] | undefined;
499
- options?: {
500
- [x: string]: unknown;
501
- id: string;
502
- description: string | string[];
503
- }[] | undefined;
504
- selected?: string | undefined;
505
- rationale?: string | string[] | undefined;
506
- scope?: string[] | undefined;
507
- operations?: {
508
- [x: string]: unknown;
509
- type: "link" | "add" | "update" | "remove";
510
- target?: string | undefined;
511
- description?: string | string[] | undefined;
512
- }[] | undefined;
513
- plan?: {
514
- [x: string]: unknown;
515
- description: string | string[];
516
- done?: boolean | undefined;
517
- }[] | undefined;
518
- propagation?: Record<string, boolean> | undefined;
519
- includes?: string[] | undefined;
520
- external_references?: {
521
- role: "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
522
- identifier: string;
523
- description?: string | string[] | undefined;
524
- node_id?: string | undefined;
525
- internalised?: string | string[] | undefined;
526
- }[] | undefined;
527
- subsystem?: /*elided*/ any | undefined;
528
- }[];
529
- $schema?: string | undefined;
530
- metadata?: {
531
- [x: string]: unknown;
532
- title?: string | undefined;
533
- doc_type?: string | undefined;
534
- scope?: string | undefined;
535
- status?: string | undefined;
536
- version?: string | number | undefined;
537
- } | undefined;
538
- relationships?: {
539
- [x: string]: unknown;
540
- from: string;
541
- to: string;
542
- type: "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "part_of" | "precedes" | "must_follow" | "governed_by" | "modifies" | "produces";
543
- description?: string | string[] | undefined;
544
- polarity?: "positive" | "negative" | "neutral" | "uncertain" | undefined;
545
- strength?: number | undefined;
546
- }[] | undefined;
547
- external_references?: {
548
- role: "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
549
- identifier: string;
550
- description?: string | string[] | undefined;
551
- node_id?: string | undefined;
552
- internalised?: string | string[] | undefined;
553
- }[] | undefined;
554
- };
555
- }>;
@@ -1,35 +0,0 @@
1
- import * as z from "zod";
2
- import { defineOperation } from "./define-operation.js";
3
- import { SysProMDocument } from "../schema.js";
4
- /**
5
- * Set the done status of a task in a change node's plan array. Returns a new document.
6
- * @throws {Error} If the change node is not found or the task index is out of range.
7
- */
8
- export const updatePlanTaskOp = defineOperation({
9
- name: "updatePlanTask",
10
- description: "Set the done status of a task in a change node's plan array. Returns a new document.",
11
- input: z.object({
12
- doc: SysProMDocument,
13
- changeId: z.string(),
14
- taskIndex: z.number(),
15
- done: z.boolean(),
16
- }),
17
- output: SysProMDocument,
18
- fn({ doc, changeId, taskIndex, done }) {
19
- const node = doc.nodes.find((n) => n.id === changeId);
20
- if (!node) {
21
- throw new Error(`Node not found: ${changeId}`);
22
- }
23
- const plan = node.plan ?? [];
24
- if (taskIndex < 0 || taskIndex >= plan.length) {
25
- throw new Error(`Task index ${String(taskIndex)} out of range (plan has ${String(plan.length)} task(s))`);
26
- }
27
- const newPlan = [...plan];
28
- newPlan[taskIndex] = { ...newPlan[taskIndex], done };
29
- const updatedNode = { ...node, plan: newPlan };
30
- const newNodes = [...doc.nodes];
31
- const idx = newNodes.findIndex((n) => n.id === changeId);
32
- newNodes[idx] = updatedNode;
33
- return { ...doc, nodes: newNodes };
34
- },
35
- });