@dcasegr/skein 0.0.0-stage → 0.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.
Files changed (176) hide show
  1. package/README.md +522 -2
  2. package/bin/skein-host.js +22 -0
  3. package/bin/skein.js +8 -0
  4. package/dist/client/admin-cli.d.ts +10 -0
  5. package/dist/client/admin-cli.js +370 -0
  6. package/dist/client/admin.d.ts +139 -0
  7. package/dist/client/admin.js +256 -0
  8. package/dist/client/bundle.d.ts +9 -0
  9. package/dist/client/bundle.js +34 -0
  10. package/dist/client/cli.d.ts +44 -0
  11. package/dist/client/cli.js +306 -0
  12. package/dist/client/client.d.ts +161 -0
  13. package/dist/client/client.js +237 -0
  14. package/dist/client/config.d.ts +18 -0
  15. package/dist/client/config.js +31 -0
  16. package/dist/client/conversation.d.ts +62 -0
  17. package/dist/client/conversation.js +113 -0
  18. package/dist/client/raw.d.ts +94 -0
  19. package/dist/client/raw.js +154 -0
  20. package/dist/client/target.d.ts +34 -0
  21. package/dist/client/target.js +158 -0
  22. package/dist/dev/cli.d.ts +8 -0
  23. package/dist/dev/cli.js +248 -0
  24. package/dist/dev/scan.d.ts +15 -0
  25. package/dist/dev/scan.js +173 -0
  26. package/dist/envelope-cbor.d.ts +110 -0
  27. package/dist/envelope-cbor.js +160 -0
  28. package/dist/envelope.d.ts +38 -0
  29. package/dist/envelope.js +101 -0
  30. package/dist/host/arc.d.ts +131 -0
  31. package/dist/host/arc.js +425 -0
  32. package/dist/host/billing.d.ts +102 -0
  33. package/dist/host/billing.js +167 -0
  34. package/dist/host/boot.d.ts +246 -0
  35. package/dist/host/boot.js +643 -0
  36. package/dist/host/cli.d.ts +57 -0
  37. package/dist/host/cli.js +1253 -0
  38. package/dist/host/clock.d.ts +3 -0
  39. package/dist/host/clock.js +8 -0
  40. package/dist/host/control.d.ts +45 -0
  41. package/dist/host/control.js +170 -0
  42. package/dist/host/cron.d.ts +99 -0
  43. package/dist/host/cron.js +196 -0
  44. package/dist/host/deliver.d.ts +53 -0
  45. package/dist/host/deliver.js +251 -0
  46. package/dist/host/deploy.d.ts +29 -0
  47. package/dist/host/deploy.js +55 -0
  48. package/dist/host/door-answer.d.ts +24 -0
  49. package/dist/host/door-answer.js +21 -0
  50. package/dist/host/events.d.ts +89 -0
  51. package/dist/host/events.js +222 -0
  52. package/dist/host/fake-arcade.d.ts +40 -0
  53. package/dist/host/fake-arcade.js +149 -0
  54. package/dist/host/fake-discovery.d.ts +4 -0
  55. package/dist/host/fake-discovery.js +58 -0
  56. package/dist/host/feeds.d.ts +127 -0
  57. package/dist/host/feeds.js +422 -0
  58. package/dist/host/frontdoor.d.ts +92 -0
  59. package/dist/host/frontdoor.js +172 -0
  60. package/dist/host/genesis.d.ts +259 -0
  61. package/dist/host/genesis.js +353 -0
  62. package/dist/host/handles.d.ts +40 -0
  63. package/dist/host/handles.js +88 -0
  64. package/dist/host/hostenv.d.ts +30 -0
  65. package/dist/host/hostenv.js +83 -0
  66. package/dist/host/image-chain.d.ts +127 -0
  67. package/dist/host/image-chain.js +440 -0
  68. package/dist/host/install.d.ts +22 -0
  69. package/dist/host/install.js +139 -0
  70. package/dist/host/instances.d.ts +227 -0
  71. package/dist/host/instances.js +430 -0
  72. package/dist/host/kernel.d.ts +246 -0
  73. package/dist/host/kernel.js +603 -0
  74. package/dist/host/liveness.d.ts +65 -0
  75. package/dist/host/liveness.js +155 -0
  76. package/dist/host/manifest.d.ts +160 -0
  77. package/dist/host/manifest.js +597 -0
  78. package/dist/host/p2p.d.ts +337 -0
  79. package/dist/host/p2p.js +1002 -0
  80. package/dist/host/packet.d.ts +121 -0
  81. package/dist/host/packet.js +562 -0
  82. package/dist/host/plan.d.ts +154 -0
  83. package/dist/host/plan.js +418 -0
  84. package/dist/host/providers.d.ts +238 -0
  85. package/dist/host/providers.js +565 -0
  86. package/dist/host/roster.d.ts +72 -0
  87. package/dist/host/roster.js +172 -0
  88. package/dist/host/router.d.ts +773 -0
  89. package/dist/host/router.js +2389 -0
  90. package/dist/host/signer.d.ts +49 -0
  91. package/dist/host/signer.js +167 -0
  92. package/dist/host/store-sqlite.d.ts +39 -0
  93. package/dist/host/store-sqlite.js +170 -0
  94. package/dist/host/stores.d.ts +43 -0
  95. package/dist/host/stores.js +342 -0
  96. package/dist/host/sync.d.ts +121 -0
  97. package/dist/host/sync.js +467 -0
  98. package/dist/host/testbeef.d.ts +21 -0
  99. package/dist/host/testbeef.js +37 -0
  100. package/dist/host/testhost.d.ts +149 -0
  101. package/dist/host/testhost.js +211 -0
  102. package/dist/host/vcdiff.d.ts +9 -0
  103. package/dist/host/vcdiff.js +210 -0
  104. package/dist/host/wasm-kernel.d.ts +87 -0
  105. package/dist/host/wasm-kernel.js +296 -0
  106. package/dist/host/wasm-worker.d.ts +1 -0
  107. package/dist/host/wasm-worker.js +186 -0
  108. package/dist/peers/cron.d.ts +33 -0
  109. package/dist/peers/cron.js +75 -0
  110. package/dist/peers/infer-main.d.ts +2 -0
  111. package/dist/peers/infer-main.js +74 -0
  112. package/dist/peers/infer.d.ts +163 -0
  113. package/dist/peers/infer.js +367 -0
  114. package/dist/runtime/beef.d.ts +28 -0
  115. package/dist/runtime/beef.js +107 -0
  116. package/dist/runtime/bitcoin.d.ts +36 -0
  117. package/dist/runtime/bitcoin.js +141 -0
  118. package/dist/runtime/cid.d.ts +14 -0
  119. package/dist/runtime/cid.js +51 -0
  120. package/dist/runtime/dispatch.d.ts +92 -0
  121. package/dist/runtime/dispatch.js +142 -0
  122. package/dist/runtime/envelope.d.ts +60 -0
  123. package/dist/runtime/envelope.js +101 -0
  124. package/dist/runtime/heads.d.ts +25 -0
  125. package/dist/runtime/heads.js +37 -0
  126. package/dist/runtime/identity.d.ts +28 -0
  127. package/dist/runtime/identity.js +67 -0
  128. package/dist/runtime/index-store.d.ts +152 -0
  129. package/dist/runtime/index-store.js +715 -0
  130. package/dist/runtime/log.d.ts +62 -0
  131. package/dist/runtime/log.js +104 -0
  132. package/dist/runtime/programs.d.ts +30 -0
  133. package/dist/runtime/programs.js +61 -0
  134. package/dist/runtime/records.d.ts +135 -0
  135. package/dist/runtime/records.js +149 -0
  136. package/dist/runtime/sqlite.d.ts +33 -0
  137. package/dist/runtime/sqlite.js +604 -0
  138. package/dist/runtime/store.d.ts +141 -0
  139. package/dist/runtime/store.js +24 -0
  140. package/dist/runtime/syscalls.d.ts +9 -0
  141. package/dist/runtime/syscalls.js +41 -0
  142. package/dist/runtime/tree.d.ts +60 -0
  143. package/dist/runtime/tree.js +196 -0
  144. package/dist/runtime/types.d.ts +100 -0
  145. package/dist/runtime/types.js +7 -0
  146. package/dist/testapps.d.ts +101 -0
  147. package/dist/testapps.js +275 -0
  148. package/dist/testkit.d.ts +25 -0
  149. package/dist/testkit.js +48 -0
  150. package/dist/wallet.d.ts +35 -0
  151. package/dist/wallet.js +87 -0
  152. package/images/README.md +68 -0
  153. package/images/default/README.md +38 -0
  154. package/images/default/bin/frontdoor.cid +1 -0
  155. package/images/default/bin/frontdoor.json +5 -0
  156. package/images/default/bin/messagebox.cid +1 -0
  157. package/images/default/bin/messagebox.json +8 -0
  158. package/images/default/bin/wallet.cid +1 -0
  159. package/images/default/bin/wallet.json +14 -0
  160. package/images/default/etc/config.json +1 -0
  161. package/images/default/etc/dispatch.json +82 -0
  162. package/images/host/etc/apps.json +8 -0
  163. package/kernel-zig/README.md +1247 -0
  164. package/kernel-zig/web/client.js +65 -0
  165. package/kernel-zig/web/kernel.d.ts +59 -0
  166. package/kernel-zig/web/kernel.js +329 -0
  167. package/kernel-zig/web/store.js +67 -0
  168. package/kernel-zig/web/worker.js +79 -0
  169. package/kernel-zig/zig-out/web/skein-kernel.wasm +0 -0
  170. package/package.json +77 -4
  171. package/wasm/README.md +35 -0
  172. package/wasm/frontdoor.wasm +0 -0
  173. package/wasm/messagebox.wasm +0 -0
  174. package/wasm/resolve.wasm +0 -0
  175. package/wasm/wallet.wasm +0 -0
  176. package/wasm/wire-probe.wasm +0 -0
