@sealant/sdk-next 0.40.0-next.863 → 0.40.0-next.866

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  import { type ScopesNamespace } from "./scopes.js";
2
- import type { AccessTokensNamespace, 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, WorkspaceSshNamespace, SealantConfig, UsersNamespace } from "./types.js";
3
3
  export declare class Sealant {
4
4
  #private;
5
5
  /**
@@ -69,6 +69,11 @@ export declare class Sealant {
69
69
  */
70
70
  /** Identity rows for products that own their own login (one client per user afterwards). */
71
71
  readonly users: UsersNamespace;
72
+ /**
73
+ * The Boat accounts the control plane keeps beside its default one: one Boat API key each, for
74
+ * the workspaces created with `boatAccountId`. With a service key; keys go in, none come out.
75
+ */
76
+ readonly boatAccounts: BoatAccountsNamespace;
72
77
  /** This client's owner's Claude / Codex / GitHub accounts. Secrets go in; none come out. */
73
78
  readonly connectedAccounts: ConnectedAccountsNamespace;
74
79
  /**
package/dist/client.js CHANGED
@@ -1,4 +1,4 @@
1
- import { archiveConnectedAccountOp, archiveSshKeyOp, cancelWorkspaceCreateOp, createAccessTokenOp, createConnectedAccountOp, createSshKeyOp, createWorkspaceOp, ensureUserOp, getRunOp, getSetupStateOp, getUserOp, bindUserPersonOp, getWorkspaceCreateOp, getWorkspaceOp, inferenceRespondOp, inspectWorkspaceImageOp, listConnectedAccountsOp, listSshKeysOp, listWorkspacesOp, markConnectedAccountInvalidOp, setConnectedAccountDefaultOp, } from "./effect/operations.js";
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";
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";
@@ -21,6 +21,13 @@ const toCreateState = (wire) => ({
21
21
  ...(wire.runId === undefined ? {} : { runId: wire.runId }),
22
22
  ...(wire.launchId === undefined ? {} : { launchId: wire.launchId }),
23
23
  });
24
+ const mapBoatAccount = (wire) => ({
25
+ boatAccountId: wire.boatAccountId,
26
+ label: wire.label,
27
+ state: wire.state,
28
+ createdAt: wire.createdAt,
29
+ keyRotatedAt: wire.keyRotatedAt,
30
+ });
24
31
  const mapConnectedAccount = (wire) => ({
25
32
  connectedAccountId: wire.connectedAccountId,
26
33
  ownerUserId: wire.ownerUserId,
@@ -256,6 +263,16 @@ export class Sealant {
256
263
  return { userId: wire.userId, person: wire.person, created: wire.created };
257
264
  },
258
265
  };
266
+ /**
267
+ * The Boat accounts the control plane keeps beside its default one: one Boat API key each, for
268
+ * the workspaces created with `boatAccountId`. With a service key; keys go in, none come out.
269
+ */
270
+ boatAccounts = {
271
+ create: async (options) => mapBoatAccount(await this.#runtime.run(createBoatAccountOp({ label: options.label, apiKey: options.apiKey }))),
272
+ list: async () => (await this.#runtime.run(listBoatAccountsOp())).items.map(mapBoatAccount),
273
+ rotateKey: async (boatAccountId, apiKey) => mapBoatAccount(await this.#runtime.run(rotateBoatAccountKeyOp(boatAccountId, { apiKey }))),
274
+ remove: async (boatAccountId) => mapBoatAccount(await this.#runtime.run(removeBoatAccountOp(boatAccountId))),
275
+ };
259
276
  /** This client's owner's Claude / Codex / GitHub accounts. Secrets go in; none come out. */
260
277
  connectedAccounts = {
261
278
  list: async () => {
@@ -54,6 +54,47 @@ declare const buildControlPlaneClient: (config: SealantInternalConfig) => Effect
54
54
  readonly createdAt: import("effect/Schema").String;
55
55
  }>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").AccessTokenBadRequestError | typeof import("@sealant/api-contracts").AccessTokenNotFoundError | typeof import("@sealant/api-contracts").AccessTokenInternalServerError>, import("@sealant/api-contracts").RequestBudget | import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
56
56
  };
57
+ readonly boatAccounts: {
58
+ readonly createBoatAccount: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"createBoatAccount", "POST", "/v1/boat-accounts/", never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
59
+ readonly label: import("effect/Schema").String;
60
+ readonly apiKey: import("effect/Schema").String;
61
+ }>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
62
+ readonly boatAccountId: import("effect/Schema").String;
63
+ readonly label: import("effect/Schema").String;
64
+ readonly state: import("effect/Schema").Literals<readonly ["active", "removing"]>;
65
+ readonly createdAt: import("effect/Schema").String;
66
+ readonly keyRotatedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
67
+ }>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").BoatAccountBadRequestError | typeof import("@sealant/api-contracts").BoatAccountKeyRefusedError | typeof import("@sealant/api-contracts").BoatAccountServiceUnavailableError | typeof import("@sealant/api-contracts").BoatAccountInternalServerError>, import("@sealant/api-contracts").RequestBudget | import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
68
+ readonly listBoatAccounts: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"listBoatAccounts", "GET", "/v1/boat-accounts/", never, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
69
+ readonly items: import("effect/Schema").$Array<import("effect/Schema").Struct<{
70
+ readonly boatAccountId: import("effect/Schema").String;
71
+ readonly label: import("effect/Schema").String;
72
+ readonly state: import("effect/Schema").Literals<readonly ["active", "removing"]>;
73
+ readonly createdAt: import("effect/Schema").String;
74
+ readonly keyRotatedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
75
+ }>>;
76
+ }>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").BoatAccountServiceUnavailableError | typeof import("@sealant/api-contracts").BoatAccountInternalServerError>, import("@sealant/api-contracts").RequestBudget | import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
77
+ readonly removeBoatAccount: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"removeBoatAccount", "DELETE", "/v1/boat-accounts/:boatAccountId", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
78
+ readonly boatAccountId: import("effect/Schema").String;
79
+ }>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
80
+ readonly boatAccountId: import("effect/Schema").String;
81
+ readonly label: import("effect/Schema").String;
82
+ readonly state: import("effect/Schema").Literals<readonly ["active", "removing"]>;
83
+ readonly createdAt: import("effect/Schema").String;
84
+ readonly keyRotatedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
85
+ }>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").BoatAccountNotFoundError | typeof import("@sealant/api-contracts").BoatAccountConflictError | typeof import("@sealant/api-contracts").BoatAccountServiceUnavailableError | typeof import("@sealant/api-contracts").BoatAccountInternalServerError>, import("@sealant/api-contracts").RequestBudget | import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
86
+ readonly rotateBoatAccountKey: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"rotateBoatAccountKey", "PUT", "/v1/boat-accounts/:boatAccountId/key", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
87
+ readonly boatAccountId: import("effect/Schema").String;
88
+ }>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
89
+ readonly apiKey: import("effect/Schema").String;
90
+ }>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
91
+ readonly boatAccountId: import("effect/Schema").String;
92
+ readonly label: import("effect/Schema").String;
93
+ readonly state: import("effect/Schema").Literals<readonly ["active", "removing"]>;
94
+ readonly createdAt: import("effect/Schema").String;
95
+ readonly keyRotatedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
96
+ }>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").BoatAccountBadRequestError | typeof import("@sealant/api-contracts").BoatAccountKeyRefusedError | typeof import("@sealant/api-contracts").BoatAccountNotFoundError | typeof import("@sealant/api-contracts").BoatAccountConflictError | typeof import("@sealant/api-contracts").BoatAccountServiceUnavailableError | typeof import("@sealant/api-contracts").BoatAccountInternalServerError>, import("@sealant/api-contracts").RequestBudget | import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
97
+ };
57
98
  readonly connectedAccounts: {
58
99
  readonly archiveConnectedAccount: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"archiveConnectedAccount", "DELETE", "/v1/connected-accounts/:connectedAccountId", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
59
100
  readonly connectedAccountId: import("effect/Schema").String;
@@ -2676,6 +2717,47 @@ declare const SealantApiClient_base: Context.ServiceClass<SealantApiClient, "@se
2676
2717
  readonly createdAt: import("effect/Schema").String;
2677
2718
  }>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").AccessTokenBadRequestError | typeof import("@sealant/api-contracts").AccessTokenNotFoundError | typeof import("@sealant/api-contracts").AccessTokenInternalServerError>, import("@sealant/api-contracts").RequestBudget | import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
