@spacefast/common 0.0.13 → 0.0.18

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 (154) hide show
  1. package/dist/agents/client-registry.d.ts +22 -0
  2. package/dist/agents/client-registry.js +41 -0
  3. package/dist/agents/connect-targets.d.ts +51 -6
  4. package/dist/agents/connect-targets.js +93 -28
  5. package/dist/brand.d.ts +0 -11
  6. package/dist/brand.js +0 -20
  7. package/dist/config/domains.d.ts +15 -6
  8. package/dist/config/domains.js +24 -10
  9. package/dist/config/postgres-budget.d.ts +3 -0
  10. package/dist/config/postgres-budget.js +6 -1
  11. package/dist/config/postgres-budget.json +2 -1
  12. package/dist/contracts/abuse.js +1 -1
  13. package/dist/contracts/access.d.ts +149 -44
  14. package/dist/contracts/access.js +94 -8
  15. package/dist/contracts/activity.js +5 -1
  16. package/dist/contracts/api-keys.js +9 -9
  17. package/dist/contracts/archives.js +11 -11
  18. package/dist/contracts/beta.js +1 -1
  19. package/dist/contracts/builds.js +14 -14
  20. package/dist/contracts/channels.js +2 -2
  21. package/dist/contracts/comments.d.ts +86 -15
  22. package/dist/contracts/comments.js +116 -20
  23. package/dist/contracts/common.d.ts +12 -12
  24. package/dist/contracts/common.js +33 -30
  25. package/dist/contracts/continuation.js +5 -5
  26. package/dist/contracts/data-source-routes.js +1 -1
  27. package/dist/contracts/device-auth.d.ts +6 -6
  28. package/dist/contracts/device-auth.js +12 -12
  29. package/dist/contracts/docs.d.ts +10 -10
  30. package/dist/contracts/domains.js +39 -33
  31. package/dist/contracts/enums.d.ts +2 -10
  32. package/dist/contracts/enums.js +0 -2
  33. package/dist/contracts/error-code-meta.d.ts +116 -47
  34. package/dist/contracts/error-code-meta.js +37 -16
  35. package/dist/contracts/error-codes.d.ts +7 -4
  36. package/dist/contracts/error-codes.js +46 -21
  37. package/dist/contracts/events.d.ts +10 -3
  38. package/dist/contracts/events.js +33 -5
  39. package/dist/contracts/execution.d.ts +26 -0
  40. package/dist/contracts/execution.js +21 -0
  41. package/dist/contracts/feature-lifecycle.d.ts +21 -24
  42. package/dist/contracts/feature-lifecycle.js +28 -26
  43. package/dist/contracts/features.js +4 -4
  44. package/dist/contracts/functions.d.ts +8 -140
  45. package/dist/contracts/functions.js +9 -19
  46. package/dist/contracts/git.d.ts +1 -1
  47. package/dist/contracts/grants.d.ts +96 -79
  48. package/dist/contracts/grants.js +130 -43
  49. package/dist/contracts/ids.d.ts +2 -2
  50. package/dist/contracts/ids.js +2 -4
  51. package/dist/contracts/internal.js +2 -2
  52. package/dist/contracts/mcp.d.ts +17 -556
  53. package/dist/contracts/mcp.js +9 -103
  54. package/dist/contracts/me.js +3 -4
  55. package/dist/contracts/notifications.d.ts +108 -0
  56. package/dist/contracts/notifications.js +54 -0
  57. package/dist/contracts/oauth-resources.d.ts +18 -1
  58. package/dist/contracts/oauth-resources.js +22 -2
  59. package/dist/contracts/operations.d.ts +2 -50
  60. package/dist/contracts/operations.js +0 -19
  61. package/dist/contracts/pages.d.ts +8 -4
  62. package/dist/contracts/pages.js +16 -3
  63. package/dist/contracts/platform.js +10 -8
  64. package/dist/contracts/problem-document.d.ts +14 -0
  65. package/dist/contracts/problem-document.js +35 -0
  66. package/dist/contracts/push-new.d.ts +21 -6
  67. package/dist/contracts/push-new.js +3 -7
  68. package/dist/contracts/resources.d.ts +8 -7
  69. package/dist/contracts/resources.js +9 -6
  70. package/dist/contracts/runtime-api.d.ts +162 -92
  71. package/dist/contracts/runtime-api.js +99 -27
  72. package/dist/contracts/runtime-app.d.ts +41 -11
  73. package/dist/contracts/runtime-app.js +22 -1
  74. package/dist/contracts/runtime-db.d.ts +424 -0
  75. package/dist/contracts/runtime-db.js +108 -0
  76. package/dist/contracts/runtime-storage.d.ts +120 -0
  77. package/dist/contracts/runtime-storage.js +40 -0
  78. package/dist/contracts/sf-config-v1.d.ts +49 -1
  79. package/dist/contracts/sf-config-v1.js +2 -2
  80. package/dist/contracts/sites.d.ts +1 -0
  81. package/dist/contracts/sites.js +20 -12
  82. package/dist/contracts/space-config.d.ts +62 -22
  83. package/dist/contracts/space-config.js +173 -47
  84. package/dist/contracts/spaces.d.ts +79 -45
  85. package/dist/contracts/spaces.js +66 -50
  86. package/dist/contracts/superadmin-spaces.d.ts +13 -2
  87. package/dist/contracts/superadmin-spaces.js +15 -0
  88. package/dist/contracts/superadmin-tenants.js +4 -4
  89. package/dist/contracts/superadmin.d.ts +4 -0
  90. package/dist/contracts/superadmin.js +14 -1
  91. package/dist/contracts/tags.d.ts +17 -17
  92. package/dist/contracts/tags.js +1 -1
  93. package/dist/contracts/teams.js +25 -16
  94. package/dist/contracts/theme-json.js +1 -1
  95. package/dist/contracts/transfers.js +4 -4
  96. package/dist/contracts/variables.js +3 -3
  97. package/dist/contracts/zero.d.ts +204 -338
  98. package/dist/contracts/zero.js +94 -98
  99. package/dist/dashboard-paths/index.d.ts +16 -1
  100. package/dist/dashboard-paths/index.js +18 -0
  101. package/dist/docs/agent-handoff-document.d.ts +2 -2
  102. package/dist/docs/agent-handoff-document.js +8 -7
  103. package/dist/docs/agent-prose.d.ts +22 -3
  104. package/dist/docs/agent-prose.js +221 -51
  105. package/dist/docs/agent-setup.d.ts +13 -10
  106. package/dist/docs/agent-setup.js +279 -53
  107. package/dist/docs/agent-solutions.d.ts +6 -6
  108. package/dist/docs/agent-solutions.js +23 -21
  109. package/dist/docs/catalog.d.ts +29 -74
  110. package/dist/docs/catalog.js +65 -92
  111. package/dist/docs/error-docs.js +293 -221
  112. package/dist/docs/skill-distribution.d.ts +2 -0
  113. package/dist/docs/skill-distribution.js +7 -4
  114. package/dist/docs/skills.d.ts +546 -0
  115. package/dist/docs/skills.js +340 -0
  116. package/dist/utils/browser-credential.d.ts +19 -0
  117. package/dist/utils/browser-credential.js +62 -0
  118. package/dist/utils/comment-avatars.d.ts +7 -0
  119. package/dist/utils/comment-avatars.js +42 -0
  120. package/dist/utils/content-type.d.ts +3 -3
  121. package/dist/utils/content-type.js +38 -61
  122. package/dist/utils/domain-diagnostics.d.ts +5 -5
  123. package/dist/utils/domain-diagnostics.js +21 -10
  124. package/dist/utils/local-space-state.d.ts +78 -4
  125. package/dist/utils/local-space-state.js +383 -82
  126. package/dist/utils/one-shot-replay.d.ts +14 -0
  127. package/dist/utils/one-shot-replay.js +21 -0
  128. package/dist/utils/page-preview.d.ts +7 -0
  129. package/dist/utils/page-preview.js +9 -0
  130. package/dist/utils/pages.d.ts +2 -11
  131. package/dist/utils/pages.js +58 -14
  132. package/dist/utils/publish-form-data.d.ts +22 -0
  133. package/dist/utils/publish-form-data.js +26 -0
  134. package/dist/utils/publish-policy.js +20 -4
  135. package/dist/utils/query-keys.d.ts +7 -4
  136. package/dist/utils/query-keys.js +13 -4
  137. package/dist/utils/runtime-paths.d.ts +3 -0
  138. package/dist/utils/runtime-paths.js +7 -0
  139. package/dist/utils/secure-local-file.d.ts +73 -0
  140. package/dist/utils/secure-local-file.js +1373 -0
  141. package/dist/utils/space-config.d.ts +13 -4
  142. package/dist/utils/space-config.js +123 -15
  143. package/dist/utils/storage-policy.d.ts +20 -0
  144. package/dist/utils/storage-policy.fixtures.json +174 -0
  145. package/dist/utils/storage-policy.js +193 -0
  146. package/dist/utils/upload-session.d.ts +12 -1
  147. package/dist/utils/upload-session.js +37 -2
  148. package/dist/utils/version-file-browser.d.ts +13 -0
  149. package/dist/utils/version-file-browser.js +59 -0
  150. package/package.json +19 -1
  151. package/dist/contracts/mounts.d.ts +0 -142
  152. package/dist/contracts/mounts.js +0 -56
  153. package/dist/utils/asset-fingerprint.d.ts +0 -64
  154. package/dist/utils/asset-fingerprint.js +0 -620
