@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.
- package/dist/agents/client-registry.d.ts +22 -0
- package/dist/agents/client-registry.js +41 -0
- package/dist/agents/connect-targets.d.ts +51 -6
- package/dist/agents/connect-targets.js +93 -28
- package/dist/brand.d.ts +0 -11
- package/dist/brand.js +0 -20
- package/dist/config/domains.d.ts +15 -6
- package/dist/config/domains.js +24 -10
- package/dist/config/postgres-budget.d.ts +3 -0
- package/dist/config/postgres-budget.js +6 -1
- package/dist/config/postgres-budget.json +2 -1
- package/dist/contracts/abuse.js +1 -1
- package/dist/contracts/access.d.ts +149 -44
- package/dist/contracts/access.js +94 -8
- package/dist/contracts/activity.js +5 -1
- package/dist/contracts/api-keys.js +9 -9
- package/dist/contracts/archives.js +11 -11
- package/dist/contracts/beta.js +1 -1
- package/dist/contracts/builds.js +14 -14
- package/dist/contracts/channels.js +2 -2
- package/dist/contracts/comments.d.ts +86 -15
- package/dist/contracts/comments.js +116 -20
- package/dist/contracts/common.d.ts +12 -12
- package/dist/contracts/common.js +33 -30
- package/dist/contracts/continuation.js +5 -5
- package/dist/contracts/data-source-routes.js +1 -1
- package/dist/contracts/device-auth.d.ts +6 -6
- package/dist/contracts/device-auth.js +12 -12
- package/dist/contracts/docs.d.ts +10 -10
- package/dist/contracts/domains.js +39 -33
- package/dist/contracts/enums.d.ts +2 -10
- package/dist/contracts/enums.js +0 -2
- package/dist/contracts/error-code-meta.d.ts +116 -47
- package/dist/contracts/error-code-meta.js +37 -16
- package/dist/contracts/error-codes.d.ts +7 -4
- package/dist/contracts/error-codes.js +46 -21
- package/dist/contracts/events.d.ts +10 -3
- package/dist/contracts/events.js +33 -5
- package/dist/contracts/execution.d.ts +26 -0
- package/dist/contracts/execution.js +21 -0
- package/dist/contracts/feature-lifecycle.d.ts +21 -24
- package/dist/contracts/feature-lifecycle.js +28 -26
- package/dist/contracts/features.js +4 -4
- package/dist/contracts/functions.d.ts +8 -140
- package/dist/contracts/functions.js +9 -19
- package/dist/contracts/git.d.ts +1 -1
- package/dist/contracts/grants.d.ts +96 -79
- package/dist/contracts/grants.js +130 -43
- package/dist/contracts/ids.d.ts +2 -2
- package/dist/contracts/ids.js +2 -4
- package/dist/contracts/internal.js +2 -2
- package/dist/contracts/mcp.d.ts +17 -556
- package/dist/contracts/mcp.js +9 -103
- package/dist/contracts/me.js +3 -4
- package/dist/contracts/notifications.d.ts +108 -0
- package/dist/contracts/notifications.js +54 -0
- package/dist/contracts/oauth-resources.d.ts +18 -1
- package/dist/contracts/oauth-resources.js +22 -2
- package/dist/contracts/operations.d.ts +2 -50
- package/dist/contracts/operations.js +0 -19
- package/dist/contracts/pages.d.ts +8 -4
- package/dist/contracts/pages.js +16 -3
- package/dist/contracts/platform.js +10 -8
- package/dist/contracts/problem-document.d.ts +14 -0
- package/dist/contracts/problem-document.js +35 -0
- package/dist/contracts/push-new.d.ts +21 -6
- package/dist/contracts/push-new.js +3 -7
- package/dist/contracts/resources.d.ts +8 -7
- package/dist/contracts/resources.js +9 -6
- package/dist/contracts/runtime-api.d.ts +162 -92
- package/dist/contracts/runtime-api.js +99 -27
- package/dist/contracts/runtime-app.d.ts +41 -11
- package/dist/contracts/runtime-app.js +22 -1
- package/dist/contracts/runtime-db.d.ts +424 -0
- package/dist/contracts/runtime-db.js +108 -0
- package/dist/contracts/runtime-storage.d.ts +120 -0
- package/dist/contracts/runtime-storage.js +40 -0
- package/dist/contracts/sf-config-v1.d.ts +49 -1
- package/dist/contracts/sf-config-v1.js +2 -2
- package/dist/contracts/sites.d.ts +1 -0
- package/dist/contracts/sites.js +20 -12
- package/dist/contracts/space-config.d.ts +62 -22
- package/dist/contracts/space-config.js +173 -47
- package/dist/contracts/spaces.d.ts +79 -45
- package/dist/contracts/spaces.js +66 -50
- package/dist/contracts/superadmin-spaces.d.ts +13 -2
- package/dist/contracts/superadmin-spaces.js +15 -0
- package/dist/contracts/superadmin-tenants.js +4 -4
- package/dist/contracts/superadmin.d.ts +4 -0
- package/dist/contracts/superadmin.js +14 -1
- package/dist/contracts/tags.d.ts +17 -17
- package/dist/contracts/tags.js +1 -1
- package/dist/contracts/teams.js +25 -16
- package/dist/contracts/theme-json.js +1 -1
- package/dist/contracts/transfers.js +4 -4
- package/dist/contracts/variables.js +3 -3
- package/dist/contracts/zero.d.ts +204 -338
- package/dist/contracts/zero.js +94 -98
- package/dist/dashboard-paths/index.d.ts +16 -1
- package/dist/dashboard-paths/index.js +18 -0
- package/dist/docs/agent-handoff-document.d.ts +2 -2
- package/dist/docs/agent-handoff-document.js +8 -7
- package/dist/docs/agent-prose.d.ts +22 -3
- package/dist/docs/agent-prose.js +221 -51
- package/dist/docs/agent-setup.d.ts +13 -10
- package/dist/docs/agent-setup.js +279 -53
- package/dist/docs/agent-solutions.d.ts +6 -6
- package/dist/docs/agent-solutions.js +23 -21
- package/dist/docs/catalog.d.ts +29 -74
- package/dist/docs/catalog.js +65 -92
- package/dist/docs/error-docs.js +293 -221
- package/dist/docs/skill-distribution.d.ts +2 -0
- package/dist/docs/skill-distribution.js +7 -4
- package/dist/docs/skills.d.ts +546 -0
- package/dist/docs/skills.js +340 -0
- package/dist/utils/browser-credential.d.ts +19 -0
- package/dist/utils/browser-credential.js +62 -0
- package/dist/utils/comment-avatars.d.ts +7 -0
- package/dist/utils/comment-avatars.js +42 -0
- package/dist/utils/content-type.d.ts +3 -3
- package/dist/utils/content-type.js +38 -61
- package/dist/utils/domain-diagnostics.d.ts +5 -5
- package/dist/utils/domain-diagnostics.js +21 -10
- package/dist/utils/local-space-state.d.ts +78 -4
- package/dist/utils/local-space-state.js +383 -82
- package/dist/utils/one-shot-replay.d.ts +14 -0
- package/dist/utils/one-shot-replay.js +21 -0
- package/dist/utils/page-preview.d.ts +7 -0
- package/dist/utils/page-preview.js +9 -0
- package/dist/utils/pages.d.ts +2 -11
- package/dist/utils/pages.js +58 -14
- package/dist/utils/publish-form-data.d.ts +22 -0
- package/dist/utils/publish-form-data.js +26 -0
- package/dist/utils/publish-policy.js +20 -4
- package/dist/utils/query-keys.d.ts +7 -4
- package/dist/utils/query-keys.js +13 -4
- package/dist/utils/runtime-paths.d.ts +3 -0
- package/dist/utils/runtime-paths.js +7 -0
- package/dist/utils/secure-local-file.d.ts +73 -0
- package/dist/utils/secure-local-file.js +1373 -0
- package/dist/utils/space-config.d.ts +13 -4
- package/dist/utils/space-config.js +123 -15
- package/dist/utils/storage-policy.d.ts +20 -0
- package/dist/utils/storage-policy.fixtures.json +174 -0
- package/dist/utils/storage-policy.js +193 -0
- package/dist/utils/upload-session.d.ts +12 -1
- package/dist/utils/upload-session.js +37 -2
- package/dist/utils/version-file-browser.d.ts +13 -0
- package/dist/utils/version-file-browser.js +59 -0
- package/package.json +19 -1
- package/dist/contracts/mounts.d.ts +0 -142
- package/dist/contracts/mounts.js +0 -56
- package/dist/utils/asset-fingerprint.d.ts +0 -64
- 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
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
|
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>;
|
package/dist/contracts/common.js
CHANGED
|
@@ -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,
|
|
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
|
|
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
|
|
68
|
-
//
|
|
69
|
-
//
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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("
|
|
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;
|
|
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
|
|
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
|
|
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,
|
|
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
|
|
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("
|
|
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
|
|
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("
|
|
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
|
|
176
|
-
spaceId: z.string().min(1).describe("Finite
|
|
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
|
|
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
|
|
194
|
-
spaceId: z.string().min(1).describe("Finite
|
|
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
|
|
216
|
-
teamId: z.string().min(1).describe("Team that owns the selected
|
|
217
|
-
spaceId: z.string().min(1).describe("Finite
|
|
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
|
|
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
|
|
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
|
|
243
|
-
spaceId: z.string().min(1).describe("Finite
|
|
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."),
|
package/dist/contracts/docs.d.ts
CHANGED
|
@@ -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(
|
|
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("
|
|
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("
|
|
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.
|
|
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
|
|
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(
|
|
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("
|
|
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("
|
|
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
|
|
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`
|
|
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
|
|
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("
|
|
223
|
-
updatedAt: z.string().datetime().describe("
|
|
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("
|
|
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("
|
|
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
|
|
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("
|
|
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("
|
|
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
|
|
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
|
|
381
|
-
|
|
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. external
|
|
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
|
|
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("
|
|
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
|
|
501
|
-
patchable: z.boolean().describe("Whether patch requests
|
|
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
|
|
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
|
|
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
|
|
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
|
|
1099
|
-
// entry in `
|
|
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,
|
|
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."),
|