@spacefast/common 0.0.10 → 0.0.12

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 (122) hide show
  1. package/dist/agents/connect-targets.d.ts +4 -4
  2. package/dist/agents/connect-targets.js +3 -3
  3. package/dist/agents/private-key-oauth.d.ts +37 -0
  4. package/dist/agents/private-key-oauth.js +158 -0
  5. package/dist/config/domains.js +1 -1
  6. package/dist/config/index.d.ts +1 -0
  7. package/dist/config/index.js +1 -0
  8. package/dist/config/postgres-budget.d.ts +126 -0
  9. package/dist/config/postgres-budget.js +135 -0
  10. package/dist/config/postgres-budget.json +50 -0
  11. package/dist/contracts/access.d.ts +42 -24
  12. package/dist/contracts/access.js +73 -34
  13. package/dist/contracts/activity.d.ts +1 -1
  14. package/dist/contracts/activity.js +5 -5
  15. package/dist/contracts/api-keys.d.ts +53 -45
  16. package/dist/contracts/api-keys.js +1 -0
  17. package/dist/contracts/archives.d.ts +8 -8
  18. package/dist/contracts/builds.d.ts +8 -8
  19. package/dist/contracts/builds.js +28 -48
  20. package/dist/contracts/channels.js +1 -2
  21. package/dist/contracts/comments.d.ts +55 -19
  22. package/dist/contracts/comments.js +56 -17
  23. package/dist/contracts/common.d.ts +4 -3
  24. package/dist/contracts/common.js +2 -0
  25. package/dist/contracts/deployments.d.ts +3 -3
  26. package/dist/contracts/device-auth.d.ts +14 -12
  27. package/dist/contracts/docs.d.ts +5 -5
  28. package/dist/contracts/domains.d.ts +261 -1330
  29. package/dist/contracts/domains.js +39 -301
  30. package/dist/contracts/email-preferences.d.ts +50 -0
  31. package/dist/contracts/email-preferences.js +44 -0
  32. package/dist/contracts/enums.d.ts +1 -1
  33. package/dist/contracts/error-code-meta.d.ts +84 -15
  34. package/dist/contracts/error-code-meta.js +28 -4
  35. package/dist/contracts/error-codes.d.ts +1 -1
  36. package/dist/contracts/error-codes.js +24 -6
  37. package/dist/contracts/events.d.ts +13 -13
  38. package/dist/contracts/feature-lifecycle.d.ts +644 -2
  39. package/dist/contracts/feature-lifecycle.js +685 -2
  40. package/dist/contracts/features.d.ts +236 -24
  41. package/dist/contracts/features.js +3 -272
  42. package/dist/contracts/ids.d.ts +1 -2
  43. package/dist/contracts/ids.js +1 -2
  44. package/dist/contracts/internal.d.ts +3 -3
  45. package/dist/contracts/mcp.d.ts +6 -6
  46. package/dist/contracts/me.js +1 -1
  47. package/dist/contracts/mounts.d.ts +142 -0
  48. package/dist/contracts/mounts.js +56 -0
  49. package/dist/contracts/oauth-resources.d.ts +5 -5
  50. package/dist/contracts/oauth-resources.js +1 -0
  51. package/dist/contracts/operations.d.ts +2 -2
  52. package/dist/contracts/pages.d.ts +2 -2
  53. package/dist/contracts/pages.js +8 -3
  54. package/dist/contracts/plan-policy.d.ts +1 -1
  55. package/dist/contracts/platform.d.ts +3 -3
  56. package/dist/contracts/resources.d.ts +12 -20
  57. package/dist/contracts/resources.js +13 -37
  58. package/dist/contracts/runtime-api.d.ts +330 -16
  59. package/dist/contracts/runtime-api.js +58 -14
  60. package/dist/contracts/sf-config-v1.js +1 -1
  61. package/dist/contracts/sites.d.ts +12 -12
  62. package/dist/contracts/sites.js +18 -11
  63. package/dist/contracts/space-config.d.ts +2 -3
  64. package/dist/contracts/space-config.js +3 -1
  65. package/dist/contracts/spaces.d.ts +143 -102
  66. package/dist/contracts/spaces.js +109 -43
  67. package/dist/contracts/superadmin-emails.d.ts +25 -1
  68. package/dist/contracts/superadmin-emails.js +10 -15
  69. package/dist/contracts/superadmin-runtime.d.ts +2 -2
  70. package/dist/contracts/superadmin-spaces.d.ts +6 -14
  71. package/dist/contracts/tags.d.ts +43 -13
  72. package/dist/contracts/tags.js +195 -11
  73. package/dist/contracts/transfers.d.ts +1 -1
  74. package/dist/contracts/variables.d.ts +4 -4
  75. package/dist/contracts/variables.js +4 -3
  76. package/dist/contracts/webhooks.d.ts +2 -2
  77. package/dist/contracts/zero.d.ts +329 -7
  78. package/dist/contracts/zero.js +121 -2
  79. package/dist/dashboard-paths/index.d.ts +1 -1
  80. package/dist/docs/agent-setup.d.ts +4 -2
  81. package/dist/docs/agent-setup.js +15 -7
  82. package/dist/docs/agent-solutions.js +1 -1
  83. package/dist/docs/catalog.d.ts +8 -10
  84. package/dist/docs/catalog.js +8 -10
  85. package/dist/docs/error-docs.js +86 -18
  86. package/dist/utils/access-grant.d.ts +14 -0
  87. package/dist/utils/access-grant.js +88 -0
  88. package/dist/utils/access-match.d.ts +7 -0
  89. package/dist/utils/access-match.fixtures.json +513 -0
  90. package/dist/utils/access-match.js +32 -16
  91. package/dist/utils/access-verdict.fixtures.json +421 -0
  92. package/dist/utils/credential-policy.d.ts +1 -1
  93. package/dist/utils/dns-instructions.d.ts +29 -0
  94. package/dist/utils/dns-instructions.js +78 -0
  95. package/dist/utils/domain-diagnostics.d.ts +29 -0
  96. package/dist/utils/domain-diagnostics.js +63 -0
  97. package/dist/utils/egress-policy.fixtures.json +51 -0
  98. package/dist/utils/id-hints.d.ts +1 -0
  99. package/dist/utils/id-hints.js +55 -13
  100. package/dist/utils/page-colors.d.ts +50 -0
  101. package/dist/utils/page-colors.js +167 -0
  102. package/dist/utils/page-fonts.d.ts +2 -0
  103. package/dist/utils/page-fonts.js +4 -0
  104. package/dist/utils/pages.d.ts +8 -1
  105. package/dist/utils/pages.js +123 -37
  106. package/dist/utils/production-runtime.d.ts +18 -0
  107. package/dist/utils/production-runtime.js +28 -0
  108. package/dist/utils/query-keys.d.ts +6 -7
  109. package/dist/utils/query-keys.js +11 -12
  110. package/dist/utils/sf-config-v1.fixtures.json +9 -0
  111. package/dist/utils/sf-config-v1.js +28 -19
  112. package/dist/utils/source-archive-policy.d.ts +2 -0
  113. package/dist/utils/source-archive-policy.js +2 -0
  114. package/dist/utils/static-runtime-policy.fixtures.json +57 -0
  115. package/dist/utils/static-runtime-policy.js +1 -1
  116. package/package.json +5 -4
  117. package/dist/contracts/annotations.d.ts +0 -327
  118. package/dist/contracts/annotations.js +0 -235
  119. package/dist/contracts/generated-feature-launch-entries.d.ts +0 -2
  120. package/dist/contracts/generated-feature-launch-entries.js +0 -518
  121. package/dist/contracts/publishes.d.ts +0 -135
  122. package/dist/contracts/publishes.js +0 -162
