esoul-sdk 0.3.0 → 0.6.0
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 +135 -24
- package/dist/audience.d.ts +103 -0
- package/dist/audience.js +142 -0
- package/dist/bindings.d.ts +164 -0
- package/dist/bindings.js +163 -0
- package/dist/db/client-core.d.ts +154 -0
- package/dist/db/client-core.js +274 -0
- package/dist/db/compile-rules.d.ts +199 -0
- package/dist/db/compile-rules.js +390 -0
- package/dist/db/memory-client.d.ts +136 -0
- package/dist/db/memory-client.js +323 -0
- package/dist/db/schema-gen.d.ts +103 -0
- package/dist/db/schema-gen.js +329 -0
- package/dist/helpers.d.ts +67 -0
- package/dist/helpers.js +125 -8
- package/dist/index.d.ts +24 -0
- package/dist/index.js +22 -0
- package/dist/manifest.d.ts +445 -13
- package/dist/manifest.js +211 -5
- package/dist/react.d.ts +29 -0
- package/dist/react.js +10 -0
- package/dist/roles.d.ts +43 -0
- package/dist/roles.js +56 -0
- package/dist/server.d.ts +165 -0
- package/dist/server.js +80 -0
- package/dist/testing/db.d.ts +69 -0
- package/dist/testing/db.js +94 -0
- package/dist/testing/index.d.ts +14 -0
- package/dist/testing/index.js +9 -0
- package/dist/testing/ops.d.ts +84 -0
- package/dist/testing/ops.js +76 -0
- package/dist/types.d.ts +22 -1
- package/docs/04-tools.md +5 -2
- package/docs/05-ui.md +30 -0
- package/docs/06-server.md +49 -0
- package/docs/07-background-tasks.md +29 -3
- package/docs/10-testing.md +18 -0
- package/docs/12-rules.md +3 -2
- package/docs/13-people-and-access.md +148 -0
- package/docs/14-database.md +115 -0
- package/docs/15-realtime.md +88 -0
- package/docs/16-bindings.md +79 -0
- package/llms-full.txt +715 -31
- package/llms.txt +4 -0
- package/package.json +7 -3
- package/schemas/plugin.schema.json +323 -9
package/dist/manifest.d.ts
CHANGED
|
@@ -75,6 +75,128 @@ export declare const PluginConnectionSchema: z.ZodEffects<z.ZodObject<{
|
|
|
75
75
|
clientSecretEnv?: string | undefined;
|
|
76
76
|
headerNames?: string[] | undefined;
|
|
77
77
|
}>;
|
|
78
|
+
/**
|
|
79
|
+
* WHO MAY REACH A SURFACE — the access level of one op, route or kickable task.
|
|
80
|
+
*
|
|
81
|
+
* Every entry point of an app has always been owner-or-editor-only, which is
|
|
82
|
+
* the right default and the wrong ONLY option: an app with customers needs a
|
|
83
|
+
* catalogue anyone may read and an order anyone signed in may place.
|
|
84
|
+
*
|
|
85
|
+
* write (default) — people who may edit the workspace. Today's behaviour.
|
|
86
|
+
* read — anyone who may see it, including a read-only member.
|
|
87
|
+
* public — anyone on the app's public share link, signed in or not.
|
|
88
|
+
*
|
|
89
|
+
* `requires: "account"` adds "…but they must be signed in", answered with
|
|
90
|
+
* `login-required` (and a way back) rather than a flat refusal, so the app can
|
|
91
|
+
* render a sign-in wall instead of an error.
|
|
92
|
+
*
|
|
93
|
+
* NOTHING opens by default. A level is opt-in per NAME, and the install card
|
|
94
|
+
* lists every public door before the owner presses Install.
|
|
95
|
+
*/
|
|
96
|
+
export declare const PLUGIN_ACCESS_LEVELS: readonly ["write", "read", "public"];
|
|
97
|
+
export type PluginAccessLevel = (typeof PLUGIN_ACCESS_LEVELS)[number];
|
|
98
|
+
export declare const PluginSurfaceEntrySchema: z.ZodObject<{
|
|
99
|
+
access: z.ZodDefault<z.ZodOptional<z.ZodEnum<["write", "read", "public"]>>>;
|
|
100
|
+
requires: z.ZodOptional<z.ZodLiteral<"account">>;
|
|
101
|
+
}, "strict", z.ZodTypeAny, {
|
|
102
|
+
access: "public" | "write" | "read";
|
|
103
|
+
requires?: "account" | undefined;
|
|
104
|
+
}, {
|
|
105
|
+
access?: "public" | "write" | "read" | undefined;
|
|
106
|
+
requires?: "account" | undefined;
|
|
107
|
+
}>;
|
|
108
|
+
/** Normalised view of any surface list: every declared name, in order. */
|
|
109
|
+
export declare function surfaceNames(list: unknown): string[];
|
|
110
|
+
/** The access a surface declares. Absent, unknown or array-form → `write`. */
|
|
111
|
+
export declare function surfaceAccess(list: unknown, name: string): {
|
|
112
|
+
level: PluginAccessLevel;
|
|
113
|
+
requiresAccount: boolean;
|
|
114
|
+
};
|
|
115
|
+
/** Every name in this list that is reachable without a workspace session. */
|
|
116
|
+
export declare function publicSurfaceNames(list: unknown): string[];
|
|
117
|
+
/**
|
|
118
|
+
* WHAT THE APP CALLS ITS PEOPLE.
|
|
119
|
+
*
|
|
120
|
+
* The platform knows owner / member / visitor / anonymous. A shop thinks in
|
|
121
|
+
* customer / staff / owner. An app declares its own words and how the
|
|
122
|
+
* platform's kinds map onto them, and the owner can override the word for one
|
|
123
|
+
* person and one app in the sharing settings — the `appRoles` column that has
|
|
124
|
+
* carried a "Phase 5+" comment since it was added, and that nothing has ever
|
|
125
|
+
* written.
|
|
126
|
+
*
|
|
127
|
+
* `describe` is not decoration: it is what the role picker shows the owner when
|
|
128
|
+
* they are deciding what to give somebody.
|
|
129
|
+
*/
|
|
130
|
+
export declare const PluginRolesSchema: z.ZodEffects<z.ZodObject<{
|
|
131
|
+
vocabulary: z.ZodArray<z.ZodString, "many">;
|
|
132
|
+
default: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
133
|
+
owner: z.ZodOptional<z.ZodString>;
|
|
134
|
+
"member-edit": z.ZodOptional<z.ZodString>;
|
|
135
|
+
"member-readonly": z.ZodOptional<z.ZodString>;
|
|
136
|
+
visitor: z.ZodOptional<z.ZodString>;
|
|
137
|
+
anonymous: z.ZodOptional<z.ZodString>;
|
|
138
|
+
agent: z.ZodOptional<z.ZodString>;
|
|
139
|
+
}, "strict", z.ZodTypeAny, {
|
|
140
|
+
owner?: string | undefined;
|
|
141
|
+
"member-edit"?: string | undefined;
|
|
142
|
+
"member-readonly"?: string | undefined;
|
|
143
|
+
visitor?: string | undefined;
|
|
144
|
+
anonymous?: string | undefined;
|
|
145
|
+
agent?: string | undefined;
|
|
146
|
+
}, {
|
|
147
|
+
owner?: string | undefined;
|
|
148
|
+
"member-edit"?: string | undefined;
|
|
149
|
+
"member-readonly"?: string | undefined;
|
|
150
|
+
visitor?: string | undefined;
|
|
151
|
+
anonymous?: string | undefined;
|
|
152
|
+
agent?: string | undefined;
|
|
153
|
+
}>>>;
|
|
154
|
+
describe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
155
|
+
}, "strict", z.ZodTypeAny, {
|
|
156
|
+
vocabulary: string[];
|
|
157
|
+
default: {
|
|
158
|
+
owner?: string | undefined;
|
|
159
|
+
"member-edit"?: string | undefined;
|
|
160
|
+
"member-readonly"?: string | undefined;
|
|
161
|
+
visitor?: string | undefined;
|
|
162
|
+
anonymous?: string | undefined;
|
|
163
|
+
agent?: string | undefined;
|
|
164
|
+
};
|
|
165
|
+
describe?: Record<string, string> | undefined;
|
|
166
|
+
}, {
|
|
167
|
+
vocabulary: string[];
|
|
168
|
+
default?: {
|
|
169
|
+
owner?: string | undefined;
|
|
170
|
+
"member-edit"?: string | undefined;
|
|
171
|
+
"member-readonly"?: string | undefined;
|
|
172
|
+
visitor?: string | undefined;
|
|
173
|
+
anonymous?: string | undefined;
|
|
174
|
+
agent?: string | undefined;
|
|
175
|
+
} | undefined;
|
|
176
|
+
describe?: Record<string, string> | undefined;
|
|
177
|
+
}>, {
|
|
178
|
+
vocabulary: string[];
|
|
179
|
+
default: {
|
|
180
|
+
owner?: string | undefined;
|
|
181
|
+
"member-edit"?: string | undefined;
|
|
182
|
+
"member-readonly"?: string | undefined;
|
|
183
|
+
visitor?: string | undefined;
|
|
184
|
+
anonymous?: string | undefined;
|
|
185
|
+
agent?: string | undefined;
|
|
186
|
+
};
|
|
187
|
+
describe?: Record<string, string> | undefined;
|
|
188
|
+
}, {
|
|
189
|
+
vocabulary: string[];
|
|
190
|
+
default?: {
|
|
191
|
+
owner?: string | undefined;
|
|
192
|
+
"member-edit"?: string | undefined;
|
|
193
|
+
"member-readonly"?: string | undefined;
|
|
194
|
+
visitor?: string | undefined;
|
|
195
|
+
anonymous?: string | undefined;
|
|
196
|
+
agent?: string | undefined;
|
|
197
|
+
} | undefined;
|
|
198
|
+
describe?: Record<string, string> | undefined;
|
|
199
|
+
}>;
|
|
78
200
|
export declare const PluginManifestSchema: z.ZodObject<{
|
|
79
201
|
manifestVersion: z.ZodLiteral<1>;
|
|
80
202
|
/** Directory name under src/plugins/. Kebab-case. */
|
|
@@ -109,12 +231,42 @@ export declare const PluginManifestSchema: z.ZodObject<{
|
|
|
109
231
|
email?: string | undefined;
|
|
110
232
|
url?: string | undefined;
|
|
111
233
|
}>>;
|
|
112
|
-
/** Tasks the BROWSER may kick via /api/inngest/send-event. */
|
|
113
|
-
kickableTasks: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many"
|
|
234
|
+
/** Tasks the BROWSER may kick via /api/inngest/send-event. Array or name→access. */
|
|
235
|
+
kickableTasks: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
236
|
+
access: z.ZodDefault<z.ZodOptional<z.ZodEnum<["write", "read", "public"]>>>;
|
|
237
|
+
requires: z.ZodOptional<z.ZodLiteral<"account">>;
|
|
238
|
+
}, "strict", z.ZodTypeAny, {
|
|
239
|
+
access: "public" | "write" | "read";
|
|
240
|
+
requires?: "account" | undefined;
|
|
241
|
+
}, {
|
|
242
|
+
access?: "public" | "write" | "read" | undefined;
|
|
243
|
+
requires?: "account" | undefined;
|
|
244
|
+
}>>]>>>;
|
|
114
245
|
/** Push-ingress endpoints — POST|GET /api/plugins/<id>/webhook/<name>. */
|
|
115
246
|
webhooks: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
116
|
-
/** Server ops — POST /api/plugins/<id>/op/<name
|
|
117
|
-
ops: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many"
|
|
247
|
+
/** Server ops — POST /api/plugins/<id>/op/<name>. Array or name→access. */
|
|
248
|
+
ops: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
249
|
+
access: z.ZodDefault<z.ZodOptional<z.ZodEnum<["write", "read", "public"]>>>;
|
|
250
|
+
requires: z.ZodOptional<z.ZodLiteral<"account">>;
|
|
251
|
+
}, "strict", z.ZodTypeAny, {
|
|
252
|
+
access: "public" | "write" | "read";
|
|
253
|
+
requires?: "account" | undefined;
|
|
254
|
+
}, {
|
|
255
|
+
access?: "public" | "write" | "read" | undefined;
|
|
256
|
+
requires?: "account" | undefined;
|
|
257
|
+
}>>]>>>;
|
|
258
|
+
/** Server routes the app brings with it — `pluginServer.routes` in server.ts, mounted at
|
|
259
|
+
* `/api/plugins/<id>/route/<name>` on install (GET and POST; may stream). */
|
|
260
|
+
routes: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
261
|
+
access: z.ZodDefault<z.ZodOptional<z.ZodEnum<["write", "read", "public"]>>>;
|
|
262
|
+
requires: z.ZodOptional<z.ZodLiteral<"account">>;
|
|
263
|
+
}, "strict", z.ZodTypeAny, {
|
|
264
|
+
access: "public" | "write" | "read";
|
|
265
|
+
requires?: "account" | undefined;
|
|
266
|
+
}, {
|
|
267
|
+
access?: "public" | "write" | "read" | undefined;
|
|
268
|
+
requires?: "account" | undefined;
|
|
269
|
+
}>>]>>>;
|
|
118
270
|
/** Poll cadences for durable tasks (the offline-safe pull lane). */
|
|
119
271
|
pollTasks: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
120
272
|
task: z.ZodString;
|
|
@@ -139,6 +291,77 @@ export declare const PluginManifestSchema: z.ZodObject<{
|
|
|
139
291
|
}>>;
|
|
140
292
|
/** Reserved for the review/consent flow. */
|
|
141
293
|
scopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
294
|
+
/** The app's own role vocabulary (see PluginRolesSchema). */
|
|
295
|
+
roles: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
296
|
+
vocabulary: z.ZodArray<z.ZodString, "many">;
|
|
297
|
+
default: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
298
|
+
owner: z.ZodOptional<z.ZodString>;
|
|
299
|
+
"member-edit": z.ZodOptional<z.ZodString>;
|
|
300
|
+
"member-readonly": z.ZodOptional<z.ZodString>;
|
|
301
|
+
visitor: z.ZodOptional<z.ZodString>;
|
|
302
|
+
anonymous: z.ZodOptional<z.ZodString>;
|
|
303
|
+
agent: z.ZodOptional<z.ZodString>;
|
|
304
|
+
}, "strict", z.ZodTypeAny, {
|
|
305
|
+
owner?: string | undefined;
|
|
306
|
+
"member-edit"?: string | undefined;
|
|
307
|
+
"member-readonly"?: string | undefined;
|
|
308
|
+
visitor?: string | undefined;
|
|
309
|
+
anonymous?: string | undefined;
|
|
310
|
+
agent?: string | undefined;
|
|
311
|
+
}, {
|
|
312
|
+
owner?: string | undefined;
|
|
313
|
+
"member-edit"?: string | undefined;
|
|
314
|
+
"member-readonly"?: string | undefined;
|
|
315
|
+
visitor?: string | undefined;
|
|
316
|
+
anonymous?: string | undefined;
|
|
317
|
+
agent?: string | undefined;
|
|
318
|
+
}>>>;
|
|
319
|
+
describe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
320
|
+
}, "strict", z.ZodTypeAny, {
|
|
321
|
+
vocabulary: string[];
|
|
322
|
+
default: {
|
|
323
|
+
owner?: string | undefined;
|
|
324
|
+
"member-edit"?: string | undefined;
|
|
325
|
+
"member-readonly"?: string | undefined;
|
|
326
|
+
visitor?: string | undefined;
|
|
327
|
+
anonymous?: string | undefined;
|
|
328
|
+
agent?: string | undefined;
|
|
329
|
+
};
|
|
330
|
+
describe?: Record<string, string> | undefined;
|
|
331
|
+
}, {
|
|
332
|
+
vocabulary: string[];
|
|
333
|
+
default?: {
|
|
334
|
+
owner?: string | undefined;
|
|
335
|
+
"member-edit"?: string | undefined;
|
|
336
|
+
"member-readonly"?: string | undefined;
|
|
337
|
+
visitor?: string | undefined;
|
|
338
|
+
anonymous?: string | undefined;
|
|
339
|
+
agent?: string | undefined;
|
|
340
|
+
} | undefined;
|
|
341
|
+
describe?: Record<string, string> | undefined;
|
|
342
|
+
}>, {
|
|
343
|
+
vocabulary: string[];
|
|
344
|
+
default: {
|
|
345
|
+
owner?: string | undefined;
|
|
346
|
+
"member-edit"?: string | undefined;
|
|
347
|
+
"member-readonly"?: string | undefined;
|
|
348
|
+
visitor?: string | undefined;
|
|
349
|
+
anonymous?: string | undefined;
|
|
350
|
+
agent?: string | undefined;
|
|
351
|
+
};
|
|
352
|
+
describe?: Record<string, string> | undefined;
|
|
353
|
+
}, {
|
|
354
|
+
vocabulary: string[];
|
|
355
|
+
default?: {
|
|
356
|
+
owner?: string | undefined;
|
|
357
|
+
"member-edit"?: string | undefined;
|
|
358
|
+
"member-readonly"?: string | undefined;
|
|
359
|
+
visitor?: string | undefined;
|
|
360
|
+
anonymous?: string | undefined;
|
|
361
|
+
agent?: string | undefined;
|
|
362
|
+
} | undefined;
|
|
363
|
+
describe?: Record<string, string> | undefined;
|
|
364
|
+
}>>;
|
|
142
365
|
/**
|
|
143
366
|
* Tools of OTHER apps in the workspace this plugin's UI may invoke through
|
|
144
367
|
* `useWorkspaceTools()` — "<applicationType>:<tool base name>", e.g.
|
|
@@ -248,17 +471,140 @@ export declare const PluginManifestSchema: z.ZodObject<{
|
|
|
248
471
|
label: string;
|
|
249
472
|
connectionKey: string;
|
|
250
473
|
}>, "many">>>;
|
|
251
|
-
|
|
474
|
+
/**
|
|
475
|
+
* SLOTS this app needs filled (S9). `contract` names what must stand there
|
|
476
|
+
* ("stock/v1"); the OWNER picks which app fills it, and the platform checks
|
|
477
|
+
* at bind time that the provider really has every tool, event and table the
|
|
478
|
+
* contract requires. A required slot nothing fills refuses at the seam
|
|
479
|
+
* (`not-bound`); an optional one is simply absent.
|
|
480
|
+
*/
|
|
481
|
+
uses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
482
|
+
contract: z.ZodString;
|
|
483
|
+
label: z.ZodOptional<z.ZodString>;
|
|
484
|
+
optional: z.ZodOptional<z.ZodBoolean>;
|
|
485
|
+
}, "strict", z.ZodTypeAny, {
|
|
486
|
+
contract: string;
|
|
487
|
+
label?: string | undefined;
|
|
488
|
+
optional?: boolean | undefined;
|
|
489
|
+
}, {
|
|
490
|
+
contract: string;
|
|
491
|
+
label?: string | undefined;
|
|
492
|
+
optional?: boolean | undefined;
|
|
493
|
+
}>>>;
|
|
494
|
+
/**
|
|
495
|
+
* What this app OFFERS other apps, per contract id. A claim, checked at bind
|
|
496
|
+
* time against what the app actually has — a manifest that names a tool the
|
|
497
|
+
* app does not mint refuses the binding rather than failing later inside
|
|
498
|
+
* someone's order.
|
|
499
|
+
*/
|
|
500
|
+
provides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
501
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
502
|
+
events: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
503
|
+
models: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
504
|
+
}, "strict", z.ZodTypeAny, {
|
|
505
|
+
tools?: string[] | undefined;
|
|
506
|
+
events?: string[] | undefined;
|
|
507
|
+
models?: string[] | undefined;
|
|
508
|
+
}, {
|
|
509
|
+
tools?: string[] | undefined;
|
|
510
|
+
events?: string[] | undefined;
|
|
511
|
+
models?: string[] | undefined;
|
|
512
|
+
}>>>;
|
|
513
|
+
/**
|
|
514
|
+
* The app's realtime TOPICS, and who hears each (forge-sdk-spec-and-tests
|
|
515
|
+
* §A1.3.5). `audience` is `all` (default — the instance's channel), `viewer`
|
|
516
|
+
* (one channel per person) or `role:<name>`; `mayAddress` names the roles
|
|
517
|
+
* allowed to aim a message at someone else. The platform mints a token per
|
|
518
|
+
* channel, so a customer is never handed the staff channel or another
|
|
519
|
+
* customer's — it is not filtered on arrival, it is never issued.
|
|
520
|
+
* `esoul-sdk/audience` is the one decision both sides use.
|
|
521
|
+
*/
|
|
522
|
+
channel: z.ZodOptional<z.ZodObject<{
|
|
523
|
+
topics: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
524
|
+
audience: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"all">, z.ZodLiteral<"viewer">, z.ZodString]>>;
|
|
525
|
+
mayAddress: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
526
|
+
description: z.ZodOptional<z.ZodString>;
|
|
527
|
+
}, "strict", z.ZodTypeAny, {
|
|
528
|
+
description?: string | undefined;
|
|
529
|
+
audience?: string | undefined;
|
|
530
|
+
mayAddress?: string[] | undefined;
|
|
531
|
+
}, {
|
|
532
|
+
description?: string | undefined;
|
|
533
|
+
audience?: string | undefined;
|
|
534
|
+
mayAddress?: string[] | undefined;
|
|
535
|
+
}>>;
|
|
536
|
+
}, "strict", z.ZodTypeAny, {
|
|
537
|
+
topics: Record<string, {
|
|
538
|
+
description?: string | undefined;
|
|
539
|
+
audience?: string | undefined;
|
|
540
|
+
mayAddress?: string[] | undefined;
|
|
541
|
+
}>;
|
|
542
|
+
}, {
|
|
543
|
+
topics: Record<string, {
|
|
544
|
+
description?: string | undefined;
|
|
545
|
+
audience?: string | undefined;
|
|
546
|
+
mayAddress?: string[] | undefined;
|
|
547
|
+
}>;
|
|
548
|
+
}>>;
|
|
549
|
+
/**
|
|
550
|
+
* The app's own TABLES (forge-sdk-spec-and-tests §A1.3.4). Shape only: the
|
|
551
|
+
* rule compiler (`db/compile-rules.ts`) is what validates a field type, a
|
|
552
|
+
* rule's principals and a sealed column, and it says which key was wrong.
|
|
553
|
+
*
|
|
554
|
+
* It is declared HERE because a schema that does not know a block SILENTLY
|
|
555
|
+
* DROPS it — `z.object` strips what it has no field for. The install path
|
|
556
|
+
* parses through this schema, so for one evening an app installed from its
|
|
557
|
+
* own repository arrived with `db: undefined`, the job skipped its
|
|
558
|
+
* schema step without a word, and the app was live with no tables
|
|
559
|
+
* (2026-09-11, found by driving it). Hence `.strict()` below: a block this
|
|
560
|
+
* platform does not understand refuses the install instead of vanishing.
|
|
561
|
+
*/
|
|
562
|
+
db: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
563
|
+
scope: z.ZodOptional<z.ZodEnum<["instance", "workspace", "user"]>>;
|
|
564
|
+
owner: z.ZodOptional<z.ZodLiteral<"creator">>;
|
|
565
|
+
fields: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
566
|
+
sealed: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
567
|
+
unique: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>;
|
|
568
|
+
indexes: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>;
|
|
569
|
+
rules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
570
|
+
}, "strict", z.ZodTypeAny, {
|
|
571
|
+
fields: Record<string, string>;
|
|
572
|
+
owner?: "creator" | undefined;
|
|
573
|
+
scope?: "workspace" | "instance" | "user" | undefined;
|
|
574
|
+
sealed?: string[] | undefined;
|
|
575
|
+
unique?: string[][] | undefined;
|
|
576
|
+
indexes?: string[][] | undefined;
|
|
577
|
+
rules?: Record<string, unknown> | undefined;
|
|
578
|
+
}, {
|
|
579
|
+
fields: Record<string, string>;
|
|
580
|
+
owner?: "creator" | undefined;
|
|
581
|
+
scope?: "workspace" | "instance" | "user" | undefined;
|
|
582
|
+
sealed?: string[] | undefined;
|
|
583
|
+
unique?: string[][] | undefined;
|
|
584
|
+
indexes?: string[][] | undefined;
|
|
585
|
+
rules?: Record<string, unknown> | undefined;
|
|
586
|
+
}>>>;
|
|
587
|
+
}, "strict", z.ZodTypeAny, {
|
|
588
|
+
version: string;
|
|
589
|
+
applicationType: string;
|
|
252
590
|
description: string;
|
|
253
591
|
manifestVersion: 1;
|
|
254
592
|
id: string;
|
|
255
593
|
name: string;
|
|
256
|
-
version: string;
|
|
257
|
-
applicationType: string;
|
|
258
594
|
entry: string;
|
|
259
|
-
kickableTasks: string[]
|
|
595
|
+
kickableTasks: string[] | Record<string, {
|
|
596
|
+
access: "public" | "write" | "read";
|
|
597
|
+
requires?: "account" | undefined;
|
|
598
|
+
}>;
|
|
260
599
|
webhooks: string[];
|
|
261
|
-
ops: string[]
|
|
600
|
+
ops: string[] | Record<string, {
|
|
601
|
+
access: "public" | "write" | "read";
|
|
602
|
+
requires?: "account" | undefined;
|
|
603
|
+
}>;
|
|
604
|
+
routes: string[] | Record<string, {
|
|
605
|
+
access: "public" | "write" | "read";
|
|
606
|
+
requires?: "account" | undefined;
|
|
607
|
+
}>;
|
|
262
608
|
pollTasks: {
|
|
263
609
|
task: string;
|
|
264
610
|
everyMinutes: number;
|
|
@@ -292,17 +638,55 @@ export declare const PluginManifestSchema: z.ZodObject<{
|
|
|
292
638
|
min: string;
|
|
293
639
|
max?: string | undefined;
|
|
294
640
|
} | undefined;
|
|
641
|
+
roles?: {
|
|
642
|
+
vocabulary: string[];
|
|
643
|
+
default: {
|
|
644
|
+
owner?: string | undefined;
|
|
645
|
+
"member-edit"?: string | undefined;
|
|
646
|
+
"member-readonly"?: string | undefined;
|
|
647
|
+
visitor?: string | undefined;
|
|
648
|
+
anonymous?: string | undefined;
|
|
649
|
+
agent?: string | undefined;
|
|
650
|
+
};
|
|
651
|
+
describe?: Record<string, string> | undefined;
|
|
652
|
+
} | undefined;
|
|
295
653
|
fileSources?: {
|
|
296
654
|
providers: string[];
|
|
297
655
|
workspace?: "read" | "readwrite" | undefined;
|
|
298
656
|
} | undefined;
|
|
657
|
+
uses?: Record<string, {
|
|
658
|
+
contract: string;
|
|
659
|
+
label?: string | undefined;
|
|
660
|
+
optional?: boolean | undefined;
|
|
661
|
+
}> | undefined;
|
|
662
|
+
provides?: Record<string, {
|
|
663
|
+
tools?: string[] | undefined;
|
|
664
|
+
events?: string[] | undefined;
|
|
665
|
+
models?: string[] | undefined;
|
|
666
|
+
}> | undefined;
|
|
667
|
+
channel?: {
|
|
668
|
+
topics: Record<string, {
|
|
669
|
+
description?: string | undefined;
|
|
670
|
+
audience?: string | undefined;
|
|
671
|
+
mayAddress?: string[] | undefined;
|
|
672
|
+
}>;
|
|
673
|
+
} | undefined;
|
|
674
|
+
db?: Record<string, {
|
|
675
|
+
fields: Record<string, string>;
|
|
676
|
+
owner?: "creator" | undefined;
|
|
677
|
+
scope?: "workspace" | "instance" | "user" | undefined;
|
|
678
|
+
sealed?: string[] | undefined;
|
|
679
|
+
unique?: string[][] | undefined;
|
|
680
|
+
indexes?: string[][] | undefined;
|
|
681
|
+
rules?: Record<string, unknown> | undefined;
|
|
682
|
+
}> | undefined;
|
|
299
683
|
}, {
|
|
684
|
+
version: string;
|
|
685
|
+
applicationType: string;
|
|
300
686
|
description: string;
|
|
301
687
|
manifestVersion: 1;
|
|
302
688
|
id: string;
|
|
303
689
|
name: string;
|
|
304
|
-
version: string;
|
|
305
|
-
applicationType: string;
|
|
306
690
|
entry: string;
|
|
307
691
|
icon?: string | undefined;
|
|
308
692
|
author?: {
|
|
@@ -310,9 +694,19 @@ export declare const PluginManifestSchema: z.ZodObject<{
|
|
|
310
694
|
email?: string | undefined;
|
|
311
695
|
url?: string | undefined;
|
|
312
696
|
} | undefined;
|
|
313
|
-
kickableTasks?: string[] |
|
|
697
|
+
kickableTasks?: string[] | Record<string, {
|
|
698
|
+
access?: "public" | "write" | "read" | undefined;
|
|
699
|
+
requires?: "account" | undefined;
|
|
700
|
+
}> | undefined;
|
|
314
701
|
webhooks?: string[] | undefined;
|
|
315
|
-
ops?: string[] |
|
|
702
|
+
ops?: string[] | Record<string, {
|
|
703
|
+
access?: "public" | "write" | "read" | undefined;
|
|
704
|
+
requires?: "account" | undefined;
|
|
705
|
+
}> | undefined;
|
|
706
|
+
routes?: string[] | Record<string, {
|
|
707
|
+
access?: "public" | "write" | "read" | undefined;
|
|
708
|
+
requires?: "account" | undefined;
|
|
709
|
+
}> | undefined;
|
|
316
710
|
pollTasks?: {
|
|
317
711
|
task: string;
|
|
318
712
|
everyMinutes: number;
|
|
@@ -322,6 +716,18 @@ export declare const PluginManifestSchema: z.ZodObject<{
|
|
|
322
716
|
max?: string | undefined;
|
|
323
717
|
} | undefined;
|
|
324
718
|
scopes?: string[] | undefined;
|
|
719
|
+
roles?: {
|
|
720
|
+
vocabulary: string[];
|
|
721
|
+
default?: {
|
|
722
|
+
owner?: string | undefined;
|
|
723
|
+
"member-edit"?: string | undefined;
|
|
724
|
+
"member-readonly"?: string | undefined;
|
|
725
|
+
visitor?: string | undefined;
|
|
726
|
+
anonymous?: string | undefined;
|
|
727
|
+
agent?: string | undefined;
|
|
728
|
+
} | undefined;
|
|
729
|
+
describe?: Record<string, string> | undefined;
|
|
730
|
+
} | undefined;
|
|
325
731
|
workspaceTools?: string[] | undefined;
|
|
326
732
|
connections?: {
|
|
327
733
|
key: string;
|
|
@@ -344,6 +750,32 @@ export declare const PluginManifestSchema: z.ZodObject<{
|
|
|
344
750
|
label: string;
|
|
345
751
|
connectionKey: string;
|
|
346
752
|
}[] | undefined;
|
|
753
|
+
uses?: Record<string, {
|
|
754
|
+
contract: string;
|
|
755
|
+
label?: string | undefined;
|
|
756
|
+
optional?: boolean | undefined;
|
|
757
|
+
}> | undefined;
|
|
758
|
+
provides?: Record<string, {
|
|
759
|
+
tools?: string[] | undefined;
|
|
760
|
+
events?: string[] | undefined;
|
|
761
|
+
models?: string[] | undefined;
|
|
762
|
+
}> | undefined;
|
|
763
|
+
channel?: {
|
|
764
|
+
topics: Record<string, {
|
|
765
|
+
description?: string | undefined;
|
|
766
|
+
audience?: string | undefined;
|
|
767
|
+
mayAddress?: string[] | undefined;
|
|
768
|
+
}>;
|
|
769
|
+
} | undefined;
|
|
770
|
+
db?: Record<string, {
|
|
771
|
+
fields: Record<string, string>;
|
|
772
|
+
owner?: "creator" | undefined;
|
|
773
|
+
scope?: "workspace" | "instance" | "user" | undefined;
|
|
774
|
+
sealed?: string[] | undefined;
|
|
775
|
+
unique?: string[][] | undefined;
|
|
776
|
+
indexes?: string[][] | undefined;
|
|
777
|
+
rules?: Record<string, unknown> | undefined;
|
|
778
|
+
}> | undefined;
|
|
347
779
|
}>;
|
|
348
780
|
export type PluginManifest = z.infer<typeof PluginManifestSchema>;
|
|
349
781
|
export type PluginConnectionDecl = z.infer<typeof PluginConnectionSchema>;
|