@sealant/sdk 0.3.1 → 0.4.0
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 +7 -7
- package/dist/client.d.ts +7 -7
- package/dist/client.js +21 -21
- package/dist/effect/api-client.d.ts +250 -250
- package/dist/effect/operations.d.ts +14 -14
- package/dist/effect/operations.js +4 -4
- package/dist/effect/run-harness.d.ts +2 -2
- package/dist/effect/run-harness.js +4 -4
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +1 -1
- package/dist/facade/run.d.ts +1 -1
- package/dist/facade/{sandbox.d.ts → workspace.d.ts} +6 -6
- package/dist/facade/{sandbox.js → workspace.js} +17 -17
- package/dist/harness.d.ts +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/internal/blueprint.d.ts +1 -1
- package/dist/internal/blueprint.js +8 -8
- package/dist/internal/config.d.ts +2 -2
- package/dist/internal/credentials.d.ts +7 -7
- package/dist/internal/credentials.js +2 -2
- package/dist/internal/map-error.d.ts +1 -1
- package/dist/internal/map-error.js +1 -1
- package/dist/types.d.ts +35 -35
- package/dist/types.js +2 -2
- package/package.json +3 -3
package/dist/types.d.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* This is the fluent object model the marketing site commits to verbatim:
|
|
5
5
|
*
|
|
6
|
-
* const
|
|
7
|
-
* const run = await
|
|
6
|
+
* const workspace = await sealant.workspaces.create({ repository, harness: opencode() })
|
|
7
|
+
* const run = await workspace.harness.run("Round invoice totals once, after applying the discount.")
|
|
8
8
|
* await run.record.replay()
|
|
9
9
|
*
|
|
10
10
|
* Design rule (load-bearing): these public types are HAND-WRITTEN and DECOUPLED from the Effect-core
|
|
@@ -30,7 +30,7 @@ export interface SealantConfig {
|
|
|
30
30
|
}
|
|
31
31
|
/** The harnesses with first-class integrations baked into the platform today. */
|
|
32
32
|
export type HarnessId = "opencode" | "codex" | "claude-code";
|
|
33
|
-
/** A single one-shot command to invoke a harness against a prompt inside the
|
|
33
|
+
/** A single one-shot command to invoke a harness against a prompt inside the workspace. */
|
|
34
34
|
export interface HarnessRunCommand {
|
|
35
35
|
/** The executable to run (e.g. `"opencode"`). */
|
|
36
36
|
readonly executable: string;
|
|
@@ -56,19 +56,19 @@ export interface Harness {
|
|
|
56
56
|
/** Optional launch command for an interactive session (defaults to the executable). */
|
|
57
57
|
readonly launchCommand?: string;
|
|
58
58
|
}
|
|
59
|
-
/** Lifecycle status of a
|
|
60
|
-
export type
|
|
61
|
-
/** A coarse lifecycle event observed while a
|
|
62
|
-
export interface
|
|
59
|
+
/** Lifecycle status of a workspace. `stopped`/`expired` arrive with lifecycle close-out (Phase 3). */
|
|
60
|
+
export type WorkspaceStatus = "queued" | "running" | "ready" | "failed" | "cancelled";
|
|
61
|
+
/** A coarse lifecycle event observed while a workspace is being provisioned. */
|
|
62
|
+
export interface WorkspaceEvent {
|
|
63
63
|
readonly type: string;
|
|
64
64
|
readonly occurredAt: string;
|
|
65
65
|
readonly message?: string;
|
|
66
66
|
}
|
|
67
|
-
/** The supported
|
|
68
|
-
export type
|
|
67
|
+
/** The supported workspace OS families (maps to the blueprint target). */
|
|
68
|
+
export type WorkspaceOs = "fedora" | "arch" | "nix";
|
|
69
69
|
/**
|
|
70
|
-
* Connected-account credentials to attach to a
|
|
71
|
-
* harness inside the
|
|
70
|
+
* Connected-account credentials to attach to a workspace at creation time, per provider — so the
|
|
71
|
+
* harness inside the workspace authenticates as the caller's own Claude / Codex / GitHub identity
|
|
72
72
|
* instead of running unauthenticated.
|
|
73
73
|
*
|
|
74
74
|
* For each provider: `true` means "my default account" (the one named `"default"`), and a `string`
|
|
@@ -80,7 +80,7 @@ export type SandboxOs = "fedora" | "arch" | "nix";
|
|
|
80
80
|
* `auth.json` contents, and any other secret material never do. The control plane resolves references
|
|
81
81
|
* to encrypted credentials server-side and injects them at launch.
|
|
82
82
|
*/
|
|
83
|
-
export interface
|
|
83
|
+
export interface WorkspaceCredentialsOptions {
|
|
84
84
|
/** Profile id whose per-provider account bindings apply first. */
|
|
85
85
|
readonly profile?: string;
|
|
86
86
|
/** `true` for the caller's default Claude account, or a string naming a specific one. */
|
|
@@ -91,46 +91,46 @@ export interface SandboxCredentialsOptions {
|
|
|
91
91
|
readonly github?: boolean | string;
|
|
92
92
|
}
|
|
93
93
|
export interface CreateOptions {
|
|
94
|
-
/** Source git repository to build the
|
|
94
|
+
/** Source git repository to build the workspace around (e.g. `"github.com/acme/billing-service"`). */
|
|
95
95
|
readonly repository: string;
|
|
96
|
-
/** The harness to run inside the
|
|
96
|
+
/** The harness to run inside the workspace. */
|
|
97
97
|
readonly harness: Harness;
|
|
98
98
|
/** Git ref to check out (defaults to the repository's default branch). */
|
|
99
99
|
readonly ref?: string;
|
|
100
|
-
/** Human-friendly name for the
|
|
100
|
+
/** Human-friendly name for the workspace. */
|
|
101
101
|
readonly name?: string;
|
|
102
|
-
/** OS family for the
|
|
103
|
-
readonly os?:
|
|
104
|
-
/** Extra OS packages to install in the
|
|
102
|
+
/** OS family for the workspace image. */
|
|
103
|
+
readonly os?: WorkspaceOs;
|
|
104
|
+
/** Extra OS packages to install in the workspace. */
|
|
105
105
|
readonly packages?: readonly string[];
|
|
106
|
-
/** When true (default), resolve only once the
|
|
106
|
+
/** When true (default), resolve only once the workspace runtime is live. */
|
|
107
107
|
readonly wait?: boolean;
|
|
108
108
|
/** Observe provisioning events as they happen. */
|
|
109
|
-
readonly onEvent?: (event:
|
|
110
|
-
/** Connected-account credentials to attach to the
|
|
111
|
-
readonly credentials?:
|
|
109
|
+
readonly onEvent?: (event: WorkspaceEvent) => void;
|
|
110
|
+
/** Connected-account credentials to attach to the workspace (see `WorkspaceCredentialsOptions`). */
|
|
111
|
+
readonly credentials?: WorkspaceCredentialsOptions;
|
|
112
112
|
}
|
|
113
113
|
export interface ListOptions {
|
|
114
|
-
readonly status?:
|
|
114
|
+
readonly status?: WorkspaceStatus;
|
|
115
115
|
readonly limit?: number;
|
|
116
116
|
}
|
|
117
117
|
/** A live, disposable development environment around a real repository. */
|
|
118
|
-
export interface
|
|
118
|
+
export interface Workspace {
|
|
119
119
|
readonly id: string;
|
|
120
120
|
readonly name: string;
|
|
121
121
|
/** Current lifecycle status. */
|
|
122
|
-
status(): Promise<
|
|
123
|
-
/** Resolves once the
|
|
122
|
+
status(): Promise<WorkspaceStatus>;
|
|
123
|
+
/** Resolves once the workspace runtime is live and ready to accept a run. */
|
|
124
124
|
ready(): Promise<this>;
|
|
125
|
-
/** Run a harness in this
|
|
125
|
+
/** Run a harness in this workspace. */
|
|
126
126
|
readonly harness: HarnessRunner;
|
|
127
127
|
/** Lifecycle events as an async stream. */
|
|
128
|
-
events(): AsyncIterable<
|
|
129
|
-
/** Stop the
|
|
128
|
+
events(): AsyncIterable<WorkspaceEvent>;
|
|
129
|
+
/** Stop the workspace now (Phase 3). */
|
|
130
130
|
stop(): Promise<void>;
|
|
131
|
-
/** Restart the
|
|
132
|
-
restart(): Promise<
|
|
133
|
-
/** Schedule the
|
|
131
|
+
/** Restart the workspace into a fresh runtime (Phase 3). */
|
|
132
|
+
restart(): Promise<Workspace>;
|
|
133
|
+
/** Schedule the workspace to expire (Phase 3). */
|
|
134
134
|
expire(options?: {
|
|
135
135
|
readonly in?: string;
|
|
136
136
|
}): Promise<void>;
|
|
@@ -144,13 +144,13 @@ export interface RunOptions {
|
|
|
144
144
|
export interface SessionOptions {
|
|
145
145
|
readonly signal?: AbortSignal;
|
|
146
146
|
}
|
|
147
|
-
/** Runs a harness in a
|
|
147
|
+
/** Runs a harness in a workspace, one-shot or interactive. */
|
|
148
148
|
export interface HarnessRunner {
|
|
149
149
|
/** BLOCKING: resolves once the harness has terminally completed; `result`/`changes` are settled. */
|
|
150
150
|
run(prompt: string, options?: RunOptions): Promise<Run>;
|
|
151
151
|
/** NON-BLOCKING: returns a live handle immediately for streaming via `run.record.stream()`. */
|
|
152
152
|
start(prompt: string, options?: RunOptions): Promise<Run>;
|
|
153
|
-
/** Interactive session reusing the live
|
|
153
|
+
/** Interactive session reusing the live workspace (Phase 3). */
|
|
154
154
|
session(options?: SessionOptions): Promise<InteractiveSession>;
|
|
155
155
|
}
|
|
156
156
|
export type RunOutcome = "completed" | "failed";
|
|
@@ -283,7 +283,7 @@ export interface Run {
|
|
|
283
283
|
/** Resolves once the run has terminally completed (no-op if already settled). */
|
|
284
284
|
wait(): Promise<Run>;
|
|
285
285
|
}
|
|
286
|
-
/** An interactive harness session over the live
|
|
286
|
+
/** An interactive harness session over the live workspace (Phase 3). */
|
|
287
287
|
export interface InteractiveSession {
|
|
288
288
|
send(input: string): Promise<void>;
|
|
289
289
|
output(): AsyncIterable<Uint8Array>;
|
package/dist/types.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* This is the fluent object model the marketing site commits to verbatim:
|
|
5
5
|
*
|
|
6
|
-
* const
|
|
7
|
-
* const run = await
|
|
6
|
+
* const workspace = await sealant.workspaces.create({ repository, harness: opencode() })
|
|
7
|
+
* const run = await workspace.harness.run("Round invoice totals once, after applying the discount.")
|
|
8
8
|
* await run.record.replay()
|
|
9
9
|
*
|
|
10
10
|
* Design rule (load-bearing): these public types are HAND-WRITTEN and DECOUPLED from the Effect-core
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sealant/sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "The fluent public SDK for Sealant — create a
|
|
3
|
+
"version": "0.4.0",
|
|
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": {
|
|
7
7
|
"type": "git",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"effect": "^4.0.0-beta.85",
|
|
26
|
-
"@sealant/api-contracts": "^0.
|
|
26
|
+
"@sealant/api-contracts": "^0.4.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@effect/vitest": "^4.0.0-beta.85",
|