@dcasegr/skein 0.0.0-stage → 0.1.2
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 +525 -2
- package/bin/skein-host.js +22 -0
- package/bin/skein.js +8 -0
- package/dist/client/admin-cli.d.ts +10 -0
- package/dist/client/admin-cli.js +370 -0
- package/dist/client/admin.d.ts +139 -0
- package/dist/client/admin.js +256 -0
- package/dist/client/bundle.d.ts +9 -0
- package/dist/client/bundle.js +34 -0
- package/dist/client/cli.d.ts +44 -0
- package/dist/client/cli.js +306 -0
- package/dist/client/client.d.ts +161 -0
- package/dist/client/client.js +237 -0
- package/dist/client/config.d.ts +18 -0
- package/dist/client/config.js +31 -0
- package/dist/client/conversation.d.ts +62 -0
- package/dist/client/conversation.js +113 -0
- package/dist/client/raw.d.ts +94 -0
- package/dist/client/raw.js +154 -0
- package/dist/client/target.d.ts +34 -0
- package/dist/client/target.js +158 -0
- package/dist/dev/cli.d.ts +8 -0
- package/dist/dev/cli.js +248 -0
- package/dist/dev/scan.d.ts +15 -0
- package/dist/dev/scan.js +173 -0
- package/dist/envelope-cbor.d.ts +110 -0
- package/dist/envelope-cbor.js +160 -0
- package/dist/envelope.d.ts +38 -0
- package/dist/envelope.js +101 -0
- package/dist/host/arc.d.ts +131 -0
- package/dist/host/arc.js +425 -0
- package/dist/host/billing.d.ts +102 -0
- package/dist/host/billing.js +167 -0
- package/dist/host/boot.d.ts +246 -0
- package/dist/host/boot.js +643 -0
- package/dist/host/cli.d.ts +57 -0
- package/dist/host/cli.js +1253 -0
- package/dist/host/clock.d.ts +3 -0
- package/dist/host/clock.js +8 -0
- package/dist/host/control.d.ts +45 -0
- package/dist/host/control.js +170 -0
- package/dist/host/cron.d.ts +99 -0
- package/dist/host/cron.js +196 -0
- package/dist/host/deliver.d.ts +53 -0
- package/dist/host/deliver.js +251 -0
- package/dist/host/deploy.d.ts +29 -0
- package/dist/host/deploy.js +55 -0
- package/dist/host/door-answer.d.ts +24 -0
- package/dist/host/door-answer.js +21 -0
- package/dist/host/events.d.ts +89 -0
- package/dist/host/events.js +222 -0
- package/dist/host/fake-arcade.d.ts +40 -0
- package/dist/host/fake-arcade.js +149 -0
- package/dist/host/fake-discovery.d.ts +4 -0
- package/dist/host/fake-discovery.js +58 -0
- package/dist/host/feeds.d.ts +127 -0
- package/dist/host/feeds.js +422 -0
- package/dist/host/frontdoor.d.ts +92 -0
- package/dist/host/frontdoor.js +172 -0
- package/dist/host/genesis.d.ts +259 -0
- package/dist/host/genesis.js +353 -0
- package/dist/host/handles.d.ts +40 -0
- package/dist/host/handles.js +88 -0
- package/dist/host/hostenv.d.ts +30 -0
- package/dist/host/hostenv.js +83 -0
- package/dist/host/image-chain.d.ts +127 -0
- package/dist/host/image-chain.js +440 -0
- package/dist/host/install.d.ts +22 -0
- package/dist/host/install.js +139 -0
- package/dist/host/instances.d.ts +227 -0
- package/dist/host/instances.js +430 -0
- package/dist/host/kernel.d.ts +246 -0
- package/dist/host/kernel.js +603 -0
- package/dist/host/liveness.d.ts +65 -0
- package/dist/host/liveness.js +155 -0
- package/dist/host/manifest.d.ts +160 -0
- package/dist/host/manifest.js +597 -0
- package/dist/host/p2p.d.ts +337 -0
- package/dist/host/p2p.js +1002 -0
- package/dist/host/packet.d.ts +121 -0
- package/dist/host/packet.js +562 -0
- package/dist/host/plan.d.ts +154 -0
- package/dist/host/plan.js +418 -0
- package/dist/host/providers.d.ts +238 -0
- package/dist/host/providers.js +565 -0
- package/dist/host/roster.d.ts +72 -0
- package/dist/host/roster.js +172 -0
- package/dist/host/router.d.ts +782 -0
- package/dist/host/router.js +2411 -0
- package/dist/host/signer.d.ts +49 -0
- package/dist/host/signer.js +167 -0
- package/dist/host/store-sqlite.d.ts +39 -0
- package/dist/host/store-sqlite.js +170 -0
- package/dist/host/stores.d.ts +43 -0
- package/dist/host/stores.js +342 -0
- package/dist/host/sync.d.ts +121 -0
- package/dist/host/sync.js +467 -0
- package/dist/host/testbeef.d.ts +21 -0
- package/dist/host/testbeef.js +37 -0
- package/dist/host/testhost.d.ts +149 -0
- package/dist/host/testhost.js +211 -0
- package/dist/host/vcdiff.d.ts +9 -0
- package/dist/host/vcdiff.js +210 -0
- package/dist/host/wasm-kernel.d.ts +87 -0
- package/dist/host/wasm-kernel.js +296 -0
- package/dist/host/wasm-worker.d.ts +1 -0
- package/dist/host/wasm-worker.js +186 -0
- package/dist/peers/cron.d.ts +33 -0
- package/dist/peers/cron.js +75 -0
- package/dist/peers/infer-main.d.ts +2 -0
- package/dist/peers/infer-main.js +74 -0
- package/dist/peers/infer.d.ts +163 -0
- package/dist/peers/infer.js +367 -0
- package/dist/runtime/beef.d.ts +28 -0
- package/dist/runtime/beef.js +107 -0
- package/dist/runtime/bitcoin.d.ts +36 -0
- package/dist/runtime/bitcoin.js +141 -0
- package/dist/runtime/cid.d.ts +14 -0
- package/dist/runtime/cid.js +51 -0
- package/dist/runtime/dispatch.d.ts +92 -0
- package/dist/runtime/dispatch.js +142 -0
- package/dist/runtime/envelope.d.ts +60 -0
- package/dist/runtime/envelope.js +101 -0
- package/dist/runtime/heads.d.ts +25 -0
- package/dist/runtime/heads.js +37 -0
- package/dist/runtime/identity.d.ts +28 -0
- package/dist/runtime/identity.js +67 -0
- package/dist/runtime/index-store.d.ts +152 -0
- package/dist/runtime/index-store.js +715 -0
- package/dist/runtime/log.d.ts +62 -0
- package/dist/runtime/log.js +104 -0
- package/dist/runtime/programs.d.ts +30 -0
- package/dist/runtime/programs.js +61 -0
- package/dist/runtime/records.d.ts +135 -0
- package/dist/runtime/records.js +149 -0
- package/dist/runtime/sqlite.d.ts +33 -0
- package/dist/runtime/sqlite.js +604 -0
- package/dist/runtime/store.d.ts +141 -0
- package/dist/runtime/store.js +24 -0
- package/dist/runtime/syscalls.d.ts +9 -0
- package/dist/runtime/syscalls.js +41 -0
- package/dist/runtime/tree.d.ts +60 -0
- package/dist/runtime/tree.js +196 -0
- package/dist/runtime/types.d.ts +100 -0
- package/dist/runtime/types.js +7 -0
- package/dist/testapps.d.ts +101 -0
- package/dist/testapps.js +275 -0
- package/dist/testkit.d.ts +25 -0
- package/dist/testkit.js +48 -0
- package/dist/wallet.d.ts +35 -0
- package/dist/wallet.js +87 -0
- package/images/README.md +68 -0
- package/images/default/README.md +38 -0
- package/images/default/bin/frontdoor.cid +1 -0
- package/images/default/bin/frontdoor.json +5 -0
- package/images/default/bin/messagebox.cid +1 -0
- package/images/default/bin/messagebox.json +8 -0
- package/images/default/bin/wallet.cid +1 -0
- package/images/default/bin/wallet.json +14 -0
- package/images/default/etc/config.json +1 -0
- package/images/default/etc/dispatch.json +82 -0
- package/images/host/etc/apps.json +8 -0
- package/kernel-zig/README.md +1247 -0
- package/kernel-zig/web/client.js +65 -0
- package/kernel-zig/web/kernel.d.ts +59 -0
- package/kernel-zig/web/kernel.js +329 -0
- package/kernel-zig/web/store.js +67 -0
- package/kernel-zig/web/worker.js +79 -0
- package/kernel-zig/zig-out/web/skein-kernel.wasm +0 -0
- package/package.json +77 -4
- package/wasm/README.md +35 -0
- package/wasm/frontdoor.wasm +0 -0
- package/wasm/messagebox.wasm +0 -0
- package/wasm/resolve.wasm +0 -0
- package/wasm/wallet.wasm +0 -0
- package/wasm/wire-probe.wasm +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env -S node --experimental-strip-types --no-warnings
|
|
2
|
+
import { DEFAULT_IMAGE } from "./boot.ts";
|
|
3
|
+
import type { Server } from "node:http";
|
|
4
|
+
import type { Store } from "../runtime/store.ts";
|
|
5
|
+
import { homeOf as homeOfVars } from "./hostenv.ts";
|
|
6
|
+
import { Router, type RouterOptions } from "./router.ts";
|
|
7
|
+
import { HostDb, type InstanceRow } from "./instances.ts";
|
|
8
|
+
export interface Env {
|
|
9
|
+
vars: Record<string, string | undefined>;
|
|
10
|
+
out(line: string): void;
|
|
11
|
+
err(line: string): void;
|
|
12
|
+
/** Tests: a row's store, instead of opening its file read-only. */
|
|
13
|
+
store?(row: InstanceRow): Store | undefined;
|
|
14
|
+
}
|
|
15
|
+
export declare const homeOf: typeof homeOfVars;
|
|
16
|
+
export declare function main(argv: string[], given: Env): Promise<number>;
|
|
17
|
+
/** The network the whole host runs on (SKEIN_NETWORK, default main): a network fact, written as every genesis's `defaults.walletNetwork`. */
|
|
18
|
+
export declare const NETWORKS: readonly ["main", "test", "regtest"];
|
|
19
|
+
export declare function hostNetwork(v: Env["vars"]): string;
|
|
20
|
+
/**
|
|
21
|
+
* An instance's origin here (router.ts originOf): its front door, its
|
|
22
|
+
* messagebox — SKEIN_INSTANCE_ORIGIN (default http://{handle}.localhost:{port})
|
|
23
|
+
* on SKEIN_ROUTER_PORT (default 8100).
|
|
24
|
+
*/
|
|
25
|
+
export declare function originOf(vars: Env["vars"], handle: string): string;
|
|
26
|
+
/** The onboarding app's config at the host skein's birth (#142), from the settings: domain, origin, name, note. */
|
|
27
|
+
export declare function onboardConfig(v: Env["vars"]): Record<string, Record<string, unknown>>;
|
|
28
|
+
export interface RunOptions {
|
|
29
|
+
/** The router's options beyond what the environment gives (tests). */
|
|
30
|
+
router?: Partial<RouterOptions>;
|
|
31
|
+
/** false: no host skein on the first run (tests that make their own). */
|
|
32
|
+
firstRun?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface Host {
|
|
35
|
+
router: Router;
|
|
36
|
+
/** The messagebox (router) port and the host page's. */
|
|
37
|
+
messagebox?: number;
|
|
38
|
+
server?: Server;
|
|
39
|
+
port?: number;
|
|
40
|
+
stop(): Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
/** The default image (#89): one genesis for everyone, no owner in it, a claim row (boot.ts). */
|
|
43
|
+
export { DEFAULT_IMAGE };
|
|
44
|
+
/**
|
|
45
|
+
* `skein-host run`: the router (router.ts) on SKEIN_ROUTER_PORT (default
|
|
46
|
+
* 8100, the messagebox URL clients already use), every enabled row hydrated
|
|
47
|
+
* once at start (stopped only past SKEIN_IDLE_MS), and the host page and roster on
|
|
48
|
+
* SKEIN_HOST_PORT. A skein's explorer is its own (`/explore`, its owner's),
|
|
49
|
+
* read by the management site (shruggr/skein-site, #92).
|
|
50
|
+
*/
|
|
51
|
+
export declare function runHost(db: HostDb, env: Env, o?: RunOptions): Promise<Host>;
|
|
52
|
+
/**
|
|
53
|
+
* The host's SQLite database for new instances (the settled split, 2026-10-31): SKEIN_STORE_SQLITE, else
|
|
54
|
+
* $SKEIN_HOME/store.sqlite when this installation has no native kernel binary (the npm package ships the
|
|
55
|
+
* wasm kernel only) and no other shared store is named; else none (a native kernel per instance store).
|
|
56
|
+
*/
|
|
57
|
+
export declare function sqliteStoreOf(v: Record<string, string | undefined>, home: string): string | undefined;
|