@spacefast/common 0.0.23 → 0.0.26

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 (224) hide show
  1. package/brand-assets/LICENSE-Haskoy.txt +93 -0
  2. package/brand-assets/haskoy-latin-variable.woff2 +0 -0
  3. package/brand-assets/spacefast-favicon.svg +4 -4
  4. package/brand-assets/spacefast-sf-full-bleed.svg +3 -3
  5. package/brand-assets/spacefast-wordmark.svg +2 -4
  6. package/dist/agents/connect-targets.js +1 -1
  7. package/dist/agents/private-key-oauth.d.ts +0 -1
  8. package/dist/agents/private-key-oauth.js +46 -63
  9. package/dist/brand-assets-build.js +4 -6
  10. package/dist/brand-assets.d.ts +5 -15
  11. package/dist/brand-assets.js +15 -14
  12. package/dist/config/domains.d.ts +47 -7
  13. package/dist/config/domains.js +66 -10
  14. package/dist/config/index.d.ts +0 -1
  15. package/dist/config/index.js +0 -1
  16. package/dist/contracts/abuse.d.ts +2 -0
  17. package/dist/contracts/abuse.js +12 -0
  18. package/dist/contracts/access.d.ts +124 -12
  19. package/dist/contracts/access.js +73 -9
  20. package/dist/contracts/activity.d.ts +1 -1
  21. package/dist/contracts/activity.js +5 -12
  22. package/dist/contracts/api-keys.d.ts +21 -21
  23. package/dist/contracts/api-keys.js +2 -2
  24. package/dist/contracts/beta.js +1 -1
  25. package/dist/contracts/billing.d.ts +3 -35
  26. package/dist/contracts/billing.js +33 -52
  27. package/dist/contracts/builds.d.ts +30 -18
  28. package/dist/contracts/builds.js +28 -9
  29. package/dist/contracts/channels.js +1 -1
  30. package/dist/contracts/cli.d.ts +10 -0
  31. package/dist/contracts/cli.js +10 -0
  32. package/dist/contracts/collab-public.d.ts +63 -0
  33. package/dist/contracts/collab-public.js +46 -0
  34. package/dist/contracts/comments.d.ts +282 -53
  35. package/dist/contracts/comments.js +173 -52
  36. package/dist/contracts/common.d.ts +3 -3
  37. package/dist/contracts/common.js +5 -5
  38. package/dist/contracts/crons.d.ts +35 -0
  39. package/dist/contracts/crons.js +42 -0
  40. package/dist/contracts/device-auth.d.ts +6 -6
  41. package/dist/contracts/device-auth.js +2 -2
  42. package/dist/contracts/docs.js +2 -2
  43. package/dist/contracts/domains.d.ts +38 -27
  44. package/dist/contracts/domains.js +29 -2
  45. package/dist/contracts/enums.d.ts +34 -30
  46. package/dist/contracts/enums.js +62 -48
  47. package/dist/contracts/error-code-meta.d.ts +50 -125
  48. package/dist/contracts/error-code-meta.js +29 -41
  49. package/dist/contracts/error-codes.d.ts +1 -1
  50. package/dist/contracts/error-codes.js +14 -33
  51. package/dist/contracts/execution.d.ts +47 -66
  52. package/dist/contracts/execution.js +53 -49
  53. package/dist/contracts/feature-lifecycle-core.d.ts +0 -6
  54. package/dist/contracts/feature-lifecycle-core.js +2 -31
  55. package/dist/contracts/feature-lifecycle.d.ts +12 -52
  56. package/dist/contracts/feature-lifecycle.js +16 -59
  57. package/dist/contracts/features.d.ts +48 -60
  58. package/dist/contracts/features.js +59 -51
  59. package/dist/contracts/functions.d.ts +266 -72
  60. package/dist/contracts/functions.js +260 -37
  61. package/dist/contracts/git.d.ts +28 -34
  62. package/dist/contracts/git.js +10 -11
  63. package/dist/contracts/grants.d.ts +9 -5
  64. package/dist/contracts/grants.js +18 -9
  65. package/dist/contracts/ids.js +2 -2
  66. package/dist/contracts/internal.d.ts +8 -6
  67. package/dist/contracts/internal.js +12 -12
  68. package/dist/contracts/mcp.d.ts +11 -0
  69. package/dist/contracts/mcp.js +5 -0
  70. package/dist/contracts/me.js +1 -1
  71. package/dist/contracts/oauth-resources.d.ts +4 -3
  72. package/dist/contracts/oauth-resources.js +12 -3
  73. package/dist/contracts/operations.d.ts +90 -5
  74. package/dist/contracts/operations.js +77 -3
  75. package/dist/contracts/pages.d.ts +12 -7
  76. package/dist/contracts/pages.js +24 -1
  77. package/dist/contracts/plan-policy.d.ts +0 -2
  78. package/dist/contracts/plan-policy.js +2 -3
  79. package/dist/contracts/platform.d.ts +61 -148
  80. package/dist/contracts/platform.js +70 -126
  81. package/dist/contracts/publish-archive.d.ts +508 -0
  82. package/dist/contracts/publish-archive.js +32 -0
  83. package/dist/contracts/push-new.d.ts +4 -4
  84. package/dist/contracts/quotas.js +2 -2
  85. package/dist/contracts/repository-connections.d.ts +43 -30
  86. package/dist/contracts/repository-connections.js +11 -3
  87. package/dist/contracts/resources.d.ts +12 -24
  88. package/dist/contracts/resources.js +36 -16
  89. package/dist/contracts/runtime-api.d.ts +433 -192
  90. package/dist/contracts/runtime-api.js +421 -356
  91. package/dist/contracts/runtime-app.d.ts +127 -120
  92. package/dist/contracts/runtime-app.js +19 -10
  93. package/dist/contracts/runtime-db.d.ts +5 -5
  94. package/dist/contracts/runtime-db.js +2 -2
  95. package/dist/contracts/runtime-purge.d.ts +8 -0
  96. package/dist/contracts/runtime-purge.js +7 -0
  97. package/dist/contracts/runtime-services.d.ts +219 -0
  98. package/dist/contracts/runtime-services.js +437 -0
  99. package/dist/contracts/runtime-storage.d.ts +46 -32
  100. package/dist/contracts/runtime-storage.js +31 -8
  101. package/dist/contracts/sf-config-v1.d.ts +48 -10
  102. package/dist/contracts/space-config.d.ts +69 -18
  103. package/dist/contracts/space-config.js +226 -27
  104. package/dist/contracts/spaces.d.ts +236 -450
  105. package/dist/contracts/spaces.js +131 -151
  106. package/dist/contracts/superadmin-activity.d.ts +57 -4
  107. package/dist/contracts/superadmin-activity.js +48 -2
  108. package/dist/contracts/superadmin-search.d.ts +126 -0
  109. package/dist/contracts/superadmin-search.js +61 -0
  110. package/dist/contracts/superadmin-spaces.d.ts +361 -92
  111. package/dist/contracts/superadmin-spaces.js +97 -24
  112. package/dist/contracts/superadmin-teams.d.ts +28 -10
  113. package/dist/contracts/superadmin-teams.js +5 -8
  114. package/dist/contracts/superadmin-tenants.d.ts +0 -6
  115. package/dist/contracts/superadmin-tenants.js +1 -7
  116. package/dist/contracts/superadmin.d.ts +135 -54
  117. package/dist/contracts/superadmin.js +46 -23
  118. package/dist/contracts/tags.d.ts +12 -12
  119. package/dist/contracts/tags.js +3 -3
  120. package/dist/contracts/teams.d.ts +49 -14
  121. package/dist/contracts/teams.js +40 -22
  122. package/dist/contracts/transfers.d.ts +0 -49
  123. package/dist/contracts/transfers.js +4 -8
  124. package/dist/contracts/usage.d.ts +61 -0
  125. package/dist/contracts/usage.js +64 -0
  126. package/dist/contracts/variables.d.ts +2 -7
  127. package/dist/contracts/variables.js +9 -8
  128. package/dist/contracts/webhooks.d.ts +2 -2
  129. package/dist/contracts/zero.d.ts +102 -73
  130. package/dist/contracts/zero.js +94 -32
  131. package/dist/dashboard-paths/index.d.ts +1 -1
  132. package/dist/dashboard-paths/index.js +1 -0
  133. package/dist/docs/agent-prose.d.ts +2 -2
  134. package/dist/docs/agent-prose.js +63 -70
  135. package/dist/docs/agent-setup.js +45 -15
  136. package/dist/docs/catalog.d.ts +24 -24
  137. package/dist/docs/catalog.js +35 -24
  138. package/dist/docs/error-docs.js +194 -270
  139. package/dist/docs/skills.d.ts +12 -12
  140. package/dist/docs/skills.js +4 -4
  141. package/dist/test-helpers/fetch-stub.d.ts +16 -0
  142. package/dist/test-helpers/fetch-stub.js +25 -0
  143. package/dist/utils/build-settings.d.ts +5 -1
  144. package/dist/utils/build-settings.js +91 -13
  145. package/dist/utils/canonical-json.d.ts +10 -0
  146. package/dist/utils/canonical-json.js +22 -0
  147. package/dist/utils/cast-transport.d.ts +28 -0
  148. package/dist/utils/cast-transport.js +52 -0
  149. package/dist/utils/claim-token.d.ts +0 -8
  150. package/dist/utils/claim-token.js +3 -15
  151. package/dist/utils/concurrency.js +1 -0
  152. package/dist/utils/credential-policy.d.ts +1 -1
  153. package/dist/utils/credential-policy.js +4 -3
  154. package/dist/utils/dns-instructions.js +9 -9
  155. package/dist/utils/env-file.d.ts +17 -0
  156. package/dist/utils/env-file.js +96 -0
  157. package/dist/utils/error-code.d.ts +2 -0
  158. package/dist/utils/error-code.js +8 -0
  159. package/dist/utils/generate-space-name.d.ts +8 -10
  160. package/dist/utils/generate-space-name.js +206 -21
  161. package/dist/utils/grant-decision.fixtures.json +2938 -0
  162. package/dist/utils/grants.d.ts +2 -0
  163. package/dist/utils/grants.js +26 -1
  164. package/dist/utils/gravatar.d.ts +9 -0
  165. package/dist/utils/gravatar.js +31 -0
  166. package/dist/utils/idempotency.d.ts +6 -0
  167. package/dist/utils/idempotency.js +28 -0
  168. package/dist/utils/local-space-state.d.ts +9 -16
  169. package/dist/utils/local-space-state.js +20 -50
  170. package/dist/utils/one-shot-replay.d.ts +4 -1
  171. package/dist/utils/page-colors.d.ts +14 -12
  172. package/dist/utils/page-colors.js +15 -13
  173. package/dist/utils/page-fonts.d.ts +2 -2
  174. package/dist/utils/page-fonts.js +15 -4
  175. package/dist/utils/pages.d.ts +21 -3
  176. package/dist/utils/pages.js +42 -13
  177. package/dist/utils/publish-form-data.d.ts +12 -0
  178. package/dist/utils/publish-form-data.js +10 -0
  179. package/dist/utils/publish-policy.d.ts +27 -0
  180. package/dist/utils/publish-policy.fixtures.json +403 -0
  181. package/dist/utils/publish-policy.js +45 -20
  182. package/dist/utils/push-new.d.ts +7 -0
  183. package/dist/utils/push-new.js +7 -0
  184. package/dist/utils/query-keys.d.ts +4 -5
  185. package/dist/utils/query-keys.js +2 -3
  186. package/dist/utils/runtime-paths.d.ts +5 -0
  187. package/dist/utils/runtime-paths.js +5 -0
  188. package/dist/utils/runtime-upload-batch.d.ts +0 -5
  189. package/dist/utils/runtime-upload-batch.js +1 -27
  190. package/dist/utils/runtime-upload.d.ts +6 -11
  191. package/dist/utils/runtime-upload.js +10 -13
  192. package/dist/utils/secure-local-file.js +5 -16
  193. package/dist/utils/space-config.d.ts +1 -34
  194. package/dist/utils/space-config.js +8 -326
  195. package/dist/utils/static-runtime-policy.d.ts +9 -3
  196. package/dist/utils/static-runtime-policy.fixtures.json +38 -41
  197. package/dist/utils/static-runtime-policy.js +22 -56
  198. package/dist/utils/storage-policy.d.ts +1 -1
  199. package/dist/utils/storage-policy.js +3 -1
  200. package/dist/utils/structured-error.d.ts +14 -0
  201. package/dist/utils/structured-error.js +22 -0
  202. package/dist/utils/upload-session.d.ts +4 -1
  203. package/dist/utils/upload-session.js +33 -5
  204. package/dist/utils/version-path.js +13 -4
  205. package/dist/vocabulary.d.ts +13 -11
  206. package/dist/vocabulary.js +42 -28
  207. package/package.json +7 -17
  208. package/dist/config/postgres-budget.d.ts +0 -129
  209. package/dist/config/postgres-budget.js +0 -140
  210. package/dist/config/postgres-budget.json +0 -51
  211. package/dist/contracts/archives.d.ts +0 -331
  212. package/dist/contracts/archives.js +0 -120
  213. package/dist/contracts/deployments.d.ts +0 -574
  214. package/dist/contracts/deployments.js +0 -97
  215. package/dist/contracts/sites.d.ts +0 -416
  216. package/dist/contracts/sites.js +0 -168
  217. package/dist/contracts/superadmin-queues.d.ts +0 -414
  218. package/dist/contracts/superadmin-queues.js +0 -202
  219. package/dist/contracts/superadmin-runtime.d.ts +0 -27
  220. package/dist/contracts/superadmin-runtime.js +0 -38
  221. package/dist/index.d.ts +0 -1
  222. package/dist/index.js +0 -1
  223. package/dist/utils/api.d.ts +0 -4
  224. package/dist/utils/api.js +0 -13
