esoul-sdk 0.4.0 → 0.7.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.
Files changed (43) hide show
  1. package/README.md +146 -24
  2. package/dist/audience.d.ts +103 -0
  3. package/dist/audience.js +142 -0
  4. package/dist/bindings.d.ts +164 -0
  5. package/dist/bindings.js +163 -0
  6. package/dist/db/client-core.d.ts +169 -0
  7. package/dist/db/client-core.js +316 -0
  8. package/dist/db/compile-rules.d.ts +229 -0
  9. package/dist/db/compile-rules.js +426 -0
  10. package/dist/db/memory-client.d.ts +136 -0
  11. package/dist/db/memory-client.js +332 -0
  12. package/dist/db/schema-gen.d.ts +109 -0
  13. package/dist/db/schema-gen.js +363 -0
  14. package/dist/helpers.d.ts +52 -0
  15. package/dist/helpers.js +106 -10
  16. package/dist/index.d.ts +5 -0
  17. package/dist/index.js +5 -0
  18. package/dist/manifest.d.ts +466 -13
  19. package/dist/manifest.js +218 -5
  20. package/dist/roles.d.ts +43 -0
  21. package/dist/roles.js +56 -0
  22. package/dist/server.d.ts +182 -0
  23. package/dist/server.js +80 -0
  24. package/dist/testing/db.d.ts +71 -0
  25. package/dist/testing/db.js +103 -0
  26. package/dist/testing/index.d.ts +14 -0
  27. package/dist/testing/index.js +9 -0
  28. package/dist/testing/ops.d.ts +84 -0
  29. package/dist/testing/ops.js +76 -0
  30. package/dist/types.d.ts +22 -1
  31. package/docs/04-tools.md +5 -2
  32. package/docs/06-server.md +78 -0
  33. package/docs/07-background-tasks.md +23 -0
  34. package/docs/10-testing.md +18 -0
  35. package/docs/12-rules.md +3 -2
  36. package/docs/13-people-and-access.md +152 -0
  37. package/docs/14-database.md +221 -0
  38. package/docs/15-realtime.md +88 -0
  39. package/docs/16-bindings.md +79 -0
  40. package/llms-full.txt +829 -28
  41. package/llms.txt +4 -0
  42. package/package.json +7 -3
  43. package/schemas/plugin.schema.json +351 -9
@@ -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> (platform-gated). */
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,155 @@ export declare const PluginManifestSchema: z.ZodObject<{
248
471
  label: string;
249
472
  connectionKey: string;
250
473
  }>, "many">>>;
