@pixpilot/scaffoldfy 0.19.1 → 0.19.2

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pixpilot/scaffoldfy",
3
3
  "type": "module",
4
- "version": "0.19.1",
4
+ "version": "0.19.2",
5
5
  "author": "PixPilot <m.doaie@hotmail.com>",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -48,9 +48,9 @@
48
48
  "tsdown": "^0.15.8",
49
49
  "typescript": "^5.9.3",
50
50
  "@internal/eslint-config": "0.3.0",
51
+ "@internal/tsconfig": "0.1.0",
51
52
  "@internal/prettier-config": "0.0.1",
52
53
  "@internal/vitest-config": "0.1.0",
53
- "@internal/tsconfig": "0.1.0",
54
54
  "@internal/tsdown-config": "0.1.0"
55
55
  },
56
56
  "prettier": "@internal/prettier-config",
@@ -45,184 +45,18 @@
45
45
  "variables": {
46
46
  "type": "array",
47
47
  "description": "Top-level global variables available to all tasks. Variables are resolved once at startup and do not require user interaction.",
48
- "items": {
49
- "type": "object",
50
- "required": ["id", "value"],
51
- "additionalProperties": false,
52
- "properties": {
53
- "id": {
54
- "type": "string",
55
- "description": "Unique identifier for the variable (must be a valid JavaScript identifier: start with letter, underscore, or $, followed by letters, digits, underscores, or $)",
56
- "pattern": "^[a-zA-Z_$][a-zA-Z0-9_$]*$"
57
- },
58
- "value": {
59
- "description": "Variable value. Can be a static value or an object with 'type' and 'value' properties for executable values.",
60
- "oneOf": [
61
- {
62
- "description": "Static value (string, number, or boolean)"
63
- },
64
- {
65
- "type": "object",
66
- "description": "Value configuration for static or executable values",
67
- "required": ["type", "value"],
68
- "properties": {
69
- "type": {
70
- "type": "string",
71
- "enum": ["static", "exec"],
72
- "description": "Type of value. 'static' for explicit static values, 'exec' for command execution."
73
- },
74
- "value": {
75
- "description": "For 'static' type: the static value. For 'exec' type: the shell command to execute. Commands output will be trimmed and auto-parsed as JSON, number, or boolean when applicable."
76
- }
77
- }
78
- }
79
- ]
80
- },
81
- "override": {
82
- "type": "string",
83
- "enum": ["merge", "replace"],
84
- "description": "Strategy for merging with base variable when extending templates. 'merge' (default) replaces the value, 'replace' completely replaces the variable. Must be specified when variable ID conflicts with base template."
85
- }
86
- }
87
- }
48
+ "items": { "$ref": "#/$defs/variableItem" }
88
49
  },
