feat(sandbox): introduce unified sandbox adapter architecture (#6362)
Introduces a new, extensible sandbox adapter architecture to abstract various sandbox providers behind a unified ISandbox interface. This design utilizes an adapter pattern with a BaseSandboxAdapter, enabling easy integration of providers like OpenSandboxAdapter and MinimalProviderAdapter. It ensures consistent functionality across environments through capability-driven polyfills for missing features. This provides a scalable and maintainable foundation for different execution environments.
Showing
sdk/sandbox/README.md
0 → 100644
sdk/sandbox/package.json
0 → 100644
| { | |||
| "name": "@fastgpt/sandbox", | |||
| "version": "0.1.0", | |||
| "description": "Unified abstraction layer for cloud sandbox providers with adapter pattern and feature polyfilling", | |||
| "type": "module", | |||
| "main": "./dist/index.js", | |||
| "types": "./dist/index.d.ts", | |||
| "exports": { | |||
| ".": { | |||
| "import": "./dist/index.js", | |||
| "types": "./dist/index.d.ts" | |||
| } | |||
| }, | |||
| "scripts": { | |||
| "build": "tsc", | |||
| "dev": "tsc --watch", | |||
| "test": "vitest run --config ./vitest.config.mts", | |||
| "test:watch": "vitest watch", | |||
| "test:coverage": "vitest run --coverage" | |||
| }, | |||
| "keywords": [ | |||
| "sandbox", | |||
| "cloud", | |||
| "adapter", | |||
| "abstraction" | |||
| ], | |||
| "author": "", | |||
| "license": "MIT", | |||
| "dependencies": { | |||
| "@alibaba-group/opensandbox": "^0.1.3" | |||
| }, | |||
| "devDependencies": { | |||
| "vitest": "^3.0.9", | |||
| "@vitest/coverage-v8": "^3.0.9", | |||
| "typescript": "^5.1.3", | |||
| "husky": "^9.1.7", | |||
| "lint-staged": "^16.2.7" | |||
| }, | |||
| "peerDependencies": { | |||
| "typescript": "^5.0.0" | |||
| } | |||
| } |
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
sdk/sandbox/src/adapters/index.ts
0 → 100644
sdk/sandbox/src/errors/ConnectionError.ts
0 → 100644
sdk/sandbox/src/errors/FileOperationError.ts
0 → 100644
sdk/sandbox/src/errors/SandboxException.ts
0 → 100644
sdk/sandbox/src/errors/SandboxStateError.ts
0 → 100644
sdk/sandbox/src/errors/TimeoutError.ts
0 → 100644
sdk/sandbox/src/errors/index.ts
0 → 100644
sdk/sandbox/src/factory/index.ts
0 → 100644
sdk/sandbox/src/index.ts
0 → 100644
sdk/sandbox/src/interfaces/IFileSystem.ts
0 → 100644
sdk/sandbox/src/interfaces/IHealthCheck.ts
0 → 100644
sdk/sandbox/src/interfaces/ISandbox.ts
0 → 100644
sdk/sandbox/src/interfaces/index.ts
0 → 100644
This diff is collapsed.
Click to expand it.
sdk/sandbox/src/polyfill/index.ts
0 → 100644
sdk/sandbox/src/types/capabilities.ts
0 → 100644
sdk/sandbox/src/types/execution.ts
0 → 100644
sdk/sandbox/src/types/filesystem.ts
0 → 100644
sdk/sandbox/src/types/index.ts
0 → 100644
sdk/sandbox/src/types/sandbox.ts
0 → 100644
sdk/sandbox/src/utils/base64.ts
0 → 100644
sdk/sandbox/src/utils/index.ts
0 → 100644
sdk/sandbox/src/utils/streams.ts
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
sdk/sandbox/tests/mocks/index.ts
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
sdk/sandbox/tsconfig.json
0 → 100644
sdk/sandbox/vitest.config.mts
0 → 100644
Please
register
or
sign in
to comment