@sealant/sdk-next 0.40.0-next.869 → 0.40.0-next.872
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/dist/client.d.ts +10 -1
- package/dist/client.js +33 -2
- package/dist/effect/api-client.d.ts +2664 -6
- package/dist/effect/operations.d.ts +1266 -1
- package/dist/effect/operations.js +5 -0
- package/dist/errors.d.ts +26 -1
- package/dist/errors.js +31 -0
- package/dist/facade/workspace.js +7 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/dist/internal/map-error.js +12 -1
- package/dist/types.d.ts +106 -4
- package/package.json +3 -3
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ScopesNamespace } from "./scopes.js";
|
|
2
|
-
import type { AccessTokensNamespace, BoatAccountsNamespace, ConnectedAccountsNamespace, CreateOptions, InferenceNamespace, ListOptions, Run, SealantFeatures, SshKeysNamespace, Workspace, WorkspaceCreateState, WorkspaceImageInspection, WorkspaceSshNamespace, SealantConfig, UsersNamespace } from "./types.js";
|
|
2
|
+
import type { AccessTokensNamespace, BoatAccountsNamespace, ConnectedAccountsNamespace, CreateOptions, InferenceNamespace, ListOptions, Run, SealantFeatures, SshKeysNamespace, Workspace, WorkspaceCreateState, WorkspaceImageInspection, WorkspaceRuntimes, WorkspaceSshNamespace, SealantConfig, UsersNamespace } from "./types.js";
|
|
3
3
|
export declare class Sealant {
|
|
4
4
|
#private;
|
|
5
5
|
/**
|
|
@@ -28,6 +28,15 @@ export declare class Sealant {
|
|
|
28
28
|
* seen.
|
|
29
29
|
*/
|
|
30
30
|
imageKey: (options: CreateOptions) => string;
|
|
31
|
+
/**
|
|
32
|
+
* The runtimes this control plane launches workspaces on, and what each supports, read before
|
|
33
|
+
* any create: OS families, a custom base image, host directories, Docker inside, gVisor,
|
|
34
|
+
* Kubernetes references, the source and dotfiles a workspace may start from, a screen, the ports
|
|
35
|
+
* the runtime holds, how resources attach, and whether an idle workspace costs money. A create
|
|
36
|
+
* that asks a runtime for an item it marks unsupported is refused with that item's `message`:
|
|
37
|
+
* both answers come from one table. `default` is the runtime a create that names none runs on.
|
|
38
|
+
*/
|
|
39
|
+
runtimes: () => Promise<WorkspaceRuntimes>;
|
|
31
40
|
/**
|
|
32
41
|
* What `create(options)` would build, read before the create: the spec is planned exactly as
|
|
33
42
|
* the build plans it, and the latest image published for that plan answers with its
|
package/dist/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { archiveConnectedAccountOp, archiveSshKeyOp, cancelWorkspaceCreateOp, createAccessTokenOp, createBoatAccountOp, createConnectedAccountOp, createSshKeyOp, createWorkspaceOp, ensureUserOp, getRunOp, getSetupStateOp, getUserOp, bindUserPersonOp, getWorkspaceCreateOp, getWorkspaceOp, inferenceRespondOp, inspectWorkspaceImageOp, listBoatAccountsOp, listConnectedAccountsOp, listSshKeysOp, listWorkspacesOp, markConnectedAccountInvalidOp, removeBoatAccountOp, rotateBoatAccountKeyOp, setConnectedAccountDefaultOp, } from "./effect/operations.js";
|
|
1
|
+
import { archiveConnectedAccountOp, archiveSshKeyOp, cancelWorkspaceCreateOp, createAccessTokenOp, checkBoatAccountOp, checkBoatInstallKeyOp, getBoatInstallKeyOp, createBoatAccountOp, createConnectedAccountOp, createSshKeyOp, createWorkspaceOp, ensureUserOp, getRunOp, getSetupStateOp, getUserOp, bindUserPersonOp, getWorkspaceCreateOp, getWorkspaceOp, inferenceRespondOp, inspectWorkspaceImageOp, listWorkspaceRuntimesOp, listBoatAccountsOp, listConnectedAccountsOp, listSshKeysOp, listWorkspacesOp, markConnectedAccountInvalidOp, removeBoatAccountOp, rotateBoatAccountKeyOp, setConnectedAccountDefaultOp, } from "./effect/operations.js";
|
|
2
2
|
import { runHarness, startHarness } from "./effect/run-harness.js";
|
|
3
3
|
import { makeSdkRuntime } from "./effect/runtime.js";
|
|
4
4
|
import { SealantBudgetExceededError, SealantError } from "./errors.js";
|
|
@@ -27,6 +27,9 @@ const mapBoatAccount = (wire) => ({
|
|
|
27
27
|
state: wire.state,
|
|
28
28
|
createdAt: wire.createdAt,
|
|
29
29
|
keyRotatedAt: wire.keyRotatedAt,
|
|
30
|
+
// An older control plane sends neither: no organization named, no report.
|
|
31
|
+
organization: wire.organization ?? null,
|
|
32
|
+
report: wire.report ?? null,
|
|
30
33
|
});
|
|
31
34
|
const mapConnectedAccount = (wire) => ({
|
|
32
35
|
connectedAccountId: wire.connectedAccountId,
|
|
@@ -147,6 +150,27 @@ export class Sealant {
|
|
|
147
150
|
* seen.
|
|
148
151
|
*/
|
|
149
152
|
imageKey: (options) => imageSpecKey(buildCreateWorkspaceRequest(options, this.#ctx.config).payload.spec),
|
|
153
|
+
/**
|
|
154
|
+
* The runtimes this control plane launches workspaces on, and what each supports, read before
|
|
155
|
+
* any create: OS families, a custom base image, host directories, Docker inside, gVisor,
|
|
156
|
+
* Kubernetes references, the source and dotfiles a workspace may start from, a screen, the ports
|
|
157
|
+
* the runtime holds, how resources attach, and whether an idle workspace costs money. A create
|
|
158
|
+
* that asks a runtime for an item it marks unsupported is refused with that item's `message`:
|
|
159
|
+
* both answers come from one table. `default` is the runtime a create that names none runs on.
|
|
160
|
+
*/
|
|
161
|
+
runtimes: async () => {
|
|
162
|
+
const answered = await this.#runtime.run(listWorkspaceRuntimesOp());
|
|
163
|
+
return {
|
|
164
|
+
default: answered.default,
|
|
165
|
+
runtimes: answered.runtimes.map((support) => ({
|
|
166
|
+
...support,
|
|
167
|
+
screen: support.screen.supported
|
|
168
|
+
? { supported: true, architectures: [...support.screen.architectures] }
|
|
169
|
+
: support.screen,
|
|
170
|
+
reservedPorts: [...support.reservedPorts],
|
|
171
|
+
})),
|
|
172
|
+
};
|
|
173
|
+
},
|
|
150
174
|
/**
|
|
151
175
|
* What `create(options)` would build, read before the create: the spec is planned exactly as
|
|
152
176
|
* the build plans it, and the latest image published for that plan answers with its
|
|
@@ -268,9 +292,16 @@ export class Sealant {
|
|
|
268
292
|
* the workspaces created with `boatAccountId`. With a service key; keys go in, none come out.
|
|
269
293
|
*/
|
|
270
294
|
boatAccounts = {
|
|
271
|
-
create: async (options) => mapBoatAccount(await this.#runtime.run(createBoatAccountOp({
|
|
295
|
+
create: async (options) => mapBoatAccount(await this.#runtime.run(createBoatAccountOp({
|
|
296
|
+
label: options.label,
|
|
297
|
+
apiKey: options.apiKey,
|
|
298
|
+
...(options.organization === undefined ? {} : { organization: options.organization }),
|
|
299
|
+
}))),
|
|
272
300
|
list: async () => (await this.#runtime.run(listBoatAccountsOp())).items.map(mapBoatAccount),
|
|
273
301
|
rotateKey: async (boatAccountId, apiKey) => mapBoatAccount(await this.#runtime.run(rotateBoatAccountKeyOp(boatAccountId, { apiKey }))),
|
|
302
|
+
check: async (boatAccountId) => mapBoatAccount(await this.#runtime.run(checkBoatAccountOp(boatAccountId))),
|
|
303
|
+
installKey: async () => await this.#runtime.run(getBoatInstallKeyOp()),
|
|
304
|
+
checkInstallKey: async () => await this.#runtime.run(checkBoatInstallKeyOp()),
|
|
274
305
|
remove: async (boatAccountId) => mapBoatAccount(await this.#runtime.run(removeBoatAccountOp(boatAccountId))),
|
|
275
306
|
};
|
|
276
307
|
/** This client's owner's Claude / Codex / GitHub accounts. Secrets go in; none come out. */
|