@enclave-run/sdk 0.1.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 */
@@ -4224,7 +4091,7 @@ type TemplateTagConflictReason = "tag_changed" | "concurrent_mutation";
4224
4091
  /**
4225
4092
  * A concurrent template tag mutation prevented an atomic promotion.
4226
4093
  *
4227
- * Fetch the current head with `Template.getTagHead`, decide whether the
4094
+ * Read the current head with `Template.getTags`, decide whether the
4228
4095
  * promotion is still appropriate, and retry with that newly observed token.
4229
4096
  */
4230
4097
  declare class TemplateTagConflictError extends TemplateError {
@@ -9380,55 +9247,6 @@ type TemplateBuildStatusResponse = {
9380
9247
  */
9381
9248
  reason?: BuildStatusReason;
9382
9249
  };
9383
- type TemplateRegionActivation = components["schemas"]["TemplateRegionActivation"];
9384
- type TemplateActivationOptions = ConnectionOpts & {
9385
- /**
9386
- * Region in which the exact build generation should be ready.
9387
- * @default ENCLAVE_REGION, then yyz
9388
- */
9389
- region?: string;
9390
- /**
9391
- * Number of eligible nodes that must report this exact generation ready.
9392
- * @default 1
9393
- */
9394
- requiredReadyNodes?: number;
9395
- /**
9396
- * Explicitly permit separately classified remote-backed creates while the
9397
- * region warms. The normal activated path remains local-only.
9398
- * @default false
9399
- */
9400
- allowRemoteFallback?: boolean;
9401
- /**
9402
- * Compare-and-swap precondition for this exact build activation.
9403
- * Use `0` to require a new activation, or the last observed version when
9404
- * changing one.
9405
- */
9406
- expectedVersion?: number;
9407
- };
9408
- type GetTemplateActivationOptions = ConnectionOpts & {
9409
- /**
9410
- * Region whose cell-local activation evidence should be returned.
9411
- * @default ENCLAVE_REGION, then yyz
9412
- */
9413
- region?: string;
9414
- /**
9415
- * Exact immutable build generation whose regional state should be returned.
9416
- * When omitted, Enclave resolves the tag in `templateId` (`default` when
9417
- * untagged) for compatibility with existing callers.
9418
- */
9419
- buildId?: string;
9420
- };
9421
- type DeactivateTemplateOptions = ConnectionOpts & {
9422
- /**
9423
- * Region in which the exact build generation should be deactivated.
9424
- * @default ENCLAVE_REGION, then yyz
9425
- */
9426
- region?: string;
9427
- /**
9428
- * Compare-and-swap precondition using the last observed activation version.
9429
- */
9430
- expectedVersion?: number;
9431
- };
9432
9250
  /**
9433
9251
  * Information about assigned template tags.
9434
9252
  */
@@ -9441,6 +9259,11 @@ type TemplateTagInfo = {
9441
9259
  * Assigned tags of the template.
9442
9260
  */
9443
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;
9444
9267
  };
9445
9268
  /**
9446
9269
  * Detailed information about a single template tag.
@@ -9458,34 +9281,36 @@ type TemplateTag = {
9458
9281
  * When this tag was assigned.
9459
9282
  */
9460
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;
9461
9290
  };
9462
9291
  /**
9463
9292
  * Authoritative traffic-selection token for one template tag.
9464
9293
  */