@@ -102,19 +102,19 @@ export declare const requiredActionsSchema: z.ZodArray<z.ZodDiscriminatedUnion<[
102
102
  type: z.ZodLiteral<"renew">;
103
103
  domainId: z.ZodString;
104
104
  }, z.core.$strip>], "type">>;
105
- export declare const ApiErrorResponseSchema: z.ZodObject<{
106
- error: z.ZodObject<{
107
- code: z.ZodString;
108
- message: z.ZodString;
109
- param: z.ZodOptional<z.ZodString>;
110
- docsUrl: z.ZodString;
111
- details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
112
- suggestions: z.ZodOptional<z.ZodArray<z.ZodString>>;
113
- next: z.ZodOptional<z.ZodArray<z.ZodString>>;
114
- requestId: z.ZodOptional<z.ZodString>;
115
- }, z.core.$strip>;
105
+ export declare const ProblemDetailsSchema: z.ZodObject<{
106
+ type: z.ZodString;
107
+ title: z.ZodString;
108
+ status: z.ZodNumber;
109
+ detail: z.ZodString;
110
+ code: z.ZodString;
111
+ pointer: z.ZodOptional<z.ZodString>;
112
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
113
+ suggestions: z.ZodOptional<z.ZodArray<z.ZodString>>;
114
+ next: z.ZodOptional<z.ZodArray<z.ZodString>>;
115
+ requestId: z.ZodString;
116
116
  }, z.core.$strip>;
117
- export type ApiErrorResponse = z.infer<typeof ApiErrorResponseSchema>;
117
+ export type ProblemDetails = z.infer<typeof ProblemDetailsSchema>;
118
118
  export declare function dataEnvelope<T extends z.ZodType>(data: T): z.ZodObject<{
119
119
  data: T;
120
120
  }, z.core.$strip>;
@@ -18,7 +18,7 @@ export const baseDiagnosticSchema = z.object({
18
18
  path: z
19
19
  .string()
20
20
  .nullish()
21
- .describe('Artifact path the diagnostic points at, e.g. "_headers:12", when one exists.'),
21
+ .describe('Artifact path the diagnostic points at, for example "_headers:12", when one exists.'),
22
22
  provider: diagnosticProvider
23
23
  .nullish()
24
24
  .describe("Upstream system the diagnostic originated from, when not Spacefast itself."),
@@ -30,7 +30,7 @@ export const baseDiagnosticSchema = z.object({
30
30
  retryable: z
31
31
  .boolean()
32
32
  .nullish()
33
- .describe("Whether retrying the same operation may resolve this diagnostic without the caller changing anything."),
33
+ .describe("Whether retrying the same operation can resolve this diagnostic without the caller changing anything."),
34
34
  });
35
35
  // Canonical DnsInstruction (internal-docs/platform.md L2500-2506): provider vocabulary
36
36
  // never leaks into `purpose`.
@@ -64,31 +64,34 @@ export const requiredActionSchema = z.discriminatedUnion("type", [
64
64
  export const requiredActionsSchema = z
65
65
  .array(requiredActionSchema)
66
66
  .describe("Concrete user steps that unblock this resource, using the one shared vocabulary.");
67
- // The error envelope (internal-docs/platform.md "Global API Conventions"): `docsUrl` is
68
- // mandatory and derived from `code` (see contracts/error-codes.ts); `param` is a
69
- // JSON-path-lite pointer into the failing request field on validation failures.
70
- export const ApiErrorResponseSchema = z.object({
71
- error: z.object({
72
- code: z.string().describe("Stable snake_case error code naming the failed public contract."),
73
- message: z.string().describe("Human-readable failure explanation."),
74
- param: z
75
- .string()
76
- .optional()
77
- .describe('JSON-path-lite pointer into the failing request field, e.g. "files[37].path", on validation failures.'),
78
- docsUrl: z
79
- .string()
80
- .describe("Always present; derived mechanically from `code` against the docs origin."),
81
- details: AnyObjectSchema.optional().describe("Machine-readable context for the error code."),
82
- suggestions: z
83
- .array(z.string())
84
- .optional()
85
- .describe("Actionable recovery steps safe to show in dashboards, SDKs, and CLI output."),
86
- next: z
87
- .array(z.string())
88
- .optional()
89
- .describe("Copy-pasteable commands or API requests an agent can run next."),
90
- requestId: z.string().optional().describe("Request id to quote when contacting support."),
91
- }),
67
+ // The error shape (internal-docs/platform.md "Global API Conventions"): every 4xx/5xx body
68
+ // is one RFC 9457 problem details document served as `application/problem+json`. `type` and
69
+ // `title` are derived mechanically from `code` (see contracts/error-codes.ts); `code`,
70
+ // `pointer` (RFC 6901), `details`, `suggestions`, `next`, and `requestId` are extension members.
71
+ export const ProblemDetailsSchema = z.object({
72
+ type: z
73
+ .string()
74
+ .describe("Problem type URI. It resolves to the error docs page. The server derives it mechanically from `code` against the docs origin."),
75
+ title: z
76
+ .string()
77
+ .describe("Short human-readable summary of the problem type. The server derives it mechanically from `code`."),
78
+ status: z.number().int().describe("HTTP status code of this response, repeated in the body."),
79
+ detail: z.string().describe("Human-readable failure explanation for this occurrence."),
80
+ code: z.string().describe("Stable snake_case error code naming the failed public contract."),
81
+ pointer: z
82
+ .string()
83
+ .optional()
84
+ .describe('RFC 6901 JSON Pointer into the failing request field, for example "/files/37/path", on validation failures.'),
85
+ details: AnyObjectSchema.optional().describe("Machine-readable context for the error code."),
86
+ suggestions: z
87
+ .array(z.string())
88
+ .optional()
89
+ .describe("Actionable recovery steps safe to show in dashboards, SDKs, and CLI output."),
90
+ next: z
91
+ .array(z.string())
92
+ .optional()
93
+ .describe("Copy-pasteable commands or API requests an agent can run next."),
94
+ requestId: z.string().describe("The request id to quote when contacting support."),
92
95
  });
93
96
  // Success envelope (internal-docs/platform.md "Global API Conventions"): `{ data: T }` for
94
97
  // single resources and mutations, `{ data: T[], pagination }` for lists. Mutations whose work
@@ -98,7 +101,7 @@ export function dataEnvelope(data) {
98
101
  }
99
102
  export const ApiUploadInstructionSchema = z
100
103
  .object({
101
- id: z.string().describe("Upload session id (`upl_…`)."),
104
+ id: z.string().describe("The upload session id (`upl_…`)."),
102
105
  expiresAt: z.string().datetime(),
103
106
  method: z.literal("PUT"),
104
107
  url: z
@@ -114,7 +117,7 @@ export const CursorPaginationSchema = z.object({
114
117
  nextCursor: z
115
118
  .string()
116
119
  .nullable()
117
- .describe("Opaque cursor for the next page; pass as `?cursor=`. Null on the last page."),
120
+ .describe("Opaque cursor for the next page; null when there are no more results."),
118
121
  hasMore: z.boolean().describe("Whether another page exists after this one."),
119
122
  });
120
123
  export const CURSOR_MAX_LENGTH = 4_096;
@@ -133,7 +136,7 @@ export const cursorListQuerySchema = z.object({
133
136
  .min(1)
134
137
  .max(CURSOR_MAX_LENGTH)
135
138
  .optional()
136
- .describe("Opaque cursor from a previous page's `pagination.nextCursor`."),
139
+ .describe("Opaque cursor from the previous page's `nextCursor`."),
137
140
  });
138
141
  // The operator-only offset list-response shape (superadmin surfaces): the named
139
142
  // items array, plus `total`/`limit`/`offset` and the offset `pagination` block.
@@ -13,7 +13,7 @@ import { AnyObjectSchema } from "./common.js";
13
13
  // generalized resume endpoint once the human step is done.
14
14
  export const RequiresActionTypeSchema = z
15
15
  .enum(["device_authorization"])
16
- .describe("Stable identifier for the out-of-band step a flow is blocked on. New blocking steps are added HERE so resume stays one generalized contract.");
16
+ .describe("Stable identifier for the out-of-band step that blocks the flow. Add new blocking steps here so resume stays one generalized contract.");
17
17
  export const RequiresActionSchema = z
18
18
  .object({
19
19
  actionType: RequiresActionTypeSchema,
@@ -29,7 +29,7 @@ export const RequiresActionSchema = z
29
29
  continuationToken: z
30
30
  .string()
31
31
  .min(1)
32
- .describe("Short-lived, single-use-on-completion, principal-scoped capability the agent presents to POST /v1/actions/resume to poll and complete this exact flow. Treat as a secret; never log it."),
32
+ .describe("Short-lived, principal-scoped capability for this exact flow. Present it to POST /v1/actions/resume to poll and complete the flow. The token is single-use on completion. Treat it as a secret. Never log it."),
33
33
  pollAfterSeconds: z
34
34
  .number()
35
35
  .int()
@@ -38,7 +38,7 @@ export const RequiresActionSchema = z
38
38
  expiresAt: z
39
39
  .string()
40
40
  .datetime()
41
- .describe("Instant by which the human step must be completed the originating flow's own deadline. Resume after this returns a terminal `expired` status (the token survives a short grace past this so resume can report that), but the flow can no longer be redeemed."),
41
+ .describe("Instant when the human step deadline is reached for the originating flow. Resume after this returns terminal `expired`. The token survives for a short grace so resume can report `expired`, but the flow can no longer be redeemed."),
42
42
  })
43
43
  .strict();
44
44
  /** The canonical `{ requiresAction }` envelope, additive alongside `{ data }` / `{ error }`. */
@@ -70,7 +70,7 @@ export const ActionResumeResponseSchema = z
70
70
  .object({
71
71
  status: z.literal("completed"),
72
72
  actionType: RequiresActionTypeSchema,
73
- result: AnyObjectSchema.describe("The flow's success payload, redeemed exactly once. For device_authorization this carries the one-time `apiKey` and any `claimedSpaceId`."),
73
+ result: AnyObjectSchema.describe("Flow success payload, redeemed exactly once. For device_authorization, this carries the one-time `apiKey` and any `claimedSpaceId`."),
74
74
  })
75
75
  .strict(),
76
76
  z
@@ -88,4 +88,4 @@ export const ActionResumeResponseSchema = z
88
88
  })
89
89
  .strict(),
90
90
  ])
91
- .describe("Consistent resume result across flows: keep polling on `pending`, read the one-time payload on `completed`, stop on `denied`/`expired`.");
91
+ .describe("Consistent resume result across flows. Keep polling on `pending`. Read the one-time payload on `completed`. Stop on `denied` or `expired`.");
@@ -4,7 +4,7 @@ import { dataSourceNameSchema, wordpressDataSourceSchema } from "./space-config.
4
4
  export const dataSourceListItemSchema = wordpressDataSourceSchema
5
5
  .extend({
6
6
  name: dataSourceNameSchema,
7
- default: z.boolean().describe("True for the effective default source."),
7
+ default: z.boolean().describe("Whether this source is the effective default."),
8
8
  })
9
9
  .strict();
10
10
  export const dataSourceListResponseSchema = dataEnvelope(z.object({
@@ -199,9 +199,9 @@ export declare const AgentHandoffCreateRequestSchema: z.ZodObject<{
199
199
  spaceId: z.ZodString;
200
200
  clientTargetId: z.ZodEnum<{
201
201
  "claude-code": "claude-code";
202
+ codex: "codex";
202
203
  cursor: "cursor";
203
204
  vscode: "vscode";
204
- codex: "codex";
205
205
  }>;
206
206
  }, z.core.$strict>;
207
207
  export type AgentHandoffCreateRequest = z.infer<typeof AgentHandoffCreateRequestSchema>;
@@ -213,9 +213,9 @@ export declare const AgentHandoffCreateResponseSchema: z.ZodObject<{
213
213
  spaceId: z.ZodString;
214
214
  clientTargetId: z.ZodEnum<{
215
215
  "claude-code": "claude-code";
216
+ codex: "codex";
216
217
  cursor: "cursor";
217
218
  vscode: "vscode";
218
- codex: "codex";
219
219
  }>;
220
220
  }, z.core.$strict>;
221
221
  export type AgentHandoffCreateResponse = z.infer<typeof AgentHandoffCreateResponseSchema>;
@@ -223,9 +223,9 @@ export declare const AgentHandoffRedeemRequestSchema: z.ZodObject<{
223
223
  url: z.ZodString;
224
224
  clientTargetId: z.ZodOptional<z.ZodEnum<{
225
225
  "claude-code": "claude-code";
226
+ codex: "codex";
226
227
  cursor: "cursor";
227
228
  vscode: "vscode";
228
- codex: "codex";
229
229
  }>>;
230
230
  }, z.core.$strict>;
231
231
  export type AgentHandoffRedeemRequest = z.infer<typeof AgentHandoffRedeemRequestSchema>;
@@ -342,9 +342,9 @@ export declare const AgentHandoffRedeemResponseSchema: z.ZodObject<{
342
342
  spaceId: z.ZodString;
343
343
  clientTargetId: z.ZodEnum<{
344
344
  "claude-code": "claude-code";
345
+ codex: "codex";
345
346
  cursor: "cursor";
346
347
  vscode: "vscode";
347
- codex: "codex";
348
348
  }>;
349
349
  }, z.core.$strict>;
350
350
  export type AgentHandoffRedeemResponse = z.infer<typeof AgentHandoffRedeemResponseSchema>;
@@ -367,9 +367,9 @@ export declare const AgentHandoffSummarySchema: z.ZodObject<{
367
367
  spaceId: z.ZodString;
368
368
  clientTargetId: z.ZodEnum<{
369
369
  "claude-code": "claude-code";
370
+ codex: "codex";
370
371
  cursor: "cursor";
371
372
  vscode: "vscode";
372
- codex: "codex";
373
373
  }>;
374
374
  status: z.ZodEnum<{
375
375
  revoked: "revoked";
@@ -388,9 +388,9 @@ export declare const AgentHandoffListResponseSchema: z.ZodArray<z.ZodObject<{
388
388
  spaceId: z.ZodString;
389
389
  clientTargetId: z.ZodEnum<{
390
390
  "claude-code": "claude-code";
391
+ codex: "codex";
391
392
  cursor: "cursor";
392
393
  vscode: "vscode";
393
- codex: "codex";
394
394
  }>;
395
395
  status: z.ZodEnum<{
396
396
  revoked: "revoked";
@@ -172,8 +172,8 @@ export const DeviceAuthorizationDenyResponseSchema = z.object({
172
172
  export const AGENT_HANDOFF_CLIENT_TARGETS = ["claude-code", "codex", "cursor", "vscode"];
173
173
  export const AgentHandoffCreateRequestSchema = z
174
174
  .object({
175
- teamId: z.string().min(1).describe("Team that owns the selected Space."),
176
- spaceId: z.string().min(1).describe("Finite Space scope granted to the agent."),
175
+ teamId: z.string().min(1).describe("Team that owns the selected space."),
176
+ spaceId: z.string().min(1).describe("Finite space scope granted to the agent."),
177
177
  clientTargetId: z
178
178
  .enum(AGENT_HANDOFF_CLIENT_TARGETS)
179
179
  .describe("CLI-redeemable client family the handoff is bound to."),
@@ -185,13 +185,13 @@ export const AgentHandoffCreateResponseSchema = z
185
185
  url: z
186
186
  .string()
187
187
  .url()
188
- .describe("Sensitive one-time handoff URL. This is the only response field containing the fragment secret."),
188
+ .describe("Sensitive one-time handoff URL. This is the only response field containing the browser credential."),
189
189
  expiresAt: z
190
190
  .string()
191
191
  .datetime()
192
192
  .describe("Instant after which the handoff cannot be redeemed."),
193
- teamId: z.string().min(1).describe("Team that owns the selected Space."),
194
- spaceId: z.string().min(1).describe("Finite Space scope granted to the agent."),
193
+ teamId: z.string().min(1).describe("Team that owns the selected space."),
194
+ spaceId: z.string().min(1).describe("Finite space scope granted to the agent."),
195
195
  clientTargetId: z
196
196
  .enum(AGENT_HANDOFF_CLIENT_TARGETS)
197
197
  .describe("CLI-redeemable client family the handoff is bound to."),
@@ -212,9 +212,9 @@ export const AgentHandoffRedeemRequestSchema = z
212
212
  export const AgentHandoffRedeemResponseSchema = z
213
213
  .object({
214
214
  status: z.literal("redeemed").describe("The handoff was redeemed exactly once."),
215
- apiKey: ApiKeySchema.describe("Finite Space-scoped API key including its one-time secret."),
216
- teamId: z.string().min(1).describe("Team that owns the selected Space."),
217
- spaceId: z.string().min(1).describe("Finite Space scope granted to the agent."),
215
+ apiKey: ApiKeySchema.describe("Finite space-scoped API key including its one-time secret."),
216
+ teamId: z.string().min(1).describe("Team that owns the selected space."),
217
+ spaceId: z.string().min(1).describe("Finite space scope granted to the agent."),
218
218
  clientTargetId: z
219
219
  .enum(AGENT_HANDOFF_CLIENT_TARGETS)
220
220
  .describe("CLI-redeemable client family the handoff is bound to."),
@@ -228,19 +228,19 @@ export const AgentHandoffRevokeResponseSchema = z
228
228
  // List (`GET /v1/auth/agent-handoffs?teamId=…`): the human handoff ledger. Session-only,
229
229
  // scoped to one team, bounded to the newest rows (active handoffs are few and short-lived,
230
230
  // so the bound can never hide a revocable link); rows are the truthful lifecycle record,
231
- // never the secret (the fragment secret exists only in the one create response and is
231
+ // never the secret (the browser credential exists only in the one create response and is
232
232
  // never listed or replayed).
233
233
  export const AgentHandoffListQuerySchema = z.object({
234
234
  teamId: z.string().min(1).describe("Team whose issued agent handoffs to list."),
235
235
  });
236
236
  export const AgentHandoffStatusSchema = z
237
237
  .enum(["pending", "redeemed", "revoked"])
238
- .describe("Stored lifecycle status. `expired` is not a stored status it is derived by the caller from `expiresAt`.");
238
+ .describe("Stored lifecycle status. `expired` is not a stored status. The caller derives it from `expiresAt`.");
239
239
  export const AgentHandoffSummarySchema = z
240
240
  .object({
241
241
  id: z.string().min(1).describe("Opaque app-private handoff document identifier."),
242
- teamId: z.string().min(1).describe("Team that owns the selected Space."),
243
- spaceId: z.string().min(1).describe("Finite Space scope granted to the agent."),
242
+ teamId: z.string().min(1).describe("Team that owns the selected space."),
243
+ spaceId: z.string().min(1).describe("Finite space scope granted to the agent."),
244
244
  clientTargetId: z
245
245
  .enum(AGENT_HANDOFF_CLIENT_TARGETS)
246
246
  .describe("CLI-redeemable client family the handoff is bound to."),
@@ -9,12 +9,12 @@ export declare const docsIndexQuerySchema: z.ZodObject<{
9
9
  reference: "reference";
10
10
  }>>;
11
11
  category: z.ZodOptional<z.ZodEnum<{
12
- api: "api";
13
12
  guide: "guide";
13
+ api: "api";
14
14
  error: "error";
15
15
  cli: "cli";
16
- recipe: "recipe";
17
16
  workflow: "workflow";
17
+ recipe: "recipe";
18
18
  }>>;
19
19
  }, z.core.$strip>;
20
20
  /** Links carried by every docs entry. */
@@ -28,12 +28,12 @@ export declare const DocsEntrySchema: z.ZodObject<{
28
28
  title: z.ZodString;
29
29
  summary: z.ZodString;
30
30
  category: z.ZodEnum<{
31
- api: "api";
32
31
  guide: "guide";
32
+ api: "api";
33
33
  error: "error";
34
34
  cli: "cli";
35
- recipe: "recipe";
36
35
  workflow: "workflow";
36
+ recipe: "recipe";
37
37
  }>;
38
38
  tier: z.ZodEnum<{
39
39
  essential: "essential";
@@ -54,12 +54,12 @@ export declare const DocsDocSchema: z.ZodObject<{
54
54
  title: z.ZodString;
55
55
  summary: z.ZodString;
56
56
  category: z.ZodEnum<{
57
- api: "api";
58
57
  guide: "guide";
58
+ api: "api";
59
59
  error: "error";
60
60
  cli: "cli";
61
- recipe: "recipe";
62
61
  workflow: "workflow";
62
+ recipe: "recipe";
63
63
  }>;
64
64
  tier: z.ZodEnum<{
65
65
  essential: "essential";
@@ -84,12 +84,12 @@ export declare const DocsIndexResponseSchema: z.ZodObject<{
84
84
  }>;
85
85
  query: z.ZodNullable<z.ZodString>;
86
86
  category: z.ZodNullable<z.ZodEnum<{
87
- api: "api";
88
87
  guide: "guide";
88
+ api: "api";
89
89
  error: "error";
90
90
  cli: "cli";
91
- recipe: "recipe";
92
91
  workflow: "workflow";
92
+ recipe: "recipe";
93
93
  }>>;
94
94
  count: z.ZodNumber;
95
95
  entries: z.ZodArray<z.ZodObject<{
@@ -97,12 +97,12 @@ export declare const DocsIndexResponseSchema: z.ZodObject<{
97
97
  title: z.ZodString;
98
98
  summary: z.ZodString;
99
99
  category: z.ZodEnum<{
100
- api: "api";
101
100
  guide: "guide";
101
+ api: "api";
102
102
  error: "error";
103
103
  cli: "cli";
104
- recipe: "recipe";
105
104
  workflow: "workflow";
105
+ recipe: "recipe";
106
106
  }>;
107
107
  tier: z.ZodEnum<{
108
108
  essential: "essential";
@@ -14,17 +14,17 @@ export const domainRegistrarFacetSchema = z.object({
14
14
  provider: z
15
15
  .string()
16
16
  .optional()
17
- .describe('Wrapped registrar provider key when mode is "stattic", e.g. "wpcom".'),
17
+ .describe("Wrapped registrar provider key when `mode` is `stattic`, for example `wpcom`."),
18
18
  status: z
19
19
  .enum(["active", "pending_purchase", "pending_transfer_in", "expiring", "expired", "locked"])
20
20
  .optional()
21
21
  .describe("Registration lifecycle status; `expiring` is derived from the expiry date."),
22
- expiresAt: z.string().datetime().optional().describe("When the registration expires."),
22
+ expiresAt: z.string().datetime().optional().describe("Instant when the registration expires."),
23
23
  redemptionEndsAt: z
24
24
  .string()
25
25
  .datetime()
26
26
  .optional()
27
- .describe("End of the provider grace/redemption window after expiry."),
27
+ .describe("Instant when the provider grace or redemption window ends after expiry."),
28
28
  autoRenew: z.boolean().optional().describe("Whether the registration renews automatically."),
29
29
  transferLock: z
30
30
  .boolean()
@@ -40,15 +40,15 @@ export const domainDnsFacetSchema = z.object({
40
40
  managementKind: z
41
41
  .enum(["unmanaged_external", "connected_provider", "registrar_dns", "stattic_nameservers"])
42
42
  .optional()
43
- .describe("Derived DNS management state. Additive; `mode` remains the v1 compatibility field."),
43
+ .describe("Derived DNS management state. This field is additive. `mode` remains the v1 compatibility field."),
44
44
  dnsMode: z
45
45
  .enum(["authoritative", "adapter"])
46
46
  .optional()
47
- .describe("Hybrid DNS mode derived from `managementKind`: authoritative (Spacefast hosts the zone) or adapter (records managed/observed on the user's existing host). Additive read-model label."),
47
+ .describe("Hybrid DNS mode derived from `managementKind`: authoritative when Spacefast hosts the zone, or adapter when records are managed or observed on the user's existing host. This field is an additive read-model label."),
48
48
  provider: z
49
49
  .string()
50
50
  .optional()
51
- .describe('Wrapped DNS provider key when mode is "stattic", e.g. "route53" or "wpcom".'),
51
+ .describe("Wrapped DNS provider key when `mode` is `stattic`, for example `route53` or `wpcom`."),
52
52
  assignedNameservers: z
53
53
  .array(z.string())
54
54
  .optional()
@@ -88,13 +88,13 @@ export const domainVerificationSchema = z.object({
88
88
  .datetime()
89
89
  .nullable()
90
90
  .optional()
91
- .describe("When observed DNS was last polled."),
91
+ .describe("Instant when observed DNS was last polled."),
92
92
  lastVerifiedAt: z
93
93
  .string()
94
94
  .datetime()
95
95
  .nullable()
96
96
  .optional()
97
- .describe("Last time this domain proved DNS control."),
97
+ .describe("Instant when this domain last proved DNS control."),
98
98
  diagnostics: z
99
99
  .array(baseDiagnosticSchema)
100
100
  .optional()
@@ -171,7 +171,7 @@ export const domainRedirectTargetSchema = z
171
171
  .describe("Redirect destination: an absolute URL, or a space (optionally with a path).");
172
172
  export const domainRedirectStatusSchema = z
173
173
  .union([z.literal(301), z.literal(302), z.literal(307), z.literal(308)])
174
- .describe("HTTP redirect status; defaults to 308.");
174
+ .describe("HTTP redirect status. Defaults to 308.");
175
175
  // A domain either serves its Space or redirects away from it — whole-host
176
176
  // only. Path-level routing belongs in the serving Space's `_redirects`.
177
177
  export const domainRedirectSchema = z.object({
@@ -191,10 +191,10 @@ export const DomainSchema = z.object({
191
191
  .describe("Read-only U-label form, present only when it differs from `name`."),
192
192
  kind: z
193
193
  .enum(["hostname", "apex"])
194
- .describe("Derived, never create input: `apex` iff `name` equals `derivedGroup`."),
194
+ .describe("Derived field, never create input: `apex` if and only if `name` equals `derivedGroup`."),
195
195
  wildcardEnabled: z
196
196
  .boolean()
197
- .describe("Whether wildcard hostnames may be derived from this record."),
197
+ .describe("Whether wildcard hostnames can be derived from this record."),
198
198
  spaceId: z
199
199
  .string()
200
200
  .nullable()
@@ -219,8 +219,8 @@ export const DomainSchema = z.object({
219
219
  .array(domainHintSchema)
220
220
  .optional()
221
221
  .describe("Projected domain hints derived from diagnostics, actions, observations, and operations."),
222
- createdAt: z.string().datetime().describe("When the record was created."),
223
- updatedAt: z.string().datetime().describe("When the record last changed."),
222
+ createdAt: z.string().datetime().describe("Instant when the record was created."),
223
+ updatedAt: z.string().datetime().describe("Instant when the record last changed."),
224
224
  });
225
225
  export const domainListQuerySchema = cursorListQuerySchema.extend({
226
226
  teamId: z.string().min(1).optional().describe("Filter to domains owned by one team."),
@@ -242,7 +242,7 @@ export const spaceManagedDomainSchema = z.object({
242
242
  managed: z.literal(true),
243
243
  deletable: z.literal(false),
244
244
  assignable: z.literal(false),
245
- primary: z.boolean().describe("True when no custom primary domain overrides the managed URL."),
245
+ primary: z.boolean().describe("Whether no custom primary domain overrides the managed URL."),
246
246
  name: z.string().describe("Managed hostname."),
247
247
  unicodeName: z.string().optional(),
248
248
  kind: z.literal("hostname"),
@@ -281,7 +281,7 @@ export const domainCreateRequestSchema = z.object({
281
281
  .string()
282
282
  .min(1)
283
283
  .optional()
284
- .describe("Owning team. Defaults to the active team for sessions and the key's team."),
284
+ .describe("Owning team. Defaults to the active team for sessions and the API key's team."),
285
285
  });
286
286
  // Facet modes are never PATCHable: `dns.mode` changes only via POST /dns and
287
287
  // `registrar.mode` only via POST /registration. The PATCHable surface is
@@ -291,7 +291,7 @@ export const domainPatchSchema = z
291
291
  wildcardEnabled: z
292
292
  .boolean()
293
293
  .optional()
294
- .describe("Allow wildcard bindings under this domain record."),
294
+ .describe("Pass `true` to allow wildcard bindings under this domain record. Pass `false` to disallow them."),
295
295
  })
296
296
  .refine((value) => Object.keys(value).length > 0, {
297
297
  message: "At least one domain field is required.",
@@ -306,14 +306,14 @@ export const domainRegistrationSchema = z.object({
306
306
  provider: z
307
307
  .enum(["dsapi", "manual"])
308
308
  .nullable()
309
- .describe("Wrapped registrar bridge the registration lives at."),
309
+ .describe("Wrapped registrar bridge where the registration lives."),
310
310
  status: z.string().describe("Registration lifecycle status."),
311
- expiresAt: z.string().datetime().nullable().describe("When the registration expires."),
311
+ expiresAt: z.string().datetime().nullable().describe("Instant when the registration expires."),
312
312
  redemptionEndsAt: z
313
313
  .string()
314
314
  .datetime()
315
315
  .nullable()
316
- .describe("End of the redemption window after expiry."),
316
+ .describe("Instant when the redemption window ends after expiry."),
317
317
  autoRenew: z.boolean().describe("Whether the registration renews automatically."),
318
318
  transferLock: z.boolean().describe("Whether outbound transfers are locked."),
319
319
  privacySetting: z
@@ -321,7 +321,7 @@ export const domainRegistrationSchema = z.object({
321
321
  .nullable()
322
322
  .describe("WHOIS privacy behavior."),
323
323
  contactId: z.string().nullable().describe("Registrant contact record."),
324
- failureReason: z.string().nullable().describe("Provider failure detail, when failed."),
324
+ failureReason: z.string().nullable().describe("Provider failure detail when status is `failed`."),
325
325
  createdAt: z.string().datetime().nullable(),
326
326
  updatedAt: z.string().datetime().nullable(),
327
327
  });
@@ -377,8 +377,14 @@ export const domainRegistrationActionSchema = z.discriminatedUnion("action", [
377
377
  export const domainRegistrationActionResponseSchema = mutationEnvelope(domainRegistrationSchema);
378
378
  export const domainRegistrationPatchSchema = z
379
379
  .object({
380
- autoRenew: z.boolean().optional().describe("Toggle automatic renewal."),
381
- transferLock: z.boolean().optional().describe("Toggle the registrar transfer lock."),
380
+ autoRenew: z
381
+ .boolean()
382
+ .optional()
383
+ .describe("Pass `true` to enable automatic renewal. Pass `false` to disable it."),
384
+ transferLock: z
385
+ .boolean()
386
+ .optional()
387
+ .describe("Pass `true` to enable the registrar transfer lock. Pass `false` to disable it."),
382
388
  privacySetting: z
383
389
  .enum(["enable_privacy_service", "redact_contact_info", "disclose_contact_info"])
384
390
  .optional()
@@ -427,7 +433,7 @@ export const domainNameserverUpdateSchema = z.object({
427
433
  export const domainDnsModeRequestSchema = z.object({
428
434
  mode: z
429
435
  .enum(["stattic", "external"])
430
- .describe("Target DNS hosting mode. externalstattic snapshots observed records first."),
436
+ .describe("Target DNS hosting mode. On `external` to `stattic`, the server snapshots observed records first."),
431
437
  });
432
438
  // The transition receipt rides inside `data` (envelope law: `{data}` plus
433
439
  // `operation` only): the post-mutation Domain plus the transition diagnostics
@@ -473,11 +479,11 @@ export const domainDnsRecordSchema = z.object({
473
479
  .describe("Provider-only record metadata when advertised by capabilities."),
474
480
  managed: z
475
481
  .boolean()
476
- .describe("Spacefast-owned (verification/routing/ssl); read-only via the public API."),
482
+ .describe("Whether Spacefast owns this record for verification, routing, or SSL. Set by the server; read-only."),
477
483
  protected: z
478
484
  .boolean()
479
485
  .default(false)
480
- .describe("Read-only through public DNS record writes even when the record is not Spacefast-owned."),
486
+ .describe("Whether this record is read-only through public DNS record writes, even when Spacefast does not own it."),
481
487
  purpose: z
482
488
  .enum(["verification", "routing", "ssl"])
483
489
  .nullable()
@@ -497,8 +503,8 @@ export const domainDnsCapabilityFieldSchema = z.object({
497
503
  .enum(["string", "number", "boolean", "enum", "object", "array"])
498
504
  .describe("Machine-readable field type."),
499
505
  readable: z.boolean().describe("Whether provider snapshots can return this field."),
500
- creatable: z.boolean().describe("Whether create requests may set this field."),
501
- patchable: z.boolean().describe("Whether patch requests may change this field."),
506
+ creatable: z.boolean().describe("Whether create requests can set this field."),
507
+ patchable: z.boolean().describe("Whether patch requests can change this field."),
502
508
  requiredWhen: z
503
509
  .string()
504
510
  .nullable()
@@ -655,7 +661,7 @@ export const domainDnsCapabilitiesSchema = z
655
661
  "delegated_nameservers",
656
662
  "internal_service_key",
657
663
  ])
658
- .describe("Why DNS writes are or are not available."),
664
+ .describe("Why DNS writes are available or unavailable."),
659
665
  provider: z.string().nullable().describe("Effective DNS provider key when known."),
660
666
  recordTypes: z
661
667
  .array(domainDnsRecordSchema.shape.type)
@@ -944,7 +950,7 @@ export const domainActionCreateRequestSchema = domainActionDraftSchema.extend({
944
950
  .min(1)
945
951
  .max(320)
946
952
  .optional()
947
- .describe("Stable caller-supplied dedupe key; server derives one when omitted."),
953
+ .describe("Stable caller-supplied dedupe key. The server derives one when you omit this field."),
948
954
  });
949
955
  export const domainActionMutationResponseSchema = mutationEnvelope(domainActionSchema);
950
956
  export const domainDnsRecordSnapshotMetadataSchema = z.object({
@@ -1064,7 +1070,7 @@ const domainDnsRecordPatchableFields = z.object({
1064
1070
  .int()
1065
1071
  .min(60)
1066
1072
  .max(86400)
1067
- .describe("Time to live in seconds (60-86400); defaults to 3600 on create."),
1073
+ .describe("Time to live in seconds (60 to 86400). Defaults to 3600 on create."),
1068
1074
  priority: z
1069
1075
  .number()
1070
1076
  .int()
@@ -1095,8 +1101,8 @@ export const domainDnsRecordPatchSchema = domainDnsRecordPatchableFields
1095
1101
  })
1096
1102
  .superRefine(requireMxSrvPriority);
1097
1103
  // Executed in exactly this order — deletes, patches, puts, posts — as one
1098
- // atomic transaction; any failure rejects the whole batch with the failing
1099
- // entry in `error.param`.
1104
+ // atomic transaction; any failure rejects the whole batch with an RFC 6901
1105
+ // JSON Pointer to the failing entry in the problem document's `pointer`.
1100
1106
  export const domainDnsRecordBatchSchema = z
1101
1107
  .object({
1102
1108
  deletes: z
@@ -1188,7 +1194,7 @@ export const domainDiagnosticsResponseSchema = z.object({
1188
1194
  diagnostics: z
1189
1195
  .array(baseDiagnosticSchema)
1190
1196
  .optional()
1191
- .describe('Domain-level setup nudges computed at read time, e.g. "companion_hostname_unbound" when the apex/www pair is half-bound.'),
1197
+ .describe('Domain-level setup nudges computed at read time, for example "companion_hostname_unbound" when the apex/www pair is half-bound.'),
1192
1198
  hostnameDiagnostics: z
1193
1199
  .array(domainHostnameDiagnosticsSchema)
1194
1200
  .describe("Per-hostname DNS and SSL connectivity diagnostics."),