@spacefast/common 0.0.5 → 0.0.7

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 (183) hide show
  1. package/brand-assets/spacefast-favicon.svg +16 -0
  2. package/brand-assets/spacefast-sf-full-bleed.svg +13 -0
  3. package/brand-assets/spacefast-wordmark.svg +5 -0
  4. package/dist/agents/connect-targets.d.ts +138 -0
  5. package/dist/agents/connect-targets.js +243 -0
  6. package/dist/brand-assets-build.d.ts +26 -0
  7. package/dist/brand-assets-build.js +81 -0
  8. package/dist/brand-assets.d.ts +42 -0
  9. package/dist/brand-assets.js +30 -0
  10. package/dist/brand.d.ts +1 -0
  11. package/dist/brand.js +5 -0
  12. package/dist/config/domains.d.ts +12 -6
  13. package/dist/config/domains.js +30 -38
  14. package/dist/contracts/access.d.ts +967 -124
  15. package/dist/contracts/access.js +804 -148
  16. package/dist/contracts/activity.d.ts +1 -1
  17. package/dist/contracts/activity.js +28 -2
  18. package/dist/contracts/annotations.d.ts +2 -4
  19. package/dist/contracts/api-keys.d.ts +126 -4
  20. package/dist/contracts/api-keys.js +74 -6
  21. package/dist/contracts/archives.d.ts +8 -2
  22. package/dist/contracts/archives.js +11 -4
  23. package/dist/contracts/billing.d.ts +0 -9
  24. package/dist/contracts/builds.d.ts +65 -21
  25. package/dist/contracts/builds.js +29 -0
  26. package/dist/contracts/common.d.ts +2 -0
  27. package/dist/contracts/common.js +4 -0
  28. package/dist/contracts/continuation.d.ts +0 -3
  29. package/dist/contracts/countries.d.ts +2 -0
  30. package/dist/contracts/countries.js +261 -0
  31. package/dist/contracts/deployments.d.ts +34 -34
  32. package/dist/contracts/device-auth.d.ts +4 -11
  33. package/dist/contracts/device-auth.js +4 -0
  34. package/dist/contracts/docs.d.ts +119 -0
  35. package/dist/contracts/docs.js +51 -0
  36. package/dist/contracts/domains.d.ts +96 -54
  37. package/dist/contracts/domains.js +26 -4
  38. package/dist/contracts/enums.d.ts +15 -16
  39. package/dist/contracts/enums.js +26 -14
  40. package/dist/contracts/error-code-meta.d.ts +184 -0
  41. package/dist/contracts/error-code-meta.js +124 -10
  42. package/dist/contracts/error-codes.d.ts +1 -1
  43. package/dist/contracts/error-codes.js +42 -0
  44. package/dist/contracts/events.d.ts +1 -1
  45. package/dist/contracts/feature-lifecycle-core.d.ts +36 -0
  46. package/dist/contracts/feature-lifecycle-core.js +220 -0
  47. package/dist/contracts/feature-lifecycle.d.ts +7 -0
  48. package/dist/contracts/feature-lifecycle.js +31 -0
  49. package/dist/contracts/features.d.ts +76 -6
  50. package/dist/contracts/features.js +178 -13
  51. package/dist/contracts/generated-feature-launch-entries.d.ts +2 -0
  52. package/dist/contracts/generated-feature-launch-entries.js +518 -0
  53. package/dist/contracts/git.d.ts +2 -8
  54. package/dist/contracts/ids.d.ts +9 -0
  55. package/dist/contracts/ids.js +13 -0
  56. package/dist/contracts/mcp.d.ts +8 -10
  57. package/dist/contracts/me.js +1 -1
  58. package/dist/contracts/oauth-resources.d.ts +19 -8
  59. package/dist/contracts/oauth-resources.js +44 -13
  60. package/dist/contracts/operations.d.ts +161 -1
  61. package/dist/contracts/operations.js +49 -1
  62. package/dist/contracts/platform.d.ts +6 -102
  63. package/dist/contracts/platform.js +6 -50
  64. package/dist/contracts/publishes.d.ts +130 -0
  65. package/dist/contracts/publishes.js +145 -0
  66. package/dist/contracts/push-new.d.ts +4 -4
  67. package/dist/contracts/quotas.d.ts +2 -0
  68. package/dist/contracts/quotas.js +8 -0
  69. package/dist/contracts/repository-connections.d.ts +9 -8
  70. package/dist/contracts/repository-connections.js +13 -0
  71. package/dist/contracts/resources.d.ts +99 -13
  72. package/dist/contracts/resources.js +36 -4
  73. package/dist/contracts/routes.d.ts +0 -2
  74. package/dist/contracts/runtime-api.d.ts +363 -39
  75. package/dist/contracts/runtime-api.js +276 -6
  76. package/dist/contracts/sf-config-v1.d.ts +75 -0
  77. package/dist/contracts/sf-config-v1.js +6 -0
  78. package/dist/contracts/sites.d.ts +19 -2
  79. package/dist/contracts/sites.js +21 -0
  80. package/dist/contracts/space-config.d.ts +201 -2
  81. package/dist/contracts/space-config.js +135 -5
  82. package/dist/contracts/spaces.d.ts +376 -196
  83. package/dist/contracts/spaces.js +62 -10
  84. package/dist/contracts/superadmin-emails.d.ts +4 -2
  85. package/dist/contracts/superadmin-emails.js +8 -0
  86. package/dist/contracts/superadmin-queues.d.ts +26 -26
  87. package/dist/contracts/superadmin-spaces.d.ts +172 -42
  88. package/dist/contracts/superadmin-tenants.d.ts +6 -6
  89. package/dist/contracts/superadmin-tenants.js +6 -11
  90. package/dist/contracts/superadmin.d.ts +6 -93
  91. package/dist/contracts/superadmin.js +6 -14
  92. package/dist/contracts/tags.d.ts +10 -9
  93. package/dist/contracts/tags.js +2 -1
  94. package/dist/contracts/teams.d.ts +26 -30
  95. package/dist/contracts/teams.js +11 -17
  96. package/dist/contracts/theme-json.d.ts +30 -0
  97. package/dist/contracts/theme-json.js +48 -0
  98. package/dist/contracts/variables.d.ts +0 -2
  99. package/dist/contracts/variables.js +0 -5
  100. package/dist/contracts/webhooks.d.ts +2 -0
  101. package/dist/contracts/webhooks.js +1 -1
  102. package/dist/contracts/zero.d.ts +5 -10
  103. package/dist/docs/agent-prose.d.ts +43 -3
  104. package/dist/docs/agent-prose.js +146 -7
  105. package/dist/docs/agent-setup.d.ts +51 -0
  106. package/dist/docs/agent-setup.js +211 -14
  107. package/dist/docs/agent-solutions.d.ts +5 -5
  108. package/dist/docs/agent-solutions.js +2 -2
  109. package/dist/docs/catalog.d.ts +650 -0
  110. package/dist/docs/catalog.js +758 -0
  111. package/dist/docs/error-docs.d.ts +0 -2
  112. package/dist/docs/error-docs.js +189 -35
  113. package/dist/docs/index-build.d.ts +17 -0
  114. package/dist/docs/index-build.js +24 -0
  115. package/dist/docs/search.d.ts +54 -0
  116. package/dist/docs/search.js +96 -0
  117. package/dist/docs/skill-distribution.d.ts +5 -3
  118. package/dist/docs/skill-distribution.js +8 -8
  119. package/dist/slug-policy/blocklist.d.ts +4 -0
  120. package/dist/slug-policy/blocklist.js +122 -0
  121. package/dist/slug-policy/index.d.ts +17 -0
  122. package/dist/slug-policy/index.js +86 -0
  123. package/dist/utils/access-match.d.ts +39 -0
  124. package/dist/utils/access-match.js +296 -0
  125. package/dist/utils/auth-redirect.d.ts +3 -1
  126. package/dist/utils/auth-redirect.js +21 -1
  127. package/dist/utils/build-settings.d.ts +6 -0
  128. package/dist/utils/build-settings.js +429 -46
  129. package/dist/utils/claim-token.d.ts +8 -0
  130. package/dist/utils/claim-token.js +23 -2
  131. package/dist/utils/concurrency.d.ts +1 -0
  132. package/dist/utils/concurrency.js +22 -0
  133. package/dist/utils/content-type.d.ts +1 -0
  134. package/dist/utils/content-type.js +1 -1
  135. package/dist/utils/credential-policy.d.ts +54 -0
  136. package/dist/utils/{access-policy.js → credential-policy.js} +28 -2
  137. package/dist/utils/email.d.ts +1 -0
  138. package/dist/utils/email.js +3 -0
  139. package/dist/utils/gate-theme.d.ts +61 -0
  140. package/dist/utils/gate-theme.js +217 -0
  141. package/dist/utils/git-repository.d.ts +0 -1
  142. package/dist/utils/git-repository.js +0 -3
  143. package/dist/utils/id-hints.d.ts +8 -0
  144. package/dist/utils/id-hints.js +61 -0
  145. package/dist/utils/local-space-state.d.ts +91 -0
  146. package/dist/utils/local-space-state.js +251 -0
  147. package/dist/utils/oauth-signed-query.d.ts +8 -0
  148. package/dist/utils/oauth-signed-query.js +26 -0
  149. package/dist/utils/publish-detection.d.ts +0 -8
  150. package/dist/utils/publish-detection.js +0 -93
  151. package/dist/utils/publish-policy.d.ts +6 -5
  152. package/dist/utils/publish-policy.js +71 -7
  153. package/dist/utils/query-keys.d.ts +16 -4
  154. package/dist/utils/query-keys.js +31 -4
  155. package/dist/utils/runtime-paths.d.ts +0 -1
  156. package/dist/utils/runtime-paths.js +0 -1
  157. package/dist/utils/runtime-upload-batch.d.ts +18 -0
  158. package/dist/utils/runtime-upload-batch.js +90 -0
  159. package/dist/utils/runtime-upload.d.ts +2 -0
  160. package/dist/utils/runtime-upload.js +5 -0
  161. package/dist/utils/sf-config-v1.d.ts +2 -0
  162. package/dist/utils/sf-config-v1.js +542 -0
  163. package/dist/utils/space-config.d.ts +4 -0
  164. package/dist/utils/space-config.js +10 -1
  165. package/dist/utils/space-theme.d.ts +2 -0
  166. package/dist/utils/space-theme.js +9 -0
  167. package/dist/utils/static-runtime-policy.d.ts +0 -21
  168. package/dist/utils/static-runtime-policy.js +19 -103
  169. package/dist/utils/upload-session.d.ts +1 -1
  170. package/dist/utils/wpcom-auth-redirects.d.ts +32 -2
  171. package/dist/utils/wpcom-auth-redirects.js +26 -10
  172. package/dist/vocabulary.d.ts +130 -30
  173. package/dist/vocabulary.js +77 -36
  174. package/package.json +35 -1
  175. package/dist/contracts/account.d.ts +0 -28
  176. package/dist/contracts/account.js +0 -54
  177. package/dist/contracts/intercom.d.ts +0 -6
  178. package/dist/contracts/intercom.js +0 -5
  179. package/dist/contracts/telemetry.d.ts +0 -2
  180. package/dist/contracts/telemetry.js +0 -1
  181. package/dist/utils/access-policy.d.ts +0 -39
  182. package/dist/utils/error-display.d.ts +0 -7
  183. package/dist/utils/error-display.js +0 -42
