@sealant/sdk-next 0.40.0-next.757 → 0.40.0-next.759

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.
@@ -24,6 +24,16 @@ export const toRuntimeInfo = (runtime) => ({
24
24
  // concurrent stop while ready() polls must surface immediately, not as a 10-minute timeout.
25
25
  // "retained" too: the executor ended and is kept for recovery; it never becomes ready.
26
26
  const FAILED_STATUSES = new Set(["failed", "cancelled", "stopped", "retained"]);
27
+ const OWNER_MAP_REFUSAL_CODES = new Set(["owner-map-unsupported", "owner-map-unverified"]);
28
+ const readyFailureCode = (code) => {
29
+ if (code === "image-build-stalled")
30
+ return "workspace_image_build_stalled";
31
+ if (code === "image-build-timeout")
32
+ return "workspace_image_build_timeout";
33
+ if (code !== undefined && OWNER_MAP_REFUSAL_CODES.has(code))
34
+ return code;
35
+ return "workspace_not_ready";
36
+ };
27
37
  const READY_POLL_INTERVAL_MS = 2_000;
28
38
  /**
29
39
  * `ready()` looks again soon, then less often: a Docker launch is ready in about four seconds, and
@@ -480,13 +490,7 @@ export const makeWorkspace = (ctx, init) => {
480
490
  }
481
491
  if (FAILED_STATUSES.has(details.status)) {
482
492
  const reason = details.error === undefined ? "" : `: ${details.error.message}`;
483
- throw new SealantError(`Workspace ${init.id} reached terminal status "${details.status}" before becoming ready${reason}`, {
484
- code: details.error?.code === "image-build-stalled"
485
- ? "workspace_image_build_stalled"
486
- : details.error?.code === "image-build-timeout"
487
- ? "workspace_image_build_timeout"
488
- : "workspace_not_ready",
489
- });
493
+ throw new SealantError(`Workspace ${init.id} reached terminal status "${details.status}" before becoming ready${reason}`, { code: readyFailureCode(details.error?.code) });
490
494
  }
491
495
  const phase = details.phase === undefined ? undefined : toWorkspacePhase(details.phase);
492
496
  const wasBuilding = building;
package/dist/types.d.ts CHANGED
@@ -1064,11 +1064,14 @@ export interface Workspace {
1064
1064
  * Rejects with `workspace_ready_timeout` past the readiness bound, `workspace_image_build_timeout`
1065
1065
  * past the image-build bound (the caller's, or the control plane's own), `workspace_image_build_stalled` when the build stopped making
1066
1066
  * progress (with the step it stopped on), and `workspace_not_ready` when the launch ended
1067
- * otherwise (with the control plane's reason). When the handle came from
1068
- * `workspaces.create()` and `ready()` gives up on a bound, a stop is requested before the error
1069
- * is thrown, so an abandoned launch does not keep running to its cap; the error says whether the
1070
- * request was accepted (not that the workspace stopped). Options given here win over the ones
1071
- * given to `create()`.
1067
+ * otherwise (with the control plane's reason; a runtime's `unsupported-runtime-requirement`
1068
+ * refusal is one). A per-person launch the worker refused for its owner map rejects with the
1069
+ * refusal's own code: `owner-map-unsupported` when the image cannot apply the owner map,
1070
+ * `owner-map-unverified` when Core cannot tell whether it does.
1071
+ * When the handle came from `workspaces.create()` and `ready()` gives up on a bound, a stop is
1072
+ * requested before the error is thrown, so an abandoned launch does not keep running to its cap;
1073
+ * the error says whether the request was accepted (not that the workspace stopped). Options given
1074
+ * here win over the ones given to `create()`.
1072
1075
  */
1073
1076
  ready(options?: WorkspaceReadyOptions): Promise<this>;
1074
1077
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sealant/sdk-next",
3
- "version": "0.40.0-next.757",
3
+ "version": "0.40.0-next.759",
4
4
  "description": "The fluent public SDK for Sealant — create a workspace, run a harness, replay the record.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -26,12 +26,12 @@
26
26
  "node": ">=20"
27
27
  },
28
28
  "dependencies": {
29
- "@sealant/api-contracts": "npm:@sealant/api-contracts-next@0.40.0-next.757"
29
+ "@sealant/api-contracts": "npm:@sealant/api-contracts-next@0.40.0-next.759"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "effect": "^4.0.5"
33
33
  },
34
- "gitHead": "30986c255bb3b259e1821aac7da33537cce06160",
34
+ "gitHead": "2e8d2c658ec3dda4ba925f6734a7fdda3919ca7d",
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  }