@flowrunner/cli 0.1.9-dev.2 → 0.1.10
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/ai-docs/instructions/service-code-format/03-parameters.md +22 -7
- package/ai-docs/instructions/service-code-format/13-runtime-contracts.md +4 -1
- package/ai-docs/instructions/service-code-format/16-gotchas.md +8 -0
- package/dist/cli.js +11 -3
- package/dist/cli.js.map +2 -2
- package/dist/index.js +10 -2
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
- package/runtime/index.js +10 -2
- package/runtime/index.js.map +2 -2
- package/templates/qa-test/files/src/index.js +7 -5
|
@@ -449,7 +449,8 @@ const getRecordTypesDictionary = ext.dictionary({
|
|
|
449
449
|
})
|
|
450
450
|
|
|
451
451
|
// The fields of one record type — every kind of field a loader can return. Built per call: a loader answers
|
|
452
|
-
// with fresh zod each time.
|
|
452
|
+
// with fresh zod each time. Their rules and defaults apply in the forms only: at run time a loaded field
|
|
453
|
+
// reaches the handler as the flow supplied it.
|
|
453
454
|
const recordFields = recordType => {
|
|
454
455
|
switch (recordType) {
|
|
455
456
|
case 'contact':
|
|
@@ -457,7 +458,7 @@ const recordFields = recordType => {
|
|
|
457
458
|
name : z.string().label('Name'),
|
|
458
459
|
email: z.email().optional().label('Email (format-checked)'),
|
|
459
460
|
age : z.number().int().min(0).max(150).optional().label('Age (0–150)'),
|
|
460
|
-
vip : z.boolean().optional().default(false).label('VIP (
|
|
461
|
+
vip : z.boolean().optional().default(false).label('VIP (form default: false)'),
|
|
461
462
|
tier : z.enum(['free', 'pro', 'enterprise'])
|
|
462
463
|
.labels({ free: 'Free', pro: 'Pro', enterprise: 'Enterprise' })
|
|
463
464
|
.optional()
|
|
@@ -471,7 +472,7 @@ const recordFields = recordType => {
|
|
|
471
472
|
price : z.number().min(0).label('Price (≥ 0)'),
|
|
472
473
|
inStock : z.boolean().label('In Stock'),
|
|
473
474
|
tags : z.array(z.string()).optional().label('Tags (list of text)'),
|
|
474
|
-
category: z.enum(['books', 'games', 'music']).default('books').label('Category (
|
|
475
|
+
category: z.enum(['books', 'games', 'music']).default('books').label('Category (form default: books)'),
|
|
475
476
|
}
|
|
476
477
|
|
|
477
478
|
case 'event':
|
|
@@ -503,7 +504,8 @@ ext.addAction({
|
|
|
503
504
|
}),
|
|
504
505
|
}),
|
|
505
506
|
result : { params: {} },
|
|
506
|
-
// The loaded fields arrive nested under `record
|
|
507
|
+
// The loaded fields arrive nested under `record` as the flow supplied them: they are not re-checked, converted
|
|
508
|
+
// or defaulted at run time — `types` shows what each one actually is
|
|
507
509
|
execute : ({ params }) => ({ params, types: typesOf(params.record) }),
|
|
508
510
|
})
|
|
509
511
|
|
|
@@ -583,7 +585,7 @@ ext.addAction({
|
|
|
583
585
|
execute: () => ({
|
|
584
586
|
costCenter: z.string().optional().label('Cost Center'),
|
|
585
587
|
priority : z.enum(['low', 'normal', 'high']).optional().label('Priority'),
|
|
586
|
-
loadedAt : z.string().optional().default(new Date().toISOString()).label('Loaded At (default
|
|
588
|
+
loadedAt : z.string().optional().default(new Date().toISOString()).label('Loaded At (form default: when it loaded)'),
|
|
587
589
|
}),
|
|
588
590
|
}),
|
|
589
591
|
}),
|