@computesdk/kosa8 1.0.3 → 1.0.5
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/README.md +20 -4
- package/dist/index.d.mts +117 -11
- package/dist/index.d.ts +117 -11
- package/dist/index.js +668 -47
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +657 -48
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -50,7 +50,17 @@ console.log((await sandbox.runCommand('sh /tmp/hello.sh')).stdout); // "42\n"
|
|
|
50
50
|
await sandbox.pause();
|
|
51
51
|
await sandbox.resume();
|
|
52
52
|
|
|
53
|
+
// Snapshot: memory (running processes) and disk, saved while the sandbox keeps running.
|
|
54
|
+
// Each restore is a new sandbox that starts exactly where the snapshot was taken.
|
|
55
|
+
const snap = await sdk.snapshot.create(sandbox.sandboxId);
|
|
53
56
|
await sandbox.destroy();
|
|
57
|
+
const clone = await sdk.sandbox.create({ snapshotId: snap.id });
|
|
58
|
+
await clone.destroy();
|
|
59
|
+
await sdk.snapshot.delete(snap.id);
|
|
60
|
+
|
|
61
|
+
// Boot an OCI image (a VM of its own, 2 vCPU / 4 GiB by default)
|
|
62
|
+
const py = await sdk.sandbox.create({ image: 'python:3.12-slim' });
|
|
63
|
+
await py.destroy();
|
|
54
64
|
```
|
|
55
65
|
|
|
56
66
|
## Configuration
|
|
@@ -76,14 +86,18 @@ interface Kosa8Config {
|
|
|
76
86
|
| `region` | `region` | A region id such as `eu-hel1`. |
|
|
77
87
|
| `timeout` (ms) | `ttl_s` | The sandbox is deleted when its lifetime ends. Rounded up to whole seconds; the API's minimum is 60 s and maximum 90 days. Without it, a sandbox lives until destroyed. |
|
|
78
88
|
| `sleepAfterSeconds` | `sleep_after_s` | Idle seconds before the sandbox sleeps; `0` never sleeps. |
|
|
89
|
+
| `image` | `image` | An OCI image reference such as `node:22`. The sandbox boots a VM of its own (2 vCPU / 4 GiB) from it, and `create` resolves once it runs. Needs a payment method on the organization. The configured default template does not apply. |
|
|
90
|
+
| `snapshotId` | `snapshot` | A snapshot from `snapshot.create()`. The new sandbox is restored from it, memory and disk, on the snapshot's host, and takes its template, size and image from it, so `templateId`, `image` and `region` are refused with it. |
|
|
79
91
|
|
|
80
|
-
`cpu`, `memory`, disk sizes, `
|
|
92
|
+
`cpu`, `memory`, disk sizes, `envs` and `volumes` are rejected with an error rather than ignored: a sandbox's size comes from its template or image. Pass environment variables per command with `runCommand(cmd, { env })`.
|
|
81
93
|
|
|
82
94
|
## Features
|
|
83
95
|
|
|
84
96
|
- **Command execution** with `cwd`, `env`, `timeout` and background commands
|
|
85
|
-
- **Filesystem**: read, write, list, mkdir, exists and remove,
|
|
86
|
-
- **
|
|
97
|
+
- **Filesystem**: read, write, list, mkdir, exists and remove, at any absolute path. File content is sent as raw bytes straight to the sandbox's host when its direct token covers files, and otherwise through the API's file stream. A file up to 64 MiB is one request; a larger one moves as 64 MiB parts in parallel (offset writes, ranged reads). On an older host without the file stream, `/workspace` files go through its file API and other paths over exec. `list`, `mkdir`, `exists` and `remove` are shell commands over exec.
|
|
98
|
+
- **Command output**: `runCommand` results also carry `truncated`, `stdoutTruncated`, `stderrTruncated`, `stdoutBytes` and `stderrBytes` when the API reports them, so output cut off at the API's limit is not mistaken for the whole.
|
|
99
|
+
- **Snapshots**: `snapshot.create(sandboxId)` saves the sandbox's memory and disk while it keeps running; `sandbox.create({ snapshotId })` restores it, as many times as you like, including after the source is destroyed. `snapshot.list()` and `snapshot.delete(id)` manage them.
|
|
100
|
+
- **Pause and resume**: `pause()` puts the sandbox to sleep (memory and disk are snapshotted, its RAM is freed) and `resume()` wakes it. A command or file call sent to a sleeping sandbox also wakes it, so `getInfo()` reports a sleeping sandbox as `running`.
|
|
87
101
|
- **Lifetime**: `extendLifetime(ms)` moves the delete time of a sandbox created with `timeout`
|
|
88
102
|
- **Templates**: `template.list()` returns the templates your organization can start, with their size and regions
|
|
89
103
|
|
|
@@ -92,7 +106,9 @@ interface Kosa8Config {
|
|
|
92
106
|
- `getUrl()` (port URLs) is not supported yet and throws.
|
|
93
107
|
- Output is returned when the command finishes; there is no live streaming.
|
|
94
108
|
- `runCommand`'s `timeout` stops the command inside the sandbox with `timeout -s KILL` and reports exit code 124. On an image without the `timeout` utility, the command runs to completion.
|
|
95
|
-
- Templates are offered by kosa8's hosts, so `template.create()` and `template.delete()` throw.
|
|
109
|
+
- Templates are offered by kosa8's hosts, so `template.create()` and `template.delete()` throw.
|
|
110
|
+
- A snapshot is kept on the host its source ran on, and sandboxes restored from it are placed on that host.
|
|
111
|
+
- Volumes are not supported.
|
|
96
112
|
- Sandboxes created without `timeout` live until destroyed, so always call `destroy()` when you are done.
|
|
97
113
|
|
|
98
114
|
## Links
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
import * as computesdk from 'computesdk';
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import { RunCommandOptions, CommandResult, CreateInstanceOptions, SnapshotCapabilities } from '@computesdk/provider';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* File content for the kosa8 provider.
|
|
6
|
+
*
|
|
7
|
+
* kosa8's file stream takes and returns a file's raw bytes at any absolute path:
|
|
8
|
+
* `PUT`/`GET …/files?path=`, with `offset=` on a PUT (the rest of the file kept) and `Range` on a
|
|
9
|
+
* GET. It is reached two ways, tried in this order:
|
|
10
|
+
*
|
|
11
|
+
* 1. Straight on the sandbox's host, at the direct token's `files_url`, when the token covers files.
|
|
12
|
+
* This skips the API's Worker and Cloudflare's 100 MB request limit.
|
|
13
|
+
* 2. Through the API, `/v1/sandboxes/{id}/files`.
|
|
14
|
+
*
|
|
15
|
+
* A file of at most one part (64 MiB) is one request. A larger one is sent in parts to a
|
|
16
|
+
* temporary name beside it — the first part creates it, the rest are written at their offsets in
|
|
17
|
+
* parallel — and renamed over its path once every part landed, so a failed part leaves the file
|
|
18
|
+
* it replaces intact. It is read the same way, with ranges.
|
|
19
|
+
*
|
|
20
|
+
* An older host has the base64 file API instead: /workspace only, 8 MiB at most, no offsets. Its
|
|
21
|
+
* refusals (400 outside /workspace, 413, 501) send the file over exec instead, in base64 chunks.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
type ExecRunner = (sandbox: Kosa8Sandbox, command: string, options?: RunCommandOptions) => Promise<CommandResult>;
|
|
25
|
+
/**
|
|
26
|
+
* Base64 characters per write exec (the fallback for older hosts). The exec API caps each argv
|
|
27
|
+
* entry at 8192 characters, so content travels in an environment variable, which counts only toward
|
|
28
|
+
* the 64 KiB request body.
|
|
29
|
+
*/
|
|
30
|
+
declare const WRITE_CHUNK_CHARS: number;
|
|
31
|
+
/**
|
|
32
|
+
* Writes a file through exec (older hosts): base64 chunks into a temporary file beside it, then an
|
|
33
|
+
* atomic rename. One chunk is a single command.
|
|
34
|
+
*/
|
|
35
|
+
declare function writeFileViaExec(sandbox: Kosa8Sandbox, path: string, content: string | Uint8Array, run: ExecRunner): Promise<void>;
|
|
4
36
|
|
|
5
37
|
interface Kosa8Config {
|
|
6
38
|
/** kosa8 Cloud API key - if not provided, will fallback to KOSA8_API_KEY environment variable */
|
|
@@ -36,12 +68,84 @@ interface Kosa8Template {
|
|
|
36
68
|
regions: string[];
|
|
37
69
|
[key: string]: unknown;
|
|
38
70
|
}
|
|
71
|
+
/** The create answer's `direct` object: the host's exec endpoint for this sandbox and a token for it. */
|
|
72
|
+
interface Kosa8Direct {
|
|
73
|
+
exec_url: string;
|
|
74
|
+
/** The host's raw file endpoint for this sandbox, when the token also covers files (`files.direct`). */
|
|
75
|
+
files_url?: string;
|
|
76
|
+
token: string;
|
|
77
|
+
/** When the token stops working, ms since the epoch. */
|
|
78
|
+
expires_at: number;
|
|
79
|
+
}
|
|
39
80
|
interface Kosa8Sandbox {
|
|
40
81
|
id: string;
|
|
41
82
|
data: Kosa8SandboxData;
|
|
42
83
|
apiKey: string;
|
|
43
84
|
baseUrl: string;
|
|
85
|
+
/** Present while commands can go straight to the sandbox's host (runDirect). */
|
|
86
|
+
direct?: Kosa8Direct;
|
|
87
|
+
/** A fresh direct token being fetched (refreshDirect). */
|
|
88
|
+
refreshing?: Promise<void>;
|
|
89
|
+
/** False once the sandbox's host answered that it has no file API: files then go over exec. */
|
|
90
|
+
files?: boolean;
|
|
91
|
+
/** False once the host refused file requests with the direct token: files then go through the API. */
|
|
92
|
+
directFiles?: boolean;
|
|
44
93
|
}
|
|
94
|
+
/** A snapshot as the kosa8 Cloud API returns it. */
|
|
95
|
+
interface Kosa8SnapshotData {
|
|
96
|
+
id: string;
|
|
97
|
+
name: string | null;
|
|
98
|
+
state: string;
|
|
99
|
+
source_sandbox_id: string;
|
|
100
|
+
template: string;
|
|
101
|
+
cpus: number;
|
|
102
|
+
mem_mb: number;
|
|
103
|
+
image: string | null;
|
|
104
|
+
bytes: number;
|
|
105
|
+
region: string | null;
|
|
106
|
+
created_at: number;
|
|
107
|
+
[key: string]: unknown;
|
|
108
|
+
}
|
|
109
|
+
/** A snapshot as `provider.snapshot` returns it. */
|
|
110
|
+
interface Kosa8Snapshot {
|
|
111
|
+
id: string;
|
|
112
|
+
provider: 'kosa8';
|
|
113
|
+
createdAt: Date;
|
|
114
|
+
metadata: {
|
|
115
|
+
name: string | null;
|
|
116
|
+
sourceInstanceId: string;
|
|
117
|
+
state: string;
|
|
118
|
+
template: string;
|
|
119
|
+
cpus: number;
|
|
120
|
+
memMb: number;
|
|
121
|
+
image: string | null;
|
|
122
|
+
bytes: number;
|
|
123
|
+
region: string | null;
|
|
124
|
+
/** How long the host took to save it, when the API reports it. */
|
|
125
|
+
createMs?: number | null;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* A command's result. Beyond ComputeSDK's fields it says when the API returned only the first part
|
|
130
|
+
* of the output (its limit on a buffered command): `truncated`, per stream, and each stream's full
|
|
131
|
+
* length in bytes. These are absent when the API does not report them.
|
|
132
|
+
*/
|
|
133
|
+
interface Kosa8CommandResult extends CommandResult {
|
|
134
|
+
truncated?: boolean;
|
|
135
|
+
stdoutTruncated?: boolean;
|
|
136
|
+
stderrTruncated?: boolean;
|
|
137
|
+
stdoutBytes?: number;
|
|
138
|
+
stderrBytes?: number;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* The direct token and files URL for file requests, or null when files go through the API: no
|
|
142
|
+
* token, a host whose token does not cover files, one that refused it, or a token about to expire
|
|
143
|
+
* (renewed in the background, as for commands).
|
|
144
|
+
*/
|
|
145
|
+
declare function directFiles(sandbox: Kosa8Sandbox): {
|
|
146
|
+
url: string;
|
|
147
|
+
token: string;
|
|
148
|
+
} | null;
|
|
45
149
|
/** Maps ComputeSDK's create options onto the body of POST /v1/sandboxes. */
|
|
46
150
|
declare function createBody(config: Kosa8Config, options?: CreateInstanceOptions): Record<string, unknown>;
|
|
47
151
|
/** Builds the argv for POST /v1/sandboxes/{id}/exec from a shell command string. */
|
|
@@ -58,17 +162,19 @@ declare function execBody(command: string, options?: RunCommandOptions): {
|
|
|
58
162
|
cmd: string[];
|
|
59
163
|
env: string[];
|
|
60
164
|
};
|
|
61
|
-
type ExecRunner = (sandbox: Kosa8Sandbox, command: string, options?: RunCommandOptions) => Promise<CommandResult>;
|
|
62
165
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
166
|
+
* kosa8 snapshots save the whole VM, memory included, so a restore resumes running processes. The
|
|
167
|
+
* source keeps running, and one snapshot restores into any number of sandboxes, each copy-on-write
|
|
168
|
+
* on the snapshot's host. A snapshot is ready when `create` returns.
|
|
66
169
|
*/
|
|
67
|
-
declare const
|
|
68
|
-
|
|
69
|
-
declare function writeFileViaExec(sandbox: Kosa8Sandbox, path: string, content: string, run: ExecRunner): Promise<void>;
|
|
70
|
-
declare const kosa8: (config: Kosa8Config & _computesdk_provider.ProcessRuntimeOptions) => _computesdk_provider.Provider<Kosa8Sandbox, any, any, computesdk.Volume> & {
|
|
170
|
+
declare const SNAPSHOT_CAPABILITIES: SnapshotCapabilities;
|
|
171
|
+
declare const provider: (config: Kosa8Config & computesdk.ProcessRuntimeOptions) => computesdk.Provider<Kosa8Sandbox, any, any, computesdk.Volume> & {
|
|
71
172
|
readonly sizes: computesdk.InstanceSizeManager;
|
|
72
173
|
};
|
|
174
|
+
/**
|
|
175
|
+
* The kosa8 provider. Configuring it opens the HTTP/2 session to the API (transport.ts), so the
|
|
176
|
+
* first create does not pay the connection's handshake.
|
|
177
|
+
*/
|
|
178
|
+
declare const kosa8: typeof provider;
|
|
73
179
|
|
|
74
|
-
export { type Kosa8Config, type Kosa8Sandbox, type Kosa8SandboxData, type Kosa8Template, MAX_EXEC_BODY_BYTES, SCRIPT_ENV, WRITE_CHUNK_CHARS, createBody, kosa8 as default, execArgv, execBody, kosa8, writeFileViaExec };
|
|
180
|
+
export { type Kosa8CommandResult, type Kosa8Config, type Kosa8Direct, type Kosa8Sandbox, type Kosa8SandboxData, type Kosa8Snapshot, type Kosa8SnapshotData, type Kosa8Template, MAX_EXEC_BODY_BYTES, SCRIPT_ENV, SNAPSHOT_CAPABILITIES, WRITE_CHUNK_CHARS, createBody, kosa8 as default, directFiles, execArgv, execBody, kosa8, writeFileViaExec };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
import * as computesdk from 'computesdk';
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import { RunCommandOptions, CommandResult, CreateInstanceOptions, SnapshotCapabilities } from '@computesdk/provider';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* File content for the kosa8 provider.
|
|
6
|
+
*
|
|
7
|
+
* kosa8's file stream takes and returns a file's raw bytes at any absolute path:
|
|
8
|
+
* `PUT`/`GET …/files?path=`, with `offset=` on a PUT (the rest of the file kept) and `Range` on a
|
|
9
|
+
* GET. It is reached two ways, tried in this order:
|
|
10
|
+
*
|
|
11
|
+
* 1. Straight on the sandbox's host, at the direct token's `files_url`, when the token covers files.
|
|
12
|
+
* This skips the API's Worker and Cloudflare's 100 MB request limit.
|
|
13
|
+
* 2. Through the API, `/v1/sandboxes/{id}/files`.
|
|
14
|
+
*
|
|
15
|
+
* A file of at most one part (64 MiB) is one request. A larger one is sent in parts to a
|
|
16
|
+
* temporary name beside it — the first part creates it, the rest are written at their offsets in
|
|
17
|
+
* parallel — and renamed over its path once every part landed, so a failed part leaves the file
|
|
18
|
+
* it replaces intact. It is read the same way, with ranges.
|
|
19
|
+
*
|
|
20
|
+
* An older host has the base64 file API instead: /workspace only, 8 MiB at most, no offsets. Its
|
|
21
|
+
* refusals (400 outside /workspace, 413, 501) send the file over exec instead, in base64 chunks.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
type ExecRunner = (sandbox: Kosa8Sandbox, command: string, options?: RunCommandOptions) => Promise<CommandResult>;
|
|
25
|
+
/**
|
|
26
|
+
* Base64 characters per write exec (the fallback for older hosts). The exec API caps each argv
|
|
27
|
+
* entry at 8192 characters, so content travels in an environment variable, which counts only toward
|
|
28
|
+
* the 64 KiB request body.
|
|
29
|
+
*/
|
|
30
|
+
declare const WRITE_CHUNK_CHARS: number;
|
|
31
|
+
/**
|
|
32
|
+
* Writes a file through exec (older hosts): base64 chunks into a temporary file beside it, then an
|
|
33
|
+
* atomic rename. One chunk is a single command.
|
|
34
|
+
*/
|
|
35
|
+
declare function writeFileViaExec(sandbox: Kosa8Sandbox, path: string, content: string | Uint8Array, run: ExecRunner): Promise<void>;
|
|
4
36
|
|
|
5
37
|
interface Kosa8Config {
|
|
6
38
|
/** kosa8 Cloud API key - if not provided, will fallback to KOSA8_API_KEY environment variable */
|
|
@@ -36,12 +68,84 @@ interface Kosa8Template {
|
|
|
36
68
|
regions: string[];
|
|
37
69
|
[key: string]: unknown;
|
|
38
70
|
}
|
|
71
|
+
/** The create answer's `direct` object: the host's exec endpoint for this sandbox and a token for it. */
|
|
72
|
+
interface Kosa8Direct {
|
|
73
|
+
exec_url: string;
|
|
74
|
+
/** The host's raw file endpoint for this sandbox, when the token also covers files (`files.direct`). */
|
|
75
|
+
files_url?: string;
|
|
76
|
+
token: string;
|
|
77
|
+
/** When the token stops working, ms since the epoch. */
|
|
78
|
+
expires_at: number;
|
|
79
|
+
}
|
|
39
80
|
interface Kosa8Sandbox {
|
|
40
81
|
id: string;
|
|
41
82
|
data: Kosa8SandboxData;
|
|
42
83
|
apiKey: string;
|
|
43
84
|
baseUrl: string;
|
|
85
|
+
/** Present while commands can go straight to the sandbox's host (runDirect). */
|
|
86
|
+
direct?: Kosa8Direct;
|
|
87
|
+
/** A fresh direct token being fetched (refreshDirect). */
|
|
88
|
+
refreshing?: Promise<void>;
|
|
89
|
+
/** False once the sandbox's host answered that it has no file API: files then go over exec. */
|
|
90
|
+
files?: boolean;
|
|
91
|
+
/** False once the host refused file requests with the direct token: files then go through the API. */
|
|
92
|
+
directFiles?: boolean;
|
|
44
93
|
}
|
|
94
|
+
/** A snapshot as the kosa8 Cloud API returns it. */
|
|
95
|
+
interface Kosa8SnapshotData {
|
|
96
|
+
id: string;
|
|
97
|
+
name: string | null;
|
|
98
|
+
state: string;
|
|
99
|
+
source_sandbox_id: string;
|
|
100
|
+
template: string;
|
|
101
|
+
cpus: number;
|
|
102
|
+
mem_mb: number;
|
|
103
|
+
image: string | null;
|
|
104
|
+
bytes: number;
|
|
105
|
+
region: string | null;
|
|
106
|
+
created_at: number;
|
|
107
|
+
[key: string]: unknown;
|
|
108
|
+
}
|
|
109
|
+
/** A snapshot as `provider.snapshot` returns it. */
|
|
110
|
+
interface Kosa8Snapshot {
|
|
111
|
+
id: string;
|
|
112
|
+
provider: 'kosa8';
|
|
113
|
+
createdAt: Date;
|
|
114
|
+
metadata: {
|
|
115
|
+
name: string | null;
|
|
116
|
+
sourceInstanceId: string;
|
|
117
|
+
state: string;
|
|
118
|
+
template: string;
|
|
119
|
+
cpus: number;
|
|
120
|
+
memMb: number;
|
|
121
|
+
image: string | null;
|
|
122
|
+
bytes: number;
|
|
123
|
+
region: string | null;
|
|
124
|
+
/** How long the host took to save it, when the API reports it. */
|
|
125
|
+
createMs?: number | null;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* A command's result. Beyond ComputeSDK's fields it says when the API returned only the first part
|
|
130
|
+
* of the output (its limit on a buffered command): `truncated`, per stream, and each stream's full
|
|
131
|
+
* length in bytes. These are absent when the API does not report them.
|
|
132
|
+
*/
|
|
133
|
+
interface Kosa8CommandResult extends CommandResult {
|
|
134
|
+
truncated?: boolean;
|
|
135
|
+
stdoutTruncated?: boolean;
|
|
136
|
+
stderrTruncated?: boolean;
|
|
137
|
+
stdoutBytes?: number;
|
|
138
|
+
stderrBytes?: number;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* The direct token and files URL for file requests, or null when files go through the API: no
|
|
142
|
+
* token, a host whose token does not cover files, one that refused it, or a token about to expire
|
|
143
|
+
* (renewed in the background, as for commands).
|
|
144
|
+
*/
|
|
145
|
+
declare function directFiles(sandbox: Kosa8Sandbox): {
|
|
146
|
+
url: string;
|
|
147
|
+
token: string;
|
|
148
|
+
} | null;
|
|
45
149
|
/** Maps ComputeSDK's create options onto the body of POST /v1/sandboxes. */
|
|
46
150
|
declare function createBody(config: Kosa8Config, options?: CreateInstanceOptions): Record<string, unknown>;
|
|
47
151
|
/** Builds the argv for POST /v1/sandboxes/{id}/exec from a shell command string. */
|
|
@@ -58,17 +162,19 @@ declare function execBody(command: string, options?: RunCommandOptions): {
|
|
|
58
162
|
cmd: string[];
|
|
59
163
|
env: string[];
|
|
60
164
|
};
|
|
61
|
-
type ExecRunner = (sandbox: Kosa8Sandbox, command: string, options?: RunCommandOptions) => Promise<CommandResult>;
|
|
62
165
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
166
|
+
* kosa8 snapshots save the whole VM, memory included, so a restore resumes running processes. The
|
|
167
|
+
* source keeps running, and one snapshot restores into any number of sandboxes, each copy-on-write
|
|
168
|
+
* on the snapshot's host. A snapshot is ready when `create` returns.
|
|
66
169
|
*/
|
|
67
|
-
declare const
|
|
68
|
-
|
|
69
|
-
declare function writeFileViaExec(sandbox: Kosa8Sandbox, path: string, content: string, run: ExecRunner): Promise<void>;
|
|
70
|
-
declare const kosa8: (config: Kosa8Config & _computesdk_provider.ProcessRuntimeOptions) => _computesdk_provider.Provider<Kosa8Sandbox, any, any, computesdk.Volume> & {
|
|
170
|
+
declare const SNAPSHOT_CAPABILITIES: SnapshotCapabilities;
|
|
171
|
+
declare const provider: (config: Kosa8Config & computesdk.ProcessRuntimeOptions) => computesdk.Provider<Kosa8Sandbox, any, any, computesdk.Volume> & {
|
|
71
172
|
readonly sizes: computesdk.InstanceSizeManager;
|
|
72
173
|
};
|
|
174
|
+
/**
|
|
175
|
+
* The kosa8 provider. Configuring it opens the HTTP/2 session to the API (transport.ts), so the
|
|
176
|
+
* first create does not pay the connection's handshake.
|
|
177
|
+
*/
|
|
178
|
+
declare const kosa8: typeof provider;
|
|
73
179
|
|
|
74
|
-
export { type Kosa8Config, type Kosa8Sandbox, type Kosa8SandboxData, type Kosa8Template, MAX_EXEC_BODY_BYTES, SCRIPT_ENV, WRITE_CHUNK_CHARS, createBody, kosa8 as default, execArgv, execBody, kosa8, writeFileViaExec };
|
|
180
|
+
export { type Kosa8CommandResult, type Kosa8Config, type Kosa8Direct, type Kosa8Sandbox, type Kosa8SandboxData, type Kosa8Snapshot, type Kosa8SnapshotData, type Kosa8Template, MAX_EXEC_BODY_BYTES, SCRIPT_ENV, SNAPSHOT_CAPABILITIES, WRITE_CHUNK_CHARS, createBody, kosa8 as default, directFiles, execArgv, execBody, kosa8, writeFileViaExec };
|