89
50
  "prompts": {
90
51
  "type": "array",
91
52
  "description": "Top-level global prompts collected once upfront and available to all tasks.",
92
- "items": {
93
- "type": "object",
94
- "required": ["id", "type", "message"],
95
- "additionalProperties": false,
96
- "properties": {
97
- "id": {
98
- "type": "string",
99
- "description": "Unique identifier for the prompt value (must be a valid JavaScript identifier: start with letter, underscore, or $, followed by letters, digits, underscores, or $)",
100
- "pattern": "^[a-zA-Z_$][a-zA-Z0-9_$]*$"
101
- },
102
- "type": {
103
- "type": "string",
104
- "enum": ["input", "select", "confirm", "password", "number"],
105
- "description": "Type of prompt to display"
106
- },
107
- "message": {
108
- "type": "string",
109
- "description": "Prompt message to display to the user"
110
- },
111
- "required": {
112
- "type": "boolean",
113
- "description": "Whether the prompt value is required (cannot be empty)"
114
- },
115
- "enabled": {
116
- "description": "Whether this prompt should be displayed. Can be a boolean, a string expression, or a conditional expression based on variables or other prompt values.",
117
- "oneOf": [
118
- {
119
- "type": "boolean",
120
- "description": "Static enabled state"
121
- },
122
- {
123
- "type": "string",
124
- "description": "JavaScript expression to evaluate (shorthand for { condition: \"...\" }). Prompt only displays if expression evaluates to true."
125
- },
126
- {
127
- "type": "object",
128
- "description": "Conditional enabled configuration",
129
- "required": ["condition"],
130
- "properties": {
131
- "condition": {
132
- "type": "string",
133
- "description": "JavaScript expression to evaluate. Prompt only displays if condition evaluates to true. Has access to all variables and previously collected prompts."
134
- }
135
- }
136
- }
137
- ]
138
- },
139
- "default": {
140
- "description": "Default value for the prompt. Can be a static value, an object with 'type' and 'value' properties for executable defaults, or a conditional default configuration.",
141
- "oneOf": [
142
- {
143
- "description": "Static default value (string, number, or boolean)"
144
- },
145
- {
146
- "type": "object",
147
- "description": "Default value configuration for static or executable values",
148
- "required": ["type", "value"],
149
- "properties": {
150
- "type": {
151
- "type": "string",
152
- "enum": ["static", "exec"],
153
- "description": "Type of default value. 'static' for explicit static values, 'exec' for command execution."
154
- },
155
- "value": {
156
- "description": "For 'static' type: the static value. For 'exec' type: the shell command to execute. Commands can be any shell command including git, npm, node, etc. The command output will be trimmed and auto-parsed as JSON, number, or boolean when applicable."
157
- }
158
- }
159
- },
160
- {
161
- "type": "object",
162
- "description": "Conditional default value configuration",
163
- "required": ["type", "condition", "ifTrue", "ifFalse"],
164
- "properties": {
165
- "type": {
166
- "type": "string",
167
- "enum": ["conditional"],
168
- "description": "Type of default value. 'conditional' for condition-based defaults."
169
- },
170
- "condition": {
171
- "type": "string",
172
- "description": "JavaScript expression to evaluate. Can reference variables, prompts, and config values."
173
- },
174
- "ifTrue": {
175
- "description": "Value to use if condition evaluates to true. Can be a static value or a template string with {{variables}}."
176
- },
177
- "ifFalse": {
178
- "description": "Value to use if condition evaluates to false. Can be a static value or a template string with {{variables}}."
179
- }
180
- }
181
- }
182
- ]
183
- },
184
- "placeholder": {
185
- "type": "string",
186
- "description": "Placeholder text (for input prompts)"
187
- },
188
- "min": {
189
- "type": "number",
190
- "description": "Minimum value (for number prompts)"
191
- },
192
- "max": {
193
- "type": "number",
194
- "description": "Maximum value (for number prompts)"
195
- },
196
- "choices": {
197
- "type": "array",
198
- "description": "Available choices (for select prompts)",
199
- "items": {
200
- "type": "object",
201
- "required": ["name", "value"],
202
- "properties": {
203
- "name": {
204
- "type": "string",
205
- "description": "Display name for the choice"
206
- },
207
- "value": {
208
- "description": "Value to use when this choice is selected"
209
- }
210
- }
211
- }
212
- },
213
- "override": {
214
- "type": "string",
215
- "enum": ["merge", "replace"],
216
- "description": "Strategy for merging with base prompt when extending templates. 'merge' (default) intelligently merges properties, 'replace' completely replaces the base prompt. Must be specified when prompt ID conflicts with base template."
217
- }
218
- }
219
- }
53
+ "items": { "$ref": "#/$defs/promptItem" }
220
54
  },
