@enclave-run/sdk 0.0.0 → 0.1.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
@@ -4130,6 +4130,14 @@ declare class OutcomeUnknownError extends SandboxError {
4130
4130
  readonly cause?: unknown;
4131
4131
  constructor(message: string, recovery: SandboxCreateRecovery, cause?: unknown);
4132
4132
  }
4133
+ /**
4134
+ * The durable create operation reached an authoritative failed state after
4135
+ * admission. The recovery identity remains available for audit and support.
4136
+ */
4137
+ declare class SandboxCreateFailedError extends SandboxError {
4138
+ readonly recovery: SandboxCreateRecovery;
4139
+ constructor(message: string, recovery: SandboxCreateRecovery);
4140
+ }
4133
4141
  /**
4134
4142
  * The selected region explicitly rejected the request before admission.
4135
4143
  */
@@ -10383,4 +10391,4 @@ declare namespace Template {
10383
10391
  var toDockerfile: typeof TemplateBase.toDockerfile;
10384
10392
  }
10385
10393
 
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 };
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 };
package/dist/index.d.ts CHANGED
@@ -4130,6 +4130,14 @@ declare class OutcomeUnknownError extends SandboxError {
4130
4130
  readonly cause?: unknown;
4131
4131
  constructor(message: string, recovery: SandboxCreateRecovery, cause?: unknown);
4132
4132
  }
4133
+ /**
4134
+ * The durable create operation reached an authoritative failed state after
4135
+ * admission. The recovery identity remains available for audit and support.
4136
+ */
4137
+ declare class SandboxCreateFailedError extends SandboxError {
4138
+ readonly recovery: SandboxCreateRecovery;
4139
+ constructor(message: string, recovery: SandboxCreateRecovery);
4140
+ }
4133
4141
  /**
4134
4142
  * The selected region explicitly rejected the request before admission.
4135
4143
  */
@@ -10383,4 +10391,4 @@ declare namespace Template {
10383
10391
  var toDockerfile: typeof TemplateBase.toDockerfile;
10384
10392
  }
10385
10393
 
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 };
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 };
package/dist/index.js CHANGED
@@ -101,6 +101,7 @@ __export(src_exports, {
101
101
  ReadyCmd: () => ReadyCmd,
102
102
  RegionCapacityError: () => RegionCapacityError,
103
103
  Sandbox: () => Sandbox,
104
+ SandboxCreateFailedError: () => SandboxCreateFailedError,
104
105
  SandboxCreateRejectedError: () => SandboxCreateRejectedError,
105
106
  SandboxError: () => SandboxError,
106
107
  SandboxRegionScope: () => SandboxRegionScope,
@@ -127,7 +128,7 @@ var import_openapi_fetch = __toESM(require("openapi-fetch"));
127
128
  var import_platform2 = __toESM(require("platform"));
128
129
 
129
130
  // package.json
130
- var version = "0.0.0";
131
+ var version = "0.1.0";
131
132
 
132
133
  // src/utils.ts
133
134
  var import_platform = __toESM(require("platform"));
@@ -169,12 +170,6 @@ async function sha256(data) {
169
170
  function timeoutToSeconds(timeout) {
170
171
  return Math.ceil(timeout / 1e3);
171
172
  }
172
- async function dynamicImport(module2) {
173
- if (runtime === "browser") {
174
- throw new Error("Browser runtime is not supported for dynamic import");
175
- }
176
- return await import(module2);
177
- }
178
173
  function ansiRegex({ onlyFirst = false } = {}) {
179
174
  const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
180
175
  const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
@@ -239,6 +234,13 @@ var OutcomeUnknownError = class extends SandboxError {
239
234
  this.cause = cause;
240
235
  }
241
236
  };
237
+ var SandboxCreateFailedError = class extends SandboxError {
238
+ constructor(message, recovery) {
239
+ super(message);
240
+ this.name = "SandboxCreateFailedError";
241
+ this.recovery = recovery;
242
+ }
243
+ };
242
244
  var SandboxCreateRejectedError = class extends SandboxError {
243
245
  constructor(message, recovery, reason, spilloverAllowed = false, capacityTier = "shared") {
244
246
  super(message);
@@ -3584,8 +3586,9 @@ var SandboxApi = class {
3584
3586
  return operation.sandbox;
3585
3587
  }
3586
3588
  if (operation.state === "failed") {
3587
- throw new SandboxError(
3588
- (_b = (_a3 = operation.error) == null ? void 0 : _a3.message) != null ? _b : "Sandbox create failed after admission"
3589
+ throw new SandboxCreateFailedError(
3590
+ (_b = (_a3 = operation.error) == null ? void 0 : _a3.message) != null ? _b : "Sandbox create failed after admission",
3591
+ recovery
3589
3592
  );
3590
3593
  }
3591
3594
  await new Promise((resolve) => setTimeout(resolve, 25));
@@ -4616,6 +4619,18 @@ var STACK_TRACE_DEPTH = 3;
4616
4619
  var RESOLVE_SYMLINKS = false;
4617
4620
 
4618
4621
  // src/template/utils.ts
4622
+ async function loadGlob() {
4623
+ if (runtime === "browser") {
4624
+ throw new Error("Browser runtime is not supported for local file copies");
4625
+ }
4626
+ return await import("glob");
4627
+ }
4628
+ async function loadTar() {
4629
+ if (runtime === "browser") {
4630
+ throw new Error("Browser runtime is not supported for local file copies");
4631
+ }
4632
+ return await import("tar");
4633
+ }
4619
4634
  function validateRelativePath(src, stackTrace) {
4620
4635
  if (import_node_path.default.isAbsolute(src)) {
4621
4636
  const error = new TemplateError(
@@ -4646,7 +4661,7 @@ function normalizePath(path2) {
4646
4661
  return path2.replace(/\\/g, "/");
4647
4662
  }
4648
4663
  async function getAllFilesInPath(src, contextPath, ignorePatterns, includeDirectories = true) {
4649
- const { glob } = await dynamicImport("glob");
4664
+ const { glob } = await loadGlob();
4650
4665
  const files = /* @__PURE__ */ new Map();
4651
4666
  const globFiles = await glob(src, {
4652
4667
  ignore: ignorePatterns,
@@ -4763,7 +4778,7 @@ function padOctal(mode) {
4763
4778
  return mode.toString(8).padStart(4, "0");
4764
4779
  }
4765
4780
  async function getTarArchiveInputs(fileName, fileContextPath, ignorePatterns) {
4766
- const { create } = await dynamicImport("tar");
4781
+ const { create } = await loadTar();
4767
4782
  const allFiles = await getAllFilesInPath(
4768
4783
  fileName,
4769
4784
  fileContextPath,
@@ -6498,6 +6513,7 @@ var src_default = Sandbox;
6498
6513
  ReadyCmd,
6499
6514
  RegionCapacityError,
6500
6515
  Sandbox,
6516
+ SandboxCreateFailedError,
6501
6517
  SandboxCreateRejectedError,
6502
6518
  SandboxError,
6503
6519
  SandboxRegionScope,