copilotz 1.0.0-rc.23 → 1.0.0-rc.25

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 (413) hide show
  1. package/CHANGELOG.md +579 -0
  2. package/README.md +471 -251
  3. package/hosts/terminal/contract.d.ts +1 -1
  4. package/hosts/terminal/host.js +1 -1
  5. package/hosts/web/assets.d.ts +14 -11
  6. package/hosts/web/assets.js +16 -13
  7. package/hosts/web/host.d.ts +9 -5
  8. package/hosts/web/host.js +63 -28
  9. package/hosts/web/lazy.js +1 -1
  10. package/hosts/web/mod.d.ts +3 -5
  11. package/hosts/web/mod.js +3 -6
  12. package/hosts/web/node/bundle.js +1 -1
  13. package/hosts/web/node/mod.d.ts +17 -21
  14. package/hosts/web/node/mod.js +17 -21
  15. package/hosts/web/node/serve.d.ts +4 -59
  16. package/hosts/web/node/serve.js +12 -42
  17. package/hosts/web/palette/sources.js +1 -1
  18. package/hosts/web/server.d.ts +44 -146
  19. package/hosts/web/server.js +169 -262
  20. package/hosts/web/signin.d.ts +11 -5
  21. package/hosts/web/signin.js +5 -5
  22. package/hosts/web/theme/css.d.ts +1 -1
  23. package/hosts/web/theme/css.js +1 -1
  24. package/hosts/web/theme/default.d.ts +1 -1
  25. package/hosts/web/theme/files/mod.d.ts +1 -1
  26. package/hosts/web/widget.js +1 -1
  27. package/hosts/web/widgets.js +3 -2
  28. package/package.json +2 -10
  29. package/plugins/access/accounts/actions/callback.d.ts +0 -1
  30. package/plugins/access/accounts/actions/callback.js +19 -33
  31. package/plugins/access/accounts/actions/disconnect.js +6 -4
  32. package/plugins/access/accounts/contract.d.ts +1 -1
  33. package/plugins/access/accounts/mod.d.ts +2 -2
  34. package/plugins/access/accounts/mod.js +6 -4
  35. package/plugins/access/accounts/routes/callback.d.ts +10 -0
  36. package/plugins/access/accounts/routes/callback.js +33 -0
  37. package/plugins/access/accounts/shared/flow.js +1 -1
  38. package/plugins/access/accounts/shared/oauth.d.ts +2 -2
  39. package/plugins/access/accounts/shared/oauth.js +2 -2
  40. package/plugins/access/accounts/shared/renew.js +4 -1
  41. package/plugins/access/accounts/shared/rules.d.ts +4 -2
  42. package/plugins/access/accounts/shared/rules.js +20 -5
  43. package/plugins/access/accounts/web.js +3 -3
  44. package/plugins/access/contacts/mod.js +9 -2
  45. package/plugins/access/contacts/views/contact.js +1 -1
  46. package/plugins/access/dev/mod.d.ts +4 -4
  47. package/plugins/access/dev/mod.js +6 -5
  48. package/plugins/access/dev/routes/sign-in.d.ts +8 -0
  49. package/plugins/access/dev/routes/sign-in.js +25 -0
  50. package/plugins/access/dev/shared/here.d.ts +4 -0
  51. package/plugins/access/dev/shared/here.js +32 -0
  52. package/plugins/access/directory/actions/host.js +4 -3
  53. package/plugins/access/directory/actions/invite.js +2 -2
  54. package/plugins/access/directory/actions/org.d.ts +0 -1
  55. package/plugins/access/directory/actions/org.js +5 -24
  56. package/plugins/access/directory/collections/credit-code.d.ts +1 -1
  57. package/plugins/access/directory/collections/org-host.d.ts +4 -3
  58. package/plugins/access/directory/collections/org-host.js +4 -3
  59. package/plugins/access/directory/collections/org.d.ts +1 -1
  60. package/plugins/access/directory/collections/org.js +23 -1
  61. package/plugins/access/directory/contract.d.ts +8 -0
  62. package/plugins/access/directory/contract.js +8 -0
  63. package/plugins/access/directory/mod.d.ts +53 -13
  64. package/plugins/access/directory/mod.js +77 -14
  65. package/plugins/access/directory/routes/console.d.ts +26 -0
  66. package/plugins/access/directory/routes/console.js +129 -0
  67. package/plugins/access/directory/routes/enter.d.ts +18 -0
  68. package/plugins/access/directory/routes/enter.js +47 -0
  69. package/plugins/access/directory/routes/forward.d.ts +35 -0
  70. package/plugins/access/directory/routes/forward.js +119 -0
  71. package/plugins/access/directory/routes/orgs.d.ts +25 -0
  72. package/plugins/access/directory/routes/orgs.js +113 -0
  73. package/plugins/access/directory/routes/signout.d.ts +11 -0
  74. package/plugins/access/directory/routes/signout.js +36 -0
  75. package/plugins/access/directory/shared/enter.d.ts +36 -0
  76. package/plugins/access/directory/shared/enter.js +82 -0
  77. package/plugins/access/directory/shared/http.d.ts +42 -0
  78. package/plugins/access/directory/shared/http.js +77 -0
  79. package/plugins/access/directory/shared/member.d.ts +21 -0
  80. package/plugins/access/directory/shared/member.js +73 -0
  81. package/plugins/access/directory/shared/settings.d.ts +36 -4
  82. package/plugins/access/directory/shared/state.d.ts +74 -0
  83. package/plugins/access/directory/shared/state.js +101 -0
  84. package/{hosts/web/orgs.js → plugins/access/directory/web.js} +11 -7
  85. package/plugins/access/google/actions/sign-in.js +1 -1
  86. package/plugins/access/google/adapters/keys.d.ts +4 -4
  87. package/plugins/access/google/adapters/keys.js +2 -2
  88. package/plugins/access/google/mod.d.ts +3 -3
  89. package/plugins/access/google/mod.js +5 -14
  90. package/plugins/access/google/routes/sign-in.d.ts +12 -0
  91. package/plugins/access/google/routes/sign-in.js +36 -0
  92. package/plugins/access/identity/actions/session.js +3 -1
  93. package/plugins/access/identity/collections/credential.d.ts +8 -18
  94. package/plugins/access/identity/collections/credential.js +10 -25
  95. package/plugins/access/identity/contract.d.ts +16 -2
  96. package/plugins/access/identity/contract.js +18 -1
  97. package/plugins/access/identity/mod.d.ts +13 -8
  98. package/plugins/access/identity/mod.js +30 -25
  99. package/plugins/access/identity/routes/session.d.ts +17 -0
  100. package/plugins/access/identity/routes/session.js +35 -0
  101. package/plugins/access/mod.d.ts +5 -5
  102. package/plugins/access/spaces/actions/create.js +5 -2
  103. package/plugins/access/spaces/actions/member.js +8 -2
  104. package/plugins/access/spaces/actions/org.d.ts +2 -2
  105. package/plugins/access/spaces/actions/personal.js +2 -1
  106. package/plugins/access/spaces/contract.d.ts +15 -1
  107. package/plugins/access/spaces/mod.d.ts +1 -1
  108. package/plugins/access/spaces/mod.js +2 -2
  109. package/plugins/access/spaces/resources/commands.js +1 -1
  110. package/plugins/access/spaces/shared/personal.d.ts +3 -2
  111. package/plugins/access/spaces/shared/personal.js +5 -3
  112. package/plugins/access/spaces/shared/reach.d.ts +18 -6
  113. package/plugins/access/spaces/shared/reach.js +20 -13
  114. package/plugins/access/spaces/shared/rules.d.ts +2 -0
  115. package/plugins/access/spaces/shared/rules.js +9 -3
  116. package/plugins/access/spaces/shared/seat.d.ts +3 -3
  117. package/plugins/access/spaces/shared/seat.js +6 -3
  118. package/plugins/access/spaces/terminal.js +1 -1
  119. package/plugins/access/spaces/views/web/members.d.ts +2 -1
  120. package/plugins/access/spaces/views/web/members.js +10 -4
  121. package/plugins/access/spaces/views/web/org-about.js +2 -1
  122. package/plugins/access/spaces/views/web/tree.js +2 -1
  123. package/plugins/access/spaces/views/web/who.d.ts +4 -1
  124. package/plugins/access/spaces/views/web/who.js +5 -6
  125. package/plugins/access/spaces/web.js +14 -14
  126. package/plugins/access/web.d.ts +1 -0
  127. package/plugins/access/web.js +2 -0
  128. package/plugins/agents/chat/actions/say.js +1 -1
  129. package/plugins/agents/chat/collections/intent.d.ts +1 -1
  130. package/plugins/agents/chat/collections/message.d.ts +3 -3
  131. package/plugins/agents/chat/collections/shown.d.ts +2 -2
  132. package/plugins/agents/chat/collections/shown.js +1 -1
  133. package/plugins/agents/chat/collections/thread.js +1 -1
  134. package/plugins/agents/chat/mod.d.ts +2 -2
  135. package/plugins/agents/chat/mod.js +23 -8
  136. package/plugins/agents/chat/processors/turn.js +1 -1
  137. package/plugins/agents/chat/resources/commands.js +4 -1
  138. package/{hosts/web → plugins/agents/chat/routes}/files.d.ts +7 -10
  139. package/plugins/agents/chat/routes/files.js +107 -0
  140. package/plugins/agents/chat/shared/tools.js +1 -1
  141. package/plugins/agents/chat/shared/types.d.ts +5 -5
  142. package/plugins/agents/chat/terminal.js +6 -6
  143. package/plugins/agents/chat/views/history.js +1 -1
  144. package/plugins/agents/chat/views/terminal/conversation.js +2 -2
  145. package/plugins/agents/chat/views/web/conversation.js +2 -2
  146. package/plugins/agents/chat/web.js +9 -9
  147. package/plugins/agents/history/collections/outline.d.ts +2 -2
  148. package/plugins/agents/history/collections/summary.d.ts +1 -1
  149. package/plugins/agents/history/mod.js +3 -3
  150. package/plugins/agents/history/resources/tools.js +1 -1
  151. package/plugins/agents/history/shared/weight.js +1 -1
  152. package/plugins/agents/history/views/history.js +1 -1
  153. package/plugins/agents/memory/mod.js +11 -2
  154. package/plugins/agents/memory/resources/commands.js +1 -1
  155. package/plugins/agents/memory/terminal.js +1 -1
  156. package/plugins/agents/memory/views/context.d.ts +3 -9
  157. package/plugins/agents/memory/views/context.js +41 -47
  158. package/plugins/agents/memory/web.js +3 -3
  159. package/plugins/agents/openapi/actions/operation.js +1 -1
  160. package/plugins/agents/openapi/contract.d.ts +0 -2
  161. package/plugins/agents/openapi/mod.js +0 -3
  162. package/plugins/agents/routines/mod.js +9 -1
  163. package/plugins/agents/routines/web.js +5 -5
  164. package/plugins/agents/skills/mod.js +11 -2
  165. package/plugins/agents/skills/web.js +5 -5
  166. package/plugins/agents/team/mod.js +8 -1
  167. package/plugins/agents/team/web.js +4 -4
  168. package/plugins/agents/tiers/web.js +3 -3
  169. package/plugins/billing/credits/collections/plan.d.ts +1 -1
  170. package/plugins/billing/credits/views/web/composer.js +2 -1
  171. package/plugins/billing/credits/web.js +2 -2
  172. package/plugins/billing/stripe/actions/checkout.js +3 -3
  173. package/plugins/billing/stripe/actions/fact.d.ts +1 -0
  174. package/plugins/billing/stripe/actions/fact.js +39 -0
  175. package/plugins/billing/stripe/mod.d.ts +15 -3
  176. package/plugins/billing/stripe/mod.js +22 -3
  177. package/plugins/billing/stripe/routes/webhook.d.ts +16 -0
  178. package/plugins/billing/stripe/routes/webhook.js +56 -0
  179. package/plugins/billing/stripe/shared/api.d.ts +1 -1
  180. package/plugins/billing/stripe/shared/api.js +1 -1
  181. package/plugins/billing/stripe/shared/settings.d.ts +8 -3
  182. package/plugins/billing/usage/terminal.js +1 -1
  183. package/plugins/billing/usage/web.js +1 -1
  184. package/plugins/compute/apps/mod.js +8 -1
  185. package/plugins/compute/apps/shared/claims.d.ts +1 -1
  186. package/plugins/compute/apps/web.js +3 -3
  187. package/plugins/compute/cloud/collections/cloud-computer.d.ts +1 -1
  188. package/plugins/compute/cloud/collections/pool-want.d.ts +1 -1
  189. package/plugins/compute/cloud/contract.d.ts +6 -0
  190. package/plugins/compute/cloud/contract.js +6 -0
  191. package/plugins/compute/cloud/mod.d.ts +2 -2
  192. package/plugins/compute/cloud/mod.js +17 -5
  193. package/plugins/compute/cloud/web.js +2 -2
  194. package/plugins/compute/computers/collections/approval.d.ts +2 -2
  195. package/plugins/compute/computers/collections/computer.d.ts +1 -1
  196. package/plugins/compute/computers/collections/grant.d.ts +1 -1
  197. package/plugins/compute/computers/mod.js +14 -5
  198. package/plugins/compute/computers/program/version.d.ts +1 -1
  199. package/plugins/compute/computers/program/version.js +1 -1
  200. package/plugins/compute/computers/resources/downloads.js +11 -13
  201. package/plugins/compute/computers/resources/previews.d.ts +6 -25
  202. package/plugins/compute/computers/resources/previews.js +30 -16
  203. package/plugins/compute/computers/terminal.js +1 -1
  204. package/plugins/compute/computers/views/context.d.ts +1 -3
  205. package/plugins/compute/computers/views/context.js +75 -77
  206. package/plugins/compute/computers/web.js +8 -8
  207. package/plugins/interfaces/api/actions/create.js +50 -24
  208. package/plugins/interfaces/api/actions/revoke.js +18 -8
  209. package/plugins/interfaces/api/collections/key.d.ts +123 -53
  210. package/plugins/interfaces/api/collections/key.js +35 -36
  211. package/plugins/interfaces/api/contract.d.ts +11 -11
  212. package/plugins/interfaces/api/contract.js +1 -1
  213. package/plugins/interfaces/api/mod.d.ts +18 -13
  214. package/plugins/interfaces/api/mod.js +22 -15
  215. package/plugins/interfaces/api/processors/left.d.ts +3 -2
  216. package/plugins/interfaces/api/processors/left.js +11 -4
  217. package/plugins/interfaces/api/resources/presets.d.ts +3 -2
  218. package/plugins/interfaces/api/resources/presets.js +5 -3
  219. package/plugins/interfaces/api/shared/actor.d.ts +22 -8
  220. package/plugins/interfaces/api/shared/actor.js +34 -2
  221. package/plugins/interfaces/api/shared/end.d.ts +9 -0
  222. package/plugins/interfaces/api/shared/end.js +10 -0
  223. package/plugins/interfaces/api/shared/rules.d.ts +7 -4
  224. package/plugins/interfaces/api/shared/rules.js +17 -5
  225. package/plugins/interfaces/api/views/web/create.d.ts +7 -5
  226. package/plugins/interfaces/api/views/web/create.js +38 -33
  227. package/plugins/interfaces/api/views/web/keys.d.ts +21 -4
  228. package/plugins/interfaces/api/views/web/keys.js +22 -19
  229. package/plugins/interfaces/api/views/web/members.d.ts +13 -0
  230. package/plugins/interfaces/api/views/web/members.js +35 -0
  231. package/plugins/interfaces/api/views/web/reference.d.ts +6 -6
  232. package/plugins/interfaces/api/views/web/reference.js +17 -7
  233. package/plugins/interfaces/api/views/web/snippet.d.ts +18 -13
  234. package/plugins/interfaces/api/views/web/snippet.js +27 -16
  235. package/plugins/interfaces/api/views/web/style.d.ts +4 -3
  236. package/plugins/interfaces/api/views/web/style.js +31 -2
  237. package/plugins/interfaces/api/web.d.ts +5 -4
  238. package/plugins/interfaces/api/web.js +8 -5
  239. package/plugins/interfaces/maintenance/mod.js +2 -4
  240. package/plugins/interfaces/maintenance/resources/routes.d.ts +4 -14
  241. package/plugins/interfaces/maintenance/resources/routes.js +6 -11
  242. package/plugins/interfaces/mcp/actions/call.js +5 -5
  243. package/plugins/interfaces/mcp/contract.d.ts +5 -6
  244. package/plugins/interfaces/mcp/contract.js +4 -5
  245. package/plugins/interfaces/mcp/mod.d.ts +18 -18
  246. package/plugins/interfaces/mcp/mod.js +26 -26
  247. package/plugins/interfaces/mcp/resources/running.d.ts +1 -1
  248. package/plugins/interfaces/mcp/resources/running.js +1 -1
  249. package/plugins/interfaces/mcp/resources/server.d.ts +6 -13
  250. package/plugins/interfaces/mcp/resources/server.js +19 -24
  251. package/plugins/interfaces/mcp/resources/tools.d.ts +6 -8
  252. package/plugins/interfaces/mcp/resources/tools.js +5 -6
  253. package/plugins/interfaces/mcp/resources/widgets.d.ts +8 -8
  254. package/plugins/interfaces/mcp/resources/widgets.js +1 -1
  255. package/plugins/interfaces/mcp/shared/keys.d.ts +1 -1
  256. package/plugins/interfaces/mcp/shared/settings.d.ts +47 -68
  257. package/plugins/interfaces/mcp/shared/settings.js +27 -43
  258. package/plugins/interfaces/mcp/views/offered.d.ts +1 -2
  259. package/plugins/interfaces/terminal/terminal.js +3 -3
  260. package/plugins/interfaces/terminal/views/shell.js +8 -3
  261. package/plugins/interfaces/voice/actions/call.js +4 -4
  262. package/plugins/interfaces/voice/actions/prune.js +25 -17
  263. package/plugins/interfaces/voice/actions/{hook.d.ts → ring.d.ts} +2 -1
  264. package/plugins/interfaces/voice/actions/ring.js +165 -0
  265. package/plugins/interfaces/voice/collections/blocked.d.ts +1 -1
  266. package/plugins/interfaces/voice/collections/call.d.ts +2 -2
  267. package/plugins/interfaces/voice/contract.d.ts +3 -3
  268. package/plugins/interfaces/voice/mod.d.ts +15 -16
  269. package/plugins/interfaces/voice/mod.js +45 -39
  270. package/plugins/interfaces/voice/routes/hook.d.ts +21 -0
  271. package/plugins/interfaces/voice/routes/hook.js +114 -0
  272. package/plugins/interfaces/voice/routes/relay.d.ts +20 -0
  273. package/plugins/interfaces/voice/{resources → routes}/relay.js +64 -16
  274. package/plugins/interfaces/voice/shared/settings.d.ts +29 -42
  275. package/plugins/interfaces/voice/shared/settings.js +16 -22
  276. package/plugins/interfaces/voice/views/call.d.ts +3 -3
  277. package/plugins/interfaces/voice/views/call.js +1 -1
  278. package/plugins/interfaces/voice/views/message.d.ts +2 -2
  279. package/plugins/interfaces/web/actions/arrive.js +18 -34
  280. package/plugins/interfaces/web/actions/sending.js +2 -2
  281. package/plugins/interfaces/web/actions/spent.js +2 -2
  282. package/plugins/interfaces/web/collections/visitor.d.ts +2 -2
  283. package/plugins/interfaces/web/collections/visitor.js +13 -12
  284. package/plugins/interfaces/web/contract.d.ts +2 -2
  285. package/plugins/interfaces/web/lines.d.ts +17 -18
  286. package/plugins/interfaces/web/lines.js +28 -23
  287. package/plugins/interfaces/web/mod.d.ts +2 -2
  288. package/plugins/interfaces/web/mod.js +6 -6
  289. package/plugins/interfaces/web/resources/spend.js +3 -3
  290. package/plugins/interfaces/web/routes/arrive.d.ts +20 -0
  291. package/plugins/interfaces/web/routes/arrive.js +92 -0
  292. package/plugins/interfaces/web/shared/codes.d.ts +1 -1
  293. package/plugins/interfaces/web/shared/lines.d.ts +43 -54
  294. package/plugins/interfaces/web/shared/lines.js +33 -42
  295. package/plugins/interfaces/web/shared/secret.d.ts +1 -1
  296. package/plugins/interfaces/web/views/console-codes.d.ts +1 -1
  297. package/plugins/interfaces/web/views/console-codes.js +2 -1
  298. package/plugins/interfaces/web/views/console.js +2 -1
  299. package/plugins/interfaces/web/views/default.d.ts +2 -2
  300. package/plugins/interfaces/web/views/default.js +3 -2
  301. package/plugins/interfaces/web/views/frame.js +2 -1
  302. package/plugins/interfaces/web/views/org.js +2 -1
  303. package/plugins/interfaces/web/views/orgs.d.ts +2 -1
  304. package/plugins/interfaces/web/views/orgs.js +2 -1
  305. package/plugins/interfaces/web/views/shell.js +6 -1
  306. package/plugins/interfaces/whatsapp/actions/connect.js +2 -2
  307. package/plugins/interfaces/whatsapp/actions/hook.d.ts +8 -1
  308. package/plugins/interfaces/whatsapp/actions/hook.js +91 -70
  309. package/plugins/interfaces/whatsapp/actions/link.js +2 -2
  310. package/plugins/interfaces/whatsapp/collections/number.d.ts +2 -2
  311. package/plugins/interfaces/whatsapp/collections/number.js +1 -1
  312. package/plugins/interfaces/whatsapp/contract.d.ts +2 -2
  313. package/plugins/interfaces/whatsapp/contract.js +1 -1
  314. package/plugins/interfaces/whatsapp/mod.d.ts +10 -8
  315. package/plugins/interfaces/whatsapp/mod.js +25 -20
  316. package/plugins/interfaces/whatsapp/processors/receive.js +2 -2
  317. package/plugins/interfaces/whatsapp/processors/reply.d.ts +1 -1
  318. package/plugins/interfaces/whatsapp/processors/reply.js +3 -3
  319. package/plugins/interfaces/whatsapp/routes/hook.d.ts +16 -0
  320. package/plugins/interfaces/whatsapp/routes/hook.js +52 -0
  321. package/plugins/interfaces/whatsapp/shared/graph.d.ts +2 -1
  322. package/plugins/interfaces/whatsapp/shared/graph.js +5 -3
  323. package/plugins/interfaces/whatsapp/shared/media.d.ts +2 -1
  324. package/plugins/interfaces/whatsapp/shared/media.js +6 -4
  325. package/plugins/interfaces/whatsapp/shared/number.d.ts +1 -1
  326. package/plugins/interfaces/whatsapp/shared/number.js +21 -21
  327. package/plugins/interfaces/whatsapp/shared/parts.js +1 -1
  328. package/plugins/interfaces/whatsapp/shared/rules.d.ts +3 -1
  329. package/plugins/interfaces/whatsapp/shared/rules.js +7 -2
  330. package/plugins/interfaces/whatsapp/shared/settings.d.ts +19 -33
  331. package/plugins/interfaces/whatsapp/shared/settings.js +8 -20
  332. package/plugins/interfaces/whatsapp/views/message.d.ts +2 -2
  333. package/plugins/interfaces/whatsapp/web.js +2 -2
  334. package/runtime/actor.d.ts +61 -7
  335. package/runtime/actor.js +40 -0
  336. package/{hosts/web → runtime}/address.js +10 -8
  337. package/runtime/api.d.ts +49 -0
  338. package/runtime/api.js +670 -0
  339. package/runtime/body.d.ts +16 -0
  340. package/runtime/body.js +57 -0
  341. package/runtime/browsers.d.ts +27 -16
  342. package/runtime/browsers.js +19 -22
  343. package/runtime/caller.d.ts +18 -9
  344. package/runtime/caller.js +20 -9
  345. package/runtime/client.d.ts +110 -11
  346. package/runtime/client.js +201 -12
  347. package/runtime/collection.d.ts +2 -0
  348. package/runtime/collection.js +2 -1
  349. package/runtime/cookies.d.ts +72 -0
  350. package/runtime/cookies.js +125 -0
  351. package/runtime/define.d.ts +105 -24
  352. package/runtime/executor.d.ts +2 -0
  353. package/runtime/executor.js +13 -4
  354. package/runtime/fetch.d.ts +97 -0
  355. package/runtime/fetch.js +404 -0
  356. package/runtime/links.d.ts +2 -2
  357. package/runtime/mod.d.ts +8 -2
  358. package/runtime/mod.js +8 -2
  359. package/runtime/observe.d.ts +2 -2
  360. package/runtime/observe.js +22 -22
  361. package/runtime/ops.d.ts +9 -1
  362. package/runtime/ops.js +103 -0
  363. package/runtime/owner.d.ts +25 -17
  364. package/runtime/owner.js +279 -40
  365. package/runtime/reads.d.ts +3 -3
  366. package/runtime/reads.js +8 -6
  367. package/runtime/registry.d.ts +15 -3
  368. package/runtime/registry.js +15 -5
  369. package/runtime/rest.d.ts +10 -0
  370. package/runtime/rest.js +247 -0
  371. package/runtime/routes.d.ts +51 -0
  372. package/runtime/routes.js +79 -0
  373. package/runtime/runtime.d.ts +6 -9
  374. package/runtime/runtime.js +9 -7
  375. package/runtime/runtimes.d.ts +43 -0
  376. package/runtime/runtimes.js +86 -0
  377. package/runtime/site.d.ts +45 -0
  378. package/runtime/site.js +164 -0
  379. package/runtime/tickets.d.ts +15 -0
  380. package/{hosts/web → runtime}/tickets.js +25 -4
  381. package/runtime/views.d.ts +1 -3
  382. package/runtime/views.js +7 -10
  383. package/runtime/wire.d.ts +1 -2
  384. package/testing/mod.d.ts +16 -0
  385. package/testing/mod.js +31 -2
  386. package/hosts/orgs/mod.d.ts +0 -128
  387. package/hosts/orgs/mod.js +0 -741
  388. package/hosts/web/entrances.d.ts +0 -250
  389. package/hosts/web/entrances.js +0 -362
  390. package/hosts/web/files.js +0 -116
  391. package/hosts/web/routes.d.ts +0 -179
  392. package/hosts/web/routes.js +0 -312
  393. package/hosts/web/tickets.d.ts +0 -33
  394. package/plugins/access/identity/actions/key.d.ts +0 -2
  395. package/plugins/access/identity/actions/key.js +0 -48
  396. package/plugins/billing/stripe/webhook.d.ts +0 -17
  397. package/plugins/billing/stripe/webhook.js +0 -45
  398. package/plugins/interfaces/api/shared/events.d.ts +0 -26
  399. package/plugins/interfaces/api/shared/events.js +0 -143
  400. package/plugins/interfaces/api/shared/http.d.ts +0 -28
  401. package/plugins/interfaces/api/shared/http.js +0 -93
  402. package/plugins/interfaces/api/shared/reference.d.ts +0 -48
  403. package/plugins/interfaces/api/shared/reference.js +0 -37
  404. package/plugins/interfaces/api/shared/server.d.ts +0 -34
  405. package/plugins/interfaces/api/shared/server.js +0 -177
  406. package/plugins/interfaces/voice/actions/hook.js +0 -225
  407. package/plugins/interfaces/voice/resources/relay.d.ts +0 -79
  408. package/plugins/interfaces/web/resources/entrance.d.ts +0 -47
  409. package/plugins/interfaces/web/resources/entrance.js +0 -83
  410. package/plugins/interfaces/whatsapp/shared/http.d.ts +0 -47
  411. package/plugins/interfaces/whatsapp/shared/http.js +0 -22
  412. /package/{hosts/web/orgs.d.ts → plugins/access/directory/web.d.ts} +0 -0
  413. /package/{hosts/web → runtime}/address.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,584 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 1.0.0-rc.25 — 2026-11-06
