@spacefast/common 0.2.1 → 0.4.1

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 (226) hide show
  1. package/dist/agents/marketplace-prompts.d.ts +1 -0
  2. package/dist/agents/marketplace-prompts.js +6 -0
  3. package/dist/agents/registry/core.d.ts +4 -12
  4. package/dist/agents/registry/core.js +7 -28
  5. package/dist/config/domains.d.ts +10 -8
  6. package/dist/config/domains.js +4 -7
  7. package/dist/contracts/access-core.d.ts +135 -0
  8. package/dist/contracts/access-core.js +242 -0
  9. package/dist/contracts/access-profiles.d.ts +8 -8
  10. package/dist/contracts/access-profiles.js +8 -8
  11. package/dist/contracts/access.d.ts +14 -103
  12. package/dist/contracts/access.js +10 -210
  13. package/dist/contracts/activity.d.ts +54 -55
  14. package/dist/contracts/activity.js +38 -9
  15. package/dist/contracts/api-keys.d.ts +69 -26
  16. package/dist/contracts/api-keys.js +29 -2
  17. package/dist/contracts/application-journal.d.ts +197 -4
  18. package/dist/contracts/application-journal.js +97 -16
  19. package/dist/contracts/auth.d.ts +20 -0
  20. package/dist/contracts/auth.js +18 -0
  21. package/dist/contracts/beta.d.ts +13 -0
  22. package/dist/contracts/beta.js +28 -0
  23. package/dist/contracts/billing.d.ts +2 -2
  24. package/dist/contracts/bootstrap.d.ts +23 -6
  25. package/dist/contracts/builds.d.ts +24 -4
  26. package/dist/contracts/builds.js +16 -4
  27. package/dist/contracts/channels.d.ts +43 -0
  28. package/dist/contracts/channels.js +22 -6
  29. package/dist/contracts/comments.d.ts +49 -0
  30. package/dist/contracts/comments.js +61 -2
  31. package/dist/contracts/commerce.d.ts +19 -13
  32. package/dist/contracts/connector-access.d.ts +28 -0
  33. package/dist/contracts/connector-access.js +31 -0
  34. package/dist/contracts/connectors.d.ts +2382 -0
  35. package/dist/contracts/connectors.js +941 -0
  36. package/dist/contracts/content-contract-verification.d.ts +112 -58
  37. package/dist/contracts/content-contract-verification.js +42 -54
  38. package/dist/contracts/content-model-emit.d.ts +97 -0
  39. package/dist/contracts/content-model-emit.js +306 -0
  40. package/dist/contracts/content-model-sdk.d.ts +101 -0
  41. package/dist/contracts/content-model-sdk.js +232 -0
  42. package/dist/contracts/{content-program.d.ts → content-model.d.ts} +338 -82
  43. package/dist/contracts/{content-program.js → content-model.js} +291 -63
  44. package/dist/contracts/content-platform-fixture.d.ts +380 -110
  45. package/dist/contracts/content-platform-fixture.js +8 -8
  46. package/dist/contracts/content-sync.d.ts +197 -74
  47. package/dist/contracts/content-sync.js +98 -37
  48. package/dist/contracts/content.d.ts +30 -422
  49. package/dist/contracts/content.js +34 -294
  50. package/dist/contracts/dashboard-prefs.d.ts +10 -3
  51. package/dist/contracts/dashboard-prefs.js +6 -3
  52. package/dist/contracts/data-location.d.ts +9 -0
  53. package/dist/contracts/data-location.js +7 -0
  54. package/dist/contracts/deployment-comparison.d.ts +67 -0
  55. package/dist/contracts/deployment-comparison.js +68 -0
  56. package/dist/contracts/device-auth.d.ts +55 -11
  57. package/dist/contracts/domains.d.ts +40 -16
  58. package/dist/contracts/domains.js +23 -0
  59. package/dist/contracts/enums.d.ts +1 -10
  60. package/dist/contracts/enums.js +0 -15
  61. package/dist/contracts/error-code-meta.d.ts +388 -20
  62. package/dist/contracts/error-code-meta.js +201 -5
  63. package/dist/contracts/error-codes.d.ts +17 -4
  64. package/dist/contracts/error-codes.js +109 -10
  65. package/dist/contracts/events.d.ts +5 -0
  66. package/dist/contracts/events.js +12 -3
  67. package/dist/contracts/execution.d.ts +5 -1
  68. package/dist/contracts/execution.js +4 -0
  69. package/dist/contracts/feature-lifecycle.d.ts +53 -20
  70. package/dist/contracts/feature-lifecycle.js +65 -23
  71. package/dist/contracts/features.d.ts +57 -31
  72. package/dist/contracts/features.js +0 -1
  73. package/dist/contracts/feedback.d.ts +124 -0
  74. package/dist/contracts/feedback.js +64 -0
  75. package/dist/contracts/fixtures/content-model-sdk-v1.generated.d.ts +129 -0
  76. package/dist/contracts/fixtures/content-model-sdk-v1.generated.js +48 -0
  77. package/dist/contracts/fixtures/content-platform-v1.json +101 -49
  78. package/dist/contracts/frame-session.d.ts +60 -10
  79. package/dist/contracts/frame-session.js +52 -12
  80. package/dist/contracts/functions.d.ts +28 -2
  81. package/dist/contracts/functions.js +25 -2
  82. package/dist/contracts/grant-copy.d.ts +2 -0
  83. package/dist/contracts/grant-copy.js +2 -0
  84. package/dist/contracts/grants-core.d.ts +95 -0
  85. package/dist/contracts/grants-core.js +435 -0
  86. package/dist/contracts/grants.d.ts +13 -84
  87. package/dist/contracts/grants.js +21 -369
  88. package/dist/contracts/ids-core.d.ts +11 -0
  89. package/dist/contracts/ids-core.js +14 -0
  90. package/dist/contracts/ids.d.ts +7 -4
  91. package/dist/contracts/ids.js +12 -4
  92. package/dist/contracts/internal.d.ts +18 -0
  93. package/dist/contracts/internal.js +19 -0
  94. package/dist/contracts/mcp.d.ts +8 -18
  95. package/dist/contracts/mcp.js +2 -23
  96. package/dist/contracts/notifications.d.ts +4 -1
  97. package/dist/contracts/notifications.js +1 -0
  98. package/dist/contracts/oauth-resources.d.ts +55 -9
  99. package/dist/contracts/oauth-resources.js +64 -1
  100. package/dist/contracts/oauth-scope-actions.d.ts +27 -3
  101. package/dist/contracts/oauth-scope-actions.js +18 -8
  102. package/dist/contracts/operations.d.ts +1 -1
  103. package/dist/contracts/partner-account.d.ts +629 -0
  104. package/dist/contracts/partner-account.js +18 -0
  105. package/dist/contracts/principal-assertion.d.ts +74 -1
  106. package/dist/contracts/principal-assertion.js +67 -3
  107. package/dist/contracts/publish-archive.d.ts +22 -1
  108. package/dist/contracts/push-new.d.ts +3 -3
  109. package/dist/contracts/push-new.js +1 -1
  110. package/dist/contracts/quotas.js +2 -1
  111. package/dist/contracts/repository-connections.d.ts +10 -6
  112. package/dist/contracts/repository-connections.js +15 -0
  113. package/dist/contracts/resources.d.ts +6 -5
  114. package/dist/contracts/resources.js +7 -0
  115. package/dist/contracts/route-inventory.d.ts +74 -19
  116. package/dist/contracts/route-inventory.js +20 -6
  117. package/dist/contracts/runtime-api.d.ts +415 -4
  118. package/dist/contracts/runtime-api.js +60 -15
  119. package/dist/contracts/runtime-app.d.ts +6 -1
  120. package/dist/contracts/runtime-components.d.ts +646 -18
  121. package/dist/contracts/runtime-components.js +304 -188
  122. package/dist/contracts/runtime-services.d.ts +15 -0
  123. package/dist/contracts/runtime-services.js +25 -0
  124. package/dist/contracts/runtime-storage.d.ts +32 -0
  125. package/dist/contracts/runtime-storage.js +37 -0
  126. package/dist/contracts/source-workspaces.d.ts +511 -0
  127. package/dist/contracts/source-workspaces.js +276 -0
  128. package/dist/contracts/space-config-spacefast.d.ts +394 -0
  129. package/dist/contracts/space-config-spacefast.js +70 -0
  130. package/dist/contracts/space-config.d.ts +177 -90
  131. package/dist/contracts/space-config.js +77 -92
  132. package/dist/contracts/spaces.d.ts +132 -24
  133. package/dist/contracts/spaces.js +77 -13
  134. package/dist/contracts/superadmin-connectors.d.ts +371 -0
  135. package/dist/contracts/superadmin-connectors.js +61 -0
  136. package/dist/contracts/superadmin-emails.d.ts +1 -1
  137. package/dist/contracts/superadmin-emails.js +1 -1
  138. package/dist/contracts/superadmin-entities.d.ts +105 -0
  139. package/dist/contracts/superadmin-entities.js +64 -0
  140. package/dist/contracts/superadmin-runtime.d.ts +35 -116
  141. package/dist/contracts/superadmin-runtime.js +13 -69
  142. package/dist/contracts/superadmin-search.d.ts +12 -14
  143. package/dist/contracts/superadmin-search.js +2 -2
  144. package/dist/contracts/superadmin-spaces.d.ts +15 -72
  145. package/dist/contracts/superadmin-spaces.js +2 -7
  146. package/dist/contracts/superadmin-teams.d.ts +12 -0
  147. package/dist/contracts/superadmin-teams.js +7 -1
  148. package/dist/contracts/superadmin-tenants.d.ts +44 -16
  149. package/dist/contracts/superadmin.d.ts +2 -2
  150. package/dist/contracts/tags.d.ts +12 -12
  151. package/dist/contracts/teams.d.ts +29 -1
  152. package/dist/contracts/teams.js +24 -2
  153. package/dist/contracts/tenants.d.ts +98 -0
  154. package/dist/contracts/tenants.js +20 -0
  155. package/dist/contracts/transfers.d.ts +92 -0
  156. package/dist/contracts/transfers.js +37 -0
  157. package/dist/contracts/usage.d.ts +9 -1
  158. package/dist/contracts/usage.js +2 -0
  159. package/dist/contracts/visual-review.d.ts +448 -0
  160. package/dist/contracts/visual-review.js +156 -0
  161. package/dist/contracts/wordpress-php-toolkit.json +9 -0
  162. package/dist/contracts/work-mode.d.ts +24 -0
  163. package/dist/contracts/work-mode.js +17 -0
  164. package/dist/contracts/wp-cli.d.ts +66 -0
  165. package/dist/contracts/wp-cli.js +68 -0
  166. package/dist/contracts/zero-catalog.d.ts +29 -0
  167. package/dist/contracts/zero-catalog.js +55 -0
  168. package/dist/contracts/zero-platform-abilities.generated.d.ts +31 -0
  169. package/dist/contracts/zero-platform-abilities.generated.js +373 -0
  170. package/dist/contracts/zero-spacefast.d.ts +444 -0
  171. package/dist/contracts/zero-spacefast.js +149 -0
  172. package/dist/contracts/zero-types.d.ts +47 -0
  173. package/dist/contracts/zero-types.js +263 -0
  174. package/dist/contracts/zero.d.ts +781 -14
  175. package/dist/contracts/zero.js +204 -10
  176. package/dist/dashboard-paths/index.d.ts +2 -2
  177. package/dist/dashboard-paths/route-reservations.generated.d.ts +2 -2
  178. package/dist/dashboard-paths/route-reservations.generated.js +5 -0
  179. package/dist/docs/agent-prose.d.ts +1 -1
  180. package/dist/docs/agent-prose.js +15 -18
  181. package/dist/docs/agent-setup.d.ts +1 -1
  182. package/dist/docs/agent-setup.js +5 -13
  183. package/dist/docs/catalog.d.ts +64 -28
  184. package/dist/docs/catalog.js +155 -28
  185. package/dist/docs/error-docs.d.ts +365 -17
  186. package/dist/docs/error-docs.js +369 -21
  187. package/dist/docs/reference-urls.js +1 -1
  188. package/dist/docs/skills.d.ts +84 -84
  189. package/dist/docs/skills.js +66 -47
  190. package/dist/docs/start-prompts.d.ts +14 -0
  191. package/dist/docs/start-prompts.js +20 -0
  192. package/dist/utils/account-labels.d.ts +7 -0
  193. package/dist/utils/account-labels.js +15 -0
  194. package/dist/utils/auth.d.ts +1 -0
  195. package/dist/utils/auth.js +1 -0
  196. package/dist/utils/credential-policy.d.ts +22 -1
  197. package/dist/utils/credential-policy.js +55 -6
  198. package/dist/utils/local-space-state.d.ts +7 -0
  199. package/dist/utils/local-space-state.js +7 -0
  200. package/dist/utils/logger.d.ts +34 -0
  201. package/dist/utils/logger.js +144 -0
  202. package/dist/utils/page-routes.d.ts +9 -0
  203. package/dist/utils/page-routes.js +82 -0
  204. package/dist/utils/pages.d.ts +2 -0
  205. package/dist/utils/pages.js +7 -0
  206. package/dist/utils/publish-form-data.d.ts +2 -0
  207. package/dist/utils/publish-form-data.js +2 -0
  208. package/dist/utils/publish-policy-spacefast.d.ts +13 -0
  209. package/dist/utils/publish-policy-spacefast.js +117 -0
  210. package/dist/utils/publish-policy.d.ts +22 -16
  211. package/dist/utils/publish-policy.fixtures.json +15 -0
  212. package/dist/utils/publish-policy.js +62 -139
  213. package/dist/utils/query-client.js +9 -1
  214. package/dist/utils/runtime-upload.d.ts +4 -0
  215. package/dist/utils/runtime-upload.js +5 -0
  216. package/dist/utils/space-config.d.ts +2 -3
  217. package/dist/utils/space-config.js +1 -1
  218. package/dist/utils/uploaded-source.d.ts +4 -0
  219. package/dist/utils/uploaded-source.js +12 -0
  220. package/dist/visual-review.d.ts +4 -0
  221. package/dist/visual-review.js +208 -0
  222. package/dist/vocabulary.d.ts +38 -0
  223. package/dist/vocabulary.js +55 -0
  224. package/package.json +7 -2
  225. package/dist/agents/registry/deeplink-probes.d.ts +0 -23
  226. package/dist/agents/registry/deeplink-probes.js +0 -18
