copilotz 1.0.0-rc.20 → 1.0.0-rc.21

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 (340) hide show
  1. package/CHANGELOG.md +417 -0
  2. package/README.md +295 -19
  3. package/hosts/orgs/mod.d.ts +4 -1
  4. package/hosts/orgs/mod.js +2 -2
  5. package/hosts/web/files.d.ts +6 -2
  6. package/hosts/web/files.js +36 -3
  7. package/hosts/web/node/mod.d.ts +1 -1
  8. package/hosts/web/node/mod.js +1 -1
  9. package/hosts/web/node/serve.d.ts +26 -0
  10. package/hosts/web/node/serve.js +23 -1
  11. package/hosts/web/routes.d.ts +28 -1
  12. package/hosts/web/routes.js +65 -10
  13. package/hosts/web/server.d.ts +5 -4
  14. package/hosts/web/server.js +1 -1
  15. package/package.json +2 -2
  16. package/plugins/access/accounts/collections/account.d.ts +2 -2
  17. package/plugins/access/contacts/actions/chat.d.ts +1 -0
  18. package/plugins/access/contacts/actions/chat.js +45 -0
  19. package/plugins/access/contacts/actions/forget.d.ts +1 -0
  20. package/plugins/access/contacts/actions/forget.js +56 -0
  21. package/plugins/access/contacts/actions/start.d.ts +1 -0
  22. package/plugins/access/contacts/actions/start.js +50 -0
  23. package/plugins/access/contacts/collections/contact.d.ts +81 -0
  24. package/plugins/access/contacts/collections/contact.js +58 -0
  25. package/plugins/access/contacts/contract.d.ts +10 -0
  26. package/plugins/access/contacts/contract.js +10 -0
  27. package/plugins/access/contacts/mod.d.ts +27 -0
  28. package/plugins/access/contacts/mod.js +49 -0
  29. package/plugins/access/contacts/views/contact.d.ts +8 -0
  30. package/plugins/access/contacts/views/contact.js +25 -0
  31. package/plugins/access/contacts/web.d.ts +7 -0
  32. package/plugins/access/contacts/web.js +11 -0
  33. package/plugins/access/directory/collections/credit-code.d.ts +1 -1
  34. package/plugins/access/directory/collections/invite.d.ts +1 -1
  35. package/plugins/access/identity/mod.js +8 -6
  36. package/plugins/access/mod.d.ts +7 -1
  37. package/plugins/access/mod.js +7 -2
  38. package/plugins/access/spaces/actions/agents.js +12 -6
  39. package/plugins/access/spaces/actions/create.js +10 -1
  40. package/plugins/access/spaces/actions/invitation.js +5 -2
  41. package/plugins/access/spaces/actions/keep.d.ts +1 -0
  42. package/plugins/access/spaces/actions/keep.js +55 -0
  43. package/plugins/access/spaces/actions/member.js +17 -4
  44. package/plugins/access/spaces/actions/rename.js +4 -0
  45. package/plugins/access/spaces/collections/member.d.ts +1 -1
  46. package/plugins/access/spaces/collections/request.d.ts +1 -1
  47. package/plugins/access/spaces/collections/space.d.ts +9 -0
  48. package/plugins/access/spaces/collections/space.js +2 -0
  49. package/plugins/access/spaces/contract.d.ts +4 -3
  50. package/plugins/access/spaces/contract.js +1 -1
  51. package/plugins/access/spaces/mod.d.ts +7 -1
  52. package/plugins/access/spaces/mod.js +8 -1
  53. package/plugins/access/spaces/resources/tools.d.ts +0 -5
  54. package/plugins/access/spaces/resources/tools.js +11 -1
  55. package/plugins/access/spaces/shared/agents.js +2 -2
  56. package/plugins/access/spaces/shared/can.d.ts +18 -3
  57. package/plugins/access/spaces/shared/can.js +32 -5
  58. package/plugins/access/spaces/shared/declared.d.ts +21 -0
  59. package/plugins/access/spaces/shared/declared.js +8 -0
  60. package/plugins/access/spaces/shared/labels.d.ts +7 -1
  61. package/plugins/access/spaces/shared/labels.js +56 -8
  62. package/plugins/access/spaces/shared/managers.js +2 -2
  63. package/plugins/access/spaces/shared/names.d.ts +9 -5
  64. package/plugins/access/spaces/shared/names.js +36 -19
  65. package/plugins/access/spaces/shared/reach.d.ts +20 -6
  66. package/plugins/access/spaces/shared/reach.js +62 -20
  67. package/plugins/access/spaces/shared/rules.d.ts +10 -5
  68. package/plugins/access/spaces/shared/rules.js +35 -10
  69. package/plugins/access/spaces/shared/seat.d.ts +3 -2
  70. package/plugins/access/spaces/shared/seat.js +9 -2
  71. package/plugins/access/spaces/views/where.d.ts +4 -2
  72. package/plugins/access/spaces/views/where.js +9 -0
  73. package/plugins/access/spaces/web.js +1 -1
  74. package/plugins/access/web.d.ts +1 -0
  75. package/plugins/access/web.js +1 -0
  76. package/plugins/agents/chat/actions/erase.d.ts +1 -0
  77. package/plugins/agents/chat/actions/erase.js +51 -0
  78. package/plugins/agents/chat/actions/open.d.ts +1 -0
  79. package/plugins/agents/chat/actions/open.js +49 -0
  80. package/plugins/agents/chat/actions/quiet.d.ts +1 -0
  81. package/plugins/agents/chat/actions/quiet.js +33 -0
  82. package/plugins/agents/chat/actions/say.d.ts +1 -0
  83. package/plugins/agents/chat/actions/say.js +82 -0
  84. package/plugins/agents/chat/actions/send.js +57 -19
  85. package/plugins/agents/chat/actions/shown.d.ts +1 -0
  86. package/plugins/agents/chat/actions/shown.js +35 -0
  87. package/plugins/agents/chat/collections/intent.d.ts +124 -0
  88. package/plugins/agents/chat/collections/intent.js +52 -0
  89. package/plugins/agents/chat/collections/message.d.ts +74 -1
  90. package/plugins/agents/chat/collections/message.js +23 -1
  91. package/plugins/agents/chat/collections/shown.d.ts +105 -0
  92. package/plugins/agents/chat/collections/shown.js +34 -0
  93. package/plugins/agents/chat/contract.d.ts +15 -7
  94. package/plugins/agents/chat/contract.js +7 -1
  95. package/plugins/agents/chat/mod.d.ts +20 -2
  96. package/plugins/agents/chat/mod.js +43 -4
  97. package/plugins/agents/chat/processors/failed.js +15 -5
  98. package/plugins/agents/chat/processors/turn.d.ts +1 -1
  99. package/plugins/agents/chat/processors/turn.js +95 -35
  100. package/plugins/agents/chat/shared/delivery.d.ts +16 -2
  101. package/plugins/agents/chat/shared/delivery.js +62 -7
  102. package/plugins/agents/chat/shared/send.d.ts +1 -3
  103. package/plugins/agents/chat/shared/send.js +2 -9
  104. package/plugins/agents/chat/shared/tools.d.ts +33 -0
  105. package/plugins/agents/chat/shared/tools.js +28 -0
  106. package/plugins/agents/chat/shared/types.d.ts +59 -1
  107. package/plugins/agents/chat/views/message.d.ts +4 -2
  108. package/plugins/agents/chat/views/message.js +22 -4
  109. package/plugins/agents/chat/views/prompt.js +38 -4
  110. package/plugins/agents/history/collections/outline.d.ts +1 -1
  111. package/plugins/agents/history/collections/summary.d.ts +1 -1
  112. package/plugins/agents/history/mod.js +2 -1
  113. package/plugins/agents/history/processors/erase.d.ts +3 -0
  114. package/plugins/agents/history/processors/erase.js +11 -0
  115. package/plugins/agents/memory/mod.js +2 -1
  116. package/plugins/agents/memory/processors/extract.d.ts +1 -1
  117. package/plugins/agents/memory/processors/extract.js +5 -0
  118. package/plugins/agents/memory/resources/tools.js +1 -1
  119. package/plugins/agents/memory/shared/settings.d.ts +7 -2
  120. package/plugins/agents/memory/shared/settings.js +9 -1
  121. package/plugins/agents/routines/collections/routine.d.ts +1 -1
  122. package/plugins/agents/routines/collections/run.d.ts +1 -1
  123. package/plugins/compute/apps/collections/app.d.ts +2 -2
  124. package/plugins/compute/cloud/resources/tools.js +3 -3
  125. package/plugins/compute/computers/collections/approval.d.ts +2 -2
  126. package/plugins/compute/computers/collections/grant.d.ts +1 -1
  127. package/plugins/compute/computers/collections/preview.d.ts +2 -2
  128. package/plugins/compute/computers/program/version.d.ts +1 -1
  129. package/plugins/compute/computers/program/version.js +1 -1
  130. package/plugins/compute/computers/resources/downloads.js +1 -1
  131. package/plugins/compute/computers/shared/wake.d.ts +1 -1
  132. package/plugins/compute/computers/shared/wake.js +17 -0
  133. package/plugins/interfaces/api/collections/key.d.ts +1 -1
  134. package/plugins/interfaces/api/shared/events.js +5 -4
  135. package/plugins/interfaces/maintenance/actions/read.d.ts +4 -0
  136. package/plugins/interfaces/maintenance/actions/read.js +76 -0
  137. package/plugins/interfaces/maintenance/actions/write.d.ts +4 -0
  138. package/plugins/interfaces/maintenance/actions/write.js +64 -0
  139. package/plugins/interfaces/maintenance/contract.d.ts +60 -0
  140. package/plugins/interfaces/maintenance/contract.js +2 -0
  141. package/plugins/interfaces/maintenance/mod.d.ts +52 -0
  142. package/plugins/interfaces/maintenance/mod.js +66 -0
  143. package/plugins/interfaces/maintenance/resources/routes.d.ts +71 -0
  144. package/plugins/interfaces/maintenance/resources/routes.js +457 -0
  145. package/plugins/interfaces/maintenance/shared/ops.d.ts +4 -0
  146. package/plugins/interfaces/maintenance/shared/ops.js +19 -0
  147. package/plugins/interfaces/mcp/actions/call.d.ts +11 -0
  148. package/plugins/interfaces/mcp/actions/call.js +304 -0
  149. package/plugins/interfaces/mcp/actions/prune.d.ts +1 -0
  150. package/plugins/interfaces/mcp/actions/prune.js +18 -0
  151. package/plugins/interfaces/mcp/collections/closed.d.ts +23 -0
  152. package/plugins/interfaces/mcp/collections/closed.js +17 -0
  153. package/plugins/interfaces/mcp/collections/rate.d.ts +27 -0
  154. package/plugins/interfaces/mcp/collections/rate.js +18 -0
  155. package/plugins/interfaces/mcp/collections/receipt.d.ts +46 -0
  156. package/plugins/interfaces/mcp/collections/receipt.js +46 -0
  157. package/plugins/interfaces/mcp/contract.d.ts +9 -0
  158. package/plugins/interfaces/mcp/contract.js +9 -0
  159. package/plugins/interfaces/mcp/mod.d.ts +84 -0
  160. package/plugins/interfaces/mcp/mod.js +122 -0
  161. package/plugins/interfaces/mcp/processors/closed.d.ts +13 -0
  162. package/plugins/interfaces/mcp/processors/closed.js +16 -0
  163. package/plugins/interfaces/mcp/resources/running.d.ts +21 -0
  164. package/plugins/interfaces/mcp/resources/running.js +36 -0
  165. package/plugins/interfaces/mcp/resources/server.d.ts +54 -0
  166. package/plugins/interfaces/mcp/resources/server.js +423 -0
  167. package/plugins/interfaces/mcp/resources/tools.d.ts +114 -0
  168. package/plugins/interfaces/mcp/resources/tools.js +324 -0
  169. package/plugins/interfaces/mcp/shared/caller.d.ts +45 -0
  170. package/plugins/interfaces/mcp/shared/caller.js +99 -0
  171. package/plugins/interfaces/mcp/shared/keys.d.ts +50 -0
  172. package/plugins/interfaces/mcp/shared/keys.js +53 -0
  173. package/plugins/interfaces/mcp/shared/settings.d.ts +187 -0
  174. package/plugins/interfaces/mcp/shared/settings.js +176 -0
  175. package/plugins/interfaces/mcp/views/offered.d.ts +20 -0
  176. package/plugins/interfaces/mcp/views/offered.js +20 -0
  177. package/plugins/interfaces/mod.d.ts +5 -1
  178. package/plugins/interfaces/mod.js +5 -1
  179. package/plugins/interfaces/terminal/actions/print.js +1 -1
  180. package/plugins/interfaces/terminal/actions/set.js +1 -1
  181. package/plugins/interfaces/terminal/collections/output.d.ts +1 -1
  182. package/plugins/interfaces/terminal/collections/shell.js +1 -1
  183. package/plugins/interfaces/voice/actions/block.d.ts +2 -0
  184. package/plugins/interfaces/voice/actions/block.js +74 -0
  185. package/plugins/interfaces/voice/actions/call.d.ts +19 -0
  186. package/plugins/interfaces/voice/actions/call.js +253 -0
  187. package/plugins/interfaces/voice/actions/hook.d.ts +5 -0
  188. package/plugins/interfaces/voice/actions/hook.js +225 -0
  189. package/plugins/interfaces/voice/actions/prune.d.ts +1 -0
  190. package/plugins/interfaces/voice/actions/prune.js +35 -0
  191. package/plugins/interfaces/voice/collections/blocked.d.ts +87 -0
  192. package/plugins/interfaces/voice/collections/blocked.js +34 -0
  193. package/plugins/interfaces/voice/collections/call.d.ts +279 -0
  194. package/plugins/interfaces/voice/collections/call.js +77 -0
  195. package/plugins/interfaces/voice/collections/phone.d.ts +74 -0
  196. package/plugins/interfaces/voice/collections/phone.js +26 -0
  197. package/plugins/interfaces/voice/contract.d.ts +14 -0
  198. package/plugins/interfaces/voice/contract.js +2 -0
  199. package/plugins/interfaces/voice/mod.d.ts +57 -0
  200. package/plugins/interfaces/voice/mod.js +118 -0
  201. package/plugins/interfaces/voice/processors/forget.d.ts +13 -0
  202. package/plugins/interfaces/voice/processors/forget.js +27 -0
  203. package/plugins/interfaces/voice/resources/relay.d.ts +77 -0
  204. package/plugins/interfaces/voice/resources/relay.js +428 -0
  205. package/plugins/interfaces/voice/resources/tools.d.ts +1 -0
  206. package/plugins/interfaces/voice/resources/tools.js +25 -0
  207. package/plugins/interfaces/voice/shared/caller.d.ts +27 -0
  208. package/plugins/interfaces/voice/shared/caller.js +38 -0
  209. package/plugins/interfaces/voice/shared/settings.d.ts +136 -0
  210. package/plugins/interfaces/voice/shared/settings.js +121 -0
  211. package/plugins/interfaces/voice/shared/signature.d.ts +11 -0
  212. package/plugins/interfaces/voice/shared/signature.js +34 -0
  213. package/plugins/interfaces/voice/views/call.d.ts +41 -0
  214. package/plugins/interfaces/voice/views/call.js +30 -0
  215. package/plugins/interfaces/voice/views/context.d.ts +9 -0
  216. package/plugins/interfaces/voice/views/context.js +14 -0
  217. package/plugins/interfaces/voice/views/message.d.ts +17 -0
  218. package/plugins/interfaces/voice/views/message.js +41 -0
  219. package/plugins/interfaces/whatsapp/actions/connect.js +3 -0
  220. package/plugins/interfaces/whatsapp/actions/disconnect.js +4 -1
  221. package/plugins/interfaces/whatsapp/actions/hook.js +27 -11
  222. package/plugins/interfaces/whatsapp/actions/set.d.ts +8 -0
  223. package/plugins/interfaces/whatsapp/actions/set.js +121 -0
  224. package/plugins/interfaces/whatsapp/collections/blocked.d.ts +29 -0
  225. package/plugins/interfaces/whatsapp/collections/blocked.js +22 -0
  226. package/plugins/interfaces/whatsapp/collections/code.d.ts +1 -1
  227. package/plugins/interfaces/whatsapp/collections/number.d.ts +90 -4
  228. package/plugins/interfaces/whatsapp/collections/number.js +36 -4
  229. package/plugins/interfaces/whatsapp/collections/phone.d.ts +13 -3
  230. package/plugins/interfaces/whatsapp/collections/phone.js +9 -3
  231. package/plugins/interfaces/whatsapp/collections/rate.d.ts +27 -0
  232. package/plugins/interfaces/whatsapp/collections/rate.js +13 -0
  233. package/plugins/interfaces/whatsapp/collections/sent.d.ts +24 -12
  234. package/plugins/interfaces/whatsapp/collections/sent.js +11 -7
  235. package/plugins/interfaces/whatsapp/collections/thread.d.ts +14 -6
  236. package/plugins/interfaces/whatsapp/collections/thread.js +7 -5
  237. package/plugins/interfaces/whatsapp/collections/typing.d.ts +70 -0
  238. package/plugins/interfaces/whatsapp/collections/typing.js +21 -0
  239. package/plugins/interfaces/whatsapp/contract.d.ts +27 -4
  240. package/plugins/interfaces/whatsapp/contract.js +34 -1
  241. package/plugins/interfaces/whatsapp/events/undelivered.d.ts +8 -0
  242. package/plugins/interfaces/whatsapp/events/undelivered.js +17 -0
  243. package/plugins/interfaces/whatsapp/mod.d.ts +28 -2
  244. package/plugins/interfaces/whatsapp/mod.js +65 -6
  245. package/plugins/interfaces/whatsapp/processors/forget.d.ts +6 -0
  246. package/plugins/interfaces/whatsapp/processors/forget.js +11 -0
  247. package/plugins/interfaces/whatsapp/processors/receive.d.ts +17 -3
  248. package/plugins/interfaces/whatsapp/processors/receive.js +264 -81
  249. package/plugins/interfaces/whatsapp/processors/reply.d.ts +25 -5
  250. package/plugins/interfaces/whatsapp/processors/reply.js +216 -20
  251. package/plugins/interfaces/whatsapp/processors/typing.d.ts +8 -0
  252. package/plugins/interfaces/whatsapp/processors/typing.js +25 -0
  253. package/plugins/interfaces/whatsapp/shared/customers.d.ts +13 -0
  254. package/plugins/interfaces/whatsapp/shared/customers.js +16 -0
  255. package/plugins/interfaces/whatsapp/shared/graph.d.ts +31 -6
  256. package/plugins/interfaces/whatsapp/shared/graph.js +117 -10
  257. package/plugins/interfaces/whatsapp/shared/media.d.ts +23 -0
  258. package/plugins/interfaces/whatsapp/shared/media.js +46 -0
  259. package/plugins/interfaces/whatsapp/shared/number.d.ts +19 -8
  260. package/plugins/interfaces/whatsapp/shared/number.js +64 -7
  261. package/plugins/interfaces/whatsapp/shared/parts.d.ts +94 -0
  262. package/plugins/interfaces/whatsapp/shared/parts.js +184 -0
  263. package/plugins/interfaces/whatsapp/shared/payload.d.ts +27 -1
  264. package/plugins/interfaces/whatsapp/shared/payload.js +36 -1
  265. package/plugins/interfaces/whatsapp/shared/settings.d.ts +49 -1
  266. package/plugins/interfaces/whatsapp/shared/settings.js +11 -0
  267. package/plugins/interfaces/whatsapp/views/message.d.ts +13 -0
  268. package/plugins/interfaces/whatsapp/views/message.js +13 -0
  269. package/plugins/interfaces/whatsapp/views/web/line.d.ts +24 -0
  270. package/plugins/interfaces/whatsapp/views/web/line.js +44 -0
  271. package/plugins/interfaces/whatsapp/views/web/space.d.ts +7 -5
  272. package/plugins/interfaces/whatsapp/views/web/space.js +17 -10
  273. package/plugins/interfaces/whatsapp/views/web/style.d.ts +1 -1
  274. package/plugins/interfaces/whatsapp/views/web/style.js +8 -0
  275. package/plugins/models/adapters/llm/anthropic.d.ts +1 -1
  276. package/plugins/models/adapters/llm/anthropic.js +28 -15
  277. package/plugins/models/adapters/llm/gemini.d.ts +1 -1
  278. package/plugins/models/adapters/llm/gemini.js +2 -1
  279. package/plugins/models/adapters/llm/openai-compatible.d.ts +1 -1
  280. package/plugins/models/adapters/llm/openai-compatible.js +2 -1
  281. package/plugins/models/adapters/llm/openai.d.ts +1 -1
  282. package/plugins/models/adapters/llm/openai.js +16 -4
  283. package/plugins/models/shared/types.d.ts +8 -0
  284. package/plugins/models/shared/types.js +10 -0
  285. package/runtime/actor.d.ts +6 -0
  286. package/runtime/actor.js +9 -4
  287. package/runtime/aggregate.js +8 -2
  288. package/runtime/blobs.d.ts +15 -12
  289. package/runtime/blobs.js +58 -11
  290. package/runtime/cache.d.ts +6 -0
  291. package/runtime/cache.js +19 -1
  292. package/runtime/define.d.ts +10 -0
  293. package/runtime/errors.d.ts +20 -2
  294. package/runtime/errors.js +7 -1
  295. package/runtime/executor.js +27 -11
  296. package/runtime/links.d.ts +31 -0
  297. package/runtime/links.js +60 -0
  298. package/runtime/maintain.d.ts +88 -0
  299. package/runtime/maintain.js +120 -0
  300. package/runtime/memory.js +7 -4
  301. package/runtime/mod.d.ts +6 -4
  302. package/runtime/mod.js +5 -2
  303. package/runtime/mongo.d.ts +13 -0
  304. package/runtime/mongo.js +39 -8
  305. package/runtime/observe.d.ts +2 -0
  306. package/runtime/observe.js +14 -10
  307. package/runtime/ops.d.ts +5 -0
  308. package/runtime/ops.js +10 -1
  309. package/runtime/owner.d.ts +18 -1
  310. package/runtime/owner.js +127 -61
  311. package/runtime/presence.d.ts +18 -0
  312. package/runtime/presence.js +25 -0
  313. package/runtime/registry.d.ts +5 -0
  314. package/runtime/registry.js +18 -0
  315. package/runtime/runtime.js +9 -3
  316. package/runtime/store.d.ts +48 -1
  317. package/runtime/wire.d.ts +1 -0
  318. package/runtime/wire.js +3 -1
  319. package/stores/blobs/files/mod.js +4 -2
  320. package/stores/blobs/gcs/mod.d.ts +3 -0
  321. package/stores/blobs/gcs/mod.js +6 -5
  322. package/stores/blobs/http/mod.d.ts +1 -1
  323. package/stores/blobs/http/mod.js +2 -1
  324. package/stores/latency/mod.js +5 -1
  325. package/stores/sql/postgres/maintenance.d.ts +24 -0
  326. package/stores/sql/postgres/maintenance.js +258 -0
  327. package/stores/sql/postgres/mod.d.ts +20 -4
  328. package/stores/sql/postgres/mod.js +363 -96
  329. package/stores/sql/postgres/update.js +3 -1
  330. package/stores/sql/shared/capped.d.ts +2 -0
  331. package/stores/sql/shared/capped.js +22 -0
  332. package/stores/sql/shared/rows.d.ts +14 -0
  333. package/stores/sql/shared/rows.js +29 -0
  334. package/stores/sql/shared/statement.d.ts +12 -0
  335. package/stores/sql/shared/statement.js +244 -0
  336. package/stores/sql/sqlite/apart.d.ts +11 -0
  337. package/stores/sql/sqlite/apart.js +219 -0
  338. package/stores/sql/sqlite/mod.d.ts +16 -2
  339. package/stores/sql/sqlite/mod.js +246 -51
  340. package/testing/mod.js +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,420 @@