4
+
5
+ **Upgrading from rc.24.** The runtime now answers HTTP itself. `runtime.fetch(request)` is a fetch
6
+ handler (a function from a web-standard `Request` to a `Response`) that every host calls; plugins
7
+ declare their HTTP as `routes` (plain functions by URL pattern) and say who a request is with `who`
8
+ (a function from a request to an actor, or nothing); the runtime names and sets every cookie; the
9
+ page is a plugin (`webPage`); and many orgs are the directory's routes, forwarding each request to
10
+ its org's runtime. Every URL, webhook path and cookie name stays as it was, so nobody signs in
11
+ again. Developer keys made before stop working: make them again (step 7). The steps, in order:
12
+
13
+ 1. **Composition: the page is a plugin, and the runtime takes no browser options.** Drop
14
+ `transports: [socket]` and `admit: tickets.admit`: the runtime keeps its own one-time tickets and
15
+ takes its own socket at `/oxian`. Add `webPage` (from `copilotz/web/server`) with a `page`
16
+ resource. What `serve` and `webServer` took as options are resources now: `code`, `title`,
17
+ `lang`, `assets` and `base` go in `page`; `theme` in `theme`; `front: { secret }` is the `caller`
18
+ resource's `front` (beside its `header`); `widgets` go in `widgets`. `code` may be a function
19
+ that bundles once, on the page's first request.
20
+
21
+ ```ts
22
+ // rc.24
23
+ const tickets = createTickets(); // copilotz/web/tickets
24
+ const runtime = await createRuntime({
25
+ store,
26
+ plugins: [...plugins, devSignIn],
27
+ transports: [socket], // copilotz/web/server
28
+ admit: tickets.admit,
29
+ });
30
+
31
+ // now
32
+ const runtime = await createRuntime({
33
+ store,
34
+ plugins: [
35
+ ...plugins,
36
+ devSignIn,
37
+ webPage,
38
+ definePlugin({
39
+ name: "page",
40
+ resources: {
41
+ page: { title: "Notes", code: () => bundle(new URL("./browser.tsx", import.meta.url)) },
42
+ theme: themeOf([]),
43
+ },
44
+ }),
45
+ ],
46
+ });
47
+ ```
48
+
49
+ 2. **Serving: a listener calls `runtime.fetch`.** On Node and Bun, `listen(runtime.fetch, options)`
50
+ from `copilotz/web/node` replaces `serve({ runtime, tickets, code, … })`. It answers a
51
+ `Listener`, whose `shutdown()` stops listening, and you close the runtime yourself
52
+ (`runtime.close({ drain })`). On Deno, `Deno.serve(runtime.fetch)` replaces serving
53
+ `webServer({ …, upgrade })` with Oxian's Deno handler, and needs no `setClientAddress`: the
54
+ runtime reads the socket's address from what `Deno.serve` hands it. On workerd,
55
+ `export default { fetch: runtime.fetch }`. Bun's own `Bun.serve({ fetch: runtime.fetch })` serves
56
+ requests but not the runtime's socket, so use `listen` there.
57
+
58
+ ```ts
59
+ // rc.24
60
+ const server = await serve({ runtime, tickets, code, theme, port: 8080 });
61
+ process.once("SIGTERM", () => server.close({ drain: 8_000 }));
62
+
63
+ // now
64
+ const server = await listen(runtime.fetch, { port: 8080 });
65
+ process.once("SIGTERM", async () => {
66
+ await server.shutdown();
67
+ await runtime.close({ drain: 8_000 });
68
+ });
69
+ ```
70
+
71
+ 3. **Settings: flat named entries, one `caller`, and `ctx.fetch`.** Each interface plugin's resource
72
+ is a map of what the app declares, by name, with no `lines` key. `web.caller` and `mcp.caller`
73
+ are one `caller` resource. `caller.exempt` is the MCP server's own `exempt`, `voice.keep` each
74
+ number's `keep`, and `mcp.atOnce` each server's `limits.atOnce`; `whatsapp.codeMinutes` and
75
+ `whatsapp.maxFileMb` are constants now, and a declared entry's `org` is gone (each org's runtime
76
+ declares its own). Types: `WhatsAppLine` is `DeclaredNumber`, `VoiceLine` `DeclaredVoiceNumber`,
77
+ `McpLine` `DeclaredServer`, `WebLine` `DeclaredSite`, and `McpCaller` `CallerSettings`. Plugin
78
+ code calls outside services through `ctx.fetch` (step 10), so the `whatsapp.graph` setting,
79
+ Stripe's `settings.fetch`, `googleKeys(fetcher)`'s argument and openapi's `fetch` setting are
80
+ gone.
81
+
82
+ ```ts
83
+ // rc.24
84
+ resources: {
85
+ web: {
86
+ caller: { header: "cf-connecting-ip", front },
87
+ lines: { site: { in: "visitors", agent: "guide" } },
88
+ },
89
+ whatsapp: {
90
+ lines: { vendas: { in: "customers", phoneId, token, secret, verify, agent: "mobi" } },
91
+ },
92
+ mcp: { atOnce: 4, lines: { chatgpt: { in: "customers", tools } } },
93
+ }
94
+
95
+ // now
96
+ resources: {
97
+ caller: { header: "cf-connecting-ip", front },
98
+ web: { site: { in: "visitors", agent: "guide" } },
99
+ whatsapp: { vendas: { in: "customers", phoneId, token, secret, verify, agent: "mobi" } },
100
+ mcp: { chatgpt: { in: "customers", tools } },
101
+ }
102
+ ```
103
+
104
+ 4. **Routes: plain functions on a plugin.** The `routes` resource goes, with its three shapes
105
+ (`{ path, action }`, `{ path, serve }`, `{ host, serve }`), `methods`, `HttpRequest`,
106
+ `HttpAnswer` and `Served`. A plugin's `routes` field maps a `URLPattern` pathname to a `Route`:
107
+ `(request, { runtime, actor, params, cookies }) => Response`. A path that took everything under
108
+ it (`"/hooks/"`) is `"/hooks/*"`; a host route is a whole URL pattern (`"*://*-preview.*:*/*"`);
109
+ a route checks its own method. `host.runtime` is `ctx.runtime`, `await host.whom()` is
110
+ `ctx.actor`, `host.host` is the request's own URL (already the site the browser asked for),
111
+ `host.upgrade()` is Oxian's `upgradeWebSocket(request)`, and `host.widgets` is the `widgets`
112
+ resource. A route calls Actions as trusted code, as the system unless it names an actor
113
+ (`runtime.call(name, input, { actor })`): an Action that took an `HttpRequest` behind
114
+ `{ path, action }` takes plain data now, and one only a route calls needs no `allow`.
115
+
116
+ ```ts
117
+ // rc.24
118
+ resources: {
119
+ routes: {
120
+ ping: {
121
+ path: "/hooks/ping",
122
+ methods: ["POST"],
123
+ serve: async (request, host) =>
124
+ Response.json(await host.runtime.call("relay.ping", { body: await request.text() })),
125
+ },
126
+ },
127
+ },
128
+
129
+ // now
130
+ routes: {
131
+ "/hooks/ping": async (request, { runtime }) => {
132
+ if (request.method !== "POST") return new Response("Only POST", { status: 405 });
133
+ return Response.json(await runtime.call("relay.ping", { body: await request.text() }));
134
+ },
135
+ },
136
+ ```
137
+
138
+ 5. **Sign-in: plugins' routes, `who`, and the runtime's cookies.** The `entrances` and `signIn`
139
+ resources go. Apps on `googleSignIn` and `devSignIn` change nothing: their routes are
140
+ `POST /signin/google` (with `GET /google` for the button's client id) and `/signin/dev`, which
141
+ the page already used. A sign-in method of your own is a plugin built on identity whose route
142
+ calls its Action and answers with identity's `signedIn` (from `copilotz/plugins/access`), which
143
+ sets the session's cookie. A credential of your own (an entrance's `cookie` and `query`) is a
144
+ plugin's `who`, and its cookie is set and cleared with `ctx.cookies`: no plugin writes
145
+ `Set-Cookie`. Identity's `POST /signout` ends the session, disconnects its browsers and clears
146
+ its cookie; its `GET /me` says whom the page shows.
147
+
148
+ ```ts
149
+ // rc.24
150
+ resources: {
151
+ signIn: { mine: { action: "mine.sign-in" } },
152
+ entrances: { badge: { cookie: "badge", query: "badge.actor" } },
153
+ },
154
+
155
+ // now
156
+ definePlugin({
157
+ name: "mine-sign-in",
158
+ requires: ["identity"],
159
+ actions: { "mine.sign-in": signInAction }, // answers { person, session }, as before
160
+ routes: {
161
+ "/signin/mine": async (request, { runtime, cookies }) =>
162
+ signedIn(cookies, await runtime.call("mine.sign-in", await request.json())),
163
+ },
164
+ who: (_request, { cookies, query }) => {
165
+ const secret = cookies.get("badge");
166
+ return secret ? query("badge.actor", { secret }) : null;
167
+ },
168
+ });
169
+ ```
170
+
171
+ 6. **The site chat: its own route.** `web({ arrive: { line } })` is `web({ arrive: { name } })`. The
172
+ page posts to the site chat's route, `POST /web/<name>` (with `{ challenge }` when it has one),
173
+ before it connects, and `/connect` takes no JSON. `contact.arrive` loses its `secret` input. The
174
+ cookie (`visitor`) and the limits are the same.
175
+
176
+ ```tsx
177
+ // rc.24
178
+ await web({ root, plugins: [siteShell, chatWeb], arrive: { line: "site", challenge: token } });
179
+
180
+ // now
181
+ await web({ root, plugins: [siteShell, chatWeb], arrive: { name: "site", challenge: token } });
182
+ ```
183
+
184
+ 7. **Keys: members of their space, with a scope.** Every key is the api plugin's, and every key has
185
+ a scope: `api_key.create` takes `scope` (`call`, `query`, `view`, `read`, `write`) in place of
186
+ `actions`, `queries` and `views`, and `apiPresets` are `{ title, description, scope }`. An Action
187
+ that takes a space gets no default from a key: the key names `in`. Identity's unscoped keys
188
+ (`key.create`, `key.revoke`, `credential.keys`) are gone. Keys made before stop working: make
189
+ them again.
190
+
191
+ ```ts
192
+ // rc.24
193
+ await runtime.call("api_key.create", {
194
+ in: space,
195
+ name: "Bot",
196
+ actions: ["chat.send"],
197
+ queries: ["thread.recent"],
198
+ }, { actor });
199
+
200
+ // now
201
+ await runtime.call("api_key.create", {
202
+ in: space,
203
+ name: "Bot",
204
+ scope: { call: ["chat.send"], query: ["thread.recent"] },
205
+ }, { actor });
206
+ ```
207
+
208
+ 8. **REST and the client.** `/api/` is the runtime's own now (the api plugin's `serveApi` is gone),
209
+ answered for whoever `who` says: a key, a session from the app's own page, or anonymous. Its
210
+ paths are unchanged, with more beside them (below). A View over `/api/` asked with `?follow=1` is
211
+ asked with `Accept: text/event-stream`, and `?id=` is `?item=` (the item, as JSON). A script
212
+ connects with the client instead of hand-made requests, over the socket or over HTTP, and its
213
+ collections are spelled as plugin code's.
214
+
215
+ ```ts
216
+ // rc.24
217
+ const headers = { authorization: `Bearer ${key}`, "content-type": "application/json" };
218
+ await fetch(`${app}/api/actions/booking.cancel`, {
219
+ method: "POST",
220
+ headers,
221
+ body: '{"id":"42"}',
222
+ });
223
+ await fetch(`${app}/api/views/booking.panel?id=42&follow=1`, { headers });
224
+
225
+ // now
226
+ const client = await connect(app, { key }); // the socket; { key, over: "http" } for the REST API
227
+ await client.call("booking.cancel", { id: "42" });
228
+ const stop = client.db.collection("booking").watch({ _id: "42" }, (rows) => show(rows));
229
+ // by hand: GET /api/views/booking.panel?item={"_id":"42"}, with Accept: text/event-stream
230
+ ```
231
+
232
+ 9. **Many orgs: the directory's routes.** `orgsHost` (`copilotz/orgs`) goes. The directory's runtime
233
+ is the app's `fetch`, and its plugin's routes forward each request, untouched and sockets
234
+ included, to its org's runtime. Its `directory` resource takes the orgs' runtimes as a pool
235
+ (`orgs`: `runtimes(open)`, from `copilotz`) and a `lobby` for someone signed in nowhere (a
236
+ runtime with the page), beside `staff` and `operations`; `hosts` is the `hosts` resource's `own`.
237
+ Each org's runtime gets `directory.member(dir, org)`, in place of what `open` was given
238
+ (`plugins`, `admit`, `transports`) and of `here(org)`. `listen(dir.fetch)` carries sockets too:
239
+ no `hypervisor` picker. `org.get` is the `org.info` query, and front ends import the orgs'
240
+ browser half (`useOrgs`, `enterOrg`…) from `copilotz/plugins/access/web`. Stripe's webhook is the
241
+ `stripeWebhook` plugin, in the directory's runtime with the pool as the `stripe` resource's
242
+ `orgs` (below).
243
+
244
+ ```ts
245
+ // rc.24
246
+ const host = orgsHost({
247
+ directory: await createRuntime({ store, plugins: [identity, directory, devSignIn] }),
248
+ open: async (org, given) =>
249
+ await createRuntime({
250
+ store: storeOf(org),
251
+ plugins: [...plugins, ...given.plugins],
252
+ transports: given.transports,
253
+ admit: given.admit,
254
+ browsers: given.browsers,
255
+ }),
256
+ upgrade: () => new Response("Connect again", { status: 503 }),
257
+ code,
258
+ theme,
259
+ });
260
+ await listen({ fetch: host.serve, hypervisor: (r) => host.openRuntime(r)?.hypervisor, port });
261
+
262
+ // now
263
+ const orgs = runtimes(async (id) => {
264
+ const org = await dir.query<OrgInfo | null>("org.info", { org: id });
265
+ if (!org) return undefined;
266
+ return await createRuntime({
267
+ store: await storeOf(org),
268
+ plugins: [...plugins, ...page, directory.member(dir, org)], // page: webPage and its resource
269
+ browsers: { pool: visitors }, // const visitors = contactsPool()
270
+ });
271
+ });
272
+ const lobby = await createRuntime({ store: memoryStore(), plugins: page });
273
+ const dir: Runtime = await createRuntime({
274
+ store,
275
+ plugins: [
276
+ identity,
277
+ directory,
278
+ devSignIn,
279
+ definePlugin({
280
+ name: "directory-settings",
281
+ resources: { directory: { orgs, lobby } },
282
+ }),
283
+ ],
284
+ });
285
+ await listen(dir.fetch, { port });
286
+ ```
287
+
288
+ 10. **Tests: `testWho`, `ticketFor`, `runtime.fetch` and `createRuntime({ fetch })`.** A test that
289
+ made browsers with `createRuntime({ admit })` adds `testWho` (from `copilotz/testing`: a `who`
290
+ that believes the `x-test-actor` header, for tests alone) and takes each ticket from the
291
+ runtime's `/connect` with `ticketFor(runtime, actor)`. HTTP needs no listener:
292
+ `await runtime.fetch(new Request(url, init))`. A fake outside service (Meta's Graph API, Stripe,
293
+ Google's keys) is the `fetch` the runtime gives plugin code, as `clock` is replaced.
294
+
295
+ ```ts
296
+ // rc.24
297
+ const tickets = new Map<string, Actor>();
298
+ const runtime = await createRuntime({
299
+ store,
300
+ plugins: [
301
+ ...plugins,
302
+ definePlugin({ name: "t", resources: { whatsapp: { graph: fake.url } } }),
303
+ ],
304
+ transports: [transport],
305
+ admit: (secret) => tickets.get(secret),
306
+ });
307
+ const ticket = () => {
308
+ const secret = crypto.randomUUID();
309
+ tickets.set(secret, ana);
310
+ return Promise.resolve(secret);
311
+ };
312
+
313
+ // now
314
+ const runtime = await createRuntime({
315
+ store,
316
+ plugins: [...plugins, testWho],
317
+ transports: [transport],
318
+ fetch: fakeMeta,
319
+ });
320
+ const ticket = () => ticketFor(runtime, ana);
321
+ const hook = await runtime.fetch(new Request("http://localhost/hooks/whatsapp/vendas", init));
322
+ ```
323
+
324
+ **What changes, and what goes:**
325
+
326
+ - **`runtime.fetch(request, info?)`** answers every request: a route with a host first (a host it
327
+ takes is that route's alone); the socket (`/oxian`, and `<base>/oxian`); then requests from other
328
+ sites are refused; `POST /connect`; the REST API (`/api/`); plugins' routes; `GET /health` when no
329
+ route takes it (`ok`); else a 404. What a listener passes beside the request (Deno's `info`, Bun's
330
+ server) says the socket's address. Another runtime's route may forward a request to it
331
+ (`other.fetch(request)`), sockets included: a socket `Deno.serve` gave stays Deno's to accept. The
332
+ runtime accepts its own socket: Deno's upgrade under `Deno.serve`, a `WebSocketPair` on workerd
333
+ (not tested yet), else Oxian's route upgrade, whose decision `listen` takes directly (Oxian
334
+ 0.23.4's asynchronous `prepare`).
335
+ - **The site** is decided once, before anything else: the address the browser asked for, on the host
336
+ the app's front says when the request carries the front's secret (`x-copilotz-front`, the `caller`
337
+ resource's `front`; then `x-forwarded-host`), and under the app's base (`resources.page.base`: a
338
+ route sees `/o/acme/x` as `/x`). Routes are matched, and cookies named and secured, by it. Without
339
+ the secret, forwarded headers are ignored.
340
+ - **Requests from other sites are refused** (403), in one rule in place of the web host's
341
+ `fromPage`: a request that may change something (anything but GET, HEAD and OPTIONS), whose
342
+ `Sec-Fetch-Site` isn't `same-origin` (or `none`) or whose `Origin` isn't the site's own, unless it
343
+ carries `Authorization`. It holds for every route, not only `/connect`; a sibling host under the
344
+ same domain is another site; webhooks send no `Origin`, and pass. So an MCP server's `origins`
345
+ lets a browser's call through only with `Authorization`.
346
+ - **`resources.hosts`** (`{ own: ["app.example.com", "*.run.app"] }`): the app's own hosts. With
347
+ them named, a request to any other host is answered only by routes that take its host (a 404 when
348
+ none does), never by the runtime's paths, its socket or `/connect`; and the app's own hosts are
349
+ never a host route's. A host route for every host (`*`) takes only hosts that aren't the app's
350
+ own: with none named, none.
351
+ - **`who`** (`Plugin.who`, the `Who` and `WhoContext` types): asked in plugin order, once per
352
+ request and when `/connect` issues a ticket; the first answer wins, and none is anonymous
353
+ (`{ kind: "anonymous", id: "" }`). A `who` can't answer the system. What it queries is kept five
354
+ seconds per query and params, and dropped when the actor is disconnected. `WhoContext` has
355
+ `resources`, `query` and `call` (as the system: the api plugin notes a key's last use) and
356
+ `cookies.get`. A request with both a session cookie and a key is whoever the first plugin in order
357
+ says (usually the cookie). A store's failure while asking is a 500, never anonymous.
358
+ - **Routes** (`Plugin.routes`, the `Route` and `RouteContext` types): matched more specific first,
359
+ segment by segment (a literal before a parameter before a wildcard, deeper before shallower), `/*`
360
+ last, and among patterns alike in plugin order; a later plugin's route replaces an earlier one of
361
+ the same pattern, and `null` removes it. A route that isn't a pattern, or takes `/connect`,
362
+ `/oxian`, `/api` or anything under `/api/`, stops the runtime from starting. What a route throws
363
+ answers by its code: `invalid` 400, `unauthorized` 401, `forbidden` 403, `not_found` 404,
364
+ `too_many` 429 (with `retry-after`), anything else 500 (logged), its words only when they're
365
+ public.
366
+ - **Cookies** (`ctx.cookies`, the `Cookies` type): `get(name)`,
367
+ `set(name, secret, { days, sameSite })` and `clear(name, { sameSite })`, by the plain name; the
368
+ runtime puts them on the route's response. Every cookie is httpOnly, `Path=/`, with no `Domain`;
369
+ `Secure` and named `__Host-<name>` anywhere but plain http to this machine or one on its network;
370
+ `SameSite=Lax` (30 days) unless said. A value is 1 to 512 cookie-safe characters (letters, digits
371
+ and `._~+/=-`): a short one is fine where it's no secret; a cookie holding anything else reads as
372
+ none. A response that sets or clears one is `no-store`. A name is the first plugin's to set;
373
+ another may only when one builds on the other (`requires`), or both on the same one (Google's and
374
+ dev sign-in's, and the directory's sign-out, all set identity's session); anything else is a
375
+ plugin's mistake, and a 500. The `cookies` resource (`{ names, suffix }`, the `CookieSettings`
376
+ type) renames them: `names` maps a name to the one it goes by, and `suffix` follows every other.
377
+ - **Cookies the web host kept, and no longer does:** a leftover plain `session` cookie beside
378
+ `__Host-session` is no longer cleared (it's ignored); a cookie that proves no one (forged, ended)
379
+ is no longer cleared, and reads as nobody; `POST /signout` clears identity's `session` only (a
380
+ site visitor's cookie stays).
381
+ - **Tickets are the runtime's** (`runtime/tickets.ts`): one works once, for a minute; an actor has
382
+ 30 a minute (`browsers.tickets`), past which `/connect` is a 429 with `retry-after`. Disconnecting
383
+ an actor ends its tickets not yet used; a person's key has its own, apart from its person's.
384
+ `createRuntime`'s `admit` is gone, and the runtime always has a key for remote executors (a new
385
+ one each start, unless given).
386
+ - **`POST /connect`** (POST only: else 405) answers `{ ticket, actor: { kind, id } }` (no `name`:
387
+ the page asks `GET /me`), 401 for anonymous, and reads no body: arriving at a site chat is
388
+ `POST /web/<name>`.
389
+ - **Checked at start:** routes' patterns, `page.base` (a path with no trailing slash), the `cookies`
390
+ and `hosts` resources, and the `links` secret (too short to sign with stops the start, rather than
391
+ failing each link).
392
+ - **New in `copilotz`:** `runtimes` and `Runtimes`; `connect` and the client's types
393
+ (`ClientCollection`, `RemoteOptions`, `Watcher`…); `inScope` and `Scope`; `clientAddress`,
394
+ `setClientAddress` and `loopbackAddress` (were in `copilotz/web/server`); `bodyOf` and `jsonOf`;
395
+ `cookieSafe` and `CookieSettings`; `hostMatches`, `HostsSettings`, `ownHost`, `vouched`,
396
+ `loopback` and `nearby`; `callerOf` and `exemptProblem`; and the `Route`, `RouteContext`, `Who`,
397
+ `WhoContext` and `Cookies` types.
398
+ - **`runtimes(open, { idleMs })`:** runtimes by id, each opened on its first `get`, the same one
399
+ after (a failed opening is tried again), closed once idle (no browsers, nothing pending, 30
400
+ minutes unless said) and opened again on its next use; `peek(id)` and `entries()` never open one;
401
+ `close(id)` closes one now, and a `get` meanwhile opens another only once it has closed, so one id
402
+ never has two writers; `close()` closes them all.
403
+ - **`listen(fetch, { hostname, port, signal })`** (was `listen({ fetch, hypervisor, … })`) serves
404
+ any fetch handler on Node, Bun and Deno through Oxian's Node adapter, sockets included, and
405
+ answers a `Listener` (`url`, `finished`, `shutdown()`). `serve`, `ServeOptions` and `Server` are
406
+ gone.
407
+ - **The page plugin** (`webPage`, `copilotz/web/server`): `/app/*` (the code; the entry `no-cache`,
408
+ chunks kept a year), `/assets/*`, `/manifest.webmanifest`, `/sw.js`, and `/*` for GET navigations
409
+ only (`Sec-Fetch-Mode: navigate`, or an `Accept` with HTML, `*/*` or none): a script's `fetch`
410
+ there is a 404, not the page. Its `/*` takes `GET /health` too, so the runtime's `ok` answers only
411
+ an app without a page (with a page, `/health` was the page before as well). It refuses to start
412
+ without `page.code`. The page tells its code the base (`appBase()`), and its `/connect` and socket
413
+ follow it.
414
+ - **The page in the browser:** `web()` posts to `/web/<name>` first when it arrives as a visitor
415
+ (`arrive: { name, challenge? }`), asks identity's `GET /me` for the person's name while it takes
416
+ its ticket, and finds the ways to sign in by asking `GET /google` and `GET /signin/dev`.
417
+ - **Sign-in and sign-out are plugins' routes:** identity's `POST /signout` (ends the session,
418
+ disconnects whoever it was, clears the cookie) and `GET /me` (401 for anyone but a person), and
419
+ its contract's `signedIn` (sets the session's cookie, `SameSite=Lax` so an OAuth redirect back
420
+ carries it, and answers `{ person }`); Google's `POST /signin/google` (`{ idToken }`) and
421
+ `GET /google` (the first client id, cached five minutes); dev sign-in's `/signin/dev` (GET says
422
+ it's there, POST `{ name }` signs in), from this machine only, as before. Nothing refuses to start
423
+ with a recorded sign-in Action any more (the web host did): keep yours `record: false`, since its
424
+ answer is the session's secret. `credential.revoke` (taking someone out of an org) disconnects
425
+ their browsers and drops what `who` kept for them, so their next request is nobody at once.
426
+ - **Webhooks and other plugins' HTTP are routes; their URLs are unchanged:**
427
+ - WhatsApp: `/hooks/whatsapp/*` does Meta's handshake and checks the signature, then calls
428
+ `whatsapp.receive` with `{ number, payload }`; `whatsapp.number` finds a number by its path.
429
+ Both are the system's (no `allow`); `whatsapp.hook` is gone. `hookRoute` is exported, for a
430
+ number's own path.
431
+ - Voice: `/hooks/voice/<name>` and `/hooks/voice/<name>/over` check Twilio's signature and call
432
+ `voice.ring` and `voice.hangup` (`voice.hook` is gone); `/hooks/voice/<name>/relay` takes the
433
+ call's socket with Oxian's `upgradeWebSocket`.
434
+ - MCP: `/mcp/*`, finding the app's widgets in the `widgets` resource (was
435
+ `webServer({ widgets })`).
436
+ - Maintenance: `/maintenance/*`; an org's runtime (`resources.org`) still never serves it.
437
+ - Chat: `GET /files/<id>` is chat's route (was the web host's), read as whoever the request is, or
438
+ by a link signed for the file.
439
+ - Connected accounts: `GET /accounts/callback/<provider>` calls `account.callback` with
440
+ `{ provider, code, state, error? }` as the session's person, and sends them back to Connected
441
+ accounts.
442
+ - Computers: previews are one route for every host shaped like a preview's
443
+ (`*://*-preview.*:*/*`), answering only for the app's `previews.domain`, with the grant at
444
+ `/__copilotz/previews/grant`; a release's downloads (`computerDownloads({ dir })`) are
445
+ `/computer/download/*`.
446
+ - Stripe: `stripeWebhook` is a plugin (was a function the app routed to by hand),
447
+ `POST /__stripe/<seller>`: it checks the signature on the raw text, reads the event as facts
448
+ (`stripe.fact`, asking Stripe for a dispute's charge through `ctx.fetch`), and hands them to the
449
+ org's runtime as `billing.apply` under the event's id. Which runtime is the org's: the `stripe`
450
+ resource's `orgs` (the directory's pool), or without them this runtime, when the event is for
451
+ its org. The plan an org goes back to is the `billing` resource's `start` ("free" unless said),
452
+ not a `start` option. What can be tried again answers 500; what never can, 200.
453
+ - The cloud pool: its VMs' socket (`/__pool/oxian`) is `cloudPool`'s route, answered by its
454
+ runtime's own socket.
455
+ - **The site chat:** `POST /web/<name>` limits newcomers by address, runs the site's challenge,
456
+ calls `contact.arrive` and sets the visitor cookie (`SameSite=Strict`); the site chat's `who`
457
+ reads it. `contact_visitor.actor` now answers a visitor that hasn't spoken yet too.
458
+ - **`ctx.fetch`** (`Context.fetch`, `ReadContext.fetch`): what plugin code calls outside services
459
+ with, in Actions, Processors and queries, remote executors included; the platform's `fetch` unless
460
+ `createRuntime({ fetch })` gives another. Adapters stay for real ports (model providers).
461
+ - **The REST API is the runtime's own** (`/api/`, answered by `runtime.fetch` for whoever `who`
462
+ says): collections (`GET /api/collections/<name>?filter=…`, `…/<id>`; `POST`, `PATCH`, `PUT`,
463
+ `DELETE`), Actions by the caller's own call id (`Idempotency-Key`), queries (`GET ?params=` or
464
+ `POST`), Views, emits (`POST /api/events/<type>`), the events stream, and the reference
465
+ (`GET /api/`); any GET with `Accept: text/event-stream` is a watch. A credential that proves
466
+ nobody is a 401, and so is a refusal to anonymous. Any origin may call it with a key; with a
467
+ session's cookie, only the app's own page. Streams end at once when their actor is disconnected,
468
+ and at each ping (every 20 s, on the runtime's clock) when `who` says someone else. The api
469
+ plugin's `serveApi`, `Served`, its own HTTP, events and reference, and its `api_key.see` and
470
+ `api_key.get` queries are gone; the reference says `actor` (no `key` record).
471
+ - **Direct writes from outside** (REST, and the socket's new `core.write`): only where a rule speaks
472
+ for the collection's writes (`Guard`'s operation gains `direct`), never `sys.*`, never a private
473
+ field (nor a filter, sort or update that names one, over the socket too; a replacement keeps
474
+ them), within the caller's reach, schema-checked, and recorded as the caller's events.
475
+ **Breaking:** plugins' records change through their Actions: their rules refuse direct writes for
476
+ spaces, memberships, invitations and requests; identity's people and sessions; keys; contacts;
477
+ chat's messages, `live`, threads, files and what was shown (`shown`); memories; skills and their
478
+ files; routines and their runs; the computers plugin's records; apps; cloud computers; agents;
479
+ accounts; WhatsApp's phones and numbers; and voice blocks. Still writable directly, each under its
480
+ rule: apps' own collections (an app guards its own the same way when its rules assume its
481
+ Actions). Following events or watching a read holds a request open: an anonymous caller gets 401.
482
+ The events stream follows the rules: a change is sent when the reader's rule matches the event's
483
+ document.
484
+ - **Identity: only a session proves someone.** `credential.actor` asks for `kind: "session"`: a key
485
+ identity made before (`kind: "key"`, unscoped) proves nobody.
486
+ - **The client** (`connect`, from `copilotz` and `copilotz/web`): `client.db.collection(name)`
487
+ (`find` with `.toArray()`, `findOne`, `countDocuments`, `insertOne`, `updateOne`, `replaceOne`,
488
+ `deleteOne`, `query`, `watch(filter, options?, onChange)`), `client.call(action, input, { id })`,
489
+ and `connect(url, { key, over: "socket" | "http", plugins?, fetch? })` for scripts, beside the
490
+ page's `connect({ transport, ticket, plugins })`. The socket gains a call's own id.
491
+ - **Developer keys** are members of their space, with a scope. A key's actor is
492
+ `{ kind: "person", id, key, scope }` (`within` is gone): `people` still lets it in and `inPerson`
493
+ keeps it out. It's a member of its space (`key:<id>`), an editor when its scope calls or writes,
494
+ else a viewer, never more than its person may be there, and reaches what both its membership and
495
+ its person reach, with no org role (an admin's key reaches only its space). Its `scope` (exact
496
+ names, no wildcards) is checked by the runtime (`inScope`) only where a call from outside comes
497
+ in: calls, queries, Views rendered for it, direct reads and writes; a scoped actor emits nothing.
498
+ Never inside a job: an Action it may call writes as usual. `api_key` records keep `scope` and
499
+ `role`; their id is the start of the secret's hash (`hash` is private); they live in their space
500
+ (`shared`), where its members see them in the Members tab and its managers revoke them.
501
+ `api_key.actor` answers the actor; `api_key.revoke` (its person, or a manager) ends the key, its
502
+ membership and its connections, and so does its person leaving the space or the org;
503
+ `ctx.disconnect` of a key ends only its own. Spaces add `spaceMembers` (a section of the Members
504
+ tab). A key's default space is gone: the runtime knows no spaces, and REST and the socket must
505
+ behave the same.
506
+ - **Identity makes no keys:** `key.create`, `key.revoke` and `credential.keys` are gone, and a
507
+ credential is a session. People and sessions change only through identity's Actions.
508
+ - **Many orgs, by forwarding** (see design/tenancy.md): the directory's routes forward `/o/<org>/…`
509
+ to that org (404 for none, 403 when suspended), `/*` to the org the browser is in (a page asked
510
+ for without a session there goes in first, to the org they were in, else their last, else their
511
+ own, made now, then 302s back), and a host an org claimed to that org's host routes; anything else
512
+ for someone signed in nowhere is the lobby's (without one, a 401). Entering an org (`POST /orgs`,
513
+ `/orgs/enter`, `/orgs/invites/answer`, and a page's way in) is `org.enter`, then a signed handoff,
514
+ a minute long and never out of the process, to the org's own `POST /enter`, which keeps who they
515
+ are, joins them the first time, starts its session and sets its cookie (`s_<org>`). The
516
+ directory's own: `GET /orgs`, `POST /signout` out of every org it holds a session for (each ended
517
+ where its org is open; signing out never opens one), staff's `/console/orgs…` and
518
+ `/console/codes…`, and the front's `/__copilotz/hosts/resolve` on any host. `directory.member`
519
+ gives each org's runtime `resources.org` (id, name, kind, address), `page.base`, its cookies'
520
+ names (`{ names: { session: "s_<org>" }, suffix: "_<org>" }`), the app's own hosts, the
521
+ directory's hooks (invitations, leaving, renaming, claiming and releasing hosts, gift codes) and
522
+ its `/enter`. The directory's session is still `__Host-dir` (the directory plugin's `cookies`
523
+ resource), and which org a browser is in, `__Host-org`. `org.info` (a query, in place of the
524
+ `org.get` Action) is kept 10 seconds, hosts' claims a minute, each forgotten at once when the
525
+ directory changes it. The orgs host's tests are ported (`plugins/access/tests/orgs*.test.ts`).
526
+ - **Removed entry points and exports:** `copilotz/web/tickets` (`createTickets`) and `copilotz/orgs`
527
+ (`orgsHost`). From `copilotz/web/server`: `webServer`, `WebServerOptions`, `socket`, `Entrance`,
528
+ `SignIn`, `Arrived`, `Door`, `Whom`, `whomOf`, `cookieOf`, `hostCookie`, `setCookie`, `siteOf`,
529
+ `ANONYMOUS` (write `{ kind: "anonymous", id: "" }`), `Front`, `hostOf`, `HttpRequest`,
530
+ `HttpAnswer`, `httpRequest`, `Route` (now the runtime's, a function), `RouteSocket` and `Served`;
531
+ `clientAddress`, `setClientAddress` and `hostMatches` moved to `copilotz`. From `copilotz/web`:
532
+ the orgs' browser half (now `copilotz/plugins/access/web`). From `copilotz/web/node`: `serve`,
533
+ `ServeOptions` and `Server`. From `copilotz/plugins/interfaces`: `serveApi`, `WebLine` and the
534
+ other `*Line` types. The `entrances`, `signIn` and `routes` resources; `createRuntime`'s `admit`;
535
+ the actor's `within`; `whatsapp.hook` and `voice.hook`.
536
+
537
+ - **Oxian 0.23.5:** the Node adapter keeps an error listener on each request and response for their
538
+ whole life, so a client leaving mid-response (a server-sent stream it stops) never reaches the
539
+ process as an unhandled error (it did under Bun).
540
+
541
+ ## 1.0.0-rc.24 — 2026-11-06
542
+
543
+ **Upgrading from rc.23** (two breaking renames; no aliases, no data moves):
544
+
545
+ 1. **Views are found by name alone; the medium is gone.** Flatten `views`:
546
+ `{ "booking.panel": { web: BookingPanel } }` becomes `{ "booking.panel": BookingPanel }` (`Views`
547
+ is `Record<string, View>`). `render(medium, name, item, options)` and
548
+ `observe(medium, name, item, options)` lose their first argument:
549
+ `ctx.render("llm", "thread", t)` is `ctx.render("llm.thread", t)`,
550
+ `client.observe("web", "booking.panel", item)` is `client.observe("booking.panel", item)`.
551
+ `ViewContext` loses `medium`, and its `kind` is now `name`. `ctx.show(name, item)` shows exactly
552
+ the View it names: there is no inheritance by place. The `"*"` fallback is gone; the hosts ask
553
+ for their own default (`web.default`, `terminal.default`) when a name has no View.
554
+ `runtime.describe().views` is the list of names. `GET /api/views/<name>` takes the name
555
+ (`llm.thread`) and no longer reads `?medium=`; API keys that list a View by `thread` or `message`
556
+ list `llm.thread` or `llm.message`. An MCP widget's `_meta` names the View without a medium.
557
+ Where the same thing is shown in several places the name takes the place as a prefix; seven kinds
558
+ were renamed:
559
+ | Was | Is |
560
+ | ------------------------- | ------------------------------------------------------------------------------------------- |
561
+ | `message` | `llm.message`, `web.message`, `terminal.message`, `whatsapp.message`, `voice.message` |
562
+ | `thread` | `llm.thread`, `web.thread`, `terminal.thread` |
563
+ | `memory` | `llm.memory`, `terminal.memory` |
564
+ | `live`, `shell`, `spaces` | `web.live`, `web.shell`, `web.spaces`; `terminal.live`, `terminal.shell`, `terminal.spaces` |
565
+ | `*` | `web.default`, `terminal.default` |
566
+
567
+ Every other name stays (`tool:<name>`, `context:<name>`, `addition:<name>`, `mcp:offered`, and
568
+ the rest). The last plugin to register a name still wins, so an app replaces WhatsApp's message
569
+ with its own `whatsapp.message`. A page's address still names its View as before
570
+ (`/thread/<id>`): the web shell looks for that name, then `web.<name>`, then `web.default` (hint
571
+ `of` names the address's kind); the terminal's `open` does the same with `terminal.`.
572
+ 2. **The anonymous actor is `anonymous`, not `visitor`:** a request nobody is signed in to is
573
+ `{ kind: "anonymous", id: "" }` (`VISITOR` is `ANONYMOUS` in `copilotz/web/server`). Rules that
574
+ named `visitor` name `anonymous` (identity's `callback` allows `person` or `anonymous`). The
575
+ `visitor` entrance and its cookie keep their names. `runtime/actor.ts` now lists all six kinds
576
+ (person, agent, contact, system, maintenance, anonymous); `routine` is an origin and `space` a
577
+ kind of member, not actors.
578
+
579
+ - **Oxian 0.23.4:** its adapters await an asynchronous `prepare`, so a front serving several
580
+ runtimes behind one listener can open the right one before deciding a socket upgrade.
581
+
3
582
  ## 1.0.0-rc.23 — 2026-11-05
4
583
 
5
584
  **Upgrading from rc.22** (three renames and one host change; nothing else needs doing):