@sealant/sdk-next 0.40.0-next.790 → 0.40.0-next.791
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.
|
@@ -856,6 +856,14 @@ declare const buildControlPlaneClient: (config: SealantInternalConfig) => Effect
|
|
|
856
856
|
}>>;
|
|
857
857
|
}>>;
|
|
858
858
|
}>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").ResourceDomainForbiddenError | typeof import("@sealant/api-contracts").ResourceDomainNotFoundError | typeof import("@sealant/api-contracts").ResourceDomainInternalServerError | typeof import("@sealant/api-contracts").ResourceInstanceSpecRefusedError | typeof import("@sealant/api-contracts").ResourceRuntimeUnsupportedError | typeof import("@sealant/api-contracts").ResourceInstanceBusyError | typeof import("@sealant/api-contracts").ResourceInstanceBudgetError>, import("@sealant/api-contracts").RequestBudget | import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
|
|
859
|
+
readonly purgeResourceInstance: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"purgeResourceInstance", "POST", "/v1/resource-domains/:resourceDomainId/instances/:key/purge", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
860
|
+
readonly resourceDomainId: import("effect/Schema").String;
|
|
861
|
+
readonly key: import("effect/Schema").brand<import("effect/Schema").String, "ResourceInstanceKey">;
|
|
862
|
+
}>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
863
|
+
readonly expectedInstanceId: import("effect/Schema").brand<import("effect/Schema").String, "ResourceInstanceId">;
|
|
864
|
+
}>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
865
|
+
readonly kind: import("effect/Schema").Literals<readonly ["purged", "already-purged"]>;
|
|
866
|
+
}>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").ResourceDomainForbiddenError | typeof import("@sealant/api-contracts").ResourceDomainNotFoundError | typeof import("@sealant/api-contracts").ResourceDomainInternalServerError | typeof import("@sealant/api-contracts").ResourceInstanceSpecRefusedError | typeof import("@sealant/api-contracts").ResourceRuntimeUnsupportedError | typeof import("@sealant/api-contracts").ResourceInstancePurgeRefusedError | typeof import("@sealant/api-contracts").ResourceInstanceBusyError | typeof import("@sealant/api-contracts").ResourceInstanceBudgetError>, import("@sealant/api-contracts").RequestBudget | import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
|
|
859
867
|
readonly stopResourceInstance: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"stopResourceInstance", "POST", "/v1/resource-domains/:resourceDomainId/instances/:key/stop", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
860
868
|
readonly resourceDomainId: import("effect/Schema").String;
|
|
861
869
|
readonly key: import("effect/Schema").brand<import("effect/Schema").String, "ResourceInstanceKey">;
|
|
@@ -3253,6 +3261,14 @@ declare const SealantApiClient_base: Context.ServiceClass<SealantApiClient, "@se
|
|
|
3253
3261
|
}>>;
|
|
3254
3262
|
}>>;
|
|
3255
3263
|
}>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").ResourceDomainForbiddenError | typeof import("@sealant/api-contracts").ResourceDomainNotFoundError | typeof import("@sealant/api-contracts").ResourceDomainInternalServerError | typeof import("@sealant/api-contracts").ResourceInstanceSpecRefusedError | typeof import("@sealant/api-contracts").ResourceRuntimeUnsupportedError | typeof import("@sealant/api-contracts").ResourceInstanceBusyError | typeof import("@sealant/api-contracts").ResourceInstanceBudgetError>, import("@sealant/api-contracts").RequestBudget | import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
|
|
3264
|
+
readonly purgeResourceInstance: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"purgeResourceInstance", "POST", "/v1/resource-domains/:resourceDomainId/instances/:key/purge", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
3265
|
+
readonly resourceDomainId: import("effect/Schema").String;
|
|
3266
|
+
readonly key: import("effect/Schema").brand<import("effect/Schema").String, "ResourceInstanceKey">;
|
|
3267
|
+
}>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
3268
|
+
readonly expectedInstanceId: import("effect/Schema").brand<import("effect/Schema").String, "ResourceInstanceId">;
|
|
3269
|
+
}>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
3270
|
+
readonly kind: import("effect/Schema").Literals<readonly ["purged", "already-purged"]>;
|
|
3271
|
+
}>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").ResourceDomainForbiddenError | typeof import("@sealant/api-contracts").ResourceDomainNotFoundError | typeof import("@sealant/api-contracts").ResourceDomainInternalServerError | typeof import("@sealant/api-contracts").ResourceInstanceSpecRefusedError | typeof import("@sealant/api-contracts").ResourceRuntimeUnsupportedError | typeof import("@sealant/api-contracts").ResourceInstancePurgeRefusedError | typeof import("@sealant/api-contracts").ResourceInstanceBusyError | typeof import("@sealant/api-contracts").ResourceInstanceBudgetError>, import("@sealant/api-contracts").RequestBudget | import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
|
|
3256
3272
|
readonly stopResourceInstance: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"stopResourceInstance", "POST", "/v1/resource-domains/:resourceDomainId/instances/:key/stop", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
3257
3273
|
readonly resourceDomainId: import("effect/Schema").String;
|
|
3258
3274
|
readonly key: import("effect/Schema").brand<import("effect/Schema").String, "ResourceInstanceKey">;
|
|
@@ -1507,6 +1507,9 @@ export declare const archiveResourceInstanceOp: (resourceDomainId: string, key:
|
|
|
1507
1507
|
readonly bytes: number | null;
|
|
1508
1508
|
}[];
|
|
1509
1509
|
}, import("@sealant/api-contracts").BudgetExceededError | import("effect/http/HttpClientError").HttpClientError | import("@sealant/api-contracts").RequestRefusedError | import("@sealant/api-contracts").ResourceDomainForbiddenError | import("@sealant/api-contracts").ResourceDomainInternalServerError | import("@sealant/api-contracts").ResourceDomainNotFoundError | import("@sealant/api-contracts").ResourceInstanceBudgetError | import("@sealant/api-contracts").ResourceInstanceBusyError | import("@sealant/api-contracts").ResourceInstanceNotFoundError | import("@sealant/api-contracts").ResourceInstanceSpecRefusedError | import("@sealant/api-contracts").ResourceRuntimeUnsupportedError | Schema.SchemaError | import("effect/Cause").UnknownError, SealantApiClient>;
|
|
1510
|
+
export declare const purgeResourceInstanceOp: (resourceDomainId: string, key: string, expectedInstanceId: string) => Effect.Effect<{
|
|
1511
|
+
readonly kind: "already-purged" | "purged";
|
|
1512
|
+
}, import("@sealant/api-contracts").BudgetExceededError | import("effect/http/HttpClientError").HttpClientError | import("@sealant/api-contracts").RequestRefusedError | import("@sealant/api-contracts").ResourceDomainForbiddenError | import("@sealant/api-contracts").ResourceDomainInternalServerError | import("@sealant/api-contracts").ResourceDomainNotFoundError | import("@sealant/api-contracts").ResourceInstanceBudgetError | import("@sealant/api-contracts").ResourceInstanceBusyError | import("@sealant/api-contracts").ResourceInstancePurgeRefusedError | import("@sealant/api-contracts").ResourceInstanceSpecRefusedError | import("@sealant/api-contracts").ResourceRuntimeUnsupportedError | Schema.SchemaError | import("effect/Cause").UnknownError, SealantApiClient>;
|
|
1510
1513
|
export declare const linkResourceWorkspaceOp: (resourceDomainId: string, workspaceId: string, worktreeKey: string, aliases?: Readonly<Record<string, "project" | "worktree">>) => Effect.Effect<{
|
|
1511
1514
|
readonly workspaceId: string;
|
|
1512
1515
|
readonly worktreeKey: string & import("effect/Brand").Brand<"ResourceWorktreeKey">;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ResourceInstanceKey, ResourceReachAliases, ResourceWorktreeKey, } from "@sealant/api-contracts";
|
|
1
|
+
import { ResourceInstanceId, ResourceInstanceKey, ResourceReachAliases, ResourceWorktreeKey, } from "@sealant/api-contracts";
|
|
2
2
|
import { Effect, Schema } from "effect";
|
|
3
3
|
import { CurrentRequestPriority, SealantApiClient } from "./api-client.js";
|
|
4
4
|
// ---- workspaces ----
|
|
@@ -127,6 +127,14 @@ export const stopResourceInstanceOp = (resourceDomainId, key, by) => Effect.flat
|
|
|
127
127
|
export const archiveResourceInstanceOp = (resourceDomainId, key) => Effect.flatMap(Effect.all([SealantApiClient, instanceKey(key)]), ([client, checked]) => client.resourceInstances.archiveResourceInstance({
|
|
128
128
|
params: { resourceDomainId, key: checked },
|
|
129
129
|
}));
|
|
130
|
+
export const purgeResourceInstanceOp = (resourceDomainId, key, expectedInstanceId) => Effect.flatMap(Effect.all([
|
|
131
|
+
SealantApiClient,
|
|
132
|
+
instanceKey(key),
|
|
133
|
+
Effect.try(() => ResourceInstanceId.make(expectedInstanceId)),
|
|
134
|
+
]), ([client, checked, id]) => client.resourceInstances.purgeResourceInstance({
|
|
135
|
+
params: { resourceDomainId, key: checked },
|
|
136
|
+
payload: { expectedInstanceId: id },
|
|
137
|
+
})).pipe(Effect.provideService(CurrentRequestPriority, "interactive"));
|
|
130
138
|
export const linkResourceWorkspaceOp = (resourceDomainId, workspaceId, worktreeKey, aliases) => Effect.flatMap(Effect.all([
|
|
131
139
|
SealantApiClient,
|
|
132
140
|
Effect.try(() => ResourceWorktreeKey.make(worktreeKey)),
|
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,6 @@ export { claudeCode, codex, customHarness, opencode, pi } from "./harness.js";
|
|
|
19
19
|
export { ForwardDialError, type ForwardDialFailure, type ForwardDialReason, ForwardResetError, SealantApiError, SealantBudgetExceededError, SealantError, SealantNotImplementedError, SealantRuntimeError, } from "./errors.js";
|
|
20
20
|
export type * from "./types.js";
|
|
21
21
|
export type { EnsuredScope, ScopeBudget, ScopeBudgetDimension, ScopeBudgetLimits, ScopeBudgets, ScopeClient, ScopeInfo, ScopeMember, ScopeMemberDecision, ScopeMemberPage, ScopeMembers, ScopesNamespace, } from "./scopes.js";
|
|
22
|
-
export type { ScopeArchivedVolume, ScopeExecResult, ScopeInstance, ScopeInstances, ScopeInstanceSpec, ScopeInstanceState, ScopeInstanceStopReason, ScopeWorkspaces, } from "./scope-instances.js";
|
|
22
|
+
export type { ScopeArchivedVolume, ScopeExecResult, ScopeInstance, ScopeInstances, ScopeInstanceSpec, ScopeInstanceState, ScopeInstanceStopReason, ScopeInstancePurgeResult, ScopeWorkspaces, } from "./scope-instances.js";
|
|
23
23
|
export { findWorkspaceEnvReservedRule, findWorkspaceSecretEnvReservedRule, formatWorkspaceEnvIssue, parseWorkspaceEnv, parseWorkspaceSecretEnv, WORKSPACE_ENV_MAX_ENTRIES, WORKSPACE_ENV_MAX_NAME_LENGTH, WORKSPACE_ENV_MAX_TOTAL_BYTES, WORKSPACE_ENV_MAX_VALUE_BYTES, WORKSPACE_ENV_NAME_PATTERN, WORKSPACE_ENV_SECRET_MARKERS, } from "@sealant/api-contracts/workspace-environment";
|
|
24
24
|
export type { WorkspaceEnvIssue, WorkspaceEnvParseResult, WorkspaceEnvReservedRule, } from "@sealant/api-contracts/workspace-environment";
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A scope's long-running instances (a project's Postgres, Redis or any image), the workspaces that
|
|
3
|
+
* reach them, and the scope's archive. Organization and installation scopes use caller-only
|
|
4
|
+
* reach on Docker or Kubernetes. Other providers reject with `ResourceRuntimeUnsupportedError`.
|
|
5
|
+
*/
|
|
6
|
+
import { type ResourceInstancePurgeResult } from "@sealant/api-contracts";
|
|
1
7
|
import type { SdkRuntime } from "./effect/runtime.js";
|
|
2
8
|
import { type SealantInternalConfig } from "./internal/config.js";
|
|
3
9
|
/**
|
|
@@ -124,7 +130,17 @@ export interface ScopeExecResult {
|
|
|
124
130
|
readonly truncated: boolean;
|
|
125
131
|
readonly timedOut: boolean;
|
|
126
132
|
}
|
|
133
|
+
/** Whether this call removed the instance or found its key already absent. */
|
|
134
|
+
export type ScopeInstancePurgeResult = ResourceInstancePurgeResult;
|
|
127
135
|
export interface ScopeInstances {
|
|
136
|
+
/**
|
|
137
|
+
* Irreversibly delete a stopped or archived caller-owned instance, including retained volumes
|
|
138
|
+
* and sealed env. Pass its observed id to protect a replacement using the same key. No Core
|
|
139
|
+
* backup is retained; previously downloaded copies belong to their recipient.
|
|
140
|
+
*/
|
|
141
|
+
purge(key: string, options: {
|
|
142
|
+
readonly expectedInstanceId: string;
|
|
143
|
+
}): Promise<ScopeInstancePurgeResult>;
|
|
128
144
|
/**
|
|
129
145
|
* Create or update the instance by key, start it and answer once its ready check passed or its
|
|
130
146
|
* start failed (`state.kind`). `cause: "use"` (a launch, a wake) leaves an instance a person
|
package/dist/scope-instances.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* reach on Docker or Kubernetes. Other providers reject with `ResourceRuntimeUnsupportedError`.
|
|
5
5
|
*/
|
|
6
6
|
import { RESOURCE_INSTANCE_EXEC, RESOURCE_INSTANCE_BACKUP, } from "@sealant/api-contracts";
|
|
7
|
-
import { archiveResourceDomainOp, archiveResourceInstanceOp, getResourceInstanceOp, linkResourceWorkspaceOp, listResourceInstancesOp, stopResourceInstanceOp, upResourceInstanceOp, } from "./effect/operations.js";
|
|
7
|
+
import { archiveResourceDomainOp, archiveResourceInstanceOp, purgeResourceInstanceOp, getResourceInstanceOp, linkResourceWorkspaceOp, listResourceInstancesOp, stopResourceInstanceOp, upResourceInstanceOp, } from "./effect/operations.js";
|
|
8
8
|
import { SealantApiError, SealantBudgetExceededError, SealantError } from "./errors.js";
|
|
9
9
|
import { resolveRequestPriority } from "./internal/config.js";
|
|
10
10
|
import { toSealantError } from "./internal/map-error.js";
|
|
@@ -138,6 +138,7 @@ const exec = async (config, scopeId, key, options) => {
|
|
|
138
138
|
};
|
|
139
139
|
export const makeScopeInstances = (runtime, config, scopeId) => ({
|
|
140
140
|
instances: {
|
|
141
|
+
purge: (key, options) => runtime.run(purgeResourceInstanceOp(scopeId, key, options.expectedInstanceId)),
|
|
141
142
|
up: async (key, spec, { cause, secretEnv }) => toInstance(await runtime.run(upResourceInstanceOp(scopeId, key, {
|
|
142
143
|
spec: { ...spec },
|
|
143
144
|
cause,
|
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.791",
|
|
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.791"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"effect": "^4.0.5"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "b18cfe790bde2ec8f715311c5fa21ac1b2a8e68e",
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
}
|