@ai-ecoverse/slicc-kernel 1.185.0 → 1.186.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/README.md +25 -0
- package/dist/async-process.js +1 -1
- package/dist/cloudflare-sources.js +1 -1
- package/dist/cloudflare.js +7 -4
- package/dist/cloudflare.js.map +3 -3
- package/dist/kernel-worker.js +5 -4
- package/dist/kernel-worker.js.map +3 -3
- package/dist/node-process-worker.cjs +1 -1
- package/dist/node-process-worker.js +1 -1
- package/dist/node.js +5 -4
- package/dist/node.js.map +3 -3
- package/dist/process-worker.js +1 -1
- package/dist/types/cloudflare.d.ts +5 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -304,6 +304,7 @@ The Worker needs a Worker Loader binding (`worker_loaders`) and a SQLite-backed
|
|
|
304
304
|
| `root`, `meta`, `ranged` | `memoryRoot()` | a root of your own in place of `sql` |
|
|
305
305
|
| `clock` | none | called before every timed wait; pass a call into the Durable Object's own namespace, as above. Without it, `sleep` and timeouts can end early |
|
|
306
306
|
| `isolates` | `{ max: 8, waitMs: 10000, memory: 64 MiB, perInstance: 8 MiB }` | how many Dynamic Workers run at once, how long a spawn waits for one, and the memory budget per Dynamic Worker |
|
|
307
|
+
| `commands` | none | `{ append }`: more command roots, as for `createKernel`; one can be a mount (see [A file system the Durable Object serves](#a-file-system-the-durable-object-serves)) |
|
|
307
308
|
| `network` | none | `{ transport, tlsEngine, uplink, doh }`: the transport programs reach the outside world through, and the TLS engine for their `https://` requests (see [The network](#the-network-in-a-durable-object)) |
|
|
308
309
|
|
|
309
310
|
**How it works.** Workers has no `Worker`, refuses `Atomics.wait`, and does not share memory between isolates, so a process cannot block the way it does in a page. Here a process is a wasm instance in a Dynamic Worker, parked with JSPI (`WebAssembly.Suspending`) while its system call is answered by the Durable Object over Workers RPC.
|
|
@@ -353,6 +354,30 @@ await kernel.run(['curl', '-sS', 'https://example.com/']);
|
|
|
353
354
|
- **How `compiledTlsEngine(factory, module)` works:** the package's glue only instantiates from bytes. So while the engine loads, `WebAssembly.instantiate` answers that one call, which it knows by the bytes the glue was given, with an instance of `module`. Every other call goes to the real function, and the real function is back in place once the engine has loaded or failed.
|
|
354
355
|
- **The option is `() => Promise<TlsEngineModule>`**, asked at the first `CONNECT` and once per kernel, so any other way of loading the engine works too.
|
|
355
356
|
|
|
357
|
+
#### A file system the Durable Object serves
|
|
358
|
+
|
|
359
|
+
A package driver runs in a worker of its own, which a Durable Object does not have. `inProcessMount(spec, driver)` mounts a file system whose handlers run in the Durable Object itself, with the same [handlers and capabilities](#mounts) as a package driver:
|
|
360
|
+
|
|
361
|
+
```js
|
|
362
|
+
import { fsError, inProcessMount } from '@ai-ecoverse/slicc-kernel/cloudflare';
|
|
363
|
+
|
|
364
|
+
const kernel = await createCloudflareKernel({
|
|
365
|
+
loader: env.LOADER,
|
|
366
|
+
commands: { append: ['/image/node_modules'] },
|
|
367
|
+
});
|
|
368
|
+
await kernel.mount(
|
|
369
|
+
inProcessMount(
|
|
370
|
+
{ type: 'image', source: 'tools', target: '/image', options: { ro: '' } },
|
|
371
|
+
{ handlers, capabilities: { readonly: true, ranges: true } }
|
|
372
|
+
)
|
|
373
|
+
);
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
- **Programs on a mount:** a mount under an appended command root (`commands.append`) provides commands as `/node_modules` does, so a kernel can run programs it never copied into its own root: from R2, from the Worker's own modules, or from memory. The kernel reads a program's file when it first runs it.
|
|
377
|
+
- **The mount point** has to exist: `attachKernel(await kernel.connect()).fs.mkdir(target)` makes it, with its parents.
|
|
378
|
+
- **`driver`** is `{ handlers, capabilities?, served? }`. `served` is called once with `{ invalidate(paths) }`, for a driver whose files change outside the kernel.
|
|
379
|
+
- **Limits:** the handlers share the Durable Object's thread with the kernel, so a slow handler holds up every process. A handler that does not answer within 30 s fails its call with `EIO`, as any driver's does.
|
|
380
|
+
|
|
356
381
|
Measured on a deployed Worker, from a client about 40 ms away, next to local `wrangler dev`:
|
|
357
382
|
|
|
358
383
|
| | `wrangler dev` | deployed |
|
package/dist/async-process.js
CHANGED
|
@@ -1337,7 +1337,7 @@ function createParentRefreshCount() {
|
|
|
1337
1337
|
}
|
|
1338
1338
|
|
|
1339
1339
|
// src/version.ts
|
|
1340
|
-
var KERNEL_VERSION = true ? "1.
|
|
1340
|
+
var KERNEL_VERSION = true ? "1.186.0" : "0.0.0-dev";
|
|
1341
1341
|
var OS_RELEASE = "6.0.0-slicc";
|
|
1342
1342
|
function procVersion() {
|
|
1343
1343
|
return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
|