251
- }, "strip", z.ZodTypeAny, {
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.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
569
+ fields: z.ZodArray<z.ZodString, "many">;
570
+ kind: z.ZodOptional<z.ZodEnum<["btree", "contains", "text"]>>;
571
+ }, "strict", z.ZodTypeAny, {
572
+ fields: string[];
573
+ kind?: "btree" | "contains" | "text" | undefined;
574
+ }, {
575
+ fields: string[];
576
+ kind?: "btree" | "contains" | "text" | undefined;
577
+ }>]>, "many">>;
578
+ rules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
579
+ }, "strict", z.ZodTypeAny, {
580
+ fields: Record<string, string>;
581
+ owner?: "creator" | undefined;
582
+ scope?: "workspace" | "instance" | "user" | undefined;
583
+ sealed?: string[] | undefined;
584
+ unique?: string[][] | undefined;
585
+ indexes?: (string[] | {
586
+ fields: string[];
587
+ kind?: "btree" | "contains" | "text" | undefined;
588
+ })[] | undefined;
589
+ rules?: Record<string, unknown> | undefined;
590
+ }, {
591
+ fields: Record<string, string>;
592
+ owner?: "creator" | undefined;
593
+ scope?: "workspace" | "instance" | "user" | undefined;
594
+ sealed?: string[] | undefined;
595
+ unique?: string[][] | undefined;
596
+ indexes?: (string[] | {
597
+ fields: string[];
598
+ kind?: "btree" | "contains" | "text" | undefined;
599
+ })[] | undefined;
600
+ rules?: Record<string, unknown> | undefined;
601
+ }>>>;
602
+ }, "strict", z.ZodTypeAny, {
603
+ version: string;
604
+ applicationType: string;
252
605
  description: string;
253
606
  manifestVersion: 1;
254
607
  id: string;
255
608
  name: string;
256
- version: string;
257
- applicationType: string;
258
609
  entry: string;
259
- kickableTasks: string[];
610
+ kickableTasks: string[] | Record<string, {
611
+ access: "public" | "write" | "read";
612
+ requires?: "account" | undefined;
613
+ }>;
260
614
  webhooks: string[];
261
- ops: string[];
615
+ ops: string[] | Record<string, {
616
+ access: "public" | "write" | "read";
617
+ requires?: "account" | undefined;
618
+ }>;
619
+ routes: string[] | Record<string, {
620
+ access: "public" | "write" | "read";
621
+ requires?: "account" | undefined;
622
+ }>;
262
623
  pollTasks: {
263
624
  task: string;
264
625
  everyMinutes: number;
@@ -292,17 +653,58 @@ export declare const PluginManifestSchema: z.ZodObject<{
292
653
  min: string;
293
654
  max?: string | undefined;
294
655
  } | undefined;
656
+ roles?: {
657
+ vocabulary: string[];
658
+ default: {
659
+ owner?: string | undefined;
660
+ "member-edit"?: string | undefined;
661
+ "member-readonly"?: string | undefined;
662
+ visitor?: string | undefined;
663
+ anonymous?: string | undefined;
664
+ agent?: string | undefined;
665
+ };
666
+ describe?: Record<string, string> | undefined;
667
+ } | undefined;
295
668
  fileSources?: {
296
669
  providers: string[];
297
670
  workspace?: "read" | "readwrite" | undefined;
298
671
  } | undefined;
672
+ uses?: Record<string, {
673
+ contract: string;
674
+ label?: string | undefined;
675
+ optional?: boolean | undefined;
676
+ }> | undefined;
677
+ provides?: Record<string, {
678
+ tools?: string[] | undefined;
679
+ events?: string[] | undefined;
680
+ models?: string[] | undefined;
681
+ }> | undefined;
682
+ channel?: {
683
+ topics: Record<string, {
684
+ description?: string | undefined;
685
+ audience?: string | undefined;
686
+ mayAddress?: string[] | undefined;
687
+ }>;
688
+ } | undefined;
689
+ db?: Record<string, {
690
+ fields: Record<string, string>;
691
+ owner?: "creator" | undefined;
692
+ scope?: "workspace" | "instance" | "user" | undefined;
693
+ sealed?: string[] | undefined;
694
+ unique?: string[][] | undefined;
695
+ indexes?: (string[] | {
696
+ fields: string[];
697
+ kind?: "btree" | "contains" | "text" | undefined;
698
+ })[] | undefined;
699
+ rules?: Record<string, unknown> | undefined;
700
+ }> | undefined;
299
701
  }, {
702
+ version: string;
703
+ applicationType: string;
300
704
  description: string;
301
705
  manifestVersion: 1;
302
706
  id: string;
303
707
  name: string;
304
- version: string;
305
- applicationType: string;
306
708
  entry: string;
307
709
  icon?: string | undefined;
308
710
  author?: {
@@ -310,9 +712,19 @@ export declare const PluginManifestSchema: z.ZodObject<{
310
712
  email?: string | undefined;
311
713
  url?: string | undefined;
312
714
  } | undefined;
313
- kickableTasks?: string[] | undefined;
715
+ kickableTasks?: string[] | Record<string, {
716
+ access?: "public" | "write" | "read" | undefined;
717
+ requires?: "account" | undefined;
718
+ }> | undefined;
314
719
  webhooks?: string[] | undefined;
315
- ops?: string[] | undefined;
720
+ ops?: string[] | Record<string, {
721
+ access?: "public" | "write" | "read" | undefined;
722
+ requires?: "account" | undefined;
723
+ }> | undefined;
724
+ routes?: string[] | Record<string, {
725
+ access?: "public" | "write" | "read" | undefined;
726
+ requires?: "account" | undefined;
727
+ }> | undefined;
316
728
  pollTasks?: {
317
729
  task: string;
318
730
  everyMinutes: number;
@@ -322,6 +734,18 @@ export declare const PluginManifestSchema: z.ZodObject<{
322
734
  max?: string | undefined;
323
735
  } | undefined;
324
736
  scopes?: string[] | undefined;
737
+ roles?: {
738
+ vocabulary: string[];
739
+ default?: {
740
+ owner?: string | undefined;
741
+ "member-edit"?: string | undefined;
742
+ "member-readonly"?: string | undefined;
743
+ visitor?: string | undefined;
744
+ anonymous?: string | undefined;
745
+ agent?: string | undefined;
746
+ } | undefined;
747
+ describe?: Record<string, string> | undefined;
748
+ } | undefined;
325
749
  workspaceTools?: string[] | undefined;
326
750
  connections?: {
327
751
  key: string;
@@ -344,6 +768,35 @@ export declare const PluginManifestSchema: z.ZodObject<{
344
768
  label: string;
345
769
  connectionKey: string;
346
770
  }[] | undefined;
771
+ uses?: Record<string, {
772
+ contract: string;
773
+ label?: string | undefined;
774
+ optional?: boolean | undefined;
775
+ }> | undefined;
776
+ provides?: Record<string, {
777
+ tools?: string[] | undefined;
778
+ events?: string[] | undefined;
779
+ models?: string[] | undefined;
780
+ }> | undefined;
781
+ channel?: {
782
+ topics: Record<string, {
783
+ description?: string | undefined;
784
+ audience?: string | undefined;
785
+ mayAddress?: string[] | undefined;
786
+ }>;
787
+ } | undefined;
788
+ db?: Record<string, {
789
+ fields: Record<string, string>;
790
+ owner?: "creator" | undefined;
791
+ scope?: "workspace" | "instance" | "user" | undefined;
792
+ sealed?: string[] | undefined;
793
+ unique?: string[][] | undefined;
794
+ indexes?: (string[] | {
795
+ fields: string[];
796
+ kind?: "btree" | "contains" | "text" | undefined;
797
+ })[] | undefined;
798
+ rules?: Record<string, unknown> | undefined;
799
+ }> | undefined;
347
800
  }>;
348
801
  export type PluginManifest = z.infer<typeof PluginManifestSchema>;
349
802
  export type PluginConnectionDecl = z.infer<typeof PluginConnectionSchema>;