@fastgpt-sdk/sandbox-adapter 0.0.3 → 0.0.4

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.
@@ -15,9 +15,4 @@ import type { ISandboxLifecycle } from './ISandboxLifecycle';
15
15
  export interface ISandbox extends ISandboxLifecycle, ICommandExecution, IFileSystem, IHealthCheck {
16
16
  /** Provider name (e.g., 'opensandbox') */
17
17
  readonly provider: string;
18
- /**
19
- * Close the connection and release resources.
20
- * Should be called when done with the sandbox.
21
- */
22
- close(): Promise<void>;
23
18
  }
@@ -21,16 +21,6 @@ export interface ISandboxLifecycle {
21
21
  * Stop a running sandbox (graceful shutdown).
22
22
  */
23
23
  stop(): Promise<void>;
24
- /**
25
- * Pause a running sandbox.
26
- * Not all providers support this.
27
- */
28
- pause(): Promise<void>;
29
- /**
30
- * Resume a paused sandbox.
31
- * Not all providers support this.
32
- */
33
- resume(): Promise<void>;
34
24
  /**
35
25
  * Delete the sandbox permanently.
36
26
  */
@@ -5,7 +5,7 @@ export type SandboxId = string;
5
5
  /**
6
6
  * Sandbox status states.
7
7
  */
8
- export type SandboxState = 'Creating' | 'Running' | 'Pausing' | 'Paused' | 'Resuming' | 'Deleting' | 'Deleted' | 'Error' | string;
8
+ export type SandboxState = 'UnExist' | 'Running' | 'Creating' | 'Starting' | 'Stopping' | 'Stopped' | 'Deleting' | 'Error';
9
9
  /**
10
10
  * Sandbox status information.
11
11
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fastgpt-sdk/sandbox-adapter",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Unified abstraction layer for cloud sandbox providers with adapter pattern and feature polyfilling",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -47,8 +47,7 @@
47
47
  "author": "",
48
48
  "license": "MIT",
49
49
  "dependencies": {
50
- "@alibaba-group/opensandbox": "^0.1.3",
51
- "@fastgpt-sdk/sandbox-server": "^0.0.5"
50
+ "@alibaba-group/opensandbox": "^0.1.3"
52
51
  },
53
52
  "devDependencies": {
54
53
  "@eslint/js": "^9.39.2",
@@ -1,85 +0,0 @@
1
- import type { ExecuteOptions, ExecuteResult, SandboxConfig, SandboxId, SandboxInfo } from '../../types';
2
- import { BaseSandboxAdapter } from '../BaseSandboxAdapter';
3
- /**
4
- * Configuration for FastGPT Sandbox Adapter.
5
- */
6
- export interface FastGPTSandboxConfig {
7
- /** Base URL for the FastGPT Sandbox Server API */
8
- baseUrl: string;
9
- /** Authentication token */
10
- token: string;
11
- /** Container name (used as sandbox ID) */
12
- containerName: string;
13
- }
14
- export declare class FastGPTSandboxAdapter extends BaseSandboxAdapter {
15
- private config;
16
- /** Provider identifier */
17
- readonly provider: "fastgpt";
18
- /** SDK instance */
19
- private sdk;
20
- /** Container name (used as sandbox ID) */
21
- private _id;
22
- /**
23
- * Creates a new FastGPTSandboxAdapter instance.
24
- *
25
- * @param config - Connection configuration
26
- */
27
- constructor(config: FastGPTSandboxConfig);
28
- /**
29
- * Get the sandbox ID (container name).
30
- */
31
- get id(): SandboxId;
32
- /**
33
- * Get detailed information about the sandbox.
34
- */
35
- getInfo(): Promise<SandboxInfo | null>;
36
- /**
37
- * Create a new sandbox container.
38
- *
39
- * Note: The FastGPT SDK only accepts container name for creation.
40
- * Image and resource configuration are handled server-side.
41
- *
42
- * @param _config - Sandbox configuration (not fully used by this SDK)
43
- */
44
- create(_config: SandboxConfig): Promise<void>;
45
- /**
46
- * Start a stopped or paused sandbox.
47
- * Uses SDK's start method which resumes paused containers.
48
- */
49
- start(): Promise<void>;
50
- /**
51
- * Stop the sandbox.
52
- * Note: FastGPT SDK uses pause instead of stop.
53
- */
54
- stop(): Promise<void>;
55
- /**
56
- * Pause a running sandbox.
57
- */
58
- pause(): Promise<void>;
59
- /**
60
- * Resume a paused sandbox.
61
- */
62
- resume(): Promise<void>;
63
- /**
64
- * Delete the sandbox permanently.
65
- */
66
- delete(): Promise<void>;
67
- /**
68
- * Close the connection and release resources.
69
- */
70
- close(): Promise<void>;
71
- /**
72
- * Execute a command and wait for completion.
73
- *
74
- * @param command - The command to execute
75
- * @param options - Execution options
76
- * @returns Execution result with stdout, stderr, and exit code
77
- */
78
- execute(command: string, options?: ExecuteOptions): Promise<ExecuteResult>;
79
- /**
80
- * Check if the sandbox is healthy.
81
- *
82
- * @returns true if healthy, false otherwise
83
- */
84
- ping(): Promise<boolean>;
85
- }