1
+ ## 1.0.0-rc.21 — 2026-11-04
2
+
3
+ - **Security: a burst of calls no longer drops an executor's connection** (Oxian 0.23.3). About 35
4
+ concurrent calls on one executor (around 20 holding transactions) filled Oxian's queues, and the
5
+ connection was lost with every job in flight on it (`executor_lost`): a remote DoS on any app with
6
+ a public entry point, flagged by a security review. Full queues now hold senders back instead.
7
+ Long-lived workers also move to a fresh connection before one's streams run out, instead of
8
+ failing calls with `capacity`; Copilotz treats the move as the same worker (#154).
9
+ - **MCP: models outside the app call its tools** (the new `mcp` interface; widgets come next). An
10
+ app declares lines in `resources.mcp.lines.<name>`, each an MCP server at `POST /mcp/<name>`
11
+ (`/o/<org>/mcp/<name>` under many orgs): the space its chats live in (`in`), the tools it offers
12
+ (`tools`, by name: only these, never an agent's; each needs its `tool:<name>` View, else it isn't
13
+ offered, and one whose `offer` says no to a contact isn't either), how each is shown (`title`,
14
+ `annotations`, ChatGPT's `invoking`/`invoked` lines, 64 characters), who calls (`client`, the
15
+ steps' sender), `title`, `version`, `instructions`, `handles`, `origins`, `org` and `limits`; and
16
+ plugin-wide, how it knows a caller's address (`caller`) and calls at once in the process
17
+ (`atOnce`, 8). Checked at start; it needs the `links` resource's secret.
18
+ - **The protocol:** Streamable HTTP and JSON-RPC 2.0, written in the plugin, answered as JSON,
19
+ with no session (GET and DELETE are 405; no `Mcp-Session-Id`). MCP 2026-07-28 (per-request
20
+ `_meta`, `server/discover`, the `MCP-Protocol-Version`, `Mcp-Method`, `Mcp-Name` and
21
+ `Mcp-Param-*` headers checked against the body: -32020) and 2025-11-25, 2025-06-18 and
22
+ 2025-03-26 (`initialize`; batches only for 2025-03-26, 10 messages at most, one after another).
23
+ Unknown versions are -32022 with the supported ones. Every tool says `noauth`, and all four of
24
+ MCP's hints. A request with an `Origin` the line doesn't name is 403; input nested past 64
25
+ levels, or holding a `$blob`, is -32602.
26
+ - **Conversations:** ChatGPT's `_meta["openai/session"]` (with `openai/subject`) names one; a
27
+ client that names none gets a `chat` handle (128 random bits, an optional input on every tool,
28
+ said once, at the end of the first answer), or with `handles: false` is refused. Each is a
29
+ contact (`via: "mcp"`) in a chat of its own in the line's space, its ids HMACs of the key with
30
+ the `links` secret: no table. A handle the app never gave is refused; a chat whose contact its
31
+ people took out, or that was erased (`contact.forget`, `chat.erase`: a tombstone, `mcp_closed`,
32
+ no personal data), is over for good.
33
+ - **A call** is `mcp.call`, called by the route as the conversation's contact (an actor only the
34
+ route makes: `{ kind: "contact", id, mcp, client }`, which the Action's `allow` asks for). It
35
+ runs the tool through chat's runner, writes a private step from the line's `client` in the chat
36
+ (in its space as it is now; only input that fit the tool's schema, else a note of what was
37
+ sent), and answers with the tool's View, read as the contact, never its output as it is. Only a
38
+ public error (below) says its message. `ctx.callId` is the step's id (the call's,
39
+ `mcp:<thread>:<hash of the request id>:<hash of tool and input>`, and when it began), the same
40
+ however often a call cut short runs again; a new call has a new one. A tool that changes things
41
+ keeps a receipt (`mcp_receipt`, durable, no events, gone after 15 minutes) by what it asks in
42
+ its conversation (tool and input), whatever the request's id: the same call while it runs waits
43
+ for that run; asked again, under any id, within two minutes of its end it's answered what it
44
+ said (kept up to 8,000 characters), beginning with a line saying it wasn't done again (so a
45
+ second, deliberate purchase isn't taken for done); begun and never done (stopped, an owner
46
+ restarted, or failed by accident and told to try again), it runs again as the same step, with
47
+ `retry` and the same `callId`. A public refusal is an answer, and is said again. A read-only
48
+ tool always runs.
49
+ - **Limits** (`limits`): calls at once in the runtime (`mcp.atOnce`, 4: each org's own under the
50
+ orgs host), on the line (4: an executor's connection takes about that many tools that change
51
+ things at once until Oxian's send backpressure is released), from one caller's address (2; a
52
+ batch's every call counts) and in one conversation (2), past any of which it's 503 busy, -31000
53
+ (a batch, an error for each of its requests; a batch with more tool calls than `addressAtOnce`
54
+ is refused, -32600); how long the route waits for an answer (`timeout`, 20 s: then the model is
55
+ told it's still working, as long as few calls are, `lateAtOnce` 2 on the line and
56
+ `addressLateAtOnce` 1 from an address, else it's stopped) and a call may run (`stop`, 60 s: then
57
+ it's stopped; tools should honour `ctx.signal`); a request's body (64 KiB), calls a minute by
58
+ conversation (30), by caller's address (60) and on the line (600), new conversations an hour by
59
+ user (30, ChatGPT's `openai/subject`), by address (20) and on the line (600), and an answer's
60
+ length (100,000 characters). Only calls taken count, and a new conversation once it's made. The
61
+ address is believed only as the app's front says it (`caller`: its header, with the front's
62
+ secret, a request without which is refused, or the proxies' `hops`, which a list header such as
63
+ `x-forwarded-for` needs); IPv6 is counted by its /64, IPv4 written as IPv6 as IPv4, and an
64
+ address that can't be read with every other such call, as one. Ranges in `caller.exempt`
65
+ (OpenAI's) aren't limited by address.
66
+ - **A failure can be public** (`failure(code, message, { public: true })`, `isPublic`): its message
67
+ is for any caller, even a model outside the app over MCP, which no other error's words reach. It
68
+ stays public from job to job. A code alone isn't public: libraries' errors have codes too.
69
+ - **Chat's tool runner is in its contract** (`runTool`, `toolText`): a tool's input checked, run,
70
+ and its result read as agents read it, as a turn does; the turn uses them. Input that doesn't fit
71
+ a tool's schema is a public failure, and the runner says so (`unchecked`). `Tool` gains `title`
72
+ and `annotations` (`readOnly`, `destructive`, `idempotent`, `openWorld`).
73
+
74
+ - **Phone calls: the `voice` plugin** (in `copilotz/plugins/interfaces`), on Twilio's
75
+ ConversationRelay. The app declares its lines (`resources.voice.lines.<name>`: `in`, `account`,
76
+ `token`, `origin`, and optionally `agent`, `language`, `tts`, `voice`, `stt`, `texts`, `gap`,
77
+ `trustCallerId`, `keys`, `limits`, `org`), each a Twilio number open to anyone who calls; their
78
+ settings are checked at start.
79
+ - **Twilio's webhook** is `POST /hooks/voice/<line>` (the `voice.hook` route): checked against
80
+ `X-Twilio-Signature` with the line's auth token. A caller the line's managers blocked isn't
81
+ taken (`voice.block { thread, days? }`, kept by the number's hash; `voice.unblock { block }`
82
+ lifts it by its id, whatever is left of the call); then a call is taken within its caller's
83
+ limits (`callerAtOnce` 1, `callerPerDay` 10; withheld numbers, together, their own
84
+ `hiddenAtOnce` and `hiddenPerDay`, by default the line's `atOnce` and half its `perDay`), then
85
+ the line's (`atOnce` 2, `perDay` 50 calls that went on in any 24 hours), or rejected as busy
86
+ (`<Reject reason="busy"/>`: nothing is spent). A call taken gets TwiML that opens the line's
87
+ socket (`<Connect><ConversationRelay>`, the line's language, greeting and voice) with a ticket
88
+ good once, for a minute; `POST /hooks/voice/<line>/over` hears the relay end and hangs up.
89
+ - **The socket** (`GET /hooks/voice/<line>/relay`, a `serve` route): its signature checked, its
90
+ ticket used, then Twilio's `setup` must name the call the ticket was for. The caller is a
91
+ contact (`via: "voice"`) in a chat of their own in the line's space, answered by the line's
92
+ agent (a line whose agent doesn't answer there fails the call). A number isn't proof of who's
93
+ calling: calling back goes on in the same contact and chat (until the line's `gap`, 12 hours,
94
+ and never into a chat with another call on, checked in the write that puts the call live) only
95
+ when Twilio verified the number (`StirVerstat` `TN-Validation-Passed-A`) or the line sets
96
+ `trustCallerId`; otherwise, and for withheld numbers (Twilio's placeholders, `+266696687`,
97
+ `+7378742833` and the like), each call is a new contact.
98
+ - **What's said:** what the caller says goes to the agent at once, one prompt after the other; a
99
+ prompt said while the answer to the one before is still being written stops that turn, and the
100
+ next turn reads both (Twilio already waits for the caller to finish: a quiet window would add to
101
+ every answer). What the agent writes is said as it writes it, word by word (a step's words
102
+ before its tools, then its answer), through the `voice_call` View read as the caller, and only
103
+ of the turns the caller's own words started: a staff member's turn in their chat isn't said.
104
+ Speaking over it (`interrupt`) cuts what was being said, and the agent is told what was heard
105
+ (the `voice` context). Keys pressed (with `keys`) come as a tap, `keys:<digits>`.
106
+ - **What a call may cost** (`limits`): an answer that failed, or took longer than `turn` (25 s,
107
+ then stopped), says the line's `failed` text, never the error; one past `said` characters
108
+ (1,200) is cut at a word and stopped; `idle` (90 s) of silence, a call past `call` (600 s) or
109
+ past `turns` prompts (30) says `bye` and ends it. The goodbye waits 15 seconds at most for
110
+ what's being said; a call is over by its hard end (`call`, the goodbye and closing), and holds
111
+ its place among the line's calls until then. A call that ends stops its turn, and any turn of it
112
+ that starts just after. The agent ends a call too, once its goodbye is said (the `end_call`
113
+ tool, offered to whoever answers a call while it goes on). Twilio's `end` says why
114
+ (`handoffData`).
115
+ - **The phone is a medium:** messages are said through their `message` View (renderer `voice`: the
116
+ words without Markdown, a link's words, a web address's site), which an app may replace.
117
+ - Each call is a small record (`voice_call`, no events: when, how long, why it ended, whether the
118
+ number was verified; the caller's number private), and `voice_phone` keeps each verified
119
+ caller's contact and chat. Erasing a contact erases its number from both; erasing a chat
120
+ (`chat.erase`, `contact.forget` with `chats`) erases what the calls kept of it. Calls' records
121
+ go after the plugin's `keep` days (30, at least 1: `voice.prune`, daily), once they're over: a
122
+ call going on is never pruned. Agents working for a caller are told it's a phone call, and that
123
+ the number isn't proof of who they are (the `contact` context).
124
+ - It needs a host that takes a route's socket (`host.upgrade()`: `serveRoutes`, or `serve`, from
125
+ `copilotz/web/node`).
126
+
127
+ - **Maintenance endpoints** (the new `maintenance` plugin, in `copilotz/plugins/interfaces`): HTTP
128
+ under `/maintenance/` for an app's operators when they can't reach its database. A key (`key`, or
129
+ several in `keys` to rotate one; 32 random characters at least, a weak one stops the app),
130
+ compared in constant time; without one, every request is unauthorized. Requests act as the
131
+ maintenance actor (`{ kind: "maintenance", by }`), whose Actions run as the system on the record,
132
+ and each writes a line (`log`) before it runs. An orgs host's orgs don't get it.
133
+ - `POST /maintenance/sql`: one read-only statement, with `params`, at most `limit` rows and
134
+ `bytes`, cut off after `timeout`.
135
+ - `POST /maintenance/collections/<collection>/<op>`: insertOne… deleteMany, find… aggregate,
136
+ through the owner's write path: schema-checked, recorded, cached, heard by Processors.
137
+ - `POST /maintenance/queries/<collection>.<name>`: a collection's named query, the body its
138
+ params, read as the system.
139
+ - `POST /maintenance/sql/write`: one statement that writes, run by the owner alone among its
140
+ writes, fenced by its epoch, with a `maintenance.sql` audit event in the same commit; then the
141
+ owner empties its read cache, runs observed Views again and re-reads its timers. A statement
142
+ that changes `meta` (the epoch, Processors' positions) is rolled back. An `Idempotency-Key`
143
+ makes it safe to send again.
144
+ - `GET /maintenance/blobs/<id>`: a blob's bytes, as a download.
145
+ - **SQL on the store port, for maintenance only:**
146
+ `Store.inspect?(sql, params?, { limit, timeout })` (now SQLite's too), a transaction's
147
+ `execute?(sql, params?)` and `transaction(…, { maintenance })`. Both run exactly one statement: a
148
+ second, or one that ends the transaction or changes the connection (`COMMIT`, `SET`…), is refused
149
+ (PostgreSQL ran every statement of an unparameterized `inspect` before; PostgreSQL's line comments
150
+ end at a CR too). `runtime.maintenance` is the owner's way to them; plugin code has none. The
151
+ cache gains `clear()`, observers `stale()`.
152
+ - **PostgreSQL servers:** raw SQL runs only as a role of its own
153
+ (`postgresStore({ maintenance: { url, connections } })`), which must hold exactly maintenance's
154
+ grants: no attribute but LOGIN, membership in no role (but Cloud SQL's IAM marker, itself held
155
+ to the same), no settings of its own, nothing owned (a large object neither), nothing granted
156
+ outside the store's schema, `CREATE` nowhere, no large object, table or column of another's to
157
+ read, nothing on the store's tables beyond what it needs, no `SECURITY DEFINER` function to run,
158
+ no `dblink` or `postgres_fdw`, no trigger on the store's tables: checked before each statement
159
+ and again after a write, in its transaction, reading only `pg_catalog`'s names. `ALTER ROLE`,
160
+ `DO` and `LOCK` don't run; a password literal is kept as `PASSWORD '***'`. Each statement on a
161
+ connection of its own, over the extended protocol, closed after; at most 2 at once, else `busy`.
162
+ A read stops fetching before a row would pass its bytes. PGlite runs it as its one session, and
163
+ discards what it left there.
164
+ - **SQLite:** the store names its tables in `main`, so a temporary object can't stand in for them
165
+ (a write that leaves one, or a trigger, is rolled back); a read runs in a process of its own
166
+ (`deno`, `node` or `bun` itself, never a compiled app; an empty environment; on Deno and Node,
167
+ read access to the database's files alone), killed at its timeout. Else, on the reading
168
+ connection, a pragma only from those that only read, said once and on each answer
169
+ (`inline: true`).
170
+
171
+ - **Security: a forged blob reference is refused, never loaded.** Large strings are kept as blobs
172
+ and documents hold `{ $blob, size, type }` in their place; the owner loaded any object with a
173
+ string `$blob` on every read. So an Action that stores what it's given (a tool's input, a
174
+ webhook's body) could plant one: an id no blob has made every read of that document fail (a chat
175
+ that can't be read or erased, Processors giving up on its events); another document's hash pulled
176
+ that content in; and a path or a name read a file (`fileBlobs`) or any object in the bucket
177
+ (`gcsBlobs` without a prefix).
178
+ - What plugin code writes (documents, updates, upserts' filters, edges, events, records, timers'
179
+ inputs, Action results) and what an Action is called with may hold no `$blob` key: `invalid`.
180
+ The owner checks it as it walks what it offloads, so it costs no extra pass.
181
+ - No part of an update's field path may start with `$` (as MongoDB refuses) or be `__proto__`
182
+ (`invalid`): `{ $set: { "bio.$blob": … } }` made a reference out of plain strings, and on Node
183
+ and Bun `{ $set: { "__proto__.x": … } }` set `x` on every object's prototype (Deno has no
184
+ `__proto__`). `constructor` and `prototype` are fields like any other: paths read and make a
185
+ document's own fields only, so a filter on `constructor` no longer finds `Object` in every
186
+ document.
187
+ - A path ends at a blob reference as it does at a string, so a large string is treated like a
188
+ small one (`$set: { "text.note": 1 }` replaced the reference's insides, losing the text), and at
189
+ any other object with a `$blob` key, so no update turns a planted one into a reference.
190
+ - An aggregate's `$group` can't name a field `$…` either: `_id: { $blob: …, size, type }` built a
191
+ reference from strings, which a browser's own read then loaded.
192
+ - The API's event stream sends a call's result whole; one over 16 KiB went as its reference.
193
+ Published events (`runtime.subscribe`) have `full()`: the event with its large values.
194
+ - Only an exact reference loads a blob: the keys `$blob`, `size` and `type`, a `sha256-<64 hex>`
195
+ id, a numeric size and a string type. Any other object is data.
196
+ - Every blob store (memory, SQLite, PostgreSQL, `fileBlobs`, `httpBlobs`, `gcsBlobs`) takes only a
197
+ blob's id (`checkBlobId`, exported for your own `Blobs`).
198
+ - Fixed on the way: a timer's input over 16 KiB reached its Action as a reference; it comes whole.
199
+ An occurrence of one that a deploy to this version cuts short fails once when it resumes
200
+ (`id_conflict`: it started with the reference as its input); the timer's next ones run.
201
+ - A store may already hold planted references: an exact one still loads (its blob gone, reads
202
+ fail), and any other, carried on, is now refused. #155 has read-only queries (PostgreSQL,
203
+ SQLite) that find them; clean every one, `sys.timers` first.
204
+
205
+ - **Contacts: people outside the org who talk to its agents** (the new `contacts` plugin, part of
206
+ `access`). A WhatsApp customer is a contact, its own kind of actor (`{ kind: "contact", id }`),
207
+ never a person: every `allow: people` Action and query stays shut to it, and nothing that asks for
208
+ a person (`personOf`) finds one. The runtime's `principalOf` says whom work is for, a person or a
209
+ contact (it moved there from chat), and `peopleOrContacts` is what an Action opened to contacts
210
+ allows: today only `chat.send`, whose message is then from `contact:<id>`.
211
+ - A contact's chat is shared with it on its own (a membership `on` the thread, made by
212
+ `contact.chat`): it reaches that chat, what's said and filed there, and its own record, nothing
213
+ else. The space's people reach it as any chat there; the agent working for the contact reaches
214
+ exactly that chat. Three generic completions in spaces make it so, and help people too (a person
215
+ can now share one chat): a shared collection's documents can be part of another's (`part`: a
216
+ message's `thread`), reached with it; an agent working for someone reaches a document one of
217
+ them reaches on its own in a space the other reaches; and `present(ctx, space)` says whether
218
+ someone reaches a space or a document in it, so `space.roster` tells a contact in its chat who
219
+ answers (agents only).
220
+ - A contact is let into documents only, never a whole space (`member.set`, a request granted), and
221
+ never manages one. `request_access` isn't offered to agents working for a contact, nor memory: a
222
+ customer's chat keeps to itself.
223
+ - `contact.start` (trusted code, idempotent by id) and `contact.chat`; `contactOf(actor)` says
224
+ whose work an event's actor's is (the contact's id, through the agent working for them too);
225
+ agents are told whom they talk with (the `contact` context) and see them by name: the `names`
226
+ resource is now a map of sources
227
+ (`{ people: { collection: "profile" }, contact: { collection: "contact", prefix:
228
+ "contact:" } }`),
229
+ replacing `{ collection }`. On the web, add `contactsWeb` to show contacts by name.
230
+ - **A WhatsApp number can be a customer line.** Its space's managers open it to anyone
231
+ (`whatsapp.set { number, open, agent, gap }`). A stranger who writes is then a contact, in a chat
232
+ of their own in the number's space, answered by the number's agent (or who answers new chats
233
+ there); a chat quiet for `gap` hours (12 by default) is over, and their next message starts a new
234
+ one. Their text always goes to the agent (commands stay linked people's); a code from the app
235
+ still links a phone, and linked phones keep working as their person. The `whatsapp` plugin now
236
+ requires `contacts`.
237
+ - **WhatsApp is a medium.** A View for it (renderer `whatsapp`) returns parts, each one WhatsApp
238
+ message, built with the toolkit in WhatsApp's contract (`text`, `buttons`, `list`, `carousel`,
239
+ `image`, `document`, and `clip` for titles), which checks Meta's limits and throws `invalid`
240
+ instead of cutting anything short. A message goes out as its `message` View there (the plugin's:
241
+ its text as WhatsApp formats it; an app's replaces it).
242
+ - **Additions:** chat declares the `additions` resource kind (`{ order?, agents? }`, each an
243
+ `addition:<name>` View in the medium, given `{ thread, answer }`, returning `Addition`s:
244
+ `{ key, parts, fallback?, note? }`). After an agent's final answer that didn't fail
245
+ (`isAnswer`), each goes once per chat per key, recorded in chat's new `shown` ledger through
246
+ `chat.shown` (trusted code, unrecorded); its `note` is told to the model after that answer
247
+ (`[then shown: …]`).
248
+ - **One message, not two:** an answer's last text goes as the first addition's body (or caption)
249
+ when there's room, as Meta charges per message. A part Meta refuses (a 400 that isn't the token
250
+ or the 24-hour window) sends the addition's fallback instead, with the answer joined to it;
251
+ without one, it's logged. A retried delivery sends only what didn't go (`whatsapp_sent` now
252
+ keeps each part by id, with its addition's `key` and `thread`).
253
+ - **Taps:** a button's, a list row's, a carousel card's or a template's reply comes as its title
254
+ with `tap: { id, title, key }` (`chat.send` takes `tap`; messages keep it), answering the
255
+ message it was on; agents read `Carla: PIX [tapped: pay:pix]`. Typing the title is just text. A
256
+ tap is a choice, not a permission: anyone can send any id, so a tool acting on one checks it
257
+ against what was shown there. A quote or a tap answers only what went out in its own chat.
258
+ - What a message and its additions show is read as whom they go to, never with the reach of
259
+ whoever's work the answer was.
260
+ - **"Typing…" while agents work:** each step an agent takes in a WhatsApp chat shows it again once
261
+ WhatsApp may have hidden it (after 20 s, for up to five minutes); nothing says "please wait".
262
+ - **Media:** a part's picture or file is a public https link (as given), one of the app's routes
263
+ (`{ route, params }`: a link signed for a day with its params, which the route checks with
264
+ `verifyLink`), or a chat's file (`{ file }`: a signed link to `/files/<id>`, or, without the
265
+ app's `links`, uploaded to Meta and sent by its id). A carousel's pictures must be links: a file
266
+ with nowhere to link it sends the fallback. A message's files go as images (jpeg, png up to 5
267
+ MB) or documents, a short text as the first one's caption.
268
+ - **WhatsApp lines for an app, as it uses them** (for Mobizap):
269
+ - **A line the app declares** in its settings (`resources.whatsapp.lines.<name>`: the space,
270
+ Meta's number id, token and app secret, its own verify token, a webhook path it routes to
271
+ `whatsapp.hook`, its agent, gap, rate, quiet window and language): open to anyone, kept as the
272
+ settings say at every use, with no person connecting or opening it; people can't change it
273
+ (`whatsapp.set`, `whatsapp.credentials` and `whatsapp.disconnect` refuse), and the web tab
274
+ leaves it alone. `whatsapp.set` stays for numbers people connect.
275
+ - **Spaces the app declares** (the spaces plugin's `spaces` resource, by id: `{ name, agents }`):
276
+ the app's own, owned by no person, made and kept by the system when something needs them
277
+ (`space.keep`, trusted code; a declared line keeps the space it's `in`). Its agents are editors
278
+ there, the first answering its new chats; people neither take them out, nor change their role,
279
+ nor rename the space. Otherwise it's a space like any other.
280
+ - **The reply is the body:** after an answer, an addition's own words (a question its buttons ask)
281
+ are what it says without one; with the answer, the answer is its whole body. A fallback keeps
282
+ its words after the answer.
283
+ - **What Meta took but couldn't deliver** (a failed status on the webhook, such as a picture it
284
+ couldn't fetch: `whatsapp.undelivered`) sends that addition's fallback, once, with the answer's
285
+ text when it went in the same message.
286
+ - **A burst gets one answer:** a customer's messages wait for the line's quiet window (`quiet`, 4
287
+ s by default, up to 30) before the agent answers, all of them in one turn and one reply
288
+ (`chat.send`'s new `quiet`: a durable timer each message sets again, `chat.quiet`, so a restart
289
+ in the window still answers once).
290
+ - **A failed turn** tells a customer only that, in their line's language, never its error.
291
+ - Each sender's quiet window is their own (`quiet:<thread>:<sender>:<agent>`): a staff member's
292
+ message never takes a customer's place, nor the reverse. Erasing a chat ends its windows, and a
293
+ window whose message is gone (or no longer theirs to read) starts no turn.
294
+ - A declared line is one org's with the orgs host: it names the org (`org`), and every other org's
295
+ runtime has nothing of it; a line naming none is a single-org app's.
296
+ - What Meta couldn't deliver is rendered again as its addressee, as any reply is.
297
+ - **Signed links** (the runtime's `signLink` and `verifyLink`, with the app's `links` resource:
298
+ `{ origin, secret }`, a secret of at least 32 bytes, checked at start): the app's origin, a path,
299
+ its params and an expiry (an hour unless said), HMAC-signed, with a line break between origin and
300
+ path, so a link for one app or org never opens another (under `hosts/orgs`, give each org its own
301
+ origin). The web host checks the secret as it starts serving. A chat's file is linked or uploaded
302
+ only for someone who may read it. The web host serves a file at a signed `/files/<id>` link
303
+ without a session, as the system; expired or altered, a 404.
304
+ - **Chat in spaces declares its own `shared` entries** (`thread`, `message` with labels, `file`,
305
+ `live` and `shown`, each a part of its thread). `chat.open` opens an empty chat in a space;
306
+ `chat.say { id, thread, from, text, to? }` has an agent say a fixed message in a chat without a
307
+ turn (trusted code only; the same `id` is said once), sent out like any of its answers.
308
+ - **What a contact's chat shows stays theirs to see** (from a security review):
309
+ - A document others are parts of (a chat) labels as itself, and so do its parts: a write into a
310
+ chat shared with someone outside its space (a contact) that drew on anything else, even the same
311
+ space, carries that space as its source (staff read it; the contact doesn't), or an agent
312
+ writing it is refused (`needs_share`). WhatsApp sends only what its addressee may read.
313
+ - Agents are told who else is in a chat from outside the org (the `where` context), from a chat's
314
+ members on its own, which its space's people now read by asking for that chat.
315
+ - A part of a shared document, and a document shared on its own, are reached only where it lives:
316
+ nothing written as one lands in another space. `may`, `must` and `present` never take a document
317
+ shared on its own for a space (`may(ctx, verb, id, on)` asks about the document).
318
+ - A contact's message goes to whom its chat is with (or the agent that wrote what it replies to):
319
+ never to agents it names. Anyone's `replyTo` is kept only for a message of the same chat that
320
+ they read.
321
+ - A tool whose `offer` is a function decides for agents that name it too; `request_access` refuses
322
+ for a contact; computers aren't woken (or billed) for work that's no person's; memory declares
323
+ its own `shared` entry; the identity guard keeps people's records to people.
324
+ - `chat.say`'s message is `<thread>:say:<id>`, said only by an agent answering in that chat.
325
+ - Work handed to another space from a chat shared with a contact comes back labelled with that
326
+ space (`sources`): the contact doesn't read it (spaces' contract: `sharedWith`).
327
+ - The `shared` resource's entries are its own keys: a collection named like what objects inherit
328
+ (`constructor`) is none.
329
+ - **Erasure:** `contact.forget { contact, chats? }` (managers of its space) ends a contact's access
330
+ at once, deletes its record (`contact.deleted`: WhatsApp erases its phone, but a block on it
331
+ stays, by the phone's hash) and, with `chats`, its chats, each for someone who manages that chat's
332
+ space (chat's new `chat.erase`, trusted code only: messages, files, waits, steps in flight; the
333
+ history plugin erases its summaries on `thread.deleted`). The event log keeps what happened (what
334
+ WhatsApp delivered, each change with its document) until retention removes it; memories learned in
335
+ staff's chats, and chats a hand-over opened elsewhere, aren't erased.
336
+ - **An open line, kept in hand:** `whatsapp.block { thread, blocked }` (managers) blocks the phone
337
+ behind a chat: what it sends goes nowhere, unanswered. A customer sending more than the number's
338
+ `rate` a minute (20) goes unanswered. One taken out of their chat is heard again once it's been
339
+ quiet for the gap. Customers are told what can't go on in the number's `language` (`en`, `pt`),
340
+ never in an error's own words.
341
+ - **Fixed:** `message.questions`, and the terminal's `shell.mine`, `shell.set` and `shell.print`,
342
+ let anyone whose id matched in; they're a person's own now.
343
+
344
+ - **Private fields for recorded Actions.** `private: ["buyer", "passengers"]` on an Action (dot
345
+ paths, as a collection's): its calls are recorded without them, in `action.started`'s input and
346
+ `action.completed`'s result alike, so the personal data a booking's buyer gives (names, CPFs,
347
+ emails) never lands in the log, while the calls are still recorded, retried and deduplicated.
348
+ - The call's `inputHash`, and so a nested call's id, still covers the whole input: a retry with
349
+ the same input answers from the log, and a changed one is a new call (under an outside call id,
350
+ `id_conflict`).
351
+ - A result that had private fields is kept whole in `sys.results` (a document by call id, written
352
+ in the completion's commit, no events), and `action.completed` says `private: true`: a retry
353
+ answers with all of it, as it would without them.
354
+
355
+ - **A host without the web app: `serveRoutes`** (`copilotz/web/node`), for an app people use on
356
+ WhatsApp or on the phone. Given the runtime, it serves the app's routes alone (webhooks),
357
+ `/health` (unless a route takes it), and 404 for anything else: no page, no code, no sign-in; a
358
+ route's Action is called as a visitor. Its `close({ drain })` stops listening, letting running
359
+ requests finish, then closes the runtime with those options. A runtime that declares the `socket`
360
+ transport still takes its sockets at `/oxian`. `routeHost(runtime)` (`copilotz/web/server`) is the
361
+ same as a fetch handler. On Node, Deno and Bun (`examples/web-node/routes.ts`).
362
+ - **A route can take a WebSocket** (a voice call's relay): a `serve` route calls `host.upgrade()`,
363
+ and answers with the response it gives; its `socket` is a browser's `WebSocket` as far as
364
+ `onmessage`, `send` and `close` go. It can refuse first, before any handshake. `serveRoutes` and
365
+ the web host's `serve` take it, through Oxian's adapter (route sockets, Oxian 0.23).
366
+
367
+ - **A tool call runs once, even when its turn is tried again.** A step that failed after its tools
368
+ ran (a tool's `llm` View throwing, a commit failing) was run again whole: its model asked again,
369
+ its tools run again, with whatever input the model now chose, and the model never saw the first
370
+ run. Now a step's calls are written before any of them runs (chat's new `intent` collection, one
371
+ document per running turn, no events), and what each returns as soon as it does. A retried turn
372
+ goes on with those calls without asking its model: a call that returned answers from its record,
373
+ and one cut short (its executor lost, the runtime closed) runs again as itself.
374
+ - Tools get `ctx.callId`, the same however many times the call runs (`<turn>:<step>:<n>`): the
375
+ idempotency key for what they do outside. `ctx.retry` is now true only for a call that may have
376
+ run before. The recorded Actions a tool calls answer from the log when it runs again.
377
+ - A turn that ends without its step (failed for good, or stopped mid-tool) keeps the step, with
378
+ what each call returned, or that it never did ("Interrupted before it returned: it may or may
379
+ not have taken effect…"); a stopped answer no longer repeats that step's text.
380
+ - A tool step costs one more commit (its calls, before they run) and one per tool call (what it
381
+ returned). A step that only sends messages costs nothing more: they commit with it.
382
+ - **Closing drops no turn.** `runtime.close()` returned from a delivery it cut short as if it were
383
+ done, then saved its Processor's cursor past it, so a turn running at a deploy never answered. Now
384
+ closing starts no more deliveries or timer occurrences, gives the running ones `drain` ms to
385
+ finish (`close({ drain })`, 5 s by default), and keeps each cursor before an event it didn't
386
+ finish: the next owner delivers it again, with `retry`, and with the above it doesn't repeat its
387
+ tools. Workers are told they're gone after the drain, so running work can still use them. The orgs
388
+ host's `close({ drain })` passes it on to every org's runtime.
389
+
390
+ - **Fixed: messages in a row ended an agent's prompt with its own answer.** A person writing several
391
+ messages a few seconds apart starts a turn for each; one that ran after the agent had answered
392
+ (while it wrote, or with the next turn) was sent a conversation ending with that answer, which
393
+ Anthropic's newer models refuse ("assistant message prefill", HTTP 400), so it failed. Now an
394
+ answer keeps how far its turn had read its thread (`knew`, the `at` of the newest message there);
395
+ the prompt reads what others said after that, while it wrote, after the answer; and the turn of a
396
+ person's message that an answer to them had already read ends without a model call. Adapters never
397
+ send a conversation ending with the model's own message: a user turn ("Continue.") follows it, for
398
+ every provider alike.
399
+ - **Fixed: a failed turn's answer said what its provider said.** "booking failed: Anthropic 400:
400
+ {…}" was written in the chat, where everyone there read it (and a WhatsApp customer got it). It
401
+ now says "booking failed: something went wrong, so it couldn't answer. Try again in a moment."
402
+ What went wrong stays in the `processor.failed` event; a missing key still says who can add one.
403
+ - **Fixed: MiniMax's usage counted no input.** Anthropic's adapter read input and cache counts only
404
+ from `message_start`; MiniMax (on Anthropic's protocol) says them in `message_delta`, so its calls
405
+ were recorded with 0 input tokens. It now reads every count from both, the greatest of each (they
406
+ are totals so far), so Anthropic's, said in both, count once.
407
+ - **OpenAI keeps nothing: `store: false`.** The Responses API stores every response (30 days) unless
408
+ told not to, and Copilotz never read them back: a model's reasoning already comes back encrypted
409
+ and goes back with each call. A server that refuses `store` is asked again without it, from then
410
+ on, as one refusing `include` is. A model's `options` can still set it.
411
+
412
+ - **Fixed: a collection's private fields reached the log on PostgreSQL.** Writes that go as the
413
+ store's single command (most of them) recorded `.created`, `.updated` and `.deleted` with the
414
+ whole document, so `private` fields (a computer's `pending` secret, unsealed account tokens) were
415
+ in the log there; memory and SQLite left them out. The command now records documents without them
416
+ too. Events already written still hold them.
417
+
1
418
  ## 1.0.0-rc.20 — 2026-11-04
2
419
 
3
420
  - **A model thinking past two minutes isn't a dropped call.** A call counted as dropped once its