dphelper 3.1.0 → 3.1.1
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/dphelper.umd.js +22 -22
- package/index.js +20 -20
- package/package.json +1 -1
- package/types/dphelper.d.ts +0 -47
- package/tools/sandbox/interface.d.ts +0 -44
- package/types/tools/sandbox/index.d.ts +0 -1
package/package.json
CHANGED
package/types/dphelper.d.ts
CHANGED
|
@@ -338,52 +338,6 @@ declare global {
|
|
|
338
338
|
resolve: (data: any) => Promise<any>
|
|
339
339
|
}
|
|
340
340
|
|
|
341
|
-
// --- sandbox ---
|
|
342
|
-
interface SandboxOptions {
|
|
343
|
-
timeout?: number
|
|
344
|
-
memoryLimit?: number
|
|
345
|
-
allowGlobals?: boolean
|
|
346
|
-
allowConsole?: boolean
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
interface AgentSandboxOptions {
|
|
350
|
-
maxTokens?: number
|
|
351
|
-
maxOperations?: number
|
|
352
|
-
allowRead?: boolean
|
|
353
|
-
allowWrite?: boolean
|
|
354
|
-
allowNetwork?: boolean
|
|
355
|
-
blockedAPIs?: string[]
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
interface AgentContext {
|
|
359
|
-
id: string
|
|
360
|
-
created: number
|
|
361
|
-
operations: number
|
|
362
|
-
tokens: number
|
|
363
|
-
blocked: boolean
|
|
364
|
-
data: Record<string, any>
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
interface IsolatedSandbox {
|
|
368
|
-
run: (code: string) => any
|
|
369
|
-
eval: (expr: string) => any
|
|
370
|
-
setGlobal: (key: string, value: any) => void
|
|
371
|
-
getGlobal: (key: string) => any
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
interface SandboxTool {
|
|
375
|
-
run: (code: string, options?: SandboxOptions) => Promise<any>
|
|
376
|
-
eval: (expr: string) => any
|
|
377
|
-
createAgent: (options?: AgentSandboxOptions) => string
|
|
378
|
-
agentRun: (agentId: string, code: string) => Promise<any>
|
|
379
|
-
blockFS: () => void
|
|
380
|
-
blockNetwork: () => void
|
|
381
|
-
isolate: (globals?: Record<string, any>) => IsolatedSandbox
|
|
382
|
-
reset: () => void
|
|
383
|
-
listAgents: () => AgentContext[]
|
|
384
|
-
killAgent: (agentId: string) => boolean
|
|
385
|
-
}
|
|
386
|
-
|
|
387
341
|
// --- sanitize ---
|
|
388
342
|
interface SanitizeTool {
|
|
389
343
|
html: (s: string) => string
|
|
@@ -634,7 +588,6 @@ declare global {
|
|
|
634
588
|
object: ObjectsTool
|
|
635
589
|
path: PathTool
|
|
636
590
|
promise: PromiseTool
|
|
637
|
-
sandbox: SandboxTool
|
|
638
591
|
sanitize: SanitizeTool
|
|
639
592
|
screen: ScreenTool
|
|
640
593
|
scrollbar: ScrollbarTool
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
interface SandboxOptions {
|
|
2
|
-
timeout?: number
|
|
3
|
-
memoryLimit?: number
|
|
4
|
-
allowGlobals?: boolean
|
|
5
|
-
allowConsole?: boolean
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
interface AgentSandboxOptions {
|
|
9
|
-
maxTokens?: number
|
|
10
|
-
maxOperations?: number
|
|
11
|
-
allowRead?: boolean
|
|
12
|
-
allowWrite?: boolean
|
|
13
|
-
allowNetwork?: boolean
|
|
14
|
-
blockedAPIs?: string[]
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
interface AgentContext {
|
|
18
|
-
id: string
|
|
19
|
-
created: number
|
|
20
|
-
operations: number
|
|
21
|
-
tokens: number
|
|
22
|
-
blocked: boolean
|
|
23
|
-
data: Record<string, any>
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
interface IsolatedSandbox {
|
|
27
|
-
run: (code: string) => any
|
|
28
|
-
eval: (expr: string) => any
|
|
29
|
-
setGlobal: (key: string, value: any) => void
|
|
30
|
-
getGlobal: (key: string) => any
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
interface SandboxTool {
|
|
34
|
-
run: (code: string, options?: SandboxOptions) => Promise<any>
|
|
35
|
-
eval: (expr: string) => any
|
|
36
|
-
createAgent: (options?: AgentSandboxOptions) => string
|
|
37
|
-
agentRun: (agentId: string, code: string) => Promise<any>
|
|
38
|
-
blockFS: () => void
|
|
39
|
-
blockNetwork: () => void
|
|
40
|
-
isolate: (globals?: Record<string, any>) => IsolatedSandbox
|
|
41
|
-
reset: () => void
|
|
42
|
-
listAgents: () => AgentContext[]
|
|
43
|
-
killAgent: (agentId: string) => boolean
|
|
44
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|