@@ -9,13 +9,6 @@ export const GRANT_CAPABILITIES = [
9
9
  "access.manage",
10
10
  ];
11
11
  export const grantCapabilitySchema = z.enum(GRANT_CAPABILITIES);
12
- export const GRANT_CAPABILITY_PRESETS = ["view", "comment", "publish", "manage"];
13
- export const GRANT_PRESET_CAPABILITIES = {
14
- view: ["page.view"],
15
- comment: ["page.view", "comments.read", "comments.write"],
16
- publish: ["page.view", "content.publish"],
17
- manage: ["page.view", "comments.read", "comments.write", "content.publish", "access.manage"],
18
- };
19
12
  export const GRANT_AUDIENCE_KINDS = [
20
13
  "public",
21
14
  "team",
@@ -714,12 +707,28 @@ export const identityConnectionPublicKeySchema = z
714
707
  .regex(/^[A-Za-z0-9_-]{43}$/, "publicKey must be a raw Ed25519 public key"),
715
708
  })
716
709
  .strict();
710
+ /**
711
+ * Issuers the platform stamps on its own external Grants. A Team-configured
712
+ * connection may not claim one: the authority reference an external audience
713
+ * resolves to is derived from (issuer, subject), and these three resolve into
714
+ * the platform's own `member:` / `claim-preview:` / owner namespaces.
715
+ */
716
+ export const RESERVED_IDENTITY_CONNECTION_ISSUERS = [
717
+ "spacefast-membership",
718
+ "claim-preview",
719
+ "spacefast-owner",
720
+ ];
721
+ const identityConnectionIssuerSchema = z
722
+ .string()
723
+ .min(1)
724
+ .max(1024)
725
+ .refine((issuer) => !RESERVED_IDENTITY_CONNECTION_ISSUERS.includes(issuer.trim()), { message: "issuer is reserved by Spacefast" });
717
726
  export const identityConnectionCreateSchema = z.discriminatedUnion("type", [
718
727
  z
719
728
  .object({
720
729
  type: z.literal("oidc"),
721
730
  name: z.string().trim().min(1).max(200),
722
- issuer: z.string().min(1).max(1024),
731
+ issuer: identityConnectionIssuerSchema,
723
732
  clientId: z.string().min(1).max(512),
724
733
  clientSecret: z.string().min(1).max(2048),
725
734
  sessionTtlSeconds: z
@@ -734,7 +743,7 @@ export const identityConnectionCreateSchema = z.discriminatedUnion("type", [
734
743
  .object({
735
744
  type: z.literal("signer"),
736
745
  name: z.string().trim().min(1).max(200),
737
- issuer: z.string().min(1).max(1024),
746
+ issuer: identityConnectionIssuerSchema,
738
747
  authorizeUrl: z.string().min(1).max(2048),
739
748
  publicKeys: z.array(identityConnectionPublicKeySchema).min(1).max(5),
740
749
  sessionTtlSeconds: z.number().int().min(60).max(EXTERNAL_IDENTITY_MAX_TTL_SECONDS).optional(),
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- // Id prefix registry (internal-docs/platform.md "Id prefix registry", L1106-1127).
2
+ // Id prefix registry (the platform spec "Id prefix registry").
3
3
  // Every PUBLIC resource registers a prefix here before it ships; ids are globally
4
4
  // unique and handle ids (operations, exports, imports, transfers, builds) are
5
5
  // fetchable at a top-level collection with no extra context. Control-plane-internal
@@ -49,7 +49,7 @@ export function registeredIdSchema(prefix) {
49
49
  }
50
50
  // The main Stattic tenant every self-serve team/user/resource lives under. A
51
51
  // well-known CONSTANT, never configuration: grammatically a normal tenant id with
52
- // zero special cases in contracts, policy URIs, or parsers (spec L1100-1105).
52
+ // zero special cases in contracts, policy URIs, or parsers (per the platform spec).
53
53
  export const MAIN_TENANT_ID = "ten_main";
54
54
  /** Mint a globally unique id for a registered public resource prefix. */
55
55
  export function createId(prefix) {
@@ -1,9 +1,4 @@
1
1
  import { z } from "zod";
2
- export declare const conventionFilesSchema: z.ZodObject<{
3
- redirects: z.ZodOptional<z.ZodString>;
4
- headers: z.ZodOptional<z.ZodString>;
5
- routes: z.ZodOptional<z.ZodString>;
6
- }, z.core.$strip>;
7
2
  export declare const manifestFileSchema: z.ZodObject<{
8
3
  path: z.ZodString;
9
4
  size: z.ZodNumber;
@@ -11,6 +6,13 @@ export declare const manifestFileSchema: z.ZodObject<{
11
6
  contentType: z.ZodOptional<z.ZodString>;
12
7
  sourceUrl: z.ZodOptional<z.ZodString>;
13
8
  }, z.core.$strip>;
9
+ export declare const uploadManifestFileSchema: z.ZodObject<{
10
+ path: z.ZodString;
11
+ size: z.ZodNumber;
12
+ sha256: z.ZodOptional<z.ZodString>;
13
+ contentType: z.ZodOptional<z.ZodString>;
14
+ sourceUrl: z.ZodOptional<z.ZodString>;
15
+ }, z.core.$strip>;
14
16
  export declare const pendingUploadSchema: z.ZodObject<{
15
17
  path: z.ZodString;
16
18
  size: z.ZodNumber;
@@ -91,7 +93,7 @@ export declare const uploadInstructionsSchema: z.ZodObject<{
91
93
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
92
94
  provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
93
95
  registrar: "registrar";
94
- wpcloud: "wpcloud";
96
+ infra: "infra";
95
97
  dns: "dns";
96
98
  runtime: "runtime";
97
99
  }>>>;
@@ -1,27 +1,27 @@
1
1
  import { z } from "zod";
2
2
  import { baseDiagnosticSchema } from "./common.js";
3
- export const conventionFilesSchema = z.object({
4
- redirects: z.string().optional(),
5
- headers: z.string().optional(),
6
- routes: z.string().optional(),
7
- });
3
+ const manifestSha256Schema = z
4
+ .string()
5
+ .regex(/^[0-9a-f]{64}$/, "sha256 must be 64 lowercase hex characters without a prefix.")
6
+ .describe("SHA-256 content digest: exactly 64 lowercase hex characters, no `sha256:` prefix (Version.manifestHash is the only prefixed form).");
7
+ const manifestSourceUrlSchema = z
8
+ .string()
9
+ .url()
10
+ .describe("HTTPS URL the runtime can fetch directly instead of receiving local bytes.");
8
11
  export const manifestFileSchema = z.object({
9
12
  path: z
10
13
  .string()
11
14
  .describe("Version-relative POSIX path. Canonicalized at intake to UTF-8 NFC, percent-decoded exactly once; max 1,024 bytes in canonical form."),
12
15
  size: z.number().int().nonnegative().describe("File size in bytes."),
13
- sha256: z
14
- .string()
15
- .regex(/^[0-9a-f]{64}$/, "sha256 must be 64 lowercase hex characters without a prefix.")
16
+ sha256: manifestSha256Schema
16
17
  .optional()
17
- .describe("Optional SHA-256 content digest: exactly 64 lowercase hex characters, no `sha256:` prefix (Version.manifestHash is the only prefixed form). Omit it for fastest first uploads; include it on updates so unchanged files are never re-uploaded."),
18
+ .describe("Optional SHA-256 content digest: exactly 64 lowercase hex characters, no `sha256:` prefix (Version.manifestHash is the only prefixed form). Omit it to let the runtime hash uploaded bytes; include it to upload by content address, with the digest verified as the bytes land."),
18
19
  contentType: z.string().optional().describe("Optional content type for serving metadata."),
19
- sourceUrl: z
20
- .string()
21
- .url()
20
+ sourceUrl: manifestSourceUrlSchema
22
21
  .optional()
23
22
  .describe("Optional HTTPS URL the runtime can fetch directly for this file instead of receiving bytes from the client."),
24
23
  });
24
+ export const uploadManifestFileSchema = manifestFileSchema.describe("A declared upload file. sha256 is optional: omit it for runtime-hashed path uploads or sourceUrl fetches; include it for content-addressed uploads.");
25
25
  export const pendingUploadSchema = manifestFileSchema.pick({
26
26
  path: true,
27
27
  size: true,
@@ -155,6 +155,16 @@ export declare const hostedMcpDashboardResponseSchema: z.ZodObject<{
155
155
  }, z.core.$strip>>;
156
156
  }, z.core.$strip>;
157
157
  }, z.core.$strip>;
158
+ export declare const hostedMcpProxyTokenSchema: z.ZodObject<{
159
+ accessToken: z.ZodString;
160
+ expiresAt: z.ZodString;
161
+ }, z.core.$strip>;
162
+ export declare const hostedMcpProxyTokenResponseSchema: z.ZodObject<{
163
+ data: z.ZodObject<{
164
+ accessToken: z.ZodString;
165
+ expiresAt: z.ZodString;
166
+ }, z.core.$strip>;
167
+ }, z.core.$strip>;
158
168
  export declare const hostedMcpCloseSessionResponseSchema: z.ZodObject<{
159
169
  data: z.ZodObject<{
160
170
  sessionId: z.ZodString;
@@ -243,5 +253,6 @@ export declare const hostedMcpApprovalResponseSchema: z.ZodObject<{
243
253
  export type HostedMcpSession = z.infer<typeof hostedMcpSessionSchema>;
244
254
  export type HostedMcpSessionEvent = z.infer<typeof hostedMcpSessionEventSchema>;
245
255
  export type HostedMcpDashboard = z.infer<typeof hostedMcpDashboardSchema>;
256
+ export type HostedMcpProxyToken = z.infer<typeof hostedMcpProxyTokenSchema>;
246
257
  export type HostedMcpPausedExecution = z.infer<typeof hostedMcpPausedExecutionSchema>;
247
258
  export type HostedMcpApprovalAction = z.infer<typeof hostedMcpApprovalActionSchema>;
@@ -50,6 +50,11 @@ export const hostedMcpDashboardSchema = z.object({
50
50
  events: z.array(hostedMcpSessionEventSchema),
51
51
  });
52
52
  export const hostedMcpDashboardResponseSchema = dataEnvelope(hostedMcpDashboardSchema);
53
+ export const hostedMcpProxyTokenSchema = z.object({
54
+ accessToken: z.string().min(1),
55
+ expiresAt: z.string().datetime(),
56
+ });
57
+ export const hostedMcpProxyTokenResponseSchema = dataEnvelope(hostedMcpProxyTokenSchema);
53
58
  export const hostedMcpCloseSessionResponseSchema = dataEnvelope(hostedMcpSessionSchema);
54
59
  export const hostedMcpSessionEventsResponseSchema = dataEnvelope(z.object({
55
60
  session: hostedMcpSessionSchema,
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { betaEligibleTeamSourceSchema } from "./beta.js";
3
3
  import { planCodeSchema } from "./features.js";
4
- // `GET /v1/me` (internal-docs/platform.md route catalog): the authenticated
4
+ // `GET /v1/me` (the platform spec route catalog): the authenticated
5
5
  // subject, its tenant grants, principal/team memberships, and a plan summary.
6
6
  // Works for every credential kind — sessions resolve their user and team
7
7
  // memberships; machine credentials resolve the teams and tenants their policy
@@ -3,7 +3,7 @@ export declare const OAUTH_AUTHORIZATION_SERVER_PATH: "/v1/auth";
3
3
  * mcp origin (`https://mcp.<domain>`), so it has no path entry here. */
4
4
  export declare const OAUTH_API_RESOURCE_PATH: "/v1";
5
5
  export type OAuthResourceKey = "api" | "mcp";
6
- export declare const OAUTH_API_RESOURCE_SCOPES: readonly ["teams:read", "teams:create", "spaces:read", "spaces:write", "spaces:rename", "publish:write", "domains:read", "domains:write"];
6
+ export declare const OAUTH_API_RESOURCE_SCOPES: readonly ["teams:read", "teams:create", "spaces:read", "spaces:write", "spaces:rename", "publish:write", "domains:read", "domains:write", "spaces:publish", "builds:trigger"];
7
7
  export declare const OAUTH_MCP_TOOL_SCOPE: "mcp:tools";
8
8
  export declare const OAUTH_OFFLINE_ACCESS_SCOPE: "offline_access";
9
9
  export declare const OAUTH_MCP_RESOURCE_SCOPES: readonly ["mcp:tools", "teams:read", "teams:create", "spaces:read", "spaces:write", "spaces:rename", "publish:write", "domains:read", "domains:write"];
@@ -16,6 +16,7 @@ export declare const OAUTH_MCP_RESOURCE_SCOPES: readonly ["mcp:tools", "teams:re
16
16
  * is the list of capabilities the dashboard and CLI offer per agent account.
17
17
  */
18
18
  export declare const OAUTH_MCP_RESOURCE_ALLOWED_SCOPES: readonly ["mcp:tools", "teams:read", "teams:create", "spaces:read", "spaces:write", "spaces:rename", "publish:write", "domains:read", "domains:write", "offline_access"];
19
+ export declare const OAUTH_API_RESOURCE_ALLOWED_SCOPES: readonly ["teams:read", "teams:create", "spaces:read", "spaces:write", "spaces:rename", "publish:write", "domains:read", "domains:write", "spaces:publish", "builds:trigger", "offline_access"];
19
20
  /**
20
21
  * Interactive MCP clients should be useful after one consent. Authorization is
21
22
  * still bounded by the user's live team role and by approval gates around
@@ -23,13 +24,13 @@ export declare const OAUTH_MCP_RESOURCE_ALLOWED_SCOPES: readonly ["mcp:tools", "
23
24
  * capabilities. Machine clients may continue to request a narrower set.
24
25
  */
25
26
  export declare const OAUTH_MCP_DEFAULT_SCOPES: readonly ["mcp:tools", "teams:read", "teams:create", "spaces:read", "spaces:write", "spaces:rename", "publish:write", "domains:read", "domains:write", "offline_access"];
26
- export declare const OAUTH_PROVIDER_SCOPES: readonly ["openid", "profile", "email", "offline_access", "teams:read", "teams:create", "spaces:read", "spaces:write", "spaces:rename", "publish:write", "domains:read", "domains:write", "mcp:tools"];
27
+ export declare const OAUTH_PROVIDER_SCOPES: readonly ["openid", "profile", "email", "offline_access", "teams:read", "teams:create", "spaces:read", "spaces:write", "spaces:rename", "publish:write", "domains:read", "domains:write", "spaces:publish", "builds:trigger", "mcp:tools"];
27
28
  export declare const OAUTH_RESOURCE_DEFINITIONS: {
28
29
  readonly api: {
29
30
  readonly key: "api";
30
31
  readonly name: "Spacefast API";
31
32
  readonly accessTokenTtlSeconds: number;
32
- readonly allowedScopes: readonly ["teams:read", "teams:create", "spaces:read", "spaces:write", "spaces:rename", "publish:write", "domains:read", "domains:write"];
33
+ readonly allowedScopes: readonly ["teams:read", "teams:create", "spaces:read", "spaces:write", "spaces:rename", "publish:write", "domains:read", "domains:write", "spaces:publish", "builds:trigger", "offline_access"];
33
34
  };
34
35
  readonly mcp: {
35
36
  readonly key: "mcp";
@@ -2,7 +2,7 @@ export const OAUTH_AUTHORIZATION_SERVER_PATH = "/v1/auth";
2
2
  /** The API resource is a path on the api origin; the MCP resource is the whole
3
3
  * mcp origin (`https://mcp.<domain>`), so it has no path entry here. */
4
4
  export const OAUTH_API_RESOURCE_PATH = "/v1";
5
- export const OAUTH_API_RESOURCE_SCOPES = [
5
+ const OAUTH_SHARED_API_RESOURCE_SCOPES = [
6
6
  "teams:read",
7
7
  "teams:create",
8
8
  "spaces:read",
@@ -12,11 +12,16 @@ export const OAUTH_API_RESOURCE_SCOPES = [
12
12
  "domains:read",
13
13
  "domains:write",
14
14
  ];
15
+ export const OAUTH_API_RESOURCE_SCOPES = [
16
+ ...OAUTH_SHARED_API_RESOURCE_SCOPES,
17
+ "spaces:publish",
18
+ "builds:trigger",
19
+ ];
15
20
  export const OAUTH_MCP_TOOL_SCOPE = "mcp:tools";
16
21
  export const OAUTH_OFFLINE_ACCESS_SCOPE = "offline_access";
17
22
  export const OAUTH_MCP_RESOURCE_SCOPES = [
18
23
  OAUTH_MCP_TOOL_SCOPE,
19
- ...OAUTH_API_RESOURCE_SCOPES,
24
+ ...OAUTH_SHARED_API_RESOURCE_SCOPES,
20
25
  ];
21
26
  /**
22
27
  * A resource's `allowedScopes` is intersected with the requested scopes on every
@@ -30,6 +35,10 @@ export const OAUTH_MCP_RESOURCE_ALLOWED_SCOPES = [
30
35
  ...OAUTH_MCP_RESOURCE_SCOPES,
31
36
  OAUTH_OFFLINE_ACCESS_SCOPE,
32
37
  ];
38
+ export const OAUTH_API_RESOURCE_ALLOWED_SCOPES = [
39
+ ...OAUTH_API_RESOURCE_SCOPES,
40
+ OAUTH_OFFLINE_ACCESS_SCOPE,
41
+ ];
33
42
  /**
34
43
  * Interactive MCP clients should be useful after one consent. Authorization is
35
44
  * still bounded by the user's live team role and by approval gates around
@@ -50,7 +59,7 @@ export const OAUTH_RESOURCE_DEFINITIONS = {
50
59
  key: "api",
51
60
  name: "Spacefast API",
52
61
  accessTokenTtlSeconds: 15 * 60,
53
- allowedScopes: OAUTH_API_RESOURCE_SCOPES,
62
+ allowedScopes: OAUTH_API_RESOURCE_ALLOWED_SCOPES,
54
63
  },
55
64
  mcp: {
56
65
  key: "mcp",
@@ -10,7 +10,6 @@ export declare const userOperationKindSchema: z.ZodEnum<{
10
10
  domain_transfer_submit: "domain_transfer_submit";
11
11
  domain_dns_apply: "domain_dns_apply";
12
12
  domain_lifecycle: "domain_lifecycle";
13
- variable_cascade: "variable_cascade";
14
13
  webhook_deliver: "webhook_deliver";
15
14
  integration_release: "integration_release";
16
15
  }>;
@@ -44,7 +43,7 @@ export declare const UserOperationSchema: z.ZodObject<{
44
43
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
45
44
  provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
46
45
  registrar: "registrar";
47
- wpcloud: "wpcloud";
46
+ infra: "infra";
48
47
  dns: "dns";
49
48
  runtime: "runtime";
50
49
  }>>>;
@@ -65,7 +64,6 @@ export declare const UserOperationSchema: z.ZodObject<{
65
64
  domain_transfer_submit: "domain_transfer_submit";
66
65
  domain_dns_apply: "domain_dns_apply";
67
66
  domain_lifecycle: "domain_lifecycle";
68
- variable_cascade: "variable_cascade";
69
67
  webhook_deliver: "webhook_deliver";
70
68
  integration_release: "integration_release";
71
69
  }>;
@@ -119,7 +117,7 @@ export declare const operationListResponseSchema: z.ZodObject<{
119
117
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
120
118
  provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
121
119
  registrar: "registrar";
122
- wpcloud: "wpcloud";
120
+ infra: "infra";
123
121
  dns: "dns";
124
122
  runtime: "runtime";
125
123
  }>>>;
@@ -140,7 +138,6 @@ export declare const operationListResponseSchema: z.ZodObject<{
140
138
  domain_transfer_submit: "domain_transfer_submit";
141
139
  domain_dns_apply: "domain_dns_apply";
142
140
  domain_lifecycle: "domain_lifecycle";
143
- variable_cascade: "variable_cascade";
144
141
  webhook_deliver: "webhook_deliver";
145
142
  integration_release: "integration_release";
146
143
  }>;
@@ -162,3 +159,91 @@ export declare const operationListResponseSchema: z.ZodObject<{
162
159
  hasMore: z.ZodBoolean;
163
160
  }, z.core.$strip>;
164
161
  }, z.core.$strip>;
162
+ /** Buckets an operator triages by. Live buckets partition the live population:
163
+ * a queued row is exactly one of ready / scheduled / blocked. */
164
+ export declare const SUPERADMIN_OPERATION_FILTERS: readonly ["all", "ready", "scheduled", "blocked", "running", "stuck", "retrying", "failed", "succeeded", "canceled"];
165
+ export type SuperadminOperationFilter = (typeof SUPERADMIN_OPERATION_FILTERS)[number];
166
+ export declare const superadminOperationListQuerySchema: z.ZodObject<{
167
+ filter: z.ZodDefault<z.ZodEnum<{
168
+ all: "all";
169
+ failed: "failed";
170
+ canceled: "canceled";
171
+ ready: "ready";
172
+ running: "running";
173
+ succeeded: "succeeded";
174
+ scheduled: "scheduled";
175
+ blocked: "blocked";
176
+ stuck: "stuck";
177
+ retrying: "retrying";
178
+ }>>;
179
+ eventType: z.ZodOptional<z.ZodString>;
180
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
181
+ order: z.ZodDefault<z.ZodEnum<{
182
+ newest: "newest";
183
+ oldest: "oldest";
184
+ }>>;
185
+ }, z.core.$strip>;
186
+ export type SuperadminOperationListQuery = z.infer<typeof superadminOperationListQuerySchema>;
187
+ export declare const SuperadminOperationRowSchema: z.ZodObject<{
188
+ id: z.ZodString;
189
+ eventType: z.ZodString;
190
+ status: z.ZodString;
191
+ resourceType: z.ZodString;
192
+ resourceId: z.ZodString;
193
+ attempts: z.ZodNumber;
194
+ dueAt: z.ZodNullable<z.ZodString>;
195
+ leaseExpiresAt: z.ZodNullable<z.ZodString>;
196
+ stuck: z.ZodBoolean;
197
+ blockedByOperationId: z.ZodNullable<z.ZodString>;
198
+ inflightKey: z.ZodNullable<z.ZodString>;
199
+ lastError: z.ZodNullable<z.ZodString>;
200
+ createdAt: z.ZodString;
201
+ updatedAt: z.ZodString;
202
+ finishedAt: z.ZodNullable<z.ZodString>;
203
+ }, z.core.$strip>;
204
+ export declare const SuperadminOperationListSchema: z.ZodObject<{
205
+ operations: z.ZodArray<z.ZodObject<{
206
+ id: z.ZodString;
207
+ eventType: z.ZodString;
208
+ status: z.ZodString;
209
+ resourceType: z.ZodString;
210
+ resourceId: z.ZodString;
211
+ attempts: z.ZodNumber;
212
+ dueAt: z.ZodNullable<z.ZodString>;
213
+ leaseExpiresAt: z.ZodNullable<z.ZodString>;
214
+ stuck: z.ZodBoolean;
215
+ blockedByOperationId: z.ZodNullable<z.ZodString>;
216
+ inflightKey: z.ZodNullable<z.ZodString>;
217
+ lastError: z.ZodNullable<z.ZodString>;
218
+ createdAt: z.ZodString;
219
+ updatedAt: z.ZodString;
220
+ finishedAt: z.ZodNullable<z.ZodString>;
221
+ }, z.core.$strip>>;
222
+ total: z.ZodNumber;
223
+ windowHours: z.ZodNumber;
224
+ }, z.core.$strip>;
225
+ export declare const SuperadminOperationSummarySchema: z.ZodObject<{
226
+ windowHours: z.ZodNumber;
227
+ live: z.ZodObject<{
228
+ ready: z.ZodNumber;
229
+ scheduled: z.ZodNumber;
230
+ blocked: z.ZodNumber;
231
+ running: z.ZodNumber;
232
+ stuck: z.ZodNumber;
233
+ retrying: z.ZodNumber;
234
+ }, z.core.$strip>;
235
+ recent: z.ZodObject<{
236
+ succeeded: z.ZodNumber;
237
+ failed: z.ZodNumber;
238
+ canceled: z.ZodNumber;
239
+ }, z.core.$strip>;
240
+ oldestReadyAt: z.ZodNullable<z.ZodString>;
241
+ oldestRunningAt: z.ZodNullable<z.ZodString>;
242
+ kinds: z.ZodArray<z.ZodObject<{
243
+ eventType: z.ZodString;
244
+ ready: z.ZodNumber;
245
+ running: z.ZodNumber;
246
+ stuck: z.ZodNumber;
247
+ failed: z.ZodNumber;
248
+ }, z.core.$strip>>;
249
+ }, z.core.$strip>;
@@ -11,7 +11,6 @@ export const userOperationKindSchema = z.enum([
11
11
  "domain_transfer_submit",
12
12
  "domain_dns_apply",
13
13
  "domain_lifecycle",
14
- "variable_cascade",
15
14
  "webhook_deliver",
16
15
  "integration_release",
17
16
  ]);
@@ -33,15 +32,90 @@ export const operationListQuerySchema = cursorListQuerySchema.extend({
33
32
  .string()
34
33
  .min(1)
35
34
  .optional()
36
- .describe("Filter to operations touching one resource type, e.g. `space`."),
35
+ .describe("Filter to operations touching one resource type, for example `space`."),
37
36
  resourceId: z.string().min(1).optional().describe("Filter to operations touching one resource."),
38
37
  spaceId: z
39
38
  .string()
40
39
  .min(1)
41
40
  .optional()
42
- .describe("Filter to operations pertaining to one Space — its own operations plus those of its versions and builds. The Space must be readable by the caller."),
41
+ .describe("Filter to operations for one Space — its own operations plus those of its versions and builds. The Space must be readable by the caller."),
43
42
  });
44
43
  export const operationListResponseSchema = z.object({
45
44
  data: z.array(UserOperationSchema),
46
45
  pagination: CursorPaginationSchema,
47
46
  });
47
+ // ---------------------------------------------------------------------------
48
+ // Superadmin operator surface: the operations rows ARE the queue, bucketed by
49
+ // claim eligibility. Served by the control plane's feed service and consumed
50
+ // by the superadmin dashboard and the e2e harness.
51
+ /** Buckets an operator triages by. Live buckets partition the live population:
52
+ * a queued row is exactly one of ready / scheduled / blocked. */
53
+ export const SUPERADMIN_OPERATION_FILTERS = [
54
+ "all",
55
+ "ready",
56
+ "scheduled",
57
+ "blocked",
58
+ "running",
59
+ "stuck",
60
+ "retrying",
61
+ "failed",
62
+ "succeeded",
63
+ "canceled",
64
+ ];
65
+ export const superadminOperationListQuerySchema = z.object({
66
+ filter: z.enum(SUPERADMIN_OPERATION_FILTERS).default("all"),
67
+ eventType: z.string().trim().min(1).max(160).optional(),
68
+ limit: z.coerce.number().int().min(1).max(200).default(50),
69
+ order: z.enum(["newest", "oldest"]).default("newest"),
70
+ });
71
+ export const SuperadminOperationRowSchema = z.object({
72
+ id: z.string(),
73
+ eventType: z.string(),
74
+ status: z.string(),
75
+ resourceType: z.string(),
76
+ resourceId: z.string(),
77
+ attempts: z.number().int().nonnegative(),
78
+ // The mutable eligibility clock, meaningless once the row is terminal — null
79
+ // there rather than a stale instant an operator would read as a schedule.
80
+ dueAt: z.string().datetime().nullable(),
81
+ leaseExpiresAt: z.string().datetime().nullable(),
82
+ // Computed with the database clock so row labels agree with server-side
83
+ // stuck filters and summary totals even when an operator's clock drifts.
84
+ stuck: z.boolean(),
85
+ blockedByOperationId: z.string().nullable(),
86
+ inflightKey: z.string().nullable(),
87
+ lastError: z.string().nullable(),
88
+ createdAt: z.string().datetime(),
89
+ updatedAt: z.string().datetime(),
90
+ finishedAt: z.string().datetime().nullable(),
91
+ });
92
+ export const SuperadminOperationListSchema = z.object({
93
+ operations: z.array(SuperadminOperationRowSchema),
94
+ total: z.number().int().nonnegative(),
95
+ windowHours: z.number().int().positive(),
96
+ });
97
+ export const SuperadminOperationSummarySchema = z.object({
98
+ windowHours: z.number().int().positive(),
99
+ live: z.object({
100
+ ready: z.number().int().nonnegative(),
101
+ scheduled: z.number().int().nonnegative(),
102
+ blocked: z.number().int().nonnegative(),
103
+ running: z.number().int().nonnegative(),
104
+ stuck: z.number().int().nonnegative(),
105
+ retrying: z.number().int().nonnegative(),
106
+ }),
107
+ recent: z.object({
108
+ succeeded: z.number().int().nonnegative(),
109
+ failed: z.number().int().nonnegative(),
110
+ canceled: z.number().int().nonnegative(),
111
+ }),
112
+ oldestReadyAt: z.string().datetime().nullable(),
113
+ oldestRunningAt: z.string().datetime().nullable(),
114
+ kinds: z.array(z.object({
115
+ eventType: z.string(),
116
+ ready: z.number().int().nonnegative(),
117
+ running: z.number().int().nonnegative(),
118
+ stuck: z.number().int().nonnegative(),
119
+ failed: z.number().int().nonnegative(),
120
+ })),
121
+ });
@@ -1,29 +1,33 @@
1
1
  import { z } from "zod";
2
2
  export declare const SITE_PAGE_IDS: readonly ["404", "denied", "access", "index", "preview"];
3
3
  export declare const sitePageIdSchema: z.ZodEnum<{
4
+ access: "access";
4
5
  denied: "denied";
5
- index: "index";
6
6
  preview: "preview";
7
- access: "access";
7
+ index: "index";
8
8
  404: "404";
9
9
  }>;
10
10
  export type SitePageId = z.infer<typeof sitePageIdSchema>;
11
11
  export declare const ROUTE_PAGE_IDS: readonly ["404", "denied", "access"];
12
12
  export declare const routePageIdSchema: z.ZodEnum<{
13
- denied: "denied";
14
13
  access: "access";
14
+ denied: "denied";
15
15
  404: "404";
16
16
  }>;
17
17
  export type RoutePageId = z.infer<typeof routePageIdSchema>;
18
- export declare const CUSTOM_PAGE_IDS: readonly ["404", "denied", "access", "index", "preview"];
18
+ export declare const CUSTOM_PAGE_IDS: readonly ["404", "denied", "access", "index", "preview", "collab"];
19
19
  export declare const customPageIdSchema: z.ZodEnum<{
20
+ collab: "collab";
21
+ access: "access";
20
22
  denied: "denied";
21
- index: "index";
22
23
  preview: "preview";
23
- access: "access";
24
+ index: "index";
24
25
  404: "404";
25
26
  }>;
26
27
  export type CustomPageId = z.infer<typeof customPageIdSchema>;
28
+ export declare const COLLAB_PAGE_SOURCE = "_pages/collab.html";
29
+ export declare const COLLAB_PAGE_PATH: "/_pages/collab.html";
30
+ export declare const COLLAB_PAGE_ELEMENTS: readonly ["sf-space", "sf-comments", "sf-thread", "sf-timeline", "sf-presence", "sf-versions"];
27
31
  export declare const PLATFORM_PAGE_IDS: readonly ["undeployed", "suspended", "legal", "gone", "runtime-error", "rate-limited", "tier-unavailable", "proxy-error", "method-not-allowed", "content-too-large"];
28
32
  export declare const platformPageIdSchema: z.ZodEnum<{
29
33
  legal: "legal";
@@ -55,12 +59,13 @@ export declare const pageArtifactKeySchema: z.ZodString;
55
59
  export declare const runtimePagesSchema: z.ZodObject<{
56
60
  routes: z.ZodRecord<z.ZodString, z.ZodObject<{
57
61
  pages: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
58
- denied: "denied";
59
62
  access: "access";
63
+ denied: "denied";
60
64
  404: "404";
61
65
  }>, z.ZodString>>;
62
66
  index: z.ZodOptional<z.ZodString>;
63
67
  }, z.core.$strip>>;
64
68
  previews: z.ZodRecord<z.ZodString, z.ZodString>;
69
+ collab: z.ZodOptional<z.ZodString>;
65
70
  }, z.core.$strip>;
66
71
  export type RuntimePages = z.infer<typeof runtimePagesSchema>;
@@ -3,8 +3,28 @@ export const SITE_PAGE_IDS = ["404", "denied", "access", "index", "preview"];
3
3
  export const sitePageIdSchema = z.enum(SITE_PAGE_IDS);
4
4
  export const ROUTE_PAGE_IDS = ["404", "denied", "access"];
5
5
  export const routePageIdSchema = z.enum(ROUTE_PAGE_IDS);
6
- export const CUSTOM_PAGE_IDS = ["404", "denied", "access", "index", "preview"];
6
+ // `collab` is publishable but has no built-in template: with no layout of their
7
+ // own a Space's reviewers get the platform frame at `/__/collab`, so there is
8
+ // nothing for a default `_pages/collab.html` to be. Hence CUSTOM ⊃ SITE.
9
+ export const CUSTOM_PAGE_IDS = ["404", "denied", "access", "index", "preview", "collab"];
7
10
  export const customPageIdSchema = z.enum(CUSTOM_PAGE_IDS);
11
+ // The Space-level review room the collaboration orb expands into, and the URL
12
+ // its compiled document answers at (collab-public-api.html §3). One room per
13
+ // Space, so one page, at the root — never a per-directory override.
14
+ // The PHP mirror is SPACEFAST_COLLAB_PAGE_PATH in runtime/engine/shared/context.php.
15
+ export const COLLAB_PAGE_SOURCE = "_pages/collab.html";
16
+ export const COLLAB_PAGE_PATH = `/${COLLAB_PAGE_SOURCE}`;
17
+ // Registered by the browser SDK, not by the server: the compiler leaves them
18
+ // in the document untouched and they render nothing at publish time. Listed
19
+ // here only so a collab layout using them is not read as a typo'd page slot.
20
+ export const COLLAB_PAGE_ELEMENTS = [
21
+ "sf-space",
22
+ "sf-comments",
23
+ "sf-thread",
24
+ "sf-timeline",
25
+ "sf-presence",
26
+ "sf-versions",
27
+ ];
8
28
  export const PLATFORM_PAGE_IDS = [
9
29
  "undeployed",
10
30
  "suspended",
@@ -87,4 +107,7 @@ export const runtimePagesSchema = z.object({
87
107
  index: pageArtifactKeySchema.optional(),
88
108
  })),
89
109
  previews: z.record(z.string().startsWith("/").max(2048), pageArtifactKeySchema),
110
+ // Present only when the Space published its own review room; its absence is
111
+ // what tells the SDK to expand into the platform frame instead.
112
+ collab: pageArtifactKeySchema.optional(),
90
113
  });
@@ -16,14 +16,12 @@ export type PlanDisabledBehavior = z.infer<typeof planDisabledBehaviorSchema>;
16
16
  export declare const PlanPolicyResponseSchema: z.ZodObject<{
17
17
  principal: z.ZodObject<{
18
18
  type: z.ZodEnum<{
19
- site: "site";
20
19
  space: "space";
21
20
  team: "team";
22
21
  external_principal: "external_principal";
23
22
  }>;
24
23
  id: z.ZodString;
25
24
  }, z.core.$strip>;
26
- siteId: z.ZodOptional<z.ZodString>;
27
25
  spaceId: z.ZodOptional<z.ZodString>;
28
26
  plan: z.ZodEnum<{
29
27
  free: "free";
@@ -2,7 +2,7 @@ import { z } from "zod";
2
2
  import { diagnosticSeverity } from "./enums.js";
3
3
  import { planCodeSchema, planLimitValueSchema } from "./features.js";
4
4
  // Behaviors the platform disables (rather than failing publishes) when the
5
- // plan does not include them (internal-docs/platform.md "Plans And Limits").
5
+ // plan does not include them (the platform spec "Plans And Limits").
6
6
  export const PLAN_DISABLED_BEHAVIOR_CODES = [
7
7
  "free_external_proxy_disabled",
8
8
  "routing_rules_over_plan",
@@ -19,11 +19,10 @@ export const planDisabledBehaviorSchema = z.object({
19
19
  export const PlanPolicyResponseSchema = z.object({
20
20
  principal: z
21
21
  .object({
22
- type: z.enum(["team", "site", "space", "external_principal"]),
22
+ type: z.enum(["team", "space", "external_principal"]),
23
23
  id: z.string(),
24
24
  })
25
25
  .describe("Principal the policy was resolved for."),
26
- siteId: z.string().optional().describe("Site the policy was resolved against, when site-scoped."),
27
26
  spaceId: z
28
27
  .string()
29
28
  .optional()