@nervur-org/dock 0.3.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.
Files changed (285) hide show
  1. package/GETTING_STARTED.md +128 -0
  2. package/LICENSE +202 -0
  3. package/NOTICE +6 -0
  4. package/README.md +37 -0
  5. package/api/quo-api.md +196 -0
  6. package/api/route.ts +227 -0
  7. package/beings/GLOSSARY.md +118 -0
  8. package/beings/WORLDS.md +567 -0
  9. package/beings/avatar.ts +101 -0
  10. package/beings/carry.ts +159 -0
  11. package/beings/clock.ts +552 -0
  12. package/beings/courier.ts +107 -0
  13. package/beings/desk.ts +128 -0
  14. package/beings/doorbell.ts +129 -0
  15. package/beings/envoy.ts +218 -0
  16. package/beings/index.ts +16 -0
  17. package/beings/join.ts +51 -0
  18. package/beings/link.ts +104 -0
  19. package/beings/look.ts +139 -0
  20. package/beings/porter.ts +43 -0
  21. package/beings/presence.ts +39 -0
  22. package/beings/quo-app-bells.md +280 -0
  23. package/beings/quo-dock.md +1942 -0
  24. package/beings/setup.ts +45 -0
  25. package/beings/side.ts +60 -0
  26. package/beings/user.ts +459 -0
  27. package/beings/way.ts +65 -0
  28. package/cli/bundles.ts +20 -0
  29. package/cli/client.ts +73 -0
  30. package/cli/daemon.ts +581 -0
  31. package/cli/estate/Caddyfile +33 -0
  32. package/cli/estate/quo.service +35 -0
  33. package/cli/estate/systems.quo.plist +44 -0
  34. package/cli/estate.ts +48 -0
  35. package/cli/folder.ts +27 -0
  36. package/cli/oauth.ts +32 -0
  37. package/cli/pilot.ts +38 -0
  38. package/cli/quo-dock.md +1942 -0
  39. package/cli/quo.ts +203 -0
  40. package/cli/stand.ts +160 -0
  41. package/dist/api/route.d.ts +21 -0
  42. package/dist/api/route.js +193 -0
  43. package/dist/beings/avatar.d.ts +32 -0
  44. package/dist/beings/avatar.js +100 -0
  45. package/dist/beings/carry.d.ts +12 -0
  46. package/dist/beings/carry.js +174 -0
  47. package/dist/beings/clock.d.ts +161 -0
  48. package/dist/beings/clock.js +528 -0
  49. package/dist/beings/courier.d.ts +50 -0
  50. package/dist/beings/courier.js +96 -0
  51. package/dist/beings/desk.d.ts +53 -0
  52. package/dist/beings/desk.js +135 -0
  53. package/dist/beings/doorbell.d.ts +78 -0
  54. package/dist/beings/doorbell.js +133 -0
  55. package/dist/beings/envoy.d.ts +54 -0
  56. package/dist/beings/envoy.js +211 -0
  57. package/dist/beings/index.d.ts +14 -0
  58. package/dist/beings/index.js +16 -0
  59. package/dist/beings/join.d.ts +15 -0
  60. package/dist/beings/join.js +42 -0
  61. package/dist/beings/link.d.ts +14 -0
  62. package/dist/beings/link.js +91 -0
  63. package/dist/beings/look.d.ts +30 -0
  64. package/dist/beings/look.js +104 -0
  65. package/dist/beings/porter.d.ts +14 -0
  66. package/dist/beings/porter.js +41 -0
  67. package/dist/beings/presence.d.ts +8 -0
  68. package/dist/beings/presence.js +21 -0
  69. package/dist/beings/setup.d.ts +3 -0
  70. package/dist/beings/setup.js +39 -0
  71. package/dist/beings/side.d.ts +32 -0
  72. package/dist/beings/side.js +37 -0
  73. package/dist/beings/user.d.ts +315 -0
  74. package/dist/beings/user.js +462 -0
  75. package/dist/beings/way.d.ts +19 -0
  76. package/dist/beings/way.js +28 -0
  77. package/dist/cli/bundles.d.ts +5 -0
  78. package/dist/cli/bundles.js +17 -0
  79. package/dist/cli/client.d.ts +15 -0
  80. package/dist/cli/client.js +58 -0
  81. package/dist/cli/daemon.d.ts +50 -0
  82. package/dist/cli/daemon.js +584 -0
  83. package/dist/cli/estate/Caddyfile +33 -0
  84. package/dist/cli/estate/quo.service +35 -0
  85. package/dist/cli/estate/systems.quo.plist +44 -0
  86. package/dist/cli/estate.d.ts +5 -0
  87. package/dist/cli/estate.js +50 -0
  88. package/dist/cli/folder.d.ts +2 -0
  89. package/dist/cli/folder.js +25 -0
  90. package/dist/cli/oauth.d.ts +2 -0
  91. package/dist/cli/oauth.js +32 -0
  92. package/dist/cli/pilot.d.ts +5 -0
  93. package/dist/cli/pilot.js +22 -0
  94. package/dist/cli/quo.d.ts +2 -0
  95. package/dist/cli/quo.js +201 -0
  96. package/dist/cli/stand.d.ts +37 -0
  97. package/dist/cli/stand.js +110 -0
  98. package/dist/dock/agents.d.ts +102 -0
  99. package/dist/dock/agents.js +105 -0
  100. package/dist/dock/apns.d.ts +27 -0
  101. package/dist/dock/apns.js +98 -0
  102. package/dist/dock/console.d.ts +6 -0
  103. package/dist/dock/console.js +20 -0
  104. package/dist/dock/dialers.d.ts +56 -0
  105. package/dist/dock/dialers.js +75 -0
  106. package/dist/dock/faculty.d.ts +24 -0
  107. package/dist/dock/faculty.js +142 -0
  108. package/dist/dock/fcm.d.ts +13 -0
  109. package/dist/dock/fcm.js +77 -0
  110. package/dist/dock/grants.d.ts +41 -0
  111. package/dist/dock/grants.js +99 -0
  112. package/dist/dock/http2.d.ts +4 -0
  113. package/dist/dock/http2.js +68 -0
  114. package/dist/dock/index.d.ts +41 -0
  115. package/dist/dock/index.js +113 -0
  116. package/dist/dock/local.d.ts +13 -0
  117. package/dist/dock/local.js +44 -0
  118. package/dist/dock/location.d.ts +19 -0
  119. package/dist/dock/location.js +11 -0
  120. package/dist/dock/notifications.d.ts +38 -0
  121. package/dist/dock/notifications.js +60 -0
  122. package/dist/dock/push.d.ts +79 -0
  123. package/dist/dock/push.js +132 -0
  124. package/dist/dock/service.d.ts +4 -0
  125. package/dist/dock/service.js +107 -0
  126. package/dist/dock/timer.d.ts +52 -0
  127. package/dist/dock/timer.js +149 -0
  128. package/dist/dock/webpush.d.ts +12 -0
  129. package/dist/dock/webpush.js +144 -0
  130. package/dist/harbor/browser.d.ts +15 -0
  131. package/dist/harbor/browser.js +82 -0
  132. package/dist/harbor/capacitor.d.ts +28 -0
  133. package/dist/harbor/capacitor.js +218 -0
  134. package/dist/harbor/disk.d.ts +27 -0
  135. package/dist/harbor/disk.js +249 -0
  136. package/dist/harbor/edge/alarm.d.ts +10 -0
  137. package/dist/harbor/edge/alarm.js +38 -0
  138. package/dist/harbor/edge/edge.d.ts +54 -0
  139. package/dist/harbor/edge/edge.js +370 -0
  140. package/dist/harbor/edge/exercise.d.ts +7 -0
  141. package/dist/harbor/edge/exercise.js +232 -0
  142. package/dist/harbor/edge/given.d.ts +26 -0
  143. package/dist/harbor/edge/given.js +42 -0
  144. package/dist/harbor/edge/platform.d.ts +39 -0
  145. package/dist/harbor/edge/storage.d.ts +30 -0
  146. package/dist/harbor/edge/storage.js +180 -0
  147. package/dist/harbor/edge/worker.d.ts +17 -0
  148. package/dist/harbor/edge/worker.js +67 -0
  149. package/dist/harbor/files.d.ts +15 -0
  150. package/dist/harbor/files.js +220 -0
  151. package/dist/harbor/http.d.ts +19 -0
  152. package/dist/harbor/http.js +177 -0
  153. package/dist/harbor/idb.d.ts +15 -0
  154. package/dist/harbor/idb.js +0 -0
  155. package/dist/harbor/quo.d.ts +10 -0
  156. package/dist/harbor/quo.js +42 -0
  157. package/dist/harbor/resolve.d.ts +16 -0
  158. package/dist/harbor/resolve.js +17 -0
  159. package/dist/harbor/seal.d.ts +3 -0
  160. package/dist/harbor/seal.js +25 -0
  161. package/dist/harbor/sealed.d.ts +35 -0
  162. package/dist/harbor/sealed.js +162 -0
  163. package/dist/harbor/tauri.d.ts +16 -0
  164. package/dist/harbor/tauri.js +59 -0
  165. package/dist/harbor/ward.d.ts +9 -0
  166. package/dist/harbor/ward.js +15 -0
  167. package/dist/human/app.d.ts +32 -0
  168. package/dist/human/app.js +527 -0
  169. package/dist/human/apps.d.ts +10 -0
  170. package/dist/human/apps.js +29 -0
  171. package/dist/human/dom.d.ts +2 -0
  172. package/dist/human/dom.js +15 -0
  173. package/dist/human/door.d.ts +19 -0
  174. package/dist/human/door.js +92 -0
  175. package/dist/human/guest.d.ts +3 -0
  176. package/dist/human/guest.js +33 -0
  177. package/dist/human/html.d.ts +55 -0
  178. package/dist/human/html.js +451 -0
  179. package/dist/human/local.d.ts +7 -0
  180. package/dist/human/local.js +10 -0
  181. package/dist/human/mark.d.ts +8 -0
  182. package/dist/human/mark.js +47 -0
  183. package/dist/human/move.d.ts +17 -0
  184. package/dist/human/move.js +90 -0
  185. package/dist/human/screen.d.ts +19 -0
  186. package/dist/human/screen.js +119 -0
  187. package/dist/human/style.d.ts +2 -0
  188. package/dist/human/style.js +60 -0
  189. package/dist/human/tab.bundle.txt +4775 -0
  190. package/dist/human/tab.d.ts +15 -0
  191. package/dist/human/tab.js +409 -0
  192. package/dist/human/tree.d.ts +50 -0
  193. package/dist/human/tree.js +157 -0
  194. package/dist/human/wake.d.ts +34 -0
  195. package/dist/human/wake.js +179 -0
  196. package/dist/human/web.d.ts +33 -0
  197. package/dist/human/web.js +184 -0
  198. package/dist/human/worker.bundle.txt +3868 -0
  199. package/dist/human/worker.d.ts +1 -0
  200. package/dist/human/worker.js +81 -0
  201. package/dist/human/worlds.d.ts +24 -0
  202. package/dist/human/worlds.js +99 -0
  203. package/dist/mcp/agent.d.ts +10 -0
  204. package/dist/mcp/agent.js +78 -0
  205. package/dist/mcp/allow.d.ts +20 -0
  206. package/dist/mcp/allow.js +88 -0
  207. package/dist/mcp/http.d.ts +27 -0
  208. package/dist/mcp/http.js +92 -0
  209. package/dist/mcp/oauth.d.ts +91 -0
  210. package/dist/mcp/oauth.js +241 -0
  211. package/dist/mcp/route.d.ts +15 -0
  212. package/dist/mcp/route.js +42 -0
  213. package/dist/mcp/runner.d.ts +45 -0
  214. package/dist/mcp/runner.js +99 -0
  215. package/dist/mcp/server.d.ts +11 -0
  216. package/dist/mcp/server.js +102 -0
  217. package/dock/agents.ts +121 -0
  218. package/dock/apns.ts +138 -0
  219. package/dock/console.ts +23 -0
  220. package/dock/dialers.ts +85 -0
  221. package/dock/faculty.ts +148 -0
  222. package/dock/fcm.ts +103 -0
  223. package/dock/grants.ts +111 -0
  224. package/dock/http2.ts +70 -0
  225. package/dock/index.ts +133 -0
  226. package/dock/local.ts +48 -0
  227. package/dock/location.ts +22 -0
  228. package/dock/notifications.ts +67 -0
  229. package/dock/push.ts +161 -0
  230. package/dock/quo-app-bells.md +280 -0
  231. package/dock/quo-dock.md +1942 -0
  232. package/dock/service.ts +100 -0
  233. package/dock/timer.ts +174 -0
  234. package/dock/webpush.ts +182 -0
  235. package/harbor/browser.ts +97 -0
  236. package/harbor/capacitor.ts +223 -0
  237. package/harbor/disk.ts +237 -0
  238. package/harbor/edge/alarm.ts +48 -0
  239. package/harbor/edge/edge.ts +407 -0
  240. package/harbor/edge/exercise.ts +241 -0
  241. package/harbor/edge/given.ts +106 -0
  242. package/harbor/edge/platform.d.ts +39 -0
  243. package/harbor/edge/storage.ts +179 -0
  244. package/harbor/edge/text.d.ts +15 -0
  245. package/harbor/edge/worker.ts +70 -0
  246. package/harbor/edge/wrangler.toml +30 -0
  247. package/harbor/files.ts +221 -0
  248. package/harbor/http.ts +188 -0
  249. package/harbor/idb.ts +0 -0
  250. package/harbor/quo-harbor.md +850 -0
  251. package/harbor/quo.ts +44 -0
  252. package/harbor/resolve.ts +31 -0
  253. package/harbor/seal.ts +26 -0
  254. package/harbor/sealed.ts +183 -0
  255. package/harbor/tauri.ts +79 -0
  256. package/harbor/ward.ts +28 -0
  257. package/human/app.ts +580 -0
  258. package/human/apps.ts +47 -0
  259. package/human/dom.ts +21 -0
  260. package/human/door.ts +113 -0
  261. package/human/guest.ts +34 -0
  262. package/human/html.ts +490 -0
  263. package/human/local.ts +30 -0
  264. package/human/mark.ts +53 -0
  265. package/human/move.ts +122 -0
  266. package/human/quo-human.md +1042 -0
  267. package/human/screen.ts +136 -0
  268. package/human/style.ts +63 -0
  269. package/human/tab.bundle.txt +4775 -0
  270. package/human/tab.ts +446 -0
  271. package/human/tree.ts +217 -0
  272. package/human/wake.ts +191 -0
  273. package/human/web.ts +259 -0
  274. package/human/worker.bundle.txt +3868 -0
  275. package/human/worker.ts +124 -0
  276. package/human/worlds.ts +127 -0
  277. package/mcp/agent.ts +94 -0
  278. package/mcp/allow.ts +131 -0
  279. package/mcp/http.ts +92 -0
  280. package/mcp/oauth.ts +270 -0
  281. package/mcp/quo-mcp.md +343 -0
  282. package/mcp/route.ts +45 -0
  283. package/mcp/runner.ts +136 -0
  284. package/mcp/server.ts +101 -0
  285. package/package.json +121 -0
