@sealant/api-contracts-next 0.40.0-next.791 → 0.40.0-next.793
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/core-api/control-plane.d.ts +1000 -798
- package/dist/core-api/workspaces.d.ts +584 -16
- package/dist/core-api/workspaces.js +87 -3
- package/package.json +2 -2
|
@@ -23,8 +23,10 @@ export const workspaceStatusSchema = Schema.Literals([
|
|
|
23
23
|
"stopped",
|
|
24
24
|
"retained",
|
|
25
25
|
]);
|
|
26
|
+
/** Request families. A deployment registers only the adapters it can actually launch. */
|
|
27
|
+
export const runtimeAdapterIds = ["docker", "k8s", "k3s", "cloudflare", "microvm", "boat"];
|
|
26
28
|
export const workspaceRuntimeSchema = Schema.Struct({
|
|
27
|
-
adapter: Schema.Literals(
|
|
29
|
+
adapter: Schema.Literals(runtimeAdapterIds),
|
|
28
30
|
/**
|
|
29
31
|
* The executor's identity on its runtime: the Docker container id, the Pod name, the MicroVM
|
|
30
32
|
* id. This is the id a caller records at launch and names in a stop's `completion`.
|
|
@@ -50,7 +52,7 @@ export const workspaceSshTargetSchema = Schema.Struct({
|
|
|
50
52
|
workspaceId: NonEmptyString,
|
|
51
53
|
attemptId: NonEmptyString,
|
|
52
54
|
runtime: Schema.Struct({
|
|
53
|
-
adapter: Schema.Literals(
|
|
55
|
+
adapter: Schema.Literals(runtimeAdapterIds),
|
|
54
56
|
resourceId: NonEmptyString,
|
|
55
57
|
reference: NonEmptyString,
|
|
56
58
|
status: Schema.Literals(["pending", "running", "ready", "failed", "stopped"]),
|
|
@@ -116,6 +118,61 @@ export const workspacePublishedImageSchema = Schema.Struct({
|
|
|
116
118
|
/** Absent from control planes before the per-person capability. */
|
|
117
119
|
personLayout: Schema.optional(workspaceImagePersonLayoutSchema),
|
|
118
120
|
});
|
|
121
|
+
/** Public artifact facts. Native provenance remains readable without authorizing execution. */
|
|
122
|
+
export const workspacePublicationSchema = Schema.Union([
|
|
123
|
+
Schema.Struct({
|
|
124
|
+
kind: Schema.Literal("oci"),
|
|
125
|
+
publicationId: NonEmptyString,
|
|
126
|
+
image: Schema.Struct({
|
|
127
|
+
repository: NonEmptyString,
|
|
128
|
+
tag: NonEmptyString,
|
|
129
|
+
reference: NonEmptyString,
|
|
130
|
+
digestReference: NonEmptyString,
|
|
131
|
+
digest: NonEmptyString,
|
|
132
|
+
}),
|
|
133
|
+
}),
|
|
134
|
+
Schema.Struct({
|
|
135
|
+
kind: Schema.Literal("microvm"),
|
|
136
|
+
publicationId: NonEmptyString,
|
|
137
|
+
image: Schema.Struct({
|
|
138
|
+
imageArn: NonEmptyString,
|
|
139
|
+
imageVersion: NonEmptyString,
|
|
140
|
+
planHash: NonEmptyString,
|
|
141
|
+
}),
|
|
142
|
+
}),
|
|
143
|
+
Schema.Struct({
|
|
144
|
+
kind: Schema.Literal("boat-native"),
|
|
145
|
+
publicationId: NonEmptyString,
|
|
146
|
+
snapshot: Schema.Struct({
|
|
147
|
+
kind: Schema.Literal("boat-saved-snapshot"),
|
|
148
|
+
owner: NonEmptyString,
|
|
149
|
+
build: NonEmptyString,
|
|
150
|
+
recipeHash: NonEmptyString,
|
|
151
|
+
receiptHash: NonEmptyString,
|
|
152
|
+
identity: Schema.Struct({
|
|
153
|
+
name: NonEmptyString,
|
|
154
|
+
sourceSandboxId: NonEmptyString,
|
|
155
|
+
createdAt: NonEmptyString,
|
|
156
|
+
snapshotId: Schema.optional(NonEmptyString),
|
|
157
|
+
}),
|
|
158
|
+
}),
|
|
159
|
+
evidence: Schema.Struct({
|
|
160
|
+
recipeHash: NonEmptyString,
|
|
161
|
+
receiptHash: NonEmptyString,
|
|
162
|
+
assetsHash: NonEmptyString,
|
|
163
|
+
runtime: Schema.Struct({
|
|
164
|
+
source: NonEmptyString,
|
|
165
|
+
platform: Schema.Literal("linux/amd64"),
|
|
166
|
+
manifest: NonEmptyString,
|
|
167
|
+
sealantd: NonEmptyString,
|
|
168
|
+
socat: NonEmptyString,
|
|
169
|
+
relay: NonEmptyString,
|
|
170
|
+
}),
|
|
171
|
+
daemonRecovery: Schema.Literals(["supported", "unsupported", "unknown"]),
|
|
172
|
+
executorRecovery: Schema.Literal("unverified"),
|
|
173
|
+
}),
|
|
174
|
+
}),
|
|
175
|
+
]);
|
|
119
176
|
export const workspaceErrorSchema = Schema.Struct({
|
|
120
177
|
message: Schema.String,
|
|
121
178
|
code: Schema.optional(NonEmptyString),
|
|
@@ -137,6 +194,8 @@ export const createWorkspaceCredentialsSchema = Schema.Struct({
|
|
|
137
194
|
github: Schema.optional(NonEmptyString),
|
|
138
195
|
});
|
|
139
196
|
export const createWorkspaceRequestSchema = Schema.Struct({
|
|
197
|
+
/** Existing resource domain for image reuse only. Omitted selects the authenticated owner. */
|
|
198
|
+
imageScopeId: Schema.optional(NonEmptyString),
|
|
140
199
|
ownerUserId: PersonId,
|
|
141
200
|
registryId: NonEmptyString,
|
|
142
201
|
repository: NonEmptyString,
|
|
@@ -644,6 +703,7 @@ export const restartWorkspaceResponseSchema = Schema.Struct({
|
|
|
644
703
|
* image published for that plan answers. Nothing is created, built or reserved.
|
|
645
704
|
*/
|
|
646
705
|
export const inspectWorkspaceImageRequestSchema = Schema.Struct({
|
|
706
|
+
imageScopeId: Schema.optional(NonEmptyString),
|
|
647
707
|
ownerUserId: PersonId,
|
|
648
708
|
registryId: NonEmptyString,
|
|
649
709
|
/** The spec a create would send (`CreateWorkspaceRequest.spec`). */
|
|
@@ -654,6 +714,7 @@ export const inspectWorkspaceImageResponseSchema = Schema.Struct({
|
|
|
654
714
|
planHash: NonEmptyString,
|
|
655
715
|
/** The latest image published for the plan; absent when none has been built yet. */
|
|
656
716
|
publishedImage: Schema.optional(workspacePublishedImageSchema),
|
|
717
|
+
publication: Schema.optional(workspacePublicationSchema),
|
|
657
718
|
/** The image's per-person capability (`unknown` when none has been built yet). */
|
|
658
719
|
personLayout: workspaceImagePersonLayoutSchema,
|
|
659
720
|
});
|
|
@@ -971,6 +1032,7 @@ export const workspaceSummarySchema = Schema.Struct({
|
|
|
971
1032
|
tag: Schema.optional(NonEmptyString),
|
|
972
1033
|
runtime: Schema.optional(workspaceRuntimeSchema),
|
|
973
1034
|
publishedImage: Schema.optional(workspacePublishedImageSchema),
|
|
1035
|
+
publication: Schema.optional(workspacePublicationSchema),
|
|
974
1036
|
/** See `workspaceProcessUserCapabilitySchema`. Absent from older control planes. */
|
|
975
1037
|
processUser: Schema.optional(workspaceProcessUserCapabilitySchema),
|
|
976
1038
|
error: Schema.optional(workspaceErrorSchema),
|
|
@@ -1069,6 +1131,7 @@ export const workspaceDetailsSchema = Schema.Struct({
|
|
|
1069
1131
|
tag: Schema.optional(NonEmptyString),
|
|
1070
1132
|
runtime: Schema.optional(workspaceRuntimeSchema),
|
|
1071
1133
|
publishedImage: Schema.optional(workspacePublishedImageSchema),
|
|
1134
|
+
publication: Schema.optional(workspacePublicationSchema),
|
|
1072
1135
|
/** See `workspaceProcessUserCapabilitySchema`. Absent from older control planes. */
|
|
1073
1136
|
processUser: Schema.optional(workspaceProcessUserCapabilitySchema),
|
|
1074
1137
|
error: Schema.optional(workspaceErrorSchema),
|
|
@@ -1115,6 +1178,7 @@ export const workspaceAttemptSummarySchema = Schema.Struct({
|
|
|
1115
1178
|
triggerRef: Schema.optional(NonEmptyString),
|
|
1116
1179
|
runtime: Schema.optional(workspaceRuntimeSchema),
|
|
1117
1180
|
publishedImage: Schema.optional(workspacePublishedImageSchema),
|
|
1181
|
+
publication: Schema.optional(workspacePublicationSchema),
|
|
1118
1182
|
error: Schema.optional(workspaceErrorSchema),
|
|
1119
1183
|
spec: Schema.optional(Schema.Unknown),
|
|
1120
1184
|
queuedAt: Schema.String,
|
|
@@ -1189,6 +1253,16 @@ export class WorkspaceRuntimeEnvReferencesUnsupportedError extends Schema.Tagged
|
|
|
1189
1253
|
code: Schema.Literals(["runtime-env-references-unsupported"]),
|
|
1190
1254
|
}, { httpApiStatus: 422 }) {
|
|
1191
1255
|
}
|
|
1256
|
+
/** A native runtime requirement refused before any new create is reserved. */
|
|
1257
|
+
export class WorkspaceRuntimeRequirementUnsupportedError extends Schema.TaggedError()("WorkspaceRuntimeRequirementUnsupportedError", {
|
|
1258
|
+
message: Schema.String,
|
|
1259
|
+
code: Schema.Literals([
|
|
1260
|
+
"runtime-os-unsupported",
|
|
1261
|
+
"runtime-requirement-unsupported",
|
|
1262
|
+
"workspace-docker-unsupported",
|
|
1263
|
+
]),
|
|
1264
|
+
}, { httpApiStatus: 422 }) {
|
|
1265
|
+
}
|
|
1192
1266
|
/**
|
|
1193
1267
|
* `services.docker` requested on an install whose workspace runtime cannot serve it. Kubernetes
|
|
1194
1268
|
* needs its operator-enabled rootless sidecar. Lambda MicroVMs need a separate Docker-capable
|
|
@@ -1250,6 +1324,7 @@ export class WorkspaceBadGatewayError extends Schema.TaggedError()("WorkspaceBad
|
|
|
1250
1324
|
}
|
|
1251
1325
|
export class WorkspaceServiceUnavailableError extends Schema.TaggedError()("WorkspaceServiceUnavailableError", {
|
|
1252
1326
|
message: Schema.String,
|
|
1327
|
+
code: Schema.optional(NonEmptyString),
|
|
1253
1328
|
}, { httpApiStatus: 503 }) {
|
|
1254
1329
|
}
|
|
1255
1330
|
export class WorkspaceInternalServerError extends Schema.TaggedError()("WorkspaceInternalServerError", {
|
|
@@ -1268,6 +1343,7 @@ export const WorkspacesGroup = HttpApiGroup.make("workspaces")
|
|
|
1268
1343
|
WorkspaceBadRequestError,
|
|
1269
1344
|
WorkspaceRuntimeEnvReferencesUnsupportedError,
|
|
1270
1345
|
WorkspaceDockerServiceUnsupportedError,
|
|
1346
|
+
WorkspaceRuntimeRequirementUnsupportedError,
|
|
1271
1347
|
WorkspaceForbiddenError,
|
|
1272
1348
|
WorkspaceSshOwnerRefusedError,
|
|
1273
1349
|
WorkspaceNotFoundError,
|
|
@@ -1456,6 +1532,8 @@ HttpApiEndpoint.post("restartWorkspace", "/:workspaceId/restart", {
|
|
|
1456
1532
|
// The workspace has never launched (no spec to relaunch from) or is mid-launch.
|
|
1457
1533
|
WorkspaceConflictError,
|
|
1458
1534
|
WorkspaceBadGatewayError,
|
|
1535
|
+
WorkspaceServiceUnavailableError,
|
|
1536
|
+
WorkspaceRuntimeRequirementUnsupportedError,
|
|
1459
1537
|
WorkspaceInternalServerError,
|
|
1460
1538
|
],
|
|
1461
1539
|
}))
|
|
@@ -1464,7 +1542,13 @@ HttpApiEndpoint.post("restartWorkspace", "/:workspaceId/restart", {
|
|
|
1464
1542
|
HttpApiEndpoint.post("inspectWorkspaceImage", "/image", {
|
|
1465
1543
|
payload: inspectWorkspaceImageRequestSchema,
|
|
1466
1544
|
success: inspectWorkspaceImageResponseSchema,
|
|
1467
|
-
error: [
|
|
1545
|
+
error: [
|
|
1546
|
+
WorkspaceBadRequestError,
|
|
1547
|
+
WorkspaceNotFoundError,
|
|
1548
|
+
WorkspaceRuntimeRequirementUnsupportedError,
|
|
1549
|
+
WorkspaceServiceUnavailableError,
|
|
1550
|
+
WorkspaceInternalServerError,
|
|
1551
|
+
],
|
|
1468
1552
|
}))
|
|
1469
1553
|
.add(
|
|
1470
1554
|
// Synchronous: the files are written over the control connection before this answers.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sealant/api-contracts-next",
|
|
3
|
-
"version": "0.40.0-next.
|
|
3
|
+
"version": "0.40.0-next.793",
|
|
4
4
|
"description": "Contract-first HTTP API definitions for Sealant services",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"effect": "^4.0.5"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "c97cceaf8e68c9e480b60c2fe414db553d36ce0b",
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
}
|