9465
- type TemplateTagHead = {
9466
- /**
9467
- * Name of the tag.
9468
- */
9469
- tag: string;
9470
- /**
9471
- * Exact build currently selected by the tag.
9472
- */
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 = {
9473
9300
  buildId: string;
9474
- /**
9475
- * Monotonic version used to fence concurrent promotion attempts.
9476
- */
9477
9301
  version: number;
9302
+ } | null;
9303
+ /**
9304
+ * Options for {@link Template.assignTags}.
9305
+ */
9306
+ type AssignTagsOptions = ConnectionOpts & {
9478
9307
  /**
9479
- * 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`.
9480
9311
  */
9481
- createdAt: Date;
9312
+ expect?: TemplateTagExpectation;
9482
9313
  };
9483
- /**
9484
- * The previously observed tag head required for a safe promotion.
9485
- *
9486
- * Pass `null` to require that the tag does not yet exist.
9487
- */
9488
- type TemplateTagHeadExpectation = Pick<TemplateTagHead, "buildId" | "version"> | null;
9489
9314
  /**
9490
9315
  * Configuration for a single file/directory copy operation.
9491
9316
  */
@@ -10107,23 +9932,6 @@ declare class TemplateBase implements TemplateFromImage, TemplateBuilder, Templa
10107
9932
  * ```
10108
9933
  */
10109
9934
  static getBuildStatus(data: Pick<BuildInfo, "templateId" | "buildId">, options?: GetBuildStatusOptions): Promise<TemplateBuildStatusResponse>;
10110
- /**
10111
- * Materialize one immutable template build in a region before create.
10112
- *
10113
- * The request is recorded on the global control plane; hydration then runs
10114
- * asynchronously inside the selected region. Poll {@link getActivation}
10115
- * until the returned status is `ready`.
10116
- */
10117
- static activate(data: Pick<BuildInfo, "templateId" | "buildId">, options?: TemplateActivationOptions): Promise<TemplateRegionActivation>;
10118
- /**
10119
- * Return desired state plus exact-generation evidence from the selected
10120
- * regional cell.
10121
- */
10122
- static getActivation(templateId: string, options?: GetTemplateActivationOptions): Promise<TemplateRegionActivation>;
10123
- /**
10124
- * Stop pinning and maintaining one exact build generation in a region.
10125
- */
10126
- static deactivate(data: Pick<BuildInfo, "templateId" | "buildId">, options?: DeactivateTemplateOptions): Promise<TemplateRegionActivation>;
10127
9935
  /**
10128
9936
  * Check if a template with the given name exists.
10129
9937
  *
@@ -10157,7 +9965,7 @@ declare class TemplateBase implements TemplateFromImage, TemplateBuilder, Templa
10157
9965
  * await Template.assignTags('my-template:v1.0', ['production', 'stable'])
10158
9966
  * ```
10159
9967
  */
10160
- 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>;
10161
9969
  /**
10162
9970
  * Remove tag(s) from a template.
10163
9971
  *
@@ -10191,23 +9999,6 @@ declare class TemplateBase implements TemplateFromImage, TemplateBuilder, Templa
10191
9999
  * ```
10192
10000
  */
10193
10001
  static getTags(templateId: string, options?: ConnectionOpts): Promise<TemplateTag[]>;
10194
- /**
10195
- * Get the authoritative traffic-selection token for one template tag.
10196
- *
10197
- * Pass the returned head directly to {@link promoteTag}; its monotonic
10198
- * version prevents concurrent releasers from silently overwriting each
10199
- * other.
10200
- */
10201
- static getTagHead(templateId: string, tag: string, options?: ConnectionOpts): Promise<TemplateTagHead>;
10202
- /**
10203
- * Atomically move one template tag to an exact ready, durable build.
10204
- *
10205
- * Use a head returned by {@link getTagHead} as `expected`. Pass `null` only
10206
- * when creating a tag that must not already exist. A concurrent change throws
10207
- * `TemplateTagConflictError`; fetch the head again before deciding whether to
10208
- * retry.
10209
- */
10210
- static promoteTag(candidate: Pick<BuildInfo, "templateId" | "buildId">, tag: string, expected: TemplateTagHeadExpectation, options?: ConnectionOpts): Promise<TemplateTagHead>;
10211
10002
  fromDebianImage(variant?: string): TemplateBuilder;
10212
10003
  fromUbuntuImage(variant?: string): TemplateBuilder;
10213
10004
  fromPythonImage(version?: string): TemplateBuilder;
@@ -10378,17 +10169,12 @@ declare namespace Template {
10378
10169
  var build: typeof TemplateBase.build;
10379
10170
  var buildInBackground: typeof TemplateBase.buildInBackground;
10380
10171
  var getBuildStatus: typeof TemplateBase.getBuildStatus;
10381
- var activate: typeof TemplateBase.activate;
10382
- var getActivation: typeof TemplateBase.getActivation;
10383
- var deactivate: typeof TemplateBase.deactivate;
10384
10172
  var exists: typeof TemplateBase.exists;
10385
10173
  var assignTags: typeof TemplateBase.assignTags;
10386
10174
  var removeTags: typeof TemplateBase.removeTags;
10387
10175
  var getTags: typeof TemplateBase.getTags;
10388
- var getTagHead: typeof TemplateBase.getTagHead;
10389
- var promoteTag: typeof TemplateBase.promoteTag;
10390
10176
  var toJSON: typeof TemplateBase.toJSON;
10391
10177
  var toDockerfile: typeof TemplateBase.toDockerfile;
10392
10178
  }
10393
10179
 
10394
- 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, 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, 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 };