@meetploy/types 1.16.0 → 1.18.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 +1 -0
- package/dist/sandbox.d.ts +87 -0
- package/dist/sandbox.js +2 -0
- package/dist/sandbox.js.map +1 -0
- package/globals.d.ts +3 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export type { TimerBinding, TimerEvent, TimerOptions } from "./timer.js";
|
|
|
6
6
|
export type { CacheBinding, CacheSetOptions } from "./cache.js";
|
|
7
7
|
export type { KVNamespace, KVNamespaceGetOptions, KVNamespaceGetMethodOptions, KVNamespaceGetWithMetadataResult, KVNamespaceListKey, KVNamespaceListOptions, KVNamespaceListResult, KVNamespacePutOptions, StateBinding, StateUpdateDoc, } from "./state.js";
|
|
8
8
|
export type { FileStorageBinding, FileStorageObject, FileStorageKey, FileStorageListResult, FileStoragePutOptions, FileStorageListOptions, } from "./fs.js";
|
|
9
|
+
export type { SandboxBinding, SandboxClient, SandboxSession, SandboxSessionOptions, SandboxExecResult, SandboxExecOptions, SandboxFileEntry, SandboxGitCheckoutOptions, SandboxProcessInfo, } from "./sandbox.js";
|
|
9
10
|
export type { ScheduledEvent, ScheduledHandler } from "./scheduled.js";
|
|
10
11
|
export type { PloyAuth, PloyUser } from "./auth.js";
|
|
11
12
|
export type { Ai, AiGateway, AiGatewayOptions, AiGatewayRetries, AiRunOptions, } from "./ai.js";
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export interface SandboxExecResult {
|
|
2
|
+
stdout: string;
|
|
3
|
+
stderr: string;
|
|
4
|
+
exitCode: number;
|
|
5
|
+
success: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface SandboxExecOptions {
|
|
8
|
+
cwd?: string;
|
|
9
|
+
env?: Record<string, string>;
|
|
10
|
+
timeoutMs?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface SandboxFileEntry {
|
|
13
|
+
name: string;
|
|
14
|
+
path: string;
|
|
15
|
+
type: "file" | "directory";
|
|
16
|
+
size?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface SandboxGitCheckoutOptions {
|
|
19
|
+
branch?: string;
|
|
20
|
+
depth?: number;
|
|
21
|
+
targetDir?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface SandboxSessionOptions {
|
|
24
|
+
cwd?: string;
|
|
25
|
+
env?: Record<string, string>;
|
|
26
|
+
}
|
|
27
|
+
export interface SandboxProcessInfo {
|
|
28
|
+
id: string;
|
|
29
|
+
pid: number | null;
|
|
30
|
+
command: string;
|
|
31
|
+
status: "running" | "completed" | "failed";
|
|
32
|
+
exitCode: number | null;
|
|
33
|
+
startedAt: string;
|
|
34
|
+
}
|
|
35
|
+
export interface SandboxSession {
|
|
36
|
+
readonly sessionId: string;
|
|
37
|
+
exec: (command: string, options?: SandboxExecOptions) => Promise<SandboxExecResult>;
|
|
38
|
+
execStream: (command: string, options?: SandboxExecOptions) => Promise<ReadableStream<Uint8Array>>;
|
|
39
|
+
writeFile: (path: string, content: string) => Promise<void>;
|
|
40
|
+
readFile: (path: string) => Promise<{
|
|
41
|
+
content: string;
|
|
42
|
+
}>;
|
|
43
|
+
deleteFile: (path: string) => Promise<void>;
|
|
44
|
+
mkdir: (path: string, options?: {
|
|
45
|
+
recursive?: boolean;
|
|
46
|
+
}) => Promise<void>;
|
|
47
|
+
listFiles: (path: string) => Promise<SandboxFileEntry[]>;
|
|
48
|
+
gitCheckout: (repoUrl: string, options?: SandboxGitCheckoutOptions) => Promise<void>;
|
|
49
|
+
setEnvVars: (vars: Record<string, string>) => Promise<void>;
|
|
50
|
+
startProcess: (command: string, options?: SandboxExecOptions) => Promise<SandboxProcessInfo>;
|
|
51
|
+
listProcesses: () => Promise<SandboxProcessInfo[]>;
|
|
52
|
+
getProcess: (processId: string) => Promise<SandboxProcessInfo | null>;
|
|
53
|
+
getProcessLogs: (processId: string) => Promise<{
|
|
54
|
+
logs: string;
|
|
55
|
+
}>;
|
|
56
|
+
streamProcessLogs: (processId: string) => Promise<ReadableStream<Uint8Array>>;
|
|
57
|
+
killProcess: (processId: string) => Promise<void>;
|
|
58
|
+
}
|
|
59
|
+
export interface SandboxClient {
|
|
60
|
+
readonly id: string;
|
|
61
|
+
exec: (command: string, options?: SandboxExecOptions) => Promise<SandboxExecResult>;
|
|
62
|
+
execStream: (command: string, options?: SandboxExecOptions) => Promise<ReadableStream<Uint8Array>>;
|
|
63
|
+
writeFile: (path: string, content: string) => Promise<void>;
|
|
64
|
+
readFile: (path: string) => Promise<{
|
|
65
|
+
content: string;
|
|
66
|
+
}>;
|
|
67
|
+
deleteFile: (path: string) => Promise<void>;
|
|
68
|
+
mkdir: (path: string, options?: {
|
|
69
|
+
recursive?: boolean;
|
|
70
|
+
}) => Promise<void>;
|
|
71
|
+
listFiles: (path: string) => Promise<SandboxFileEntry[]>;
|
|
72
|
+
gitCheckout: (repoUrl: string, options?: SandboxGitCheckoutOptions) => Promise<void>;
|
|
73
|
+
setEnvVars: (vars: Record<string, string>) => Promise<void>;
|
|
74
|
+
startProcess: (command: string, options?: SandboxExecOptions) => Promise<SandboxProcessInfo>;
|
|
75
|
+
listProcesses: () => Promise<SandboxProcessInfo[]>;
|
|
76
|
+
getProcess: (processId: string) => Promise<SandboxProcessInfo | null>;
|
|
77
|
+
getProcessLogs: (processId: string) => Promise<{
|
|
78
|
+
logs: string;
|
|
79
|
+
}>;
|
|
80
|
+
streamProcessLogs: (processId: string) => Promise<ReadableStream<Uint8Array>>;
|
|
81
|
+
killProcess: (processId: string) => Promise<void>;
|
|
82
|
+
createSession: (options?: SandboxSessionOptions) => Promise<SandboxSession>;
|
|
83
|
+
destroy: () => Promise<void>;
|
|
84
|
+
}
|
|
85
|
+
export interface SandboxBinding {
|
|
86
|
+
get: (id: string) => SandboxClient;
|
|
87
|
+
}
|
package/dist/sandbox.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox.js","sourceRoot":"","sources":["../src/sandbox.ts"],"names":[],"mappings":""}
|
package/globals.d.ts
CHANGED
|
@@ -41,6 +41,9 @@ declare global {
|
|
|
41
41
|
type WorkflowBinding = import("@meetploy/types").WorkflowBinding;
|
|
42
42
|
type FileStorageBinding = import("@meetploy/types").FileStorageBinding;
|
|
43
43
|
type TimerBinding = import("@meetploy/types").TimerBinding;
|
|
44
|
+
type SandboxBinding = import("@meetploy/types").SandboxBinding;
|
|
45
|
+
type SandboxClient = import("@meetploy/types").SandboxClient;
|
|
46
|
+
type SandboxSession = import("@meetploy/types").SandboxSession;
|
|
44
47
|
type PloyAuth = import("@meetploy/types").PloyAuth;
|
|
45
48
|
type PloyUser = import("@meetploy/types").PloyUser;
|
|
46
49
|
type Ai = import("@meetploy/types").Ai;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meetploy/types",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.18.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/
|
|
7
|
+
"url": "git+https://github.com/meetploy/ploy.git",
|
|
8
8
|
"directory": "packages/types"
|
|
9
9
|
},
|
|
10
10
|
"license": "SEE LICENSE IN ../../LICENSE",
|