@sealant/sdk-next 0.40.0-next.805 → 0.40.0-next.807
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/README.md +11 -0
- package/dist/internal/blueprint.js +10 -5
- package/dist/types.d.ts +6 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -44,6 +44,17 @@ await run.record.replay();
|
|
|
44
44
|
- **Harness-neutral.** `opencode()`, `codex()`, `claudeCode()`, and `customHarness()` are thin
|
|
45
45
|
client values describing how to invoke a harness one-shot.
|
|
46
46
|
|
|
47
|
+
## Choose a runtime
|
|
48
|
+
|
|
49
|
+
`workspaces.create({ repository, harness, runtime: "docker" })` requires Docker. The same option
|
|
50
|
+
accepts `boat`, `k8s`, `k3s`, `cloudflare` or `microvm`. An unavailable or unsupported choice is
|
|
51
|
+
refused rather than replaced with another runtime. Omit `runtime` to keep the deployment's default.
|
|
52
|
+
The choice applies to this new workspace; it does not move an existing workspace.
|
|
53
|
+
|
|
54
|
+
Boat still requires the operator's admission settings, a supported image and a capture source.
|
|
55
|
+
Selecting it through the SDK grants no admission. The SDK returns the control plane's refusal in
|
|
56
|
+
`SealantApiError.reason` when those requirements are unmet.
|
|
57
|
+
|
|
47
58
|
## Deterministic exec
|
|
48
59
|
|
|
49
60
|
Run a command in the workspace with no agent in the loop — recorded into a run record like any other
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
* job's own records — the worker publishes the image under plan-keyed coordinates (one repository
|
|
7
7
|
* per OS family, one tag per plan hash), so this name never reaches the registry — and
|
|
8
8
|
* we derive. `customization.enableSealantd` is forced on (it bakes + launches the daemon the run path
|
|
9
|
-
* connects to), the runtime target
|
|
10
|
-
* when the worker is configured for a cluster), and the
|
|
9
|
+
* connects to), the runtime target defaults to `auto`; an explicit selection requires that runtime. The
|
|
11
10
|
* foreground is a keepalive so the workspace idles with the daemon up and the harness is exec'd on
|
|
12
11
|
* demand by `run()` rather than launched at boot. `options.credentials`, if present, is lowered via
|
|
13
12
|
* `mapWorkspaceCredentials` (see `./credentials.js`) and folded into `spec.credentials`; the control
|
|
@@ -30,6 +29,12 @@ export const toGitUrl = (repository) => {
|
|
|
30
29
|
return `https://${repository}.git`;
|
|
31
30
|
};
|
|
32
31
|
export const buildCreateWorkspaceRequest = (options, config) => {
|
|
32
|
+
if (options.runtime !== undefined &&
|
|
33
|
+
!["docker", "k8s", "k3s", "cloudflare", "microvm", "boat"].includes(options.runtime)) {
|
|
34
|
+
throw new SealantError("workspaces.create runtime must name a supported runtime family.", {
|
|
35
|
+
code: "invalid_create_options",
|
|
36
|
+
});
|
|
37
|
+
}
|
|
33
38
|
if ((options.repository === undefined) === (options.source === undefined)) {
|
|
34
39
|
throw new SealantError("workspaces.create requires exactly one of `repository` (a git remote to clone) or `source` (a caller-owned mount).", { code: "invalid_create_options" });
|
|
35
40
|
}
|
|
@@ -248,9 +253,9 @@ export const buildCreateWorkspaceRequest = (options, config) => {
|
|
|
248
253
|
os: options.baseImage !== undefined
|
|
249
254
|
? { family: "custom", mode: "require", baseImage: options.baseImage }
|
|
250
255
|
: { family: options.os ?? "fedora", mode: "prefer" },
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
256
|
+
runtime: options.runtime === undefined
|
|
257
|
+
? { family: "auto", mode: "prefer" }
|
|
258
|
+
: { family: options.runtime, mode: "require" },
|
|
254
259
|
},
|
|
255
260
|
lifecycle: {
|
|
256
261
|
startup: { foreground: { kind: "command", run: "sleep infinity", shell: "bash" } },
|
package/dist/types.d.ts
CHANGED
|
@@ -784,6 +784,12 @@ export interface WorkspaceEnvFromSource {
|
|
|
784
784
|
readonly name: string;
|
|
785
785
|
}
|
|
786
786
|
export interface CreateOptions {
|
|
787
|
+
/**
|
|
788
|
+
* Require this runtime for the new workspace. Omitted, use the deployment's default.
|
|
789
|
+
* An unavailable runtime is refused; it never falls back to another runtime. Boat still
|
|
790
|
+
* requires the deployment's operator admission and supported source/image settings.
|
|
791
|
+
*/
|
|
792
|
+
readonly runtime?: WorkspaceRuntimeInfo["kind"];
|
|
787
793
|
/** Reuse images within this existing resource domain, subject to current owner membership. */
|
|
788
794
|
readonly imageScopeId?: string;
|
|
789
795
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sealant/sdk-next",
|
|
3
|
-
"version": "0.40.0-next.
|
|
3
|
+
"version": "0.40.0-next.807",
|
|
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.
|
|
29
|
+
"@sealant/api-contracts": "npm:@sealant/api-contracts-next@0.40.0-next.807"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"effect": "^4.0.5"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "0cf22c6cd8e1f9b8185695560c84ee83f927b2ab",
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
}
|