@exposify/next 0.0.2 → 0.0.4
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/README.md +56 -4
- package/dist/config.cjs +365 -94
- package/dist/config.d.cts +49 -3
- package/dist/config.d.ts +49 -3
- package/dist/config.js +359 -88
- package/dist/exposify-next.js +552 -118
- package/dist/index.cjs +190 -43
- package/dist/index.d.cts +40 -120
- package/dist/index.d.ts +40 -120
- package/dist/index.js +196 -43
- package/dist/manifest-DZQCvzQy.d.cts +176 -0
- package/dist/manifest-DZQCvzQy.d.ts +176 -0
- package/package.json +3 -3
- package/dist/fields-olvyFnxj.d.cts +0 -23
- package/dist/fields-olvyFnxj.d.ts +0 -23
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { ProposedField, LoginField, DocSource } from '@exposify/core';
|
|
2
|
+
|
|
3
|
+
type FieldType = "string" | "number" | "boolean" | "json" | "file";
|
|
4
|
+
interface ActionField {
|
|
5
|
+
name: string;
|
|
6
|
+
type: FieldType;
|
|
7
|
+
/** Read with getAll(): a repeated field, sent as an array. */
|
|
8
|
+
array?: true;
|
|
9
|
+
/** Its allowed values, from `LIST.includes(x)` over a constant list. */
|
|
10
|
+
enum?: string[];
|
|
11
|
+
/** Always needed: a parameter of its own (a `.bind` argument), a non-optional key of an object parameter, or required by every form that submits to it. */
|
|
12
|
+
required?: true;
|
|
13
|
+
/** From the form's input (pass 3, forms.ts). */
|
|
14
|
+
min?: number;
|
|
15
|
+
max?: number;
|
|
16
|
+
minLength?: number;
|
|
17
|
+
maxLength?: number;
|
|
18
|
+
pattern?: string;
|
|
19
|
+
/** Where it was found: the action's code, its form, or both. */
|
|
20
|
+
origin?: "action" | "form" | "both";
|
|
21
|
+
/** For the agent: format, units, what it refers to (from an accepted proposal). */
|
|
22
|
+
description?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface AppRouteEntry {
|
|
26
|
+
router: "app";
|
|
27
|
+
/** `/api/orders/:id`; catch-alls as `:slug*`, optional ones as `:slug*?`. */
|
|
28
|
+
path: string;
|
|
29
|
+
params: string[];
|
|
30
|
+
/** Project-relative, for messages. */
|
|
31
|
+
file: string;
|
|
32
|
+
/** Exported methods when generated; the loaded module's exports win at runtime. */
|
|
33
|
+
methods: string[];
|
|
34
|
+
/** Loads the route module to read exposed()/hidden()/describe() off its exports. Absent for edge routes. */
|
|
35
|
+
load?: () => Promise<Record<string, unknown>>;
|
|
36
|
+
/** `export const runtime = "edge"`: not loaded into the Node MCP route, so markers there aren't read. */
|
|
37
|
+
edge?: boolean;
|
|
38
|
+
}
|
|
39
|
+
interface PagesRouteEntry {
|
|
40
|
+
router: "pages";
|
|
41
|
+
path: string;
|
|
42
|
+
params: string[];
|
|
43
|
+
file: string;
|
|
44
|
+
}
|
|
45
|
+
type ManifestRoute = AppRouteEntry | PagesRouteEntry;
|
|
46
|
+
/** An exported function of a `"use server"` module. */
|
|
47
|
+
interface ManifestAction {
|
|
48
|
+
/** Unique among actions: the default tool name, and the URL segment under `<mcpPath>/actions/`. */
|
|
49
|
+
key: string;
|
|
50
|
+
file: string;
|
|
51
|
+
export: string;
|
|
52
|
+
/** How each parameter is filled on a call, in order: see `ActionParamRole` in parse.ts. */
|
|
53
|
+
params: Array<{
|
|
54
|
+
name: string;
|
|
55
|
+
role: "formData" | "prev" | "input" | "object";
|
|
56
|
+
}>;
|
|
57
|
+
/** It sets or deletes a cookie, which would land on exposify's internal call rather than the agent's client. */
|
|
58
|
+
setsCookies?: boolean;
|
|
59
|
+
/** What it takes, worked out from its code (fields.ts): its tool schema when the app doesn't write one. */
|
|
60
|
+
fields: ActionField[];
|
|
61
|
+
/** It reads every form field, so its code doesn't say which exist. */
|
|
62
|
+
readsAll?: boolean;
|
|
63
|
+
/** What the analysis couldn't work out ("line N: …"): with any, the app writes the schema. */
|
|
64
|
+
unresolved?: string[];
|
|
65
|
+
/** The forms that submit to it (pass 3), where they are. */
|
|
66
|
+
forms?: Array<{
|
|
67
|
+
file: string;
|
|
68
|
+
line: number;
|
|
69
|
+
}>;
|
|
70
|
+
/** An input `describe` proposed and a person accepted, current with the code: used when `fields` can't be the schema. */
|
|
71
|
+
proposed?: ProposedField[];
|
|
72
|
+
/**
|
|
73
|
+
* A page that uses it (`/checkout`, `/admin/orders/:id`): tool calls are
|
|
74
|
+
* sent there as a real Server Action request. Absent when no page uses it;
|
|
75
|
+
* it's then called in-process by the MCP route.
|
|
76
|
+
*/
|
|
77
|
+
host?: string;
|
|
78
|
+
/**
|
|
79
|
+
* The app's own checks it runs first (`lib/auth.ts#requireAdmin`): a
|
|
80
|
+
* user who doesn't pass one doesn't see the tool (guards.ts).
|
|
81
|
+
*/
|
|
82
|
+
guards?: string[];
|
|
83
|
+
load: () => Promise<Record<string, unknown>>;
|
|
84
|
+
}
|
|
85
|
+
/** An App Router page: a read tool that fetches it like a browser (pages.ts). */
|
|
86
|
+
interface ManifestPage {
|
|
87
|
+
/** Tool name, e.g. `view_product_slug`. */
|
|
88
|
+
name: string;
|
|
89
|
+
/** `/product/:slug`, as routes are written. */
|
|
90
|
+
path: string;
|
|
91
|
+
params: string[];
|
|
92
|
+
file: string;
|
|
93
|
+
/** Search params its code reads: optional tool arguments, sent as the query. */
|
|
94
|
+
search?: string[];
|
|
95
|
+
/** From its static `metadata`. */
|
|
96
|
+
title?: string;
|
|
97
|
+
description?: string;
|
|
98
|
+
/** Just a form posting to a Server Action: not a tool unless `pages` lists it. */
|
|
99
|
+
formOnly?: boolean;
|
|
100
|
+
/** The app's own checks it runs (`lib/auth.ts#requireAdmin`), see ManifestAction.guards. */
|
|
101
|
+
guards?: string[];
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The app's own login (login.ts): a sign-in form under the MCP route makes
|
|
105
|
+
* this request, for Connect with no code. `host` is the page with the
|
|
106
|
+
* action's form, which tool calls redirected to mean "signed out".
|
|
107
|
+
*/
|
|
108
|
+
type ManifestLogin = ManifestLoginStep & {
|
|
109
|
+
/** Where it is, for the startup log and the dashboard: "signIn in app/actions/auth.ts". */
|
|
110
|
+
where?: string;
|
|
111
|
+
/** The first step takes no password: an email or phone number, then the code. */
|
|
112
|
+
passwordless?: boolean;
|
|
113
|
+
/** The login's second step, a code; `host` (or the route's path) is where the first step redirects to ask for it. */
|
|
114
|
+
verify?: ManifestLoginStep;
|
|
115
|
+
};
|
|
116
|
+
/** One request of the login. */
|
|
117
|
+
type ManifestLoginStep = {
|
|
118
|
+
kind: "action";
|
|
119
|
+
key: string;
|
|
120
|
+
fields: LoginField[];
|
|
121
|
+
host?: string;
|
|
122
|
+
} | {
|
|
123
|
+
kind: "route";
|
|
124
|
+
path: string;
|
|
125
|
+
fields: LoginField[];
|
|
126
|
+
body: "json" | "form";
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* A Next app on Supabase Auth with `@supabase/ssr` (supabase.ts): which
|
|
130
|
+
* sign-ins Connect makes on Supabase directly, decided at build time from
|
|
131
|
+
* where the app signs its users in (plan Part 2, decisions A and B).
|
|
132
|
+
*/
|
|
133
|
+
interface ManifestSupabase {
|
|
134
|
+
/** The session cookie's name when the app sets one; else `sb-<ref>-auth-token`, from the project's URL. */
|
|
135
|
+
cookieName?: string;
|
|
136
|
+
/**
|
|
137
|
+
* Signed in to on Supabase directly: by password on the form at
|
|
138
|
+
* `<MCP path>/login` (the password goes from the app's server to Supabase),
|
|
139
|
+
* the rest on the broker's pages. A method the app signs in with on its
|
|
140
|
+
* server isn't here: the app's own login does it, or nothing does.
|
|
141
|
+
*/
|
|
142
|
+
direct: Array<"password" | "email-code" | "social">;
|
|
143
|
+
/** Where the app signs in, as found: "signInWithPassword in components/login-form.tsx:42 (browser: "use client")". */
|
|
144
|
+
found: string[];
|
|
145
|
+
/** Server sign-ins the app's own login couldn't be made from, so that method has no sign-in until the owner switches to Supabase directly. */
|
|
146
|
+
unusable?: string[];
|
|
147
|
+
/** Routes that finish a sign-in (`exchangeCodeForSession`): their checks don't run for Connect's sign-ins. */
|
|
148
|
+
callbacks?: string[];
|
|
149
|
+
/** The app's sign-in pages (`/auth/login`): a tool call redirected there was signed out. */
|
|
150
|
+
loginPages?: string[];
|
|
151
|
+
}
|
|
152
|
+
interface ExposifyManifest {
|
|
153
|
+
info: {
|
|
154
|
+
name: string;
|
|
155
|
+
version: string;
|
|
156
|
+
};
|
|
157
|
+
/** next.config's basePath, prefixed to every tool call's path. */
|
|
158
|
+
basePath?: string;
|
|
159
|
+
/** next.config's trailingSlash: tool calls add one, so they aren't redirected. */
|
|
160
|
+
trailingSlash?: boolean;
|
|
161
|
+
routes: ManifestRoute[];
|
|
162
|
+
/** The MCP route's URL without its catch-all segment, e.g. `/mcp`: Server Actions are served under `<mcpPath>/actions/`. */
|
|
163
|
+
mcpPath?: string;
|
|
164
|
+
actions?: ManifestAction[];
|
|
165
|
+
pages?: ManifestPage[];
|
|
166
|
+
login?: ManifestLogin;
|
|
167
|
+
supabase?: ManifestSupabase;
|
|
168
|
+
/** Auth libraries in package.json ("next-auth", "@supabase/ssr", ...), reported with the login. */
|
|
169
|
+
authStacks?: string[];
|
|
170
|
+
/** Docs for search_docs, embedded so they work without a file system. */
|
|
171
|
+
docs: DocSource[];
|
|
172
|
+
/** exposify.descriptions.json's texts, "METHOD /path" -> text. */
|
|
173
|
+
descriptions?: Record<string, string>;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export type { ActionField as A, ExposifyManifest as E, ManifestSupabase as M, PagesRouteEntry as P, AppRouteEntry as a, ManifestAction as b, ManifestLogin as c, ManifestLoginStep as d, ManifestPage as e, ManifestRoute as f };
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { ProposedField, LoginField, DocSource } from '@exposify/core';
|
|
2
|
+
|
|
3
|
+
type FieldType = "string" | "number" | "boolean" | "json" | "file";
|
|
4
|
+
interface ActionField {
|
|
5
|
+
name: string;
|
|
6
|
+
type: FieldType;
|
|
7
|
+
/** Read with getAll(): a repeated field, sent as an array. */
|
|
8
|
+
array?: true;
|
|
9
|
+
/** Its allowed values, from `LIST.includes(x)` over a constant list. */
|
|
10
|
+
enum?: string[];
|
|
11
|
+
/** Always needed: a parameter of its own (a `.bind` argument), a non-optional key of an object parameter, or required by every form that submits to it. */
|
|
12
|
+
required?: true;
|
|
13
|
+
/** From the form's input (pass 3, forms.ts). */
|
|
14
|
+
min?: number;
|
|
15
|
+
max?: number;
|
|
16
|
+
minLength?: number;
|
|
17
|
+
maxLength?: number;
|
|
18
|
+
pattern?: string;
|
|
19
|
+
/** Where it was found: the action's code, its form, or both. */
|
|
20
|
+
origin?: "action" | "form" | "both";
|
|
21
|
+
/** For the agent: format, units, what it refers to (from an accepted proposal). */
|
|
22
|
+
description?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface AppRouteEntry {
|
|
26
|
+
router: "app";
|
|
27
|
+
/** `/api/orders/:id`; catch-alls as `:slug*`, optional ones as `:slug*?`. */
|
|
28
|
+
path: string;
|
|
29
|
+
params: string[];
|
|
30
|
+
/** Project-relative, for messages. */
|
|
31
|
+
file: string;
|
|
32
|
+
/** Exported methods when generated; the loaded module's exports win at runtime. */
|
|
33
|
+
methods: string[];
|
|
34
|
+
/** Loads the route module to read exposed()/hidden()/describe() off its exports. Absent for edge routes. */
|
|
35
|
+
load?: () => Promise<Record<string, unknown>>;
|
|
36
|
+
/** `export const runtime = "edge"`: not loaded into the Node MCP route, so markers there aren't read. */
|
|
37
|
+
edge?: boolean;
|
|
38
|
+
}
|
|
39
|
+
interface PagesRouteEntry {
|
|
40
|
+
router: "pages";
|
|
41
|
+
path: string;
|
|
42
|
+
params: string[];
|
|
43
|
+
file: string;
|
|
44
|
+
}
|
|
45
|
+
type ManifestRoute = AppRouteEntry | PagesRouteEntry;
|
|
46
|
+
/** An exported function of a `"use server"` module. */
|
|
47
|
+
interface ManifestAction {
|
|
48
|
+
/** Unique among actions: the default tool name, and the URL segment under `<mcpPath>/actions/`. */
|
|
49
|
+
key: string;
|
|
50
|
+
file: string;
|
|
51
|
+
export: string;
|
|
52
|
+
/** How each parameter is filled on a call, in order: see `ActionParamRole` in parse.ts. */
|
|
53
|
+
params: Array<{
|
|
54
|
+
name: string;
|
|
55
|
+
role: "formData" | "prev" | "input" | "object";
|
|
56
|
+
}>;
|
|
57
|
+
/** It sets or deletes a cookie, which would land on exposify's internal call rather than the agent's client. */
|
|
58
|
+
setsCookies?: boolean;
|
|
59
|
+
/** What it takes, worked out from its code (fields.ts): its tool schema when the app doesn't write one. */
|
|
60
|
+
fields: ActionField[];
|
|
61
|
+
/** It reads every form field, so its code doesn't say which exist. */
|
|
62
|
+
readsAll?: boolean;
|
|
63
|
+
/** What the analysis couldn't work out ("line N: …"): with any, the app writes the schema. */
|
|
64
|
+
unresolved?: string[];
|
|
65
|
+
/** The forms that submit to it (pass 3), where they are. */
|
|
66
|
+
forms?: Array<{
|
|
67
|
+
file: string;
|
|
68
|
+
line: number;
|
|
69
|
+
}>;
|
|
70
|
+
/** An input `describe` proposed and a person accepted, current with the code: used when `fields` can't be the schema. */
|
|
71
|
+
proposed?: ProposedField[];
|
|
72
|
+
/**
|
|
73
|
+
* A page that uses it (`/checkout`, `/admin/orders/:id`): tool calls are
|
|
74
|
+
* sent there as a real Server Action request. Absent when no page uses it;
|
|
75
|
+
* it's then called in-process by the MCP route.
|
|
76
|
+
*/
|
|
77
|
+
host?: string;
|
|
78
|
+
/**
|
|
79
|
+
* The app's own checks it runs first (`lib/auth.ts#requireAdmin`): a
|
|
80
|
+
* user who doesn't pass one doesn't see the tool (guards.ts).
|
|
81
|
+
*/
|
|
82
|
+
guards?: string[];
|
|
83
|
+
load: () => Promise<Record<string, unknown>>;
|
|
84
|
+
}
|
|
85
|
+
/** An App Router page: a read tool that fetches it like a browser (pages.ts). */
|
|
86
|
+
interface ManifestPage {
|
|
87
|
+
/** Tool name, e.g. `view_product_slug`. */
|
|
88
|
+
name: string;
|
|
89
|
+
/** `/product/:slug`, as routes are written. */
|
|
90
|
+
path: string;
|
|
91
|
+
params: string[];
|
|
92
|
+
file: string;
|
|
93
|
+
/** Search params its code reads: optional tool arguments, sent as the query. */
|
|
94
|
+
search?: string[];
|
|
95
|
+
/** From its static `metadata`. */
|
|
96
|
+
title?: string;
|
|
97
|
+
description?: string;
|
|
98
|
+
/** Just a form posting to a Server Action: not a tool unless `pages` lists it. */
|
|
99
|
+
formOnly?: boolean;
|
|
100
|
+
/** The app's own checks it runs (`lib/auth.ts#requireAdmin`), see ManifestAction.guards. */
|
|
101
|
+
guards?: string[];
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The app's own login (login.ts): a sign-in form under the MCP route makes
|
|
105
|
+
* this request, for Connect with no code. `host` is the page with the
|
|
106
|
+
* action's form, which tool calls redirected to mean "signed out".
|
|
107
|
+
*/
|
|
108
|
+
type ManifestLogin = ManifestLoginStep & {
|
|
109
|
+
/** Where it is, for the startup log and the dashboard: "signIn in app/actions/auth.ts". */
|
|
110
|
+
where?: string;
|
|
111
|
+
/** The first step takes no password: an email or phone number, then the code. */
|
|
112
|
+
passwordless?: boolean;
|
|
113
|
+
/** The login's second step, a code; `host` (or the route's path) is where the first step redirects to ask for it. */
|
|
114
|
+
verify?: ManifestLoginStep;
|
|
115
|
+
};
|
|
116
|
+
/** One request of the login. */
|
|
117
|
+
type ManifestLoginStep = {
|
|
118
|
+
kind: "action";
|
|
119
|
+
key: string;
|
|
120
|
+
fields: LoginField[];
|
|
121
|
+
host?: string;
|
|
122
|
+
} | {
|
|
123
|
+
kind: "route";
|
|
124
|
+
path: string;
|
|
125
|
+
fields: LoginField[];
|
|
126
|
+
body: "json" | "form";
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* A Next app on Supabase Auth with `@supabase/ssr` (supabase.ts): which
|
|
130
|
+
* sign-ins Connect makes on Supabase directly, decided at build time from
|
|
131
|
+
* where the app signs its users in (plan Part 2, decisions A and B).
|
|
132
|
+
*/
|
|
133
|
+
interface ManifestSupabase {
|
|
134
|
+
/** The session cookie's name when the app sets one; else `sb-<ref>-auth-token`, from the project's URL. */
|
|
135
|
+
cookieName?: string;
|
|
136
|
+
/**
|
|
137
|
+
* Signed in to on Supabase directly: by password on the form at
|
|
138
|
+
* `<MCP path>/login` (the password goes from the app's server to Supabase),
|
|
139
|
+
* the rest on the broker's pages. A method the app signs in with on its
|
|
140
|
+
* server isn't here: the app's own login does it, or nothing does.
|
|
141
|
+
*/
|
|
142
|
+
direct: Array<"password" | "email-code" | "social">;
|
|
143
|
+
/** Where the app signs in, as found: "signInWithPassword in components/login-form.tsx:42 (browser: "use client")". */
|
|
144
|
+
found: string[];
|
|
145
|
+
/** Server sign-ins the app's own login couldn't be made from, so that method has no sign-in until the owner switches to Supabase directly. */
|
|
146
|
+
unusable?: string[];
|
|
147
|
+
/** Routes that finish a sign-in (`exchangeCodeForSession`): their checks don't run for Connect's sign-ins. */
|
|
148
|
+
callbacks?: string[];
|
|
149
|
+
/** The app's sign-in pages (`/auth/login`): a tool call redirected there was signed out. */
|
|
150
|
+
loginPages?: string[];
|
|
151
|
+
}
|
|
152
|
+
interface ExposifyManifest {
|
|
153
|
+
info: {
|
|
154
|
+
name: string;
|
|
155
|
+
version: string;
|
|
156
|
+
};
|
|
157
|
+
/** next.config's basePath, prefixed to every tool call's path. */
|
|
158
|
+
basePath?: string;
|
|
159
|
+
/** next.config's trailingSlash: tool calls add one, so they aren't redirected. */
|
|
160
|
+
trailingSlash?: boolean;
|
|
161
|
+
routes: ManifestRoute[];
|
|
162
|
+
/** The MCP route's URL without its catch-all segment, e.g. `/mcp`: Server Actions are served under `<mcpPath>/actions/`. */
|
|
163
|
+
mcpPath?: string;
|
|
164
|
+
actions?: ManifestAction[];
|
|
165
|
+
pages?: ManifestPage[];
|
|
166
|
+
login?: ManifestLogin;
|
|
167
|
+
supabase?: ManifestSupabase;
|
|
168
|
+
/** Auth libraries in package.json ("next-auth", "@supabase/ssr", ...), reported with the login. */
|
|
169
|
+
authStacks?: string[];
|
|
170
|
+
/** Docs for search_docs, embedded so they work without a file system. */
|
|
171
|
+
docs: DocSource[];
|
|
172
|
+
/** exposify.descriptions.json's texts, "METHOD /path" -> text. */
|
|
173
|
+
descriptions?: Record<string, string>;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export type { ActionField as A, ExposifyManifest as E, ManifestSupabase as M, PagesRouteEntry as P, AppRouteEntry as a, ManifestAction as b, ManifestLogin as c, ManifestLoginStep as d, ManifestPage as e, ManifestRoute as f };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exposify/next",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/parser": "^8.0.0",
|
|
35
|
-
"@exposify/cli": "0.0.
|
|
36
|
-
"@exposify/core": "0.3.
|
|
35
|
+
"@exposify/cli": "0.0.3",
|
|
36
|
+
"@exposify/core": "0.3.16",
|
|
37
37
|
"tinyglobby": "^0.2.10",
|
|
38
38
|
"zod": "^3.24.0"
|
|
39
39
|
},
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
type FieldType = "string" | "number" | "boolean" | "json" | "file";
|
|
2
|
-
interface ActionField {
|
|
3
|
-
name: string;
|
|
4
|
-
type: FieldType;
|
|
5
|
-
/** Read with getAll(): a repeated field, sent as an array. */
|
|
6
|
-
array?: true;
|
|
7
|
-
/** Its allowed values, from `LIST.includes(x)` over a constant list. */
|
|
8
|
-
enum?: string[];
|
|
9
|
-
/** Always needed: a parameter of its own (a `.bind` argument), a non-optional key of an object parameter, or required by every form that submits to it. */
|
|
10
|
-
required?: true;
|
|
11
|
-
/** From the form's input (pass 3, forms.ts). */
|
|
12
|
-
min?: number;
|
|
13
|
-
max?: number;
|
|
14
|
-
minLength?: number;
|
|
15
|
-
maxLength?: number;
|
|
16
|
-
pattern?: string;
|
|
17
|
-
/** Where it was found: the action's code, its form, or both. */
|
|
18
|
-
origin?: "action" | "form" | "both";
|
|
19
|
-
/** For the agent: format, units, what it refers to (from an accepted proposal). */
|
|
20
|
-
description?: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export type { ActionField as A };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
type FieldType = "string" | "number" | "boolean" | "json" | "file";
|
|
2
|
-
interface ActionField {
|
|
3
|
-
name: string;
|
|
4
|
-
type: FieldType;
|
|
5
|
-
/** Read with getAll(): a repeated field, sent as an array. */
|
|
6
|
-
array?: true;
|
|
7
|
-
/** Its allowed values, from `LIST.includes(x)` over a constant list. */
|
|
8
|
-
enum?: string[];
|
|
9
|
-
/** Always needed: a parameter of its own (a `.bind` argument), a non-optional key of an object parameter, or required by every form that submits to it. */
|
|
10
|
-
required?: true;
|
|
11
|
-
/** From the form's input (pass 3, forms.ts). */
|
|
12
|
-
min?: number;
|
|
13
|
-
max?: number;
|
|
14
|
-
minLength?: number;
|
|
15
|
-
maxLength?: number;
|
|
16
|
-
pattern?: string;
|
|
17
|
-
/** Where it was found: the action's code, its form, or both. */
|
|
18
|
-
origin?: "action" | "form" | "both";
|
|
19
|
-
/** For the agent: format, units, what it refers to (from an accepted proposal). */
|
|
20
|
-
description?: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export type { ActionField as A };
|