@flowrunner/cli 0.1.16 → 0.1.18
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/02-zod-types.md +87 -29
- package/ai-docs/instructions/service-code-format/03-parameters.md +3 -1
- package/ai-docs/instructions/service-code-format/05-dictionaries.md +8 -2
- package/ai-docs/instructions/service-code-format/07-actions.md +5 -1
- package/ai-docs/instructions/service-code-format/14-reference-service.md +1 -1
- package/ai-docs/instructions/service-code-format/16-gotchas.md +90 -0
- package/ai-docs/instructions/service-code-format/18-test-recipes.md +2 -1
- package/ai-docs/instructions/service-code-format/README.md +1 -1
- package/dist/cli.js +61 -47
- package/dist/cli.js.map +3 -3
- package/dist/index.js +60 -46
- package/dist/index.js.map +3 -3
- package/dist/types/flow-extension-runner/src/v2/dictionaries/payload-schema.d.ts +1 -1
- package/dist/types/flow-extension-runner/src/v2/params/schema/defaults.d.ts +4 -11
- package/dist/types/flow-extension-runner/src/v2/params/widget-types.d.ts +1 -1
- package/dist/types/flow-extension-runner/src/v2/params/zod.d.ts +9 -19
- package/dist/types/flow-extension-runner/src/v2/types.d.ts +1 -1
- package/package.json +1 -1
- package/runtime/index.js +60 -46
- package/runtime/index.js.map +3 -3
- package/runtime/types/flow-extension-runner/src/v2/dictionaries/payload-schema.d.ts +1 -1
- package/runtime/types/flow-extension-runner/src/v2/params/schema/defaults.d.ts +4 -11
- package/runtime/types/flow-extension-runner/src/v2/params/widget-types.d.ts +1 -1
- package/runtime/types/flow-extension-runner/src/v2/params/zod.d.ts +9 -19
- package/runtime/types/flow-extension-runner/src/v2/types.d.ts +1 -1
|
@@ -4,7 +4,7 @@ export declare const DictionaryPayloadSchema: import("zod").ZodObject<{
|
|
|
4
4
|
criteria: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
5
5
|
}, import("zod/v4/core").$loose>;
|
|
6
6
|
export interface DictionaryPayload {
|
|
7
|
-
search
|
|
7
|
+
search: string;
|
|
8
8
|
cursor?: unknown;
|
|
9
9
|
criteria: Record<string, unknown>;
|
|
10
10
|
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { type AnyZod } from './introspect';
|
|
2
2
|
/** `z.text()` — FlowRunner's own marker, the most specific thing a field can declare. */
|
|
3
3
|
export declare const WIDGET_DESCRIPTIONS: Record<string, string>;
|
|
4
|
-
/**
|
|
5
|
-
* `z.json()`. More specific than the widget it carries: it renders as the same textarea `z.text()` does, so
|
|
6
|
-
* the widget wording would say "line breaks are allowed" and leave out the only rule that actually rejects
|
|
7
|
-
* anything — that what is typed has to parse.
|
|
8
|
-
*/
|
|
9
|
-
export declare const JSON_DESCRIPTION = "Expects JSON, e.g. {\"key\": \"value\"}";
|
|
10
4
|
/**
|
|
11
5
|
* The plain core type, when nothing more specific is declared.
|
|
12
6
|
*
|
|
@@ -26,11 +20,10 @@ export declare const FORMAT_DESCRIPTIONS: Record<string, string>;
|
|
|
26
20
|
/**
|
|
27
21
|
* What a field's declaration explains about itself, most specific wins:
|
|
28
22
|
*
|
|
29
|
-
* 1. `z.
|
|
30
|
-
* 2. a
|
|
31
|
-
* 3.
|
|
32
|
-
* 4. the plain core type — `number`, `bigint`, `literal`, `enum`, `date`
|
|
23
|
+
* 1. a FlowRunner widget marker — `z.text()`, a string the console renders specially
|
|
24
|
+
* 2. a zod `format` token — `z.email()`, `z.ipv4()`, `z.iso.date()`, …
|
|
25
|
+
* 3. the plain core type — `number`, `bigint`, `literal`, `enum`, `date`
|
|
33
26
|
*
|
|
34
|
-
*
|
|
27
|
+
* Each is read past the optional/nullable/default wrappers, so a modifier never changes the answer.
|
|
35
28
|
*/
|
|
36
29
|
export declare function describeField(schema: AnyZod): string | undefined;
|
|
@@ -33,7 +33,7 @@ export declare const FlowExtensionParamWidgetTypes: {
|
|
|
33
33
|
* The widget tokens a declaration carries EXPLICITLY, as author metadata (`meta.frWidget`) — everything else
|
|
34
34
|
* in the map above is DERIVED from the zod type by `deriveWidget`.
|
|
35
35
|
*
|
|
36
|
-
* `MULTI_LINE_TEXT` is `z.text()
|
|
36
|
+
* `MULTI_LINE_TEXT` is `z.text()`; the `FILE_*_OPTIONS` tokens name a platform param group.
|
|
37
37
|
*/
|
|
38
38
|
export type FrWidgetToken = 'MULTI_LINE_TEXT' | 'FILE_UPLOAD_OPTIONS' | 'FILE_LIST_OPTIONS' | 'FILE_GET_OPTIONS' | 'FILE_DELETE_OPTIONS';
|
|
39
39
|
/** The subset that names a platform param GROUP rather than a single control. */
|
|
@@ -33,8 +33,6 @@ export interface FrMeta {
|
|
|
33
33
|
/** A widget token the declaration carries explicitly — see `FrWidgetToken` in ./widget-types.ts. */
|
|
34
34
|
frWidget?: FrWidgetToken;
|
|
35
35
|
frSecret?: boolean;
|
|
36
|
-
/** `z.json()` — the value arrives as TEXT and is parsed before the handler sees it. See `json()` below. */
|
|
37
|
-
frJson?: boolean;
|
|
38
36
|
/**
|
|
39
37
|
* `.dynamicProps()` — the spec (holding the author's function) on a declared schema, the plain ref of the
|
|
40
38
|
* method that runs it on a decoded one. Never encoded as the spec: see ./json/encode.ts.
|
|
@@ -98,25 +96,17 @@ declare module 'zod' {
|
|
|
98
96
|
}
|
|
99
97
|
declare function text(): baseZod.ZodString;
|
|
100
98
|
/**
|
|
101
|
-
*
|
|
99
|
+
* `z.json()` is not a param type. It was one — JSON typed into a textarea, parsed before the handler ran — and
|
|
100
|
+
* was removed (FR-3910): `z.unknown()` takes any value as given, and a declared `z.object()` / `z.array()` takes
|
|
101
|
+
* JSON text of its kind (see ./schema/coerce.ts), so the only thing it still offered was a parse of free text
|
|
102
|
+
* into a value nobody had described.
|
|
102
103
|
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* - **`execute` receives the parsed structure.** `frJson` tells ../schema/coerce.ts to `JSON.parse` the text
|
|
108
|
-
* on the way in, so no service writes its own parse and none has to invent wording for text that is not
|
|
109
|
-
* JSON. Coercion already sits between the transport and zod for exactly this kind of conversion — this is
|
|
110
|
-
* the same arrangement as `z.string().pipe(z.coerce.number())`, with a fixed conversion.
|
|
111
|
-
* - **The author's TYPE is the parsed value, not the text.** Hence `unknown` underneath: `z.infer` gives the
|
|
112
|
-
* handler `unknown`, which is what it actually receives. Declaring `z.string()` here would publish and
|
|
113
|
-
* coerce correctly and then lie to every author about what lands in `params`.
|
|
114
|
-
*
|
|
115
|
-
* ⚠️ This SHADOWS zod's own `z.json()` (the namespace is `Object.create(baseZod)`). Deliberate, and safe
|
|
116
|
-
* only because zod's version cannot currently be declared at all — it recurses until the stack is gone, and
|
|
117
|
-
* the extension never registers (FR-3600). An author reaching for `z.json()` gets this one.
|
|
104
|
+
* It throws rather than disappearing, because the name would otherwise fall through to zod's own `z.json()`
|
|
105
|
+
* (the namespace is `Object.create(baseZod)`), which cannot be declared at all: it recurses until the stack is
|
|
106
|
+
* gone and the extension never registers (FR-3600). An author following an old example gets a message naming
|
|
107
|
+
* what to write instead, at registration, instead of a stack overflow.
|
|
118
108
|
*/
|
|
119
|
-
declare function json():
|
|
109
|
+
declare function json(): never;
|
|
120
110
|
export declare const z: Omit<typeof baseZod, "json"> & {
|
|
121
111
|
text: typeof text;
|
|
122
112
|
json: typeof json;
|
|
@@ -90,7 +90,7 @@ export interface DictionaryProps<TShape extends ExtensionShape = AnyShape, TCrit
|
|
|
90
90
|
result?: unknown;
|
|
91
91
|
oauth2Scopes?: string[];
|
|
92
92
|
execute: (bag: HandlerBag<TShape> & {
|
|
93
|
-
search
|
|
93
|
+
search: string;
|
|
94
94
|
cursor?: unknown;
|
|
95
95
|
criteria: Infer<TCriteria>;
|
|
96
96
|
}) => DictionaryResult | DictionaryResultItems | Promise<DictionaryResult | DictionaryResultItems>;
|