@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 CHANGED
@@ -1,18 +1,18 @@
1
1
  # @sealant/sdk
2
2
 
3
- The fluent public SDK for Sealant — **create a sandbox, run a harness, replay the record.**
3
+ The fluent public SDK for Sealant — **create a workspace, run a harness, replay the record.**
4
4
 
5
5
  ```ts
6
6
  import { Sealant, opencode } from "@sealant/sdk";
7
7
 
8
8
  const sealant = new Sealant({ baseUrl: "http://localhost:8080" });
9
9
 
10
- const sandbox = await sealant.sandboxes.create({
10
+ const workspace = await sealant.workspaces.create({
11
11
  repository: "github.com/acme/billing-service",
12
12
  harness: opencode(),
13
13
  });
14
14
 
15
- const run = await sandbox.harness.run("Round invoice totals once, after applying the discount.");
15
+ const run = await workspace.harness.run("Round invoice totals once, after applying the discount.");
16
16
 
17
17
  await run.record.replay();
18
18
  ```
@@ -31,11 +31,11 @@ await run.record.replay();
31
31
 
32
32
  ## Connected-account credentials
33
33
 
34
- Attach the caller's connected Claude / Codex / GitHub accounts to a sandbox so the harness
34
+ Attach the caller's connected Claude / Codex / GitHub accounts to a workspace so the harness
35
35
  authenticates as that identity instead of running unauthenticated:
36
36
 
