copilotz 1.0.0-rc.22 → 1.0.0-rc.24

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 (255) hide show
  1. package/CHANGELOG.md +292 -0
  2. package/README.md +198 -91
  3. package/hosts/orgs/mod.d.ts +33 -13
  4. package/hosts/orgs/mod.js +183 -84
  5. package/hosts/terminal/contract.d.ts +1 -1
  6. package/hosts/terminal/host.js +1 -1
  7. package/hosts/web/address.d.ts +11 -0
  8. package/hosts/web/address.js +46 -0
  9. package/hosts/web/assets.js +11 -5
  10. package/hosts/web/entrances.d.ts +250 -0
  11. package/hosts/web/entrances.js +362 -0
  12. package/hosts/web/host.d.ts +15 -3
  13. package/hosts/web/host.js +32 -19
  14. package/hosts/web/lazy.js +1 -1
  15. package/hosts/web/mod.d.ts +4 -2
  16. package/hosts/web/mod.js +6 -0
  17. package/hosts/web/node/bundle.d.ts +5 -0
  18. package/hosts/web/node/bundle.js +1 -1
  19. package/hosts/web/node/mod.d.ts +6 -4
  20. package/hosts/web/node/mod.js +6 -4
  21. package/hosts/web/node/serve.d.ts +20 -23
  22. package/hosts/web/node/serve.js +10 -21
  23. package/hosts/web/palette/sources.js +1 -1
  24. package/hosts/web/routes.d.ts +25 -19
  25. package/hosts/web/routes.js +59 -35
  26. package/hosts/web/server.d.ts +89 -44
  27. package/hosts/web/server.js +208 -108
  28. package/hosts/web/signin.d.ts +7 -10
  29. package/hosts/web/signin.js +6 -3
  30. package/hosts/web/surface.d.ts +20 -0
  31. package/hosts/web/surface.js +42 -0
  32. package/hosts/web/theme/css.d.ts +2 -1
  33. package/hosts/web/theme/css.js +9 -2
  34. package/hosts/web/tickets.d.ts +14 -1
  35. package/hosts/web/tickets.js +30 -7
  36. package/hosts/web/widget.d.ts +31 -0
  37. package/hosts/web/widget.js +429 -0
  38. package/hosts/web/widgets.d.ts +43 -0
  39. package/hosts/web/widgets.js +117 -0
  40. package/package.json +6 -2
  41. package/plugins/access/accounts/actions/callback.js +1 -1
  42. package/plugins/access/accounts/web.js +3 -3
  43. package/plugins/access/contacts/actions/forget.js +3 -1
  44. package/plugins/access/contacts/collections/contact.d.ts +2 -2
  45. package/plugins/access/contacts/collections/contact.js +1 -1
  46. package/plugins/access/contacts/contract.d.ts +5 -5
  47. package/plugins/access/contacts/contract.js +5 -5
  48. package/plugins/access/contacts/mod.d.ts +4 -0
  49. package/plugins/access/contacts/mod.js +5 -1
  50. package/plugins/access/contacts/views/contact.js +2 -1
  51. package/plugins/access/dev/actions/sign-in.d.ts +1 -0
  52. package/plugins/access/dev/actions/sign-in.js +38 -0
  53. package/plugins/access/dev/mod.d.ts +17 -0
  54. package/plugins/access/dev/mod.js +31 -0
  55. package/plugins/access/dev/shared/nearby.d.ts +2 -0
  56. package/plugins/access/dev/shared/nearby.js +27 -0
  57. package/plugins/access/directory/actions/invite.js +2 -2
  58. package/plugins/access/directory/actions/org.js +11 -8
  59. package/plugins/access/directory/collections/credit-code.d.ts +1 -1
  60. package/plugins/access/google/mod.d.ts +4 -2
  61. package/plugins/access/google/mod.js +15 -2
  62. package/plugins/access/identity/actions/session.js +3 -3
  63. package/plugins/access/identity/mod.d.ts +4 -2
  64. package/plugins/access/identity/mod.js +17 -2
  65. package/plugins/access/mod.d.ts +7 -0
  66. package/plugins/access/mod.js +1 -0
  67. package/plugins/access/spaces/mod.js +2 -2
  68. package/plugins/access/spaces/resources/commands.js +1 -1
  69. package/plugins/access/spaces/shared/rules.d.ts +16 -5
  70. package/plugins/access/spaces/shared/rules.js +74 -6
  71. package/plugins/access/spaces/terminal.js +1 -1
  72. package/plugins/access/spaces/web.js +14 -14
  73. package/plugins/agents/chat/actions/say.js +1 -1
  74. package/plugins/agents/chat/actions/send.d.ts +21 -0
  75. package/plugins/agents/chat/actions/send.js +72 -13
  76. package/plugins/agents/chat/collections/file.d.ts +15 -0
  77. package/plugins/agents/chat/collections/file.js +12 -3
  78. package/plugins/agents/chat/collections/live.d.ts +11 -0
  79. package/plugins/agents/chat/collections/live.js +11 -1
  80. package/plugins/agents/chat/collections/message.d.ts +1 -1
  81. package/plugins/agents/chat/collections/shown.d.ts +1 -1
  82. package/plugins/agents/chat/collections/shown.js +1 -1
  83. package/plugins/agents/chat/collections/thread.js +1 -1
  84. package/plugins/agents/chat/collections/wait.d.ts +1 -1
  85. package/plugins/agents/chat/contract.d.ts +3 -2
  86. package/plugins/agents/chat/contract.js +1 -0
  87. package/plugins/agents/chat/mod.d.ts +11 -5
  88. package/plugins/agents/chat/mod.js +35 -14
  89. package/plugins/agents/chat/processors/failed.js +8 -3
  90. package/plugins/agents/chat/processors/turn.js +7 -4
  91. package/plugins/agents/chat/resources/commands.js +4 -1
  92. package/plugins/agents/chat/shared/agents.js +11 -2
  93. package/plugins/agents/chat/shared/live.d.ts +4 -2
  94. package/plugins/agents/chat/shared/live.js +2 -1
  95. package/plugins/agents/chat/shared/tools.js +1 -1
  96. package/plugins/agents/chat/shared/types.d.ts +13 -5
  97. package/plugins/agents/chat/terminal.js +6 -6
  98. package/plugins/agents/chat/views/history.js +1 -1
  99. package/plugins/agents/chat/views/terminal/conversation.js +2 -2
  100. package/plugins/agents/chat/views/web/conversation.js +2 -2
  101. package/plugins/agents/chat/web.js +9 -9
  102. package/plugins/agents/history/collections/outline.d.ts +2 -2
  103. package/plugins/agents/history/mod.js +3 -3
  104. package/plugins/agents/history/resources/tools.js +1 -1
  105. package/plugins/agents/history/shared/weight.js +1 -1
  106. package/plugins/agents/history/views/history.js +1 -1
  107. package/plugins/agents/memory/mod.js +1 -1
  108. package/plugins/agents/memory/resources/commands.js +1 -1
  109. package/plugins/agents/memory/terminal.js +1 -1
  110. package/plugins/agents/memory/views/context.d.ts +3 -9
  111. package/plugins/agents/memory/views/context.js +41 -47
  112. package/plugins/agents/memory/web.js +3 -3
  113. package/plugins/agents/openapi/shared/files.js +2 -0
  114. package/plugins/agents/routines/collections/routine.d.ts +1 -1
  115. package/plugins/agents/routines/web.js +5 -5
  116. package/plugins/agents/skills/mod.js +1 -1
  117. package/plugins/agents/skills/web.js +5 -5
  118. package/plugins/agents/team/web.js +4 -4
  119. package/plugins/agents/tiers/web.js +3 -3
  120. package/plugins/billing/credits/collections/plan.d.ts +2 -2
  121. package/plugins/billing/credits/collections/room.d.ts +1 -1
  122. package/plugins/billing/credits/web.js +2 -2
  123. package/plugins/billing/usage/collections/rollup.d.ts +2 -2
  124. package/plugins/billing/usage/collections/usage.d.ts +2 -2
  125. package/plugins/billing/usage/terminal.js +1 -1
  126. package/plugins/billing/usage/web.js +1 -1
  127. package/plugins/compute/apps/web.js +3 -3
  128. package/plugins/compute/cloud/collections/pool-vm.d.ts +1 -1
  129. package/plugins/compute/cloud/web.js +2 -2
  130. package/plugins/compute/computers/program/version.d.ts +1 -1
  131. package/plugins/compute/computers/program/version.js +1 -1
  132. package/plugins/compute/computers/resources/downloads.js +1 -1
  133. package/plugins/compute/computers/resources/previews.js +5 -2
  134. package/plugins/compute/computers/terminal.js +1 -1
  135. package/plugins/compute/computers/views/context.d.ts +1 -3
  136. package/plugins/compute/computers/views/context.js +75 -77
  137. package/plugins/compute/computers/web.js +8 -8
  138. package/plugins/interfaces/api/shared/server.d.ts +2 -2
  139. package/plugins/interfaces/api/shared/server.js +2 -3
  140. package/plugins/interfaces/api/web.js +1 -1
  141. package/plugins/interfaces/mcp/actions/call.d.ts +4 -0
  142. package/plugins/interfaces/mcp/actions/call.js +87 -8
  143. package/plugins/interfaces/mcp/actions/conversation.d.ts +1 -0
  144. package/plugins/interfaces/mcp/actions/conversation.js +49 -0
  145. package/plugins/interfaces/mcp/mod.d.ts +28 -4
  146. package/plugins/interfaces/mcp/mod.js +36 -7
  147. package/plugins/interfaces/mcp/resources/server.d.ts +13 -4
  148. package/plugins/interfaces/mcp/resources/server.js +163 -21
  149. package/plugins/interfaces/mcp/resources/tools.d.ts +88 -12
  150. package/plugins/interfaces/mcp/resources/tools.js +115 -21
  151. package/plugins/interfaces/mcp/resources/widgets.d.ts +161 -0
  152. package/plugins/interfaces/mcp/resources/widgets.js +246 -0
  153. package/plugins/interfaces/mcp/shared/keys.d.ts +25 -19
  154. package/plugins/interfaces/mcp/shared/keys.js +55 -9
  155. package/plugins/interfaces/mcp/shared/settings.d.ts +70 -37
  156. package/plugins/interfaces/mcp/shared/settings.js +64 -39
  157. package/plugins/interfaces/mcp/views/offered.d.ts +1 -2
  158. package/plugins/interfaces/mod.d.ts +2 -1
  159. package/plugins/interfaces/mod.js +2 -1
  160. package/plugins/interfaces/terminal/terminal.js +3 -3
  161. package/plugins/interfaces/terminal/views/shell.js +8 -3
  162. package/plugins/interfaces/voice/collections/blocked.d.ts +2 -2
  163. package/plugins/interfaces/voice/collections/call.d.ts +3 -3
  164. package/plugins/interfaces/voice/contract.d.ts +1 -1
  165. package/plugins/interfaces/voice/mod.d.ts +4 -4
  166. package/plugins/interfaces/voice/mod.js +8 -8
  167. package/plugins/interfaces/voice/resources/relay.d.ts +5 -3
  168. package/plugins/interfaces/voice/resources/relay.js +18 -7
  169. package/plugins/interfaces/voice/resources/tools.js +2 -0
  170. package/plugins/interfaces/voice/shared/settings.d.ts +5 -0
  171. package/plugins/interfaces/voice/views/call.d.ts +18 -11
  172. package/plugins/interfaces/voice/views/call.js +16 -4
  173. package/plugins/interfaces/voice/views/message.d.ts +2 -2
  174. package/plugins/interfaces/web/actions/arrive.d.ts +1 -0
  175. package/plugins/interfaces/web/actions/arrive.js +120 -0
  176. package/plugins/interfaces/web/actions/prune.d.ts +1 -0
  177. package/plugins/interfaces/web/actions/prune.js +51 -0
  178. package/plugins/interfaces/web/actions/sending.d.ts +1 -0
  179. package/plugins/interfaces/web/actions/sending.js +222 -0
  180. package/plugins/interfaces/web/actions/spent.d.ts +2 -0
  181. package/plugins/interfaces/web/actions/spent.js +59 -0
  182. package/plugins/interfaces/web/collections/rate.d.ts +122 -0
  183. package/plugins/interfaces/web/collections/rate.js +37 -0
  184. package/plugins/interfaces/web/collections/visitor.d.ts +110 -0
  185. package/plugins/interfaces/web/collections/visitor.js +64 -0
  186. package/plugins/interfaces/web/contract.d.ts +4 -0
  187. package/plugins/interfaces/web/contract.js +1 -0
  188. package/plugins/interfaces/web/lines.d.ts +36 -0
  189. package/plugins/interfaces/web/lines.js +78 -0
  190. package/plugins/interfaces/web/mod.d.ts +1 -1
  191. package/plugins/interfaces/web/mod.js +5 -5
  192. package/plugins/interfaces/web/processors/forget.d.ts +10 -0
  193. package/plugins/interfaces/web/processors/forget.js +14 -0
  194. package/plugins/interfaces/web/resources/entrance.d.ts +47 -0
  195. package/plugins/interfaces/web/resources/entrance.js +83 -0
  196. package/plugins/interfaces/web/resources/spend.d.ts +2 -0
  197. package/plugins/interfaces/web/resources/spend.js +62 -0
  198. package/plugins/interfaces/web/shared/budget.d.ts +65 -0
  199. package/plugins/interfaces/web/shared/budget.js +134 -0
  200. package/plugins/interfaces/web/shared/lines.d.ts +158 -0
  201. package/plugins/interfaces/web/shared/lines.js +156 -0
  202. package/plugins/interfaces/web/shared/secret.d.ts +33 -0
  203. package/plugins/interfaces/web/shared/secret.js +86 -0
  204. package/plugins/interfaces/web/views/default.d.ts +2 -2
  205. package/plugins/interfaces/web/views/default.js +3 -2
  206. package/plugins/interfaces/web/views/shell.js +6 -1
  207. package/plugins/interfaces/whatsapp/collections/phone.d.ts +1 -1
  208. package/plugins/interfaces/whatsapp/contract.d.ts +1 -1
  209. package/plugins/interfaces/whatsapp/contract.js +1 -1
  210. package/plugins/interfaces/whatsapp/mod.d.ts +2 -2
  211. package/plugins/interfaces/whatsapp/mod.js +4 -4
  212. package/plugins/interfaces/whatsapp/processors/reply.d.ts +1 -1
  213. package/plugins/interfaces/whatsapp/processors/reply.js +3 -3
  214. package/plugins/interfaces/whatsapp/shared/parts.js +1 -1
  215. package/plugins/interfaces/whatsapp/views/message.d.ts +2 -2
  216. package/plugins/interfaces/whatsapp/web.js +2 -2
  217. package/plugins/models/contract.d.ts +1 -1
  218. package/plugins/models/shared/generate.js +13 -4
  219. package/plugins/models/shared/transcribe.js +7 -1
  220. package/plugins/models/shared/use.d.ts +16 -2
  221. package/plugins/models/shared/use.js +20 -0
  222. package/runtime/actor.d.ts +24 -7
  223. package/runtime/browsers.d.ts +153 -18
  224. package/runtime/browsers.js +337 -32
  225. package/runtime/cache.js +25 -5
  226. package/runtime/caller.d.ts +117 -0
  227. package/runtime/caller.js +215 -0
  228. package/runtime/client.d.ts +47 -3
  229. package/runtime/client.js +132 -42
  230. package/runtime/define.d.ts +39 -19
  231. package/runtime/executor.js +7 -6
  232. package/runtime/expiring.d.ts +23 -0
  233. package/runtime/expiring.js +64 -0
  234. package/runtime/links.d.ts +27 -4
  235. package/runtime/links.js +49 -11
  236. package/runtime/memory.js +102 -15
  237. package/runtime/mod.d.ts +3 -1
  238. package/runtime/mod.js +3 -1
  239. package/runtime/mongo.d.ts +12 -0
  240. package/runtime/mongo.js +44 -0
  241. package/runtime/observe.d.ts +2 -2
  242. package/runtime/observe.js +103 -30
  243. package/runtime/ops.d.ts +9 -1
  244. package/runtime/owner.d.ts +19 -7
  245. package/runtime/owner.js +82 -28
  246. package/runtime/reads.js +2 -2
  247. package/runtime/registry.js +8 -4
  248. package/runtime/runtime.d.ts +7 -0
  249. package/runtime/runtime.js +1 -0
  250. package/runtime/timers.js +2 -0
  251. package/runtime/views.d.ts +2 -4
  252. package/runtime/views.js +8 -11
  253. package/runtime/wire.d.ts +1 -2
  254. package/plugins/interfaces/mcp/shared/caller.d.ts +0 -45
  255. package/plugins/interfaces/mcp/shared/caller.js +0 -99