2678
2719
  };
2720
+ readonly boatAccounts: {
2721
+ readonly createBoatAccount: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"createBoatAccount", "POST", "/v1/boat-accounts/", never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
2722
+ readonly label: import("effect/Schema").String;
2723
+ readonly apiKey: import("effect/Schema").String;
2724
+ }>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
2725
+ readonly boatAccountId: import("effect/Schema").String;
2726
+ readonly label: import("effect/Schema").String;
2727
+ readonly state: import("effect/Schema").Literals<readonly ["active", "removing"]>;
2728
+ readonly createdAt: import("effect/Schema").String;
2729
+ readonly keyRotatedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
2730
+ }>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").BoatAccountBadRequestError | typeof import("@sealant/api-contracts").BoatAccountKeyRefusedError | typeof import("@sealant/api-contracts").BoatAccountServiceUnavailableError | typeof import("@sealant/api-contracts").BoatAccountInternalServerError>, import("@sealant/api-contracts").RequestBudget | import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
2731
+ readonly listBoatAccounts: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"listBoatAccounts", "GET", "/v1/boat-accounts/", never, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
2732
+ readonly items: import("effect/Schema").$Array<import("effect/Schema").Struct<{
2733
+ readonly boatAccountId: import("effect/Schema").String;
2734
+ readonly label: import("effect/Schema").String;
2735
+ readonly state: import("effect/Schema").Literals<readonly ["active", "removing"]>;
2736
+ readonly createdAt: import("effect/Schema").String;
2737
+ readonly keyRotatedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
2738
+ }>>;
2739
+ }>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").BoatAccountServiceUnavailableError | typeof import("@sealant/api-contracts").BoatAccountInternalServerError>, import("@sealant/api-contracts").RequestBudget | import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
2740
+ readonly removeBoatAccount: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"removeBoatAccount", "DELETE", "/v1/boat-accounts/:boatAccountId", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
2741
+ readonly boatAccountId: import("effect/Schema").String;
2742
+ }>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
2743
+ readonly boatAccountId: import("effect/Schema").String;
2744
+ readonly label: import("effect/Schema").String;
2745
+ readonly state: import("effect/Schema").Literals<readonly ["active", "removing"]>;
2746
+ readonly createdAt: import("effect/Schema").String;
2747
+ readonly keyRotatedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
2748
+ }>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").BoatAccountNotFoundError | typeof import("@sealant/api-contracts").BoatAccountConflictError | typeof import("@sealant/api-contracts").BoatAccountServiceUnavailableError | typeof import("@sealant/api-contracts").BoatAccountInternalServerError>, import("@sealant/api-contracts").RequestBudget | import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
2749
+ readonly rotateBoatAccountKey: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"rotateBoatAccountKey", "PUT", "/v1/boat-accounts/:boatAccountId/key", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
2750
+ readonly boatAccountId: import("effect/Schema").String;
2751
+ }>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
2752
+ readonly apiKey: import("effect/Schema").String;
2753
+ }>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
2754
+ readonly boatAccountId: import("effect/Schema").String;
2755
+ readonly label: import("effect/Schema").String;
2756
+ readonly state: import("effect/Schema").Literals<readonly ["active", "removing"]>;
2757
+ readonly createdAt: import("effect/Schema").String;
2758
+ readonly keyRotatedAt: import("effect/Schema").NullOr<import("effect/Schema").String>;
2759
+ }>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").BoatAccountBadRequestError | typeof import("@sealant/api-contracts").BoatAccountKeyRefusedError | typeof import("@sealant/api-contracts").BoatAccountNotFoundError | typeof import("@sealant/api-contracts").BoatAccountConflictError | typeof import("@sealant/api-contracts").BoatAccountServiceUnavailableError | typeof import("@sealant/api-contracts").BoatAccountInternalServerError>, import("@sealant/api-contracts").RequestBudget | import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
2760
+ };
2679
2761
  readonly connectedAccounts: {
2680
2762
  readonly archiveConnectedAccount: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"archiveConnectedAccount", "DELETE", "/v1/connected-accounts/:connectedAccountId", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
2681
2763
  readonly connectedAccountId: import("effect/Schema").String;
@@ -4,7 +4,7 @@
4
4
  * maps the typed Effect failure -> a plain `SealantError`. Keeping these here (rather than inline in
5
5
  * the facade) keeps the wire surface in one place and unit-testable.
6
6
  */
7
- import type { ApplyWorkspaceDotfilesRequest, BindWorkspaceRequest, CancelWorkspaceCreateRequest, FlushWorkspaceCaptureRequest, GetWorkspaceCaptureStatusQuery, CloseSessionRequest, CreateAccessTokenRequest, ConnectedAccountProvider, CreateConnectedAccountRequest, CreateSshKeyRequest, EnsureUserRequest, PersonBindingWire, CreateRunRequest, CreateSessionAsUserRequest, CreateSessionRequest, CreateWorkspaceRequest, ExecWorkspaceAsUserRequest, ExecWorkspaceRequest, ExpireWorkspaceRequest, ClearWorkspaceSshUserQuery, GetRunScrollbackQuery, GetRunTimelineQuery, GetSessionOutputQuery, InferenceRespondRequest, ListResourceDomainMembersQuery, ResourceDomainBudgetLimits, SetResourceDomainBudgetRequest, ListRunsQuery, ListSessionsQuery, ListWorkspacesQuery, MarkConnectedAccountInvalidRequest, ReplanWorkspaceCaptureRequest, RecoverWorkspaceRequest, RestartWorkspaceRequest, SessionInputRequest, InspectWorkspaceImageRequest, PutWorkspaceCredentialsRequest, ResourceDomainMemberDecisionRequest, PruneWorkspaceCredentialsRequest, ReleaseWorkspaceCredentialsQuery, ListWorkspaceCredentialsQuery, SessionResizeRequest, SessionSignalRequest, SetConnectedAccountDefaultRequest, StopWorkspaceRequest, UpdateRunRequest, UpResourceInstanceRequest } from "@sealant/api-contracts";
7
+ import type { ApplyWorkspaceDotfilesRequest, BindWorkspaceRequest, CancelWorkspaceCreateRequest, FlushWorkspaceCaptureRequest, GetWorkspaceCaptureStatusQuery, CloseSessionRequest, CreateAccessTokenRequest, ConnectedAccountProvider, CreateConnectedAccountRequest, CreateBoatAccountRequest, RotateBoatAccountKeyRequest, CreateSshKeyRequest, EnsureUserRequest, PersonBindingWire, CreateRunRequest, CreateSessionAsUserRequest, CreateSessionRequest, CreateWorkspaceRequest, ExecWorkspaceAsUserRequest, ExecWorkspaceRequest, ExpireWorkspaceRequest, ClearWorkspaceSshUserQuery, GetRunScrollbackQuery, GetRunTimelineQuery, GetSessionOutputQuery, InferenceRespondRequest, ListResourceDomainMembersQuery, ResourceDomainBudgetLimits, SetResourceDomainBudgetRequest, ListRunsQuery, ListSessionsQuery, ListWorkspacesQuery, MarkConnectedAccountInvalidRequest, ReplanWorkspaceCaptureRequest, RecoverWorkspaceRequest, RestartWorkspaceRequest, SessionInputRequest, InspectWorkspaceImageRequest, PutWorkspaceCredentialsRequest, ResourceDomainMemberDecisionRequest, PruneWorkspaceCredentialsRequest, ReleaseWorkspaceCredentialsQuery, ListWorkspaceCredentialsQuery, SessionResizeRequest, SessionSignalRequest, SetConnectedAccountDefaultRequest, StopWorkspaceRequest, UpdateRunRequest, UpResourceInstanceRequest } from "@sealant/api-contracts";
8
8
  import { Effect, Schema } from "effect";
9
9
  import { SealantApiClient } from "./api-client.js";
10
10
  export declare const createWorkspaceOp: (payload: CreateWorkspaceRequest, idempotencyKey?: string) => Effect.Effect<{
@@ -1062,6 +1062,36 @@ export declare const getUserOp: (userId: string) => Effect.Effect<{
1062
1062
  readonly name: string;
1063
1063
  readonly createdAt: string;
1064
1064
  }, import("@sealant/api-contracts").BudgetExceededError | import("effect/http/HttpClientError").HttpClientError | import("@sealant/api-contracts").RequestRefusedError | Schema.SchemaError | import("@sealant/api-contracts").UserInternalServerError | import("@sealant/api-contracts").UserNotFoundError, SealantApiClient>;
1065
+ export declare const createBoatAccountOp: (payload: CreateBoatAccountRequest) => Effect.Effect<{
1066
+ readonly boatAccountId: string;
1067
+ readonly label: string;
1068
+ readonly state: "active" | "removing";
1069
+ readonly createdAt: string;
1070
+ readonly keyRotatedAt: string | null;
1071
+ }, import("@sealant/api-contracts").BoatAccountBadRequestError | import("@sealant/api-contracts").BoatAccountInternalServerError | import("@sealant/api-contracts").BoatAccountKeyRefusedError | import("@sealant/api-contracts").BoatAccountServiceUnavailableError | import("@sealant/api-contracts").BudgetExceededError | import("effect/http/HttpClientError").HttpClientError | import("@sealant/api-contracts").RequestRefusedError | Schema.SchemaError, SealantApiClient>;
1072
+ export declare const listBoatAccountsOp: () => Effect.Effect<{
1073
+ readonly items: readonly {
1074
+ readonly boatAccountId: string;
1075
+ readonly label: string;
1076
+ readonly state: "active" | "removing";
1077
+ readonly createdAt: string;
1078
+ readonly keyRotatedAt: string | null;
1079
+ }[];
1080
+ }, import("@sealant/api-contracts").BoatAccountInternalServerError | import("@sealant/api-contracts").BoatAccountServiceUnavailableError | import("@sealant/api-contracts").BudgetExceededError | import("effect/http/HttpClientError").HttpClientError | import("@sealant/api-contracts").RequestRefusedError | Schema.SchemaError, SealantApiClient>;
1081
+ export declare const rotateBoatAccountKeyOp: (boatAccountId: string, payload: RotateBoatAccountKeyRequest) => Effect.Effect<{
1082
+ readonly boatAccountId: string;
1083
+ readonly label: string;
1084
+ readonly state: "active" | "removing";
1085
+ readonly createdAt: string;
1086
+ readonly keyRotatedAt: string | null;
1087
+ }, import("@sealant/api-contracts").BoatAccountBadRequestError | import("@sealant/api-contracts").BoatAccountConflictError | import("@sealant/api-contracts").BoatAccountInternalServerError | import("@sealant/api-contracts").BoatAccountKeyRefusedError | import("@sealant/api-contracts").BoatAccountNotFoundError | import("@sealant/api-contracts").BoatAccountServiceUnavailableError | import("@sealant/api-contracts").BudgetExceededError | import("effect/http/HttpClientError").HttpClientError | import("@sealant/api-contracts").RequestRefusedError | Schema.SchemaError, SealantApiClient>;
1088
+ export declare const removeBoatAccountOp: (boatAccountId: string) => Effect.Effect<{
1089
+ readonly boatAccountId: string;
1090
+ readonly label: string;
1091
+ readonly state: "active" | "removing";
1092
+ readonly createdAt: string;
1093
+ readonly keyRotatedAt: string | null;
1094
+ }, import("@sealant/api-contracts").BoatAccountConflictError | import("@sealant/api-contracts").BoatAccountInternalServerError | import("@sealant/api-contracts").BoatAccountNotFoundError | import("@sealant/api-contracts").BoatAccountServiceUnavailableError | import("@sealant/api-contracts").BudgetExceededError | import("effect/http/HttpClientError").HttpClientError | import("@sealant/api-contracts").RequestRefusedError | Schema.SchemaError, SealantApiClient>;
1065
1095
  export declare const listConnectedAccountsOp: (ownerUserId: string) => Effect.Effect<{
1066
1096
  readonly items: readonly {
1067
1097
  readonly connectedAccountId: string;
@@ -66,6 +66,11 @@ export const createAccessTokenOp = (payload) => Effect.flatMap(SealantApiClient,
66
66
  export const ensureUserOp = (payload) => Effect.flatMap(SealantApiClient, (client) => client.users.ensureUser({ payload }));
67
67
  export const bindUserPersonOp = (userId, payload) => Effect.flatMap(SealantApiClient, (client) => client.users.bindUserPerson({ params: { userId }, payload }));
68
68
  export const getUserOp = (userId) => Effect.flatMap(SealantApiClient, (client) => client.users.getUser({ params: { userId } }));
69
+ // ---- boat accounts ----
70
+ export const createBoatAccountOp = (payload) => Effect.flatMap(SealantApiClient, (client) => client.boatAccounts.createBoatAccount({ payload }));
71
+ export const listBoatAccountsOp = () => Effect.flatMap(SealantApiClient, (client) => client.boatAccounts.listBoatAccounts({}));
72
+ export const rotateBoatAccountKeyOp = (boatAccountId, payload) => Effect.flatMap(SealantApiClient, (client) => client.boatAccounts.rotateBoatAccountKey({ params: { boatAccountId }, payload }));
73
+ export const removeBoatAccountOp = (boatAccountId) => Effect.flatMap(SealantApiClient, (client) => client.boatAccounts.removeBoatAccount({ params: { boatAccountId } }));
69
74
  // ---- connected accounts ----
70
75
  export const listConnectedAccountsOp = (ownerUserId) => Effect.flatMap(SealantApiClient, (client) => client.connectedAccounts.listConnectedAccounts({ query: { ownerUserId } }));
71
76
  export const createConnectedAccountOp = (payload) => Effect.flatMap(SealantApiClient, (client) => client.connectedAccounts.createConnectedAccount({ payload }));
@@ -38,6 +38,11 @@ export const buildCreateWorkspaceRequest = (options, config) => {
38
38
  if (options.resources !== undefined && options.resources !== "none") {
39
39
  throw new SealantError('workspaces.create `resources` is "none" (the workspace is never linked to project resources) or omitted.', { code: "invalid_create_options" });
40
40
  }
41
+ if (options.boatAccountId !== undefined &&
42
+ options.runtime !== undefined &&
43
+ options.runtime !== "boat") {
44
+ throw new SealantError("workspaces.create `boatAccountId` names a Boat account: it is only for a workspace on the Boat runtime.", { code: "invalid_create_options" });
45
+ }
41
46
  if ((options.repository === undefined) === (options.source === undefined)) {
42
47
  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" });
43
48
  }
@@ -157,6 +162,7 @@ export const buildCreateWorkspaceRequest = (options, config) => {
157
162
  ...(options.network?.cloudMetadata === true ? { network: { cloudMetadata: true } } : {}),
158
163
  // Sent only when asked: absent is the control plane's default (the workspace may be linked).
159
164
  ...(options.resources === undefined ? {} : { resources: options.resources }),
165
+ ...(options.boatAccountId === undefined ? {} : { boatAccountId: options.boatAccountId }),
160
166
  ...(options.credentialsHome === undefined
161
167
  ? {}
162
168
  : {
package/dist/types.d.ts CHANGED
@@ -914,6 +914,17 @@ export interface CreateOptions {
914
914
  * older than the option rejects the create (400): its spec is strict.
915
915
  */
916
916
  readonly resources?: "none";
917
+ /**
918
+ * The stored Boat account (`sealant.boatAccounts.create()`) whose VMs this workspace runs in and
919
+ * is billed to. Only for a workspace on the Boat runtime (`runtime: "boat"`, or a control plane
920
+ * whose default runtime is Boat). Kept for the workspace's life: every run of it, restarts
921
+ * included, stays in that account and uses its key. Omitted, the workspace runs in the
922
+ * control plane's default Boat account.
923
+ *
924
+ * An unknown or removed account rejects the create with a `SealantApiError` (404), one being
925
+ * removed with a 409, and naming one for a workspace not on Boat with a 400.
926
+ */
927
+ readonly boatAccountId?: string;
917
928
  /** When true (default), resolve only once the workspace runtime is live. */
918
929
  readonly wait?: boolean;
919
930
  /**
@@ -2292,6 +2303,47 @@ export interface UsersNamespace {
2292
2303
  readonly created: boolean;
2293
2304
  }>;
2294
2305
  }
2306
+ /** A stored Boat account as every surface sees it: NEVER its key. */
2307
+ export interface BoatAccount {
2308
+ readonly boatAccountId: string;
2309
+ readonly label: string;
2310
+ /** `active`: workspaces may run in it. `removing`: its removal was asked; none may. */
2311
+ readonly state: "active" | "removing";
2312
+ readonly createdAt: string;
2313
+ /** When its key was last replaced; null while it has the key it was created with. */
2314
+ readonly keyRotatedAt: string | null;
2315
+ }
2316
+ /**
2317
+ * The Boat accounts the control plane keeps beside its default one (its env key), each with its
2318
+ * own Boat API key: a workspace created with `boatAccountId` runs its VMs in, and bills them to,
2319
+ * that account. Install-scoped: needs a service key. A key goes in and never comes out.
2320
+ */
2321
+ export interface BoatAccountsNamespace {
2322
+ /**
2323
+ * Stores a Boat account. The key is checked with Boat by one read-only call first: a key Boat
2324
+ * refuses rejects with a `SealantApiError` (422, `reason` `boat-key-refused`; `boat-key-unverified`
2325
+ * when Boat did not answer) and nothing is stored. No error names the key.
2326
+ */
2327
+ create(options: {
2328
+ readonly label: string;
2329
+ readonly apiKey: string;
2330
+ }): Promise<BoatAccount>;
2331
+ /** Every stored account not removed, oldest first. */
2332
+ list(): Promise<readonly BoatAccount[]>;
2333
+ /**
2334
+ * Replaces the account's key. The new key must see every VM the account runs and every saved
2335
+ * image its launches use, or the call rejects (409, `reason` `boat-key-cannot-see`) and nothing
2336
+ * changes. Running workspaces stay in the account and use the new key from then on.
2337
+ */
2338
+ rotateKey(boatAccountId: string, apiKey: string): Promise<BoatAccount>;
2339
+ /**
2340
+ * Removes the account. Rejects (409, `reason` `boat-account-in-use`, with the count in the
2341
+ * message) while it has workspaces whose VMs Boat may still hold, or an image build in flight.
2342
+ * Otherwise it answers `state: "removing"`: no new workspace runs in it, and the control plane
2343
+ * deletes the saved images it built in the account before the account is gone from `list()`.
2344
+ */
2345
+ remove(boatAccountId: string): Promise<BoatAccount>;
2346
+ }
2295
2347
  export type ConnectedAccountProvider = "claude" | "codex" | "github";
2296
2348
  export type ConnectedAccountStatus = "active" | "invalid" | "archived";
2297
2349
  /** A connected account as every surface sees it — NEVER carries secret material. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sealant/sdk-next",
3
- "version": "0.40.0-next.863",
3
+ "version": "0.40.0-next.866",
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.863"
29
+ "@sealant/api-contracts": "npm:@sealant/api-contracts-next@0.40.0-next.866"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "effect": "^4.0.5"
33
33
  },
34
- "gitHead": "b5175f1c14cc2b4e5952934c5d8fd8e166234560",
34
+ "gitHead": "c23baae8aee3b098d43bef3dfa807e43378a365d",
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  }