pi-gsd 2.0.1 → 2.0.3

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 (66) hide show
  1. package/dist/pi-gsd-hooks.js +1533 -0
  2. package/dist/pi-gsd-tools.js +53 -52
  3. package/package.json +3 -5
  4. package/.gsd/extensions/pi-gsd-hooks.ts +0 -973
  5. package/src/cli.ts +0 -644
  6. package/src/commands/base.ts +0 -67
  7. package/src/commands/commit.ts +0 -22
  8. package/src/commands/config.ts +0 -71
  9. package/src/commands/frontmatter.ts +0 -51
  10. package/src/commands/index.ts +0 -76
  11. package/src/commands/init.ts +0 -43
  12. package/src/commands/milestone.ts +0 -37
  13. package/src/commands/phase.ts +0 -92
  14. package/src/commands/progress.ts +0 -71
  15. package/src/commands/roadmap.ts +0 -40
  16. package/src/commands/scaffold.ts +0 -19
  17. package/src/commands/state.ts +0 -102
  18. package/src/commands/template.ts +0 -52
  19. package/src/commands/verify.ts +0 -70
  20. package/src/commands/workstream.ts +0 -98
  21. package/src/commands/wxp.ts +0 -65
  22. package/src/lib/commands.ts +0 -1040
  23. package/src/lib/config.ts +0 -385
  24. package/src/lib/core.ts +0 -1167
  25. package/src/lib/frontmatter.ts +0 -462
  26. package/src/lib/init.ts +0 -517
  27. package/src/lib/milestone.ts +0 -290
  28. package/src/lib/model-profiles.ts +0 -272
  29. package/src/lib/phase.ts +0 -1012
  30. package/src/lib/profile-output.ts +0 -237
  31. package/src/lib/profile-pipeline.ts +0 -556
  32. package/src/lib/roadmap.ts +0 -378
  33. package/src/lib/schemas.ts +0 -290
  34. package/src/lib/security.ts +0 -176
  35. package/src/lib/state.ts +0 -1175
  36. package/src/lib/template.ts +0 -246
  37. package/src/lib/uat.ts +0 -289
  38. package/src/lib/verify.ts +0 -879
  39. package/src/lib/workstream.ts +0 -524
  40. package/src/output.ts +0 -45
  41. package/src/schemas/pi-gsd-settings.schema.json +0 -80
  42. package/src/schemas/wxp.xsd +0 -619
  43. package/src/schemas/wxp.zod.ts +0 -318
  44. package/src/wxp/__tests__/arguments.test.ts +0 -86
  45. package/src/wxp/__tests__/conditions.test.ts +0 -106
  46. package/src/wxp/__tests__/executor.test.ts +0 -95
  47. package/src/wxp/__tests__/helpers.ts +0 -26
  48. package/src/wxp/__tests__/integration.test.ts +0 -166
  49. package/src/wxp/__tests__/new-features.test.ts +0 -222
  50. package/src/wxp/__tests__/parser.test.ts +0 -159
  51. package/src/wxp/__tests__/paste.test.ts +0 -66
  52. package/src/wxp/__tests__/schema.test.ts +0 -120
  53. package/src/wxp/__tests__/security.test.ts +0 -87
  54. package/src/wxp/__tests__/shell.test.ts +0 -85
  55. package/src/wxp/__tests__/string-ops.test.ts +0 -25
  56. package/src/wxp/__tests__/variables.test.ts +0 -65
  57. package/src/wxp/arguments.ts +0 -89
  58. package/src/wxp/conditions.ts +0 -78
  59. package/src/wxp/executor.ts +0 -191
  60. package/src/wxp/index.ts +0 -191
  61. package/src/wxp/parser.ts +0 -198
  62. package/src/wxp/paste.ts +0 -51
  63. package/src/wxp/security.ts +0 -102
  64. package/src/wxp/shell.ts +0 -81
  65. package/src/wxp/string-ops.ts +0 -44
  66. package/src/wxp/variables.ts +0 -109