package/CHANGELOG.md CHANGED
@@ -1,3 +1,295 @@
1
+ ## Unreleased
2
+
3
+ ## 1.0.0-rc.24 — 2026-11-06
4
+
5
+ **Upgrading from rc.23** (two breaking renames; no aliases, no data moves):
6
+
7
+ 1. **Views are found by name alone; the medium is gone.** Flatten `views`:
8
+ `{ "booking.panel": { web: BookingPanel } }` becomes `{ "booking.panel": BookingPanel }` (`Views`
9
+ is `Record<string, View>`). `render(medium, name, item, options)` and
10
+ `observe(medium, name, item, options)` lose their first argument:
11
+ `ctx.render("llm", "thread", t)` is `ctx.render("llm.thread", t)`,
12
+ `client.observe("web", "booking.panel", item)` is `client.observe("booking.panel", item)`.
13
+ `ViewContext` loses `medium`, and its `kind` is now `name`. `ctx.show(name, item)` shows exactly
14
+ the View it names: there is no inheritance by place. The `"*"` fallback is gone; the hosts ask
15
+ for their own default (`web.default`, `terminal.default`) when a name has no View.
16
+ `runtime.describe().views` is the list of names. `GET /api/views/<name>` takes the name
17
+ (`llm.thread`) and no longer reads `?medium=`; API keys that list a View by `thread` or `message`
18
+ list `llm.thread` or `llm.message`. An MCP widget's `_meta` names the View without a medium.
19
+ Where the same thing is shown in several places the name takes the place as a prefix; seven kinds
20
+ were renamed:
21
+ | Was | Is |
22
+ | ------------------------- | ------------------------------------------------------------------------------------------- |
23
+ | `message` | `llm.message`, `web.message`, `terminal.message`, `whatsapp.message`, `voice.message` |
24
+ | `thread` | `llm.thread`, `web.thread`, `terminal.thread` |
25
+ | `memory` | `llm.memory`, `terminal.memory` |
26
+ | `live`, `shell`, `spaces` | `web.live`, `web.shell`, `web.spaces`; `terminal.live`, `terminal.shell`, `terminal.spaces` |
27
+ | `*` | `web.default`, `terminal.default` |
28
+
29
+ Every other name stays (`tool:<name>`, `context:<name>`, `addition:<name>`, `mcp:offered`, and
30
+ the rest). The last plugin to register a name still wins, so an app replaces WhatsApp's message
31
+ with its own `whatsapp.message`. A page's address still names its View as before
32
+ (`/thread/<id>`): the web shell looks for that name, then `web.<name>`, then `web.default` (hint
33
+ `of` names the address's kind); the terminal's `open` does the same with `terminal.`.
34
+ 2. **The anonymous actor is `anonymous`, not `visitor`:** a request nobody is signed in to is
35
+ `{ kind: "anonymous", id: "" }` (`VISITOR` is `ANONYMOUS` in `copilotz/web/server`). Rules that
36
+ named `visitor` name `anonymous` (identity's `callback` allows `person` or `anonymous`). The
37
+ `visitor` entrance and its cookie keep their names. `runtime/actor.ts` now lists all six kinds
38
+ (person, agent, contact, system, maintenance, anonymous); `routine` is an origin and `space` a
39
+ kind of member, not actors.
40
+
41
+ - **Oxian 0.23.4:** its adapters await an asynchronous `prepare`, so a front serving several
42
+ runtimes behind one listener can open the right one before deciding a socket upgrade.
43
+
44
+ ## 1.0.0-rc.23 — 2026-11-05
45
+
46
+ **Upgrading from rc.22** (three renames and one host change; nothing else needs doing):
47
+
48
+ 1. **`renderer` is `medium`:** rename `ctx.renderer` to `ctx.medium` in Views and in hand-made test
49
+ contexts (`renderer: "web"` to `medium: "web"`). No alias.
50
+ 2. **Web lines moved to the web interface:** add `webLines` beside `...access`
51
+ (`plugins: [models, chat, ...access, webLines]`) and import `WebLine`, `WebLimits`, `WebSettings`
52
+ and `WEB_LIMITS` from `copilotz/plugins/interfaces`. The `contactSend` hook's key is `web` (was
53
+ `contacts`). No data moves.
54
+ 3. **One web host:** `serveRoutes`, `routeHost` and `RouteListener` are gone, and so are `serve`'s
55
+ `google` and `dev` options: declare sign-in with `googleSignIn` and `devSignIn` plugins instead.
56
+ `serve` answers a `Server` (`close({ drain })`); `/connect` answers `{ ticket, actor, name? }`
57
+ (`person` is gone).
58
+
59
+ - **Breaking: web lines are the web interface's, not contacts'.** `resources.web.lines`, arrival,
60
+ the `visitor` entrance, the budget, the challenge, prune and the limits moved from
61
+ `plugins/access/contacts` into `plugins/interfaces/web`, as one plugin, `webLines` (exported from
62
+ `copilotz/plugins/interfaces`), as WhatsApp's, the phone's and MCP's lines are in theirs. The
63
+ resource shape is the same (`web: { caller?, lines: { … } }`), and so are the Actions
64
+ (`contact.arrive`, `contact.sending`, `contact.prune`, `contact.spent`, `contact.budget`) and
65
+ collections (`contact_visitor`, `contact_rate`): nothing is renamed, so no data moves. Migrate by
66
+ adding `webLines` beside `...access` (`plugins: [models, chat, ...access, webLines]`) and
67
+ importing `WebLine`, `WebLimits`, `WebSettings` and `WEB_LIMITS` from
68
+ `copilotz/plugins/interfaces` instead of `…/access`. Contacts keeps the contact, `contact.start`,
69
+ `contact.chat` and `contact.forget`; erasing a visitor's contact now ends its cookie and its
70
+ connections in a processor of `contact.deleted` (`web.forget`), a moment after the erasure, not in
71
+ the same transaction. The `contactSend` hook's key is `web` (was `contacts`).
72
+ - **Breaking: `renderer` is `medium`.** The docs said "medium" and the API said `renderer`; now one
73
+ word. A View's context field `ctx.renderer` is `ctx.medium`, and the wire/owner `render` job's
74
+ `renderer` field is `medium`. Migrate by renaming `ctx.renderer` to `ctx.medium` (and a test's
75
+ hand-made context `renderer: "web"` to `medium: "web"`); `render(medium, kind, item)` already took
76
+ the medium by position. The medium names are unchanged (`llm`, `web`, `terminal`, `whatsapp`,
77
+ `voice`). No alias.
78
+ - **One web host, its parts from the app's plugins.** `serve` (and `webServer` beneath it) is the
79
+ host for every app: routes from `routes` resources, as before; the page and its code from `code`
80
+ (none: no page, the routes and `/health`); who a browser is from a new `entrances` resource; how
81
+ people sign in from a new `signIn` resource; browsers connecting with `tickets` (none: no browser
82
+ connects). `serveRoutes`, `routeHost` and `RouteListener` are gone, and so are the host's `google`
83
+ and `dev` options; `serve` answers a `Server`, whose `close({ drain })` stops listening and then
84
+ closes the runtime.
85
+ - **Entrances:** each is a cookie and the query that says who its secret is (`{ secret }` in, an
86
+ actor out), asked in `order`; one may let a newcomer in on `POST /connect` (`arrive`, given the
87
+ socket's address and the secret its cookie holds when that's no one yet), and end what it is on
88
+ sign-out (`end`). The host keeps every cookie (httpOnly; `Secure` but over plain http to this
89
+ machine or a LAN host, by the host the request is for as the app's front says it; `sameSite` lax
90
+ or strict; `hostOnly`: `__Host-<name>` wherever it's Secure), clears one that's no one (forged,
91
+ ended), and never takes a store's failure for no one. Identity declares the session (`session`,
92
+ host-only, read by `credential.actor`, ended by `session.end`, which now takes `{ secret }` and
93
+ is unrecorded: its secret was in the log). `/connect` answers `{ ticket, actor, name? }`
94
+ (`person` is gone); `web()` connects as whoever it is (`start(client, actor)`), and
95
+ `web({ arrive })` is what the page asks coming in, at the app's `base` (an org's, with many).
96
+ - **Sign-in:** `POST /signin/<name>` for each way a plugin declares: an unrecorded Action (the
97
+ host refuses to start with a recorded one), called as the system with the request's JSON,
98
+ answering `{ person, session }`; `local` ones from this machine only: the socket's address (as
99
+ the listener saw it, `clientAddress`) and the host must both be loopback, a request whose
100
+ address nobody set is refused, and so is one carrying any header a proxy adds (`forwarded`,
101
+ `via`, `x-forwarded-*`, `x-real-ip`, `cf-connecting-ip`…: a proxy on this machine that rewrites
102
+ `Host` made every request this machine's). `devSignIn` refuses to start in an app whose `links`
103
+ origin is public (a proxy that adds no header, as nginx's `proxy_pass` as it comes, can't be
104
+ told from this machine). `googleSignIn` declares `google` (the page shows its button for the
105
+ first client id); the new `devSignIn` plugin declares `dev` (by name or email, this machine
106
+ only). The orgs host signs in with whatever its directory declares (`signIn: { at: directory }`
107
+ for its orgs' pages). `describe()` marks unrecorded Actions (`record: false`).
108
+ - **Visitors** (the contacts plugin's web lines, `resources.web.lines.<name>`: `in`, `agent`,
109
+ `title`, `days`, `limits`, `files`, `transcribe`, `org`; `web.caller`, as MCP's; and the app's
110
+ `links` secret, which visitors' cookies are signed with): a page asking to come in by a line
111
+ (`{ line }`) that isn't anyone becomes a visitor, its browser keeping a signed secret in a
112
+ `SameSite=Strict` cookie (`__Host-visitor` wherever it's Secure) that's the same visitor for
113
+ `days` (30). Coming in makes and keeps nothing, in memory either: the visitor the server issues
114
+ carries its line (`web`) and its networks' tags (`from`: HMACs, never the address), which its
115
+ messages are counted by. Its first message (`chat.send`, naming no chat) makes its contact
116
+ (`via: "web"`), its own chat in the line's space and its record (`contact_visitor`), through
117
+ chat's new `contactSend` hook (`contact.sending`). Limits, each a plain 429 for that caller
118
+ alone, by address held for each network it's in (`networksOf`: an IPv4 address and its /24, an
119
+ IPv6 /64, its /56 and its /48, each as many callers' worth as it counts, `SCALE`: 8, 4 and 8):
120
+ new visitors an hour from one address (`ipVisitorsPerHour`, 20), and as many first messages,
121
+ counted by the address the app's front says, else the socket's (with neither, nobody's let in,
122
+ said loudly; all from one private address, said once); a visitor's messages a minute and a day
123
+ (`perMinute` 10, `perDay` 200), its address's (`ipPerMinute` 30, `ipPerDay` 1,000), the line's a
124
+ minute (`linePerMinute` 300, of which newcomers, who hadn't spoken before the minute, send
125
+ `newcomersPerMinute` 200: the rest is kept for conversations going on), and new visitors who
126
+ speak an hour (`visitorsPerHour`, 600), each place taken in one conditional write, so messages
127
+ at once can't pass a limit. A line's `budget`: what its visitors' turns may be charged a day
128
+ (UTC), as the usage ledger prices them (`usage.quote`, through `modelUse`); past it, its
129
+ visitors' messages wait for tomorrow. A line's `challenge`: an Action of the app's a newcomer
130
+ passes first (a CAPTCHA's check, given what the page sent,
131
+ `web({ arrive: { line, challenge }
132
+ })`). Files only on a line that takes them
133
+ (`files: { count, bytes }`, 1 of 5 MB unless said), each with a media type; audio transcribed
134
+ only with `transcribe: true`. `contact.forget` ends a visitor's cookie and its browsers'
135
+ connections at once (its record stays, ended, until its cookie's time is past), and so does
136
+ removing its line. Every ten minutes (`contact.prune`) what's past goes: counters, records past
137
+ their time, a contact made for a first message that never went in. A visitor fetches its own
138
+ chat's files (`file.content` is open to contacts, under the rules), and finds its chats by its
139
+ own memberships (`member` by its key, `contact:<id>`). Checked at start (a challenge that's no
140
+ Action, a budget without the usage plugin).
141
+ - **What a contact reads:** never an agent's private steps (each tool's input and output), a tool
142
+ call being written, a step's words before it's known to be an answer, why a model's call broke
143
+ (the provider's words), nor a tool's files. The access rules' `shared` resource takes `contact`,
144
+ a filter a contact acting itself (never the agent working for it) reads and writes through:
145
+ chat's messages without `private` or `toolCalls`; `live` without a tool call or a `retry`, and
146
+ with words only of a turn that offers no tools (`open: true`, every step an answer; of one that
147
+ does, a contact sees only that the agent is at work); files without a tool's (`private`, as
148
+ OpenAPI's are now). A turn stopped mid-step keeps its words only when they were surely an
149
+ answer. A contact's own reads from its browser name what of its own they read (its chat:
150
+ `thread`, or `_id`, 32 at most, its read 2 KB of JSON at most: `CONTACT_READ`; of spaces and
151
+ memberships, only its memberships by its key), else they're refused and never watched; it reads
152
+ no `aggregate` or `nearest` directly. The voice relay reads its call as the line's agent working
153
+ for the caller (only what both may read), and says what a web visitor reads: answers, never a
154
+ step's words before its tools, and words as they're written only of a turn that offers no tools
155
+ but those called beside an answer (a tool's new `aside: true`, as the voice plugin's `end_call`
156
+ is): one with other tools says its answer once it's whole. A contact's message says 4,096
157
+ characters at most (`CONTACT_TEXT`), never what sent it (`via`), and never titles its chat or
158
+ lets an agent rename it (`title`, `renamable`); a file's media type is one (`MEDIA_TYPE`, 127
159
+ characters at most, `MEDIA_TYPE_LENGTH`), which the agent is told. WhatsApp, voice and MCP
160
+ contacts never held a browser connection: they read only through the app's own code.
161
+ - **Security:** `/connect`, sign-in and sign-out (and the orgs host's own POSTs) answer only the
162
+ app's own page: an `Origin` that isn't this host (as the front says it), over https off this
163
+ machine and its LAN, or a cross-site `Sec-Fetch-Site`, is a 403, so another site can't make its
164
+ visitors arrive here or sign anyone in. Bodies there are JSON objects of 16 KiB at most; route
165
+ bodies are refused (413) as soon as `content-length` is over 10 MB, and read no further than
166
+ that while streaming. What either host answers in JSON is `cache-control: no-store`, and what
167
+ goes wrong says only its public words, with its code's status (500s are logged). So does a
168
+ route's Action that refuses (`forbidden`, `invalid`, `not_found`, `unauthorized`: its status,
169
+ and its words only when public). The caller's address parser (`callerFrom`, `callerProblem`,
170
+ `CallerSettings`, and `countedOf` for a socket's) moved from MCP into the runtime, so MCP and
171
+ web lines read callers one way. `mcp.call` refuses a contact without an MCP line (a web
172
+ visitor), naming a line or not.
173
+ - **Limits on browsers:** 30 tickets per actor a minute (`createTickets({ perMinute })`; past them
174
+ `/connect` is a 429 with `retry-after`, and `issue` throws `too_many`), 16 browsers (worker ids)
175
+ per actor, each on two connections at most (one coming while the last goes), 512 watched reads
176
+ per connection (past them, `too_many`; those watched keep going), 16 resume credentials per
177
+ actor (the oldest dropped), each working once, for the browser it was given to. A connection
178
+ counts from the moment it's let in (Welcome) until it goes, ready or not, and one that doesn't
179
+ say it's ready within 10 seconds is closed (the owner's Hypervisor `readyTimeoutMs`, for every
180
+ worker: none starts anything before Ready). A contact far less: 2 browsers, 32 watched reads on
181
+ each connection; and contacts together 16 connections from a network (as many times as it
182
+ counts: by the tags of `actor.from`, `scaleOf`), 300 on a web line, 400 in all: well under what
183
+ a listener holds (`LISTENER`, Oxian's Node adapter's 1,000), so people find room. Runtimes on
184
+ one listener count their contacts together with one `contactsPool()`: the orgs host gives each
185
+ org one (`open`'s `given.browsers`, for `createRuntime({ browsers })`). The limits are settings:
186
+ `createRuntime({ browsers })` (`BrowserLimits`: `sockets`, `watches`, `resumes`, `contact`,
187
+ `network`, `line`, `contacts`, `pool`), checked at start; people never count against contacts'.
188
+ A contact's browser is told a failure's words only when they're for anyone (`public`), as MCP's
189
+ callers are: never a provider's (a transcription's raw error said a key's prefix). Tickets and
190
+ resumes expire on a timer (`runtime/expiring.ts`), never by looking through them all on each one
191
+ issued.
192
+ - **Cookie names, and a one-time sign-out:** every entrance's cookie is the host's alone unless it
193
+ says `hostOnly: false`: identity's session is `__Host-session` wherever it's Secure, and the
194
+ orgs host's own cookies (`dir`, `org`, `s_<org>`) and every org's entrances' are `__Host-` too,
195
+ so no other host under the domain (a preview's page) can set one to make a browser someone it
196
+ chose. The names change: every browser signed in before is signed out once, on upgrade, and what
197
+ it held under the old plain name is ended where it lives and cleared (on `/connect` and on
198
+ sign-out), so a version rolled back that reads the plain names finds no one there. Stripping
199
+ `Domain` from a preview's Set-Cookie (as previews do) doesn't stop that by itself: a preview's
200
+ page script can still set `document.cookie` with `Domain=<parent>`; the `__Host-` names are what
201
+ stop it.
202
+ - **Signing out, and erasing a contact, end their browsers** (`runtime.disconnect(actor)`, and
203
+ `ctx.disconnect` from an Action): their resume credentials go and each connection closes. A
204
+ browser comes back only with a new ticket: the client now asks for one when its way back is
205
+ refused (it used to stop, until its page reloaded), which only a cookie that's still someone
206
+ gets; another device of the same person comes straight back. A connection let in before (not yet
207
+ ready) is never ready, and tickets handed out to them not yet used are no one's (`Tickets.end`,
208
+ which sign-out calls). An org's own (`bound:`) executor can't end anyone's browsers; plugins are
209
+ trusted code, as with `cancel`. With the orgs host, sign-out ends every open org's session the
210
+ browser holds.
211
+ - **Migration:** `serveRoutes({ runtime, … })` is `serve({ runtime, … })` with no `code`.
212
+ `google: { clientId }` and `dev: true` are the plugins' resources now: add `googleSignIn` (with
213
+ the `google` resource) and `devSignIn` to the runtime's plugins (the directory's, with orgs). A
214
+ listener of the app's own (`Deno.serve`) says where each request came from
215
+ (`setClientAddress(request, info.remoteAddr.hostname)`, from `copilotz/web/server`), and so do
216
+ tests that sign in with dev sign-in through a hand-made `Request`
217
+ (`setClientAddress(request, "127.0.0.1")`); `serve` and `listen` do it themselves. Web lines
218
+ need the `links` resource. `whomOf(runtime, { cookie?, front? })` (was
219
+ `whomOf(runtime,
220
+ cookie?)`), and `setCookie` takes the request's site
221
+ (`siteOf(request, front)`). An entrance whose cookie something else under the domain reads says
222
+ `hostOnly: false`. A visitor's page finds its chat through its memberships (`member`
223
+ `{ member: "contact:<id>" }`), not by reading every `thread`. An app that ran this branch
224
+ before: visitors' cookies (their secret's format and key changed) and links signed before
225
+ upgrading don't open; visitors are newcomers once.
226
+ - **The runtime, for the web host's limits** (from the second security review of the one host):
227
+ - **The in-memory store reaches a document by its id at once.** A filter that keeps to ids (`_id`
228
+ a string, `$eq` one, `$in` strings, also in a top-level `$and`) looks them up, rather than
229
+ copying and scanning the whole collection on every read and write; other reads scan without a
230
+ copy, and stop at a `limit` without a `sort`. The `durable: false` collections (`live`, the web
231
+ lines' counters, billing's `room`) share that store and its one transaction queue, so their cost
232
+ no longer grows with what they hold. Results come in the same order.
233
+ - **Links are signed with a key of their own** (`keyOf(secret, use)`, HKDF-SHA256 of the `links`
234
+ secret; web visitors' cookies use another), never the secret itself, and the `links` resource
235
+ takes the one before it (`previous`), while what it signed should still open: a link until it
236
+ expires, a visitor's cookie (the same contact) while it lasts. **Breaking:** links signed before
237
+ upgrading (an hour's) no longer open. A secret that leaked is never given as `previous`: it goes
238
+ at once.
239
+ - **A rule hears a browser's own reads** (`Guard`'s `direct`, asked with the read's filter before
240
+ it's watched) and may refuse one it won't watch, throwing. Plugins' `check` sees every Action
241
+ (`merged.actions`). A contact reads its own memberships by its key (anyone else, memberships as
242
+ far as they reach: a key `within` a space, that space's).
243
+ - **An aggregate with its own `$match` works under a rule:** the rule's filter joins it in one
244
+ `$match`; before, every such read failed `invalid`.
245
+ - **Who calls, by network:** `networksOf(counted)` (an address's wider networks, each with its
246
+ prefix and `scale`), `SCALE`, `scaleOf(tag)`, `privateAddress(address)`.
247
+ - **From the third security review of the one host:**
248
+ - **A watched read is matched only against changes it could concern.** A read whose filter names
249
+ values of a field of its own (a string, `$eq`, `$in` of up to 256 strings: a chat's `thread`, an
250
+ `_id`) is filed under them; a change to a document holding none of them (before or after, in
251
+ that field or an array there) skips it before any matching. The owner's read cache does the same
252
+ for the queries it keeps. Results are exactly as before. New in the reference
253
+ (`runtime/mongo.ts`): `namedBy(filter)`, `valuesAt(doc, field)`.
254
+ - **A web line's budget holds, and fails closed.** Each visitor's message holds an estimate of its
255
+ turn's cost as it goes in (the most one of the line's visitors' model calls cost lately; before
256
+ any is known, the rest of the day's budget, so one turn goes at a time until a cost is),
257
+ released as its first call is charged, or lapsing in two minutes: messages at once can't all
258
+ pass a budget only one fits. Before each model call (and transcription) for a visitor, a spent
259
+ budget refuses it, for good, so a turn's tool loop stops there: the models plugin's `modelUse`
260
+ listeners may now refuse a call before it's made (`may`, its refusal `final`; `mayUse`,
261
+ `ModelCall`). Use the ledger prices at nothing (no price for the model, or pricing failing)
262
+ closes the line for the day, said in the log. New: `contact.budget`; `contact.spent` takes
263
+ `contact`, and `unpriced`.
264
+ - **Web visitors:** a secret dated more than 5 minutes ahead is nobody's. An erased visitor's
265
+ record is kept as long as any cookie made before could last (400 days, the most a line may say,
266
+ `MOST_DAYS`), so raising a line's `days` can't bring an erased visitor back.
267
+ - **MCP's ids** (contacts, chats, users, addresses) are HMACs with the `mcp` key of the app's
268
+ secret (`keyOf`), never the secret itself; with `links.previous`, a conversation made under the
269
+ one before goes on as itself (the new system-only `mcp.conversation`; `mcp.call` takes the chat
270
+ the route found, `thread`). **Breaking:** every MCP conversation from before is new once (no
271
+ deployment uses the MCP interface yet).
272
+ - **MCP widgets: an app's web Views drawn inside ChatGPT and other MCP Apps hosts** (#165). A line's
273
+ tool can name a web View (`mcp.lines.<name>.tools.<tool>.widget`); the web host serves one
274
+ `ui://<line>/widget-<version>.html` template per line (`webServer({ widgets: widgetsOf(...) })`),
275
+ and a result carries the View, a snapshot of what it reads, and a short-lived grant in `_meta`
276
+ only, never in what the model reads. Widget-only tools (`visibility: ["app"]`, `action`) refuse
277
+ calls without a grant for that conversation. The widget host is `copilotz/web/widget`
278
+ (`widget({ plugins, root })`), speaking MCP Apps' postMessage bridge with ChatGPT's
279
+ `window.openai` as fallback.
280
+ - **A tab comes back after a network flap.** A new connection on a worker id that already has two
281
+ closes the oldest instead of being refused (a Welcome lost on the way no longer locks the tab
282
+ out), and a client that was in once keeps re-enrolling, longer apart, when it's refused.
283
+ - **A model the app doesn't pay for is checked against a web line's budget too** (`paid`-tagged ones
284
+ skipped `may`, so a visitor's tool loop could go on past a spent day).
285
+ - **A web line's budget loses no charge under load:** `charge` is one atomic write (`$inc` the
286
+ spend, `$unset` the hold), and `hold` retries with jitter until a deadline instead of eight
287
+ immediate tries (no more false "busy"). One call costing more than the whole budget no longer
288
+ closes the line for 30 days: with nothing held, a message holds at most what's left.
289
+ - **Voice: a line's `waiting` phrase** (`voice.lines.<name>.waiting`, none by default) is spoken
290
+ once when a turn starts running tools before any answer, so a caller doesn't hear silence. Never
291
+ for an answer without tools, nor for `end_call`.
292
+
1
293
  ## 1.0.0-rc.22 — 2026-11-04
2
294
 
3
295
  **A security release: upgrade now.** Before it, a Google sign-in wrote the new session's secret to