37
37
  ```ts
38
- const sandbox = await sealant.sandboxes.create({
38
+ const workspace = await sealant.workspaces.create({
39
39
  repository: "github.com/acme/billing-service",
40
40
  harness: claudeCode(),
41
41
  credentials: { claude: true, github: "bot-account" },
@@ -50,12 +50,12 @@ and injects them at launch.
50
50
 
51
51
  ## Status
52
52
 
53
- The core loop is real: `sandboxes.create()`/`get()`/`list()`, `ready()`, blocking `harness.run()`
53
+ The core loop is real: `workspaces.create()`/`get()`/`list()`, `ready()`, blocking `harness.run()`
54
54
  and non-blocking `harness.start()` (run execution happens server-side; the SDK is a thin HTTP
55
55
  client), `runs.get()`, and the record read surface — `replay()`, `timeline()`, `scrollback()`,
56
56
  `commands()`, `transcript()`, `stream()` (poll-backed), `loss()`, `summary()`, plus captured
57
57
  `changes` (files + diff) settled by `run()`/`wait()`.
58
58
 
59
59
  Still typed stubs pending their read models / endpoints: `artifacts.get()` and the time-travel folds
60
- `fileTreeAt()`/`processTreeAt()` (Phase 1), and `harness.session()` + sandbox lifecycle
60
+ `fileTreeAt()`/`processTreeAt()` (Phase 1), and `harness.session()` + workspace lifecycle
61
61
  `stop()`/`restart()`/`expire()` (Phase 3).
package/dist/client.d.ts CHANGED
@@ -1,16 +1,16 @@
1
- import type { CreateOptions, ListOptions, Run, Sandbox, SealantConfig } from "./types.js";
1
+ import type { CreateOptions, ListOptions, Run, Workspace, SealantConfig } from "./types.js";
2
2
  export declare class Sealant {
3
3
  #private;
4
4
  constructor(config: SealantConfig);
5
5
  /** The configured control-plane base URL. */
6
6
  get baseUrl(): string;
7
- /** Sandbox lifecycle: create, fetch, and list live environments. */
8
- readonly sandboxes: {
9
- create: (options: CreateOptions) => Promise<Sandbox>;
10
- get: (id: string) => Promise<Sandbox>;
11
- list: (options?: ListOptions | undefined) => Promise<readonly Sandbox[]>;
7
+ /** Workspace lifecycle: create, fetch, and list live environments. */
8
+ readonly workspaces: {
9
+ create: (options: CreateOptions) => Promise<Workspace>;
10
+ get: (id: string) => Promise<Workspace>;
11
+ list: (options?: ListOptions | undefined) => Promise<readonly Workspace[]>;
12
12
  };
13
- /** Runs by id — so a record can be replayed long after its sandbox is gone. */
13
+ /** Runs by id — so a record can be replayed long after its workspace is gone. */
14
14
  readonly runs: {
15
15
  get: (runId: string) => Promise<Run>;
16
16
  };
package/dist/client.js CHANGED
@@ -10,16 +10,16 @@
10
10
  * stable surface and reject with `SealantNotImplementedError` so callers can compile and wire
11
11
  * against the final shape today.
12
12
  */
13
- import { createSandboxOp, getRunOp, getSandboxOp, listSandboxesOp } from "./effect/operations.js";
13
+ import { createWorkspaceOp, getRunOp, getWorkspaceOp, listWorkspacesOp, } from "./effect/operations.js";
14
14
  import { runHarness, startHarness } from "./effect/run-harness.js";
15
15
  import { makeSdkRuntime } from "./effect/runtime.js";
16
16
  import { SealantError } from "./errors.js";
17
17
  import { makeRun } from "./facade/run.js";
18
- import { makeSandbox, registerHarnessExecutors } from "./facade/sandbox.js";
19
- import { buildCreateSandboxRequest } from "./internal/blueprint.js";
18
+ import { makeWorkspace, registerHarnessExecutors } from "./facade/workspace.js";
19
+ import { buildCreateWorkspaceRequest } from "./internal/blueprint.js";
20
20
  import { resolveInternalConfig } from "./internal/config.js";
21
- // Wire the run-execution implementations into the Sandbox facade (the injection point exists to
22
- // break the sandbox <-> run-harness import cycle; the client is the composition root).
21
+ // Wire the run-execution implementations into the Workspace facade (the injection point exists to
22
+ // break the workspace <-> run-harness import cycle; the client is the composition root).
23
23
  registerHarnessExecutors({ run: runHarness, start: startHarness });
24
24
  export class Sealant {
25
25
  #config;
@@ -38,19 +38,19 @@ export class Sealant {
38
38
  get baseUrl() {
39
39
  return this.#config.baseUrl;
40
40
  }
41
- /** Sandbox lifecycle: create, fetch, and list live environments. */
42
- sandboxes = {
41
+ /** Workspace lifecycle: create, fetch, and list live environments. */
42
+ workspaces = {
43
43
  create: async (options) => {
44
- const { payload } = buildCreateSandboxRequest(options, this.#ctx.config);
45
- const created = await this.#runtime.run(createSandboxOp(payload));
46
- const sandbox = makeSandbox(this.#ctx, {
47
- id: created.sandboxId,
44
+ const { payload } = buildCreateWorkspaceRequest(options, this.#ctx.config);
45
+ const created = await this.#runtime.run(createWorkspaceOp(payload));
46
+ const workspace = makeWorkspace(this.#ctx, {
47
+ id: created.workspaceId,
48
48
  name: created.name,
49
49
  status: created.status,
50
50
  harness: options.harness,
51
51
  });
52
52
  if (options.wait === false) {
53
- return sandbox;
53
+ return workspace;
54
54
  }
55
55
  // Pump provisioning events to onEvent (best-effort) while we wait for ready. Never let an
56
56
  // event-stream hiccup fail create().
@@ -58,7 +58,7 @@ export class Sealant {
58
58
  const onEvent = options.onEvent;
59
59
  void (async () => {
60
60
  try {
61
- for await (const event of sandbox.events()) {
61
+ for await (const event of workspace.events()) {
62
62
  onEvent(event);
63
63
  }
64
64
  }
@@ -67,30 +67,30 @@ export class Sealant {
67
67
  }
68
68
  })();
69
69
  }
70
- return sandbox.ready();
70
+ return workspace.ready();
71
71
  },
72
72
  get: async (id) => {
73
- const details = await this.#runtime.run(getSandboxOp(id));
74
- return makeSandbox(this.#ctx, {
75
- id: details.sandboxId,
73
+ const details = await this.#runtime.run(getWorkspaceOp(id));
74
+ return makeWorkspace(this.#ctx, {
75
+ id: details.workspaceId,
76
76
  name: details.name,
77
77
  status: details.status,
78
78
  });
79
79
  },
80
80
  list: async (options) => {
81
- const response = await this.#runtime.run(listSandboxesOp({
81
+ const response = await this.#runtime.run(listWorkspacesOp({
82
82
  ownerUserId: this.#ctx.config.hostLocal.ownerUserId,
83
83
  ...(options?.status === undefined ? {} : { status: options.status }),
84
84
  ...(options?.limit === undefined ? {} : { limit: String(options.limit) }),
85
85
  }));
86
- return response.items.map((item) => makeSandbox(this.#ctx, {
87
- id: item.sandboxId,
86
+ return response.items.map((item) => makeWorkspace(this.#ctx, {
87
+ id: item.workspaceId,
88
88
  name: item.name,
89
89
  status: item.status,
90
90
  }));
91
91
  },
92
92
  };
93
- /** Runs by id — so a record can be replayed long after its sandbox is gone. */
93
+ /** Runs by id — so a record can be replayed long after its workspace is gone. */
94
94
  runs = {
95
95
  get: async (runId) => {
96
96
  const wire = await this.#runtime.run(getRunOp(runId));