221
55
  "tasks": {
222
56
  "type": "array",
223
57
  "items": {
224
58
  "type": "object",
225
- "required": ["id", "name", "type"],
59
+ "required": ["id", "name", "type", "config"],
226
60
  "additionalProperties": false,
227
61
  "properties": {
228
62
  "id": {
@@ -246,208 +80,31 @@
246
80
  "description": "Whether this task should be executed. Can be a boolean, a string expression, or a conditional expression based on variables or prompt values (optional, defaults to true).",
247
81
  "default": true,
248
82
  "oneOf": [
249
- {
250
- "type": "boolean",
251
- "description": "Static enabled state"
252
- },
253
- {
254
- "type": "string",
255
- "description": "JavaScript expression to evaluate (shorthand for { condition: \"...\" }). Task only executes if expression evaluates to true."
256
- },
83
+ { "type": "boolean", "description": "Static enabled state" },
84
+ { "type": "string", "description": "JavaScript expression to evaluate" },
257
85
  {
258
86
  "type": "object",
259
87
  "description": "Conditional enabled configuration",
260
88
  "required": ["condition"],
261
- "properties": {
262
- "condition": {
263
- "type": "string",
264
- "description": "JavaScript expression to evaluate. Task only executes if condition evaluates to true. Has access to all variables and prompt values."
265
- }
266
- }
89
+ "properties": { "condition": { "type": "string" } }
267
90
  }
268
91
  ]
269
92
  },
270
93
  "dependencies": {
271
94
  "type": "array",
272
- "items": {
273
- "type": "string"
274
- },
95
+ "items": { "type": "string" },
275
96
  "description": "IDs of tasks that must run before this one"
276
97
  },
277
98
  "override": {
278
99
  "type": "string",
279
100
  "enum": ["merge", "replace"],
280
- "description": "Strategy for merging with base task when extending templates. 'merge' (default) intelligently merges properties, 'replace' completely replaces the base task. Must be specified when task ID conflicts with base template."
281
- },
282
- "$sourceUrl": {
283
- "type": "string",
284
- "description": "Internal: URL or path of the template file this task came from (for resolving relative paths). This property is automatically added by the template inheritance system."
285
- },
286
- "prompts": {
287
- "type": "array",
288
- "description": "Task-specific prompts collected when the task is executed. These values are only available to this task.",
289
- "items": {
290
- "type": "object",
291
- "required": ["id", "type", "message"],
292
- "additionalProperties": false,
293
- "properties": {
294
- "id": {
295
- "type": "string",
296
- "description": "Unique identifier for the prompt value (must be a valid JavaScript identifier: start with letter, underscore, or $, followed by letters, digits, underscores, or $)",
297
- "pattern": "^[a-zA-Z_$][a-zA-Z0-9_$]*$"
298
- },
299
- "type": {
300
- "type": "string",
301
- "enum": ["input", "select", "confirm", "password", "number"],
302
- "description": "Type of prompt to display"
303
- },
304
- "message": {
305
- "type": "string",
306
- "description": "Prompt message to display to the user"
307
- },
308
- "required": {
309
- "type": "boolean",
310
- "description": "Whether the prompt value is required (cannot be empty)"
311
- },
312
- "enabled": {
313
- "description": "Whether this prompt should be displayed. Can be a boolean, a string expression, or a conditional expression based on variables or other prompt values.",
314
- "oneOf": [
315
- {
316
- "type": "boolean",
317
- "description": "Static enabled state"
318
- },
319
- {
320
- "type": "string",
321
- "description": "JavaScript expression to evaluate (shorthand for { condition: \"...\" }). Prompt only displays if expression evaluates to true."
322
- },
323
- {
324
- "type": "object",
325
- "description": "Conditional enabled configuration",
326
- "required": ["condition"],
327
- "properties": {
328
- "condition": {
329
- "type": "string",
330
- "description": "JavaScript expression to evaluate. Prompt only displays if condition evaluates to true. Has access to all variables and previously collected prompts."
331
- }
332
- }
333
- }
334
- ]
335
- },
336
- "default": {
337
- "description": "Default value for the prompt. Can be a static value, an object with 'type' and 'value' properties for executable defaults, or a conditional default configuration.",
338
- "oneOf": [
339
- {
340
- "description": "Static default value (string, number, or boolean)"
341
- },
342
- {
343
- "type": "object",
344
- "description": "Default value configuration for static or executable values",
345
- "required": ["type", "value"],
346
- "properties": {
347
- "type": {
348
- "type": "string",
349
- "enum": ["static", "exec"],
350
- "description": "Type of default value. 'static' for explicit static values, 'exec' for command execution."
351
- },
352
- "value": {
353
- "description": "For 'static' type: the static value. For 'exec' type: the shell command to execute. Commands can be any shell command including git, npm, node, etc. The command output will be trimmed and auto-parsed as JSON, number, or boolean when applicable."
354
- }
355
- }
356
- },
357
- {
358
- "type": "object",
359
- "description": "Conditional default value configuration",
360
- "required": ["type", "condition", "ifTrue", "ifFalse"],
361
- "properties": {
362
- "type": {
363
- "type": "string",
364
- "enum": ["conditional"],
365
- "description": "Type of default value. 'conditional' for condition-based defaults."
366
- },
367
- "condition": {
368
- "type": "string",
369
- "description": "JavaScript expression to evaluate. Can reference variables, prompts, and config values."
370
- },
371
- "ifTrue": {
372
- "description": "Value to use if condition evaluates to true. Can be a static value or a template string with {{variables}}."
373
- },
374
- "ifFalse": {
375
- "description": "Value to use if condition evaluates to false. Can be a static value or a template string with {{variables}}."
376
- }
377
- }
378
- }
379
- ]
380
- },
381
- "placeholder": {
382
- "type": "string",
383
- "description": "Placeholder text (for input prompts)"
384
- },
385
- "min": {
386
- "type": "number",
387
- "description": "Minimum value (for number prompts)"
388
- },
389
- "max": {
390
- "type": "number",
391
- "description": "Maximum value (for number prompts)"
392
- },
393
- "choices": {
394
- "type": "array",
395
- "description": "Available choices (for select prompts)",
396
- "items": {
397
- "type": "object",
398
- "required": ["name", "value"],
399
- "properties": {
400
- "name": {
401
- "type": "string",
402
- "description": "Display name for the choice"
403
- },
404
- "value": {
405
- "description": "Value to use when this choice is selected"
406
- }
407
- }
408
- }
409
- }
410
- }
411
- }
101
+ "description": "Strategy for merging with base task when extending templates"
412
102
  },
103
+ "$sourceUrl": { "type": "string" },
104
+ "prompts": { "type": "array", "items": { "$ref": "#/$defs/promptItem" } },
413
105
  "variables": {
414
106
  "type": "array",
415
- "description": "Task-scoped variables available only to this specific task. Variables are resolved once at startup and do not require user interaction. For variables shared across tasks, use top-level variables instead.",
416
- "items": {
417
- "type": "object",
418
- "required": ["id", "value"],
419
- "additionalProperties": false,
420
- "properties": {
421
- "id": {
422
- "type": "string",
423
- "description": "Unique identifier for the variable (must be a valid JavaScript identifier: start with letter, underscore, or $, followed by letters, digits, underscores, or $)",
424
- "pattern": "^[a-zA-Z_$][a-zA-Z0-9_$]*$"
425
- },
426
- "value": {
427
- "description": "Variable value. Can be a static value or an object with 'type' and 'value' properties for executable values.",
428
- "oneOf": [
429
- {
430
- "description": "Static value (string, number, or boolean)"
431
- },
432
- {
433
- "type": "object",
434
- "description": "Value configuration for static or executable values",
435
- "required": ["type", "value"],
436
- "properties": {
437
- "type": {
438
- "type": "string",
439
- "enum": ["static", "exec"],
440
- "description": "Type of value. 'static' for explicit static values, 'exec' for command execution."
441
- },
442
- "value": {
443
- "description": "For 'static' type: the static value. For 'exec' type: the shell command to execute. Commands output will be trimmed and auto-parsed as JSON, number, or boolean when applicable."
444
- }
445
- }
446
- }
447
- ]
448
- }
449
- }
450
- }
107
+ "items": { "$ref": "#/$defs/taskVariableItem" }
451
108
  },
452
109
  "type": {
453
110
  "type": "string",
@@ -466,222 +123,499 @@
466
123
  },
467
124
  "config": {
468
125
  "type": "object",
469
- "description": "Task-specific configuration",
470
- "oneOf": [
471
- {
472
- "title": "Update JSON Config",
473
- "properties": {
474
- "file": {
475
- "type": "string",
476
- "description": "Path to the JSON file to update"
477
- },
478
- "updates": {
479
- "type": "object",
480
- "description": "Key-value pairs to update (supports nested paths with dot notation)"
481
- },
482
- "condition": {
483
- "type": "string",
484
- "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
485
- }
486
- },
487
- "required": ["file", "updates"]
488
- },
489
- {
490
- "title": "Template Config",
491
- "properties": {
492
- "file": {
493
- "type": "string",
494
- "description": "Path to the file to create or overwrite"
495
- },
496
- "template": {
497
- "type": "string",
498
- "description": "Inline template string with {{variable}} placeholders. Cannot be used with templateFile."
499
- },
500
- "templateFile": {
501
- "type": "string",
502
- "description": "Path to external template file (relative to project root). Files with .hbs extension automatically use Handlebars templating. Cannot be used with template."
503
- },
504
- "condition": {
505
- "type": "string",
506
- "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
507
- }
508
- },
509
- "required": ["file"],
510
- "oneOf": [
511
- {
512
- "required": ["template"]
513
- },
514
- {
515
- "required": ["templateFile"]
516
- }
517
- ]
518
- },
519
- {
520
- "title": "Create Config",
521
- "properties": {
522
- "file": {
523
- "type": "string",
524
- "description": "Path to the file to create (will not overwrite if file already exists)"
525
- },
526
- "template": {
527
- "type": "string",
528
- "description": "Inline template string with {{variable}} placeholders. Cannot be used with templateFile."
529
- },
530
- "templateFile": {
531
- "type": "string",
532
- "description": "Path to external template file (relative to project root). Files with .hbs extension automatically use Handlebars templating. Cannot be used with template."
533
- },
534
- "condition": {
535
- "type": "string",
536
- "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
537
- }
126
+ "description": "Task-specific configuration"
127
+ }
128
+ },
129
+ "oneOf": [
130
+ {
131
+ "properties": {
132
+ "type": { "const": "update-json" },
133
+ "config": { "$ref": "#/$defs/config-update-json" }
134
+ }
135
+ },
136
+ {
137
+ "properties": {
138
+ "type": { "const": "template" },
139
+ "config": { "$ref": "#/$defs/config-template" }
140
+ }
141
+ },
142
+ {
143
+ "properties": {
144
+ "type": { "const": "create" },
145
+ "config": { "$ref": "#/$defs/config-create" }
146
+ }
147
+ },
148
+ {
149
+ "properties": {
150
+ "type": { "const": "regex-replace" },
151
+ "config": { "$ref": "#/$defs/config-regex-replace" }
152
+ }
153
+ },
154
+ {
155
+ "properties": {
156
+ "type": { "const": "replace-in-file" },
157
+ "config": { "$ref": "#/$defs/config-replace-in-file" }
158
+ }
159
+ },
160
+ {
161
+ "properties": {
162
+ "type": { "const": "delete" },
163
+ "config": { "$ref": "#/$defs/config-delete" }
164
+ }
165
+ },
166
+ {
167
+ "properties": {
168
+ "type": { "const": "rename" },
169
+ "config": { "$ref": "#/$defs/config-rename" }
170
+ }
171
+ },
172
+ {
173
+ "properties": {
174
+ "type": { "const": "git-init" },
175
+ "config": { "$ref": "#/$defs/config-git-init" }
176
+ }
177
+ },
178
+ {
179
+ "properties": {
180
+ "type": { "const": "exec" },
181
+ "config": { "$ref": "#/$defs/config-exec" }
182
+ }
183
+ }
184
+ ]
185
+ }
186
+ }
187
+ },
188
+ "$defs": {
189
+ "promptItem": {
190
+ "type": "object",
191
+ "required": ["id", "type", "message"],
192
+ "additionalProperties": false,
193
+ "properties": {
194
+ "id": {
195
+ "type": "string",
196
+ "description": "Unique identifier for the prompt value (must be a valid JavaScript identifier: start with letter, underscore, or $, followed by letters, digits, underscores, or $)",
197
+ "pattern": "^[a-zA-Z_$][a-zA-Z0-9_$]*$"
198
+ },
199
+ "type": {
200
+ "type": "string",
201
+ "enum": ["input", "select", "confirm", "password", "number"],
202
+ "description": "Type of prompt to display"
203
+ },
204
+ "message": {
205
+ "type": "string",
206
+ "description": "Prompt message to display to the user"
207
+ },
208
+ "required": {
209
+ "type": "boolean",
210
+ "description": "Whether the prompt value is required (cannot be empty)"
211
+ },
212
+ "enabled": {
213
+ "description": "Whether this prompt should be displayed. Can be a boolean, a string expression, or a conditional expression based on variables or other prompt values.",
214
+ "oneOf": [
215
+ {
216
+ "type": "boolean",
217
+ "description": "Static enabled state"
218
+ },
219
+ {
220
+ "type": "string",
221
+ "description": "JavaScript expression to evaluate (shorthand for { condition: \"...\" }). Prompt only displays if expression evaluates to true."
222
+ },
223
+ {
224
+ "type": "object",
225
+ "description": "Conditional enabled configuration",
226
+ "required": ["condition"],
227
+ "properties": {
228
+ "condition": {
229
+ "type": "string",
230
+ "description": "JavaScript expression to evaluate. Prompt only displays if condition evaluates to true. Has access to all variables and previously collected prompts."
231
+ }
232
+ }
233
+ }
234
+ ]
235
+ },
236
+ "default": {
237
+ "description": "Default value for the prompt. Can be a static value, an object with 'type' and 'value' properties for executable defaults, or a conditional default configuration.",
238
+ "oneOf": [
239
+ {
240
+ "description": "Static default value (string, number, or boolean)"
241
+ },
242
+ {
243
+ "type": "object",
244
+ "description": "Default value configuration for static or executable values",
245
+ "required": ["type", "value"],
246
+ "properties": {
247
+ "type": {
248
+ "type": "string",
249
+ "enum": ["static", "exec"],
250
+ "description": "Type of default value. 'static' for explicit static values, 'exec' for command execution."
538
251
  },
539
- "required": ["file"],
540
- "oneOf": [
541
- {
542
- "required": ["template"]
543
- },
544
- {
545
- "required": ["templateFile"]
546
- }
547
- ]
548
- },
549
- {
550
- "title": "Regex Replace Config",
551
- "properties": {
552
- "file": {
553
- "type": "string",
554
- "description": "Path to the file to modify"
555
- },
556
- "pattern": {
557
- "type": "string",
558
- "description": "Regular expression pattern to find"
559
- },
560
- "flags": {
561
- "type": "string",
562
- "description": "Regex flags (e.g., 'g', 'gm', 'gi')"
563
- },
564
- "replacement": {
565
- "type": "string",
566
- "description": "String to replace matches with"
567
- },
568
- "condition": {
569
- "type": "string",
570
- "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
571
- }
252
+ "value": {
253
+ "description": "For 'static' type: the static value. For 'exec' type: the shell command to execute. Commands can be any shell command including git, npm, node, etc. The command output will be trimmed and auto-parsed as JSON, number, or boolean when applicable."
254
+ }
255
+ }
256
+ },
257
+ {
258
+ "type": "object",
259
+ "description": "Conditional default value configuration",
260
+ "required": ["type", "condition", "ifTrue", "ifFalse"],
261
+ "properties": {
262
+ "type": {
263
+ "type": "string",
264
+ "enum": ["conditional"],
265
+ "description": "Type of default value. 'conditional' for condition-based defaults."
572
266
  },
573
- "required": ["file", "pattern", "replacement"]
574
- },
575
- {
576
- "title": "Replace In File Config",
577
- "properties": {
578
- "file": {
579
- "type": "string",
580
- "description": "Path to the file to modify"
581
- },
582
- "replacements": {
583
- "type": "array",
584
- "items": {
585
- "type": "object",
586
- "properties": {
587
- "find": {
588
- "type": "string",
589
- "description": "String to find"
590
- },
591
- "replace": {
592
- "type": "string",
593
- "description": "String to replace with"
594
- }
595
- },
596
- "required": ["find", "replace"]
597
- }
598
- },
599
- "condition": {
600
- "type": "string",
601
- "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
602
- }
267
+ "condition": {
268
+ "type": "string",
269
+ "description": "JavaScript expression to evaluate. Can reference variables, prompts, and config values."
603
270
  },
604
- "required": ["file", "replacements"]
605
- },
606
- {
607
- "title": "Delete Config",
608
- "properties": {
609
- "paths": {
610
- "type": "array",
611
- "items": {
612
- "type": "string"
613
- },
614
- "description": "Array of file or directory paths to delete"
615
- },
616
- "condition": {
617
- "type": "string",
618
- "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
619
- }
271
+ "ifTrue": {
272
+ "description": "Value to use if condition evaluates to true. Can be a static value or a template string with {{variables}}."
620
273
  },
621
- "required": ["paths"]
274
+ "ifFalse": {
275
+ "description": "Value to use if condition evaluates to false. Can be a static value or a template string with {{variables}}."
276
+ }
277
+ }
278
+ }
279
+ ]
280
+ },
281
+ "placeholder": {
282
+ "type": "string",
283
+ "description": "Placeholder text (for input prompts)"
284
+ },
285
+ "min": {
286
+ "type": "number",
287
+ "description": "Minimum value (for number prompts)"
288
+ },
289
+ "max": {
290
+ "type": "number",
291
+ "description": "Maximum value (for number prompts)"
292
+ },
293
+ "choices": {
294
+ "type": "array",
295
+ "description": "Available choices (for select prompts)",
296
+ "items": {
297
+ "type": "object",
298
+ "required": ["name", "value"],
299
+ "properties": {
300
+ "name": {
301
+ "type": "string",
302
+ "description": "Display name for the choice"
622
303
  },
623
- {
624
- "title": "Rename Config",
625
- "properties": {
626
- "from": {
627
- "type": "string",
628
- "description": "Current file or directory path"
629
- },
630
- "to": {
631
- "type": "string",
632
- "description": "New file or directory path"
633
- },
634
- "condition": {
635
- "type": "string",
636
- "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
637
- }
304
+ "value": {
305
+ "description": "Value to use when this choice is selected"
306
+ }
307
+ }
308
+ }
309
+ },
310
+ "override": {
311
+ "type": "string",
312
+ "enum": ["merge", "replace"],
313
+ "description": "Strategy for merging with base prompt when extending templates. 'merge' (default) intelligently merges properties, 'replace' completely replaces the base prompt. Must be specified when prompt ID conflicts with base template."
314
+ }
315
+ }
316
+ },
317
+ "variableItem": {
318
+ "type": "object",
319
+ "required": ["id", "value"],
320
+ "additionalProperties": false,
321
+ "properties": {
322
+ "id": {
323
+ "type": "string",
324
+ "description": "Unique identifier for the variable (must be a valid JavaScript identifier: start with letter, underscore, or $, followed by letters, digits, underscores, or $)",
325
+ "pattern": "^[a-zA-Z_$][a-zA-Z0-9_$]*$"
326
+ },
327
+ "value": {
328
+ "description": "Variable value. Can be a static value or an object with 'type' and 'value' properties for executable values.",
329
+ "oneOf": [
330
+ {
331
+ "description": "Static value (string, number, or boolean)"
332
+ },
333
+ {
334
+ "type": "object",
335
+ "description": "Value configuration for static or executable values",
336
+ "required": ["type", "value"],
337
+ "properties": {
338
+ "type": {
339
+ "type": "string",
340
+ "enum": ["static", "exec"],
341
+ "description": "Type of value. 'static' for explicit static values, 'exec' for command execution."
638
342
  },
639
- "required": ["from", "to"]
640
- },
641
- {
642
- "title": "Git Init Config",
643
- "properties": {
644
- "removeExisting": {
645
- "type": "boolean",
646
- "description": "Whether to remove existing .git directory"
647
- },
648
- "initialCommit": {
649
- "type": "boolean",
650
- "description": "Whether to create an initial commit"
651
- },
652
- "message": {
653
- "type": "string",
654
- "description": "Initial commit message"
655
- },
656
- "condition": {
657
- "type": "string",
658
- "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
659
- }
343
+ "value": {
344
+ "description": "For 'static' type: the static value. For 'exec' type: the shell command to execute. Commands output will be trimmed and auto-parsed as JSON, number, or boolean when applicable."
345
+ }
346
+ }
347
+ }
348
+ ]
349
+ },
350
+ "override": {
351
+ "type": "string",
352
+ "enum": ["merge", "replace"],
353
+ "description": "Strategy for merging with base variable when extending templates. 'merge' (default) replaces the value, 'replace' completely replaces the variable. Must be specified when variable ID conflicts with base template."
354
+ }
355
+ }
356
+ },
357
+ "taskVariableItem": {
358
+ "type": "object",
359
+ "required": ["id", "value"],
360
+ "additionalProperties": false,
361
+ "properties": {
362
+ "id": {
363
+ "type": "string",
364
+ "description": "Unique identifier for the variable (must be a valid JavaScript identifier: start with letter, underscore, or $, followed by letters, digits, underscores, or $)",
365
+ "pattern": "^[a-zA-Z_$][a-zA-Z0-9_$]*$"
366
+ },
367
+ "value": {
368
+ "description": "Variable value. Can be a static value or an object with 'type' and 'value' properties for executable values.",
369
+ "oneOf": [
370
+ {
371
+ "description": "Static value (string, number, or boolean)"
372
+ },
373
+ {
374
+ "type": "object",
375
+ "description": "Value configuration for static or executable values",
376
+ "required": ["type", "value"],
377
+ "properties": {
378
+ "type": {
379
+ "type": "string",
380
+ "enum": ["static", "exec"],
381
+ "description": "Type of value. 'static' for explicit static values, 'exec' for command execution."
660
382
  },
661
- "required": ["removeExisting", "initialCommit"]
383
+ "value": {
384
+ "description": "For 'static' type: the static value. For 'exec' type: the shell command to execute. Commands output will be trimmed and auto-parsed as JSON, number, or boolean when applicable."
385
+ }
386
+ }
387
+ }
388
+ ]
389
+ }
390
+ }
391
+ },
392
+ "config-update-json": {
393
+ "title": "Update JSON Config",
394
+ "type": "object",
395
+ "additionalProperties": false,
396
+ "properties": {
397
+ "file": {
398
+ "type": "string",
399
+ "description": "Path to the JSON file to update"
400
+ },
401
+ "updates": {
402
+ "type": "object",
403
+ "description": "Key-value pairs to update (supports nested paths with dot notation)"
404
+ },
405
+ "condition": {
406
+ "type": "string",
407
+ "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
408
+ }
409
+ },
410
+ "required": ["file", "updates"]
411
+ },
412
+ "config-template": {
413
+ "title": "Template Config",
414
+ "type": "object",
415
+ "additionalProperties": false,
416
+ "properties": {
417
+ "file": {
418
+ "type": "string",
419
+ "description": "Path to the file to create or overwrite"
420
+ },
421
+ "template": {
422
+ "type": "string",
423
+ "description": "Inline template string with {{variable}} placeholders. Cannot be used with templateFile."
424
+ },
425
+ "templateFile": {
426
+ "type": "string",
427
+ "description": "Path to external template file (relative to project root). Files with .hbs extension automatically use Handlebars templating. Cannot be used with template."
428
+ },
429
+ "condition": {
430
+ "type": "string",
431
+ "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
432
+ }
433
+ },
434
+ "required": ["file"],
435
+ "oneOf": [
436
+ {
437
+ "required": ["template"]
438
+ },
439
+ {
440
+ "required": ["templateFile"]
441
+ }
442
+ ]
443
+ },
444
+ "config-create": {
445
+ "title": "Create Config",
446
+ "type": "object",
447
+ "additionalProperties": false,
448
+ "properties": {
449
+ "file": {
450
+ "type": "string",
451
+ "description": "Path to the file to create (will not overwrite if file already exists)"
452
+ },
453
+ "template": {
454
+ "type": "string",
455
+ "description": "Inline template string with {{variable}} placeholders. Cannot be used with templateFile."
456
+ },
457
+ "templateFile": {
458
+ "type": "string",
459
+ "description": "Path to external template file (relative to project root). Files with .hbs extension automatically use Handlebars templating. Cannot be used with template."
460
+ },
461
+ "condition": {
462
+ "type": "string",
463
+ "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
464
+ }
465
+ },
466
+ "required": ["file"],
467
+ "oneOf": [
468
+ {
469
+ "required": ["template"]
470
+ },
471
+ {
472
+ "required": ["templateFile"]
473
+ }
474
+ ]
475
+ },
476
+ "config-regex-replace": {
477
+ "title": "Regex Replace Config",
478
+ "type": "object",
479
+ "additionalProperties": false,
480
+ "properties": {
481
+ "file": {
482
+ "type": "string",
483
+ "description": "Path to the file to modify"
484
+ },
485
+ "pattern": {
486
+ "type": "string",
487
+ "description": "Regular expression pattern to find"
488
+ },
489
+ "flags": {
490
+ "type": "string",
491
+ "description": "Regex flags (e.g., 'g', 'gm', 'gi')"
492
+ },
493
+ "replacement": {
494
+ "type": "string",
495
+ "description": "String to replace matches with"
496
+ },
497
+ "condition": {
498
+ "type": "string",
499
+ "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
500
+ }
501
+ },
502
+ "required": ["file", "pattern", "replacement"]
503
+ },
504
+ "config-replace-in-file": {
505
+ "title": "Replace In File Config",
506
+ "type": "object",
507
+ "additionalProperties": false,
508
+ "properties": {
509
+ "file": {
510
+ "type": "string",
511
+ "description": "Path to the file to modify"
512
+ },
513
+ "replacements": {
514
+ "type": "array",
515
+ "items": {
516
+ "type": "object",
517
+ "properties": {
518
+ "find": {
519
+ "type": "string",
520
+ "description": "String to find"
662
521
  },
663
- {
664
- "title": "Exec Config",
665
- "properties": {
666
- "command": {
667
- "type": "string",
668
- "description": "Shell command to execute"
669
- },
670
- "cwd": {
671
- "type": "string",
672
- "description": "Working directory for the command"
673
- },
674
- "condition": {
675
- "type": "string",
676
- "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
677
- }
678
- },
679
- "required": ["command"]
522
+ "replace": {
523
+ "type": "string",
524
+ "description": "String to replace with"
680
525
  }
681
- ]
526
+ },
527
+ "required": ["find", "replace"]
682
528
  }
529
+ },
530
+ "condition": {
531
+ "type": "string",
532
+ "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
683
533
  }
684
- }
534
+ },
535
+ "required": ["file", "replacements"]
536
+ },
537
+ "config-delete": {
538
+ "title": "Delete Config",
539
+ "type": "object",
540
+ "additionalProperties": false,
541
+ "properties": {
542
+ "paths": {
543
+ "type": "array",
544
+ "items": {
545
+ "type": "string"
546
+ },
547
+ "description": "Array of file or directory paths to delete"
548
+ },
549
+ "condition": {
550
+ "type": "string",
551
+ "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
552
+ }
553
+ },
554
+ "required": ["paths"]
555
+ },
556
+ "config-rename": {
557
+ "title": "Rename Config",
558
+ "type": "object",
559
+ "additionalProperties": false,
560
+ "properties": {
561
+ "from": {
562
+ "type": "string",
563
+ "description": "Current file or directory path"
564
+ },
565
+ "to": {
566
+ "type": "string",
567
+ "description": "New file or directory path"
568
+ },
569
+ "condition": {
570
+ "type": "string",
571
+ "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
572
+ }
573
+ },
574
+ "required": ["from", "to"]
575
+ },
576
+ "config-git-init": {
577
+ "title": "Git Init Config",
578
+ "type": "object",
579
+ "additionalProperties": false,
580
+ "properties": {
581
+ "removeExisting": {
582
+ "type": "boolean",
583
+ "description": "Whether to remove existing .git directory"
584
+ },
585
+ "initialCommit": {
586
+ "type": "boolean",
587
+ "description": "Whether to create an initial commit"
588
+ },
589
+ "message": {
590
+ "type": "string",
591
+ "description": "Initial commit message"
592
+ },
593
+ "condition": {
594
+ "type": "string",
595
+ "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
596
+ }
597
+ },
598
+ "required": ["removeExisting", "initialCommit"]
599
+ },
600
+ "config-exec": {
601
+ "title": "Exec Config",
602
+ "additionalProperties": false,
603
+ "type": "object",
604
+ "properties": {
605
+ "command": {
606
+ "type": "string",
607
+ "description": "Shell command to execute"
608
+ },
609
+ "cwd": {
610
+ "type": "string",
611
+ "description": "Working directory for the command"
612
+ },
613
+ "condition": {
614
+ "type": "string",
615
+ "description": "Optional JavaScript expression to evaluate. Task only executes if condition evaluates to true."
616
+ }
617
+ },
618
+ "required": ["command"]
685
619
  }
686
620
  }
687
621
  }