niceeval 0.14.2 → 0.14.3-canary.53
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/INDEX.md +13 -6
- package/dist/agents/sdk-streams.cjs +6 -1
- package/dist/agents/sdk-streams.cjs.map +1 -1
- package/dist/agents/sdk-streams.d.cts +3 -2
- package/dist/agents/sdk-streams.d.mts +3 -2
- package/dist/agents/sdk-streams.d.ts +3 -2
- package/dist/agents/ui-message-stream.cjs +3 -1
- package/dist/agents/ui-message-stream.cjs.map +1 -1
- package/dist/experiment/host/cli/debug-protocol.cjs +257 -0
- package/dist/experiment/host/cli/debug-protocol.cjs.map +1 -0
- package/dist/experiment/host/cli/debug-protocol.d.cts +13 -0
- package/dist/experiment/host/cli/debug-protocol.d.mts +13 -0
- package/dist/experiment/host/cli/debug-protocol.d.ts +13 -0
- package/dist/experiment/host/cli/debug-protocol.js +8 -0
- package/dist/experiment/host/cli/debug-protocol.js.map +1 -0
- package/dist/experiment/host/cli/session-protocol.cjs +78 -0
- package/dist/experiment/host/cli/session-protocol.cjs.map +1 -0
- package/dist/experiment/host/cli/session-protocol.d.cts +10 -0
- package/dist/experiment/host/cli/session-protocol.d.mts +10 -0
- package/dist/experiment/host/cli/session-protocol.d.ts +10 -0
- package/dist/experiment/host/cli/session-protocol.js +12 -0
- package/dist/experiment/host/cli/session-protocol.js.map +1 -0
- package/dist/experiment/host/index.cjs +9 -1
- package/dist/experiment/host/index.cjs.map +1 -1
- package/dist/experiment/host/index.d.cts +2 -0
- package/dist/experiment/host/index.d.mts +2 -0
- package/dist/experiment/host/index.d.ts +2 -0
- package/dist/experiment/host/index.js +28 -16
- package/dist/experiment/host/index.mjs +28 -16
- package/dist/run/cli/contribution.cjs +5 -5
- package/dist/run/cli/contribution.cjs.map +1 -1
- package/dist/run/host/index.cjs +14 -3
- package/dist/run/host/index.cjs.map +1 -1
- package/dist/run/host/index.d.cts +2 -2
- package/dist/run/host/index.d.mts +2 -2
- package/dist/run/host/index.d.ts +2 -2
- package/dist/run/host/lifecycle-adapter.cjs +12 -12
- package/dist/run/host/lifecycle-adapter.cjs.map +1 -1
- package/dist/run/host/runtime.cjs +22 -22
- package/dist/run/host/runtime.cjs.map +1 -1
- package/dist/run/host/runtime.d.cts +11 -2
- package/dist/run/host/runtime.d.mts +11 -2
- package/dist/run/host/runtime.d.ts +11 -2
- package/dist/run/host/runtime.js +2 -2
- package/dist/run/host/types.cjs.map +1 -1
- package/dist/run/host/types.d.cts +4 -5
- package/dist/run/host/types.d.mts +4 -5
- package/dist/run/host/types.d.ts +4 -5
- package/dist/runner/assert-first-bridge.cjs +78 -3
- package/dist/runner/assert-first-bridge.cjs.map +1 -1
- package/dist/runner/assert-first-bridge.d.cts +11 -1
- package/dist/runner/assert-first-bridge.d.mts +11 -1
- package/dist/runner/assert-first-bridge.d.ts +11 -1
- package/dist/runner/attempt.cjs +77 -67
- package/dist/runner/attempt.cjs.map +1 -1
- package/dist/sandbox/backend.cjs.map +1 -1
- package/dist/sandbox/backend.d.cts +2 -2
- package/dist/sandbox/backend.d.mts +2 -2
- package/dist/sandbox/backend.d.ts +2 -2
- package/dist/sandbox/index.cjs.map +1 -1
- package/dist/sandbox/index.d.cts +1 -0
- package/dist/sandbox/index.d.mts +1 -0
- package/dist/sandbox/index.d.ts +1 -0
- package/dist/sandbox/layer.cjs.map +1 -1
- package/dist/sandbox/layer.d.cts +3 -3
- package/dist/sandbox/layer.d.mts +3 -3
- package/dist/sandbox/layer.d.ts +3 -3
- package/dist/sandbox/runtime.cjs.map +1 -1
- package/dist/sandbox/types.cjs.map +1 -1
- package/dist/sandbox/types.d.cts +2 -0
- package/dist/sandbox/types.d.mts +2 -0
- package/dist/sandbox/types.d.ts +2 -0
- package/dist/show/render.cjs +1 -0
- package/dist/show/render.cjs.map +1 -1
- package/dist/terminal/blocks.cjs +3 -5
- package/dist/terminal/blocks.cjs.map +1 -1
- package/dist/view/app-dist/.vite/manifest.json +3 -76
- package/dist/view/app-dist/assets/index-C6GQwHEF.js +63 -0
- package/dist/view/app-dist/assets/{quality-cost-scatter-B5wDa_F1.js → quality-cost-scatter-CSiMLelf.js} +5 -5
- package/dist/view/app-dist/index.html +1 -2
- package/dist/view/server.cjs +4 -3
- package/dist/view/server.cjs.map +1 -1
- package/docs-site/zh/README.md +2 -2
- package/docs-site/zh/tutorials/agent-feedback-loop.mdx +8 -5
- package/docs-site/zh/tutorials/agent-onboarding.mdx +5 -3
- package/package.json +1 -1
- package/dist/view/app-dist/assets/AttemptDialog-76dX1VQq.js +0 -41
- package/dist/view/app-dist/assets/AttemptRoute-DRHVh2JA.js +0 -4
- package/dist/view/app-dist/assets/ResultsPage-9CSI8dvZ.js +0 -2
- package/dist/view/app-dist/assets/RunPage-BUF0REv7.js +0 -1
- package/dist/view/app-dist/assets/TableContentView-_Sbg5wDr.js +0 -3
- package/dist/view/app-dist/assets/index-BGr_6pGY.js +0 -19
- package/dist/view/app-dist/assets/jsx-runtime-BnHLaUks.js +0 -1
- package/dist/view/app-dist/assets/useSuspenseQuery-D3W8Uy33.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend.js","sourceRoot":"","sources":["backend.ts"],"names":[],"mappings":";;;AAuLA,kFAEC;AASD,gEAEC;AAED,gEAEC;AAKD,wDAOC;AAOD,oEAOC;AAED,oDAqCC;AAED,kEAEC;AAED,gEAIC;AACD,kDAMC;AAED,kEAEC;AAOD,0EAMC;AAED,wDAGC;AAhTD,mDAAmD;AACnD,mCAAsC;AA0DtC,MAAa,oCAAqC,SAAQ,aAAI,CAAC,WAAW,CAAC,sCAAsC,CAAqC;CACrJ;AADD,oFACC;AACD,MAAa,kCAAmC,SAAQ,aAAI,CAAC,WAAW,CAAC,oCAAoC,CAAqC;CACjJ;AADD,gFACC;AACD,MAAa,mCAAoC,SAAQ,aAAI,CAAC,WAAW,CAAC,qCAAqC,CAAqC;CACnJ;AADD,kFACC;AACD,MAAa,mCAAoC,SA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;IAEvF,CAAC;CACJ;AALD,oFAKC;AACD,SAAgB,+BAA+B,CAAC,OAAgB,EAAE,KAAa;IAC3E,MAAM,UAAU,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC;IAC/D,IAAI,UAAU,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;QACpC,MAAM,IAAI,oCAAoC,CAAC,KAAK,EAAE,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IAChG,CAAC;IACD,OAAO,UAAU,CAAC,KAAK,CAAC;AAC5B,CAAC;AACD,+DAA+D;AAC/D,SAAgB,sBAAsB,CAAC,OAAgB;IACnD,MAAM,UAAU,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC;IAC/D,OAAO,UAAU,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9F,CAAC","sourcesContent":["// Provider Promise SDK 与公共 Sandbox facade 之间的唯一边界。\nimport { Data, Effect } from \"effect\";\nimport type { SandboxActionState } from \"./action.ts\";\nimport type { CommandOptions, CommandResult, Sandbox, ManagedProcess, ManagedProcessStart, SandboxReuseCapability, SandboxTransferOperations, } from \"./types.ts\";\nexport type SandboxBackendSupport<T> = {\n readonly _tag: \"Supported\";\n readonly value: T;\n} | {\n readonly _tag: \"Unsupported\";\n readonly reason: string;\n};\nexport type SandboxSetupPrefixCacheUnsupportedCode = \"provider-unsupported\" | \"profile-managed\" | \"compose\" | \"host-socket\" | \"read-only-rootfs\" | \"base-image-unverified\" | \"dynamic-runner-tools\" | \"mounted-state\" | \"sensitive-state\" | \"profile-backed-dind\";\nexport type SandboxSetupPrefixCacheEligibility = {\n readonly _tag: \"Eligible\";\n readonly persistence: \"persistent\";\n readonly dependency: \"parent-backed\";\n /** Complete action-state surface this provider captures and restores. */\n readonly coverage: SandboxActionState;\n /** Exact immutable Base resolved and verified during provider initialization. */\n readonly baseImageId: string;\n /** Provider-owned key scope; omission preserves the ordinary Docker rootfs identity exactly. */\n readonly keyScope?: {\n readonly protocol: string;\n readonly storageSchemaRevision: string;\n readonly artifactFormatRevision: string;\n readonly semanticIdentity: import(\"../shared/types.ts\").JsonValue;\n };\n} | {\n readonly _tag: \"Unsupported\";\n readonly code: SandboxSetupPrefixCacheUnsupportedCode;\n readonly reason: string;\n};\nexport interface SandboxSetupPrefixCacheManifest {\n /** Exact immutable Base identity; floating source references never enter the durable root key alone. */\n readonly baseImageId: string;\n /** Content-addressed key planned by the provider-neutral runtime. */\n readonly setupPrefixKey: string;\n readonly setupManifestDigest: string;\n /** Cumulative state required by this exact logical prefix. */\n readonly requiredState: SandboxActionState;\n readonly storageSchemaRevision: string;\n readonly artifactFormatRevision: string;\n readonly changeFrequency: number;\n /** Frozen, non-sensitive declaration metadata used for bidirectional registry validation. */\n readonly declarationMetadata: unknown;\n}\nexport interface SandboxSetupPrefixCacheOperation {\n readonly operationId: string;\n readonly manifest: SandboxSetupPrefixCacheManifest;\n /** Defense-in-depth only; values are checked before an image is published and are never persisted. */\n readonly knownSensitiveValues?: readonly string[];\n}\ninterface SandboxSetupPrefixCacheErrorFields {\n readonly operation: string;\n readonly reason: string;\n readonly setupPrefixKey?: string;\n readonly domainId?: string;\n readonly cause?: unknown;\n}\nexport class SandboxSetupPrefixCacheRegistryError extends Data.TaggedError(\"SandboxSetupPrefixCacheRegistryError\")<SandboxSetupPrefixCacheErrorFields> {\n}\nexport class SandboxSetupPrefixCacheLookupError extends Data.TaggedError(\"SandboxSetupPrefixCacheLookupError\")<SandboxSetupPrefixCacheErrorFields> {\n}\nexport class SandboxSetupPrefixCacheCaptureError extends Data.TaggedError(\"SandboxSetupPrefixCacheCaptureError\")<SandboxSetupPrefixCacheErrorFields> {\n}\nexport class SandboxSetupPrefixCacheRestoreError extends Data.TaggedError(\"SandboxSetupPrefixCacheRestoreError\")<SandboxSetupPrefixCacheErrorFields> {\n}\nexport class SandboxSetupPrefixCacheValidationError extends Data.TaggedError(\"SandboxSetupPrefixCacheValidationError\")<SandboxSetupPrefixCacheErrorFields> {\n}\nexport class SandboxSetupPrefixCacheCleanupError extends Data.TaggedError(\"SandboxSetupPrefixCacheCleanupError\")<SandboxSetupPrefixCacheErrorFields> {\n}\nexport class SandboxSetupPrefixCacheAmbiguityError extends Data.TaggedError(\"SandboxSetupPrefixCacheAmbiguityError\")<SandboxSetupPrefixCacheErrorFields & {\n readonly operationId: string;\n readonly terminal: \"unresolved\";\n readonly diagnosticCommand: string;\n}> {\n}\nexport class SandboxSetupPrefixCacheCancellationError extends Data.TaggedError(\"SandboxSetupPrefixCacheCancellationError\")<SandboxSetupPrefixCacheErrorFields & {\n readonly operationId: string;\n readonly terminal: \"cancel-fenced\";\n}> {\n}\nexport type SandboxSetupPrefixCacheError = SandboxSetupPrefixCacheRegistryError | SandboxSetupPrefixCacheLookupError | SandboxSetupPrefixCacheCaptureError | SandboxSetupPrefixCacheRestoreError | SandboxSetupPrefixCacheValidationError | SandboxSetupPrefixCacheCleanupError | SandboxSetupPrefixCacheAmbiguityError | SandboxSetupPrefixCacheCancellationError;\nexport type SandboxSetupPrefixCacheLookupResult = Exclude<SandboxSetupPrefixCacheEligibility, {\n readonly _tag: \"Eligible\";\n}> | {\n readonly _tag: \"Miss\";\n readonly setupPrefixKey: string;\n /** A failed hit was scrubbed in the same private slot before this clean miss receipt. */\n readonly recovery?: \"restore-failed-replayed\";\n} | {\n readonly _tag: \"Restored\";\n readonly setupPrefixKey: string;\n readonly entryId: string;\n readonly generation: number;\n /** Provider-neutral immutable artifact identity. */\n readonly artifactId: string;\n /** Present only when the provider artifact is an exact Docker image. */\n readonly imageId?: string;\n readonly sandboxId: string;\n};\nexport type SandboxSetupPrefixCacheCaptureResult = Exclude<SandboxSetupPrefixCacheEligibility, {\n readonly _tag: \"Eligible\";\n}> | {\n readonly _tag: \"Contended\";\n readonly setupPrefixKey: string;\n readonly reason: \"active-writer\" | \"indexed-generation\";\n} | {\n /**\n * The action already succeeded and the same private sandbox is still a\n * verified active continuation. The Runner must never clean-base/replay\n * that action and must disable publication for the remainder of Attempt.\n */\n readonly _tag: \"ContinuedUncached\";\n readonly setupPrefixKey: string;\n readonly reason: \"capture-failed\" | \"publish-failed\";\n readonly sandboxId: string;\n} | {\n readonly _tag: \"Captured\";\n readonly setupPrefixKey: string;\n readonly entryId: string;\n readonly generation: number;\n /** Provider-neutral immutable artifact identity. */\n readonly artifactId: string;\n /** Present only when the provider artifact is an exact Docker image. */\n readonly imageId?: string;\n readonly sandboxId: string;\n};\nexport type SandboxSetupPrefixCacheRecoveryResult = Exclude<SandboxSetupPrefixCacheEligibility, {\n readonly _tag: \"Eligible\";\n}> | {\n readonly _tag: \"RecoveredCleanBase\";\n readonly baseImageId: string;\n readonly sandboxId: string;\n};\nexport interface SandboxSetupPrefixCacheCapability {\n eligibility(): SandboxSetupPrefixCacheEligibility;\n lookupAndRebase(input: SandboxSetupPrefixCacheOperation): Effect.Effect<SandboxSetupPrefixCacheLookupResult, SandboxSetupPrefixCacheError>;\n captureAndRebase(input: SandboxSetupPrefixCacheOperation): Effect.Effect<SandboxSetupPrefixCacheCaptureResult, SandboxSetupPrefixCacheError>;\n /**\n * One-shot degraded-path seam, only valid before any Action has succeeded in\n * the current Attempt. The provider DestroyOnly-retires a failed lookup\n * instance and rebases this stable backend onto the exact Base. Capture\n * failure paths must return ContinuedUncached or fail; they must never call\n * this seam and replay an already-successful Action.\n */\n recoverCleanBase(): Effect.Effect<SandboxSetupPrefixCacheRecoveryResult, SandboxSetupPrefixCacheError>;\n}\nexport interface SandboxBackendCapabilities {\n /** Provider 能否兑现 CommandOptions.user 的 root 覆盖;runner 私有基础设施按这项能力选择身份。 */\n readonly rootCommands: SandboxBackendSupport<true>;\n readonly appendLog: SandboxBackendSupport<(line: string) => Promise<void>>;\n readonly suspend: SandboxBackendSupport<() => Promise<void>>;\n readonly ensureLifetime: SandboxBackendSupport<(minRemainingMs: number) => Promise<{\n ready: true;\n expiresAt?: string;\n } | {\n ready: false;\n reason: string;\n }>>;\n readonly setCommandDeadline: SandboxBackendSupport<(deadlineAt?: number) => void>;\n readonly managedProcess: SandboxBackendSupport<(input: ManagedProcessStart) => Promise<ManagedProcess>>;\n /** Missing providers are normalized to an explicit Unsupported result by setupPrefixCacheCapability(). */\n readonly setupPrefixCache?: SandboxBackendSupport<SandboxSetupPrefixCacheCapability>;\n}\nexport interface SandboxProviderBackend extends Omit<SandboxTransferOperations, \"upload\"> {\n readonly workdir: string;\n readonly sandboxId: string;\n readonly otlpHost: string | null;\n readonly capabilities: SandboxBackendCapabilities;\n runCommand(command: string, args?: readonly string[], options?: CommandOptions): Promise<CommandResult>;\n runShell(script: string, options?: CommandOptions): Promise<CommandResult>;\n readText(path: string): Promise<string>;\n writeText(path: string, content: string): Promise<void>;\n readBytes(path: string): Promise<Uint8Array>;\n writeBytes(path: string, content: Uint8Array): Promise<void>;\n pathExists(path: string): Promise<boolean>;\n stop(): Promise<void>;\n}\nexport const unsupportedBackendCapability: SandboxBackendSupport<never> = Object.freeze({\n _tag: \"Unsupported\",\n reason: \"the provider does not implement this capability\",\n});\nexport function unsupportedBackendCapabilityBecause(reason: string): SandboxBackendSupport<never> {\n return Object.freeze({ _tag: \"Unsupported\", reason });\n}\nexport const noSandboxBackendCapabilities: SandboxBackendCapabilities = Object.freeze({\n rootCommands: unsupportedBackendCapability,\n appendLog: unsupportedBackendCapability,\n suspend: unsupportedBackendCapability,\n ensureLifetime: unsupportedBackendCapability,\n setCommandDeadline: unsupportedBackendCapability,\n managedProcess: unsupportedBackendCapability,\n});\nexport function supportedBackendCapability<T>(value: T): SandboxBackendSupport<T> {\n return Object.freeze({ _tag: \"Supported\", value });\n}\n/** Provider-neutral query seam; absence never masquerades as a cache miss. */\nexport function setupPrefixCacheCapability(capabilities: SandboxBackendCapabilities): SandboxBackendSupport<SandboxSetupPrefixCacheCapability> {\n return capabilities.setupPrefixCache ?? unsupportedBackendCapabilityBecause(\"the provider does not implement persistent sandbox setup-prefix caching\");\n}\nfunction providerBoundaryError(cause: unknown): Error {\n return cause instanceof Error ? cause : new Error(String(cause));\n}\n/** Promise provider SDK 在这一处 lift 成 typed-error Effect;Error 实例原样保留给现有归因逻辑。 */\nexport function providerBoundaryEffect<T>(operation: (signal: AbortSignal) => Promise<T>): Effect.Effect<T, Error> {\n return Effect.tryPromise({\n // 保留 Effect 运行时的取消信号,供真正支持 AbortSignal 的 SDK adapter 接入;不把中断\n // 编码成 Error,也不在这里启动嵌套 runtime。\n try: (signal) => operation(signal),\n catch: providerBoundaryError,\n });\n}\n/**\n * 公开 Sandbox Promise 接口唯一的兼容入口。\n *\n * 这不是内部 Effect runner:它只把 provider Promise 原样留在公开兼容面,并归一化非 Error\n * rejection。runtime / resource lifecycle 必须改用 providerBoundaryEffect() 组合 Effect。\n */\nexport async function providerCompatibilityPromise<T>(operation: () => Promise<T>): Promise<T> {\n try {\n return await operation();\n }\n catch (cause) {\n throw providerBoundaryError(cause);\n }\n}\n/** defineSandbox() 的公共新接口实现显式降成 provider backend;不探测任何旧方法。 */\nexport function customSandboxBackend(sandbox: Sandbox): SandboxProviderBackend {\n const appendLog = sandbox.appendLog;\n // Provider facade 产出的 Sandbox 再经 runtime 归一化时必须保留 provider-only capabilities;\n // 作者直接返回的普通 Sandbox 没有登记项,仍严格退回 Unsupported,不能靠鸭子类型猜能力。\n const registered = SANDBOX_CAPABILITIES.get(sandbox) ?? {\n ...noSandboxBackendCapabilities,\n managedProcess: unsupportedBackendCapabilityBecause(\"custom Sandbox facades do not declare the internal managed-process capability\"),\n };\n return {\n get workdir() {\n return sandbox.workdir;\n },\n get sandboxId() {\n return sandbox.sandboxId;\n },\n get otlpHost() {\n return sandbox.otlpHost;\n },\n capabilities: {\n ...registered,\n appendLog: appendLog === undefined\n ? unsupportedBackendCapability\n : supportedBackendCapability((line) => appendLog.call(sandbox, line)),\n },\n runCommand: (command, args, options) => sandbox.runCommand(command, args, options),\n runShell: (script, options) => sandbox.runShell(script, options),\n readText: (path) => sandbox.readText(path),\n writeText: (path, content) => sandbox.writeText(path, content),\n readBytes: (path) => sandbox.readBytes(path),\n writeBytes: (path, content) => sandbox.writeBytes(path, content),\n pathExists: (path) => sandbox.pathExists(path),\n uploadFile: (source, targetPath) => sandbox.uploadFile(source, targetPath),\n uploadDirectory: (sourceDir, targetDir, options) => sandbox.uploadDirectory(sourceDir, targetDir, options),\n downloadFile: (sourcePath, target) => sandbox.downloadFile(sourcePath, target),\n downloadDirectory: (sourceDir, targetDir, options) => sandbox.downloadDirectory(sourceDir, targetDir, options),\n stop: () => sandbox.stop(),\n };\n}\nconst SANDBOX_CAPABILITIES = new WeakMap<Sandbox, SandboxBackendCapabilities>();\nexport function registerSandboxCapabilities(sandbox: Sandbox, capabilities: SandboxBackendCapabilities): void {\n SANDBOX_CAPABILITIES.set(sandbox, capabilities);\n}\n/** 装饰器产生新 Sandbox 对象时显式继承同一份 provider-only 能力,不靠接口外成员探测。 */\nexport function inheritSandboxCapabilities(source: Sandbox, target: Sandbox): void {\n const capabilities = SANDBOX_CAPABILITIES.get(source);\n if (capabilities !== undefined)\n SANDBOX_CAPABILITIES.set(target, capabilities);\n}\nexport function sandboxCapabilities(sandbox: Sandbox): SandboxBackendCapabilities {\n const capabilities = SANDBOX_CAPABILITIES.get(sandbox);\n if (capabilities === undefined) {\n throw new Error(`sandbox ${sandbox.sandboxId} was not constructed by the provider facade`);\n }\n return capabilities;\n}\n/** 未经 provider facade 登记的普通自定义 Sandbox 保守视为不支持提权,不做鸭子类型猜测。 */\nexport function sandboxSupportsRootCommands(sandbox: Sandbox): boolean {\n return SANDBOX_CAPABILITIES.get(sandbox)?.rootCommands._tag === \"Supported\";\n}\nexport class SandboxManagedProcessCapabilityError extends Error {\n readonly name = \"SandboxManagedProcessCapabilityError\";\n constructor(readonly agent: string, readonly sandboxId: string, readonly reason: string) {\n super(`Agent ${agent} requires the sandbox managed-process capability, but sandbox ${sandboxId} does not support it: ${reason}`);\n }\n}\nexport function requireManagedProcessCapability(sandbox: Sandbox, agent: string): (input: ManagedProcessStart) => Promise<ManagedProcess> {\n const capability = sandboxCapabilities(sandbox).managedProcess;\n if (capability._tag === \"Unsupported\") {\n throw new SandboxManagedProcessCapabilityError(agent, sandbox.sandboxId, capability.reason);\n }\n return capability.value;\n}\n/** Provider facade 登记的复用寿命能力;不存在时保持显式 Unsupported,不做鸭子类型探测。 */\nexport function sandboxReuseCapability(sandbox: Sandbox): SandboxReuseCapability | undefined {\n const capability = sandboxCapabilities(sandbox).ensureLifetime;\n return capability._tag === \"Supported\" ? { ensureLifetime: capability.value } : undefined;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"backend.js","sourceRoot":"","sources":["backend.ts"],"names":[],"mappings":";;;AAuLA,kFAEC;AASD,gEAEC;AAED,gEAEC;AAKD,wDAOC;AAOD,oEAOC;AAED,oDAqCC;AAED,kEAEC;AAED,gEAIC;AACD,kDAMC;AAED,kEAEC;AAOD,0EAMC;AAED,wDAGC;AAhTD,mDAAmD;AACnD,mCAAsC;AA0DtC,MAAa,oCAAqC,SAAQ,aAAI,CAAC,WAAW,CAAC,sCAAsC,CAAqC;CACrJ;AADD,oFACC;AACD,MAAa,kCAAmC,SAAQ,aAAI,CAAC,WAAW,CAAC,oCAAoC,CAAqC;CACjJ;AADD,gFACC;AACD,MAAa,mCAAoC,SAAQ,aAAI,CAAC,WAAW,CAAC,qCAAqC,CAAqC;CACnJ;AADD,kFACC;AACD,MAAa,mCAAoC,SAAQ,aAAI,CAAC,WAAW,CAAC,qCAAqC,CAAqC;CACnJ;AADD,kFACC;AACD,MAAa,sCAAuC,SAAQ,aAAI,CAAC,WAAW,CAAC,wCAAwC,CAAqC;CACzJ;AADD,wFACC;AACD,MAAa,mCAAoC,SAAQ,aAAI,CAAC,WAAW,CAAC,qCAAqC,CAAqC;CACnJ;AADD,kFACC;AACD,MAAa,qCAAsC,SAAQ,aAAI,CAAC,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EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IAChG,CAAC;IACD,OAAO,UAAU,CAAC,KAAK,CAAC;AAC5B,CAAC;AACD,+DAA+D;AAC/D,SAAgB,sBAAsB,CAAC,OAAgB;IACnD,MAAM,UAAU,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC;IAC/D,OAAO,UAAU,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9F,CAAC","sourcesContent":["// Provider Promise SDK 与公共 Sandbox facade 之间的唯一边界。\nimport { Data, Effect } from \"effect\";\nimport type { SandboxActionState } from \"./action.ts\";\nimport type { CommandOptions, CommandResult, CustomProviderSandbox, Sandbox, ManagedProcess, ManagedProcessStart, SandboxReuseCapability, SandboxTransferOperations, } from \"./types.ts\";\nexport type SandboxBackendSupport<T> = {\n readonly _tag: \"Supported\";\n readonly value: T;\n} | {\n readonly _tag: \"Unsupported\";\n readonly reason: string;\n};\nexport type SandboxSetupPrefixCacheUnsupportedCode = \"provider-unsupported\" | \"profile-managed\" | \"compose\" | \"host-socket\" | \"read-only-rootfs\" | \"base-image-unverified\" | \"dynamic-runner-tools\" | \"mounted-state\" | \"sensitive-state\" | \"profile-backed-dind\";\nexport type SandboxSetupPrefixCacheEligibility = {\n readonly _tag: \"Eligible\";\n readonly persistence: \"persistent\";\n readonly dependency: \"parent-backed\";\n /** Complete action-state surface this provider captures and restores. */\n readonly coverage: SandboxActionState;\n /** Exact immutable Base resolved and verified during provider initialization. */\n readonly baseImageId: string;\n /** Provider-owned key scope; omission preserves the ordinary Docker rootfs identity exactly. */\n readonly keyScope?: {\n readonly protocol: string;\n readonly storageSchemaRevision: string;\n readonly artifactFormatRevision: string;\n readonly semanticIdentity: import(\"../shared/types.ts\").JsonValue;\n };\n} | {\n readonly _tag: \"Unsupported\";\n readonly code: SandboxSetupPrefixCacheUnsupportedCode;\n readonly reason: string;\n};\nexport interface SandboxSetupPrefixCacheManifest {\n /** Exact immutable Base identity; floating source references never enter the durable root key alone. */\n readonly baseImageId: string;\n /** Content-addressed key planned by the provider-neutral runtime. */\n readonly setupPrefixKey: string;\n readonly setupManifestDigest: string;\n /** Cumulative state required by this exact logical prefix. */\n readonly requiredState: SandboxActionState;\n readonly storageSchemaRevision: string;\n readonly artifactFormatRevision: string;\n readonly changeFrequency: number;\n /** Frozen, non-sensitive declaration metadata used for bidirectional registry validation. */\n readonly declarationMetadata: unknown;\n}\nexport interface SandboxSetupPrefixCacheOperation {\n readonly operationId: string;\n readonly manifest: SandboxSetupPrefixCacheManifest;\n /** Defense-in-depth only; values are checked before an image is published and are never persisted. */\n readonly knownSensitiveValues?: readonly string[];\n}\ninterface SandboxSetupPrefixCacheErrorFields {\n readonly operation: string;\n readonly reason: string;\n readonly setupPrefixKey?: string;\n readonly domainId?: string;\n readonly cause?: unknown;\n}\nexport class SandboxSetupPrefixCacheRegistryError extends Data.TaggedError(\"SandboxSetupPrefixCacheRegistryError\")<SandboxSetupPrefixCacheErrorFields> {\n}\nexport class SandboxSetupPrefixCacheLookupError extends Data.TaggedError(\"SandboxSetupPrefixCacheLookupError\")<SandboxSetupPrefixCacheErrorFields> {\n}\nexport class SandboxSetupPrefixCacheCaptureError extends Data.TaggedError(\"SandboxSetupPrefixCacheCaptureError\")<SandboxSetupPrefixCacheErrorFields> {\n}\nexport class SandboxSetupPrefixCacheRestoreError extends Data.TaggedError(\"SandboxSetupPrefixCacheRestoreError\")<SandboxSetupPrefixCacheErrorFields> {\n}\nexport class SandboxSetupPrefixCacheValidationError extends Data.TaggedError(\"SandboxSetupPrefixCacheValidationError\")<SandboxSetupPrefixCacheErrorFields> {\n}\nexport class SandboxSetupPrefixCacheCleanupError extends Data.TaggedError(\"SandboxSetupPrefixCacheCleanupError\")<SandboxSetupPrefixCacheErrorFields> {\n}\nexport class SandboxSetupPrefixCacheAmbiguityError extends Data.TaggedError(\"SandboxSetupPrefixCacheAmbiguityError\")<SandboxSetupPrefixCacheErrorFields & {\n readonly operationId: string;\n readonly terminal: \"unresolved\";\n readonly diagnosticCommand: string;\n}> {\n}\nexport class SandboxSetupPrefixCacheCancellationError extends Data.TaggedError(\"SandboxSetupPrefixCacheCancellationError\")<SandboxSetupPrefixCacheErrorFields & {\n readonly operationId: string;\n readonly terminal: \"cancel-fenced\";\n}> {\n}\nexport type SandboxSetupPrefixCacheError = SandboxSetupPrefixCacheRegistryError | SandboxSetupPrefixCacheLookupError | SandboxSetupPrefixCacheCaptureError | SandboxSetupPrefixCacheRestoreError | SandboxSetupPrefixCacheValidationError | SandboxSetupPrefixCacheCleanupError | SandboxSetupPrefixCacheAmbiguityError | SandboxSetupPrefixCacheCancellationError;\nexport type SandboxSetupPrefixCacheLookupResult = Exclude<SandboxSetupPrefixCacheEligibility, {\n readonly _tag: \"Eligible\";\n}> | {\n readonly _tag: \"Miss\";\n readonly setupPrefixKey: string;\n /** A failed hit was scrubbed in the same private slot before this clean miss receipt. */\n readonly recovery?: \"restore-failed-replayed\";\n} | {\n readonly _tag: \"Restored\";\n readonly setupPrefixKey: string;\n readonly entryId: string;\n readonly generation: number;\n /** Provider-neutral immutable artifact identity. */\n readonly artifactId: string;\n /** Present only when the provider artifact is an exact Docker image. */\n readonly imageId?: string;\n readonly sandboxId: string;\n};\nexport type SandboxSetupPrefixCacheCaptureResult = Exclude<SandboxSetupPrefixCacheEligibility, {\n readonly _tag: \"Eligible\";\n}> | {\n readonly _tag: \"Contended\";\n readonly setupPrefixKey: string;\n readonly reason: \"active-writer\" | \"indexed-generation\";\n} | {\n /**\n * The action already succeeded and the same private sandbox is still a\n * verified active continuation. The Runner must never clean-base/replay\n * that action and must disable publication for the remainder of Attempt.\n */\n readonly _tag: \"ContinuedUncached\";\n readonly setupPrefixKey: string;\n readonly reason: \"capture-failed\" | \"publish-failed\";\n readonly sandboxId: string;\n} | {\n readonly _tag: \"Captured\";\n readonly setupPrefixKey: string;\n readonly entryId: string;\n readonly generation: number;\n /** Provider-neutral immutable artifact identity. */\n readonly artifactId: string;\n /** Present only when the provider artifact is an exact Docker image. */\n readonly imageId?: string;\n readonly sandboxId: string;\n};\nexport type SandboxSetupPrefixCacheRecoveryResult = Exclude<SandboxSetupPrefixCacheEligibility, {\n readonly _tag: \"Eligible\";\n}> | {\n readonly _tag: \"RecoveredCleanBase\";\n readonly baseImageId: string;\n readonly sandboxId: string;\n};\nexport interface SandboxSetupPrefixCacheCapability {\n eligibility(): SandboxSetupPrefixCacheEligibility;\n lookupAndRebase(input: SandboxSetupPrefixCacheOperation): Effect.Effect<SandboxSetupPrefixCacheLookupResult, SandboxSetupPrefixCacheError>;\n captureAndRebase(input: SandboxSetupPrefixCacheOperation): Effect.Effect<SandboxSetupPrefixCacheCaptureResult, SandboxSetupPrefixCacheError>;\n /**\n * One-shot degraded-path seam, only valid before any Action has succeeded in\n * the current Attempt. The provider DestroyOnly-retires a failed lookup\n * instance and rebases this stable backend onto the exact Base. Capture\n * failure paths must return ContinuedUncached or fail; they must never call\n * this seam and replay an already-successful Action.\n */\n recoverCleanBase(): Effect.Effect<SandboxSetupPrefixCacheRecoveryResult, SandboxSetupPrefixCacheError>;\n}\nexport interface SandboxBackendCapabilities {\n /** Provider 能否兑现 CommandOptions.user 的 root 覆盖;runner 私有基础设施按这项能力选择身份。 */\n readonly rootCommands: SandboxBackendSupport<true>;\n readonly appendLog: SandboxBackendSupport<(line: string) => Promise<void>>;\n readonly suspend: SandboxBackendSupport<() => Promise<void>>;\n readonly ensureLifetime: SandboxBackendSupport<(minRemainingMs: number) => Promise<{\n ready: true;\n expiresAt?: string;\n } | {\n ready: false;\n reason: string;\n }>>;\n readonly setCommandDeadline: SandboxBackendSupport<(deadlineAt?: number) => void>;\n readonly managedProcess: SandboxBackendSupport<(input: ManagedProcessStart) => Promise<ManagedProcess>>;\n /** Missing providers are normalized to an explicit Unsupported result by setupPrefixCacheCapability(). */\n readonly setupPrefixCache?: SandboxBackendSupport<SandboxSetupPrefixCacheCapability>;\n}\nexport interface SandboxProviderBackend extends Omit<SandboxTransferOperations, \"upload\"> {\n readonly workdir: string;\n readonly sandboxId: string;\n readonly otlpHost: string | null;\n readonly capabilities: SandboxBackendCapabilities;\n runCommand(command: string, args?: readonly string[], options?: CommandOptions): Promise<CommandResult>;\n runShell(script: string, options?: CommandOptions): Promise<CommandResult>;\n readText(path: string): Promise<string>;\n writeText(path: string, content: string): Promise<void>;\n readBytes(path: string): Promise<Uint8Array>;\n writeBytes(path: string, content: Uint8Array): Promise<void>;\n pathExists(path: string): Promise<boolean>;\n stop(): Promise<void>;\n}\nexport const unsupportedBackendCapability: SandboxBackendSupport<never> = Object.freeze({\n _tag: \"Unsupported\",\n reason: \"the provider does not implement this capability\",\n});\nexport function unsupportedBackendCapabilityBecause(reason: string): SandboxBackendSupport<never> {\n return Object.freeze({ _tag: \"Unsupported\", reason });\n}\nexport const noSandboxBackendCapabilities: SandboxBackendCapabilities = Object.freeze({\n rootCommands: unsupportedBackendCapability,\n appendLog: unsupportedBackendCapability,\n suspend: unsupportedBackendCapability,\n ensureLifetime: unsupportedBackendCapability,\n setCommandDeadline: unsupportedBackendCapability,\n managedProcess: unsupportedBackendCapability,\n});\nexport function supportedBackendCapability<T>(value: T): SandboxBackendSupport<T> {\n return Object.freeze({ _tag: \"Supported\", value });\n}\n/** Provider-neutral query seam; absence never masquerades as a cache miss. */\nexport function setupPrefixCacheCapability(capabilities: SandboxBackendCapabilities): SandboxBackendSupport<SandboxSetupPrefixCacheCapability> {\n return capabilities.setupPrefixCache ?? unsupportedBackendCapabilityBecause(\"the provider does not implement persistent sandbox setup-prefix caching\");\n}\nfunction providerBoundaryError(cause: unknown): Error {\n return cause instanceof Error ? cause : new Error(String(cause));\n}\n/** Promise provider SDK 在这一处 lift 成 typed-error Effect;Error 实例原样保留给现有归因逻辑。 */\nexport function providerBoundaryEffect<T>(operation: (signal: AbortSignal) => Promise<T>): Effect.Effect<T, Error> {\n return Effect.tryPromise({\n // 保留 Effect 运行时的取消信号,供真正支持 AbortSignal 的 SDK adapter 接入;不把中断\n // 编码成 Error,也不在这里启动嵌套 runtime。\n try: (signal) => operation(signal),\n catch: providerBoundaryError,\n });\n}\n/**\n * 公开 Sandbox Promise 接口唯一的兼容入口。\n *\n * 这不是内部 Effect runner:它只把 provider Promise 原样留在公开兼容面,并归一化非 Error\n * rejection。runtime / resource lifecycle 必须改用 providerBoundaryEffect() 组合 Effect。\n */\nexport async function providerCompatibilityPromise<T>(operation: () => Promise<T>): Promise<T> {\n try {\n return await operation();\n }\n catch (cause) {\n throw providerBoundaryError(cause);\n }\n}\n/** defineSandbox() 的公共新接口实现显式降成 provider backend;不探测任何旧方法。 */\nexport function customSandboxBackend(sandbox: CustomProviderSandbox): SandboxProviderBackend {\n const appendLog = sandbox.appendLog;\n // Provider facade 产出的 Sandbox 再经 runtime 归一化时必须保留 provider-only capabilities;\n // 作者直接返回的普通 Sandbox 没有登记项,仍严格退回 Unsupported,不能靠鸭子类型猜能力。\n const registered = SANDBOX_CAPABILITIES.get(sandbox) ?? {\n ...noSandboxBackendCapabilities,\n managedProcess: unsupportedBackendCapabilityBecause(\"custom Sandbox facades do not declare the internal managed-process capability\"),\n };\n return {\n get workdir() {\n return sandbox.workdir;\n },\n get sandboxId() {\n return sandbox.sandboxId;\n },\n get otlpHost() {\n return sandbox.otlpHost;\n },\n capabilities: {\n ...registered,\n appendLog: appendLog === undefined\n ? unsupportedBackendCapability\n : supportedBackendCapability((line) => appendLog.call(sandbox, line)),\n },\n runCommand: (command, args, options) => sandbox.runCommand(command, args, options),\n runShell: (script, options) => sandbox.runShell(script, options),\n readText: (path) => sandbox.readText(path),\n writeText: (path, content) => sandbox.writeText(path, content),\n readBytes: (path) => sandbox.readBytes(path),\n writeBytes: (path, content) => sandbox.writeBytes(path, content),\n pathExists: (path) => sandbox.pathExists(path),\n uploadFile: (source, targetPath) => sandbox.uploadFile(source, targetPath),\n uploadDirectory: (sourceDir, targetDir, options) => sandbox.uploadDirectory(sourceDir, targetDir, options),\n downloadFile: (sourcePath, target) => sandbox.downloadFile(sourcePath, target),\n downloadDirectory: (sourceDir, targetDir, options) => sandbox.downloadDirectory(sourceDir, targetDir, options),\n stop: () => sandbox.stop(),\n };\n}\nconst SANDBOX_CAPABILITIES = new WeakMap<CustomProviderSandbox, SandboxBackendCapabilities>();\nexport function registerSandboxCapabilities(sandbox: Sandbox, capabilities: SandboxBackendCapabilities): void {\n SANDBOX_CAPABILITIES.set(sandbox, capabilities);\n}\n/** 装饰器产生新 Sandbox 对象时显式继承同一份 provider-only 能力,不靠接口外成员探测。 */\nexport function inheritSandboxCapabilities(source: Sandbox, target: Sandbox): void {\n const capabilities = SANDBOX_CAPABILITIES.get(source);\n if (capabilities !== undefined)\n SANDBOX_CAPABILITIES.set(target, capabilities);\n}\nexport function sandboxCapabilities(sandbox: Sandbox): SandboxBackendCapabilities {\n const capabilities = SANDBOX_CAPABILITIES.get(sandbox);\n if (capabilities === undefined) {\n throw new Error(`sandbox ${sandbox.sandboxId} was not constructed by the provider facade`);\n }\n return capabilities;\n}\n/** 未经 provider facade 登记的普通自定义 Sandbox 保守视为不支持提权,不做鸭子类型猜测。 */\nexport function sandboxSupportsRootCommands(sandbox: Sandbox): boolean {\n return SANDBOX_CAPABILITIES.get(sandbox)?.rootCommands._tag === \"Supported\";\n}\nexport class SandboxManagedProcessCapabilityError extends Error {\n readonly name = \"SandboxManagedProcessCapabilityError\";\n constructor(readonly agent: string, readonly sandboxId: string, readonly reason: string) {\n super(`Agent ${agent} requires the sandbox managed-process capability, but sandbox ${sandboxId} does not support it: ${reason}`);\n }\n}\nexport function requireManagedProcessCapability(sandbox: Sandbox, agent: string): (input: ManagedProcessStart) => Promise<ManagedProcess> {\n const capability = sandboxCapabilities(sandbox).managedProcess;\n if (capability._tag === \"Unsupported\") {\n throw new SandboxManagedProcessCapabilityError(agent, sandbox.sandboxId, capability.reason);\n }\n return capability.value;\n}\n/** Provider facade 登记的复用寿命能力;不存在时保持显式 Unsupported,不做鸭子类型探测。 */\nexport function sandboxReuseCapability(sandbox: Sandbox): SandboxReuseCapability | undefined {\n const capability = sandboxCapabilities(sandbox).ensureLifetime;\n return capability._tag === \"Supported\" ? { ensureLifetime: capability.value } : undefined;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import type { SandboxActionState } from "./action.cjs";
|
|
3
|
-
import type { CommandOptions, CommandResult, Sandbox, ManagedProcess, ManagedProcessStart, SandboxReuseCapability, SandboxTransferOperations } from "./types.cjs";
|
|
3
|
+
import type { CommandOptions, CommandResult, CustomProviderSandbox, Sandbox, ManagedProcess, ManagedProcessStart, SandboxReuseCapability, SandboxTransferOperations } from "./types.cjs";
|
|
4
4
|
export type SandboxBackendSupport<T> = {
|
|
5
5
|
readonly _tag: "Supported";
|
|
6
6
|
readonly value: T;
|
|
@@ -216,7 +216,7 @@ export declare function providerBoundaryEffect<T>(operation: (signal: AbortSigna
|
|
|
216
216
|
*/
|
|
217
217
|
export declare function providerCompatibilityPromise<T>(operation: () => Promise<T>): Promise<T>;
|
|
218
218
|
/** defineSandbox() 的公共新接口实现显式降成 provider backend;不探测任何旧方法。 */
|
|
219
|
-
export declare function customSandboxBackend(sandbox:
|
|
219
|
+
export declare function customSandboxBackend(sandbox: CustomProviderSandbox): SandboxProviderBackend;
|
|
220
220
|
export declare function registerSandboxCapabilities(sandbox: Sandbox, capabilities: SandboxBackendCapabilities): void;
|
|
221
221
|
/** 装饰器产生新 Sandbox 对象时显式继承同一份 provider-only 能力,不靠接口外成员探测。 */
|
|
222
222
|
export declare function inheritSandboxCapabilities(source: Sandbox, target: Sandbox): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import type { SandboxActionState } from "./action.mjs";
|
|
3
|
-
import type { CommandOptions, CommandResult, Sandbox, ManagedProcess, ManagedProcessStart, SandboxReuseCapability, SandboxTransferOperations } from "./types.mjs";
|
|
3
|
+
import type { CommandOptions, CommandResult, CustomProviderSandbox, Sandbox, ManagedProcess, ManagedProcessStart, SandboxReuseCapability, SandboxTransferOperations } from "./types.mjs";
|
|
4
4
|
export type SandboxBackendSupport<T> = {
|
|
5
5
|
readonly _tag: "Supported";
|
|
6
6
|
readonly value: T;
|
|
@@ -216,7 +216,7 @@ export declare function providerBoundaryEffect<T>(operation: (signal: AbortSigna
|
|
|
216
216
|
*/
|
|
217
217
|
export declare function providerCompatibilityPromise<T>(operation: () => Promise<T>): Promise<T>;
|
|
218
218
|
/** defineSandbox() 的公共新接口实现显式降成 provider backend;不探测任何旧方法。 */
|
|
219
|
-
export declare function customSandboxBackend(sandbox:
|
|
219
|
+
export declare function customSandboxBackend(sandbox: CustomProviderSandbox): SandboxProviderBackend;
|
|
220
220
|
export declare function registerSandboxCapabilities(sandbox: Sandbox, capabilities: SandboxBackendCapabilities): void;
|
|
221
221
|
/** 装饰器产生新 Sandbox 对象时显式继承同一份 provider-only 能力,不靠接口外成员探测。 */
|
|
222
222
|
export declare function inheritSandboxCapabilities(source: Sandbox, target: Sandbox): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import type { SandboxActionState } from "./action.js";
|
|
3
|
-
import type { CommandOptions, CommandResult, Sandbox, ManagedProcess, ManagedProcessStart, SandboxReuseCapability, SandboxTransferOperations } from "./types.js";
|
|
3
|
+
import type { CommandOptions, CommandResult, CustomProviderSandbox, Sandbox, ManagedProcess, ManagedProcessStart, SandboxReuseCapability, SandboxTransferOperations } from "./types.js";
|
|
4
4
|
export type SandboxBackendSupport<T> = {
|
|
5
5
|
readonly _tag: "Supported";
|
|
6
6
|
readonly value: T;
|
|
@@ -216,7 +216,7 @@ export declare function providerBoundaryEffect<T>(operation: (signal: AbortSigna
|
|
|
216
216
|
*/
|
|
217
217
|
export declare function providerCompatibilityPromise<T>(operation: () => Promise<T>): Promise<T>;
|
|
218
218
|
/** defineSandbox() 的公共新接口实现显式降成 provider backend;不探测任何旧方法。 */
|
|
219
|
-
export declare function customSandboxBackend(sandbox:
|
|
219
|
+
export declare function customSandboxBackend(sandbox: CustomProviderSandbox): SandboxProviderBackend;
|
|
220
220
|
export declare function registerSandboxCapabilities(sandbox: Sandbox, capabilities: SandboxBackendCapabilities): void;
|
|
221
221
|
/** 装饰器产生新 Sandbox 对象时显式继承同一份 provider-only 能力,不靠接口外成员探测。 */
|
|
222
222
|
export declare function inheritSandboxCapabilities(source: Sandbox, target: Sandbox): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,gDAAgD;AAChD,6EAA6E;AAC7E,qDAAqD;AACrD,0CAA6C;AAApC,0GAAA,aAAa,OAAA;AACtB,uCAAsL;AAA7K,6HAAA,iCAAiC,OAAA;AAAE,wGAAA,YAAY,OAAA;AAAE,+GAAA,mBAAmB,OAAA;AAAE,yGAAA,aAAa,OAAA;AAAE,gHAAA,oBAAoB,OAAA;AAAE,sGAAA,UAAU,OAAA;AAAE,yGAAA,aAAa,OAAA;AAAE,6GAAA,iBAAiB,OAAA;AAChK,uCAA0C;AAAjC,wGAAA,YAAY,OAAA;AACrB,6CAAqE;AAA5D,sGAAA,OAAO,OAAA;AAAE,oGAAA,KAAK,OAAA;AAAE,mHAAA,oBAAoB,OAAA;AAC7C,yCAAyM;AAAhM,sGAAA,SAAS,OAAA;AAAE,4GAAA,eAAe,OAAA;AAAE,gHAAA,mBAAmB,OAAA;AAAE,wGAAA,WAAW,OAAA;AAAE,wGAAA,WAAW,OAAA;AAAE,yGAAA,YAAY,OAAA;AAAE,yHAAA,4BAA4B,OAAA;AAAE,4GAAA,eAAe,OAAA;AAAE,uGAAA,UAAU,OAAA;AAAE,uGAAA,UAAU,OAAA;AAAE,sGAAA,SAAS,OAAA;AAClL,6DAA8D;AAArD,+GAAA,QAAQ,OAAA;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E,yHAAA,0BAA0B,OAAA;AAAE,4HAAA,6BAA6B,OAAA;AAAE,mHAAA,oBAAoB,OAAA;AAAE,wHAAA,yBAAyB,OAAA;AAAE,2HAAA,4BAA4B,OAAA","sourcesContent":["// niceeval/sandbox 公开导出:「在哪里跑」相关的类型 + 工厂 + 扩展点。\n// 具体 provider 实现类(DockerSandbox / VercelSandbox / E2BSandbox)是内部实现细节,不在此导出——\n// 需要自定义 provider 时用 defineSandbox(),不需要直接 new 内置实现类。\nexport { defineSandbox } from \"../define.ts\";\nexport { CustomSandboxMaterializationError, sandboxLayer, sandboxRequirements, dockerSandbox, dockerComposeSandbox, e2bSandbox, vercelSandbox, defineSandboxCase, } from \"./layer.ts\";\nexport { incusSandbox } from \"./incus.ts\";\nexport { command, shell, defineSandboxCommand } from \"./commands.ts\";\nexport { actionRef, changeFrequency, defineSandboxAction, gitCheckout, sandboxStep, sandboxState, SandboxActionDefinitionError, uploadDirectory, uploadFile, writeBytes, writeText, } from \"./action.ts\";\nexport { checkout, installTool } from \"./prepare-commands.ts\";\nexport { SandboxCommandExitError } from \"./operations.ts\";\nexport { registerSandboxContent, sandboxContent } from \"./content.ts\";\nexport { COMPOSE_MATERIALIZER_REVISION, dockerComposeBuildProvider, collectComposeBuilds, leakGateHintsFromComposeFile, inspectComposeYaml, assertComposeBlacklist, findComposeBlacklistViolations, buildComposeOverlay, materializeDockerComposeProviderCase, } from \"./compose.ts\";\nexport { computeBuildKey, computeCaseKey, resolveFloatingImageTag, credentialIdentityContribution, assertPureDataIdentity, looksLikeDigestRef, } from \"./identity.ts\";\nexport { SANDBOX_BUILD_ACTIVITY, prepareSandboxBuilds, startSandboxBuilds, buildFailureOrigin, } from \"./build-coordinator.ts\";\nexport { createCheckpoint, restoreCheckpoint } from \"./checkpoint.ts\";\nexport { normalizeSandboxCapture, } from \"./record/attachment.ts\";\nexport type { SandboxCaptureInput, SandboxCaptureInputError, } from \"./record/attachment.ts\";\nexport { NICEEVAL_BUB_DOCKER_IMAGE, NICEEVAL_CLAUDE_CODE_DOCKER_IMAGE, NICEEVAL_CODEX_DOCKER_IMAGE, NICEEVAL_HERMES_DOCKER_IMAGE, NICEEVAL_OPENCLAW_DOCKER_IMAGE, NICEEVAL_OPENCODE_DOCKER_IMAGE, NICEEVAL_OMP_DOCKER_IMAGE, NICEEVAL_DEEPSEEK_HARNESS_DOCKER_IMAGE, } from \"./docker-agent-image.ts\";\nexport type { SandboxLayer, SandboxLayerKind, SandboxRequirementsOptions, SandboxRequirement, DockerExecutionRequirement, DockerImageSource, DockerfileSource, DockerSandboxSource, DockerSandboxAccess, DockerSandboxOptions, DockerSandboxCommonOptions, DockerSandboxReadiness, ManagedDockerResources, DockerComposeSandboxOptions, DockerSandboxResources, DockerSandboxTmpfsOptions, E2BSandboxOptions, VercelSandboxOptions, CustomProviderSandboxOptions, CustomCaseSandboxOptions, CustomCaseServices, CustomCaseMaterializedServices, CustomCaseMaterializeResult, SandboxTargetPlatform, SandboxLeakGate, } from \"./layer.ts\";\nexport type { IncusSandboxOptions, IncusSandboxResources } from \"./incus.ts\";\nexport type { SandboxCommand, SandboxCommandContext, SandboxCommandTarget, SandboxCleanupCommand, SandboxCommandIdentity, SandboxCommandDefinition, SandboxCommandIdentityValue, SandboxCommandOptions, SandboxExecOptions, CommandActionOptions, CommandAfterActionOptions, CommandActionFactory, ShellActionInput, ShellAfterActionInput, ShellActionFactory, StableSandboxCommand, AttemptRef, } from \"./commands.ts\";\nexport type { CheckoutGitSandboxStepInput, ExecSandboxStepInput, NonEmptySandboxSteps, PutBytesSandboxStepInput, PutTextSandboxStepInput, SandboxAction, SandboxActionDefinition, SandboxActionFamily, SandboxActionFingerprintPlan, SandboxActionPlan, SandboxActionRef, SandboxActionState, SandboxState, SandboxActionInstanceOptions, SandboxAfterAction, SandboxAfterActionOptions, SandboxBeforeActionOptions, SandboxCapability, SandboxChangeFrequency, SandboxStep, SandboxStepPlan, SandboxTransferSource, TransferDirectorySandboxStepInput, TransferFileSandboxStepInput, GitCheckoutActionFactory, GitCheckoutActionInput, GitCheckoutAfterActionInput, UploadDirectoryActionFactory, UploadDirectoryActionInput, UploadDirectoryAfterActionInput, UploadFileActionFactory, UploadFileActionInput, UploadFileAfterActionInput, WriteBytesActionFactory, WriteBytesActionInput, WriteBytesAfterActionInput, WriteTextActionFactory, WriteTextActionInput, WriteTextAfterActionInput, } from \"./action.ts\";\nexport type { CheckoutOptions, InstallToolOptions } from \"./prepare-commands.ts\";\nexport type { CustomProviderSandbox } from \"./types.ts\";\nexport type { RegisteredSandboxContent, SandboxContent, SandboxContentFactory, } from \"./content.ts\";\nexport type { Sandbox, SandboxOperations, SandboxTransferOperations, SandboxProvider, SandboxRuntime, CommandResult, CommandOptions, SuccessfulCommandResult, } from \"../types.ts\";\nexport type { SandboxCaseKind, ServiceController, MaterializedSandboxCase, SandboxGroupEntry, SandboxResourceGroup, SandboxMaterializeContext, } from \"./case-types.ts\";\nexport type { BuildKey, CaseKey, BuildKeyInput, CaseKeyInput, ImageRefResolution, CredentialRef, } from \"./identity.ts\";\nexport type { ComposeBuildCollection, ComposeInspection, ComposeServiceInspection, ComposeBlacklistFinding, ComposeOverlay, MaterializeComposeOpts, } from \"./compose.ts\";\nexport type { SandboxBuildWork, SandboxBuildProvider, SandboxBuildRef, MaterializationScopeId, SandboxBuildLookup, SandboxBuildArtifactSource, SandboxBuildUseHandle, SandboxBuildExecutionContext, SandboxBuildPreparation, SandboxBuildFailure, PrepareSandboxBuildsOptions, } from \"./build-coordinator.ts\";\nexport { materializationScopeId, sandboxBuildRef } from \"./build-coordinator.ts\";\nexport { DockerProfileError, dockerProfileError, } from \"./docker-profile/errors.ts\";\nexport type { DockerProfileErrorCode, DockerProfileErrorOptions, } from \"./docker-profile/errors.ts\";\nexport { DOCKER_EXECUTION_PROFILE_SCHEMA_VERSION, DOCKER_PROFILE_SCHEMA_VERSION, DOCKER_PROFILE_NETWORK_POLICY_VERSION, DOCKER_PROFILE_NETWORK_DENY_CIDRS, DockerExecutionProfileV1Schema, DockerExecutionProfileSchema, createDockerExecutionProfileV1, decodeDockerExecutionProfileV1, dockerExecutionProfileSemanticPolicyRevisionOf, dockerProfileSemanticPolicyRevisionOf, dockerExecutionProfileV1Digest, dockerProfileDigestOf, dockerProfilePublicSummaryOf, isDockerExecutionProfileV1, makeDockerExecutionProfileV1, parseDockerExecutionProfile, parseDockerExecutionProfileV1, } from \"./docker-profile/schema.ts\";\nexport type { DockerExecutionProfileSecurityLevel, DockerExecutionProfileV1, DockerExecutionProfileV1Draft, DockerProfileNetworkPolicy, DockerProfilePublicSummary, DockerProfileUnixEndpoint, } from \"./docker-profile/schema.ts\";\nexport { createDockerProfileRegistry, indexDockerProfiles, parseDockerProfileRegistry, resolveDockerExecutionProfile, resolveDockerProfile, resolveDockerProfileAlias, resolveDockerProfileSelector, } from \"./docker-profile/registry.ts\";\nexport type { DockerProfileRegistryEntry, DockerProfileRegistryFileFacts, DockerProfileRegistryIndex, DockerProfileRegistryInput, DockerProfileRegistryOptions, ResolvedDockerProfileEntry, } from \"./docker-profile/registry.ts\";\n"]}
|
package/dist/sandbox/index.d.cts
CHANGED
|
@@ -18,6 +18,7 @@ export type { IncusSandboxOptions, IncusSandboxResources } from "./incus.cjs";
|
|
|
18
18
|
export type { SandboxCommand, SandboxCommandContext, SandboxCommandTarget, SandboxCleanupCommand, SandboxCommandIdentity, SandboxCommandDefinition, SandboxCommandIdentityValue, SandboxCommandOptions, SandboxExecOptions, CommandActionOptions, CommandAfterActionOptions, CommandActionFactory, ShellActionInput, ShellAfterActionInput, ShellActionFactory, StableSandboxCommand, AttemptRef, } from "./commands.cjs";
|
|
19
19
|
export type { CheckoutGitSandboxStepInput, ExecSandboxStepInput, NonEmptySandboxSteps, PutBytesSandboxStepInput, PutTextSandboxStepInput, SandboxAction, SandboxActionDefinition, SandboxActionFamily, SandboxActionFingerprintPlan, SandboxActionPlan, SandboxActionRef, SandboxActionState, SandboxState, SandboxActionInstanceOptions, SandboxAfterAction, SandboxAfterActionOptions, SandboxBeforeActionOptions, SandboxCapability, SandboxChangeFrequency, SandboxStep, SandboxStepPlan, SandboxTransferSource, TransferDirectorySandboxStepInput, TransferFileSandboxStepInput, GitCheckoutActionFactory, GitCheckoutActionInput, GitCheckoutAfterActionInput, UploadDirectoryActionFactory, UploadDirectoryActionInput, UploadDirectoryAfterActionInput, UploadFileActionFactory, UploadFileActionInput, UploadFileAfterActionInput, WriteBytesActionFactory, WriteBytesActionInput, WriteBytesAfterActionInput, WriteTextActionFactory, WriteTextActionInput, WriteTextAfterActionInput, } from "./action.cjs";
|
|
20
20
|
export type { CheckoutOptions, InstallToolOptions } from "./prepare-commands.cjs";
|
|
21
|
+
export type { CustomProviderSandbox } from "./types.cjs";
|
|
21
22
|
export type { RegisteredSandboxContent, SandboxContent, SandboxContentFactory, } from "./content.cjs";
|
|
22
23
|
export type { Sandbox, SandboxOperations, SandboxTransferOperations, SandboxProvider, SandboxRuntime, CommandResult, CommandOptions, SuccessfulCommandResult, } from "../types.cjs";
|
|
23
24
|
export type { SandboxCaseKind, ServiceController, MaterializedSandboxCase, SandboxGroupEntry, SandboxResourceGroup, SandboxMaterializeContext, } from "./case-types.cjs";
|
package/dist/sandbox/index.d.mts
CHANGED
|
@@ -18,6 +18,7 @@ export type { IncusSandboxOptions, IncusSandboxResources } from "./incus.mjs";
|
|
|
18
18
|
export type { SandboxCommand, SandboxCommandContext, SandboxCommandTarget, SandboxCleanupCommand, SandboxCommandIdentity, SandboxCommandDefinition, SandboxCommandIdentityValue, SandboxCommandOptions, SandboxExecOptions, CommandActionOptions, CommandAfterActionOptions, CommandActionFactory, ShellActionInput, ShellAfterActionInput, ShellActionFactory, StableSandboxCommand, AttemptRef, } from "./commands.mjs";
|
|
19
19
|
export type { CheckoutGitSandboxStepInput, ExecSandboxStepInput, NonEmptySandboxSteps, PutBytesSandboxStepInput, PutTextSandboxStepInput, SandboxAction, SandboxActionDefinition, SandboxActionFamily, SandboxActionFingerprintPlan, SandboxActionPlan, SandboxActionRef, SandboxActionState, SandboxState, SandboxActionInstanceOptions, SandboxAfterAction, SandboxAfterActionOptions, SandboxBeforeActionOptions, SandboxCapability, SandboxChangeFrequency, SandboxStep, SandboxStepPlan, SandboxTransferSource, TransferDirectorySandboxStepInput, TransferFileSandboxStepInput, GitCheckoutActionFactory, GitCheckoutActionInput, GitCheckoutAfterActionInput, UploadDirectoryActionFactory, UploadDirectoryActionInput, UploadDirectoryAfterActionInput, UploadFileActionFactory, UploadFileActionInput, UploadFileAfterActionInput, WriteBytesActionFactory, WriteBytesActionInput, WriteBytesAfterActionInput, WriteTextActionFactory, WriteTextActionInput, WriteTextAfterActionInput, } from "./action.mjs";
|
|
20
20
|
export type { CheckoutOptions, InstallToolOptions } from "./prepare-commands.mjs";
|
|
21
|
+
export type { CustomProviderSandbox } from "./types.mjs";
|
|
21
22
|
export type { RegisteredSandboxContent, SandboxContent, SandboxContentFactory, } from "./content.mjs";
|
|
22
23
|
export type { Sandbox, SandboxOperations, SandboxTransferOperations, SandboxProvider, SandboxRuntime, CommandResult, CommandOptions, SuccessfulCommandResult, } from "../types.mjs";
|
|
23
24
|
export type { SandboxCaseKind, ServiceController, MaterializedSandboxCase, SandboxGroupEntry, SandboxResourceGroup, SandboxMaterializeContext, } from "./case-types.mjs";
|
package/dist/sandbox/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export type { IncusSandboxOptions, IncusSandboxResources } from "./incus.js";
|
|
|
18
18
|
export type { SandboxCommand, SandboxCommandContext, SandboxCommandTarget, SandboxCleanupCommand, SandboxCommandIdentity, SandboxCommandDefinition, SandboxCommandIdentityValue, SandboxCommandOptions, SandboxExecOptions, CommandActionOptions, CommandAfterActionOptions, CommandActionFactory, ShellActionInput, ShellAfterActionInput, ShellActionFactory, StableSandboxCommand, AttemptRef, } from "./commands.js";
|
|
19
19
|
export type { CheckoutGitSandboxStepInput, ExecSandboxStepInput, NonEmptySandboxSteps, PutBytesSandboxStepInput, PutTextSandboxStepInput, SandboxAction, SandboxActionDefinition, SandboxActionFamily, SandboxActionFingerprintPlan, SandboxActionPlan, SandboxActionRef, SandboxActionState, SandboxState, SandboxActionInstanceOptions, SandboxAfterAction, SandboxAfterActionOptions, SandboxBeforeActionOptions, SandboxCapability, SandboxChangeFrequency, SandboxStep, SandboxStepPlan, SandboxTransferSource, TransferDirectorySandboxStepInput, TransferFileSandboxStepInput, GitCheckoutActionFactory, GitCheckoutActionInput, GitCheckoutAfterActionInput, UploadDirectoryActionFactory, UploadDirectoryActionInput, UploadDirectoryAfterActionInput, UploadFileActionFactory, UploadFileActionInput, UploadFileAfterActionInput, WriteBytesActionFactory, WriteBytesActionInput, WriteBytesAfterActionInput, WriteTextActionFactory, WriteTextActionInput, WriteTextAfterActionInput, } from "./action.js";
|
|
20
20
|
export type { CheckoutOptions, InstallToolOptions } from "./prepare-commands.js";
|
|
21
|
+
export type { CustomProviderSandbox } from "./types.js";
|
|
21
22
|
export type { RegisteredSandboxContent, SandboxContent, SandboxContentFactory, } from "./content.js";
|
|
22
23
|
export type { Sandbox, SandboxOperations, SandboxTransferOperations, SandboxProvider, SandboxRuntime, CommandResult, CommandOptions, SuccessfulCommandResult, } from "../types.js";
|
|
23
24
|
export type { SandboxCaseKind, ServiceController, MaterializedSandboxCase, SandboxGroupEntry, SandboxResourceGroup, SandboxMaterializeContext, } from "./case-types.js";
|