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