@enclave-run/sdk 0.0.0 → 0.2.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/dist/index.d.mts CHANGED
@@ -589,7 +589,7 @@ interface paths {
589
589
  400: components["responses"]["400"];
590
590
  401: components["responses"]["401"];
591
591
  403: components["responses"]["403"];
592
- 503: components["responses"]["503"];
592
+ 503: components["responses"]["500"];
593
593
  };
594
594
  };
595
595
  put?: never;
@@ -821,7 +821,7 @@ interface paths {
821
821
  };
822
822
  401: components["responses"]["401"];
823
823
  403: components["responses"]["403"];
824
- 503: components["responses"]["503"];
824
+ 503: components["responses"]["500"];
825
825
  };
826
826
  };
827
827
  delete?: never;
@@ -1598,85 +1598,6 @@ interface paths {
1598
1598
  patch?: never;
1599
1599
  trace?: never;
1600
1600
  };
1601
- "/templates/{templateID}/activations/{region}": {
1602
- parameters: {
1603
- query?: never;
1604
- header?: never;
1605
- path?: never;
1606
- cookie?: never;
1607
- };
1608
- /** @description Get desired and locally observed activation for one exact template build in a region. */
1609
- get: {
1610
- parameters: {
1611
- query?: {
1612
- /** @description Exact immutable build generation. When omitted, the build selected by the template identifier's tag (default when untagged) is used. */
1613
- buildID?: string;
1614
- };
1615
- header?: never;
1616
- path: {
1617
- region: string;
1618
- templateID: components["parameters"]["templateID"];
1619
- };
1620
- cookie?: never;
1621
- };
1622
- requestBody?: never;
1623
- responses: {
1624
- /** @description Activation status. */
1625
- 200: {
1626
- headers: {
1627
- [name: string]: unknown;
1628
- };
1629
- content: {
1630
- "application/json": components["schemas"]["TemplateRegionActivation"];
1631
- };
1632
- };
1633
- 401: components["responses"]["401"];
1634
- 403: components["responses"]["403"];
1635
- 404: components["responses"]["404"];
1636
- 500: components["responses"]["500"];
1637
- };
1638
- };
1639
- put?: never;
1640
- /** @description Set the desired activation of one exact template build in a region. */
1641
- post: {
1642
- parameters: {
1643
- query?: never;
1644
- header?: never;
1645
- path: {
1646
- region: string;
1647
- templateID: components["parameters"]["templateID"];
1648
- };
1649
- cookie?: never;
1650
- };
1651
- requestBody: {
1652
- content: {
1653
- "application/json": components["schemas"]["TemplateRegionActivationRequest"];
1654
- };
1655
- };
1656
- responses: {
1657
- /** @description Desired activation was recorded. */
1658
- 200: {
1659
- headers: {
1660
- [name: string]: unknown;
1661
- };
1662
- content: {
1663
- "application/json": components["schemas"]["TemplateRegionActivation"];
1664
- };
1665
- };
1666
- 400: components["responses"]["400"];
1667
- 401: components["responses"]["401"];
1668
- 403: components["responses"]["403"];
1669
- 404: components["responses"]["404"];
1670
- 409: components["responses"]["409"];
1671
- 500: components["responses"]["500"];
1672
- };
1673
- };
1674
- delete?: never;
1675
- options?: never;
1676
- head?: never;
1677
- patch?: never;
1678
- trace?: never;
1679
- };
1680
1601
  "/templates/{templateID}/builds/{buildID}/logs": {
1681
1602
  parameters: {
1682
1603
  query?: never;
@@ -3669,65 +3590,6 @@ interface components {
3669
3590
  * @enum {string}
3670
3591
  */
3671
3592
  TemplateBuildStatus: "building" | "waiting" | "ready" | "error";
3672
- TemplateRegionActivation: {
3673
- allowRemoteFallback: boolean;
3674
- artifactGeneration: string;
3675
- /** Format: uuid */
3676
- buildID: string;
3677
- /** @enum {string} */
3678
- desiredState: "active" | "inactive";
3679
- nodes: components["schemas"]["TemplateRegionActivationNode"][];
3680
- /** Format: int32 */
3681
- readyNodes: number;
3682
- region: string;
3683
- /** Format: int32 */
3684
- requiredReadyNodes: number;
3685
- /** @enum {string} */
3686
- status: "requested" | "warming" | "ready" | "degraded" | "failed" | "inactive";
3687
- templateID: string;
3688
- /** Format: date-time */
3689
- updatedAt: string;
3690
- /** Format: int64 */
3691
- version: number;
3692
- };
3693
- TemplateRegionActivationNode: {
3694
- /** Format: int32 */
3695
- attempts: number;
3696
- /** Format: int64 */
3697
- bytesMaterialized: number;
3698
- errorCode?: string;
3699
- nodeID: string;
3700
- /** Format: date-time */
3701
- observedAt: string;
3702
- /** Format: date-time */
3703
- readyAt?: string;
3704
- /** @enum {string} */
3705
- state: "requested" | "warming" | "ready" | "degraded" | "failed";
3706
- };
3707
- TemplateRegionActivationRequest: {
3708
- /** @default true */
3709
- active?: boolean;
3710
- /**
3711
- * @description Permit explicitly classified remote-backed creates while this generation is not ready.
3712
- * @default false
3713
- */
3714
- allowRemoteFallback?: boolean;
3715
- /**
3716
- * Format: uuid
3717
- * @description Exact immutable build generation to materialize.
3718
- */
3719
- buildID: string;
3720
- /**
3721
- * Format: int64
3722
- * @description Compare-and-swap precondition for this exact build activation. Use 0 to require that it does not yet exist, or the last observed version to update it.
3723
- */
3724
- expectedVersion?: number;
3725
- /**
3726
- * Format: int32
3727
- * @default 1
3728
- */
3729
- requiredReadyNodes?: number;
3730
- };
3731
3593
  TemplateRequestResponseV3: {
3732
3594
  /** @description Identifier of the last successful build for given template */
3733
3595
  buildID: string;
@@ -3770,6 +3632,11 @@ interface components {
3770
3632
  createdAt: string;
3771
3633
  /** @description The tag name */
3772
3634
  tag: string;
3635
+ /**
3636
+ * Format: int64
3637
+ * @description Compare-and-swap version of this tag head. Pass it with the build ID as the expected head when moving the tag. Omitted when the tag is not a current, promotable head.
3638
+ */
3639
+ version?: number;
3773
3640
  };
3774
3641
  TemplateTagHead: {
3775
3642
  /** Format: uuid */
@@ -4130,6 +3997,14 @@ declare class OutcomeUnknownError extends SandboxError {
4130
3997
  readonly cause?: unknown;
4131
3998
  constructor(message: string, recovery: SandboxCreateRecovery, cause?: unknown);
4132
3999
  }
4000
+ /**
4001
+ * The durable create operation reached an authoritative failed state after
4002
+ * admission. The recovery identity remains available for audit and support.
4003
+ */
4004
+ declare class SandboxCreateFailedError extends SandboxError {
4005
+ readonly recovery: SandboxCreateRecovery;
4006
+ constructor(message: string, recovery: SandboxCreateRecovery);
4007
+ }
4133
4008
  /**
4134
4009
  * The selected region explicitly rejected the request before admission.
4135
4010
  */
@@ -4216,7 +4091,7 @@ type TemplateTagConflictReason = "tag_changed" | "concurrent_mutation";
4216
4091
  /**
4217
4092
  * A concurrent template tag mutation prevented an atomic promotion.
4218
4093
  *
4219
- * Fetch the current head with `Template.getTagHead`, decide whether the
4094
+ * Read the current head with `Template.getTags`, decide whether the
4220
4095
  * promotion is still appropriate, and retry with that newly observed token.
4221
4096
  */
4222
4097
  declare class TemplateTagConflictError extends TemplateError {
@@ -9372,55 +9247,6 @@ type TemplateBuildStatusResponse = {
9372
9247
  */
9373
9248
  reason?: BuildStatusReason;
9374
9249
  };
9375
- type TemplateRegionActivation = components["schemas"]["TemplateRegionActivation"];
9376
- type TemplateActivationOptions = ConnectionOpts & {
9377
- /**
9378
- * Region in which the exact build generation should be ready.
9379
- * @default ENCLAVE_REGION, then yyz
9380
- */
9381
- region?: string;
9382
- /**
9383
- * Number of eligible nodes that must report this exact generation ready.
9384
- * @default 1
9385
- */
9386
- requiredReadyNodes?: number;
9387
- /**
9388
- * Explicitly permit separately classified remote-backed creates while the
9389
- * region warms. The normal activated path remains local-only.
9390
- * @default false
9391
- */
9392
- allowRemoteFallback?: boolean;
9393
- /**
9394
- * Compare-and-swap precondition for this exact build activation.
9395
- * Use `0` to require a new activation, or the last observed version when
9396
- * changing one.
9397
- */
9398
- expectedVersion?: number;
9399
- };
9400
- type GetTemplateActivationOptions = ConnectionOpts & {
9401
- /**
9402
- * Region whose cell-local activation evidence should be returned.
9403
- * @default ENCLAVE_REGION, then yyz
9404
- */
9405
- region?: string;
9406
- /**
9407
- * Exact immutable build generation whose regional state should be returned.
9408
- * When omitted, Enclave resolves the tag in `templateId` (`default` when
9409
- * untagged) for compatibility with existing callers.
9410
- */
9411
- buildId?: string;
9412
- };
9413
- type DeactivateTemplateOptions = ConnectionOpts & {
9414
- /**
9415
- * Region in which the exact build generation should be deactivated.
9416
- * @default ENCLAVE_REGION, then yyz
9417
- */
9418
- region?: string;
9419
- /**
9420
- * Compare-and-swap precondition using the last observed activation version.
9421
- */
9422
- expectedVersion?: number;
9423
- };
9424
9250
  /**
9425
9251
  * Information about assigned template tags.
9426
9252
  */
@@ -9433,6 +9259,11 @@ type TemplateTagInfo = {
9433
9259
  * Assigned tags of the template.
9434
9260
  */
9435
9261
  tags: string[];
9262
+ /**
9263
+ * Compare-and-swap version of the moved tag. Set when the tag was assigned
9264
+ * with an `expect` precondition.
9265
+ */
9266
+ version?: number;
9436
9267
  };
9437
9268
  /**
9438
9269
  * Detailed information about a single template tag.
@@ -9450,34 +9281,36 @@ type TemplateTag = {
9450
9281
  * When this tag was assigned.
9451
9282
  */
9452
9283
  createdAt: Date;
9284
+ /**
9285
+ * Compare-and-swap version of this tag head. Pass it with `buildId` as the
9286
+ * `expect` precondition of {@link Template.assignTags}. Undefined when the
9287
+ * tag is not a current, promotable head.
9288
+ */
9289
+ version?: number;
9453
9290
  };
9454
9291
  /**
9455
9292
  * Authoritative traffic-selection token for one template tag.
9456
9293
  */
9457
- type TemplateTagHead = {
9458
- /**
9459
- * Name of the tag.
9460
- */
9461
- tag: string;
9462
- /**
9463
- * Exact build currently selected by the tag.
9464
- */
9294
+ /**
9295
+ * The head a tag must still point at for {@link Template.assignTags} to move
9296
+ * it, as read from {@link Template.getTags}. `null` requires the tag to not
9297
+ * exist yet.
9298
+ */
9299
+ type TemplateTagExpectation = {
9465
9300
  buildId: string;
9466
- /**
9467
- * Monotonic version used to fence concurrent promotion attempts.
9468
- */
9469
9301
  version: number;
9302
+ } | null;
9303
+ /**
9304
+ * Options for {@link Template.assignTags}.
9305
+ */
9306
+ type AssignTagsOptions = ConnectionOpts & {
9470
9307
  /**
9471
- * When this head was assigned.
9308
+ * Move the tag only if it still points at this head (compare-and-swap).
9309
+ * Requires an exact build target and exactly one tag. A mismatch throws
9310
+ * `TemplateTagConflictError`.
9472
9311
  */
9473
- createdAt: Date;
9312
+ expect?: TemplateTagExpectation;
9474
9313
  };
9475
- /**
9476
- * The previously observed tag head required for a safe promotion.
9477
- *
9478
- * Pass `null` to require that the tag does not yet exist.
9479
- */
9480
- type TemplateTagHeadExpectation = Pick<TemplateTagHead, "buildId" | "version"> | null;
9481
9314
  /**
9482
9315
  * Configuration for a single file/directory copy operation.
9483
9316
  */
@@ -10099,23 +9932,6 @@ declare class TemplateBase implements TemplateFromImage, TemplateBuilder, Templa
10099
9932
  * ```
10100
9933
  */
10101
9934
  static getBuildStatus(data: Pick<BuildInfo, "templateId" | "buildId">, options?: GetBuildStatusOptions): Promise<TemplateBuildStatusResponse>;
10102
- /**
10103
- * Materialize one immutable template build in a region before create.
10104
- *
10105
- * The request is recorded on the global control plane; hydration then runs
10106
- * asynchronously inside the selected region. Poll {@link getActivation}
10107
- * until the returned status is `ready`.
10108
- */
10109
- static activate(data: Pick<BuildInfo, "templateId" | "buildId">, options?: TemplateActivationOptions): Promise<TemplateRegionActivation>;
10110
- /**
10111
- * Return desired state plus exact-generation evidence from the selected
10112
- * regional cell.
10113
- */
10114
- static getActivation(templateId: string, options?: GetTemplateActivationOptions): Promise<TemplateRegionActivation>;
10115
- /**
10116
- * Stop pinning and maintaining one exact build generation in a region.
10117
- */
10118
- static deactivate(data: Pick<BuildInfo, "templateId" | "buildId">, options?: DeactivateTemplateOptions): Promise<TemplateRegionActivation>;
10119
9935
  /**
10120
9936
  * Check if a template with the given name exists.
10121
9937
  *
@@ -10149,7 +9965,7 @@ declare class TemplateBase implements TemplateFromImage, TemplateBuilder, Templa
10149
9965
  * await Template.assignTags('my-template:v1.0', ['production', 'stable'])
10150
9966
  * ```
10151
9967
  */
10152
- static assignTags(targetName: string, tags: string | string[], options?: ConnectionOpts): Promise<TemplateTagInfo>;
9968
+ static assignTags(target: string | Pick<BuildInfo, "templateId" | "buildId">, tags: string | string[], options?: AssignTagsOptions): Promise<TemplateTagInfo>;
10153
9969
  /**
10154
9970
  * Remove tag(s) from a template.
10155
9971
  *
@@ -10183,23 +9999,6 @@ declare class TemplateBase implements TemplateFromImage, TemplateBuilder, Templa
10183
9999
  * ```
10184
10000
  */
10185
10001
  static getTags(templateId: string, options?: ConnectionOpts): Promise<TemplateTag[]>;
10186
- /**
10187
- * Get the authoritative traffic-selection token for one template tag.
10188
- *
10189
- * Pass the returned head directly to {@link promoteTag}; its monotonic
10190
- * version prevents concurrent releasers from silently overwriting each
10191
- * other.
10192
- */
10193
- static getTagHead(templateId: string, tag: string, options?: ConnectionOpts): Promise<TemplateTagHead>;
10194
- /**
10195
- * Atomically move one template tag to an exact ready, durable build.
10196
- *
10197
- * Use a head returned by {@link getTagHead} as `expected`. Pass `null` only
10198
- * when creating a tag that must not already exist. A concurrent change throws
10199
- * `TemplateTagConflictError`; fetch the head again before deciding whether to
10200
- * retry.
10201
- */
10202
- static promoteTag(candidate: Pick<BuildInfo, "templateId" | "buildId">, tag: string, expected: TemplateTagHeadExpectation, options?: ConnectionOpts): Promise<TemplateTagHead>;
10203
10002
  fromDebianImage(variant?: string): TemplateBuilder;
10204
10003
  fromUbuntuImage(variant?: string): TemplateBuilder;
10205
10004
  fromPythonImage(version?: string): TemplateBuilder;
@@ -10370,17 +10169,12 @@ declare namespace Template {
10370
10169
  var build: typeof TemplateBase.build;
10371
10170
  var buildInBackground: typeof TemplateBase.buildInBackground;
10372
10171
  var getBuildStatus: typeof TemplateBase.getBuildStatus;
10373
- var activate: typeof TemplateBase.activate;
10374
- var getActivation: typeof TemplateBase.getActivation;
10375
- var deactivate: typeof TemplateBase.deactivate;
10376
10172
  var exists: typeof TemplateBase.exists;
10377
10173
  var assignTags: typeof TemplateBase.assignTags;
10378
10174
  var removeTags: typeof TemplateBase.removeTags;
10379
10175
  var getTags: typeof TemplateBase.getTags;
10380
- var getTagHead: typeof TemplateBase.getTagHead;
10381
- var promoteTag: typeof TemplateBase.promoteTag;
10382
10176
  var toJSON: typeof TemplateBase.toJSON;
10383
10177
  var toDockerfile: typeof TemplateBase.toDockerfile;
10384
10178
  }
10385
10179
 
10386
- export { ALL_TRAFFIC, ApiClient, AuthenticationError, BuildError, type BuildInfo, type BuildOptions, type BuildStatusReason, type CommandConnectOpts, CommandExitError, CommandHandle, type CommandRequestOpts, type CommandResult, type CommandStartOpts, Commands, ConnectionConfig, type ConnectionOpts, type CopyItem, type CredentialAuditEvent, type DeactivateTemplateOptions, type EntryInfo, FileType, FileUploadError, Filesystem, type FilesystemEvent, FilesystemEventType, type GetBuildStatusOptions, type GetTemplateActivationOptions, Git, type GitAddOpts, GitAuthError, type GitBranches, type GitCloneOpts, type GitCommitOpts, type GitConfigOpts, type GitConfigScope, type GitDangerouslyAuthenticateOpts, type GitDeleteBranchOpts, type GitFileStatus, GitHubApp, type GitHubAuditQuery, type GitHubCredentialGrant, type GitHubGrantScope, type GitHubInstallation, type GitHubInstallationCallback, type GitHubInstallationLink, type GitHubRepositoryBinding, type GitHubRepositoryBindingOpts, type GitHubRepositoryPermissions, type GitInitOpts, type GitPullOpts, type GitPushOpts, type GitRemoteAddOpts, type GitRequestOpts, type GitStatus, GitUpstreamError, IdempotencyMismatchError, InvalidArgumentError, LogEntry, LogEntryEnd, type LogEntryLevel, LogEntryStart, type Logger, type McpServer$1 as McpServer, type McpServerName, NotEnoughSpaceError, NotFoundError, OutcomeUnknownError, type ProcessInfo, Pty, type PtyOutput, RateLimitError, ReadyCmd, RegionCapacityError, Sandbox, type SandboxApiOpts, type SandboxConnectOpts, type SandboxCreateRecovery, SandboxCreateRejectedError, type SandboxCreateRejectionReason, SandboxError, type SandboxInfo, type SandboxLifecycle, type SandboxListOpts, type SandboxMetrics, type SandboxMetricsOpts, type SandboxNetworkOpts, type SandboxOpts, SandboxPaginator, type SandboxRef, SandboxRegionScope, type SandboxState, type SandboxTarget, type SnapshotInfo, type SnapshotListOpts, SnapshotPaginator, type Stderr, type Stdout, Template, type TemplateActivationOptions, TemplateBase, type TemplateBuildStatus, type TemplateBuildStatusResponse, type TemplateBuilder, type TemplateClass, TemplateError, type TemplateRegionActivation, type TemplateTag, TemplateTagConflictError, type TemplateTagConflictReason, type TemplateTagHead, type TemplateTagHeadExpectation, type TemplateTagInfo, TimeoutError, type Username, WatchHandle, type WriteInfo, type components, Sandbox as default, defaultBuildLogger, getSignature, type paths, waitForFile, waitForPort, waitForProcess, waitForTimeout, waitForURL };
10180
+ export { ALL_TRAFFIC, ApiClient, type AssignTagsOptions, AuthenticationError, BuildError, type BuildInfo, type BuildOptions, type BuildStatusReason, type CommandConnectOpts, CommandExitError, CommandHandle, type CommandRequestOpts, type CommandResult, type CommandStartOpts, Commands, ConnectionConfig, type ConnectionOpts, type CopyItem, type CredentialAuditEvent, type EntryInfo, FileType, FileUploadError, Filesystem, type FilesystemEvent, FilesystemEventType, type GetBuildStatusOptions, Git, type GitAddOpts, GitAuthError, type GitBranches, type GitCloneOpts, type GitCommitOpts, type GitConfigOpts, type GitConfigScope, type GitDangerouslyAuthenticateOpts, type GitDeleteBranchOpts, type GitFileStatus, GitHubApp, type GitHubAuditQuery, type GitHubCredentialGrant, type GitHubGrantScope, type GitHubInstallation, type GitHubInstallationCallback, type GitHubInstallationLink, type GitHubRepositoryBinding, type GitHubRepositoryBindingOpts, type GitHubRepositoryPermissions, type GitInitOpts, type GitPullOpts, type GitPushOpts, type GitRemoteAddOpts, type GitRequestOpts, type GitStatus, GitUpstreamError, IdempotencyMismatchError, InvalidArgumentError, LogEntry, LogEntryEnd, type LogEntryLevel, LogEntryStart, type Logger, type McpServer$1 as McpServer, type McpServerName, NotEnoughSpaceError, NotFoundError, OutcomeUnknownError, type ProcessInfo, Pty, type PtyOutput, RateLimitError, ReadyCmd, RegionCapacityError, Sandbox, type SandboxApiOpts, type SandboxConnectOpts, SandboxCreateFailedError, type SandboxCreateRecovery, SandboxCreateRejectedError, type SandboxCreateRejectionReason, SandboxError, type SandboxInfo, type SandboxLifecycle, type SandboxListOpts, type SandboxMetrics, type SandboxMetricsOpts, type SandboxNetworkOpts, type SandboxOpts, SandboxPaginator, type SandboxRef, SandboxRegionScope, type SandboxState, type SandboxTarget, type SnapshotInfo, type SnapshotListOpts, SnapshotPaginator, type Stderr, type Stdout, Template, TemplateBase, type TemplateBuildStatus, type TemplateBuildStatusResponse, type TemplateBuilder, type TemplateClass, TemplateError, type TemplateTag, TemplateTagConflictError, type TemplateTagConflictReason, type TemplateTagExpectation, type TemplateTagInfo, TimeoutError, type Username, WatchHandle, type WriteInfo, type components, Sandbox as default, defaultBuildLogger, getSignature, type paths, waitForFile, waitForPort, waitForProcess, waitForTimeout, waitForURL };