@@ -388,6 +388,8 @@ export declare const functionsWorkerArtifactSchema: z.ZodObject<{
388
388
  spam: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
389
389
  email: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
390
390
  content: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
391
+ storage: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
392
+ connectors: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
391
393
  }, z.core.$strip>>;
392
394
  platform: z.ZodDefault<z.ZodObject<{
393
395
  nextCache: z.ZodDefault<z.ZodBoolean>;
@@ -401,7 +403,7 @@ export type FunctionsWorkerArtifact = z.infer<typeof functionsWorkerArtifactSche
401
403
  * the control plane at finalize so the origin forwards a decision rather than
402
404
  * making one. Anything absent fails closed at the relay.
403
405
  */
404
- export declare const FUNCTIONS_DISPATCH_CAPABILITIES: readonly ["storage.read", "storage.write", "db.read", "db.write", "fetch", "log", "next.cache", "gravatar.profile", "spam.check", "email.send"];
406
+ export declare const FUNCTIONS_DISPATCH_CAPABILITIES: readonly ["storage.read", "storage.write", "db.read", "db.write", "fetch", "log", "next.cache", "gravatar.profile", "spam.check", "email.send", "connectors.call", "zero.call"];
405
407
  export declare const functionsDispatchCapabilitySchema: z.ZodEnum<{
406
408
  fetch: "fetch";
407
409
  "storage.read": "storage.read";
@@ -413,6 +415,8 @@ export declare const functionsDispatchCapabilitySchema: z.ZodEnum<{
413
415
  "gravatar.profile": "gravatar.profile";
414
416
  "spam.check": "spam.check";
415
417
  "email.send": "email.send";
418
+ "connectors.call": "connectors.call";
419
+ "zero.call": "zero.call";
416
420
  }>;
417
421
  export type FunctionsDispatchCapability = z.infer<typeof functionsDispatchCapabilitySchema>;
418
422
  /**
@@ -432,6 +436,8 @@ export type FunctionsDispatchCapability = z.infer<typeof functionsDispatchCapabi
432
436
  */
433
437
  export declare function functionsDispatchCapabilities(capabilities: ExecutionCapabilities, platform?: {
434
438
  nextCache?: boolean;
439
+ connectors?: boolean;
440
+ zero?: boolean;
435
441
  }): FunctionsDispatchCapability[];
436
442
  /** Logs and the host-local Next cache do not transit the origin relay. */
437
443
  export declare function functionsGrantNeedsRelay(granted: readonly FunctionsDispatchCapability[]): boolean;
@@ -449,7 +455,13 @@ export declare const functionsHostConfigSchema: z.ZodObject<{
449
455
  }, z.core.$strict>;
450
456
  export type FunctionsHostConfig = z.infer<typeof functionsHostConfigSchema>;
451
457
  /**
452
- * The callback a dispatched worker uses for `ctx.db`, `ctx.fetch` and logging.
458
+ * Workers receive `env.CONNECTORS.call(role, tool, args)` and role proxies when
459
+ * the Space has connector bindings or its capsule declares roles. `env.ZERO.query(name,
460
+ * ...args)` and `env.ZERO.mutate(name, ...args)` call this version's capsule.
461
+ * Both bindings forward a signed visitor session when the request carries one.
462
+ * Without a visitor, ZERO runs as the Space's service principal.
463
+ *
464
+ * The callback a dispatched worker uses for database, services and capsule calls.
453
465
  *
454
466
  * Each relay call re-enters the space's PHP-FPM pool, the deadlock hazard this
455
467
  * product's admission control bounds: a proxied request occupies a worker for
@@ -544,6 +556,8 @@ export declare const functionsSourceFinalizeSchema: z.ZodObject<{
544
556
  spam: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
545
557
  email: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
546
558
  content: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
559
+ storage: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
560
+ connectors: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
547
561
  }, z.core.$strip>>;
548
562
  platform: z.ZodDefault<z.ZodObject<{
549
563
  nextCache: z.ZodDefault<z.ZodBoolean>;
@@ -608,6 +622,8 @@ export declare const functionsRuntimeConfigSchema: z.ZodObject<{
608
622
  spam: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
609
623
  email: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
610
624
  content: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
625
+ storage: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
626
+ connectors: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
611
627
  }, z.core.$strip>>;
612
628
  platform: z.ZodDefault<z.ZodObject<{
613
629
  nextCache: z.ZodDefault<z.ZodBoolean>;
@@ -622,6 +638,9 @@ export declare const functionsRuntimeConfigSchema: z.ZodObject<{
622
638
  bundleUrl: z.ZodString;
623
639
  seedUrl: z.ZodDefault<z.ZodNullable<z.ZodString>>;
624
640
  }, z.core.$strict>;
641
+ connectors: z.ZodOptional<z.ZodObject<{
642
+ token: z.ZodString;
643
+ }, z.core.$strict>>;
625
644
  grantedCapabilities: z.ZodDefault<z.ZodArray<z.ZodEnum<{
626
645
  fetch: "fetch";
627
646
  "storage.read": "storage.read";
@@ -633,6 +652,8 @@ export declare const functionsRuntimeConfigSchema: z.ZodObject<{
633
652
  "gravatar.profile": "gravatar.profile";
634
653
  "spam.check": "spam.check";
635
654
  "email.send": "email.send";
655
+ "connectors.call": "connectors.call";
656
+ "zero.call": "zero.call";
636
657
  }>>>;
637
658
  relay: z.ZodDefault<z.ZodNullable<z.ZodObject<{
638
659
  url: z.ZodString;
@@ -697,6 +718,8 @@ export declare const functionsDeployMetadataSchema: z.ZodObject<{
697
718
  spam: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
698
719
  email: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
699
720
  content: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
721
+ storage: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
722
+ connectors: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
700
723
  }, z.core.$strip>>;
701
724
  platform: z.ZodDefault<z.ZodObject<{
702
725
  nextCache: z.ZodDefault<z.ZodBoolean>;
@@ -707,6 +730,7 @@ export declare const functionsDeployMetadataSchema: z.ZodObject<{
707
730
  names: z.ZodDefault<z.ZodArray<z.ZodString>>;
708
731
  }, z.core.$strict>>;
709
732
  }, z.core.$strict>;
733
+ connectorsTokenHash: z.ZodOptional<z.ZodString>;
710
734
  }, z.core.$strict>;
711
735
  export type FunctionsDeployMetadata = z.infer<typeof functionsDeployMetadataSchema>;
712
736
  /**
@@ -782,6 +806,8 @@ export declare const functionsAppSchema: z.ZodObject<{
782
806
  spam: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
783
807
  email: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
784
808
  content: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
809
+ storage: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
810
+ connectors: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
785
811
  }, z.core.$strip>>;
786
812
  executionState: z.ZodEnum<{
787
813
  ready: "ready";
@@ -442,6 +442,8 @@ export const FUNCTIONS_DISPATCH_CAPABILITIES = [
442
442
  "gravatar.profile",
443
443
  "spam.check",
444
444
  "email.send",
445
+ "connectors.call",
446
+ "zero.call",
445
447
  ];
446
448
  export const functionsDispatchCapabilitySchema = z.enum(FUNCTIONS_DISPATCH_CAPABILITIES);
447
449
  /**
@@ -486,6 +488,10 @@ export function functionsDispatchCapabilities(capabilities, platform = {}) {
486
488
  if (platform.nextCache) {
487
489
  granted.add("next.cache");
488
490
  }
491
+ if (platform.connectors)
492
+ granted.add("connectors.call");
493
+ if (platform.zero)
494
+ granted.add("zero.call");
489
495
  // Filtered from the canonical list so the order is stable: the grant is part
490
496
  // of the host's isolate identity, and reordering would retire warm isolates.
491
497
  return FUNCTIONS_DISPATCH_CAPABILITIES.filter((capability) => granted.has(capability));
@@ -526,7 +532,13 @@ export const functionsHostConfigSchema = z
526
532
  })
527
533
  .strict();
528
534
  /**
529
- * The callback a dispatched worker uses for `ctx.db`, `ctx.fetch` and logging.
535
+ * Workers receive `env.CONNECTORS.call(role, tool, args)` and role proxies when
536
+ * the Space has connector bindings or its capsule declares roles. `env.ZERO.query(name,
537
+ * ...args)` and `env.ZERO.mutate(name, ...args)` call this version's capsule.
538
+ * Both bindings forward a signed visitor session when the request carries one.
539
+ * Without a visitor, ZERO runs as the Space's service principal.
540
+ *
541
+ * The callback a dispatched worker uses for database, services and capsule calls.
530
542
  *
531
543
  * Each relay call re-enters the space's PHP-FPM pool, the deadlock hazard this
532
544
  * product's admission control bounds: a proxied request occupies a worker for
@@ -612,7 +624,14 @@ export const functionsSourceFinalizeSchema = z
612
624
  export const functionsRuntimeConfigSchema = functionsSourceFinalizeSchema
613
625
  .extend({
614
626
  host: functionsHostConfigSchema,
615
- grantedCapabilities: z.array(functionsDispatchCapabilitySchema).max(10).default([]),
627
+ connectors: z
628
+ .object({ token: z.string().min(1) })
629
+ .strict()
630
+ .optional(),
631
+ grantedCapabilities: z
632
+ .array(functionsDispatchCapabilitySchema)
633
+ .max(FUNCTIONS_DISPATCH_CAPABILITIES.length)
634
+ .default([]),
616
635
  relay: functionsRelayConfigSchema.nullable().default(null),
617
636
  usage: functionsUsageConfigSchema.nullable().default(null),
618
637
  purge: functionsPurgeConfigSchema.nullable().default(null),
@@ -632,6 +651,10 @@ export const functionsDeployMetadataSchema = z
632
651
  .object({
633
652
  artifactId: z.string().min(1).optional(),
634
653
  finalize: functionsSourceFinalizeSchema,
654
+ connectorsTokenHash: z
655
+ .string()
656
+ .regex(/^[a-f0-9]{64}$/)
657
+ .optional(),
635
658
  })
636
659
  .strict();
637
660
  /**
@@ -31,12 +31,14 @@ export declare const GRANT_PURPOSE_COPY: {
31
31
  readonly "publish.confirm": "publish a new version";
32
32
  readonly "deploy.confirm": "deploy a site";
33
33
  readonly "version.rollback.confirm": "roll a site back to an earlier version";
34
+ readonly "space.delete.confirm": "get temporary permission to delete sites";
34
35
  readonly "domain.purchase.confirm": "purchase a domain";
35
36
  readonly "domain.dns.confirm": "change domain DNS";
36
37
  readonly "device.authorize": "connect the Spacefast CLI";
37
38
  readonly "agent_handoff.redeem": "continue a Spacefast handoff";
38
39
  readonly "claim.continue": "continue a claimed site";
39
40
  readonly "oauth.connect": "connect to Spacefast";
41
+ readonly connector_tool_call: "run a connector tool";
40
42
  };
41
43
  export type GrantPurposeCode = keyof typeof GRANT_PURPOSE_COPY;
42
44
  /** Never throws: an unknown code renders the neutral fallback, never the code. */
@@ -30,12 +30,14 @@ export const GRANT_PURPOSE_COPY = {
30
30
  "publish.confirm": "publish a new version",
31
31
  "deploy.confirm": "deploy a site",
32
32
  "version.rollback.confirm": "roll a site back to an earlier version",
33
+ "space.delete.confirm": "get temporary permission to delete sites",
33
34
  "domain.purchase.confirm": "purchase a domain",
34
35
  "domain.dns.confirm": "change domain DNS",
35
36
  "device.authorize": "connect the Spacefast CLI",
36
37
  "agent_handoff.redeem": "continue a Spacefast handoff",
37
38
  "claim.continue": "continue a claimed site",
38
39
  "oauth.connect": "connect to Spacefast",
40
+ connector_tool_call: "run a connector tool",
39
41
  };
40
42
  /** Never throws: an unknown code renders the neutral fallback, never the code. */
41
43
  export function grantPurposeCopy(purposeCode) {
@@ -0,0 +1,95 @@
1
+ import { z } from "zod";
2
+ export declare const GRANT_CAPABILITIES: readonly ["page.view", "comments.read", "comments.write", "content.publish", "access.manage"];
3
+ export declare const grantCapabilitySchema: z.ZodEnum<{
4
+ "page.view": "page.view";
5
+ "comments.read": "comments.read";
6
+ "comments.write": "comments.write";
7
+ "content.publish": "content.publish";
8
+ "access.manage": "access.manage";
9
+ }>;
10
+ export type GrantCapability = z.infer<typeof grantCapabilitySchema>;
11
+ /** An opaque reference to something a grant points at (a version, a branch, a holder). */
12
+ export declare const grantReferenceSchema: z.ZodString;
13
+ /**
14
+ * A verification key an external token issuer publishes: a key id and a raw
15
+ * Ed25519 public key, base64url-encoded. Key material, not a host concept — the
16
+ * same shape serves identity connections and a partner's declared issuers.
17
+ */
18
+ export declare const identityConnectionPublicKeySchema: z.ZodObject<{
19
+ kid: z.ZodString;
20
+ publicKey: z.ZodString;
21
+ }, z.core.$strict>;
22
+ export type IdentityConnectionPublicKey = z.infer<typeof identityConnectionPublicKeySchema>;
23
+ /**
24
+ * Canonical resource-pattern syntax shared by config compilation and evaluation.
25
+ * `*` matches one path segment and `**` matches zero or more segments. Wildcards
26
+ * are whole segments so a pattern can never disguise an encoded separator.
27
+ *
28
+ * Unlike URL-route canonicalization, resource patterns retain a terminal
29
+ * `index.html`: Grants can constrain the visitor-facing route and the artifact
30
+ * it resolves to independently.
31
+ */
32
+ export declare function normalizeGrantResourcePattern(input: string): string;
33
+ export declare const grantResourcePatternSchema: z.ZodString;
34
+ export type GrantResourcePattern = z.infer<typeof grantResourcePatternSchema>;
35
+ export declare function uniqueArray(values: readonly unknown[]): boolean;
36
+ export declare const GRANT_RESOURCE_PATTERN_LIMIT = 100;
37
+ export declare const grantResourceSetSchema: z.ZodObject<{
38
+ include: z.ZodArray<z.ZodString>;
39
+ exclude: z.ZodDefault<z.ZodArray<z.ZodString>>;
40
+ }, z.core.$strict>;
41
+ export type GrantResourceSet = z.infer<typeof grantResourceSetSchema>;
42
+ export declare const GRANT_TARGET_KINDS: readonly ["live", "version", "branch", "all_versions"];
43
+ export declare const grantTargetKindSchema: z.ZodEnum<{
44
+ live: "live";
45
+ version: "version";
46
+ branch: "branch";
47
+ all_versions: "all_versions";
48
+ }>;
49
+ export type GrantTargetKind = z.infer<typeof grantTargetKindSchema>;
50
+ export declare const grantTargetSelectorSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
51
+ kind: z.ZodLiteral<"live">;
52
+ }, z.core.$strict>, z.ZodObject<{
53
+ kind: z.ZodLiteral<"version">;
54
+ versionId: z.ZodString;
55
+ }, z.core.$strict>, z.ZodObject<{
56
+ kind: z.ZodLiteral<"branch">;
57
+ branch: z.ZodString;
58
+ }, z.core.$strict>, z.ZodObject<{
59
+ kind: z.ZodLiteral<"all_versions">;
60
+ }, z.core.$strict>], "kind">;
61
+ export type GrantTargetSelector = z.infer<typeof grantTargetSelectorSchema>;
62
+ export declare function normalizeGrantNetworkCidr(input: string): string;
63
+ export declare function grantNetworkCidrMatches(cidr: string, ipAddress: string): boolean;
64
+ export declare const grantFrameOriginSchema: z.ZodString;
65
+ export declare const grantConstraintsSchema: z.ZodObject<{
66
+ notBefore: z.ZodOptional<z.ZodString>;
67
+ expiresAt: z.ZodOptional<z.ZodString>;
68
+ maxUses: z.ZodOptional<z.ZodNumber>;
69
+ requireVerifiedEmail: z.ZodOptional<z.ZodBoolean>;
70
+ network: z.ZodOptional<z.ZodObject<{
71
+ ipCidrs: z.ZodOptional<z.ZodArray<z.ZodString>>;
72
+ countries: z.ZodOptional<z.ZodArray<z.ZodString>>;
73
+ excludedCountries: z.ZodOptional<z.ZodArray<z.ZodString>>;
74
+ excludedUserAgentSubstrings: z.ZodOptional<z.ZodArray<z.ZodString>>;
75
+ }, z.core.$strict>>;
76
+ frameOrigin: z.ZodOptional<z.ZodString>;
77
+ }, z.core.$strict>;
78
+ export type GrantConstraints = z.infer<typeof grantConstraintsSchema>;
79
+ /** Field-scoped PATCH shape. `null` clears one constraint without replacing its siblings. */
80
+ export declare const grantConstraintsPatchSchema: z.ZodObject<{
81
+ notBefore: z.ZodOptional<z.ZodNullable<z.ZodString>>;
82
+ expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
83
+ maxUses: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
84
+ requireVerifiedEmail: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
85
+ frameOrigin: z.ZodOptional<z.ZodNullable<z.ZodString>>;
86
+ network: z.ZodOptional<z.ZodNullable<z.ZodObject<{
87
+ ipCidrs: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
88
+ countries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
89
+ excludedCountries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
90
+ excludedUserAgentSubstrings: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
91
+ }, z.core.$strict>>>;
92
+ }, z.core.$strict>;
93
+ export type GrantConstraintsPatch = z.infer<typeof grantConstraintsPatchSchema>;
94
+ export declare function diffGrantConstraints(original: GrantConstraints, draft: GrantConstraints): GrantConstraintsPatch | undefined;
95
+ export declare function applyGrantConstraintsPatch(current: GrantConstraints, patch: GrantConstraintsPatch): GrantConstraints;