@enclave-run/sdk 0.1.0 → 0.3.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.ts 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;
@@ -2913,8 +2834,6 @@ interface components {
2913
2834
  network?: components["schemas"]["SandboxNetworkConfig"];
2914
2835
  /** @description Optional region code for sandbox placement. When omitted, Enclave automatically selects a placement region. */
2915
2836
  region?: string;
2916
- /** @description Secure all system communication with sandbox */
2917
- secure?: boolean;
2918
2837
  /** @description Identifier of the required template */
2919
2838
  templateID: string;
2920
2839
  /**
@@ -3669,65 +3588,6 @@ interface components {
3669
3588
  * @enum {string}
3670
3589
  */
3671
3590
  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
3591
  TemplateRequestResponseV3: {
3732
3592
  /** @description Identifier of the last successful build for given template */
3733
3593
  buildID: string;
@@ -3770,6 +3630,11 @@ interface components {
3770
3630
  createdAt: string;
3771
3631
  /** @description The tag name */
3772
3632
  tag: string;
3633
+ /**
3634
+ * Format: int64
3635
+ * @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.
3636
+ */
3637
+ version?: number;
3773
3638
  };
3774
3639
  TemplateTagHead: {
3775
3640
  /** Format: uuid */
@@ -4224,7 +4089,7 @@ type TemplateTagConflictReason = "tag_changed" | "concurrent_mutation";
4224
4089
  /**
4225
4090
  * A concurrent template tag mutation prevented an atomic promotion.
4226
4091
  *
4227
- * Fetch the current head with `Template.getTagHead`, decide whether the
4092
+ * Read the current head with `Template.getTags`, decide whether the
4228
4093
  * promotion is still appropriate, and retry with that newly observed token.
4229
4094
  */
4230
4095
  declare class TemplateTagConflictError extends TemplateError {
@@ -7416,12 +7281,6 @@ interface SandboxOpts extends ConnectionOpts {
7416
7281
  * @default 300_000 // 5 minutes
7417
7282
  */
7418
7283
  timeoutMs?: number;
7419
- /**
7420
- * Secure all traffic coming to the sandbox controller with auth token
7421
- *
7422
- * @default true
7423
- */
7424
- secure?: boolean;
7425
7284
  /**
7426
7285
  * Allow sandbox to access the internet. If set to `False`, it works the same as setting network `denyOut` to `[0.0.0.0/0]`.
7427
7286
  *
@@ -9380,55 +9239,6 @@ type TemplateBuildStatusResponse = {
9380
9239
  */
9381
9240
  reason?: BuildStatusReason;
9382
9241
  };
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
9242
  /**
9433
9243
  * Information about assigned template tags.
9434
9244
  */
@@ -9441,6 +9251,11 @@ type TemplateTagInfo = {
9441
9251
  * Assigned tags of the template.
9442
9252
  */
9443
9253
  tags: string[];
9254
+ /**
9255
+ * Compare-and-swap version of the moved tag. Set when the tag was assigned
9256
+ * with an `expect` precondition.
9257
+ */
9258
+ version?: number;
9444
9259
  };
9445
9260
  /**
9446
9261
  * Detailed information about a single template tag.
@@ -9458,34 +9273,36 @@ type TemplateTag = {
9458
9273
  * When this tag was assigned.
9459
9274
  */
9460
9275
  createdAt: Date;
9276
+ /**
9277
+ * Compare-and-swap version of this tag head. Pass it with `buildId` as the
9278
+ * `expect` precondition of {@link Template.assignTags}. Undefined when the
9279
+ * tag is not a current, promotable head.
9280
+ */
9281
+ version?: number;
9461
9282
  };
9462
9283
  /**
9463
9284
  * Authoritative traffic-selection token for one template tag.
9464
9285
  */
9465
- type TemplateTagHead = {
9466
- /**
9467
- * Name of the tag.
9468
- */
9469
- tag: string;
9470
- /**
9471
- * Exact build currently selected by the tag.
9472
- */
9286
+ /**
9287
+ * The head a tag must still point at for {@link Template.assignTags} to move
9288
+ * it, as read from {@link Template.getTags}. `null` requires the tag to not
9289
+ * exist yet.
9290
+ */
9291
+ type TemplateTagExpectation = {
9473
9292
  buildId: string;
9474
- /**
9475
- * Monotonic version used to fence concurrent promotion attempts.
9476
- */
9477
9293
  version: number;
9294
+ } | null;
9295
+ /**
9296
+ * Options for {@link Template.assignTags}.
9297
+ */
9298
+ type AssignTagsOptions = ConnectionOpts & {
9478
9299
  /**
9479
- * When this head was assigned.
9300
+ * Move the tag only if it still points at this head (compare-and-swap).
9301
+ * Requires an exact build target and exactly one tag. A mismatch throws
9302
+ * `TemplateTagConflictError`.
9480
9303
  */
9481
- createdAt: Date;
9304
+ expect?: TemplateTagExpectation;
9482
9305
  };
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
9306
  /**
9490
9307
  * Configuration for a single file/directory copy operation.
9491
9308
  */
@@ -10107,23 +9924,6 @@ declare class TemplateBase implements TemplateFromImage, TemplateBuilder, Templa
10107
9924
  * ```
10108
9925
  */
10109
9926
  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
9927
  /**
10128
9928
  * Check if a template with the given name exists.
10129
9929
  *
@@ -10157,7 +9957,7 @@ declare class TemplateBase implements TemplateFromImage, TemplateBuilder, Templa
10157
9957
  * await Template.assignTags('my-template:v1.0', ['production', 'stable'])
10158
9958
  * ```
10159
9959
  */
10160
- static assignTags(targetName: string, tags: string | string[], options?: ConnectionOpts): Promise<TemplateTagInfo>;
9960
+ static assignTags(target: string | Pick<BuildInfo, "templateId" | "buildId">, tags: string | string[], options?: AssignTagsOptions): Promise<TemplateTagInfo>;
10161
9961
  /**
10162
9962
  * Remove tag(s) from a template.
10163
9963
  *
@@ -10191,23 +9991,6 @@ declare class TemplateBase implements TemplateFromImage, TemplateBuilder, Templa
10191
9991
  * ```
10192
9992
  */
10193
9993
  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
9994
  fromDebianImage(variant?: string): TemplateBuilder;
10212
9995
  fromUbuntuImage(variant?: string): TemplateBuilder;
10213
9996
  fromPythonImage(version?: string): TemplateBuilder;
@@ -10378,17 +10161,12 @@ declare namespace Template {
10378
10161
  var build: typeof TemplateBase.build;
10379
10162
  var buildInBackground: typeof TemplateBase.buildInBackground;
10380
10163
  var getBuildStatus: typeof TemplateBase.getBuildStatus;
10381
- var activate: typeof TemplateBase.activate;
10382
- var getActivation: typeof TemplateBase.getActivation;
10383
- var deactivate: typeof TemplateBase.deactivate;
10384
10164
  var exists: typeof TemplateBase.exists;
10385
10165
  var assignTags: typeof TemplateBase.assignTags;
10386
10166
  var removeTags: typeof TemplateBase.removeTags;
10387
10167
  var getTags: typeof TemplateBase.getTags;
10388
- var getTagHead: typeof TemplateBase.getTagHead;
10389
- var promoteTag: typeof TemplateBase.promoteTag;
10390
10168
  var toJSON: typeof TemplateBase.toJSON;
10391
10169
  var toDockerfile: typeof TemplateBase.toDockerfile;
10392
10170
  }
10393
10171
 
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 };
10172
+ 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 };