@@ -1,619 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
3
- elementFormDefault="qualified"
4
- version="1.0">
5
-
6
- <!--
7
- WXP Canonical Schema — pi-gsd v1.0
8
- Authoritative definition of all WXP XML elements, attributes, nesting rules,
9
- and content models. Mirrors src/schemas/wxp.zod.ts exactly.
10
-
11
- PRD §3, §4.1
12
- -->
13
-
14
- <!-- ═══════════════════════════════════════════════════════════════════════
15
- Shared simple types
16
- ═══════════════════════════════════════════════════════════════════════ -->
17
-
18
- <!-- Valid values for the `type` attribute on <arg> -->
19
- <xs:simpleType name="ArgType">
20
- <xs:restriction base="xs:string">
21
- <xs:enumeration value="string"/>
22
- <xs:enumeration value="number"/>
23
- <xs:enumeration value="boolean"/>
24
- <xs:enumeration value="flag"/>
25
- </xs:restriction>
26
- </xs:simpleType>
27
-
28
- <!-- Valid values for the `type` attribute on <out> (v1: string only) -->
29
- <xs:simpleType name="OutType">
30
- <xs:restriction base="xs:string">
31
- <xs:enumeration value="string"/>
32
- </xs:restriction>
33
- </xs:simpleType>
34
-
35
- <!-- Valid string-op operations (v1: split only) -->
36
- <xs:simpleType name="StringOpOp">
37
- <xs:restriction base="xs:string">
38
- <xs:enumeration value="split"/>
39
- </xs:restriction>
40
- </xs:simpleType>
41
-
42
- <!-- Valid condition operators -->
43
- <xs:simpleType name="ConditionOp">
44
- <xs:restriction base="xs:string">
45
- <xs:enumeration value="equals"/>
46
- <xs:enumeration value="starts-with"/>
47
- </xs:restriction>
48
- </xs:simpleType>
49
-
50
- <!-- ═══════════════════════════════════════════════════════════════════════
51
- <arg> — universal argument element
52
- Used in: <gsd-arguments>, <shell><args>, <string-op><args>,
53
- <gsd-include><gsd-arguments>, <left>, <right>
54
- ═══════════════════════════════════════════════════════════════════════ -->
55
-
56
- <xs:element name="arg">
57
- <xs:annotation>
58
- <xs:documentation>
59
- Universal argument element. Attributes are interpreted by context:
60
-
61
- In &lt;gsd-arguments&gt;:
62
- name + type (required), flag (required when type="flag"), optional (boolean attr)
63
-
64
- In &lt;shell&gt;&lt;args&gt;:
65
- string="literal" — literal string argument
66
- name="varname" — variable reference
67
- name="varname" wrap='"' — variable wrapped in quotes
68
- type="string" value="..." — typed literal (inline)
69
-
70
- In &lt;string-op&gt;&lt;args&gt;:
71
- name="varname" — variable reference
72
- type="string" value="..." — typed literal (delimiter)
73
-
74
- In &lt;left&gt; / &lt;right&gt; (condition operands):
75
- name="varname" — variable reference
76
- type="string|boolean|number" value="..." — literal operand
77
-
78
- In &lt;gsd-include&gt;&lt;gsd-arguments&gt;:
79
- name="callerVar" as="targetVar" — variable rename mapping
80
- </xs:documentation>
81
- </xs:annotation>
82
- <xs:complexType>
83
- <!-- Literal string argument (shell context): <arg string="execute-phase" /> -->
84
- <xs:attribute name="string" type="xs:string" use="optional"/>
85
- <!-- Variable reference: <arg name="phase" /> -->
86
- <xs:attribute name="name" type="xs:string" use="optional"/>
87
- <!-- Wrap character for variable refs: <arg name="phase" wrap='"' /> -->
88
- <xs:attribute name="wrap" type="xs:string" use="optional"/>
89
- <!-- Type annotation (required in gsd-arguments; indicates literal type elsewhere) -->
90
- <xs:attribute name="type" type="ArgType" use="optional"/>
91
- <!-- Literal value (used with type= for inline typed args) -->
92
- <xs:attribute name="value" type="xs:string" use="optional"/>
93
- <!-- Flag token to match in $ARGUMENTS: <arg name="auto" type="flag" flag="--auto" /> -->
94
- <xs:attribute name="flag" type="xs:string" use="optional"/>
95
- <!-- Marks arg as optional in gsd-arguments (boolean attribute — presence = optional) -->
96
- <xs:attribute name="optional" type="xs:string" use="optional"/>
97
- <!-- Variable rename in gsd-include arg mappings: <arg name="x" as="y" /> -->
98
- <xs:attribute name="as" type="xs:string" use="optional"/>
99
- </xs:complexType>
100
- </xs:element>
101
-
102
- <!-- ═══════════════════════════════════════════════════════════════════════
103
- <out> — output capture element
104
- Used in: <shell><outs>, <string-op><outs>
105
- ═══════════════════════════════════════════════════════════════════════ -->
106
-
107
- <xs:element name="out">
108
- <xs:annotation>
109
- <xs:documentation>
110
- Captures stdout into a named variable.
111
- Example: &lt;out type="string" name="init" /&gt;
112
- </xs:documentation>
113
- </xs:annotation>
114
- <xs:complexType>
115
- <xs:attribute name="type" type="OutType" use="required"/>
116
- <xs:attribute name="name" type="xs:string" use="required"/>
117
- </xs:complexType>
118
- </xs:element>
119
-
120
- <!-- ═══════════════════════════════════════════════════════════════════════
121
- <suppress-errors> — suppress stderr (equivalent to 2>/dev/null)
122
- Used in: <shell><outs>
123
- ═══════════════════════════════════════════════════════════════════════ -->
124
-
125
- <xs:element name="suppress-errors">
126
- <xs:annotation>
127
- <xs:documentation>
128
- Suppresses stderr. Non-zero exit stores empty string in out variables
129
- instead of aborting. Equivalent to 2&gt;/dev/null.
130
- </xs:documentation>
131
- </xs:annotation>
132
- <xs:complexType/>
133
- </xs:element>
134
-
135
- <!-- ═══════════════════════════════════════════════════════════════════════
136
- <args> — ordered argument list container
137
- Used in: <shell>, <string-op>
138
- ═══════════════════════════════════════════════════════════════════════ -->
139
-
140
- <xs:element name="args">
141
- <xs:annotation>
142
- <xs:documentation>Ordered list of arguments. Position matters.</xs:documentation>
143
- </xs:annotation>
144
- <xs:complexType>
145
- <xs:sequence>
146
- <xs:element ref="arg" minOccurs="0" maxOccurs="unbounded"/>
147
- </xs:sequence>
148
- </xs:complexType>
149
- </xs:element>
150
-
151
- <!-- ═══════════════════════════════════════════════════════════════════════
152
- <outs> — output capture container
153
- Used in: <shell>, <string-op>
154
- ═══════════════════════════════════════════════════════════════════════ -->
155
-
156
- <xs:element name="outs">
157
- <xs:annotation>
158
- <xs:documentation>
159
- Output capture list. Children are &lt;out&gt; and/or &lt;suppress-errors /&gt;.
160
- The &lt;outs&gt; element is optional on &lt;shell&gt; (no output captured if absent).
161
- The &lt;outs&gt; element is mandatory on &lt;string-op&gt;.
162
- </xs:documentation>
163
- </xs:annotation>
164
- <xs:complexType>
165
- <xs:choice minOccurs="0" maxOccurs="unbounded">
166
- <xs:element ref="out"/>
167
- <xs:element ref="suppress-errors"/>
168
- </xs:choice>
169
- </xs:complexType>
170
- </xs:element>
171
-
172
- <!-- ═══════════════════════════════════════════════════════════════════════
173
- <left> / <right> — condition operands
174
- Used in: <equals>, <starts-with>
175
- ═══════════════════════════════════════════════════════════════════════ -->
176
-
177
- <xs:complexType name="OperandType">
178
- <xs:annotation>
179
- <xs:documentation>
180
- Condition operand. Either a variable reference (name=) or a typed literal (type= value=).
181
- Variable: &lt;left name="auto-chain-active" /&gt;
182
- Literal: &lt;right type="boolean" value="false" /&gt;
183
- </xs:documentation>
184
- </xs:annotation>
185
- <xs:attribute name="name" type="xs:string" use="optional"/>
186
- <xs:attribute name="type" type="ArgType" use="optional"/>
187
- <xs:attribute name="value" type="xs:string" use="optional"/>
188
- </xs:complexType>
189
-
190
- <xs:element name="left" type="OperandType"/>
191
- <xs:element name="right" type="OperandType"/>
192
-
193
- <!-- ═══════════════════════════════════════════════════════════════════════
194
- <equals> / <starts-with> — condition operators
195
- Used in: <condition>
196
- ═══════════════════════════════════════════════════════════════════════ -->
197
-
198
- <xs:complexType name="ConditionExprType">
199
- <xs:sequence>
200
- <xs:element ref="left"/>
201
- <xs:element ref="right"/>
202
- </xs:sequence>
203
- </xs:complexType>
204
-
205
-
206
-
207
- <xs:element name="condition">
208
- <xs:complexType>
209
- <xs:group ref="ConditionExprGroup"/>
210
- </xs:complexType>
211
- </xs:element>
212
-
213
- <!-- ═══════════════════════════════════════════════════════════════════════
214
- <shell> — execFileSync wrapper (PRD §3.3.1)
215
- ═══════════════════════════════════════════════════════════════════════ -->
216
-
217
- <xs:element name="shell">
218
- <xs:annotation>
219
- <xs:documentation>
220
- Execute an allowlisted command via execFileSync (30s timeout, no shell injection).
221
- Command must be in the WXP shell allowlist.
222
- Non-zero exit aborts unless &lt;suppress-errors /&gt; is present.
223
- </xs:documentation>
224
- </xs:annotation>
225
- <xs:complexType>
226
- <xs:sequence>
227
- <xs:element ref="args" minOccurs="0" maxOccurs="1"/>
228
- <xs:element ref="outs" minOccurs="0" maxOccurs="1"/>
229
- </xs:sequence>
230
- <xs:attribute name="command" type="xs:string" use="required">
231
- <xs:annotation>
232
- <xs:documentation>Bare executable name. Must be in shellAllowlist.</xs:documentation>
233
- </xs:annotation>
234
- </xs:attribute>
235
- </xs:complexType>
236
- </xs:element>
237
-
238
- <!-- ═══════════════════════════════════════════════════════════════════════
239
- <string-op> — string operations (PRD §3.3.3)
240
- ═══════════════════════════════════════════════════════════════════════ -->
241
-
242
- <xs:element name="string-op">
243
- <xs:annotation>
244
- <xs:documentation>
245
- String manipulation operation. v1 supports op="split" only.
246
- split: args[0]=source, args[1]=delimiter; each &lt;out&gt; gets one part.
247
- </xs:documentation>
248
- </xs:annotation>
249
- <xs:complexType>
250
- <xs:sequence>
251
- <xs:element ref="args"/>
252
- <xs:element ref="outs"/>
253
- </xs:sequence>
254
- <xs:attribute name="op" type="StringOpOp" use="required"/>
255
- </xs:complexType>
256
- </xs:element>
257
-
258
- <!-- ═══════════════════════════════════════════════════════════════════════
259
- <then> / <else> — conditional branches inside <if>
260
- ═══════════════════════════════════════════════════════════════════════ -->
261
-
262
- <xs:element name="then">
263
- <xs:complexType>
264
- <xs:group ref="ExecutableOperations" minOccurs="0" maxOccurs="unbounded"/>
265
- </xs:complexType>
266
- </xs:element>
267
-
268
- <xs:element name="else">
269
- <xs:complexType>
270
- <xs:group ref="ExecutableOperations" minOccurs="0" maxOccurs="unbounded"/>
271
- </xs:complexType>
272
- </xs:element>
273
-
274
- <!-- ═══════════════════════════════════════════════════════════════════════
275
- <display> — deterministic notification (PRD §3.x)
276
- ═══════════════════════════════════════════════════════════════════════ -->
277
-
278
- <xs:element name="display">
279
- <xs:annotation>
280
- <xs:documentation>
281
- Emits a ctx.ui.notify() at WXP processing time.
282
- msg supports {varname} and {var.prop} dot-notation interpolation.
283
- Does NOT inject into document text — UI notification only.
284
- </xs:documentation>
285
- </xs:annotation>
286
- <xs:complexType>
287
- <xs:attribute name="msg" type="xs:string" use="required">
288
- <xs:annotation>
289
- <xs:documentation>Template string. {varname} and {obj.prop} interpolated from variable store.</xs:documentation>
290
- </xs:annotation>
291
- </xs:attribute>
292
- <xs:attribute name="level" use="optional" default="info">
293
- <xs:simpleType>
294
- <xs:restriction base="xs:string">
295
- <xs:enumeration value="info"/>
296
- <xs:enumeration value="warning"/>
297
- <xs:enumeration value="error"/>
298
- </xs:restriction>
299
- </xs:simpleType>
300
- </xs:attribute>
301
- </xs:complexType>
302
- </xs:element>
303
-
304
- <!-- ═══════════════════════════════════════════════════════════════════════
305
- <json-parse> — parse JSON variable into scalar or array
306
- ═══════════════════════════════════════════════════════════════════════ -->
307
-
308
- <xs:element name="json-parse">
309
- <xs:annotation>
310
- <xs:documentation>
311
- Parses the JSON string in `src` variable.
312
- path: optional dot-path selector ("$.key" or "$.key.sub").
313
- out: name of output variable (scalar string or array for &lt;for-each&gt;).
314
- </xs:documentation>
315
- </xs:annotation>
316
- <xs:complexType>
317
- <xs:attribute name="src" type="xs:string" use="required"/>
318
- <xs:attribute name="path" type="xs:string" use="optional"/>
319
- <xs:attribute name="out" type="xs:string" use="required"/>
320
- </xs:complexType>
321
- </xs:element>
322
-
323
- <!-- ═══════════════════════════════════════════════════════════════════════
324
- <where> — filter clause inside <for-each>
325
- ═══════════════════════════════════════════════════════════════════════ -->
326
-
327
- <xs:element name="where">
328
- <xs:complexType>
329
- <xs:group ref="ConditionExprGroup"/>
330
- </xs:complexType>
331
- </xs:element>
332
-
333
- <!-- ═══════════════════════════════════════════════════════════════════════
334
- <sort-by> — sort clause inside <for-each>
335
- ═══════════════════════════════════════════════════════════════════════ -->
336
-
337
- <xs:element name="sort-by">
338
- <xs:complexType>
339
- <xs:attribute name="key" type="xs:string" use="required">
340
- <xs:annotation>
341
- <xs:documentation>Property key to sort by, supports dot-notation (e.g. "phase.number").</xs:documentation>
342
- </xs:annotation>
343
- </xs:attribute>
344
- <xs:attribute name="type" use="optional" default="string">
345
- <xs:simpleType>
346
- <xs:restriction base="xs:string">
347
- <xs:enumeration value="string"/>
348
- <xs:enumeration value="number"/>
349
- </xs:restriction>
350
- </xs:simpleType>
351
- </xs:attribute>
352
- <xs:attribute name="order" use="optional" default="asc">
353
- <xs:simpleType>
354
- <xs:restriction base="xs:string">
355
- <xs:enumeration value="asc"/>
356
- <xs:enumeration value="desc"/>
357
- </xs:restriction>
358
- </xs:simpleType>
359
- </xs:attribute>
360
- </xs:complexType>
361
- </xs:element>
362
-
363
- <!-- ═══════════════════════════════════════════════════════════════════════
364
- <for-each> — iteration over array variables
365
- ═══════════════════════════════════════════════════════════════════════ -->
366
-
367
- <xs:element name="for-each">
368
- <xs:annotation>
369
- <xs:documentation>
370
- Iterates an array variable (populated by &lt;json-parse&gt; or &lt;string-op op="split"&gt;).
371
- Each item is set as `item` variable during iteration (JSON string for objects).
372
- Optional &lt;where&gt; pre-filters; optional &lt;sort-by&gt; sorts before iteration.
373
- </xs:documentation>
374
- </xs:annotation>
375
- <xs:complexType>
376
- <xs:sequence>
377
- <xs:element ref="where" minOccurs="0" maxOccurs="1"/>
378
- <xs:element ref="sort-by" minOccurs="0" maxOccurs="1"/>
379
- <xs:group ref="ExecutableOperations" minOccurs="0" maxOccurs="unbounded"/>
380
- </xs:sequence>
381
- <xs:attribute name="var" type="xs:string" use="required">
382
- <xs:annotation><xs:documentation>Name of the array variable to iterate.</xs:documentation></xs:annotation>
383
- </xs:attribute>
384
- <xs:attribute name="item" type="xs:string" use="required">
385
- <xs:annotation><xs:documentation>Variable name assigned to each item during iteration.</xs:documentation></xs:annotation>
386
- </xs:attribute>
387
- </xs:complexType>
388
- </xs:element>
389
-
390
- <!-- ═══════════════════════════════════════════════════════════════════════
391
- Condition expression group — all valid condition operators
392
- ═══════════════════════════════════════════════════════════════════════ -->
393
-
394
- <xs:group name="ConditionExprGroup">
395
- <xs:choice>
396
- <xs:element name="equals" type="ConditionExprType"/>
397
- <xs:element name="not-equals" type="ConditionExprType"/>
398
- <xs:element name="starts-with" type="ConditionExprType"/>
399
- <xs:element name="contains" type="ConditionExprType"/>
400
- <xs:element name="less-than" type="ConditionExprType"/>
401
- <xs:element name="greater-than" type="ConditionExprType"/>
402
- <xs:element name="less-than-or-equal" type="ConditionExprType"/>
403
- <xs:element name="greater-than-or-equal" type="ConditionExprType"/>
404
- <xs:element name="and" type="LogicalCondType"/>
405
- <xs:element name="or" type="LogicalCondType"/>
406
- </xs:choice>
407
- </xs:group>
408
-
409
- <!-- Logical condition: <and>/<or> contain child condition expressions -->
410
- <xs:complexType name="LogicalCondType">
411
- <xs:annotation>
412
- <xs:documentation>
413
- &lt;and&gt;: all children must be true.
414
- &lt;or&gt;: at least one child must be true.
415
- Children are condition expressions — supports nesting.
416
- </xs:documentation>
417
- </xs:annotation>
418
- <xs:group ref="ConditionExprGroup" minOccurs="1" maxOccurs="unbounded"/>
419
- </xs:complexType>
420
-
421
- <!-- ═══════════════════════════════════════════════════════════════════════
422
- Updated ExecutableOperations group — includes new elements
423
- ═══════════════════════════════════════════════════════════════════════ -->
424
-
425
- <xs:group name="ExecutableOperations">
426
- <xs:choice>
427
- <xs:element ref="shell"/>
428
- <xs:element ref="if"/>
429
- <xs:element ref="string-op"/>
430
- <xs:element ref="json-parse"/>
431
- <xs:element ref="for-each"/>
432
- <xs:element ref="display"/>
433
- </xs:choice>
434
- </xs:group>
435
-
436
- <!-- ═══════════════════════════════════════════════════════════════════════
437
- <if> — conditional execution (PRD §3.3.2)
438
- ═══════════════════════════════════════════════════════════════════════ -->
439
-
440
- <xs:element name="if">
441
- <xs:annotation>
442
- <xs:documentation>
443
- Conditional execution. Evaluates &lt;condition&gt; and runs &lt;then&gt; or &lt;else&gt;.
444
- Condition operators: &lt;equals&gt;, &lt;starts-with&gt;.
445
- Operands: variable reference (name=) or typed literal (type= value=).
446
- </xs:documentation>
447
- </xs:annotation>
448
- <xs:complexType>
449
- <xs:sequence>
450
- <xs:element ref="condition"/>
451
- <xs:element ref="then" minOccurs="0" maxOccurs="1"/>
452
- <xs:element ref="else" minOccurs="0" maxOccurs="1"/>
453
- </xs:sequence>
454
- </xs:complexType>
455
- </xs:element>
456
-
457
- <!-- ═══════════════════════════════════════════════════════════════════════
458
- <delimiter> — argument delimiter configuration
459
- Used in: <gsd-arguments><settings><delimiters>
460
- ═══════════════════════════════════════════════════════════════════════ -->
461
-
462
- <xs:element name="delimiter">
463
- <xs:complexType>
464
- <xs:attribute name="type" use="required">
465
- <xs:simpleType>
466
- <xs:restriction base="xs:string">
467
- <xs:enumeration value="string"/>
468
- </xs:restriction>
469
- </xs:simpleType>
470
- </xs:attribute>
471
- <xs:attribute name="value" type="xs:string" use="required"/>
472
- </xs:complexType>
473
- </xs:element>
474
-
475
- <!-- ═══════════════════════════════════════════════════════════════════════
476
- <settings> — parsing settings inside <gsd-arguments>
477
- ═══════════════════════════════════════════════════════════════════════ -->
478
-
479
- <xs:element name="settings">
480
- <xs:complexType>
481
- <xs:sequence>
482
- <xs:choice minOccurs="0" maxOccurs="1">
483
- <xs:element name="keep-extra-args">
484
- <xs:annotation>
485
- <xs:documentation>Extra positional tokens stored in _extra variable.</xs:documentation>
486
- </xs:annotation>
487
- <xs:complexType/>
488
- </xs:element>
489
- <xs:element name="strict-args">
490
- <xs:annotation>
491
- <xs:documentation>Extra positional tokens → error.</xs:documentation>
492
- </xs:annotation>
493
- <xs:complexType/>
494
- </xs:element>
495
- </xs:choice>
496
- <xs:element name="delimiters" minOccurs="0" maxOccurs="1">
497
- <xs:complexType>
498
- <xs:sequence>
499
- <xs:element ref="delimiter" minOccurs="1" maxOccurs="unbounded"/>
500
- </xs:sequence>
501
- </xs:complexType>
502
- </xs:element>
503
- </xs:sequence>
504
- </xs:complexType>
505
- </xs:element>
506
-
507
- <!-- ═══════════════════════════════════════════════════════════════════════
508
- <gsd-arguments> — argument declaration block (PRD §3.2)
509
- ═══════════════════════════════════════════════════════════════════════ -->
510
-
511
- <xs:element name="gsd-arguments">
512
- <xs:annotation>
513
- <xs:documentation>
514
- Declares how $ARGUMENTS is parsed. Two-pass algorithm:
515
- Pass 1: flags extracted (type="flag") anywhere in the string.
516
- Pass 2: remaining tokens assigned to positionals left-to-right.
517
- Last string arg is greedy (consumes all remaining tokens).
518
- </xs:documentation>
519
- </xs:annotation>
520
- <xs:complexType>
521
- <xs:sequence>
522
- <xs:element ref="settings" minOccurs="0" maxOccurs="1"/>
523
- <xs:element ref="arg" minOccurs="0" maxOccurs="unbounded"/>
524
- </xs:sequence>
525
- </xs:complexType>
526
- </xs:element>
527
-
528
- <!-- ═══════════════════════════════════════════════════════════════════════
529
- <gsd-execute> — executable block container (PRD §3.3)
530
- ═══════════════════════════════════════════════════════════════════════ -->
531
-
532
- <xs:element name="gsd-execute">
533
- <xs:annotation>
534
- <xs:documentation>
535
- Container for WXP operations executed before the LLM receives the document.
536
- Processed in document order. Removed from output after execution.
537
- </xs:documentation>
538
- </xs:annotation>
539
- <xs:complexType>
540
- <xs:group ref="ExecutableOperations" minOccurs="0" maxOccurs="unbounded"/>
541
- </xs:complexType>
542
- </xs:element>
543
-
544
- <!-- ═══════════════════════════════════════════════════════════════════════
545
- <gsd-paste> — variable injection (PRD §3.4)
546
- ═══════════════════════════════════════════════════════════════════════ -->
547
-
548
- <xs:element name="gsd-paste">
549
- <xs:annotation>
550
- <xs:documentation>
551
- Replaced with the named variable's string value.
552
- Undefined variable → abort (no partial output).
553
- Tags inside fenced code blocks are never replaced.
554
- </xs:documentation>
555
- </xs:annotation>
556
- <xs:complexType>
557
- <xs:attribute name="name" type="xs:string" use="required"/>
558
- </xs:complexType>
559
- </xs:element>
560
-
561
- <!-- ═══════════════════════════════════════════════════════════════════════
562
- <gsd-include> — file inclusion (PRD §3.1, §3.6)
563
- ═══════════════════════════════════════════════════════════════════════ -->
564
-
565
- <xs:element name="gsd-include">
566
- <xs:annotation>
567
- <xs:documentation>
568
- Inline another workflow file at this position.
569
- Self-closing form: &lt;gsd-include path="..." /&gt;
570
- With arg mapping: &lt;gsd-include path="..."&gt;&lt;gsd-arguments&gt;...&lt;/gsd-arguments&gt;&lt;/gsd-include&gt;
571
- include-arguments: appends $ARGUMENTS after included content.
572
- select: optional content selector (tag:NAME, heading:TEXT, lines:N-M).
573
- </xs:documentation>
574
- </xs:annotation>
575
- <xs:complexType>
576
- <xs:sequence>
577
- <!-- Child gsd-arguments for variable rename mappings (INC-02) -->
578
- <xs:element ref="gsd-arguments" minOccurs="0" maxOccurs="1"/>
579
- </xs:sequence>
580
- <xs:attribute name="path" type="xs:string" use="required"/>
581
- <xs:attribute name="select" type="xs:string" use="optional">
582
- <xs:annotation>
583
- <xs:documentation>Content selector: tag:NAME | heading:TEXT | lines:N-M. Chainable with |.</xs:documentation>
584
- </xs:annotation>
585
- </xs:attribute>
586
- <xs:attribute name="include-arguments" type="xs:string" use="optional">
587
- <xs:annotation>
588
- <xs:documentation>Boolean attribute. Presence appends $ARGUMENTS after included content.</xs:documentation>
589
- </xs:annotation>
590
- </xs:attribute>
591
- </xs:complexType>
592
- </xs:element>
593
-
594
- <!-- ═══════════════════════════════════════════════════════════════════════
595
- <gsd-version> — workflow version tag (PRD §6.1, WFL-04, WFL-05)
596
- ═══════════════════════════════════════════════════════════════════════ -->
597
-
598
- <xs:element name="gsd-version">
599
- <xs:annotation>
600
- <xs:documentation>
601
- Identifies the pi-gsd version that produced this workflow file.
602
- do-not-update: presence opts the file out of harness auto-updates.
603
- </xs:documentation>
604
- </xs:annotation>
605
- <xs:complexType>
606
- <xs:attribute name="v" type="xs:string" use="required">
607
- <xs:annotation>
608
- <xs:documentation>Semantic version, e.g. "1.12.4"</xs:documentation>
609
- </xs:annotation>
610
- </xs:attribute>
611
- <xs:attribute name="do-not-update" type="xs:string" use="optional">
612
- <xs:annotation>
613
- <xs:documentation>Boolean attribute. Presence prevents auto-update overwrite.</xs:documentation>
614
- </xs:annotation>
615
- </xs:attribute>
616
- </xs:complexType>
617
- </xs:element>
618
-
619
- </xs:schema>