@sealant/api-contracts-next 0.40.0-next.854 → 0.40.0-next.857
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.
|
@@ -333,6 +333,20 @@ declare const ResourceWorkspaceLinkedElsewhereError_base: Schema.Class<ResourceW
|
|
|
333
333
|
/** A workspace links to one domain; it is linked to `resourceDomainId`. */
|
|
334
334
|
export declare class ResourceWorkspaceLinkedElsewhereError extends ResourceWorkspaceLinkedElsewhereError_base {
|
|
335
335
|
}
|
|
336
|
+
declare const ResourceWorkspaceWithoutResourcesError_base: Schema.Class<ResourceWorkspaceWithoutResourcesError, Schema.TaggedStruct<"ResourceWorkspaceWithoutResourcesError", {
|
|
337
|
+
readonly message: Schema.String;
|
|
338
|
+
readonly code: Schema.Literals<readonly ["workspace-without-resources"]>;
|
|
339
|
+
}>, import("effect/Cause").YieldableError>;
|
|
340
|
+
/**
|
|
341
|
+
* The workspace was created never to be linked to resources (`spec.runtime.resources: "none"`) and
|
|
342
|
+
* runs on a runtime that gives a workspace its way to reach resources at launch or never (Boat).
|
|
343
|
+
* Nothing was written, and the workspace's running executor is unchanged. Create the workspace
|
|
344
|
+
* again without the option and link that one: it reaches the resources from its next start. Docker
|
|
345
|
+
* and Kubernetes never answer this: they attach resources to a running workspace, so they link a
|
|
346
|
+
* workspace created with the option as they link any other.
|
|
347
|
+
*/
|
|
348
|
+
export declare class ResourceWorkspaceWithoutResourcesError extends ResourceWorkspaceWithoutResourcesError_base {
|
|
349
|
+
}
|
|
336
350
|
declare const ResourceInstanceBusyError_base: Schema.Class<ResourceInstanceBusyError, Schema.TaggedStruct<"ResourceInstanceBusyError", {
|
|
337
351
|
readonly message: Schema.String;
|
|
338
352
|
}>, import("effect/Cause").YieldableError>;
|
|
@@ -505,7 +519,7 @@ export declare const ResourceInstancesGroup: HttpApiGroup.HttpApiGroup<"resource
|
|
|
505
519
|
readonly aliases: Schema.NullOr<Schema.$Record<Schema.brand<Schema.String, "ResourceInstanceAlias">, Schema.Literals<readonly ["project", "worktree"]>>>;
|
|
506
520
|
/** How many of the workspace's live executors were attached by this call. */
|
|
507
521
|
readonly attachedExecutors: Schema.Int;
|
|
508
|
-
}>>, Schema.toCodecJson<typeof ResourceDomainForbiddenError | typeof ResourceDomainNotFoundError | typeof ResourceDomainInternalServerError | typeof ResourceInstanceSpecRefusedError | typeof ResourceRuntimeUnsupportedError | typeof ResourceDomainNotActiveError | typeof ResourceWorkspaceNotFoundError | typeof ResourceWorkspaceLinkedElsewhereError | typeof ResourceInstanceBusyError | typeof ResourceInstanceBudgetError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listResourceInstances", "GET", "/:resourceDomainId/instances", Schema.toCodecStringTree<Schema.Struct<{
|
|
522
|
+
}>>, Schema.toCodecJson<typeof ResourceDomainForbiddenError | typeof ResourceDomainNotFoundError | typeof ResourceDomainInternalServerError | typeof ResourceInstanceSpecRefusedError | typeof ResourceRuntimeUnsupportedError | typeof ResourceDomainNotActiveError | typeof ResourceWorkspaceNotFoundError | typeof ResourceWorkspaceLinkedElsewhereError | typeof ResourceWorkspaceWithoutResourcesError | typeof ResourceInstanceBusyError | typeof ResourceInstanceBudgetError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listResourceInstances", "GET", "/:resourceDomainId/instances", Schema.toCodecStringTree<Schema.Struct<{
|
|
509
523
|
readonly resourceDomainId: Schema.String;
|
|
510
524
|
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
511
525
|
/** `true`: the archived instances, whose volumes are kept. Otherwise every other one. */
|
|
@@ -291,6 +291,16 @@ export class ResourceWorkspaceNotFoundError extends Schema.TaggedError()("Resour
|
|
|
291
291
|
/** A workspace links to one domain; it is linked to `resourceDomainId`. */
|
|
292
292
|
export class ResourceWorkspaceLinkedElsewhereError extends Schema.TaggedError()("ResourceWorkspaceLinkedElsewhereError", { message: Schema.String, resourceDomainId: Schema.String }, { httpApiStatus: 409 }) {
|
|
293
293
|
}
|
|
294
|
+
/**
|
|
295
|
+
* The workspace was created never to be linked to resources (`spec.runtime.resources: "none"`) and
|
|
296
|
+
* runs on a runtime that gives a workspace its way to reach resources at launch or never (Boat).
|
|
297
|
+
* Nothing was written, and the workspace's running executor is unchanged. Create the workspace
|
|
298
|
+
* again without the option and link that one: it reaches the resources from its next start. Docker
|
|
299
|
+
* and Kubernetes never answer this: they attach resources to a running workspace, so they link a
|
|
300
|
+
* workspace created with the option as they link any other.
|
|
301
|
+
*/
|
|
302
|
+
export class ResourceWorkspaceWithoutResourcesError extends Schema.TaggedError()("ResourceWorkspaceWithoutResourcesError", { message: Schema.String, code: Schema.Literals(["workspace-without-resources"]) }, { httpApiStatus: 409 }) {
|
|
303
|
+
}
|
|
294
304
|
/** Another lifecycle operation holds the instance. Retry after it finishes. */
|
|
295
305
|
export class ResourceInstanceBusyError extends Schema.TaggedError()("ResourceInstanceBusyError", { message: Schema.String }, { httpApiStatus: 409 }) {
|
|
296
306
|
}
|
|
@@ -376,6 +386,7 @@ export const ResourceInstancesGroup = HttpApiGroup.make("resourceInstances")
|
|
|
376
386
|
...baseErrors,
|
|
377
387
|
ResourceWorkspaceNotFoundError,
|
|
378
388
|
ResourceWorkspaceLinkedElsewhereError,
|
|
389
|
+
ResourceWorkspaceWithoutResourcesError,
|
|
379
390
|
ResourceDomainNotActiveError,
|
|
380
391
|
ResourceRuntimeUnsupportedError,
|
|
381
392
|
],
|
|
@@ -192,6 +192,27 @@ export declare const createWorkspaceCredentialsSchema: Schema.Struct<{
|
|
|
192
192
|
readonly github: Schema.optional<Schema.String>;
|
|
193
193
|
}>;
|
|
194
194
|
export type CreateWorkspaceCredentials = typeof createWorkspaceCredentialsSchema.Type;
|
|
195
|
+
/**
|
|
196
|
+
* `spec.runtime.resources` of a create: this workspace will never be linked to project resources
|
|
197
|
+
* (`PUT /v1/resource-domains/:id/workspace-links/:workspaceId`). Absent, a workspace may be linked,
|
|
198
|
+
* as before the option existed, on every runtime.
|
|
199
|
+
*
|
|
200
|
+
* What it buys is runtime-specific. On Boat a workspace's way to reach resources is built when it
|
|
201
|
+
* launches (a gateway on Core's Docker host, a tunnel and a resolver in the VM); with `"none"`
|
|
202
|
+
* none of it is built, the workspace is ready sooner, and a Boat deployment with no resource
|
|
203
|
+
* gateway can run it. A later link of such a workspace is refused there
|
|
204
|
+
* (`ResourceWorkspaceWithoutResourcesError`, 409). A Boat deployment with no resource gateway
|
|
205
|
+
* refuses a Boat workspace created without the option before it is built: the launch fails with
|
|
206
|
+
* `WORKSPACE_GATEWAY_UNAVAILABLE_CODE` as the workspace's `error.code`. Docker and Kubernetes
|
|
207
|
+
* attach resources to a running workspace, so they do not enforce the option: a later link works.
|
|
208
|
+
*/
|
|
209
|
+
export declare const WORKSPACE_RESOURCES_NONE = "none";
|
|
210
|
+
/**
|
|
211
|
+
* `error.code` of a workspace whose launch a Boat deployment with no resource gateway refused: the
|
|
212
|
+
* workspace may be linked to resources (it was created without `runtime.resources: "none"`), and
|
|
213
|
+
* this deployment has nothing to reach them through. Nothing was built and no VM was created.
|
|
214
|
+
*/
|
|
215
|
+
export declare const WORKSPACE_GATEWAY_UNAVAILABLE_CODE = "gateway-unavailable";
|
|
195
216
|
export declare const createWorkspaceRequestSchema: Schema.Struct<{
|
|
196
217
|
/** Existing resource domain for image reuse only. Omitted selects the authenticated owner. */
|
|
197
218
|
readonly imageScopeId: Schema.optional<Schema.String>;
|
|
@@ -218,6 +239,12 @@ export declare const createWorkspaceRequestSchema: Schema.Struct<{
|
|
|
218
239
|
readonly codex: Schema.optional<Schema.String>;
|
|
219
240
|
readonly github: Schema.optional<Schema.String>;
|
|
220
241
|
}>>;
|
|
242
|
+
/**
|
|
243
|
+
* The workspace's spec (the blueprint in `@sealant/validators`), stored with the workspace and
|
|
244
|
+
* read again by every restart. `runtime.resources: "none"` in it is the caller's statement that
|
|
245
|
+
* this workspace will never be linked to project resources (see
|
|
246
|
+
* `WORKSPACE_RESOURCES_NONE`).
|
|
247
|
+
*/
|
|
221
248
|
readonly spec: Schema.Unknown;
|
|
222
249
|
readonly secretEnv: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
223
250
|
readonly captureToken: Schema.optional<Schema.String>;
|
|
@@ -2507,6 +2534,12 @@ export declare const WorkspacesGroup: HttpApiGroup.HttpApiGroup<"workspaces", Ht
|
|
|
2507
2534
|
readonly codex: Schema.optional<Schema.String>;
|
|
2508
2535
|
readonly github: Schema.optional<Schema.String>;
|
|
2509
2536
|
}>>;
|
|
2537
|
+
/**
|
|
2538
|
+
* The workspace's spec (the blueprint in `@sealant/validators`), stored with the workspace and
|
|
2539
|
+
* read again by every restart. `runtime.resources: "none"` in it is the caller's statement that
|
|
2540
|
+
* this workspace will never be linked to project resources (see
|
|
2541
|
+
* `WORKSPACE_RESOURCES_NONE`).
|
|
2542
|
+
*/
|
|
2510
2543
|
readonly spec: Schema.Unknown;
|
|
2511
2544
|
readonly secretEnv: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
2512
2545
|
readonly captureToken: Schema.optional<Schema.String>;
|
|
@@ -193,6 +193,27 @@ export const createWorkspaceCredentialsSchema = Schema.Struct({
|
|
|
193
193
|
codex: Schema.optional(NonEmptyString),
|
|
194
194
|
github: Schema.optional(NonEmptyString),
|
|
195
195
|
});
|
|
196
|
+
/**
|
|
197
|
+
* `spec.runtime.resources` of a create: this workspace will never be linked to project resources
|
|
198
|
+
* (`PUT /v1/resource-domains/:id/workspace-links/:workspaceId`). Absent, a workspace may be linked,
|
|
199
|
+
* as before the option existed, on every runtime.
|
|
200
|
+
*
|
|
201
|
+
* What it buys is runtime-specific. On Boat a workspace's way to reach resources is built when it
|
|
202
|
+
* launches (a gateway on Core's Docker host, a tunnel and a resolver in the VM); with `"none"`
|
|
203
|
+
* none of it is built, the workspace is ready sooner, and a Boat deployment with no resource
|
|
204
|
+
* gateway can run it. A later link of such a workspace is refused there
|
|
205
|
+
* (`ResourceWorkspaceWithoutResourcesError`, 409). A Boat deployment with no resource gateway
|
|
206
|
+
* refuses a Boat workspace created without the option before it is built: the launch fails with
|
|
207
|
+
* `WORKSPACE_GATEWAY_UNAVAILABLE_CODE` as the workspace's `error.code`. Docker and Kubernetes
|
|
208
|
+
* attach resources to a running workspace, so they do not enforce the option: a later link works.
|
|
209
|
+
*/
|
|
210
|
+
export const WORKSPACE_RESOURCES_NONE = "none";
|
|
211
|
+
/**
|
|
212
|
+
* `error.code` of a workspace whose launch a Boat deployment with no resource gateway refused: the
|
|
213
|
+
* workspace may be linked to resources (it was created without `runtime.resources: "none"`), and
|
|
214
|
+
* this deployment has nothing to reach them through. Nothing was built and no VM was created.
|
|
215
|
+
*/
|
|
216
|
+
export const WORKSPACE_GATEWAY_UNAVAILABLE_CODE = "gateway-unavailable";
|
|
196
217
|
export const createWorkspaceRequestSchema = Schema.Struct({
|
|
197
218
|
/** Existing resource domain for image reuse only. Omitted selects the authenticated owner. */
|
|
198
219
|
imageScopeId: Schema.optional(NonEmptyString),
|
|
@@ -204,6 +225,12 @@ export const createWorkspaceRequestSchema = Schema.Struct({
|
|
|
204
225
|
sourceSelection: Schema.optional(githubWorkspaceSourceSelectionSchema),
|
|
205
226
|
dotfilesSelection: Schema.optional(githubWorkspaceSourceSelectionSchema),
|
|
206
227
|
credentials: Schema.optional(createWorkspaceCredentialsSchema),
|
|
228
|
+
/**
|
|
229
|
+
* The workspace's spec (the blueprint in `@sealant/validators`), stored with the workspace and
|
|
230
|
+
* read again by every restart. `runtime.resources: "none"` in it is the caller's statement that
|
|
231
|
+
* this workspace will never be linked to project resources (see
|
|
232
|
+
* `WORKSPACE_RESOURCES_NONE`).
|
|
233
|
+
*/
|
|
207
234
|
spec: Schema.Unknown,
|
|
208
235
|
// The transient secret channel: validated by `parseWorkspaceSecretEnv`, encrypted at rest on
|
|
209
236
|
// the build job until launch, delivered to the workspace daemon as a boot file, and NEVER part
|
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.857",
|
|
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": "3bc545ab218e56eda4903aca4f202921b3cde82b",
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
}
|