@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
|
@@ -18,18 +18,13 @@ const versionHostnameEntrySchema = z.object({
|
|
|
18
18
|
hostname: z.string().min(1),
|
|
19
19
|
version_id: z.string().min(1),
|
|
20
20
|
});
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
path_prefix: z.string().startsWith("/").min(2),
|
|
24
|
-
target_space_id: z.string().min(1),
|
|
25
|
-
target_version_id: z.string().min(1),
|
|
26
|
-
});
|
|
21
|
+
// Future expansion: this intent could support explicit path-to-artifact composition
|
|
22
|
+
// after independently deployable components have a real product model.
|
|
27
23
|
const runtimeRouteIntentSchema = z.object({
|
|
28
24
|
production_hostnames: z.array(z.string().min(1)).default([]),
|
|
29
25
|
noindex_production_hostnames: z.array(z.string().min(1)).default([]),
|
|
30
26
|
version_hostnames: z.array(versionHostnameEntrySchema).default([]),
|
|
31
27
|
host_canonical_redirects: z.array(hostCanonicalRedirectSchema).default([]),
|
|
32
|
-
static_mount_routes: z.array(staticMountRouteEntrySchema).optional(),
|
|
33
28
|
});
|
|
34
29
|
// Changed-path purge contract (internal-docs/platform.md "Cache Management"):
|
|
35
30
|
// finalize computes the changed-path set against the previous pointer target
|
|
@@ -48,7 +43,7 @@ const changedPathsSchema = z
|
|
|
48
43
|
.describe("Canonical request path (decoded, leading slash) whose served bytes changed."))
|
|
49
44
|
.max(RUNTIME_CHANGED_PATHS_MAX)
|
|
50
45
|
.optional()
|
|
51
|
-
.describe("Request paths changed
|
|
46
|
+
.describe("Request paths changed from the previous pointer target. When absent, no diff is available and purge handling falls back to a host-wide purge. Echoed verbatim into the `route_updated` journal event.");
|
|
52
47
|
const previousVersionIdSchema = z
|
|
53
48
|
.string()
|
|
54
49
|
.min(1)
|
|
@@ -86,10 +81,14 @@ export const runtimeUploadSessionDescriptorSchema = z.object({
|
|
|
86
81
|
metadata: z.record(z.string(), z.unknown()).default({}),
|
|
87
82
|
convention_files: runtimeConventionFilesSchema.default({}),
|
|
88
83
|
});
|
|
89
|
-
//
|
|
90
|
-
// retained manifest)
|
|
91
|
-
// header
|
|
84
|
+
// Candidate budget for the half that rides in the upload JWT (everything
|
|
85
|
+
// except the retained manifest). This bounds signing work, but is not itself a
|
|
86
|
+
// header-size proof: callback capabilities also ride in auto-finalize tokens.
|
|
92
87
|
export const RUNTIME_UPLOAD_SESSION_DESCRIPTOR_MAX_BYTES = 4096;
|
|
88
|
+
// Hard wire budget for the complete `Authorization: Bearer <jwt>\r\n` line sent
|
|
89
|
+
// on every PUT. Lazy-session selection measures the signed line and falls back
|
|
90
|
+
// to eager runtime creation rather than returning an oversized credential.
|
|
91
|
+
export const RUNTIME_UPLOAD_AUTHORIZATION_HEADER_MAX_BYTES = 8 * 1024;
|
|
93
92
|
// Budget for the whole descriptor, which is persisted on the version row and
|
|
94
93
|
// replayed inside the durable finalize receipt.
|
|
95
94
|
export const RUNTIME_UPLOAD_SESSION_STORED_MAX_BYTES = 256 * 1024;
|
|
@@ -136,6 +135,51 @@ export const runtimePublicExposureDescriptorSchema = z.object({
|
|
|
136
135
|
externalProxy: z.boolean(),
|
|
137
136
|
unmodeled: z.string(),
|
|
138
137
|
});
|
|
138
|
+
// Everything the runtime needs to render the visitor access page itself.
|
|
139
|
+
// Presentation-only: which lanes exist is derived runtime-side from the
|
|
140
|
+
// projected grants; this descriptor carries what the grants cannot — the
|
|
141
|
+
// space's display identity, the central endpoints each lane talks to, and the
|
|
142
|
+
// deterministic credential that authenticates the runtime's own
|
|
143
|
+
// server-to-server exchange calls (password, verified email, request-invite)
|
|
144
|
+
// so the central authority may trust the visitor context the runtime forwards.
|
|
145
|
+
export const runtimeAccessPageDescriptorSchema = z
|
|
146
|
+
.object({
|
|
147
|
+
displayName: z.string().min(1).max(200).nullable(),
|
|
148
|
+
// API-origin account lane (`/v1/access/acquire/<target>`), null until the
|
|
149
|
+
// space is claimed. Doubles as the silent-SSO probe target.
|
|
150
|
+
accountUrl: z.string().url().nullable(),
|
|
151
|
+
// Identity connections rendered as SSO lanes. The runtime appends
|
|
152
|
+
// `host`/`return` to `startUrl` at render time.
|
|
153
|
+
connections: z.array(z.object({
|
|
154
|
+
id: z.string().min(1).max(64),
|
|
155
|
+
label: z.string().min(1).max(200),
|
|
156
|
+
startUrl: z.string().url(),
|
|
157
|
+
})),
|
|
158
|
+
exchange: z
|
|
159
|
+
.object({
|
|
160
|
+
passwordUrl: z.string().url(),
|
|
161
|
+
// Browser entry links and integration credentials are exchanged over
|
|
162
|
+
// separate runtime-authenticated lanes. Neither credential reaches
|
|
163
|
+
// customer code.
|
|
164
|
+
linkUrl: z.string().url(),
|
|
165
|
+
tokenUrl: z.string().url(),
|
|
166
|
+
emailUrl: z.string().url(),
|
|
167
|
+
requestUrl: z.string().url(),
|
|
168
|
+
logoutUrl: z.string().url(),
|
|
169
|
+
commentsConfigUrl: z.string().url().optional(),
|
|
170
|
+
commentsTicketUrl: z.string().url().optional(),
|
|
171
|
+
commentsVersionUrlsUrl: z.string().url().optional(),
|
|
172
|
+
zeroRealtimeTicketUrl: z.string().url().optional(),
|
|
173
|
+
credential: z.string().min(32).max(256),
|
|
174
|
+
})
|
|
175
|
+
.nullable(),
|
|
176
|
+
})
|
|
177
|
+
.strict();
|
|
178
|
+
// Runtime route artifacts are compiled into an authority-keyed index. Keep a
|
|
179
|
+
// hard ceiling as a last-resort safety boundary for route-apply CPU, artifact
|
|
180
|
+
// size, and a compromised producer; indexing, not this limit, owns hot-path
|
|
181
|
+
// performance.
|
|
182
|
+
export const RUNTIME_AUTHORIZATION_GRANT_LIMIT = 1_024;
|
|
139
183
|
export const runtimeAuthorizationProjectionSchema = z
|
|
140
184
|
.object({
|
|
141
185
|
generation: z.number().int().nonnegative(),
|
|
@@ -145,13 +189,16 @@ export const runtimeAuthorizationProjectionSchema = z
|
|
|
145
189
|
sessionVersion: z.number().int().nonnegative(),
|
|
146
190
|
fence: accessFenceKindSchema,
|
|
147
191
|
acquireUrl: z.string().url(),
|
|
192
|
+
accessPage: runtimeAccessPageDescriptorSchema,
|
|
148
193
|
spaceClaimed: z.boolean(),
|
|
149
|
-
grants: z
|
|
194
|
+
grants: z
|
|
195
|
+
.array(grantSchema.extend({
|
|
150
196
|
// The durable browser session records this generation for the exact
|
|
151
197
|
// authority it acquired. Rotating or editing one credential Grant
|
|
152
198
|
// therefore removes only that authority from the session.
|
|
153
199
|
generation: z.number().int().positive(),
|
|
154
|
-
}))
|
|
200
|
+
}))
|
|
201
|
+
.max(RUNTIME_AUTHORIZATION_GRANT_LIMIT),
|
|
155
202
|
})
|
|
156
203
|
.strict();
|
|
157
204
|
const runtimeRouteConfigSchema = z.object({
|
|
@@ -233,7 +280,7 @@ const runtimeServingConfigSchema = z.object({
|
|
|
233
280
|
index: z
|
|
234
281
|
.union([z.string().min(1), z.literal(false)])
|
|
235
282
|
.optional()
|
|
236
|
-
.describe("Directory index file name, or false to disable directory index resolution."),
|
|
283
|
+
.describe("Directory index file name, or `false` to disable directory index resolution."),
|
|
237
284
|
fallback: z
|
|
238
285
|
.object({
|
|
239
286
|
path: z.string().min(1).describe("Committed file served when no exact route matches."),
|
|
@@ -246,7 +293,7 @@ const runtimeServingConfigSchema = z.object({
|
|
|
246
293
|
clean_urls: z
|
|
247
294
|
.boolean()
|
|
248
295
|
.optional()
|
|
249
|
-
.describe("
|
|
296
|
+
.describe("Serves flat `<name>.html` files at their extensionless URLs (W7.1). Defaults to on, unless the fallback is the 200-status SPA shape."),
|
|
250
297
|
listing: z
|
|
251
298
|
.boolean()
|
|
252
299
|
.optional()
|
|
@@ -257,13 +304,13 @@ const runtimeServingConfigSchema = z.object({
|
|
|
257
304
|
.describe("Generate the single-file viewer page when a version has exactly one public file."),
|
|
258
305
|
meta: z
|
|
259
306
|
.object({
|
|
260
|
-
title: z.string().max(300).optional().describe("Listing
|
|
261
|
-
description: z.string().max(1000).optional().describe("Listing
|
|
307
|
+
title: z.string().max(300).optional().describe("Listing, viewer, and OG title."),
|
|
308
|
+
description: z.string().max(1000).optional().describe("Listing, viewer, and OG description."),
|
|
262
309
|
image: z.string().max(2000).optional().describe("OG image path."),
|
|
263
310
|
})
|
|
264
311
|
.nullable()
|
|
265
312
|
.optional()
|
|
266
|
-
.describe("Finalize-resolved listing
|
|
313
|
+
.describe("Finalize-resolved listing, viewer, and OG metadata (effective SpaceConfig metadata). This value wins over session metadata."),
|
|
267
314
|
pages: runtimePagesSchema.optional(),
|
|
268
315
|
// Hidden experimental build-pipeline flag: absent on every version finalized
|
|
269
316
|
// without it (byte-identical payload to today). Only ever sent as true.
|
|
@@ -281,6 +328,7 @@ const runtimeServingConfigSchema = z.object({
|
|
|
281
328
|
cast_api_base: z.string().url().max(2000).nullable().optional(),
|
|
282
329
|
cast_ws_url: z.string().url().max(2000).nullable().optional(),
|
|
283
330
|
cast_resource_key: z.string().min(1).max(256).nullable().optional(),
|
|
331
|
+
published_comments: z.boolean().optional(),
|
|
284
332
|
})
|
|
285
333
|
.optional(),
|
|
286
334
|
// CP-validated inject snippets (<= 8 KB each, <= 16 per array); sent only
|
|
@@ -421,7 +469,6 @@ export const runtimeVersionFinalizeRequestSchema = z.object({
|
|
|
421
469
|
noindex_production_hostnames: runtimeRouteIntentSchema.shape.noindex_production_hostnames,
|
|
422
470
|
version_hostnames: runtimeRouteIntentSchema.shape.version_hostnames,
|
|
423
471
|
host_canonical_redirects: runtimeRouteIntentSchema.shape.host_canonical_redirects,
|
|
424
|
-
static_mount_routes: runtimeRouteIntentSchema.shape.static_mount_routes,
|
|
425
472
|
})
|
|
426
473
|
.optional(),
|
|
427
474
|
});
|
|
@@ -457,6 +504,11 @@ export const runtimeVersionFinalizeResponseSchema = z.object({
|
|
|
457
504
|
.optional()
|
|
458
505
|
.describe("Stable route_updated event id when finalize also activated a route."),
|
|
459
506
|
});
|
|
507
|
+
export const runtimeZeroMigrationsApplyResponseSchema = z.object({
|
|
508
|
+
space_id: z.string(),
|
|
509
|
+
version_id: z.string(),
|
|
510
|
+
applied: z.literal(true),
|
|
511
|
+
});
|
|
460
512
|
export const runtimeRouteUpdateRequestSchema = z.object({
|
|
461
513
|
version_id: z.string().min(1),
|
|
462
514
|
config: runtimeRouteConfigSchema.optional(),
|
|
@@ -471,14 +523,12 @@ export const runtimeRouteUpdateRequestSchema = z.object({
|
|
|
471
523
|
noindex_production_hostnames: runtimeRouteIntentSchema.shape.noindex_production_hostnames,
|
|
472
524
|
version_hostnames: runtimeRouteIntentSchema.shape.version_hostnames,
|
|
473
525
|
host_canonical_redirects: runtimeRouteIntentSchema.shape.host_canonical_redirects,
|
|
474
|
-
static_mount_routes: runtimeRouteIntentSchema.shape.static_mount_routes,
|
|
475
526
|
});
|
|
476
527
|
export const runtimeHostnameIntentUpdateRequestSchema = z.object({
|
|
477
528
|
production_hostnames: runtimeRouteIntentSchema.shape.production_hostnames,
|
|
478
529
|
noindex_production_hostnames: runtimeRouteIntentSchema.shape.noindex_production_hostnames,
|
|
479
530
|
version_hostnames: runtimeRouteIntentSchema.shape.version_hostnames,
|
|
480
531
|
host_canonical_redirects: runtimeRouteIntentSchema.shape.host_canonical_redirects,
|
|
481
|
-
static_mount_routes: runtimeRouteIntentSchema.shape.static_mount_routes,
|
|
482
532
|
});
|
|
483
533
|
export const runtimeRouteUpdateResponseSchema = z.object({
|
|
484
534
|
space_id: z.string(),
|
|
@@ -647,12 +697,26 @@ export const runtimeSpaceStateSchema = z.object({
|
|
|
647
697
|
space_id: z.string().min(1).describe("Space whose runtime route pointers follow."),
|
|
648
698
|
routes: z
|
|
649
699
|
.record(z.string(), z.string())
|
|
650
|
-
.describe("Route pointer map
|
|
700
|
+
.describe("Route pointer map from route name to version id currently compiled for serving."),
|
|
651
701
|
tombstone_count: z
|
|
652
702
|
.number()
|
|
653
703
|
.int()
|
|
654
704
|
.nonnegative()
|
|
655
705
|
.describe("Hostnames the runtime serves a tombstone page for on this space."),
|
|
706
|
+
// Optional for the same reason the whole block is: the control plane deploys
|
|
707
|
+
// in one step while engines pull their bundle on their own schedule, so every
|
|
708
|
+
// field added here is absent on the fleet for hours. Absence means "this
|
|
709
|
+
// engine cannot report hostname scope", never "the scope is empty" — callers
|
|
710
|
+
// must degrade rather than sign a narrower callback claim than the engine
|
|
711
|
+
// will report.
|
|
712
|
+
intent_hostnames: z
|
|
713
|
+
.array(z.string().min(1))
|
|
714
|
+
.optional()
|
|
715
|
+
.describe("Exact hostname set in the space's current route intent."),
|
|
716
|
+
hostnames: z
|
|
717
|
+
.array(z.string().min(1))
|
|
718
|
+
.optional()
|
|
719
|
+
.describe("Exact hostname union that a space deletion event carries from route intent and tombstones."),
|
|
656
720
|
});
|
|
657
721
|
export const runtimeHealthResponseSchema = z.object({
|
|
658
722
|
ok: z.literal(true),
|
|
@@ -695,7 +759,10 @@ export const runtimeStateResponseSchema = z.object({
|
|
|
695
759
|
// replays are no-ops. The object is intentionally loose: engines may journal
|
|
696
760
|
// extra diagnostic fields without breaking older control planes.
|
|
697
761
|
export const runtimeCallbackEventSchema = z.looseObject({
|
|
698
|
-
event: z
|
|
762
|
+
event: z
|
|
763
|
+
.string()
|
|
764
|
+
.min(1)
|
|
765
|
+
.describe("Journal event name, for example `route_updated` or `space_deleted`."),
|
|
699
766
|
event_id: z
|
|
700
767
|
.string()
|
|
701
768
|
.min(1)
|
|
@@ -705,6 +772,10 @@ export const runtimeCallbackEventSchema = z.looseObject({
|
|
|
705
772
|
.string()
|
|
706
773
|
.optional()
|
|
707
774
|
.describe("Control-plane operation the management call ran under."),
|
|
775
|
+
operation_action: z
|
|
776
|
+
.string()
|
|
777
|
+
.optional()
|
|
778
|
+
.describe("Runtime management action authorized for the operation."),
|
|
708
779
|
space_id: z.string().optional().describe("Space the event applies to, when space-scoped."),
|
|
709
780
|
version_id: z.string().optional().describe("Version the event applies to, when version-scoped."),
|
|
710
781
|
route_name: z.string().optional().describe("Route pointer the event updated, when route-scoped."),
|
|
@@ -716,20 +787,20 @@ export const runtimeCallbackEventSchema = z.looseObject({
|
|
|
716
787
|
changed_paths_known: z
|
|
717
788
|
.boolean()
|
|
718
789
|
.optional()
|
|
719
|
-
.describe("True when changed_paths is the complete diff, including a known-empty diff.
|
|
790
|
+
.describe("True when `changed_paths` is the complete diff, including a known-empty diff. On older engines this field is absent. There, an empty array remains the host-wide fallback."),
|
|
720
791
|
previous_version_id: previousVersionIdSchema,
|
|
721
792
|
previous_public_exposure_digest: z
|
|
722
793
|
.string()
|
|
723
794
|
.min(1)
|
|
724
795
|
.nullable()
|
|
725
796
|
.optional()
|
|
726
|
-
.describe("Public-exposure digest stored before a route config write. Field presence proves the route already existed
|
|
797
|
+
.describe("Public-exposure digest stored before a route config write. Field presence proves the route already existed. Null means the previous projection was unreadable."),
|
|
727
798
|
public_exposure_digest: z
|
|
728
799
|
.string()
|
|
729
800
|
.min(1)
|
|
730
801
|
.nullable()
|
|
731
802
|
.optional()
|
|
732
|
-
.describe("Public-exposure digest stored by the route config write
|
|
803
|
+
.describe("Public-exposure digest stored by the route config write. Null means the incoming projection was unreadable."),
|
|
733
804
|
previous_public_exposure: runtimePublicExposureDescriptorSchema
|
|
734
805
|
.nullable()
|
|
735
806
|
.optional()
|
|
@@ -784,7 +855,7 @@ export const runtimeEventsDrainResponseSchema = z.object({
|
|
|
784
855
|
.int()
|
|
785
856
|
.nonnegative()
|
|
786
857
|
.optional()
|
|
787
|
-
.describe("Journal entries not returned because of the response cap, another active lease, or this session's failed-delivery deferral.
|
|
858
|
+
.describe("Journal entries not returned because of the response cap, another active lease, or this session's failed-delivery deferral. A non-zero value means a later page or repair session still has work."),
|
|
788
859
|
// The drain is pull-first: the caller IS the control plane and is blocked on
|
|
789
860
|
// this response, so the engine hands its journal back here instead of posting
|
|
790
861
|
// each event over a separate HTTP round trip. Processing replays are no-ops
|
|
@@ -793,6 +864,7 @@ export const runtimeEventsDrainResponseSchema = z.object({
|
|
|
793
864
|
.array(z.object({
|
|
794
865
|
delivery_id: z.string().min(1),
|
|
795
866
|
operation_id: z.string().optional(),
|
|
867
|
+
callback_token: z.string().min(1),
|
|
796
868
|
event: runtimeCallbackEventSchema,
|
|
797
869
|
}))
|
|
798
870
|
.optional(),
|
|
@@ -48,13 +48,14 @@ export declare const runtimeAppSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
48
48
|
blockIncompatibleRollback: z.ZodLiteral<true>;
|
|
49
49
|
}, z.core.$strict>;
|
|
50
50
|
realtime: z.ZodObject<{
|
|
51
|
-
production: z.ZodLiteral<"
|
|
51
|
+
production: z.ZodLiteral<"central">;
|
|
52
52
|
local: z.ZodLiteral<"foreground-cli-ws">;
|
|
53
53
|
}, z.core.$strict>;
|
|
54
54
|
}, z.core.$strict>;
|
|
55
55
|
tables: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
56
56
|
queries: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
57
57
|
mutations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
58
|
+
actions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
58
59
|
endpoints: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
59
60
|
method: z.ZodEnum<{
|
|
60
61
|
POST: "POST";
|
|
@@ -68,16 +69,17 @@ export declare const runtimeAppSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
68
69
|
path: z.ZodString;
|
|
69
70
|
}, z.core.$strict>>>;
|
|
70
71
|
sockets: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
72
|
+
migrationCount: z.ZodNumber;
|
|
73
|
+
schemaHash: z.ZodNullable<z.ZodString>;
|
|
71
74
|
variables: z.ZodObject<{
|
|
72
75
|
source: z.ZodLiteral<"stattic-variables">;
|
|
73
76
|
names: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
74
77
|
}, z.core.$strict>;
|
|
75
78
|
realtime: z.ZodObject<{
|
|
76
79
|
mode: z.ZodEnum<{
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"local-websocket": "local-websocket";
|
|
80
|
+
local: "local";
|
|
81
|
+
cast: "cast";
|
|
82
|
+
central: "central";
|
|
81
83
|
}>;
|
|
82
84
|
centralUrl: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
83
85
|
path: z.ZodOptional<z.ZodString>;
|
|
@@ -86,6 +88,7 @@ export declare const runtimeAppSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
86
88
|
runPath: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
87
89
|
runUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
88
90
|
resourceKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
91
|
+
ticketPath: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
89
92
|
socketPath: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
90
93
|
spaceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
91
94
|
versionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -124,15 +127,42 @@ export declare const runtimeAppSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
124
127
|
serving: "serving";
|
|
125
128
|
}>;
|
|
126
129
|
bundleSize: z.ZodNumber;
|
|
130
|
+
bundleSha256: z.ZodString;
|
|
127
131
|
variables: z.ZodObject<{
|
|
128
132
|
source: z.ZodLiteral<"spacefast-variables">;
|
|
129
133
|
names: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
130
134
|
}, z.core.$strict>;
|
|
131
|
-
inspect: z.ZodObject<{
|
|
132
|
-
policy: z.ZodEnum<{
|
|
133
|
-
public: "public";
|
|
134
|
-
private: "private";
|
|
135
|
-
}>;
|
|
136
|
-
}, z.core.$strict>;
|
|
137
135
|
}, z.core.$strict>], "runtimeKind">;
|
|
138
136
|
export type RuntimeApp = z.infer<typeof runtimeAppSchema>;
|
|
137
|
+
/**
|
|
138
|
+
* Replay of the invalidation events a live runtime emitted.
|
|
139
|
+
*
|
|
140
|
+
* The event shape itself is Zero's — it names mutations, changed tables and
|
|
141
|
+
* changed queries, which only a capsule has — but the route that serves it is
|
|
142
|
+
* the runtime family's, so the page contract lives here beside the rest of the
|
|
143
|
+
* unified surface rather than inside one product.
|
|
144
|
+
*/
|
|
145
|
+
export declare const runtimeRealtimeEventListQuerySchema: z.ZodObject<{
|
|
146
|
+
afterEventId: z.ZodOptional<z.ZodString>;
|
|
147
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
148
|
+
}, z.core.$strict>;
|
|
149
|
+
export type RuntimeRealtimeEventListQuery = z.infer<typeof runtimeRealtimeEventListQuerySchema>;
|
|
150
|
+
export declare const runtimeRealtimeEventListResponseSchema: z.ZodObject<{
|
|
151
|
+
data: z.ZodArray<z.ZodObject<{
|
|
152
|
+
eventId: z.ZodString;
|
|
153
|
+
spaceId: z.ZodString;
|
|
154
|
+
versionId: z.ZodNullable<z.ZodString>;
|
|
155
|
+
runtimeKind: z.ZodLiteral<"zero">;
|
|
156
|
+
requestId: z.ZodString;
|
|
157
|
+
mutationName: z.ZodString;
|
|
158
|
+
changedTables: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
159
|
+
changedQueries: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
160
|
+
schemaHash: z.ZodString;
|
|
161
|
+
committedAt: z.ZodString;
|
|
162
|
+
}, z.core.$strict>>;
|
|
163
|
+
pagination: z.ZodObject<{
|
|
164
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
165
|
+
hasMore: z.ZodBoolean;
|
|
166
|
+
}, z.core.$strip>;
|
|
167
|
+
}, z.core.$strict>;
|
|
168
|
+
export type RuntimeRealtimeEventListResponse = z.infer<typeof runtimeRealtimeEventListResponseSchema>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { CursorPaginationSchema } from "./common.js";
|
|
2
3
|
import { functionsAppSchema } from "./functions.js";
|
|
3
|
-
import { zeroAppSchema } from "./zero.js";
|
|
4
|
+
import { zeroAppSchema, zeroRealtimeEventSchema } from "./zero.js";
|
|
4
5
|
/**
|
|
5
6
|
* The one answer to "what is running on this space".
|
|
6
7
|
*
|
|
@@ -19,3 +20,23 @@ export const runtimeAppSchema = z.discriminatedUnion("runtimeKind", [
|
|
|
19
20
|
zeroAppSchema,
|
|
20
21
|
functionsAppSchema,
|
|
21
22
|
]);
|
|
23
|
+
/**
|
|
24
|
+
* Replay of the invalidation events a live runtime emitted.
|
|
25
|
+
*
|
|
26
|
+
* The event shape itself is Zero's — it names mutations, changed tables and
|
|
27
|
+
* changed queries, which only a capsule has — but the route that serves it is
|
|
28
|
+
* the runtime family's, so the page contract lives here beside the rest of the
|
|
29
|
+
* unified surface rather than inside one product.
|
|
30
|
+
*/
|
|
31
|
+
export const runtimeRealtimeEventListQuerySchema = z
|
|
32
|
+
.object({
|
|
33
|
+
afterEventId: z.string().min(1).optional(),
|
|
34
|
+
limit: z.coerce.number().int().min(1).max(100).default(50),
|
|
35
|
+
})
|
|
36
|
+
.strict();
|
|
37
|
+
export const runtimeRealtimeEventListResponseSchema = z
|
|
38
|
+
.object({
|
|
39
|
+
data: z.array(zeroRealtimeEventSchema),
|
|
40
|
+
pagination: CursorPaginationSchema,
|
|
41
|
+
})
|
|
42
|
+
.strict();
|