@@ -0,0 +1,38 @@
1
+ # The default image
2
+
3
+ One genesis for everyone, with no root in it (#89, #143). It has the front
4
+ door, the messagebox, the wallet (#116, #130), the admin routes (root's:
5
+ nobody holds root yet) and the claim route, open: the first claim's sender
6
+ is granted root (#127: never a key in its body) — the claimant's own
7
+ message, or a claim signed before the instance existed, which the host
8
+ forwards into it — and the claim route is removed. **It has no apps**
9
+ (#152): root installs them by message after the claim (`skein install
10
+ <dir>`), and a reinstall of a newer version keeps the app's state (docs/APPS.md,
11
+ "Reconfiguration"). Nothing is served at `/` until root routes it.
12
+ docs/BOOTSTRAP.md, "The default image".
13
+
14
+ - `bin/frontdoor.cid`, `bin/messagebox.cid`: the kernel's pinned modules
15
+ (`wasm/`), by CID; `scripts/pin-programs.sh` keeps them current.
16
+ - `bin/wallet.cid`, `bin/wallet.json` (#116, #130): the wallet — core, in
17
+ every skein — the same program record as src/runtime/programs.ts
18
+ `WALLET`: a skein made from the image pays its host from it (docs/VM.md
19
+ "Billing").
20
+ - `etc/dispatch.json` (#143: routes, no senders): the claim route, `:ack`
21
+ (an event route), the handshake route, the messagebox's http routes and
22
+ the explorer behind `kernel.brc104` (the explorer gated by root: every
23
+ genesis's `roles`). No route to the wallet: root funds the skein by the
24
+ wallet's `internalize` message on a route of its own (docs/WALLET.md).
25
+ - `etc/config.json`: `{collect: []}`.
26
+ - `chain/` (#132): **not in the repo** — the host adds it. The image a
27
+ host boots skeins from is this directory with the whole header chain at
28
+ `chain/headers/<first>` (2016 raw headers a block) and `chain/tip`, grown
29
+ with every header the host receives (src/host/image-chain.ts; host.db
30
+ `image`, `image_chain`, `image_blocks`), so a skein is born with the
31
+ chain up to the current tip, for the chain app to read once root installs
32
+ it. From then on the host pushes it its headers feed (the chain app's
33
+ event row), first the headers between its tip and the host's.
34
+ docs/BOOTSTRAP.md, "The image's chain part".
35
+
36
+ The host skein boots from the host image: `images/host` merged over this
37
+ one, its `etc/apps.json` naming shruggr/skein-onboard v0.4.0 by its release
38
+ tarball (images/README.md).
@@ -0,0 +1 @@
1
+ bafkreicakz7f6hjd6jh2ldecvaw3duqib2fsziuco7mebmuicugtxdf5zq
@@ -0,0 +1,5 @@
1
+ {
2
+ "inputs": {},
3
+ "services": [],
4
+ "description": "The front door (#68): the instance's middleware, stepped on every request a transport carries in (http: BRC-103/104 against its session records, head frontdoor/sessions; libp2p: the GossipSub signature; local: a provider's signed message), routed by the kernel's dispatch rows for its transport, the handler an in-VM call, the answer signed on the session. Called (fn read) for a route whose answer is a read of live state."
5
+ }
@@ -0,0 +1 @@
1
+ bafkreihbdgqextmp444phd4h6vpngwkekmefo3m3pqa43sos765oltbgae
@@ -0,0 +1,8 @@
1
+ {
2
+ "inputs": {
3
+ "box": "string?",
4
+ "event": "cid?"
5
+ },
6
+ "services": [],
7
+ "description": "The BRC-33 messagebox (#40): the front door's sendMessage (one `mail` entry), listMessages (a read), acknowledgeMessage (an `ack` event); stepped, keeps the mail a subscription routes to it (head `mailbox`); launched as a message's delivery thread (#70), emits the `deliver` intention (#157), which the host carries over BRC-103/104, and is stepped by its answer."
8
+ }
@@ -0,0 +1 @@
1
+ bafkreifmo2fz45wn3vukhcf226bpnfh6klu7w5m43of76mx6olgghnzqkq
@@ -0,0 +1,14 @@
1
+ {
2
+ "inputs": {
3
+ "envelope": "cid",
4
+ "body": "cid",
5
+ "box": "string",
6
+ "sender": "identity",
7
+ "event": "cid"
8
+ },
9
+ "services": [
10
+ "wallet",
11
+ "http"
12
+ ],
13
+ "description": "The wallet (#29, #79, #116: core): its own records under wallet/ over the chain app's chain/state. A message's body {op: internalize|createAction|signAction|list, …} (BRC-100's; every transaction ingested at the chain app); the kernel's pay step, args {pay: {to, x, checkpoint}} (#130: X sats, or all it has if less, to the host, the state record committed in a 0-sat OP_RETURN output, emitted as the event `payment`). Prints the result record's CID."
14
+ }
@@ -0,0 +1 @@
1
+ { "collect": [] }
@@ -0,0 +1,82 @@
1
+ [
2
+ {
3
+ "address": "claim",
4
+ "program": "kernel",
5
+ "fn": "claim"
6
+ },
7
+ {
8
+ "transport": "event",
9
+ "address": ":ack",
10
+ "program": "messagebox"
11
+ },
12
+ {
13
+ "transport": "http",
14
+ "address": "/.well-known/auth",
15
+ "program": "frontdoor",
16
+ "fn": "handshake"
17
+ },
18
+ {
19
+ "transport": "http",
20
+ "address": "/sendMessage",
21
+ "filters": [
22
+ "kernel.brc104"
23
+ ],
24
+ "program": "messagebox",
25
+ "fn": "sendMessage"
26
+ },
27
+ {
28
+ "transport": "http",
29
+ "address": "/listMessages",
30
+ "filters": [
31
+ "kernel.brc104"
32
+ ],
33
+ "program": "messagebox",
34
+ "fn": "listMessages"
35
+ },
36
+ {
37
+ "transport": "http",
38
+ "address": "/acknowledgeMessage",
39
+ "filters": [
40
+ "kernel.brc104"
41
+ ],
42
+ "program": "messagebox",
43
+ "fn": "acknowledgeMessage"
44
+ },
45
+ {
46
+ "transport": "http",
47
+ "address": "/messagebox/sendMessage",
48
+ "filters": [
49
+ "kernel.brc104"
50
+ ],
51
+ "program": "messagebox",
52
+ "fn": "sendMessage"
53
+ },
54
+ {
55
+ "transport": "http",
56
+ "address": "/messagebox/listMessages",
57
+ "filters": [
58
+ "kernel.brc104"
59
+ ],
60
+ "program": "messagebox",
61
+ "fn": "listMessages"
62
+ },
63
+ {
64
+ "transport": "http",
65
+ "address": "/messagebox/acknowledgeMessage",
66
+ "filters": [
67
+ "kernel.brc104"
68
+ ],
69
+ "program": "messagebox",
70
+ "fn": "acknowledgeMessage"
71
+ },
72
+ {
73
+ "transport": "http",
74
+ "address": "/explore",
75
+ "prefix": true,
76
+ "filters": [
77
+ "kernel.brc104"
78
+ ],
79
+ "program": "frontdoor",
80
+ "fn": "explore"
81
+ }
82
+ ]
@@ -0,0 +1,8 @@
1
+ {
2
+ "install": [
3
+ {
4
+ "url": "https://github.com/shruggr/skein-onboard/archive/refs/tags/v0.4.0.tar.gz",
5
+ "hash": "ba29f99adb0d2d1849aa7f0cf72ceeefde88c5ae"
6
+ }
7
+ ]
8
+ }