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