@@ -51,8 +51,8 @@ export declare const hostedMcpApprovalSchema: z.ZodObject<{
51
51
  status: z.ZodEnum<{
52
52
  expired: "expired";
53
53
  pending: "pending";
54
- denied: "denied";
55
54
  approved: "approved";
55
+ denied: "denied";
56
56
  consumed: "consumed";
57
57
  }>;
58
58
  decision: z.ZodNullable<z.ZodEnum<{
@@ -167,8 +167,8 @@ export declare const hostedMcpExecutionRunSchema: z.ZodObject<{
167
167
  export declare const hostedMcpToolPolicySchema: z.ZodObject<{
168
168
  tool: z.ZodString;
169
169
  runtime: z.ZodEnum<{
170
- hosted: "hosted";
171
170
  "on-device": "on-device";
171
+ hosted: "hosted";
172
172
  both: "both";
173
173
  }>;
174
174
  category: z.ZodString;
@@ -191,8 +191,8 @@ export declare const hostedMcpPolicyDefaultsSchema: z.ZodObject<{
191
191
  toolPolicies: z.ZodArray<z.ZodObject<{
192
192
  tool: z.ZodString;
193
193
  runtime: z.ZodEnum<{
194
- hosted: "hosted";
195
194
  "on-device": "on-device";
195
+ hosted: "hosted";
196
196
  both: "both";
197
197
  }>;
198
198
  category: z.ZodString;
@@ -257,8 +257,8 @@ export declare const hostedMcpDashboardSchema: z.ZodObject<{
257
257
  toolPolicies: z.ZodArray<z.ZodObject<{
258
258
  tool: z.ZodString;
259
259
  runtime: z.ZodEnum<{
260
- hosted: "hosted";
261
260
  "on-device": "on-device";
261
+ hosted: "hosted";
262
262
  both: "both";
263
263
  }>;
264
264
  category: z.ZodString;
@@ -314,8 +314,8 @@ export declare const hostedMcpDashboardSchema: z.ZodObject<{
314
314
  status: z.ZodEnum<{
315
315
  expired: "expired";
316
316
  pending: "pending";
317
- denied: "denied";
318
317
  approved: "approved";
318
+ denied: "denied";
319
319
  consumed: "consumed";
320
320
  }>;
321
321
  decision: z.ZodNullable<z.ZodEnum<{
@@ -422,8 +422,8 @@ export declare const hostedMcpDashboardResponseSchema: z.ZodObject<{
422
422
  toolPolicies: z.ZodArray<z.ZodObject<{
423
423
  tool: z.ZodString;
424
424
  runtime: z.ZodEnum<{
425
- hosted: "hosted";
426
425
  "on-device": "on-device";
426
+ hosted: "hosted";
427
427
  both: "both";
428
428
  }>;
429
429
  category: z.ZodString;
@@ -479,8 +479,8 @@ export declare const hostedMcpDashboardResponseSchema: z.ZodObject<{
479
479
  status: z.ZodEnum<{
480
480
  expired: "expired";
481
481
  pending: "pending";
482
- denied: "denied";
483
482
  approved: "approved";
483
+ denied: "denied";
484
484
  consumed: "consumed";
485
485
  }>;
486
486
  decision: z.ZodNullable<z.ZodEnum<{
@@ -608,8 +608,8 @@ export declare const hostedMcpApprovalResponseSchema: z.ZodObject<{
608
608
  status: z.ZodEnum<{
609
609
  expired: "expired";
610
610
  pending: "pending";
611
- denied: "denied";
612
611
  approved: "approved";
612
+ denied: "denied";
613
613
  consumed: "consumed";
614
614
  }>;
615
615
  decision: z.ZodNullable<z.ZodEnum<{
@@ -776,9 +776,7 @@ export declare const hostedMcpExecutionRunResponseSchema: z.ZodObject<{
776
776
  }, z.core.$strip>;
777
777
  }, z.core.$strip>;
778
778
  export type HostedMcpSession = z.infer<typeof hostedMcpSessionSchema>;
779
- export type HostedMcpWorkspaceSummary = z.infer<typeof hostedMcpWorkspaceSummarySchema>;
780
779
  export type HostedMcpApproval = z.infer<typeof hostedMcpApprovalSchema>;
781
- export type HostedMcpApprovalDecisionRequest = z.infer<typeof hostedMcpApprovalDecisionRequestSchema>;
782
780
  export type HostedMcpSessionEvent = z.infer<typeof hostedMcpSessionEventSchema>;
783
781
  export type HostedMcpExecutionRun = z.infer<typeof hostedMcpExecutionRunSchema>;
784
782
  export type HostedMcpExecutionStep = z.infer<typeof hostedMcpExecutionStepSchema>;
@@ -97,7 +97,7 @@ export const meResponseSchema = z.object({
97
97
  slug: z.string().nullable().describe("Team slug."),
98
98
  source: betaEligibleTeamSourceSchema,
99
99
  }))
100
- .describe("Teams the user may join via the picker (pending invitation or auto-enroll match)."),
100
+ .describe("Teams the user may join via the picker (pending invitation, auto-enroll match, or Automattician access)."),
101
101
  })
102
102
  .describe("Private-beta state. Dashboards key the blocked screen on gateEnabled && !enrolled, " +
103
103
  "never on !enrolled alone — else launch-day flag-off would still block people."),
@@ -1,9 +1,8 @@
1
1
  export declare const OAUTH_AUTHORIZATION_SERVER_PATH: "/v1/auth";
2
- export declare const OAUTH_RESOURCE_PATHS: {
3
- readonly api: "/v1";
4
- readonly mcp: "/mcp";
5
- };
6
- export type OAuthResourceKey = keyof typeof OAUTH_RESOURCE_PATHS;
2
+ /** The API resource is a path on the api origin; the MCP resource is the whole
3
+ * mcp origin (`https://mcp.<domain>`), so it has no path entry here. */
4
+ export declare const OAUTH_API_RESOURCE_PATH: "/v1";
5
+ export type OAuthResourceKey = "api" | "mcp";
7
6
  export declare const OAUTH_API_RESOURCE_SCOPES: readonly ["teams:read", "spaces:read", "spaces:write", "publish:write", "domains:read", "domains:write"];
8
7
  export declare const OAUTH_MCP_TOOL_SCOPE: "mcp:tools";
9
8
  export declare const OAUTH_MCP_RESOURCE_SCOPES: readonly ["mcp:tools", "teams:read", "spaces:read", "spaces:write", "publish:write", "domains:read", "domains:write"];
@@ -11,20 +10,32 @@ export declare const OAUTH_PROVIDER_SCOPES: readonly ["openid", "profile", "emai
11
10
  export declare const OAUTH_RESOURCE_DEFINITIONS: {
12
11
  readonly api: {
13
12
  readonly key: "api";
14
- readonly path: "/v1";
15
13
  readonly name: "Spacefast API";
16
14
  readonly accessTokenTtlSeconds: number;
17
15
  readonly allowedScopes: readonly ["teams:read", "spaces:read", "spaces:write", "publish:write", "domains:read", "domains:write"];
18
16
  };
19
17
  readonly mcp: {
20
18
  readonly key: "mcp";
21
- readonly path: "/mcp";
22
19
  readonly name: "Spacefast MCP";
23
20
  readonly accessTokenTtlSeconds: number;
24
21
  readonly allowedScopes: readonly ["mcp:tools", "teams:read", "spaces:read", "spaces:write", "publish:write", "domains:read", "domains:write"];
25
22
  };
26
23
  };
27
- export declare function oauthResourceUrl(origin: string | URL, resource: OAuthResourceKey): string;
24
+ /** Resource identifier for the public API: `https://api.<domain>/v1`. */
25
+ export declare function oauthApiResourceUrl(apiOrigin: string | URL): string;
26
+ /**
27
+ * Resource identifier for hosted MCP: the mcp origin itself, in RFC 8707
28
+ * canonical form (lowercase scheme/host, no trailing slash) — this is the
29
+ * exact string MCP clients send as the `resource` parameter.
30
+ */
31
+ export declare function oauthMcpResourceUrl(mcpOrigin: string | URL): string;
32
+ export declare function normalizeOAuthResourceIdentifier(resource: string): string;
33
+ /**
34
+ * Derive the mcp origin from a configured api origin (`api.X` → `mcp.X`).
35
+ * Returns null when the api host doesn't follow the `api.` convention
36
+ * (loopback dev, docker test hosts) — callers fall back to the api origin.
37
+ */
38
+ export declare function oauthMcpOriginFromApiOrigin(apiOrigin: string | URL): string | null;
28
39
  export declare function oauthAuthorizationServerUrl(origin: string | URL): string;
29
40
  export declare function oauthTokenEndpointUrl(origin: string | URL): string;
30
41
  export declare function oauthResourceKeyForPathname(pathname: string): OAuthResourceKey | null;
@@ -1,8 +1,7 @@
1
1
  export const OAUTH_AUTHORIZATION_SERVER_PATH = "/v1/auth";
2
- export const OAUTH_RESOURCE_PATHS = {
3
- api: "/v1",
4
- mcp: "/mcp",
5
- };
2
+ /** The API resource is a path on the api origin; the MCP resource is the whole
3
+ * mcp origin (`https://mcp.<domain>`), so it has no path entry here. */
4
+ export const OAUTH_API_RESOURCE_PATH = "/v1";
6
5
  export const OAUTH_API_RESOURCE_SCOPES = [
7
6
  "teams:read",
8
7
  "spaces:read",
@@ -27,21 +26,56 @@ export const OAUTH_PROVIDER_SCOPES = [
27
26
  export const OAUTH_RESOURCE_DEFINITIONS = {
28
27
  api: {
29
28
  key: "api",
30
- path: OAUTH_RESOURCE_PATHS.api,
31
29
  name: "Spacefast API",
32
30
  accessTokenTtlSeconds: 15 * 60,
33
31
  allowedScopes: OAUTH_API_RESOURCE_SCOPES,
34
32
  },
35
33
  mcp: {
36
34
  key: "mcp",
37
- path: OAUTH_RESOURCE_PATHS.mcp,
38
35
  name: "Spacefast MCP",
39
36
  accessTokenTtlSeconds: 15 * 60,
40
37
  allowedScopes: OAUTH_MCP_RESOURCE_SCOPES,
41
38
  },
42
39
  };
43
- export function oauthResourceUrl(origin, resource) {
44
- return new URL(OAUTH_RESOURCE_PATHS[resource], origin).toString();
40
+ /** Resource identifier for the public API: `https://api.<domain>/v1`. */
41
+ export function oauthApiResourceUrl(apiOrigin) {
42
+ return new URL(OAUTH_API_RESOURCE_PATH, apiOrigin).toString();
43
+ }
44
+ /**
45
+ * Resource identifier for hosted MCP: the mcp origin itself, in RFC 8707
46
+ * canonical form (lowercase scheme/host, no trailing slash) — this is the
47
+ * exact string MCP clients send as the `resource` parameter.
48
+ */
49
+ export function oauthMcpResourceUrl(mcpOrigin) {
50
+ return new URL(mcpOrigin).origin;
51
+ }
52
+ export function normalizeOAuthResourceIdentifier(resource) {
53
+ const trimmed = resource.trim();
54
+ if (!trimmed) {
55
+ return trimmed;
56
+ }
57
+ const url = new URL(trimmed);
58
+ if (!url.search && !url.hash && url.pathname === "/") {
59
+ return url.origin;
60
+ }
61
+ if (!url.search && !url.hash && url.pathname === `${OAUTH_API_RESOURCE_PATH}/`) {
62
+ url.pathname = OAUTH_API_RESOURCE_PATH;
63
+ return url.toString();
64
+ }
65
+ return url.toString();
66
+ }
67
+ /**
68
+ * Derive the mcp origin from a configured api origin (`api.X` → `mcp.X`).
69
+ * Returns null when the api host doesn't follow the `api.` convention
70
+ * (loopback dev, docker test hosts) — callers fall back to the api origin.
71
+ */
72
+ export function oauthMcpOriginFromApiOrigin(apiOrigin) {
73
+ const url = new URL(apiOrigin);
74
+ if (!url.hostname.startsWith("api.")) {
75
+ return null;
76
+ }
77
+ url.hostname = `mcp.${url.hostname.slice("api.".length)}`;
78
+ return url.origin;
45
79
  }
46
80
  export function oauthAuthorizationServerUrl(origin) {
47
81
  return new URL(OAUTH_AUTHORIZATION_SERVER_PATH, origin).toString();
@@ -50,11 +84,8 @@ export function oauthTokenEndpointUrl(origin) {
50
84
  return new URL(`${OAUTH_AUTHORIZATION_SERVER_PATH}/oauth2/token`, origin).toString();
51
85
  }
52
86
  export function oauthResourceKeyForPathname(pathname) {
53
- if (pathname === OAUTH_RESOURCE_PATHS.mcp) {
54
- return "mcp";
55
- }
56
- if (pathname === OAUTH_RESOURCE_PATHS.api ||
57
- pathname.startsWith(`${OAUTH_RESOURCE_PATHS.api}/`)) {
87
+ if (pathname === OAUTH_API_RESOURCE_PATH ||
88
+ pathname.startsWith(`${OAUTH_API_RESOURCE_PATH}/`)) {
58
89
  return "api";
59
90
  }
60
91
  return null;
@@ -1,4 +1,114 @@
1
1
  import { z } from "zod";
2
+ export declare const userOperationKindSchema: z.ZodEnum<{
3
+ approval: "approval";
4
+ version_finalize: "version_finalize";
5
+ version_promote_live: "version_promote_live";
6
+ version_delete: "version_delete";
7
+ build_start: "build_start";
8
+ domain_check: "domain_check";
9
+ domain_ssl_retry: "domain_ssl_retry";
10
+ domain_registration_submit: "domain_registration_submit";
11
+ domain_transfer_submit: "domain_transfer_submit";
12
+ domain_zone_publish: "domain_zone_publish";
13
+ domain_dns_apply: "domain_dns_apply";
14
+ domain_lifecycle: "domain_lifecycle";
15
+ variable_cascade: "variable_cascade";
16
+ webhook_deliver: "webhook_deliver";
17
+ integration_release: "integration_release";
18
+ agent_run: "agent_run";
19
+ }>;
20
+ export type UserOperationKind = z.infer<typeof userOperationKindSchema>;
21
+ export declare const UserOperationSchema: z.ZodObject<{
22
+ id: z.ZodString;
23
+ status: z.ZodEnum<{
24
+ failed: "failed";
25
+ canceled: "canceled";
26
+ queued: "queued";
27
+ running: "running";
28
+ succeeded: "succeeded";
29
+ }>;
30
+ resources: z.ZodArray<z.ZodObject<{
31
+ type: z.ZodString;
32
+ id: z.ZodString;
33
+ }, z.core.$strip>>;
34
+ progress: z.ZodOptional<z.ZodObject<{
35
+ total: z.ZodNumber;
36
+ completed: z.ZodNumber;
37
+ failed: z.ZodNumber;
38
+ }, z.core.$strip>>;
39
+ diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
40
+ code: z.ZodString;
41
+ severity: z.ZodEnum<{
42
+ info: "info";
43
+ warning: "warning";
44
+ error: "error";
45
+ }>;
46
+ message: z.ZodString;
47
+ path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
48
+ provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
49
+ registrar: "registrar";
50
+ wpcloud: "wpcloud";
51
+ dns: "dns";
52
+ runtime: "runtime";
53
+ }>>>;
54
+ details: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
55
+ fix: z.ZodOptional<z.ZodNullable<z.ZodString>>;
56
+ retryable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
57
+ }, z.core.$strip>>>;
58
+ createdAt: z.ZodString;
59
+ finishedAt: z.ZodOptional<z.ZodString>;
60
+ kind: z.ZodEnum<{
61
+ approval: "approval";
62
+ version_finalize: "version_finalize";
63
+ version_promote_live: "version_promote_live";
64
+ version_delete: "version_delete";
65
+ build_start: "build_start";
66
+ domain_check: "domain_check";
67
+ domain_ssl_retry: "domain_ssl_retry";
68
+ domain_registration_submit: "domain_registration_submit";
69
+ domain_transfer_submit: "domain_transfer_submit";
70
+ domain_zone_publish: "domain_zone_publish";
71
+ domain_dns_apply: "domain_dns_apply";
72
+ domain_lifecycle: "domain_lifecycle";
73
+ variable_cascade: "variable_cascade";
74
+ webhook_deliver: "webhook_deliver";
75
+ integration_release: "integration_release";
76
+ agent_run: "agent_run";
77
+ }>;
78
+ versionSource: z.ZodOptional<z.ZodEnum<{
79
+ direct_upload: "direct_upload";
80
+ git: "git";
81
+ settings: "settings";
82
+ }>>;
83
+ integrationRelease: z.ZodOptional<z.ZodObject<{
84
+ environment: z.ZodEnum<{
85
+ production: "production";
86
+ preview: "preview";
87
+ development: "development";
88
+ }>;
89
+ }, z.core.$strip>>;
90
+ agentRun: z.ZodOptional<z.ZodObject<{
91
+ state: z.ZodEnum<{
92
+ failed: "failed";
93
+ completed: "completed";
94
+ canceled: "canceled";
95
+ queued: "queued";
96
+ running: "running";
97
+ approval_required: "approval_required";
98
+ }>;
99
+ tool: z.ZodString;
100
+ mode: z.ZodOptional<z.ZodString>;
101
+ }, z.core.$strip>>;
102
+ approval: z.ZodOptional<z.ZodObject<{
103
+ decision: z.ZodNullable<z.ZodEnum<{
104
+ deny: "deny";
105
+ approve: "approve";
106
+ }>>;
107
+ decidedAt: z.ZodNullable<z.ZodString>;
108
+ expiresAt: z.ZodString;
109
+ consumedAt: z.ZodNullable<z.ZodString>;
110
+ }, z.core.$strip>>;
111
+ }, z.core.$strip>;
2
112
  export declare const operationListQuerySchema: z.ZodObject<{
3
113
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
4
114
  cursor: z.ZodOptional<z.ZodString>;
@@ -8,7 +118,6 @@ export declare const operationListQuerySchema: z.ZodObject<{
8
118
  export declare const operationListResponseSchema: z.ZodObject<{
9
119
  data: z.ZodArray<z.ZodObject<{
10
120
  id: z.ZodString;
11
- kind: z.ZodString;
12
121
  status: z.ZodEnum<{
13
122
  failed: "failed";
14
123
  canceled: "canceled";
@@ -46,6 +155,57 @@ export declare const operationListResponseSchema: z.ZodObject<{
46
155
  }, z.core.$strip>>>;
47
156
  createdAt: z.ZodString;
48
157
  finishedAt: z.ZodOptional<z.ZodString>;
158
+ kind: z.ZodEnum<{
159
+ approval: "approval";
160
+ version_finalize: "version_finalize";
161
+ version_promote_live: "version_promote_live";
162
+ version_delete: "version_delete";
163
+ build_start: "build_start";
164
+ domain_check: "domain_check";
165
+ domain_ssl_retry: "domain_ssl_retry";
166
+ domain_registration_submit: "domain_registration_submit";
167
+ domain_transfer_submit: "domain_transfer_submit";
168
+ domain_zone_publish: "domain_zone_publish";
169
+ domain_dns_apply: "domain_dns_apply";
170
+ domain_lifecycle: "domain_lifecycle";
171
+ variable_cascade: "variable_cascade";
172
+ webhook_deliver: "webhook_deliver";
173
+ integration_release: "integration_release";
174
+ agent_run: "agent_run";
175
+ }>;
176
+ versionSource: z.ZodOptional<z.ZodEnum<{
177
+ direct_upload: "direct_upload";
178
+ git: "git";
179
+ settings: "settings";
180
+ }>>;
181
+ integrationRelease: z.ZodOptional<z.ZodObject<{
182
+ environment: z.ZodEnum<{
183
+ production: "production";
184
+ preview: "preview";
185
+ development: "development";
186
+ }>;
187
+ }, z.core.$strip>>;
188
+ agentRun: z.ZodOptional<z.ZodObject<{
189
+ state: z.ZodEnum<{
190
+ failed: "failed";
191
+ completed: "completed";
192
+ canceled: "canceled";
193
+ queued: "queued";
194
+ running: "running";
195
+ approval_required: "approval_required";
196
+ }>;
197
+ tool: z.ZodString;
198
+ mode: z.ZodOptional<z.ZodString>;
199
+ }, z.core.$strip>>;
200
+ approval: z.ZodOptional<z.ZodObject<{
201
+ decision: z.ZodNullable<z.ZodEnum<{
202
+ deny: "deny";
203
+ approve: "approve";
204
+ }>>;
205
+ decidedAt: z.ZodNullable<z.ZodString>;
206
+ expiresAt: z.ZodString;
207
+ consumedAt: z.ZodNullable<z.ZodString>;
208
+ }, z.core.$strip>>;
49
209
  }, z.core.$strip>>;
50
210
  pagination: z.ZodObject<{
51
211
  nextCursor: z.ZodNullable<z.ZodString>;
@@ -1,5 +1,53 @@
1
1
  import { z } from "zod";
2
2
  import { AsyncOperationSchema, CursorPaginationSchema, cursorListQuerySchema } from "./common.js";
3
+ export const userOperationKindSchema = z.enum([
4
+ "version_finalize",
5
+ "version_promote_live",
6
+ "version_delete",
7
+ "build_start",
8
+ "domain_check",
9
+ "domain_ssl_retry",
10
+ "domain_registration_submit",
11
+ "domain_transfer_submit",
12
+ "domain_zone_publish",
13
+ "domain_dns_apply",
14
+ "domain_lifecycle",
15
+ "variable_cascade",
16
+ "webhook_deliver",
17
+ "integration_release",
18
+ "agent_run",
19
+ "approval",
20
+ ]);
21
+ export const UserOperationSchema = AsyncOperationSchema.extend({
22
+ kind: userOperationKindSchema,
23
+ versionSource: z
24
+ .enum(["direct_upload", "git", "settings"])
25
+ .optional()
26
+ .describe("Version provenance for version operations; settings marks a settings publish, while direct_upload and git mark content publishes. Omitted for legacy rows."),
27
+ integrationRelease: z
28
+ .object({
29
+ environment: z.enum(["production", "preview", "development"]),
30
+ })
31
+ .optional()
32
+ .describe("Release environment for an integration tag pointer flip."),
33
+ agentRun: z
34
+ .object({
35
+ state: z.enum(["queued", "running", "approval_required", "completed", "failed", "canceled"]),
36
+ tool: z.string(),
37
+ mode: z.string().optional(),
38
+ })
39
+ .optional()
40
+ .describe("Authoritative agent execution state and the tool invocation that produced it."),
41
+ approval: z
42
+ .object({
43
+ decision: z.enum(["approve", "deny"]).nullable(),
44
+ decidedAt: z.string().datetime().nullable(),
45
+ expiresAt: z.string().datetime(),
46
+ consumedAt: z.string().datetime().nullable(),
47
+ })
48
+ .optional()
49
+ .describe("Current approval decision and lifecycle timestamps from the approval authority."),
50
+ });
3
51
  export const operationListQuerySchema = cursorListQuerySchema.extend({
4
52
  resourceType: z
5
53
  .string()
@@ -9,6 +57,6 @@ export const operationListQuerySchema = cursorListQuerySchema.extend({
9
57
  resourceId: z.string().min(1).optional().describe("Filter to operations touching one resource."),
10
58
  });
11
59
  export const operationListResponseSchema = z.object({
12
- data: z.array(AsyncOperationSchema),
60
+ data: z.array(UserOperationSchema),
13
61
  pagination: CursorPaginationSchema,
14
62
  });
@@ -12,101 +12,6 @@ export declare const domainPurchaseContactSchema: z.ZodObject<{
12
12
  email: z.ZodString;
13
13
  phone: z.ZodString;
14
14
  }, z.core.$strip>;
15
- export declare const domainContactUpdateSchema: z.ZodObject<{
16
- firstName: z.ZodOptional<z.ZodString>;
17
- lastName: z.ZodOptional<z.ZodString>;
18
- organization: z.ZodOptional<z.ZodOptional<z.ZodString>>;
19
- address1: z.ZodOptional<z.ZodString>;
20
- address2: z.ZodOptional<z.ZodOptional<z.ZodString>>;
21
- city: z.ZodOptional<z.ZodString>;
22
- state: z.ZodOptional<z.ZodString>;
23
- postalCode: z.ZodOptional<z.ZodString>;
24
- countryCode: z.ZodOptional<z.ZodString>;
25
- email: z.ZodOptional<z.ZodString>;
26
- phone: z.ZodOptional<z.ZodString>;
27
- }, z.core.$strip>;
28
- export declare const domainRegistrationUpdateSchema: z.ZodObject<{
29
- autoRenew: z.ZodOptional<z.ZodBoolean>;
30
- privacySetting: z.ZodOptional<z.ZodEnum<{
31
- enable_privacy_service: "enable_privacy_service";
32
- redact_contact_info: "redact_contact_info";
33
- disclose_contact_info: "disclose_contact_info";
34
- }>>;
35
- contactId: z.ZodOptional<z.ZodString>;
36
- }, z.core.$strip>;
37
- export declare const domainPurchaseSchema: z.ZodObject<{
38
- domain: z.ZodString;
39
- contact: z.ZodObject<{
40
- firstName: z.ZodString;
41
- lastName: z.ZodString;
42
- organization: z.ZodOptional<z.ZodString>;
43
- address1: z.ZodString;
44
- address2: z.ZodOptional<z.ZodString>;
45
- city: z.ZodString;
46
- state: z.ZodString;
47
- postalCode: z.ZodString;
48
- countryCode: z.ZodString;
49
- email: z.ZodString;
50
- phone: z.ZodString;
51
- }, z.core.$strip>;
52
- period: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
53
- privacySetting: z.ZodDefault<z.ZodEnum<{
54
- enable_privacy_service: "enable_privacy_service";
55
- redact_contact_info: "redact_contact_info";
56
- disclose_contact_info: "disclose_contact_info";
57
- }>>;
58
- expectedFeeAmount: z.ZodCoercedNumber<unknown>;
59
- }, z.core.$strip>;
60
- export declare const domainPurchaseCheckoutSchema: z.ZodObject<{
61
- domain: z.ZodString;
62
- contact: z.ZodObject<{
63
- firstName: z.ZodString;
64
- lastName: z.ZodString;
65
- organization: z.ZodOptional<z.ZodString>;
66
- address1: z.ZodString;
67
- address2: z.ZodOptional<z.ZodString>;
68
- city: z.ZodString;
69
- state: z.ZodString;
70
- postalCode: z.ZodString;
71
- countryCode: z.ZodString;
72
- email: z.ZodString;
73
- phone: z.ZodString;
74
- }, z.core.$strip>;
75
- period: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
76
- privacySetting: z.ZodDefault<z.ZodEnum<{
77
- enable_privacy_service: "enable_privacy_service";
78
- redact_contact_info: "redact_contact_info";
79
- disclose_contact_info: "disclose_contact_info";
80
- }>>;
81
- expectedFeeAmount: z.ZodCoercedNumber<unknown>;
82
- successUrl: z.ZodString;
83
- cancelUrl: z.ZodString;
84
- }, z.core.$strip>;
85
- export declare const domainTransferSchema: z.ZodObject<{
86
- domain: z.ZodString;
87
- authCode: z.ZodString;
88
- contact: z.ZodObject<{
89
- firstName: z.ZodString;
90
- lastName: z.ZodString;
91
- organization: z.ZodOptional<z.ZodString>;
92
- address1: z.ZodString;
93
- address2: z.ZodOptional<z.ZodString>;
94
- city: z.ZodString;
95
- state: z.ZodString;
96
- postalCode: z.ZodString;
97
- countryCode: z.ZodString;
98
- email: z.ZodString;
99
- phone: z.ZodString;
100
- }, z.core.$strip>;
101
- }, z.core.$strip>;
102
- export declare const domainEmailForwardSchema: z.ZodObject<{
103
- mailbox: z.ZodString;
104
- destination: z.ZodString;
105
- }, z.core.$strip>;
106
- export declare const domainEmailForwardUpdateSchema: z.ZodObject<{
107
- mailbox: z.ZodOptional<z.ZodString>;
108
- destination: z.ZodOptional<z.ZodString>;
109
- }, z.core.$strip>;
110
15
  export declare const logWindowQuerySchema: z.ZodObject<{
111
16
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
112
17
  cursor: z.ZodOptional<z.ZodString>;
@@ -326,6 +231,12 @@ export declare const runtimeCertificateMutationResponseSchema: z.ZodObject<{
326
231
  }, z.core.$strip>>;
327
232
  raw: z.ZodRecord<z.ZodString, z.ZodUnknown>;
328
233
  }, z.core.$strip>;
234
+ export declare const runtimeCertificateValidationResponseSchema: z.ZodObject<{
235
+ valid: z.ZodBoolean;
236
+ errors: z.ZodArray<z.ZodString>;
237
+ warnings: z.ZodArray<z.ZodString>;
238
+ validations: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>;
239
+ }, z.core.$strip>;
329
240
  export declare const runtimeCertificateActivateSchema: z.ZodObject<{
330
241
  domains: z.ZodOptional<z.ZodArray<z.ZodString>>;
331
242
  }, z.core.$strip>;
@@ -350,10 +261,3 @@ export declare const runtimeSslActionResponseSchema: z.ZodObject<{
350
261
  domain: z.ZodString;
351
262
  raw: z.ZodRecord<z.ZodString, z.ZodUnknown>;
352
263
  }, z.core.$strip>;
353
- export declare const runtimeProviderRawResponseSchema: z.ZodObject<{
354
- ok: z.ZodLiteral<true>;
355
- message: z.ZodNullable<z.ZodString>;
356
- jobId: z.ZodNullable<z.ZodNumber>;
357
- responseTicketId: z.ZodNullable<z.ZodString>;
358
- raw: z.ZodRecord<z.ZodString, z.ZodUnknown>;
359
- }, z.core.$strip>;
@@ -1,6 +1,5 @@
1
1
  import { z } from "zod";
2
2
  import { CursorPaginationSchema, baseDiagnosticSchema, cursorListQuerySchema } from "./common.js";
3
- const atLeastOneKey = (value) => Object.keys(value).length > 0;
4
3
  export const domainPurchaseContactSchema = z.object({
5
4
  firstName: z.string().trim().min(1).max(80),
6
5
  lastName: z.string().trim().min(1).max(80),
@@ -14,48 +13,6 @@ export const domainPurchaseContactSchema = z.object({
14
13
  email: z.string().trim().email().max(190),
15
14
  phone: z.string().trim().min(7).max(32),
16
15
  });
17
- export const domainContactUpdateSchema = domainPurchaseContactSchema
18
- .partial()
19
- .refine(atLeastOneKey, "At least one contact field must be provided.");
20
- export const domainRegistrationUpdateSchema = z
21
- .object({
22
- autoRenew: z.boolean().optional(),
23
- privacySetting: z
24
- .enum(["enable_privacy_service", "redact_contact_info", "disclose_contact_info"])
25
- .optional(),
26
- contactId: z.string().trim().min(1).optional(),
27
- })
28
- .refine(atLeastOneKey, "At least one registration field must be provided.");
29
- export const domainPurchaseSchema = z.object({
30
- domain: z.string().trim().min(3).max(253),
31
- contact: domainPurchaseContactSchema,
32
- period: z.coerce.number().int().min(1).max(10).default(1),
33
- privacySetting: z
34
- .enum(["enable_privacy_service", "redact_contact_info", "disclose_contact_info"])
35
- .default("enable_privacy_service"),
36
- expectedFeeAmount: z.coerce.number().int().positive(),
37
- });
38
- export const domainPurchaseCheckoutSchema = domainPurchaseSchema.extend({
39
- successUrl: z.string().url(),
40
- cancelUrl: z.string().url(),
41
- });
42
- export const domainTransferSchema = z.object({
43
- domain: z.string().trim().min(3).max(253),
44
- authCode: z.string().trim().min(4).max(255),
45
- contact: domainPurchaseContactSchema,
46
- });
47
- export const domainEmailForwardSchema = z.object({
48
- mailbox: z
49
- .string()
50
- .trim()
51
- .min(1)
52
- .max(64)
53
- .regex(/^[A-Za-z0-9._%+-]+$/),
54
- destination: z.string().trim().email().max(190),
55
- });
56
- export const domainEmailForwardUpdateSchema = domainEmailForwardSchema
57
- .partial()
58
- .refine(atLeastOneKey, "At least one email forwarding field must be provided.");
59
16
  export const logWindowQuerySchema = cursorListQuerySchema.extend({
60
17
  since: z.string().datetime().optional().describe("Start of the log window."),
61
18
  until: z.string().datetime().optional().describe("End of the log window."),
@@ -184,6 +141,12 @@ export const runtimeCertificateMutationResponseSchema = z.object({
184
141
  certificate: runtimeCertificateSchema.nullable(),
185
142
  raw: z.record(z.string(), z.unknown()),
186
143
  });
144
+ export const runtimeCertificateValidationResponseSchema = z.object({
145
+ valid: z.boolean(),
146
+ errors: z.array(z.string()),
147
+ warnings: z.array(z.string()),
148
+ validations: z.record(z.string(), z.record(z.string(), z.unknown())),
149
+ });
187
150
  export const runtimeCertificateActivateSchema = z.object({
188
151
  domains: z.array(z.string()).optional(),
189
152
  });
@@ -207,10 +170,3 @@ export const runtimeSslActionResponseSchema = z.object({
207
170
  domain: z.string().min(1),
208
171
  raw: z.record(z.string(), z.unknown()),
209
172
  });
210
- export const runtimeProviderRawResponseSchema = z.object({
211
- ok: z.literal(true),
212
- message: z.string().nullable(),
213
- jobId: z.number().int().nullable(),
214
- responseTicketId: z.string().nullable(),
215
- raw: z.record(z.string(), z.unknown()),
216
- });