ppio-sandbox 2.0.4-a2 → 2.1.0-a2
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/{chunk-TKMNGUIC.mjs → chunk-46KYZWWN.mjs} +3253 -2366
- package/dist/chunk-46KYZWWN.mjs.map +1 -0
- package/dist/chunk-T5IKSUZH.mjs +468 -0
- package/dist/chunk-T5IKSUZH.mjs.map +1 -0
- package/dist/chunk-X3M4KXDB.mjs +533 -0
- package/dist/chunk-X3M4KXDB.mjs.map +1 -0
- package/dist/code-interpreter.d.mts +4 -202
- package/dist/code-interpreter.d.ts +4 -202
- package/dist/code-interpreter.js +7355 -5580
- package/dist/code-interpreter.js.map +1 -1
- package/dist/code-interpreter.mjs +18 -460
- package/dist/code-interpreter.mjs.map +1 -1
- package/dist/desktop.d.mts +2 -91
- package/dist/desktop.d.ts +2 -91
- package/dist/desktop.js +7394 -5687
- package/dist/desktop.js.map +1 -1
- package/dist/desktop.mjs +17 -525
- package/dist/desktop.mjs.map +1 -1
- package/dist/{index-CBdou_ua.d.mts → index-CRwaZUdl.d.mts} +2363 -1886
- package/dist/{index-CBdou_ua.d.ts → index-CRwaZUdl.d.ts} +2363 -1886
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +7410 -5188
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -1
- package/dist/sandbox-JYRR7FR5.mjs +8 -0
- package/dist/sandbox-JYRR7FR5.mjs.map +1 -0
- package/dist/sandbox-V324H2RC.mjs +8 -0
- package/dist/sandbox-V324H2RC.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-TKMNGUIC.mjs.map +0 -1
|
@@ -1,209 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { bm as Sandbox } from './index-CRwaZUdl.mjs';
|
|
2
|
+
export { ah as ALL_TRAFFIC, A as ApiClient, b as AuthenticationError, bC as BarChart, bD as BarData, bG as BoxAndWhiskerChart, bH as BoxAndWhiskerData, B as BuildError, b4 as BuildInfo, b5 as BuildOptions, b6 as BuildStatusReason, bB as Chart, bz as ChartType, bA as ChartTypes, bq as CodeContextRequestOpts, ak as CommandConnectOpts, t as CommandExitError, y as CommandHandle, aj as CommandRequestOpts, u as CommandResult, al as CommandStartOpts, am as Commands, C as ConnectionConfig, a as ConnectionOpts, bn as Context, b7 as CopyItem, bp as CreateCodeContextOpts, E as EntryInfo, bu as Execution, bs as ExecutionError, F as FileNotFoundError, l as FileType, i as FileUploadError, m as Filesystem, r as FilesystemEvent, q as FilesystemEventType, o as FilesystemReadOpts, n as FilesystemWriteOpts, b8 as GetBuildStatusOptions, ao as Git, au as GitAddOpts, G as GitAuthError, aB as GitBranches, aq as GitCloneOpts, at as GitCommitOpts, az as GitConfigOpts, aA as GitConfigScope, ay as GitDangerouslyAuthenticateOpts, av as GitDeleteBranchOpts, aC as GitFileStatus, ar as GitInitOpts, ax as GitPullOpts, aw as GitPushOpts, as as GitRemoteAddOpts, ap as GitRequestOpts, aD as GitStatus, d as GitUpstreamError, aV as ImageConfig, I as InvalidArgumentError, bE as LineChart, aQ as LogEntry, aS as LogEntryEnd, aT as LogEntryLevel, aR as LogEntryStart, L as Logger, br as Logs, bv as MIMEType, ag as McpServer, b9 as McpServerName, N as NotEnoughSpaceError, e as NotFoundError, bx as OutputMessage, P as PPIO, bI as PieChart, bJ as PieData, bL as PointData, ai as ProcessInfo, an as Pty, x as PtyOutput, R as RateLimitError, bw as RawData, aK as ReadyCmd, aW as RegistryCredentials, bt as Result, bo as RunCodeOpts, J as SandboxApiOpts, M as SandboxBetaCreateOpts, Q as SandboxCloneOpts, X as SandboxCloneResult, Y as SandboxCommitOpts, Z as SandboxCommitResult, K as SandboxConnectOpts, f as SandboxError, ad as SandboxEventItem, ae as SandboxEventsOpts, af as SandboxEventsResult, z as SandboxInfo, a5 as SandboxInfoLifecycle, a4 as SandboxLifecycle, a0 as SandboxListOpts, D as SandboxMetrics, O as SandboxMetricsOpts, a2 as SandboxNetworkOpts, a3 as SandboxNetworkUpdateOpts, g as SandboxNotFoundError, H as SandboxOpts, a1 as SandboxPaginator, a9 as SandboxQuota, aa as SandboxQuotaLimit, ac as SandboxQuotaOpts, ab as SandboxQuotaUsage, _ as SandboxResetOpts, $ as SandboxState, by as ScaleType, bF as ScatterChart, aH as Secret, aI as SecretBinding, j as SecretError, aJ as SecretWriteParams, a6 as SnapshotInfo, a7 as SnapshotListOpts, a8 as SnapshotPaginator, w as Stderr, v as Stdout, bK as SuperChart, b3 as Template, b0 as TemplateApi, b2 as TemplateBase, bb as TemplateBuildStatus, bc as TemplateBuildStatusResponse, ba as TemplateBuilder, bd as TemplateClass, be as TemplateDeleteOpts, T as TemplateError, bf as TemplateInfo, bh as TemplateListOptions, bg as TemplateListOpts, bi as TemplateListResponse, b1 as TemplatePaginator, bj as TemplateTag, bk as TemplateTagInfo, bl as TemplateType, h as TimeoutError, U as Username, aE as Volume, aG as VolumeAndToken, V as VolumeError, aF as VolumeInfo, s as WatchHandle, W as WriteInfo, aX as clearImageConfigCache, c as components, aU as defaultBuildLogger, aY as effectiveStartCmd, aZ as fetchImageConfig, k as getSignature, a_ as parseImageRef, p as paths, a$ as unsupportedBase, aO as waitForFile, aL as waitForPort, aN as waitForProcess, aP as waitForTimeout, aM as waitForURL } from './index-CRwaZUdl.mjs';
|
|
3
3
|
import 'openapi-fetch';
|
|
4
|
+
import 'node:fs';
|
|
4
5
|
import '@connectrpc/connect';
|
|
5
6
|
import '@bufbuild/protobuf/codegenv2';
|
|
6
7
|
import '@bufbuild/protobuf';
|
|
7
|
-
import 'node:fs';
|
|
8
|
-
|
|
9
|
-
declare enum ChartType {
|
|
10
|
-
LINE = "line",
|
|
11
|
-
SCATTER = "scatter",
|
|
12
|
-
BAR = "bar",
|
|
13
|
-
PIE = "pie",
|
|
14
|
-
BOX_AND_WHISKER = "box_and_whisker",
|
|
15
|
-
SUPERCHART = "superchart",
|
|
16
|
-
UNKNOWN = "unknown"
|
|
17
|
-
}
|
|
18
|
-
declare enum ScaleType {
|
|
19
|
-
LINEAR = "linear",
|
|
20
|
-
DATETIME = "datetime",
|
|
21
|
-
CATEGORICAL = "categorical",
|
|
22
|
-
LOG = "log",
|
|
23
|
-
SYMLOG = "symlog",
|
|
24
|
-
LOGIT = "logit",
|
|
25
|
-
FUNCTION = "function",
|
|
26
|
-
FUNCTIONLOG = "functionlog",
|
|
27
|
-
ASINH = "asinh"
|
|
28
|
-
}
|
|
29
|
-
type Chart = {
|
|
30
|
-
type: ChartType;
|
|
31
|
-
title: string;
|
|
32
|
-
elements: any[];
|
|
33
|
-
};
|
|
34
|
-
type Chart2D = Chart & {
|
|
35
|
-
x_label?: string;
|
|
36
|
-
y_label?: string;
|
|
37
|
-
x_unit?: string;
|
|
38
|
-
y_unit?: string;
|
|
39
|
-
};
|
|
40
|
-
type PointData = {
|
|
41
|
-
label: string;
|
|
42
|
-
points: [number | string, number | string][];
|
|
43
|
-
};
|
|
44
|
-
type PointChart = Chart2D & {
|
|
45
|
-
x_ticks: (number | string)[];
|
|
46
|
-
x_scale: ScaleType;
|
|
47
|
-
x_tick_labels: string[];
|
|
48
|
-
y_ticks: (number | string)[];
|
|
49
|
-
y_scale: ScaleType;
|
|
50
|
-
y_tick_labels: string[];
|
|
51
|
-
elements: PointData[];
|
|
52
|
-
};
|
|
53
|
-
type LineChart = PointChart & {
|
|
54
|
-
type: ChartType.LINE;
|
|
55
|
-
};
|
|
56
|
-
type ScatterChart = PointChart & {
|
|
57
|
-
type: ChartType.SCATTER;
|
|
58
|
-
};
|
|
59
|
-
type BarData = {
|
|
60
|
-
label: string;
|
|
61
|
-
value: string;
|
|
62
|
-
group: string;
|
|
63
|
-
};
|
|
64
|
-
type BarChart = Chart2D & {
|
|
65
|
-
type: ChartType.BAR;
|
|
66
|
-
elements: BarData[];
|
|
67
|
-
};
|
|
68
|
-
type PieData = {
|
|
69
|
-
label: string;
|
|
70
|
-
angle: number;
|
|
71
|
-
radius: number;
|
|
72
|
-
};
|
|
73
|
-
type PieChart = Chart & {
|
|
74
|
-
type: ChartType.PIE;
|
|
75
|
-
elements: PieData[];
|
|
76
|
-
};
|
|
77
|
-
type BoxAndWhiskerData = {
|
|
78
|
-
label: string;
|
|
79
|
-
min: number;
|
|
80
|
-
first_quartile: number;
|
|
81
|
-
median: number;
|
|
82
|
-
third_quartile: number;
|
|
83
|
-
max: number;
|
|
84
|
-
outliers: number[];
|
|
85
|
-
};
|
|
86
|
-
type BoxAndWhiskerChart = Chart2D & {
|
|
87
|
-
type: ChartType.BOX_AND_WHISKER;
|
|
88
|
-
elements: BoxAndWhiskerData[];
|
|
89
|
-
};
|
|
90
|
-
type SuperChart = Chart & {
|
|
91
|
-
type: ChartType.SUPERCHART;
|
|
92
|
-
elements: Chart[];
|
|
93
|
-
};
|
|
94
|
-
type ChartTypes = LineChart | ScatterChart | BarChart | PieChart | BoxAndWhiskerChart | SuperChart;
|
|
95
8
|
|
|
96
|
-
declare class OutputMessage {
|
|
97
|
-
readonly line: string;
|
|
98
|
-
readonly timestamp: number;
|
|
99
|
-
readonly error: boolean;
|
|
100
|
-
constructor(line: string, timestamp: number, error: boolean);
|
|
101
|
-
toString(): string;
|
|
102
|
-
}
|
|
103
|
-
declare class ExecutionError {
|
|
104
|
-
name: string;
|
|
105
|
-
value: string;
|
|
106
|
-
traceback: string;
|
|
107
|
-
constructor(name: string, value: string, traceback: string);
|
|
108
|
-
}
|
|
109
|
-
type MIMEType = string;
|
|
110
|
-
type PPIOSandboxData = {
|
|
111
|
-
data: Record<string, unknown>;
|
|
112
|
-
chart: ChartTypes;
|
|
113
|
-
};
|
|
114
|
-
type RawData = {
|
|
115
|
-
[key: MIMEType]: string;
|
|
116
|
-
} & PPIOSandboxData;
|
|
117
|
-
declare class Result {
|
|
118
|
-
readonly isMainResult: boolean;
|
|
119
|
-
readonly text?: string;
|
|
120
|
-
readonly html?: string;
|
|
121
|
-
readonly markdown?: string;
|
|
122
|
-
readonly svg?: string;
|
|
123
|
-
readonly png?: string;
|
|
124
|
-
readonly jpeg?: string;
|
|
125
|
-
readonly pdf?: string;
|
|
126
|
-
readonly latex?: string;
|
|
127
|
-
readonly json?: string;
|
|
128
|
-
readonly javascript?: string;
|
|
129
|
-
readonly data?: Record<string, unknown>;
|
|
130
|
-
readonly chart?: ChartTypes;
|
|
131
|
-
readonly extra?: any;
|
|
132
|
-
readonly raw: RawData;
|
|
133
|
-
constructor(rawData: RawData, isMainResult: boolean);
|
|
134
|
-
formats(): string[];
|
|
135
|
-
toJSON(): {
|
|
136
|
-
extra?: any;
|
|
137
|
-
text: string | undefined;
|
|
138
|
-
html: string | undefined;
|
|
139
|
-
markdown: string | undefined;
|
|
140
|
-
svg: string | undefined;
|
|
141
|
-
png: string | undefined;
|
|
142
|
-
jpeg: string | undefined;
|
|
143
|
-
pdf: string | undefined;
|
|
144
|
-
latex: string | undefined;
|
|
145
|
-
json: string | undefined;
|
|
146
|
-
javascript: string | undefined;
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
type Logs = {
|
|
150
|
-
stdout: string[];
|
|
151
|
-
stderr: string[];
|
|
152
|
-
};
|
|
153
|
-
declare class Execution {
|
|
154
|
-
results: Result[];
|
|
155
|
-
logs: Logs;
|
|
156
|
-
error?: ExecutionError | undefined;
|
|
157
|
-
executionCount?: number | undefined;
|
|
158
|
-
constructor(results?: Result[], logs?: Logs, error?: ExecutionError | undefined, executionCount?: number | undefined);
|
|
159
|
-
get text(): string | undefined;
|
|
160
|
-
toJSON(): {
|
|
161
|
-
results: Result[];
|
|
162
|
-
logs: Logs;
|
|
163
|
-
error: ExecutionError | undefined;
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
9
|
|
|
167
|
-
type Context = {
|
|
168
|
-
id: string;
|
|
169
|
-
language: string;
|
|
170
|
-
cwd: string;
|
|
171
|
-
};
|
|
172
|
-
interface RunCodeOpts {
|
|
173
|
-
onStdout?: (output: OutputMessage) => Promise<any> | any;
|
|
174
|
-
onStderr?: (output: OutputMessage) => Promise<any> | any;
|
|
175
|
-
onResult?: (data: Result) => Promise<any> | any;
|
|
176
|
-
onError?: (error: ExecutionError) => Promise<any> | any;
|
|
177
|
-
envs?: Record<string, string>;
|
|
178
|
-
timeoutMs?: number;
|
|
179
|
-
requestTimeoutMs?: number;
|
|
180
|
-
}
|
|
181
|
-
interface CreateCodeContextOpts {
|
|
182
|
-
cwd?: string;
|
|
183
|
-
language?: string;
|
|
184
|
-
requestTimeoutMs?: number;
|
|
185
|
-
}
|
|
186
|
-
interface CodeContextRequestOpts {
|
|
187
|
-
requestTimeoutMs?: number;
|
|
188
|
-
}
|
|
189
|
-
declare class Sandbox extends Sandbox$1 {
|
|
190
|
-
protected static readonly defaultTemplate: string;
|
|
191
|
-
runCode(code: string, opts?: RunCodeOpts & {
|
|
192
|
-
language?: 'python';
|
|
193
|
-
}): Promise<Execution>;
|
|
194
|
-
runCode(code: string, opts?: RunCodeOpts & {
|
|
195
|
-
language?: string;
|
|
196
|
-
}): Promise<Execution>;
|
|
197
|
-
runCode(code: string, opts?: RunCodeOpts & {
|
|
198
|
-
context?: Context;
|
|
199
|
-
}): Promise<Execution>;
|
|
200
|
-
createCodeContext(opts?: CreateCodeContextOpts): Promise<Context>;
|
|
201
|
-
listCodeContexts(opts?: CodeContextRequestOpts): Promise<Context[]>;
|
|
202
|
-
removeCodeContext(context: Context | string, opts?: CodeContextRequestOpts): Promise<void>;
|
|
203
|
-
restartCodeContext(context: Context | string, opts?: CodeContextRequestOpts): Promise<void>;
|
|
204
|
-
deleteCodeContext(context: Context | string, opts?: CodeContextRequestOpts): Promise<void>;
|
|
205
|
-
private get jupyterHeaders();
|
|
206
|
-
protected get jupyterUrl(): string;
|
|
207
|
-
}
|
|
208
10
|
|
|
209
|
-
export {
|
|
11
|
+
export { Sandbox, Sandbox as default };
|
|
@@ -1,209 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { bm as Sandbox } from './index-CRwaZUdl.js';
|
|
2
|
+
export { ah as ALL_TRAFFIC, A as ApiClient, b as AuthenticationError, bC as BarChart, bD as BarData, bG as BoxAndWhiskerChart, bH as BoxAndWhiskerData, B as BuildError, b4 as BuildInfo, b5 as BuildOptions, b6 as BuildStatusReason, bB as Chart, bz as ChartType, bA as ChartTypes, bq as CodeContextRequestOpts, ak as CommandConnectOpts, t as CommandExitError, y as CommandHandle, aj as CommandRequestOpts, u as CommandResult, al as CommandStartOpts, am as Commands, C as ConnectionConfig, a as ConnectionOpts, bn as Context, b7 as CopyItem, bp as CreateCodeContextOpts, E as EntryInfo, bu as Execution, bs as ExecutionError, F as FileNotFoundError, l as FileType, i as FileUploadError, m as Filesystem, r as FilesystemEvent, q as FilesystemEventType, o as FilesystemReadOpts, n as FilesystemWriteOpts, b8 as GetBuildStatusOptions, ao as Git, au as GitAddOpts, G as GitAuthError, aB as GitBranches, aq as GitCloneOpts, at as GitCommitOpts, az as GitConfigOpts, aA as GitConfigScope, ay as GitDangerouslyAuthenticateOpts, av as GitDeleteBranchOpts, aC as GitFileStatus, ar as GitInitOpts, ax as GitPullOpts, aw as GitPushOpts, as as GitRemoteAddOpts, ap as GitRequestOpts, aD as GitStatus, d as GitUpstreamError, aV as ImageConfig, I as InvalidArgumentError, bE as LineChart, aQ as LogEntry, aS as LogEntryEnd, aT as LogEntryLevel, aR as LogEntryStart, L as Logger, br as Logs, bv as MIMEType, ag as McpServer, b9 as McpServerName, N as NotEnoughSpaceError, e as NotFoundError, bx as OutputMessage, P as PPIO, bI as PieChart, bJ as PieData, bL as PointData, ai as ProcessInfo, an as Pty, x as PtyOutput, R as RateLimitError, bw as RawData, aK as ReadyCmd, aW as RegistryCredentials, bt as Result, bo as RunCodeOpts, J as SandboxApiOpts, M as SandboxBetaCreateOpts, Q as SandboxCloneOpts, X as SandboxCloneResult, Y as SandboxCommitOpts, Z as SandboxCommitResult, K as SandboxConnectOpts, f as SandboxError, ad as SandboxEventItem, ae as SandboxEventsOpts, af as SandboxEventsResult, z as SandboxInfo, a5 as SandboxInfoLifecycle, a4 as SandboxLifecycle, a0 as SandboxListOpts, D as SandboxMetrics, O as SandboxMetricsOpts, a2 as SandboxNetworkOpts, a3 as SandboxNetworkUpdateOpts, g as SandboxNotFoundError, H as SandboxOpts, a1 as SandboxPaginator, a9 as SandboxQuota, aa as SandboxQuotaLimit, ac as SandboxQuotaOpts, ab as SandboxQuotaUsage, _ as SandboxResetOpts, $ as SandboxState, by as ScaleType, bF as ScatterChart, aH as Secret, aI as SecretBinding, j as SecretError, aJ as SecretWriteParams, a6 as SnapshotInfo, a7 as SnapshotListOpts, a8 as SnapshotPaginator, w as Stderr, v as Stdout, bK as SuperChart, b3 as Template, b0 as TemplateApi, b2 as TemplateBase, bb as TemplateBuildStatus, bc as TemplateBuildStatusResponse, ba as TemplateBuilder, bd as TemplateClass, be as TemplateDeleteOpts, T as TemplateError, bf as TemplateInfo, bh as TemplateListOptions, bg as TemplateListOpts, bi as TemplateListResponse, b1 as TemplatePaginator, bj as TemplateTag, bk as TemplateTagInfo, bl as TemplateType, h as TimeoutError, U as Username, aE as Volume, aG as VolumeAndToken, V as VolumeError, aF as VolumeInfo, s as WatchHandle, W as WriteInfo, aX as clearImageConfigCache, c as components, aU as defaultBuildLogger, aY as effectiveStartCmd, aZ as fetchImageConfig, k as getSignature, a_ as parseImageRef, p as paths, a$ as unsupportedBase, aO as waitForFile, aL as waitForPort, aN as waitForProcess, aP as waitForTimeout, aM as waitForURL } from './index-CRwaZUdl.js';
|
|
3
3
|
import 'openapi-fetch';
|
|
4
|
+
import 'node:fs';
|
|
4
5
|
import '@connectrpc/connect';
|
|
5
6
|
import '@bufbuild/protobuf/codegenv2';
|
|
6
7
|
import '@bufbuild/protobuf';
|
|
7
|
-
import 'node:fs';
|
|
8
|
-
|
|
9
|
-
declare enum ChartType {
|
|
10
|
-
LINE = "line",
|
|
11
|
-
SCATTER = "scatter",
|
|
12
|
-
BAR = "bar",
|
|
13
|
-
PIE = "pie",
|
|
14
|
-
BOX_AND_WHISKER = "box_and_whisker",
|
|
15
|
-
SUPERCHART = "superchart",
|
|
16
|
-
UNKNOWN = "unknown"
|
|
17
|
-
}
|
|
18
|
-
declare enum ScaleType {
|
|
19
|
-
LINEAR = "linear",
|
|
20
|
-
DATETIME = "datetime",
|
|
21
|
-
CATEGORICAL = "categorical",
|
|
22
|
-
LOG = "log",
|
|
23
|
-
SYMLOG = "symlog",
|
|
24
|
-
LOGIT = "logit",
|
|
25
|
-
FUNCTION = "function",
|
|
26
|
-
FUNCTIONLOG = "functionlog",
|
|
27
|
-
ASINH = "asinh"
|
|
28
|
-
}
|
|
29
|
-
type Chart = {
|
|
30
|
-
type: ChartType;
|
|
31
|
-
title: string;
|
|
32
|
-
elements: any[];
|
|
33
|
-
};
|
|
34
|
-
type Chart2D = Chart & {
|
|
35
|
-
x_label?: string;
|
|
36
|
-
y_label?: string;
|
|
37
|
-
x_unit?: string;
|
|
38
|
-
y_unit?: string;
|
|
39
|
-
};
|
|
40
|
-
type PointData = {
|
|
41
|
-
label: string;
|
|
42
|
-
points: [number | string, number | string][];
|
|
43
|
-
};
|
|
44
|
-
type PointChart = Chart2D & {
|
|
45
|
-
x_ticks: (number | string)[];
|
|
46
|
-
x_scale: ScaleType;
|
|
47
|
-
x_tick_labels: string[];
|
|
48
|
-
y_ticks: (number | string)[];
|
|
49
|
-
y_scale: ScaleType;
|
|
50
|
-
y_tick_labels: string[];
|
|
51
|
-
elements: PointData[];
|
|
52
|
-
};
|
|
53
|
-
type LineChart = PointChart & {
|
|
54
|
-
type: ChartType.LINE;
|
|
55
|
-
};
|
|
56
|
-
type ScatterChart = PointChart & {
|
|
57
|
-
type: ChartType.SCATTER;
|
|
58
|
-
};
|
|
59
|
-
type BarData = {
|
|
60
|
-
label: string;
|
|
61
|
-
value: string;
|
|
62
|
-
group: string;
|
|
63
|
-
};
|
|
64
|
-
type BarChart = Chart2D & {
|
|
65
|
-
type: ChartType.BAR;
|
|
66
|
-
elements: BarData[];
|
|
67
|
-
};
|
|
68
|
-
type PieData = {
|
|
69
|
-
label: string;
|
|
70
|
-
angle: number;
|
|
71
|
-
radius: number;
|
|
72
|
-
};
|
|
73
|
-
type PieChart = Chart & {
|
|
74
|
-
type: ChartType.PIE;
|
|
75
|
-
elements: PieData[];
|
|
76
|
-
};
|
|
77
|
-
type BoxAndWhiskerData = {
|
|
78
|
-
label: string;
|
|
79
|
-
min: number;
|
|
80
|
-
first_quartile: number;
|
|
81
|
-
median: number;
|
|
82
|
-
third_quartile: number;
|
|
83
|
-
max: number;
|
|
84
|
-
outliers: number[];
|
|
85
|
-
};
|
|
86
|
-
type BoxAndWhiskerChart = Chart2D & {
|
|
87
|
-
type: ChartType.BOX_AND_WHISKER;
|
|
88
|
-
elements: BoxAndWhiskerData[];
|
|
89
|
-
};
|
|
90
|
-
type SuperChart = Chart & {
|
|
91
|
-
type: ChartType.SUPERCHART;
|
|
92
|
-
elements: Chart[];
|
|
93
|
-
};
|
|
94
|
-
type ChartTypes = LineChart | ScatterChart | BarChart | PieChart | BoxAndWhiskerChart | SuperChart;
|
|
95
8
|
|
|
96
|
-
declare class OutputMessage {
|
|
97
|
-
readonly line: string;
|
|
98
|
-
readonly timestamp: number;
|
|
99
|
-
readonly error: boolean;
|
|
100
|
-
constructor(line: string, timestamp: number, error: boolean);
|
|
101
|
-
toString(): string;
|
|
102
|
-
}
|
|
103
|
-
declare class ExecutionError {
|
|
104
|
-
name: string;
|
|
105
|
-
value: string;
|
|
106
|
-
traceback: string;
|
|
107
|
-
constructor(name: string, value: string, traceback: string);
|
|
108
|
-
}
|
|
109
|
-
type MIMEType = string;
|
|
110
|
-
type PPIOSandboxData = {
|
|
111
|
-
data: Record<string, unknown>;
|
|
112
|
-
chart: ChartTypes;
|
|
113
|
-
};
|
|
114
|
-
type RawData = {
|
|
115
|
-
[key: MIMEType]: string;
|
|
116
|
-
} & PPIOSandboxData;
|
|
117
|
-
declare class Result {
|
|
118
|
-
readonly isMainResult: boolean;
|
|
119
|
-
readonly text?: string;
|
|
120
|
-
readonly html?: string;
|
|
121
|
-
readonly markdown?: string;
|
|
122
|
-
readonly svg?: string;
|
|
123
|
-
readonly png?: string;
|
|
124
|
-
readonly jpeg?: string;
|
|
125
|
-
readonly pdf?: string;
|
|
126
|
-
readonly latex?: string;
|
|
127
|
-
readonly json?: string;
|
|
128
|
-
readonly javascript?: string;
|
|
129
|
-
readonly data?: Record<string, unknown>;
|
|
130
|
-
readonly chart?: ChartTypes;
|
|
131
|
-
readonly extra?: any;
|
|
132
|
-
readonly raw: RawData;
|
|
133
|
-
constructor(rawData: RawData, isMainResult: boolean);
|
|
134
|
-
formats(): string[];
|
|
135
|
-
toJSON(): {
|
|
136
|
-
extra?: any;
|
|
137
|
-
text: string | undefined;
|
|
138
|
-
html: string | undefined;
|
|
139
|
-
markdown: string | undefined;
|
|
140
|
-
svg: string | undefined;
|
|
141
|
-
png: string | undefined;
|
|
142
|
-
jpeg: string | undefined;
|
|
143
|
-
pdf: string | undefined;
|
|
144
|
-
latex: string | undefined;
|
|
145
|
-
json: string | undefined;
|
|
146
|
-
javascript: string | undefined;
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
type Logs = {
|
|
150
|
-
stdout: string[];
|
|
151
|
-
stderr: string[];
|
|
152
|
-
};
|
|
153
|
-
declare class Execution {
|
|
154
|
-
results: Result[];
|
|
155
|
-
logs: Logs;
|
|
156
|
-
error?: ExecutionError | undefined;
|
|
157
|
-
executionCount?: number | undefined;
|
|
158
|
-
constructor(results?: Result[], logs?: Logs, error?: ExecutionError | undefined, executionCount?: number | undefined);
|
|
159
|
-
get text(): string | undefined;
|
|
160
|
-
toJSON(): {
|
|
161
|
-
results: Result[];
|
|
162
|
-
logs: Logs;
|
|
163
|
-
error: ExecutionError | undefined;
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
9
|
|
|
167
|
-
type Context = {
|
|
168
|
-
id: string;
|
|
169
|
-
language: string;
|
|
170
|
-
cwd: string;
|
|
171
|
-
};
|
|
172
|
-
interface RunCodeOpts {
|
|
173
|
-
onStdout?: (output: OutputMessage) => Promise<any> | any;
|
|
174
|
-
onStderr?: (output: OutputMessage) => Promise<any> | any;
|
|
175
|
-
onResult?: (data: Result) => Promise<any> | any;
|
|
176
|
-
onError?: (error: ExecutionError) => Promise<any> | any;
|
|
177
|
-
envs?: Record<string, string>;
|
|
178
|
-
timeoutMs?: number;
|
|
179
|
-
requestTimeoutMs?: number;
|
|
180
|
-
}
|
|
181
|
-
interface CreateCodeContextOpts {
|
|
182
|
-
cwd?: string;
|
|
183
|
-
language?: string;
|
|
184
|
-
requestTimeoutMs?: number;
|
|
185
|
-
}
|
|
186
|
-
interface CodeContextRequestOpts {
|
|
187
|
-
requestTimeoutMs?: number;
|
|
188
|
-
}
|
|
189
|
-
declare class Sandbox extends Sandbox$1 {
|
|
190
|
-
protected static readonly defaultTemplate: string;
|
|
191
|
-
runCode(code: string, opts?: RunCodeOpts & {
|
|
192
|
-
language?: 'python';
|
|
193
|
-
}): Promise<Execution>;
|
|
194
|
-
runCode(code: string, opts?: RunCodeOpts & {
|
|
195
|
-
language?: string;
|
|
196
|
-
}): Promise<Execution>;
|
|
197
|
-
runCode(code: string, opts?: RunCodeOpts & {
|
|
198
|
-
context?: Context;
|
|
199
|
-
}): Promise<Execution>;
|
|
200
|
-
createCodeContext(opts?: CreateCodeContextOpts): Promise<Context>;
|
|
201
|
-
listCodeContexts(opts?: CodeContextRequestOpts): Promise<Context[]>;
|
|
202
|
-
removeCodeContext(context: Context | string, opts?: CodeContextRequestOpts): Promise<void>;
|
|
203
|
-
restartCodeContext(context: Context | string, opts?: CodeContextRequestOpts): Promise<void>;
|
|
204
|
-
deleteCodeContext(context: Context | string, opts?: CodeContextRequestOpts): Promise<void>;
|
|
205
|
-
private get jupyterHeaders();
|
|
206
|
-
protected get jupyterUrl(): string;
|
|
207
|
-
}
|
|
208
10
|
|
|
209
|
-
export {
|
|
11
|
+
export { Sandbox, Sandbox as default };
|