@@ -0,0 +1,128 @@
1
+ # Getting started
2
+
3
+ Quo lets an object ask another object and get an answer, without knowing
4
+ whether that other object is in the same process, on the same device, or
5
+ on another planet. Three words: a harbor boots wards, a ward keeps beings
6
+ and judges its door, and a being is one ordinary object with one voice.
7
+ This is the shortest road from nothing to each of the three, for a
8
+ stranger with a terminal. `SPEC.md` is the truth behind every sentence
9
+ here and assumes nothing; `quo-dock.md` is the dock, the part a box runs.
10
+
11
+ Two packages, and you start with the one that fits what you have:
12
+
13
+ - `@nervur-org/nervur`, the library. A harbor, a ward and a being in one
14
+ process, no wire, no files. For a program that wants Quo inside it.
15
+ - `@nervur-org/dock`, the dock. A daemon and one command, `quo`, that
16
+ stand a box up: a person's world with a page, a model's side, an api, a
17
+ door on the wire. For a box that receives people and models.
18
+
19
+ ## A being, in one process
20
+
21
+ ```bash
22
+ npm install @nervur-org/nervur
23
+ ```
24
+
25
+ A being is a class with `asks`, the methods anyone may reach, each with
26
+ the JSON schema of its input. Everything else on the class is hers alone.
27
+
28
+ ```js
29
+ import { Being } from '@nervur-org/nervur';
30
+ import { Ward } from '@nervur-org/nervur/ward';
31
+ import { MemoryHarbor } from '@nervur-org/nervur/harbor';
32
+
33
+ class Shop extends Being {
34
+ static asks = { price: { input: { type: 'object', properties: { item: { type: 'string' } } } } };
35
+ price({ item }) {
36
+ return { item, eur: 12 };
37
+ }
38
+ }
39
+ class Customer extends Being {
40
+ static asks = {};
41
+ }
42
+
43
+ const harbor = new MemoryHarbor();
44
+ const ward = await harbor.boot('acme', Ward, { Shop, Customer });
45
+ await ward.ask('boot', { key: 'shop', class: 'Shop' });
46
+ await ward.ask('boot', { key: 'ana', class: 'Customer' });
47
+ ```
48
+
49
+ The harbor booted a ward named `acme` with two classes it may make beings
50
+ of, and the ward's owner, the process itself, booted one of each by key.
51
+ The ward's own asks are seven, `boot`, `public`, `invite`, `knock`,
52
+ `remove`, `unboot` and `ask`, and `ward.ask()` with no method is her
53
+ describe: those asks and her `notes`, the ward's `pk` and her beings.
54
+
55
+ Nobody reaches a being she has not invited. An invitation is minted on a
56
+ being for one id, the shop's for `ana`, and the customer knocks with it;
57
+ from then she holds a standing at the shop, under the name she took, and
58
+ the shop holds her as an occupant.
59
+
60
+ ```js
61
+ const invitation = await ward.ask('invite', { being: 'shop', id: 'ana' });
62
+ const ana = harbor.objects.get(harbor.partitions.get('acme').beings.ana);
63
+ await ana.knock(invitation);
64
+ await ana.take('shop', invitation);
65
+ console.log(await ana.standings.shop.ask('price', { item: 'bread' }));
66
+ // { item: 'bread', eur: 12 }
67
+ ```
68
+
69
+ That is the whole protocol: a standing on one side, an occupant on the
70
+ other, an ask that rides the relation and an answer that rides it back.
71
+ The two beings here share a process; the same lines hold when the shop is
72
+ on a box across the sea, because a standing is an address and a key, and
73
+ the harbor owns the wire. `harbor.objects` is the memory harbor's hand for
74
+ a test and a first program; a being on a real box is reached through her
75
+ ward, never held.
76
+
77
+ ## A box
78
+
79
+ ```bash
80
+ npm install @nervur-org/dock
81
+ npx quo init --dir ~/.quo --ward acme --user razvan --domain acme.com --default --show
82
+ npx quo serve --dir ~/.quo --http 8787
83
+ ```
84
+
85
+ `init` mints the ward `acme`, boots razvan's user being, her doorbell and
86
+ the desk in it, marks it the default ward and shows it at the web route,
87
+ and writes `routes.json`, the four routes of a box, `mcp.`, `web.`, `quo.`
88
+ and `api.` under the domain, for a proxy to map onto the one loopback
89
+ port. Without `--domain`, write it yourself; on a Mac the four are paths
90
+ at one loopback address:
91
+
92
+ ```json
93
+ { "mcp": "http://127.0.0.1:8787/mcp", "web": "http://127.0.0.1:8787/web", "quo": "http://127.0.0.1:8787/quo", "api": "http://127.0.0.1:8787/api" }
94
+ ```
95
+
96
+ `serve` is the daemon, the one process over that folder, and every other
97
+ command is its client. From a second terminal, a phone:
98
+
99
+ ```bash
100
+ npx quo invite --dir ~/.quo '{"being":"razvan","id":"phone"}'
101
+ ```
102
+
103
+ The answer carries `link`, the ward's page with the invitation in its
104
+ fragment. Opened on the phone, the tab boots a harbor of its own, joins as
105
+ that device, and is in: no account, nothing typed. What a model gets is
106
+ the same world as tools at `mcp.`, what a program gets is the same asks as
107
+ JSON at `api.`, and what another box gets is the door at `quo.`; a being
108
+ answers each the same, because each is an ask at her door.
109
+
110
+ The box's own doings are rows on the faculties of its dock ward, placed by
111
+ the root with `quo ask --ward dock`: a socket held to another box, an
112
+ agent run for a ward, a schedule on the clock. A second box owns this one
113
+ across the wire with an invitation on the ward's own pk, knocked with
114
+ from there, and every owner command with `--via` from then on. Each of
115
+ those, the edge, and what an estate stands beyond the init, is the
116
+ "Getting started" chapter of `quo-dock.md`, proven cold on a Mac by
117
+ somebody with nothing else to read.
118
+
119
+ ## Your own beings on a box
120
+
121
+ A box holds the dock's classes and yours. `classes/index.ts` beside the
122
+ wards exports each of yours by name, and `quo boot '{"key":"shop",
123
+ "class":"Shop"}'` boots one; `quo init --class Shop` makes the ward's home
124
+ being one of yours, an organisation's ward with the org as its being. A
125
+ being's asks may name who may reach them, `for`, over the record of the
126
+ occupant asking, and her `cells` are what she keeps between boots: the
127
+ whole of what a being is, in `SPEC.md`, and the words above the spec, a
128
+ world, a home, a membership, in `WORLDS.md` and `GLOSSARY.md`.
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 Razvan Gherghina
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,6 @@
1
+ Quo
2
+ Copyright 2026 Razvan Gherghina
3
+
4
+ This product includes software developed by Razvan Gherghina.
5
+
6
+ Licensed under the Apache License, Version 2.0. See LICENSE for the terms.
package/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # The dock
2
+
3
+ What every estate on Quo needs and nobody writes twice: a daemon and the
4
+ `quo` command, the front desk, the user being and the avatar, harbors on
5
+ disk, in a tab and on the edge, the model sides and the screen, the
6
+ credential exchange. An estate is all of one owner's harbors, and it is
7
+ built on the dock, on Quo.
8
+
9
+ ```bash
10
+ npm install @nervur-org/dock
11
+ npx quo estate my-estate --domain example.com
12
+ npx quo init --dir my-estate/droplet
13
+ npx quo serve --dir my-estate/droplet
14
+ ```
15
+
16
+ `quo estate` writes an estate folder: one folder per harbor, the first a
17
+ droplet's quo directory with its routes under your domain, its unit and
18
+ its Caddyfile, and a package file that depends on the dock and nothing
19
+ else. Add your beings to `droplet/classes/`, and your placement to the
20
+ routes and agents files.
21
+
22
+ `beings/quo-dock.md` is the truth of this package and the trunk of its
23
+ documents; read it first. It knows nothing the spec of Quo does not say,
24
+ and adds no word to harbor, ward or being. Beside it are the sides,
25
+ `human/quo-human.md`, `mcp/quo-mcp.md`, `api/quo-api.md` and
26
+ `harbor/quo-harbor.md`; `beings/WORLDS.md` is what home, presence and
27
+ membership mean, and `beings/GLOSSARY.md` is every word above the spec.
28
+
29
+ ## Publishing
30
+
31
+ Published from 0.1.0 with no compatibility promise before 1.0.0. The
32
+ package ships an emitted `dist/` with its command, and the source beside it.
33
+
34
+ ## License
35
+
36
+ Apache-2.0. Copyright 2026 Razvan Gherghina. See [LICENSE](LICENSE) and
37
+ [NOTICE](NOTICE).
package/api/quo-api.md ADDED
@@ -0,0 +1,196 @@
1
+ # The api route
2
+
3
+ This is the fourth rendering of one describe. The screen speaks a being's
4
+ describe as forms, the model side speaks it as tools, the CLI speaks it as
5
+ lines, and this route speaks it as plain HTTP and JSON. It is one route of
6
+ the daemon described in `papers/quo-dock.md`, which owns the routes, the
7
+ grants, the avatar and the shared invariants; this document assumes all of
8
+ that and adds only what the route does. `papers/WORLDS.md` decides what
9
+ every route is held to: a route says the grammar a caller speaks and never
10
+ who the caller is, and the same credential is honoured on every route.
11
+
12
+ ## What it is for
13
+
14
+ A route hears every rung. A request carrying nothing is the stranger every
15
+ route knows: an ask at the named ward's public being as `{}`, which is what
16
+ every stranger is at every door, and what a browser fetch, a page
17
+ rendering server side, a crawler and a tab on another origin are. A
18
+ request carrying a bearer the box granted is an occupant: the identity's
19
+ avatar in the world the grant names, asked through her one standing at the
20
+ world's being. What a script sees with a bearer is what a model sees with
21
+ the same bearer as tools and a tab sees as forms, because all three are
22
+ one avatar's describe for one identity, and the gate is one decision for
23
+ describe and for dispatch. The route judges nothing and names nobody: the
24
+ public being answers a stranger by her own gate, the world's being answers
25
+ an occupant by hers, and the route carries the answer.
26
+
27
+ A grant is the box's and may die at any moment: a box wiped, an occupant
28
+ removed at the world's being, thirty days without a refresh. Nothing of
29
+ the world dies with it, since the avatar and her standing are the ward's;
30
+ only the box's memory of which token names her is gone, and the holder
31
+ trades again on a fresh invitation and lands on the same avatar. So a
32
+ bearer is held by something with a human near it: a model client whose
33
+ human clicks the allow page again, a script whose root mints again, a
34
+ SaaS whose operator signs up again as at any vendor. A program of the
35
+ org's that must run without a human is not a caller of this route. It is
36
+ a harbor of the org with a ward and a standing, or an agent the daemon
37
+ boots on the box, and either speaks Quo on keys that do not expire.
38
+
39
+ A world is a ward, so the route names one. Every ward `init` made holds a
40
+ desk, who is public for the first hello and answers a stranger nothing
41
+ else, so a world's public reads live in a ward of their own, and the route is what
42
+ makes a second ward reachable by name from outside: the corpus of a court
43
+ watcher, a catalogue, a board. An occupant's world is the one her
44
+ invitation named, and a bearer on any other world is refused.
45
+
46
+ ## The mapping
47
+
48
+ `packages/dock/api/route.ts` is the route, `Request` in and `Response` out
49
+ and naming no terrain: the daemon mounts it under `/api` and the proxy maps
50
+ it from the api. hostname, and the worker at the edge mounts the same file
51
+ under its harbor's prefix. It asks its harbor for the wards it holds and for
52
+ which of them a caller who names none is at, and for nothing else.
53
+
54
+ | request | Quo |
55
+ | ------------------------------------ | -------------------------------------------------------------------- |
56
+ | `POST /api` `{identity, invitation}` | the trade: her avatar knocks with it, and a grant is issued |
57
+ | `POST /api` `{refresh}` | the next grant; the old refresh token dies |
58
+ | `GET /api` | the describe of the default ward, as `GET /api/<that ward>` |
59
+ | `GET /api/<ward>` | the describe: the public being for nobody, the avatar under a bearer |
60
+ | `GET /api/<ward>/<ask>?k=v` | that ask, the query as args, every value a string |
61
+ | `POST /api/<ward>/<ask>` JSON body | that ask, the object as args |
62
+ | `POST /api/<ward>/<being>/deliver` | a vendor's delivery, the raw body and the headers to that envoy |
63
+ | `GET /api/<ward>/<being>/deliver` | the same with an empty body: a redirect lands here, query in headers |
64
+ | `OPTIONS` | the preflight, any origin, `authorization` allowed |
65
+
66
+ What a caller leaves unsaid follows `papers/WORLDS.md`, and none of it is
67
+ a default the route picks. A credential names an identity in a world, so an
68
+ occupant's ward is her grant's and a bearer on any other ward is refused.
69
+ A stranger carries nothing that names a world, so a stranger who names no
70
+ ward is at the ward the terrain says it is at, the one the box hosts or the
71
+ one it marks, and `GET /api` is what a tab at the web
72
+ route's root sees and a model's first tool list. A being is never named,
73
+ because a caller
74
+ does not choose who answers: naming a ward is naming a door, and behind it
75
+ the ward decides, the public being as nobody for a stranger and the
76
+ identity's avatar for an occupant. The one path that names a being is the
77
+ delivery, and there it is not a choice either: the envoy claimed that path
78
+ at her birth, and a delivery with no envoy named has nowhere to land and
79
+ is 404, never the public being.
80
+
81
+ The trade is the allow page of the model side without the page. Nobody at
82
+ a page vouches for a program, so a trade is a knock that spends: the
83
+ invitation is the one the root minted for that identity on the world's
84
+ being with `quo invite`, sent as a line, and the avatar knocks with it
85
+ inside the trade. An identity already in is refused with `already in` and
86
+ refreshes instead, or is removed at the world's being and invited again,
87
+ and never re-enters on a spent invitation. What comes back is the box's
88
+ grant, `dock/grants.ts`: an access token for an hour, a refresh token for
89
+ thirty days, the same grant the OAuth dance issues, honoured on the model
90
+ route too.
91
+
92
+ What she says crosses as the model side crosses it:
93
+
94
+ | she answered | the client gets |
95
+ | ------------------------------ | ------------------------------------------------------ |
96
+ | an object | 200 with that JSON |
97
+ | `{ error }` | 400 with that JSON |
98
+ | silence, a throw, a wait spent | 503 `{ error: 'silence' }`: the work may have happened |
99
+ | an ask not hers for this asker | 400 `{ error: 'unknown ask' }`, her own answer |
100
+
101
+ For a stranger, a ward with nobody at the door is 503 beside them, and
102
+ not a 404 of its own: on the wire a stranger who asks a ward that has no
103
+ public being hears one silence, and a device speaking for strangers says
104
+ what the door would. A stranger learns which world exists here and nothing
105
+ else about it. For an occupant the ward's words cross by name, `unreached`
106
+ as 503 `{ error: 'unreached' }`, and `removed` is 401 `{ error: 'removed'
107
+ }` with the grant forgotten at the box, so a script the world's being
108
+ removed starts over with a fresh invitation, exactly as a model client
109
+ does.
110
+
111
+ And what the route says on its own: 404 for a ward not here and for a path
112
+ that is not one of the shapes, 400 for a body that is not a JSON object,
113
+ 400 `{ error: 'already in' }` for a trade on an identity that holds a live
114
+ standing, 401 `{ error: 'unauthorized' }` for a bearer nobody issued or one
115
+ that died, 403 `{ error: 'not your world' }` for a bearer on a world the
116
+ grant does not name, 413 for a body past a megabyte, 405 for any other
117
+ method. Every answer is JSON and open to any origin: the route carries
118
+ nothing a stranger can use that she did not choose to say, and a bearer is
119
+ the caller's to keep.
120
+
121
+ The route holds none of the judgement. For a stranger it asks the ward the
122
+ owner's `ask` with no being named, which is the public being asked as
123
+ nobody, and the ward bounds the wait, names the three choices and saves
124
+ before the pointer returns: a public being may write while answering, a
125
+ tally, a board, and what she wrote is hers to keep. For an occupant it
126
+ asks her avatar, `tools` for the describe and `call` for an ask, the two
127
+ things every side asks of her, and saves the ward after.
128
+
129
+ ## The delivery
130
+
131
+ A vendor's webhook is not a stranger's ask and does not land as `{}`, and
132
+ it is not an occupant's ask either: it is the owner asking the envoy
133
+ `deliver`, as `papers/quo-dock.md` says of envoys, and the route carries
134
+ the bytes and nothing of the judgement. `POST /api/<ward>/<being>/deliver`
135
+ is its own row and not an ask: the body is read as a string and never
136
+ parsed here, since the vendor signed the bytes and a reparsed body fails
137
+ her check, and the rule that a body is a JSON object does not apply. The
138
+ route asks the ward's owner pointer for that being's `deliver` with `{
139
+ body, headers }`, and answers what she answers: `{ ok }` as 200, her error
140
+ object as 400, silence as 503. No bearer is read on this path, because the
141
+ rung is not the caller's to prove: the signature is hers to check, and
142
+ what fails it is refused by her and never by the route.
143
+
144
+ A `GET` on the same path is the same ask with an empty body, and is where
145
+ an OAuth redirect lands when an envoy begins an account, the code in the
146
+ query. The query crosses inside the headers object under the name
147
+ `:query`, which no header on the wire can carry, so her one ask in stays
148
+ one and an author writes no second door for redirects. What she answers
149
+ crosses as JSON like any delivery.
150
+
151
+ **And a browser gets a page.** This is a road for programs with exactly one
152
+ human arrival, and it is somebody who has just paid for something: a vendor
153
+ returns her by opening this URL in her tab, so without a page she ends a
154
+ payment reading what an envoy says to a machine. A `GET` whose `accept`
155
+ names HTML is answered with the human side's landing page, saying which of
156
+ the two happened and offering the world's own page, since a tab a vendor
157
+ opened has no history to go back through. What the envoy answered is never
158
+ on it. Everything else is unchanged: a vendor asking for JSON is answered
159
+ in JSON, a `GET` that says nothing about what it wants is answered in JSON,
160
+ and the page carries no cross-origin header, since a page is for the
161
+ browser that was sent here and never for a script somewhere else.
162
+
163
+ On its own the route says 404 for a ward not here, for a being not hers
164
+ and for a third segment that is not `deliver`, 413 past a megabyte and 405
165
+ for any method but `POST` and `GET`. A vendor that retries on anything but a quick
166
+ 200 lands once, because she keeps the delivery id and answers `{ ok }` for
167
+ one she has seen before she wakes anyone.
168
+
169
+ ## What is not here
170
+
171
+ A ward's delivery reaching more than one envoy, and a vendor that cannot
172
+ sign what it sends. Both stand when a first user does.
173
+
174
+ ## The proof
175
+
176
+ `packages/dock/test/api.test.ts`, over a real daemon on loopback. A
177
+ stranger: a world with a public board described and asked by anyone, args
178
+ by query and by body, what she wrote kept across a reboot, no ward named
179
+ being the device's own, and every refusal. An occupant: an invitation
180
+ traded for a grant, the describe under the bearer being the avatar's own
181
+ with no ward named and with hers, an ask through her, another world
182
+ refused, refresh rotating, removal at the world's being ending the grant,
183
+ and the identity let in again on a fresh invitation. One identity, two
184
+ grammars: a bearer the OAuth dance issued honoured here and its refresh
185
+ rotating at the trade, a bearer the trade issued opening an MCP session,
186
+ and the tool list being this route's describe with her look and page
187
+ left out. The delivery: signed bytes landing on an envoy's `deliver` as
188
+ the owner, a good signature kept and woken once, a retry landing once, a
189
+ bad one her refusal as 400, no bearer read, what she kept outliving the
190
+ daemon, and the route's own 404, 405 and 413.
191
+
192
+ The same route on a second terrain is
193
+ `packages/dock/test/terrain/edge.test.ts`, behind `npm run deep:dock`: the
194
+ trade at a worker's `/api`, the ask through her avatar, and the answer
195
+ compared against a Node daemon doing the same thing, because a rendering of
196
+ one describe must not differ by terrain.