@@ -24,8 +24,8 @@ export declare const uploadSessionModeSchema: z.ZodEnum<{
24
24
  export declare const uploadTargetSchema: z.ZodObject<{
25
25
  path: z.ZodString;
26
26
  method: z.ZodEnum<{
27
- PUT: "PUT";
28
27
  POST: "POST";
28
+ PUT: "PUT";
29
29
  }>;
30
30
  url: z.ZodUnion<[z.ZodString, z.ZodString]>;
31
31
  headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -53,8 +53,8 @@ export declare const uploadInstructionsSchema: z.ZodObject<{
53
53
  targets: z.ZodDefault<z.ZodArray<z.ZodObject<{
54
54
  path: z.ZodString;
55
55
  method: z.ZodEnum<{
56
- PUT: "PUT";
57
56
  POST: "POST";
57
+ PUT: "PUT";
58
58
  }>;
59
59
  url: z.ZodUnion<[z.ZodString, z.ZodString]>;
60
60
  headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -84,8 +84,8 @@ export declare const uploadInstructionsSchema: z.ZodObject<{
84
84
  code: z.ZodString;
85
85
  severity: z.ZodEnum<{
86
86
  info: "info";
87
- warning: "warning";
88
87
  error: "error";
88
+ warning: "warning";
89
89
  }>;
90
90
  message: z.ZodString;
91
91
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -101,8 +101,8 @@ export declare const hostedMcpExecutionArtifactSchema: z.ZodObject<{
101
101
  runId: z.ZodString;
102
102
  kind: z.ZodEnum<{
103
103
  file: "file";
104
- warning: "warning";
105
104
  resource: "resource";
105
+ warning: "warning";
106
106
  summary: "summary";
107
107
  result: "result";
108
108
  log: "log";
@@ -151,8 +151,8 @@ export declare const hostedMcpExecutionRunSchema: z.ZodObject<{
151
151
  runId: z.ZodString;
152
152
  kind: z.ZodEnum<{
153
153
  file: "file";
154
- warning: "warning";
155
154
  resource: "resource";
155
+ warning: "warning";
156
156
  summary: "summary";
157
157
  result: "result";
158
158
  log: "log";
@@ -377,8 +377,8 @@ export declare const hostedMcpDashboardSchema: z.ZodObject<{
377
377
  runId: z.ZodString;
378
378
  kind: z.ZodEnum<{
379
379
  file: "file";
380
- warning: "warning";
381
380
  resource: "resource";
381
+ warning: "warning";
382
382
  summary: "summary";
383
383
  result: "result";
384
384
  log: "log";
@@ -542,8 +542,8 @@ export declare const hostedMcpDashboardResponseSchema: z.ZodObject<{
542
542
  runId: z.ZodString;
543
543
  kind: z.ZodEnum<{
544
544
  file: "file";
545
- warning: "warning";
546
545
  resource: "resource";
546
+ warning: "warning";
547
547
  summary: "summary";
548
548
  result: "result";
549
549
  log: "log";
@@ -707,8 +707,8 @@ export declare const hostedMcpExecutionRunsResponseSchema: z.ZodObject<{
707
707
  runId: z.ZodString;
708
708
  kind: z.ZodEnum<{
709
709
  file: "file";
710
- warning: "warning";
711
710
  resource: "resource";
711
+ warning: "warning";
712
712
  summary: "summary";
713
713
  result: "result";
714
714
  log: "log";
@@ -761,8 +761,8 @@ export declare const hostedMcpExecutionRunResponseSchema: z.ZodObject<{
761
761
  runId: z.ZodString;
762
762
  kind: z.ZodEnum<{
763
763
  file: "file";
764
- warning: "warning";
765
764
  resource: "resource";
765
+ warning: "warning";
766
766
  summary: "summary";
767
767
  result: "result";
768
768
  log: "log";
@@ -30,7 +30,7 @@ export const meResponseSchema = z.object({
30
30
  isSuperadmin: z.boolean().describe("Whether the user is a platform operator."),
31
31
  })
32
32
  .nullable()
33
- .describe("User identity when known: the session user, or the machine credential's creator. Null for automation-created credentials."),
33
+ .describe("Authenticated user identity for user-subject credentials. Null for team- or service-subject machine credentials; creator metadata is retained only for audit attribution, not request identity."),
34
34
  tenants: z
35
35
  .array(z.object({
36
36
  id: z.string().describe("Tenant id."),
@@ -0,0 +1,142 @@
1
+ import { z } from "zod";
2
+ export declare function normalizeMountPathPrefix(value: string): string;
3
+ export declare const mountPathPrefixSchema: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
4
+ export declare const spaceMountCreateSchema: z.ZodObject<{
5
+ sourceVersionId: z.ZodCustom<`ver_${string}`, `ver_${string}`>;
6
+ pathPrefix: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
7
+ targetSpaceId: z.ZodCustom<`spc_${string}`, `spc_${string}`>;
8
+ channel: z.ZodDefault<z.ZodLiteral<"live">>;
9
+ }, z.core.$strip>;
10
+ export declare const spaceMountSchema: z.ZodObject<{
11
+ id: z.ZodCustom<`mnt_${string}`, `mnt_${string}`>;
12
+ spaceId: z.ZodCustom<`spc_${string}`, `spc_${string}`>;
13
+ sourceVersionId: z.ZodCustom<`ver_${string}`, `ver_${string}`>;
14
+ pathPrefix: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
15
+ targetSpaceId: z.ZodCustom<`spc_${string}`, `spc_${string}`>;
16
+ targetSpaceSlug: z.ZodString;
17
+ channel: z.ZodLiteral<"live">;
18
+ versionId: z.ZodNullable<z.ZodCustom<`ver_${string}`, `ver_${string}`>>;
19
+ targetVersionId: z.ZodNullable<z.ZodCustom<`ver_${string}`, `ver_${string}`>>;
20
+ createdAt: z.ZodString;
21
+ updatedAt: z.ZodString;
22
+ }, z.core.$strip>;
23
+ export declare const spaceMountListResponseSchema: z.ZodObject<{
24
+ data: z.ZodArray<z.ZodObject<{
25
+ id: z.ZodCustom<`mnt_${string}`, `mnt_${string}`>;
26
+ spaceId: z.ZodCustom<`spc_${string}`, `spc_${string}`>;
27
+ sourceVersionId: z.ZodCustom<`ver_${string}`, `ver_${string}`>;
28
+ pathPrefix: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
29
+ targetSpaceId: z.ZodCustom<`spc_${string}`, `spc_${string}`>;
30
+ targetSpaceSlug: z.ZodString;
31
+ channel: z.ZodLiteral<"live">;
32
+ versionId: z.ZodNullable<z.ZodCustom<`ver_${string}`, `ver_${string}`>>;
33
+ targetVersionId: z.ZodNullable<z.ZodCustom<`ver_${string}`, `ver_${string}`>>;
34
+ createdAt: z.ZodString;
35
+ updatedAt: z.ZodString;
36
+ }, z.core.$strip>>;
37
+ }, z.core.$strip>;
38
+ export declare const spaceMountResponseSchema: z.ZodObject<{
39
+ data: z.ZodObject<{
40
+ id: z.ZodCustom<`mnt_${string}`, `mnt_${string}`>;
41
+ spaceId: z.ZodCustom<`spc_${string}`, `spc_${string}`>;
42
+ sourceVersionId: z.ZodCustom<`ver_${string}`, `ver_${string}`>;
43
+ pathPrefix: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
44
+ targetSpaceId: z.ZodCustom<`spc_${string}`, `spc_${string}`>;
45
+ targetSpaceSlug: z.ZodString;
46
+ channel: z.ZodLiteral<"live">;
47
+ versionId: z.ZodNullable<z.ZodCustom<`ver_${string}`, `ver_${string}`>>;
48
+ targetVersionId: z.ZodNullable<z.ZodCustom<`ver_${string}`, `ver_${string}`>>;
49
+ createdAt: z.ZodString;
50
+ updatedAt: z.ZodString;
51
+ }, z.core.$strip>;
52
+ operation: z.ZodNullable<z.ZodObject<{
53
+ id: z.ZodString;
54
+ kind: z.ZodString;
55
+ status: z.ZodEnum<{
56
+ failed: "failed";
57
+ canceled: "canceled";
58
+ queued: "queued";
59
+ running: "running";
60
+ succeeded: "succeeded";
61
+ }>;
62
+ resources: z.ZodArray<z.ZodObject<{
63
+ type: z.ZodString;
64
+ id: z.ZodString;
65
+ }, z.core.$strip>>;
66
+ progress: z.ZodOptional<z.ZodObject<{
67
+ total: z.ZodNumber;
68
+ completed: z.ZodNumber;
69
+ failed: z.ZodNumber;
70
+ }, z.core.$strip>>;
71
+ diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
72
+ code: z.ZodString;
73
+ severity: z.ZodEnum<{
74
+ info: "info";
75
+ error: "error";
76
+ warning: "warning";
77
+ }>;
78
+ message: z.ZodString;
79
+ path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
80
+ provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
81
+ registrar: "registrar";
82
+ wpcloud: "wpcloud";
83
+ dns: "dns";
84
+ runtime: "runtime";
85
+ }>>>;
86
+ details: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
87
+ fix: z.ZodOptional<z.ZodNullable<z.ZodString>>;
88
+ retryable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
89
+ }, z.core.$strip>>>;
90
+ createdAt: z.ZodString;
91
+ finishedAt: z.ZodOptional<z.ZodString>;
92
+ }, z.core.$strip>>;
93
+ }, z.core.$strip>;
94
+ export declare const spaceMountDeleteResponseSchema: z.ZodObject<{
95
+ data: z.ZodObject<{
96
+ id: z.ZodCustom<`mnt_${string}`, `mnt_${string}`>;
97
+ deleted: z.ZodLiteral<true>;
98
+ }, z.core.$strip>;
99
+ operation: z.ZodNullable<z.ZodObject<{
100
+ id: z.ZodString;
101
+ kind: z.ZodString;
102
+ status: z.ZodEnum<{
103
+ failed: "failed";
104
+ canceled: "canceled";
105
+ queued: "queued";
106
+ running: "running";
107
+ succeeded: "succeeded";
108
+ }>;
109
+ resources: z.ZodArray<z.ZodObject<{
110
+ type: z.ZodString;
111
+ id: z.ZodString;
112
+ }, z.core.$strip>>;
113
+ progress: z.ZodOptional<z.ZodObject<{
114
+ total: z.ZodNumber;
115
+ completed: z.ZodNumber;
116
+ failed: z.ZodNumber;
117
+ }, z.core.$strip>>;
118
+ diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
119
+ code: z.ZodString;
120
+ severity: z.ZodEnum<{
121
+ info: "info";
122
+ error: "error";
123
+ warning: "warning";
124
+ }>;
125
+ message: z.ZodString;
126
+ path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
127
+ provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
128
+ registrar: "registrar";
129
+ wpcloud: "wpcloud";
130
+ dns: "dns";
131
+ runtime: "runtime";
132
+ }>>>;
133
+ details: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
134
+ fix: z.ZodOptional<z.ZodNullable<z.ZodString>>;
135
+ retryable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
136
+ }, z.core.$strip>>>;
137
+ createdAt: z.ZodString;
138
+ finishedAt: z.ZodOptional<z.ZodString>;
139
+ }, z.core.$strip>>;
140
+ }, z.core.$strip>;
141
+ export type SpaceMountCreate = z.infer<typeof spaceMountCreateSchema>;
142
+ export type SpaceMount = z.infer<typeof spaceMountSchema>;
@@ -0,0 +1,56 @@
1
+ import { z } from "zod";
2
+ import { dataEnvelope, mutationEnvelope } from "./common.js";
3
+ import { registeredIdSchema } from "./ids.js";
4
+ const RESERVED_MOUNT_PREFIXES = ["/__spacefast", "/__stattic", "/.well-known"];
5
+ export function normalizeMountPathPrefix(value) {
6
+ const trimmed = value.trim();
7
+ if (trimmed === "" || trimmed === "/")
8
+ return "/";
9
+ return `/${trimmed.replace(/^\/+|\/+$/g, "")}`;
10
+ }
11
+ export const mountPathPrefixSchema = z
12
+ .string()
13
+ .min(1)
14
+ .max(1024)
15
+ .transform(normalizeMountPathPrefix)
16
+ .refine((value) => value !== "/", "A mount path must be below the site root.")
17
+ .refine((value) => Array.from(value).every((character) => {
18
+ const codePoint = character.codePointAt(0) ?? 0;
19
+ return codePoint > 0x9f || (codePoint > 0x1f && codePoint !== 0x7f);
20
+ }), "Mount path is invalid.")
21
+ .refine((value) => !value.includes("\\") && !value.includes("//"), "Mount path is invalid.")
22
+ .refine((value) => !value
23
+ .split("/")
24
+ .filter(Boolean)
25
+ .some((segment) => segment === "." || segment === ".."), "Mount path is invalid.")
26
+ .refine((value) => !RESERVED_MOUNT_PREFIXES.some((reserved) => value === reserved || value.startsWith(`${reserved}/`)), "Mount path uses a Spacefast-reserved prefix.")
27
+ .describe("Normalized path prefix on the website, for example `/docs`.");
28
+ export const spaceMountCreateSchema = z.object({
29
+ sourceVersionId: registeredIdSchema("ver").describe("Immutable website version whose production activation enables this mount."),
30
+ pathPrefix: mountPathPrefixSchema,
31
+ targetSpaceId: registeredIdSchema("spc").describe("Explicitly authorized same-team space to mount."),
32
+ channel: z
33
+ .literal("live")
34
+ .default("live")
35
+ .describe("Target production channel followed by this mount."),
36
+ });
37
+ export const spaceMountSchema = z.object({
38
+ id: registeredIdSchema("mnt"),
39
+ spaceId: registeredIdSchema("spc"),
40
+ sourceVersionId: registeredIdSchema("ver"),
41
+ pathPrefix: mountPathPrefixSchema,
42
+ targetSpaceId: registeredIdSchema("spc"),
43
+ targetSpaceSlug: z.string(),
44
+ channel: z.literal("live"),
45
+ versionId: registeredIdSchema("ver")
46
+ .nullable()
47
+ .describe("Immutable target version currently serving from the mount."),
48
+ targetVersionId: registeredIdSchema("ver")
49
+ .nullable()
50
+ .describe("Target production-channel version the durable synchronizer is converging toward."),
51
+ createdAt: z.string().datetime(),
52
+ updatedAt: z.string().datetime(),
53
+ });
54
+ export const spaceMountListResponseSchema = dataEnvelope(z.array(spaceMountSchema));
55
+ export const spaceMountResponseSchema = mutationEnvelope(spaceMountSchema);
56
+ export const spaceMountDeleteResponseSchema = mutationEnvelope(z.object({ id: registeredIdSchema("mnt"), deleted: z.literal(true) }));
@@ -3,22 +3,22 @@ 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", "spaces:read", "spaces:write", "publish:write", "domains:read", "domains:write"];
6
+ export declare const OAUTH_API_RESOURCE_SCOPES: readonly ["teams:read", "teams:create", "spaces:read", "spaces:write", "publish:write", "domains:read", "domains:write"];
7
7
  export declare const OAUTH_MCP_TOOL_SCOPE: "mcp:tools";
8
- export declare const OAUTH_MCP_RESOURCE_SCOPES: readonly ["mcp:tools", "teams:read", "spaces:read", "spaces:write", "publish:write", "domains:read", "domains:write"];
9
- export declare const OAUTH_PROVIDER_SCOPES: readonly ["openid", "profile", "email", "offline_access", "teams:read", "spaces:read", "spaces:write", "publish:write", "domains:read", "domains:write", "mcp:tools"];
8
+ export declare const OAUTH_MCP_RESOURCE_SCOPES: readonly ["mcp:tools", "teams:read", "teams:create", "spaces:read", "spaces:write", "publish:write", "domains:read", "domains:write"];
9
+ export declare const OAUTH_PROVIDER_SCOPES: readonly ["openid", "profile", "email", "offline_access", "teams:read", "teams:create", "spaces:read", "spaces:write", "publish:write", "domains:read", "domains:write", "mcp:tools"];
10
10
  export declare const OAUTH_RESOURCE_DEFINITIONS: {
11
11
  readonly api: {
12
12
  readonly key: "api";
13
13
  readonly name: "Spacefast API";
14
14
  readonly accessTokenTtlSeconds: number;
15
- readonly allowedScopes: readonly ["teams:read", "spaces:read", "spaces:write", "publish:write", "domains:read", "domains:write"];
15
+ readonly allowedScopes: readonly ["teams:read", "teams:create", "spaces:read", "spaces:write", "publish:write", "domains:read", "domains:write"];
16
16
  };
17
17
  readonly mcp: {
18
18
  readonly key: "mcp";
19
19
  readonly name: "Spacefast MCP";
20
20
  readonly accessTokenTtlSeconds: number;
21
- readonly allowedScopes: readonly ["mcp:tools", "teams:read", "spaces:read", "spaces:write", "publish:write", "domains:read", "domains:write"];
21
+ readonly allowedScopes: readonly ["mcp:tools", "teams:read", "teams:create", "spaces:read", "spaces:write", "publish:write", "domains:read", "domains:write"];
22
22
  };
23
23
  };
24
24
  /** Resource identifier for the public API: `https://api.<domain>/v1`. */
@@ -4,6 +4,7 @@ export const OAUTH_AUTHORIZATION_SERVER_PATH = "/v1/auth";
4
4
  export const OAUTH_API_RESOURCE_PATH = "/v1";
5
5
  export const OAUTH_API_RESOURCE_SCOPES = [
6
6
  "teams:read",
7
+ "teams:create",
7
8
  "spaces:read",
8
9
  "spaces:write",
9
10
  "publish:write",
@@ -39,8 +39,8 @@ export declare const UserOperationSchema: z.ZodObject<{
39
39
  code: z.ZodString;
40
40
  severity: z.ZodEnum<{
41
41
  info: "info";
42
- warning: "warning";
43
42
  error: "error";
43
+ warning: "warning";
44
44
  }>;
45
45
  message: z.ZodString;
46
46
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -137,8 +137,8 @@ export declare const operationListResponseSchema: z.ZodObject<{
137
137
  code: z.ZodString;
138
138
  severity: z.ZodEnum<{
139
139
  info: "info";
140
- warning: "warning";
141
140
  error: "error";
141
+ warning: "warning";
142
142
  }>;
143
143
  message: z.ZodString;
144
144
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -41,12 +41,12 @@ export declare const platformPageIdSchema: z.ZodEnum<{
41
41
  "content-too-large": "content-too-large";
42
42
  }>;
43
43
  export type PlatformPageId = z.infer<typeof platformPageIdSchema>;
44
- export declare const PAGE_ELEMENTS: readonly ["sf-content", "sf-password-form", "sf-login", "sf-files", "sf-file", "sf-logo", "sf-name"];
44
+ export declare const PAGE_ELEMENTS: readonly ["sf-content", "sf-password-form", "sf-login", "sf-denial-context", "sf-page-path", "sf-page-title", "sf-page-summary", "sf-spacefast-branding", "sf-files", "sf-file", "sf-logo", "sf-name"];
45
45
  export type PageElement = (typeof PAGE_ELEMENTS)[number];
46
46
  export type PageDefinition = {
47
47
  id: SitePageId;
48
48
  status: 200 | 401 | 403 | 404;
49
- cacheControl: "public, max-age=0, must-revalidate" | "private, no-store";
49
+ cacheControl: "public, max-age=0, s-maxage=60, must-revalidate" | "private, no-store";
50
50
  noindex: boolean;
51
51
  customTemplate: boolean;
52
52
  };
@@ -23,6 +23,11 @@ export const PAGE_ELEMENTS = [
23
23
  "sf-content",
24
24
  "sf-password-form",
25
25
  "sf-login",
26
+ "sf-denial-context",
27
+ "sf-page-path",
28
+ "sf-page-title",
29
+ "sf-page-summary",
30
+ "sf-spacefast-branding",
26
31
  "sf-files",
27
32
  "sf-file",
28
33
  "sf-logo",
@@ -32,7 +37,7 @@ export const PAGE_CATALOG = {
32
37
  "404": {
33
38
  id: "404",
34
39
  status: 404,
35
- cacheControl: "public, max-age=0, must-revalidate",
40
+ cacheControl: "public, max-age=0, s-maxage=60, must-revalidate",
36
41
  noindex: false,
37
42
  customTemplate: true,
38
43
  },
@@ -60,14 +65,14 @@ export const PAGE_CATALOG = {
60
65
  index: {
61
66
  id: "index",
62
67
  status: 200,
63
- cacheControl: "public, max-age=0, must-revalidate",
68
+ cacheControl: "public, max-age=0, s-maxage=60, must-revalidate",
64
69
  noindex: false,
65
70
  customTemplate: true,
66
71
  },
67
72
  preview: {
68
73
  id: "preview",
69
74
  status: 200,
70
- cacheControl: "public, max-age=0, must-revalidate",
75
+ cacheControl: "public, max-age=0, s-maxage=60, must-revalidate",
71
76
  noindex: false,
72
77
  customTemplate: true,
73
78
  },
@@ -60,8 +60,8 @@ export declare const PlanPolicyResponseSchema: z.ZodObject<{
60
60
  warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
61
61
  severity: z.ZodEnum<{
62
62
  info: "info";
63
- warning: "warning";
64
63
  error: "error";
64
+ warning: "warning";
65
65
  }>;
66
66
  code: z.ZodString;
67
67
  message: z.ZodString;
@@ -56,8 +56,8 @@ export declare const accessLogListResponseSchema: z.ZodObject<{
56
56
  code: z.ZodString;
57
57
  severity: z.ZodEnum<{
58
58
  info: "info";
59
- warning: "warning";
60
59
  error: "error";
60
+ warning: "warning";
61
61
  }>;
62
62
  message: z.ZodString;
63
63
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -90,8 +90,8 @@ export declare const runtimeLogListResponseSchema: z.ZodObject<{
90
90
  code: z.ZodString;
91
91
  severity: z.ZodEnum<{
92
92
  info: "info";
93
- warning: "warning";
94
93
  error: "error";
94
+ warning: "warning";
95
95
  }>;
96
96
  message: z.ZodString;
97
97
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -161,8 +161,8 @@ export declare const analyticsResponseSchema: z.ZodObject<{
161
161
  code: z.ZodString;
162
162
  severity: z.ZodEnum<{
163
163
  info: "info";
164
- warning: "warning";
165
164
  error: "error";
165
+ warning: "warning";
166
166
  }>;
167
167
  message: z.ZodString;
168
168
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -3,8 +3,8 @@ export declare const DiagnosticSchema: z.ZodObject<{
3
3
  code: z.ZodString;
4
4
  severity: z.ZodEnum<{
5
5
  info: "info";
6
- warning: "warning";
7
6
  error: "error";
7
+ warning: "warning";
8
8
  }>;
9
9
  message: z.ZodString;
10
10
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -30,11 +30,7 @@ export declare const PrincipalRefSchema: z.ZodObject<{
30
30
  principalId: z.ZodString;
31
31
  }, z.core.$strip>;
32
32
  export declare const ChannelPointerSchema: z.ZodObject<{
33
- versionId: z.ZodOptional<z.ZodString>;
34
- weighted: z.ZodOptional<z.ZodArray<z.ZodObject<{
35
- versionId: z.ZodString;
36
- percentage: z.ZodNumber;
37
- }, z.core.$strip>>>;
33
+ versionId: z.ZodString;
38
34
  updatedAt: z.ZodString;
39
35
  }, z.core.$strip>;
40
36
  export type ChannelPointer = z.infer<typeof ChannelPointerSchema>;
@@ -111,11 +107,7 @@ export declare const SpaceSchema: z.ZodObject<{
111
107
  }>;
112
108
  moving: z.ZodBoolean;
113
109
  channels: z.ZodRecord<z.ZodString, z.ZodObject<{
114
- versionId: z.ZodOptional<z.ZodString>;
115
- weighted: z.ZodOptional<z.ZodArray<z.ZodObject<{
116
- versionId: z.ZodString;
117
- percentage: z.ZodNumber;
118
- }, z.core.$strip>>>;
110
+ versionId: z.ZodString;
119
111
  updatedAt: z.ZodString;
120
112
  }, z.core.$strip>>;
121
113
  config: z.ZodNullable<z.ZodObject<{
@@ -182,7 +174,6 @@ export declare const SpaceSchema: z.ZodObject<{
182
174
  timeoutSeconds: z.ZodOptional<z.ZodNumber>;
183
175
  }, z.core.$strict>>;
184
176
  placement: z.ZodOptional<z.ZodObject<{
185
- region: z.ZodOptional<z.ZodString>;
186
177
  mode: z.ZodOptional<z.ZodEnum<{
187
178
  shared: "shared";
188
179
  dedicated: "dedicated";
@@ -212,6 +203,7 @@ export declare const SpaceSchema: z.ZodObject<{
212
203
  ipCidrs: z.ZodOptional<z.ZodArray<z.ZodString>>;
213
204
  agent: z.ZodOptional<z.ZodString>;
214
205
  country: z.ZodOptional<z.ZodString>;
206
+ countryNotIn: z.ZodOptional<z.ZodArray<z.ZodString>>;
215
207
  header: z.ZodOptional<z.ZodObject<{
216
208
  name: z.ZodString;
217
209
  value: z.ZodString;
@@ -286,8 +278,8 @@ export declare const SpaceSchema: z.ZodObject<{
286
278
  code: z.ZodString;
287
279
  severity: z.ZodEnum<{
288
280
  info: "info";
289
- warning: "warning";
290
281
  error: "error";
282
+ warning: "warning";
291
283
  }>;
292
284
  message: z.ZodString;
293
285
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -393,10 +385,7 @@ export declare const VersionSchema: z.ZodObject<{
393
385
  manifestHash: z.ZodNullable<z.ZodString>;
394
386
  buildId: z.ZodNullable<z.ZodString>;
395
387
  importedFromVersionId: z.ZodNullable<z.ZodString>;
396
- variables: z.ZodNullable<z.ZodArray<z.ZodObject<{
397
- name: z.ZodString;
398
- valueHash: z.ZodString;
399
- }, z.core.$strip>>>;
388
+ variables: z.ZodNull;
400
389
  fileCount: z.ZodNullable<z.ZodNumber>;
401
390
  totalBytes: z.ZodNullable<z.ZodNumber>;
402
391
  pendingUploads: z.ZodArray<z.ZodObject<{
@@ -407,6 +396,10 @@ export declare const VersionSchema: z.ZodObject<{
407
396
  }, z.core.$strip>>;
408
397
  skippedPaths: z.ZodArray<z.ZodString>;
409
398
  immutableUrl: z.ZodNullable<z.ZodString>;
399
+ immutableUrlStatus: z.ZodNullable<z.ZodEnum<{
400
+ ready: "ready";
401
+ converging: "converging";
402
+ }>>;
410
403
  isCurrentProduction: z.ZodBoolean;
411
404
  siteTitle: z.ZodString;
412
405
  config: z.ZodNullable<z.ZodObject<{
@@ -473,7 +466,6 @@ export declare const VersionSchema: z.ZodObject<{
473
466
  timeoutSeconds: z.ZodOptional<z.ZodNumber>;
474
467
  }, z.core.$strict>>;
475
468
  placement: z.ZodOptional<z.ZodObject<{
476
- region: z.ZodOptional<z.ZodString>;
477
469
  mode: z.ZodOptional<z.ZodEnum<{
478
470
  shared: "shared";
479
471
  dedicated: "dedicated";
@@ -512,8 +504,8 @@ export declare const VersionSchema: z.ZodObject<{
512
504
  code: z.ZodString;
513
505
  severity: z.ZodEnum<{
514
506
  info: "info";
515
- warning: "warning";
516
507
  error: "error";
508
+ warning: "warning";
517
509
  }>;
518
510
  message: z.ZodString;
519
511
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -539,8 +531,8 @@ export declare const VersionSchema: z.ZodObject<{
539
531
  code: z.ZodString;
540
532
  severity: z.ZodEnum<{
541
533
  info: "info";
542
- warning: "warning";
543
534
  error: "error";
535
+ warning: "warning";
544
536
  }>;
545
537
  message: z.ZodString;
546
538
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -14,40 +14,12 @@ export const PrincipalRefSchema = z.object({
14
14
  principalType: z.enum(["team", "external"]),
15
15
  principalId: z.string(),
16
16
  });
17
- // ChannelPointer (internal-docs/platform.md "ChannelPointer"): exactly one of
18
- // `versionId` | `weighted` is present; an empty pointer is invalid. Weighted
19
- // pointers (gradual rollouts) are a future write surface — the shape is final.
20
- export const ChannelPointerSchema = z
21
- .object({
22
- versionId: z.string().optional().describe("Version this channel serves."),
23
- weighted: z
24
- .array(z.object({
25
- versionId: z.string(),
26
- percentage: z.number().int().min(1).max(100),
27
- }))
28
- .min(2)
29
- .optional()
30
- .describe("Weighted rollout across >=2 ready versions; percentages sum to 100."),
17
+ // ChannelPointer (internal-docs/platform.md "ChannelPointer"): a channel names
18
+ // exactly one version. A channel with no version yet is absent from the map
19
+ // rather than present with an empty pointer.
20
+ export const ChannelPointerSchema = z.object({
21
+ versionId: z.string().describe("Version this channel serves."),
31
22
  updatedAt: z.string().datetime(),
32
- })
33
- .superRefine((value, ctx) => {
34
- const hasVersion = value.versionId !== undefined;
35
- const hasWeighted = value.weighted !== undefined;
36
- if (hasVersion === hasWeighted) {
37
- ctx.addIssue({
38
- code: z.ZodIssueCode.custom,
39
- message: "Exactly one of versionId or weighted must be present.",
40
- });
41
- return;
42
- }
43
- if (value.weighted &&
44
- value.weighted.reduce((sum, entry) => sum + entry.percentage, 0) !== 100) {
45
- ctx.addIssue({
46
- code: z.ZodIssueCode.custom,
47
- path: ["weighted"],
48
- message: "Weighted percentages must sum to 100.",
49
- });
50
- }
51
23
  });
52
24
  // The versioned-settings CAS token: always the lowercase hex sha256 the
53
25
  // control plane computes over canonical {config, title}. Shared by the Space
@@ -107,7 +79,7 @@ export const SpaceSchema = z.object({
107
79
  .describe("Server-selected dashboard thumbnail. Screenshots use WordPress.com mShots; image thumbnails use WordPress.com Site Accelerator."),
108
80
  dataLocation: z
109
81
  .string()
110
- .describe('Resolved data-location region. PATCH may queue a move to change it; "auto" only while no concrete region is known yet.'),
82
+ .describe('Resolved data-location region, fixed when the space is created and immutable afterwards; "auto" only while no concrete region is known yet.'),
111
83
  region: z
112
84
  .string()
113
85
  .describe('Alias of dataLocation for placement dashboards; "auto" only while no concrete region is known yet.'),
@@ -201,9 +173,9 @@ export const VersionSchema = z.object({
201
173
  buildId: z.string().nullable(),
202
174
  // Import provenance: the source version this one was materialized from.
203
175
  importedFromVersionId: z.string().nullable(),
204
- // Finalize-time variable resolution provenance names and value hashes only,
205
- // never values.
206
- variables: z.array(z.object({ name: z.string(), valueHash: z.string() })).nullable(),
176
+ // Finalize-time dependency digests remain server-internal: historical rows
177
+ // cannot distinguish hashes of sealed values safely.
178
+ variables: z.null().describe("Variable dependency provenance is not publicly exposed."),
207
179
  fileCount: z.number().int().nullable(),
208
180
  totalBytes: z.number().int().nullable(),
209
181
  pendingUploads: z.array(pendingUploadSchema),
@@ -212,6 +184,10 @@ export const VersionSchema = z.object({
212
184
  .string()
213
185
  .nullable()
214
186
  .describe("Permanent version URL (v{number}--{label}.view.fast form), computed once and stored at ready; survives slug changes, transfers, and channel repointing. Null before ready."),
187
+ immutableUrlStatus: z
188
+ .enum(["converging", "ready"])
189
+ .nullable()
190
+ .describe("Whether the immutable version URL provider alias has converged. converging means the URL may not resolve yet."),
215
191
  isCurrentProduction: z.boolean(),
216
192
  siteTitle: z.string(),
217
193
  config: spaceConfigSchema