@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
@@ -1,31 +1,9 @@
1
1
  import { z } from "zod";
2
2
  import { AnyObjectSchema, dataEnvelope } from "./common.js";
3
- export const HOSTED_MCP_SERVER_VERSION = "2026-08-22";
4
- export const HOSTED_MCP_TOOL_CATALOG = [
5
- {
6
- name: "execute",
7
- description: "Run JavaScript against the OpenAPI-generated Spacefast catalog in a secure sandbox.",
8
- },
9
- {
10
- name: "skills",
11
- description: "Fetch Spacefast how-to guidance for an MCP workflow.",
12
- },
13
- {
14
- name: "resume",
15
- description: "Resume an execution that paused for approval or input.",
16
- },
17
- {
18
- name: "publish",
19
- description: "Publish inline files as a new immutable Spacefast version.",
20
- },
21
- {
22
- name: "search_docs",
23
- description: "Search the published Spacefast documentation. An exact slug or path returns that page in full.",
24
- },
25
- ];
26
3
  export const hostedMcpSessionStatusSchema = z.enum(["active", "closed", "expired", "interrupted"]);
27
4
  export const hostedMcpSessionSchema = z.object({
28
5
  sessionId: z.string(),
6
+ closable: z.boolean(),
29
7
  clientId: z.string().nullable(),
30
8
  credentialId: z.string().nullable(),
31
9
  credentialKind: z.string().nullable(),
@@ -84,6 +62,7 @@ export const hostedMcpSessionEventsResponseSchema = dataEnvelope(z.object({
84
62
  events: z.array(hostedMcpSessionEventSchema),
85
63
  }));
86
64
  export const hostedMcpPausedExecutionSchema = z.object({
65
+ allowAlways: z.boolean(),
87
66
  text: z.string(),
88
67
  structured: z.unknown(),
89
68
  });
@@ -1,11 +1,12 @@
1
1
  import { z } from "zod";
2
- export declare const notificationKindValues: readonly ["comment.created", "comment.replied", "thread.archived", "thread.unarchived", "mention"];
2
+ export declare const notificationKindValues: readonly ["comment.created", "comment.replied", "thread.archived", "thread.unarchived", "mention", "approval.requested"];
3
3
  export declare const notificationKindSchema: z.ZodEnum<{
4
4
  "comment.created": "comment.created";
5
5
  "comment.replied": "comment.replied";
6
6
  "thread.archived": "thread.archived";
7
7
  "thread.unarchived": "thread.unarchived";
8
8
  mention: "mention";
9
+ "approval.requested": "approval.requested";
9
10
  }>;
10
11
  export declare const notificationSchema: z.ZodObject<{
11
12
  id: z.ZodString;
@@ -15,6 +16,7 @@ export declare const notificationSchema: z.ZodObject<{
15
16
  "thread.archived": "thread.archived";
16
17
  "thread.unarchived": "thread.unarchived";
17
18
  mention: "mention";
19
+ "approval.requested": "approval.requested";
18
20
  }>;
19
21
  teamId: z.ZodNullable<z.ZodString>;
20
22
  spaceId: z.ZodNullable<z.ZodString>;
@@ -46,6 +48,7 @@ export declare const notificationListResponseSchema: z.ZodObject<{
46
48
  "thread.archived": "thread.archived";
47
49
  "thread.unarchived": "thread.unarchived";
48
50
  mention: "mention";
51
+ "approval.requested": "approval.requested";
49
52
  }>;
50
53
  teamId: z.ZodNullable<z.ZodString>;
51
54
  spaceId: z.ZodNullable<z.ZodString>;
@@ -6,6 +6,7 @@ export const notificationKindValues = [
6
6
  "thread.archived",
7
7
  "thread.unarchived",
8
8
  "mention",
9
+ "approval.requested",
9
10
  ];
10
11
  export const notificationKindSchema = z.enum(notificationKindValues);
11
12
  export const notificationSchema = z.object({
@@ -3,10 +3,10 @@ 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_SHARED_API_RESOURCE_SCOPES: readonly ["teams:read", "teams:create", "spaces:read", "spaces:write", "spaces:rename", "publish:write", "domains:read", "domains:write"];
7
- 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"];
6
+ export declare const OAUTH_SHARED_API_RESOURCE_SCOPES: readonly ["teams:read", "teams:create", "teams:members.write", "spaces:read", "spaces:write", "spaces:rename", "spaces:delete", "versions:download", "publish:write", "domains:read", "domains:write", "connectors:read", "connectors:write", "connectors:execute"];
7
+ export declare const OAUTH_API_RESOURCE_SCOPES: readonly ["teams:read", "teams:create", "teams:members.write", "spaces:read", "spaces:write", "spaces:rename", "spaces:delete", "versions:download", "publish:write", "domains:read", "domains:write", "connectors:read", "connectors:write", "connectors:execute", "spaces:publish", "builds:trigger"];
8
8
  export declare const OAUTH_OFFLINE_ACCESS_SCOPE: "offline_access";
9
- export declare const OAUTH_MCP_RESOURCE_SCOPES: readonly ["teams:read", "teams:create", "spaces:read", "spaces:write", "spaces:rename", "publish:write", "domains:read", "domains:write"];
9
+ export declare const OAUTH_MCP_RESOURCE_SCOPES: readonly ["teams:read", "teams:create", "teams:members.write", "spaces:read", "spaces:write", "spaces:rename", "spaces:delete", "versions:download", "publish:write", "domains:read", "domains:write", "connectors:read", "connectors:write", "connectors:execute"];
10
10
  /**
11
11
  * A resource's `allowedScopes` is intersected with the requested scopes on every
12
12
  * token request, and the refresh token stores that intersection, so a resource
@@ -15,16 +15,17 @@ export declare const OAUTH_MCP_RESOURCE_SCOPES: readonly ["teams:read", "teams:c
15
15
  * `accessTokenTtlSeconds`. Kept separate from OAUTH_MCP_RESOURCE_SCOPES, which
16
16
  * is the list of capabilities the dashboard and CLI offer per machine OAuth client.
17
17
  */
18
- export declare const OAUTH_MCP_RESOURCE_ALLOWED_SCOPES: readonly ["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"];
18
+ export declare const OAUTH_MCP_RESOURCE_ALLOWED_SCOPES: readonly ["teams:read", "teams:create", "teams:members.write", "spaces:read", "spaces:write", "spaces:rename", "spaces:delete", "versions:download", "publish:write", "domains:read", "domains:write", "connectors:read", "connectors:write", "connectors:execute", "offline_access"];
19
+ export declare const OAUTH_AGENT_DEFAULT_SCOPES: ("teams:read" | "teams:create" | "teams:members.write" | "spaces:read" | "spaces:write" | "spaces:rename" | "versions:download" | "publish:write" | "domains:read" | "domains:write" | "connectors:read" | "connectors:write" | "connectors:execute")[];
20
+ export declare const OAUTH_API_RESOURCE_ALLOWED_SCOPES: readonly ["teams:read", "teams:create", "teams:members.write", "spaces:read", "spaces:write", "spaces:rename", "spaces:delete", "versions:download", "publish:write", "domains:read", "domains:write", "connectors:read", "connectors:write", "connectors:execute", "spaces:publish", "builds:trigger", "offline_access"];
20
21
  /**
21
22
  * Interactive MCP clients should be useful after one consent. Authorization is
22
23
  * still bounded by the user's live team role and by approval gates around
23
24
  * sensitive execution; these scopes only let the MCP resource represent those
24
25
  * capabilities. Machine clients may continue to request a narrower set.
25
26
  */
26
- export declare const OAUTH_MCP_DEFAULT_SCOPES: readonly ["teams:read", "teams:create", "spaces:read", "spaces:write", "spaces:rename", "publish:write", "domains:read", "domains:write", "offline_access"];
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"];
27
+ export declare const OAUTH_MCP_DEFAULT_SCOPES: readonly [...("teams:read" | "teams:create" | "teams:members.write" | "spaces:read" | "spaces:write" | "spaces:rename" | "versions:download" | "publish:write" | "domains:read" | "domains:write" | "connectors:read" | "connectors:write" | "connectors:execute")[], "offline_access"];
28
+ export declare const OAUTH_PROVIDER_SCOPES: readonly ["openid", "profile", "email", "offline_access", "teams:read", "teams:create", "teams:members.write", "spaces:read", "spaces:write", "spaces:rename", "spaces:delete", "versions:download", "publish:write", "domains:read", "domains:write", "connectors:read", "connectors:write", "connectors:execute", "spaces:publish", "builds:trigger"];
28
29
  export declare const OAUTH_SCOPE_DESCRIPTIONS: {
29
30
  readonly openid: "Identify the signed-in account.";
30
31
  readonly profile: "Read the signed-in account's basic profile.";
@@ -32,15 +33,30 @@ export declare const OAUTH_SCOPE_DESCRIPTIONS: {
32
33
  readonly offline_access: "Refresh access without another interactive sign-in.";
33
34
  readonly "teams:read": "Read the teams the account belongs to.";
34
35
  readonly "teams:create": "Create teams.";
36
+ readonly "teams:members.write": "Invite people to teams that the account can administer.";
35
37
  readonly "spaces:read": "Read spaces, versions, and build status.";
36
38
  readonly "spaces:write": "Create and update spaces and their settings.";
37
39
  readonly "spaces:rename": "Rename space slugs and managed addresses.";
40
+ readonly "spaces:delete": "Delete sites.";
41
+ readonly "versions:download": "Read files from deployment versions.";
38
42
  readonly "publish:write": "Publish new immutable versions.";
39
43
  readonly "spaces:publish": "Publish a version to an existing space.";
40
44
  readonly "builds:trigger": "Start a build for an existing version.";
41
45
  readonly "domains:read": "Read domain inventory and DNS diagnostics.";
42
46
  readonly "domains:write": "Attach, verify, and mutate domains and DNS records.";
47
+ readonly "connectors:read": "Read connected services, their tools, and what policy allows.";
48
+ readonly "connectors:write": "Connect and disconnect services, and set tool policy.";
49
+ readonly "connectors:execute": "Run tools on services this team connected — acts with real accounts, on real data.";
43
50
  };
51
+ /**
52
+ * Drop scope ids the vocabulary no longer knows (e.g. a removed scope that
53
+ * older grants still store). Safe and non-widening, same as the api-key
54
+ * action normalizer: a retired scope gates nothing anywhere, so the surviving
55
+ * scopes are the real grant — serving the retired id would present a
56
+ * permission that does not exist, and strict consumers of the provider
57
+ * vocabulary would reject the whole payload over it.
58
+ */
59
+ export declare function knownOAuthScopes(scopes: readonly string[]): OAuthScopeId[];
44
60
  export declare const OAUTH_SCOPE_RISK_TINTS: readonly ["neutral", "warning", "critical"];
45
61
  export type OAuthScopeRiskTint = (typeof OAUTH_SCOPE_RISK_TINTS)[number];
46
62
  export type OAuthScopeId = keyof typeof OAUTH_SCOPE_DESCRIPTIONS;
@@ -85,6 +101,11 @@ export declare const OAUTH_SCOPE_COPY: {
85
101
  readonly description: "Create teams.";
86
102
  readonly riskTint: "warning";
87
103
  };
104
+ readonly "teams:members.write": {
105
+ readonly label: "Invite team members";
106
+ readonly description: "Invite people to teams that the account can administer.";
107
+ readonly riskTint: "critical";
108
+ };
88
109
  readonly "spaces:read": {
89
110
  readonly label: "Read your sites";
90
111
  readonly description: "Read spaces, versions, and build status.";
@@ -100,6 +121,16 @@ export declare const OAUTH_SCOPE_COPY: {
100
121
  readonly description: "Rename space slugs and managed addresses.";
101
122
  readonly riskTint: "warning";
102
123
  };
124
+ readonly "spaces:delete": {
125
+ readonly label: "Delete your sites";
126
+ readonly description: "Delete sites.";
127
+ readonly riskTint: "critical";
128
+ };
129
+ readonly "versions:download": {
130
+ readonly label: "Read version files";
131
+ readonly description: "Read files from deployment versions.";
132
+ readonly riskTint: "neutral";
133
+ };
103
134
  readonly "publish:write": {
104
135
  readonly label: "Publish and manage versions";
105
136
  readonly description: "Publish new immutable versions.";
@@ -125,6 +156,21 @@ export declare const OAUTH_SCOPE_COPY: {
125
156
  readonly description: "Attach, verify, and mutate domains and DNS records.";
126
157
  readonly riskTint: "critical";
127
158
  };
159
+ readonly "connectors:read": {
160
+ readonly label: "See the services you connected";
161
+ readonly description: "Read connected services, their tools, and what policy allows.";
162
+ readonly riskTint: "neutral";
163
+ };
164
+ readonly "connectors:write": {
165
+ readonly label: "Connect and disconnect services";
166
+ readonly description: "Connect and disconnect services, and set tool policy.";
167
+ readonly riskTint: "warning";
168
+ };
169
+ readonly "connectors:execute": {
170
+ readonly label: "Act on your connected services";
171
+ readonly description: "Run tools on services this team connected — acts with real accounts, on real data.";
172
+ readonly riskTint: "critical";
173
+ };
128
174
  };
129
175
  export declare function oauthScopeCopy(scope: string): OAuthScopeCopy;
130
176
  export declare const OAUTH_RESOURCE_DEFINITIONS: {
@@ -132,13 +178,13 @@ export declare const OAUTH_RESOURCE_DEFINITIONS: {
132
178
  readonly key: "api";
133
179
  readonly name: "Spacefast API";
134
180
  readonly accessTokenTtlSeconds: number;
135
- 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"];
181
+ readonly allowedScopes: readonly ["teams:read", "teams:create", "teams:members.write", "spaces:read", "spaces:write", "spaces:rename", "spaces:delete", "versions:download", "publish:write", "domains:read", "domains:write", "connectors:read", "connectors:write", "connectors:execute", "spaces:publish", "builds:trigger", "offline_access"];
136
182
  };
137
183
  readonly mcp: {
138
184
  readonly key: "mcp";
139
185
  readonly name: "Spacefast MCP";
140
186
  readonly accessTokenTtlSeconds: number;
141
- readonly allowedScopes: readonly ["teams:read", "teams:create", "spaces:read", "spaces:write", "spaces:rename", "publish:write", "domains:read", "domains:write", "offline_access"];
187
+ readonly allowedScopes: readonly ["teams:read", "teams:create", "teams:members.write", "spaces:read", "spaces:write", "spaces:rename", "spaces:delete", "versions:download", "publish:write", "domains:read", "domains:write", "connectors:read", "connectors:write", "connectors:execute", "offline_access"];
142
188
  };
143
189
  };
144
190
  /** Resource identifier for the public API: `https://api.<domain>/v1`. */
@@ -10,12 +10,18 @@ export const OAUTH_API_RESOURCE_PATH = "/v1";
10
10
  export const OAUTH_SHARED_API_RESOURCE_SCOPES = [
11
11
  "teams:read",
12
12
  "teams:create",
13
+ "teams:members.write",
13
14
  "spaces:read",
14
15
  "spaces:write",
15
16
  "spaces:rename",
17
+ "spaces:delete",
18
+ "versions:download",
16
19
  "publish:write",
17
20
  "domains:read",
18
21
  "domains:write",
22
+ "connectors:read",
23
+ "connectors:write",
24
+ "connectors:execute",
19
25
  ];
20
26
  export const OAUTH_API_RESOURCE_SCOPES = [
21
27
  ...OAUTH_SHARED_API_RESOURCE_SCOPES,
@@ -39,6 +45,10 @@ export const OAUTH_MCP_RESOURCE_ALLOWED_SCOPES = [
39
45
  ...OAUTH_MCP_RESOURCE_SCOPES,
40
46
  OAUTH_OFFLINE_ACCESS_SCOPE,
41
47
  ];
48
+ // Interactive Agent access can request every MCP capability except destructive
49
+ // Space deletion. A person can add that scope explicitly or approve a temporary
50
+ // elevation when an agent asks to delete.
51
+ export const OAUTH_AGENT_DEFAULT_SCOPES = OAUTH_SHARED_API_RESOURCE_SCOPES.filter((scope) => scope !== "spaces:delete");
42
52
  export const OAUTH_API_RESOURCE_ALLOWED_SCOPES = [
43
53
  ...OAUTH_API_RESOURCE_SCOPES,
44
54
  OAUTH_OFFLINE_ACCESS_SCOPE,
@@ -49,7 +59,10 @@ export const OAUTH_API_RESOURCE_ALLOWED_SCOPES = [
49
59
  * sensitive execution; these scopes only let the MCP resource represent those
50
60
  * capabilities. Machine clients may continue to request a narrower set.
51
61
  */
52
- export const OAUTH_MCP_DEFAULT_SCOPES = OAUTH_MCP_RESOURCE_ALLOWED_SCOPES;
62
+ export const OAUTH_MCP_DEFAULT_SCOPES = [
63
+ ...OAUTH_AGENT_DEFAULT_SCOPES,
64
+ OAUTH_OFFLINE_ACCESS_SCOPE,
65
+ ];
53
66
  export const OAUTH_PROVIDER_SCOPES = [
54
67
  "openid",
55
68
  "profile",
@@ -64,15 +77,35 @@ export const OAUTH_SCOPE_DESCRIPTIONS = {
64
77
  offline_access: "Refresh access without another interactive sign-in.",
65
78
  "teams:read": "Read the teams the account belongs to.",
66
79
  "teams:create": "Create teams.",
80
+ "teams:members.write": "Invite people to teams that the account can administer.",
67
81
  "spaces:read": "Read spaces, versions, and build status.",
68
82
  "spaces:write": "Create and update spaces and their settings.",
69
83
  "spaces:rename": "Rename space slugs and managed addresses.",
84
+ "spaces:delete": "Delete sites.",
85
+ "versions:download": "Read files from deployment versions.",
70
86
  "publish:write": "Publish new immutable versions.",
71
87
  "spaces:publish": "Publish a version to an existing space.",
72
88
  "builds:trigger": "Start a build for an existing version.",
73
89
  "domains:read": "Read domain inventory and DNS diagnostics.",
74
90
  "domains:write": "Attach, verify, and mutate domains and DNS records.",
91
+ "connectors:read": "Read connected services, their tools, and what policy allows.",
92
+ "connectors:write": "Connect and disconnect services, and set tool policy.",
93
+ "connectors:execute": "Run tools on services this team connected — acts with real accounts, on real data.",
75
94
  };
95
+ const OAUTH_PROVIDER_SCOPE_SET = new Set(OAUTH_PROVIDER_SCOPES);
96
+ /**
97
+ * Drop scope ids the vocabulary no longer knows (e.g. a removed scope that
98
+ * older grants still store). Safe and non-widening, same as the api-key
99
+ * action normalizer: a retired scope gates nothing anywhere, so the surviving
100
+ * scopes are the real grant — serving the retired id would present a
101
+ * permission that does not exist, and strict consumers of the provider
102
+ * vocabulary would reject the whole payload over it.
103
+ */
104
+ export function knownOAuthScopes(scopes) {
105
+ return [
106
+ ...new Set(scopes.filter((scope) => OAUTH_PROVIDER_SCOPE_SET.has(scope))),
107
+ ];
108
+ }
76
109
  export const OAUTH_SCOPE_RISK_TINTS = ["neutral", "warning", "critical"];
77
110
  /**
78
111
  * Human-facing permission copy shared by every authorization surface. Keep raw
@@ -110,6 +143,11 @@ export const OAUTH_SCOPE_COPY = {
110
143
  description: OAUTH_SCOPE_DESCRIPTIONS["teams:create"],
111
144
  riskTint: "warning",
112
145
  },
146
+ "teams:members.write": {
147
+ label: "Invite team members",
148
+ description: OAUTH_SCOPE_DESCRIPTIONS["teams:members.write"],
149
+ riskTint: "critical",
150
+ },
113
151
  "spaces:read": {
114
152
  label: "Read your sites",
115
153
  description: OAUTH_SCOPE_DESCRIPTIONS["spaces:read"],
@@ -125,6 +163,16 @@ export const OAUTH_SCOPE_COPY = {
125
163
  description: OAUTH_SCOPE_DESCRIPTIONS["spaces:rename"],
126
164
  riskTint: "warning",
127
165
  },
166
+ "spaces:delete": {
167
+ label: "Delete your sites",
168
+ description: OAUTH_SCOPE_DESCRIPTIONS["spaces:delete"],
169
+ riskTint: "critical",
170
+ },
171
+ "versions:download": {
172
+ label: "Read version files",
173
+ description: OAUTH_SCOPE_DESCRIPTIONS["versions:download"],
174
+ riskTint: "neutral",
175
+ },
128
176
  "publish:write": {
129
177
  label: "Publish and manage versions",
130
178
  description: OAUTH_SCOPE_DESCRIPTIONS["publish:write"],
@@ -150,6 +198,21 @@ export const OAUTH_SCOPE_COPY = {
150
198
  description: OAUTH_SCOPE_DESCRIPTIONS["domains:write"],
151
199
  riskTint: "critical",
152
200
  },
201
+ "connectors:read": {
202
+ label: "See the services you connected",
203
+ description: OAUTH_SCOPE_DESCRIPTIONS["connectors:read"],
204
+ riskTint: "neutral",
205
+ },
206
+ "connectors:write": {
207
+ label: "Connect and disconnect services",
208
+ description: OAUTH_SCOPE_DESCRIPTIONS["connectors:write"],
209
+ riskTint: "warning",
210
+ },
211
+ "connectors:execute": {
212
+ label: "Act on your connected services",
213
+ description: OAUTH_SCOPE_DESCRIPTIONS["connectors:execute"],
214
+ riskTint: "critical",
215
+ },
153
216
  };
154
217
  export function oauthScopeCopy(scope) {
155
218
  const match = Object.entries(OAUTH_SCOPE_COPY).find(([knownScope]) => knownScope === scope);
@@ -37,6 +37,10 @@ declare const OAUTH_SCOPE_GRAPH: {
37
37
  readonly covers: readonly [];
38
38
  readonly actions: readonly ["teams:create"];
39
39
  };
40
+ readonly "teams:members.write": {
41
+ readonly covers: readonly ["teams:read"];
42
+ readonly actions: readonly ["teams:members.write"];
43
+ };
40
44
  readonly "spaces:read": {
41
45
  readonly covers: readonly [];
42
46
  readonly actions: readonly ["spaces:read", "versions:read", "builds:read"];
@@ -49,9 +53,17 @@ declare const OAUTH_SCOPE_GRAPH: {
49
53
  readonly covers: readonly [];
50
54
  readonly actions: readonly ["spaces:rename"];
51
55
  };
56
+ readonly "spaces:delete": {
57
+ readonly covers: readonly [];
58
+ readonly actions: readonly ["spaces:delete"];
59
+ };
60
+ readonly "versions:download": {
61
+ readonly covers: readonly [];
62
+ readonly actions: readonly ["versions:download"];
63
+ };
52
64
  readonly "publish:write": {
53
- readonly covers: readonly ["spaces:read", "spaces:write"];
54
- readonly actions: readonly ["spaces:publish", "versions:promote", "versions:download", "builds:trigger", "builds:create"];
65
+ readonly covers: readonly ["spaces:read", "spaces:write", "versions:download"];
66
+ readonly actions: readonly ["spaces:publish", "versions:promote", "builds:trigger", "builds:create"];
55
67
  };
56
68
  readonly "domains:read": {
57
69
  readonly covers: readonly [];
@@ -61,6 +73,18 @@ declare const OAUTH_SCOPE_GRAPH: {
61
73
  readonly covers: readonly ["domains:read"];
62
74
  readonly actions: readonly ["domains:create", "domains:verify", "domains:assign", "domains:bind", "domains:delete", "domains:dns.write", "domains:purchase"];
63
75
  };
76
+ readonly "connectors:read": {
77
+ readonly covers: readonly [];
78
+ readonly actions: readonly ["connectors:read"];
79
+ };
80
+ readonly "connectors:write": {
81
+ readonly covers: readonly ["connectors:read"];
82
+ readonly actions: readonly ["connectors:write"];
83
+ };
84
+ readonly "connectors:execute": {
85
+ readonly covers: readonly ["connectors:read"];
86
+ readonly actions: readonly ["connectors:execute"];
87
+ };
64
88
  readonly "spaces:publish": {
65
89
  readonly covers: readonly [];
66
90
  readonly actions: readonly ["spaces:publish"];
@@ -77,7 +101,7 @@ export declare function oauthScopeHasActions(scope: string): scope is OAuthScope
77
101
  * dashboard and CLI offer per machine OAuth client. Derived from the graph's
78
102
  * own order so the label list reads the way the consent screen does.
79
103
  */
80
- export declare const OAUTH_PRIMARY_SCOPES: ("teams:read" | "teams:create" | "spaces:read" | "spaces:write" | "spaces:rename" | "publish:write" | "domains:read" | "domains:write" | "spaces:publish" | "builds:trigger")[];
104
+ export declare const OAUTH_PRIMARY_SCOPES: ("teams:read" | "teams:create" | "teams:members.write" | "spaces:read" | "spaces:write" | "spaces:rename" | "spaces:delete" | "versions:download" | "publish:write" | "domains:read" | "domains:write" | "connectors:read" | "connectors:write" | "connectors:execute" | "spaces:publish" | "builds:trigger")[];
81
105
  /** Every action a scope grants, including the scopes it subsumes. */
82
106
  export declare function oauthScopeActionsFor(scope: OAuthScopeWithActions): StatticAction[];
83
107
  /** Every action a set of scopes grants together. Unknown scopes grant nothing. */
@@ -37,26 +37,23 @@ export function isTenantAdmissionAction(action) {
37
37
  const OAUTH_SCOPE_GRAPH = {
38
38
  "teams:read": { covers: [], actions: ["teams:read"] },
39
39
  "teams:create": { covers: [], actions: ["teams:create"] },
40
+ "teams:members.write": { covers: ["teams:read"], actions: ["teams:members.write"] },
40
41
  "spaces:read": {
41
42
  covers: [],
42
43
  actions: ["spaces:read", "versions:read", "builds:read"],
43
44
  },
44
45
  "spaces:write": { covers: [], actions: ["spaces:create", "spaces:write"] },
45
46
  "spaces:rename": { covers: [], actions: ["spaces:rename"] },
47
+ "spaces:delete": { covers: [], actions: ["spaces:delete"] },
48
+ "versions:download": { covers: [], actions: ["versions:download"] },
46
49
  // The publish tier is read + write plus the version and build verbs a
47
50
  // publish flow needs. `spaces:publish` and `builds:trigger` are also offered
48
51
  // on their own as granular API-resource scopes; they stay listed here as
49
52
  // publish's own actions so a policy holding nothing but them still labels as
50
53
  // a publisher.
51
54
  "publish:write": {
52
- covers: ["spaces:read", "spaces:write"],
53
- actions: [
54
- "spaces:publish",
55
- "versions:promote",
56
- "versions:download",
57
- "builds:trigger",
58
- "builds:create",
59
- ],
55
+ covers: ["spaces:read", "spaces:write", "versions:download"],
56
+ actions: ["spaces:publish", "versions:promote", "builds:trigger", "builds:create"],
60
57
  },
61
58
  "domains:read": { covers: [], actions: ["domains:read"] },
62
59
  "domains:write": {
@@ -71,6 +68,19 @@ const OAUTH_SCOPE_GRAPH = {
71
68
  "domains:purchase",
72
69
  ],
73
70
  },
71
+ // Connectors. `write` and `execute` both cover `read` but not each other:
72
+ // wiring a service up and acting through it are different authorities, and an
73
+ // agent that only has to call a tool never earns the right to connect a new
74
+ // account.
75
+ "connectors:read": { covers: [], actions: ["connectors:read"] },
76
+ "connectors:write": {
77
+ covers: ["connectors:read"],
78
+ actions: ["connectors:write"],
79
+ },
80
+ "connectors:execute": {
81
+ covers: ["connectors:read"],
82
+ actions: ["connectors:execute"],
83
+ },
74
84
  // Granular API-resource scopes. They never label a policy on their own — the
75
85
  // inverse only ranges over the primary scopes below.
76
86
  "spaces:publish": { covers: [], actions: ["spaces:publish"] },
@@ -171,8 +171,8 @@ export declare const superadminOperationListQuerySchema: z.ZodObject<{
171
171
  ready: "ready";
172
172
  running: "running";
173
173
  succeeded: "succeeded";
174
- scheduled: "scheduled";
175
174
  blocked: "blocked";
175
+ scheduled: "scheduled";
176
176
  stuck: "stuck";
177
177
  retrying: "retrying";
178
178
  }>>;