copilotz 1.0.0-rc.55 → 1.0.0-rc.57

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 (83) hide show
  1. package/AGENTS.md +61 -6
  2. package/CHANGELOG.md +57 -0
  3. package/README.md +2 -2
  4. package/hosts/web/pt-br/computers.d.ts +6 -0
  5. package/hosts/web/pt-br/computers.js +115 -0
  6. package/hosts/web/pt-br/mod.d.ts +2 -2
  7. package/hosts/web/pt-br/mod.js +14 -3
  8. package/package.json +1 -1
  9. package/plugins/access/accounts/contract.d.ts +19 -1
  10. package/plugins/access/accounts/mod.d.ts +4 -1
  11. package/plugins/access/accounts/mod.js +4 -1
  12. package/plugins/access/accounts/views/web/accounts.d.ts +8 -1
  13. package/plugins/access/accounts/views/web/accounts.js +16 -6
  14. package/plugins/access/accounts/web.d.ts +6 -0
  15. package/plugins/access/accounts/web.js +6 -0
  16. package/plugins/compute/computers/actions/engine.d.ts +8 -0
  17. package/plugins/compute/computers/actions/engine.js +142 -0
  18. package/plugins/compute/computers/actions/engines.d.ts +15 -0
  19. package/plugins/compute/computers/actions/engines.js +111 -0
  20. package/plugins/compute/computers/adapters/engine.d.ts +34 -0
  21. package/plugins/compute/computers/adapters/engine.js +224 -0
  22. package/plugins/compute/computers/collections/computer.d.ts +19 -0
  23. package/plugins/compute/computers/collections/computer.js +6 -0
  24. package/plugins/compute/computers/mod.d.ts +8 -0
  25. package/plugins/compute/computers/mod.js +22 -0
  26. package/plugins/compute/computers/program/agents/acp.d.ts +44 -0
  27. package/plugins/compute/computers/program/agents/acp.js +452 -0
  28. package/plugins/compute/computers/program/agents/claude.d.ts +4 -0
  29. package/plugins/compute/computers/program/agents/claude.js +432 -0
  30. package/plugins/compute/computers/program/agents/codex.d.ts +78 -0
  31. package/plugins/compute/computers/program/agents/codex.js +580 -0
  32. package/plugins/compute/computers/program/agents/engines.d.ts +32 -0
  33. package/plugins/compute/computers/program/agents/engines.js +381 -0
  34. package/plugins/compute/computers/program/agents/mcp.d.ts +28 -0
  35. package/plugins/compute/computers/program/agents/mcp.js +252 -0
  36. package/plugins/compute/computers/program/agents/permission.d.ts +11 -0
  37. package/plugins/compute/computers/program/agents/permission.js +46 -0
  38. package/plugins/compute/computers/program/agents/rpc.d.ts +37 -0
  39. package/plugins/compute/computers/program/agents/rpc.js +192 -0
  40. package/plugins/compute/computers/program/agents/steps.d.ts +61 -0
  41. package/plugins/compute/computers/program/agents/steps.js +146 -0
  42. package/plugins/compute/computers/program/agents/types.d.ts +136 -0
  43. package/plugins/compute/computers/program/agents/types.js +13 -0
  44. package/plugins/compute/computers/program/agents/write.d.ts +2 -0
  45. package/plugins/compute/computers/program/agents/write.js +13 -0
  46. package/plugins/compute/computers/program/computer.d.ts +4 -1
  47. package/plugins/compute/computers/program/computer.js +15 -2
  48. package/plugins/compute/computers/program/version.d.ts +1 -1
  49. package/plugins/compute/computers/program/version.js +1 -1
  50. package/plugins/compute/computers/program/workloads/agents.d.ts +29 -0
  51. package/plugins/compute/computers/program/workloads/agents.js +38 -0
  52. package/plugins/compute/computers/program/workloads/search.d.ts +1 -1
  53. package/plugins/compute/computers/resources/downloads.js +1 -1
  54. package/plugins/compute/computers/resources/engines.d.ts +30 -0
  55. package/plugins/compute/computers/resources/engines.js +22 -0
  56. package/plugins/compute/computers/shared/engines.d.ts +51 -0
  57. package/plugins/compute/computers/shared/engines.js +47 -0
  58. package/plugins/compute/computers/shared/workloads.d.ts +128 -0
  59. package/plugins/compute/computers/shared/workloads.js +8 -0
  60. package/plugins/compute/computers/views/web/plan-card.d.ts +30 -0
  61. package/plugins/compute/computers/views/web/plan-card.js +85 -0
  62. package/plugins/compute/computers/views/web/plan-shared.d.ts +18 -0
  63. package/plugins/compute/computers/views/web/plan-shared.js +45 -0
  64. package/plugins/compute/computers/views/web/plan-sign-in.d.ts +26 -0
  65. package/plugins/compute/computers/views/web/plan-sign-in.js +207 -0
  66. package/plugins/compute/computers/views/web/plan-states.d.ts +138 -0
  67. package/plugins/compute/computers/views/web/plan-states.js +225 -0
  68. package/plugins/compute/computers/views/web/plans-palette.d.ts +11 -0
  69. package/plugins/compute/computers/views/web/plans-palette.js +40 -0
  70. package/plugins/compute/computers/views/web/plans.d.ts +22 -0
  71. package/plugins/compute/computers/views/web/plans.js +156 -0
  72. package/plugins/compute/computers/views/web/style.d.ts +4 -3
  73. package/plugins/compute/computers/views/web/style.js +163 -2
  74. package/plugins/compute/computers/views/web/words.d.ts +1 -0
  75. package/plugins/compute/computers/views/web/words.js +131 -0
  76. package/plugins/compute/computers/web.d.ts +9 -4
  77. package/plugins/compute/computers/web.js +19 -5
  78. package/plugins/models/shared/generate.js +1 -0
  79. package/plugins/models/shared/provider.d.ts +8 -1
  80. package/plugins/models/shared/provider.js +9 -2
  81. package/plugins/models/shared/types.d.ts +2 -0
  82. package/runtime/owner.d.ts +6 -0
  83. package/runtime/owner.js +15 -3
package/AGENTS.md CHANGED
@@ -4,7 +4,7 @@ A guide for coding agents (Claude Code, Codex, Cursor, Gemini) building an app w
4
4
  it whole before you write code. The last section is for work on Copilotz itself.
5
5
 
6
6
  It ships in the package (`node_modules/copilotz/AGENTS.md`, and `@copilotz/copilotz` on JSR) and
7
- goes with `copilotz@1.0.0-rc.55`. Every docs page is Markdown at
7
+ goes with `copilotz@1.0.0-rc.57`. Every docs page is Markdown at
8
8
  `https://copilotz.com/docs/<slug>.md`, and https://copilotz.com/llms.txt lists them all. When you're
9
9
  unsure of a name, fetch its page or read the package's types (`node_modules/copilotz/**/*.d.ts`).
10
10
  Don't guess.
@@ -64,12 +64,12 @@ There's no project generator. Set a project up as the docs' courses do, on Node
64
64
  ```sh
65
65
  mkdir my-app && cd my-app
66
66
  npm init -y && npm pkg set type=module
67
- npm install copilotz@1.0.0-rc.55 react@19 react-dom@19
67
+ npm install copilotz@1.0.0-rc.57 react@19 react-dom@19
68
68
  npm install -D typescript @types/node @types/react @types/react-dom esbuild
69
69
  ```
70
70
 
71
71
  Pin the version: npm's `latest` tag still points at an early release candidate. On Deno, run
72
- `deno add jsr:@copilotz/copilotz` and map `"copilotz": "jsr:@copilotz/copilotz@^1.0.0-rc.55"` in
72
+ `deno add jsr:@copilotz/copilotz` and map `"copilotz": "jsr:@copilotz/copilotz@^1.0.0-rc.57"` in
73
73
  `deno.json`, so imports read the same.
74
74
 
75
75
  Node runs `.ts` files as they are, so there's no build step. It doesn't run `.tsx`: tests that load
@@ -110,7 +110,7 @@ line `@AGENTS.md` (Claude Code reads `CLAUDE.md`, and follows the import). Keep
110
110
  ```markdown
111
111
  # AGENTS.md
112
112
 
113
- This app runs on Copilotz (copilotz@1.0.0-rc.55). Read node_modules/copilotz/AGENTS.md first;
113
+ This app runs on Copilotz (copilotz@1.0.0-rc.57). Read node_modules/copilotz/AGENTS.md first;
114
114
  https://copilotz.com/llms.txt lists the docs, as Markdown.
115
115
 
116
116
  - `npm test` runs every test offline, with a scripted model: run it after each change.
@@ -329,6 +329,61 @@ Test what callers may not do as well: call as someone else, and `assert.rejects`
329
329
  - **Online:** `devSignIn` is for this machine only; Copilotz won't start it with a public origin.
330
330
  Keep the `links` secret (32 bytes or more) across restarts, or MCP conversations start over.
331
331
 
332
+ ## The record and bytes
333
+
334
+ **The record lasts as the store does.** Each commit appends its events to the `events` table, and
335
+ the runtime never changes or deletes one. An event is `{ seq, id, type, data, cause, actor, at }`:
336
+ `cause` is the event behind it, `actor` the whole actor (`for`, `in`, `via`), `at` its commit's
337
+ time. `action.started` holds `{ action, input, inputHash, startedAt, attempt }`, `action.completed`
338
+ the `result`, a collection's event `{ _id, doc }`. Read it with `store.events(afterSeq, limit)` in a
339
+ test or script, `runtime.subscribe` live, or SQL (`sqlite3`, `psql`,
340
+ [maintenance](https://copilotz.com/docs/operations/maintenance.md)). Plugin code reads no log.
341
+
342
+ **Kept out:** a collection's `private` fields (keys, tokens), an Action's `private` fields, an
343
+ unrecorded Action's call (`record: false`; not its writes), and collections with `events: false` or
344
+ `durable: false`. All else an Action is given stays for good.
345
+
346
+ **Large values.** A string over 16 KiB is a blob, stored once by its hash: documents and events keep
347
+ a reference, and reads load it whole unless a `projection` leaves the field out. Blobs live in the
348
+ store, or in files or a bucket (`createRuntime({ blobs })`), chosen before it fills. A file is a
349
+ string (a `data:` address, base64). Nothing deletes a blob: a value deleted or replaced stays on the
350
+ record. [Stores](https://copilotz.com/docs/operations/stores.md) and
351
+ [BC 36](https://copilotz.com/docs/build-compass/part-12-shipping/36-postgresql-and-blobs.md) have
352
+ the rest.
353
+
354
+ **A list reads names, not pictures:** its query leaves them out (`projection: { picture: 0 }`), and
355
+ each row shows `/pictures/<id>`, a route that checks who asks before it reads. With `{ actor }`,
356
+ `runtime.bytes` reads only where a rule speaks for the collection (else it's refused); `service` has
357
+ none, so it's read as the system:
358
+
359
+ ```ts
360
+ import { definePlugin, people } from "copilotz";
361
+
362
+ const PICTURE = /^data:(image\/(?:png|jpeg|gif|webp));base64,(.+)$/;
363
+
364
+ export const pictures = definePlugin({
365
+ name: "pictures",
366
+ routes: {
367
+ "/pictures/:id": async (_request, { runtime, actor, params }) => {
368
+ const none = new Response("Not found", { status: 404 });
369
+ if (!people(actor)) return none;
370
+ const kept = await runtime.bytes("service", { _id: params.id }, "picture");
371
+ if (!kept) return none;
372
+ const text = new TextDecoder().decode(await kept.read(0, kept.size));
373
+ const [, type, base64] = PICTURE.exec(text) ?? [];
374
+ if (!base64) return none;
375
+ const body = Uint8Array.from(atob(base64), (c) => c.charCodeAt(0));
376
+ return new Response(body, {
377
+ headers: { "content-type": type, "x-content-type-options": "nosniff" },
378
+ });
379
+ },
380
+ },
381
+ });
382
+ ```
383
+
384
+ **Common mistakes:** a list reading pictures whole; a key in an Action's input or in a field that
385
+ isn't `private`; a route reading before it checks who asks; counting on a delete to erase a file.
386
+
332
387
  ## A business app's web front end
333
388
 
334
389
  Screens for people at work: lists, forms in dialogs, dates, a home, printed documents.
@@ -455,8 +510,8 @@ The pieces, by job:
455
510
  - **File and image inputs:** `FileInput` (`accept`; `chooseLabel`, `changeLabel`, `removeLabel`;
456
511
  `current` and `onRemove` for a stored file). A picture chosen shows in an `Avatar`
457
512
  (`picture={URL.createObjectURL(file)}`, `initial={false}`). The form sends it to an Action as a
458
- `data:` address, the Action `private: ["picture"]` so its record doesn't keep it twice; big files
459
- are served by a route with `runtime.bytes`.
513
+ `data:` address; `private: ["picture"]` keeps it out of the call's record, and a list shows it
514
+ from a route (The record and bytes).
460
515
 
461
516
  **Common mistakes:**
462
517
 
package/CHANGELOG.md CHANGED
@@ -1,3 +1,60 @@
1
+ ## 1.0.0-rc.57 — 2026-11-20
2
+
3
+ Agents can run on the plan of the person they work for: Claude, ChatGPT through Codex, or Google AI
4
+ through Antigravity, through the plan's CLI on a computer of theirs, signed in once.
5
+
6
+ **New:**
7
+
8
+ - **Agents on people's own plans** (the computers plugin). Three model providers run a model call on
9
+ the plan's CLI on the person's own computer instead of an API key: `claude-plan/<model>` (Claude
10
+ Code), `codex-plan/<model>` (Codex, on a ChatGPT plan) and `gemini-plan/<model>` (Antigravity, on
11
+ a Google AI plan). An agent names one first and an API model next
12
+ (`["claude-plan/claude-opus-5-5", "anthropic/claude-opus-5-5"]`): with nobody there (a routine),
13
+ no plan signed in, the computer off or the plan's limit reached, the list moves on at once. The
14
+ CLI is only the engine: the agent's instructions replace its own, its built-in tools are off, and
15
+ the agent's tools reach it as MCP tools from the computer program, running where every tool runs.
16
+ A tool call ends a step while the CLI waits; the next step answers it and goes on. A session per
17
+ conversation saves time, and the conversation stays the truth: edited or summarized, a fresh
18
+ session is given it all. Uses are metered as `paid: "subscription"`, at no cost to the app. See
19
+ [Agents on people's own plans](docs/guides/agents-on-peoples-plans.md).
20
+ - **Signing a plan in, once** (`computer.engines`, `computer.engine.login`): a person's computers
21
+ and the CLIs each has, signed in or not, and the CLI's own sign-in, run there from the app. It
22
+ stays on the computer, in a home the program keeps for each CLI, apart from the person's own use
23
+ of it. A plan runs only on its person's own computer, never on one shared where others' agents
24
+ work as them. Connected accounts shows them beside the ChatGPT plan, through a new
25
+ `accountSections` resource other plugins can add to.
26
+ - **The computer program speaks the Agent Client Protocol** to the CLIs (the `computer.agents.*`
27
+ workloads): Antigravity natively, Claude Code and Codex through its own adapters. No CLI is
28
+ shipped with it.
29
+ - **A provider's adapter can ask Actions as whom a call is for** (`connection.call`), beside the
30
+ `headers` function that already heard it.
31
+
32
+ ## 1.0.0-rc.56 — 2026-11-18
33
+
34
+ A security fix: `runtime.bytes` no longer serves an outside actor what no rule speaks for. And the
35
+ docs of the record and bytes.
36
+
37
+ **Security:**
38
+
39
+ - **`runtime.bytes` reads for an actor only where a rule speaks for them.** With `{ actor }`, it
40
+ read under the rules, but a collection no rule speaks for has nothing to narrow, so it answered
41
+ any actor, the anonymous one too: a route of the app's that didn't check who asked served such a
42
+ collection's files to anyone. Now an actor (anyone but the system) reads only a collection a rule
43
+ speaks for, and their scope (a key's) lists, as their own reads from outside do; elsewhere, and in
44
+ `sys.*`, it's refused (`forbidden`). Without an actor, or as a grant, it reads as the system, as
45
+ before. Chat's `/files/<id>` is unchanged for people and contacts; a key now needs
46
+ `read: ["file"]` in its scope to fetch a file there. **Upgrading:** a route that passes
47
+ `{ actor }` for a collection with no rule (`shared` or a `guard`) is now refused: check who asks
48
+ in the route, then read as the system.
49
+
50
+ **Docs:**
51
+
52
+ - **Docs: the record and bytes.** AGENTS.md says what the record keeps and how to read it back, what
53
+ stays out of it (`private`, `record: false`, keys), where large values go (blobs, kept once by
54
+ hash, never deleted) and how a route serves one with `runtime.bytes`, once it has checked who
55
+ asks. Stores, the business app's guide (pictures in a list), Build Compass chapter 36 and Events
56
+ say the rest.
57
+
1
58
  ## 1.0.0-rc.55 — 2026-11-18
2
59
 
3
60
  What an app's first minutes ask of Copilotz: a welcome, a team people can shape, models chosen by
package/README.md CHANGED
@@ -152,7 +152,7 @@ ana sees: Tue 10:00, Wed 15:00
152
152
  ```sh
153
153
  npm install copilotz@next # Node 24+ (npm, pnpm, yarn)
154
154
  bun add copilotz@next # Bun
155
- deno add jsr:@copilotz/copilotz@^1.0.0-rc.55 # Deno 2.9+ (or `deno add npm:copilotz@next`)
155
+ deno add jsr:@copilotz/copilotz@^1.0.0-rc.57 # Deno 2.9+ (or `deno add npm:copilotz@next`)
156
156
  ```
157
157
 
158
158
  Until 1.0, the release candidates are on npm's `next` tag, and a plain `npm install copilotz` or
@@ -166,7 +166,7 @@ OPENAI_API_KEY=sk-… node salon.ts # or bun salon.ts, or deno run -A salon.t
166
166
  ```
167
167
 
168
168
  On Deno, map the name `copilotz` in `deno.json`
169
- (`"copilotz": "jsr:@copilotz/copilotz@^1.0.0-rc.55"`) so the imports read the same everywhere.
169
+ (`"copilotz": "jsr:@copilotz/copilotz@^1.0.0-rc.57"`) so the imports read the same everywhere.
170
170
  Copilotz runs on Node 24+, Deno 2.9+ and Bun, and it's built on web standards for Cloudflare Workers
171
171
  and the browser.
172
172
 
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Computers' words in Brazilian Portuguese (a person's plans on their own computers): the keys
3
+ * `hosts/web/WORDS.md` lists, `computers.*`.
4
+ */
5
+ import type { Words } from "../words.js";
6
+ export declare const computers: Words;
@@ -0,0 +1,115 @@
1
+ export const computers = {
2
+ "computers.anotherComputer": "Outro computador",
3
+ "computers.antigravityAbout": "Seus agentes rodam no seu plano do Google AI, pelo Antigravity no seu computador.",
4
+ "computers.antigravityCli": "Antigravity",
5
+ "computers.antigravityPlan": "plano do Google AI",
6
+ "computers.antigravityTitle": "Plano do Google AI, pelo Antigravity",
7
+ "computers.askMeFirst": "Perguntar a mim antes em {spaces}",
8
+ "computers.cancel": "Cancelar",
9
+ "computers.checkAgain": "Verificar de novo",
10
+ "computers.checkFailed": "Não deu para verificar seus computadores: {why}",
11
+ "computers.checkedAt": "verificado por último {time}",
12
+ "computers.checking": "Verificando seus computadores…",
13
+ "computers.claudeAbout": "Seus agentes rodam no seu plano do Claude, pelo Claude Code no seu computador.",
14
+ "computers.claudeCli": "Claude Code",
15
+ "computers.claudePlan": "plano do Claude",
16
+ "computers.claudeTitle": "Plano do Claude",
17
+ "computers.close": "Fechar",
18
+ "computers.codeHint": "Se a página mostrar um código depois que você entrar, cole aqui.",
19
+ "computers.codeLabel": "O código da página de login",
20
+ "computers.codePlaceholder": "Cole o código",
21
+ "computers.codeSent": "Código enviado: finalizando…",
22
+ "computers.codexAbout": "Seus agentes rodam no seu plano do ChatGPT, pelo Codex no seu computador.",
23
+ "computers.codexCli": "Codex",
24
+ "computers.codexPlan": "plano do ChatGPT",
25
+ "computers.codexTitle": "Plano do ChatGPT, pelo Codex",
26
+ "computers.connectComputer": "Conectar um computador",
27
+ "computers.copyCode": "Copiar o código",
28
+ "computers.done": "Pronto",
29
+ "computers.doneAs": "Conectado como {account}",
30
+ "computers.doneNext": "Seus agentes rodam nele a partir de agora, em todas as conversas e espaços daqui.",
31
+ "computers.doneOn": "Em {computer}, pelo {cli}",
32
+ "computers.doneTitle": "Seu {plan} está conectado",
33
+ "computers.failedEnded": "Ele parou sem entrar. Tente de novo, ou leia abaixo o que ele disse.",
34
+ "computers.failedStart": "Não deu para entrar: {why}",
35
+ "computers.failedTitle": "O {cli} não entrou",
36
+ "computers.gotCode": "A página deu um código?",
37
+ "computers.hideInstall": "Ocultar",
38
+ "computers.howToFix": "Como usar",
39
+ "computers.howToInstall": "Como instalar",
40
+ "computers.installAnywhere": "Num terminal nesse computador, rode:",
41
+ "computers.installCommand": "O comando que instala o {cli}",
42
+ "computers.installIn": "Num terminal em {computer}, rode:",
43
+ "computers.installMissing": "O {cli} ainda não está instalado em {computer}. Num terminal lá, rode:",
44
+ "computers.installThen": "Depois verifique de novo aqui. É a instalação oficial do {cli}.",
45
+ "computers.keepAsIs": "Deixar como está",
46
+ "computers.listMore": "{rest} e {last}",
47
+ "computers.listPair": "{first} e {second}",
48
+ "computers.moreOn": "Mais de {computer}",
49
+ "computers.noComputerText": "Os planos rodam pelos apps deles num computador seu, um Mac, um PC com Linux ou Windows, " +
50
+ "enquanto ele estiver ligado. Conecte um, e entre aqui.",
51
+ "computers.noComputerTitle": "Conecte um computador seu primeiro",
52
+ "computers.notOpened": "Não está nessa tela? Abra aqui",
53
+ "computers.offline": "Offline",
54
+ "computers.offlineNote": "{computer} está offline. Ligue-o, ou abra o programa do computador nele, e tente de novo.",
55
+ "computers.openSignIn": "Abrir a página de login",
56
+ "computers.openSpace": "Abrir {space}",
57
+ "computers.optionAsleep": "Dormindo: ele acorda primeiro",
58
+ "computers.optionReady": "Pronto para entrar",
59
+ "computers.output": "O que o {cli} diz",
60
+ "computers.ownSignIn": "É o login dos seus agentes: o seu próprio uso do {cli} nesse computador continua como está.",
61
+ "computers.paletteGroup": "Geral",
62
+ "computers.paletteKeywords": "plano, assinatura, entrar, login, computador, Claude, ChatGPT, Codex, Gemini, Google",
63
+ "computers.palettePlans": "Planos nos seus computadores",
64
+ "computers.paletteSignIn": "Entrar no seu {plan}",
65
+ "computers.paletteSignedIn": "Conectado em {computer}",
66
+ "computers.paletteSignedInMany": {
67
+ one: "Conectado em {count} computador",
68
+ other: "Conectado em {count} computadores",
69
+ },
70
+ "computers.personal": "seu espaço Pessoal",
71
+ "computers.plansAbout": "Seus agentes podem rodar num plano que você já paga, em vez de uma chave de API. Entre uma " +
72
+ "vez, pelo app dele num computador seu, e ele vale em todas as conversas e espaços daqui.",
73
+ "computers.plansPrivate": "Nada é cobrado aqui por essas chamadas. O login fica no seu computador: este app nunca o vê.",
74
+ "computers.plansTitle": "Planos nos seus computadores",
75
+ "computers.rowInstalled": "Instalado, sem login",
76
+ "computers.rowMissing": "O {cli} não está instalado",
77
+ "computers.rowOld": "Não respondeu: o programa do computador talvez precise de atualização",
78
+ "computers.rowSharedSomewhere": "Compartilhado com agentes de outros",
79
+ "computers.rowSignedIn": "Conectado",
80
+ "computers.rowSignedInAs": "Conectado como {account}",
81
+ "computers.rowUnchecked": "Ainda não verificado",
82
+ "computers.runsWhileOn": "Seus agentes o usam enquanto {computer} estiver ligado; até lá, usam os modelos do app.",
83
+ "computers.send": "Enviar",
84
+ "computers.sharedFix": "Para usá-lo no seu plano, faça os agentes deles perguntarem a você antes lá: assim nada roda " +
85
+ "nele sem o seu sim. Ou tire-o de {spaces}, pelo menu dele lá.",
86
+ "computers.sharedNotice": "{computer} está compartilhado com agentes de outros em {spaces}, então seus planos não rodam nele.",
87
+ "computers.sharedNoticeSomewhere": "{computer} está compartilhado com agentes de outros, então seus planos não rodam nele.",
88
+ "computers.sharedTitle": "{computer} está compartilhado com agentes de outros",
89
+ "computers.sharedWhy": "Em {spaces}, os agentes de cada pessoa trabalham em {computer} como você. Com login lá, " +
90
+ "seu plano também seria deles para usar, então ele não pode rodar nele.",
91
+ "computers.sharedWhySomewhere": "Agentes de outros trabalham em {computer} como você, onde ele está compartilhado. Com login " +
92
+ "lá, seu plano também seria deles para usar, então ele não pode rodar nele.",
93
+ "computers.signIn": "Entrar",
94
+ "computers.signInAgain": "Entrar de novo",
95
+ "computers.signInOn": "Pelo {cli}, em {computer}.",
96
+ "computers.signInOther": "Entrar em outro computador",
97
+ "computers.signInThrough": "Pelo {cli}, num computador seu.",
98
+ "computers.signInTitle": "Entrar no seu {plan}",
99
+ "computers.signedIn": "Conectado",
100
+ "computers.start": "Começar o login",
101
+ "computers.stepCode": "Cole o código que ela der",
102
+ "computers.stepEnterCode": "Abra a página de login, entre com a conta que tem o seu plano, e digite este código lá:",
103
+ "computers.stepSignIn": "Entre no seu {plan}",
104
+ "computers.stepSignInHere": "Abra a página de login, e entre com a conta que tem o seu plano.",
105
+ "computers.stepSignInThere": "Uma página de login abre no navegador de {computer}. Entre lá, com a conta que tem o seu plano.",
106
+ "computers.stepSignInWait": "A página de login aparece aqui assim que o {cli} a mostrar.",
107
+ "computers.stepStart": "Abrindo o {cli} em {computer}",
108
+ "computers.stepWake": "Acordando {computer}",
109
+ "computers.tryAgain": "Tentar de novo",
110
+ "computers.version": "versão {version}",
111
+ "computers.waiting": "Esperando o login terminar…",
112
+ "computers.wakeNote": "{computer} acorda primeiro: leva um momento.",
113
+ "computers.whichComputer": "Em qual computador?",
114
+ "computers.whichHint": "As chamadas dos seus agentes rodam lá, então ele precisa estar ligado enquanto eles trabalham.",
115
+ };
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Brazilian Portuguese for the web, out of the box (`copilotz/web/pt-br`): a
3
3
  * plugin of the page's whose `words` say every word Copilotz's web front ends
4
- * show (chat, spaces, the shell, memory, usage, the palette, the toolkit, the
5
- * host: every key of hosts/web/WORDS.md), and whose `signInPage` says the
4
+ * show (chat, spaces, the shell, memory, usage, computers' plans, the palette,
5
+ * the toolkit, the host: every key of hosts/web/WORDS.md), and whose `signInPage` says the
6
6
  * sign-in page's, with Copilotz's pitch beside the form in Portuguese.
7
7
  *
8
8
  * ```ts
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Brazilian Portuguese for the web, out of the box (`copilotz/web/pt-br`): a
3
3
  * plugin of the page's whose `words` say every word Copilotz's web front ends
4
- * show (chat, spaces, the shell, memory, usage, the palette, the toolkit, the
5
- * host: every key of hosts/web/WORDS.md), and whose `signInPage` says the
4
+ * show (chat, spaces, the shell, memory, usage, computers' plans, the palette,
5
+ * the toolkit, the host: every key of hosts/web/WORDS.md), and whose `signInPage` says the
6
6
  * sign-in page's, with Copilotz's pitch beside the form in Portuguese.
7
7
  *
8
8
  * ```ts
@@ -21,6 +21,7 @@
21
21
  import { definePlugin } from "../../../runtime/mod.js";
22
22
  import { about } from "./about.js";
23
23
  import { chat } from "./chat.js";
24
+ import { computers } from "./computers.js";
24
25
  import { host } from "./host.js";
25
26
  import { memory } from "./memory.js";
26
27
  import { palette } from "./palette.js";
@@ -32,7 +33,17 @@ import { usage } from "./usage.js";
32
33
  export const ptBR = definePlugin({
33
34
  name: "words-pt-br",
34
35
  resources: {
35
- words: { ...chat, ...host, ...memory, ...palette, ...shell, ...spaces, ...toolkit, ...usage },
36
+ words: {
37
+ ...chat,
38
+ ...computers,
39
+ ...host,
40
+ ...memory,
41
+ ...palette,
42
+ ...shell,
43
+ ...spaces,
44
+ ...toolkit,
45
+ ...usage,
46
+ },
36
47
  signInPage: { words: signIn, about },
37
48
  },
38
49
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "copilotz",
3
- "version": "1.0.0-rc.55",
3
+ "version": "1.0.0-rc.57",
4
4
  "description": "The open-source runtime that makes your app usable by people, your own agents and their assistants.",
5
5
  "keywords": [
6
6
  "agents",
@@ -11,7 +11,10 @@
11
11
  * (a person's), and `account.token` (trusted code only: a model provider,
12
12
  * a tool calling the provider's API for its person);
13
13
  * - its event `account.changed`, as an account is connected, lost or
14
- * disconnected.
14
+ * disconnected;
15
+ * - on the web, the `accountSections` resource: a section of another front
16
+ * end's on the Connected accounts page, below the providers
17
+ * (`AccountSection`).
15
18
  *
16
19
  * A provider is a resource: the OAuth endpoints, the client, its scopes, how
17
20
  * to tell who the account is, and the headers its token goes in:
@@ -121,6 +124,21 @@ export type ProviderShown = {
121
124
  paste?: string;
122
125
  models?: string[];
123
126
  };
127
+ /**
128
+ * An `accountSections` resource: a section another front end adds to the
129
+ * Connected accounts page, below the providers (a person's plans on their
130
+ * own computers). Its View gets item `{}` and hints `{ query, mode }`: the
131
+ * page's address query, for its own parameters (`?signin=claude`), and
132
+ * `full` or `panel`. Lowest `order` first; `null` takes one out.
133
+ *
134
+ * ```ts
135
+ * resources: { accountSections: { plans: { view: "computer.plans", order: 10 } } }
136
+ * ```
137
+ */
138
+ export type AccountSection = {
139
+ view: string;
140
+ order?: number;
141
+ };
124
142
  /** What `account.connect` answers: where to sign in, and (to paste back) where the person lands. */
125
143
  export type Connecting = {
126
144
  url: string;
@@ -40,7 +40,10 @@
40
40
  * disconnected: the audit trail, with nothing secret in it.
41
41
  *
42
42
  * Its web front end is `accountsWeb` (web.tsx): the Connected accounts page,
43
- * and in a chat, a quiet word when its agents run on your plan.
43
+ * and in a chat, a quiet word when its agents run on your plan. Other front
44
+ * ends add sections to that page, below the providers, with an
45
+ * `accountSections` resource (`{ <key>: { view, order } }`, see contract.ts):
46
+ * computers' plans, signed in on the person's own computers, are one.
44
47
  *
45
48
  * ```ts
46
49
  * plugins: [...access, accounts, definePlugin({ name: "app", resources: {
@@ -40,7 +40,10 @@
40
40
  * disconnected: the audit trail, with nothing secret in it.
41
41
  *
42
42
  * Its web front end is `accountsWeb` (web.tsx): the Connected accounts page,
43
- * and in a chat, a quiet word when its agents run on your plan.
43
+ * and in a chat, a quiet word when its agents run on your plan. Other front
44
+ * ends add sections to that page, below the providers, with an
45
+ * `accountSections` resource (`{ <key>: { view, order } }`, see contract.ts):
46
+ * computers' plans, signed in on the person's own computers, are one.
44
47
  *
45
48
  * ```ts
46
49
  * plugins: [...access, accounts, definePlugin({ name: "app", resources: {
@@ -5,8 +5,15 @@
5
5
  * tokens), live: renewed, lost or disconnected, it shows at once.
6
6
  * Connecting opens its dialog; the address opens one too
7
7
  * (`?connect=chatgpt`: the command palette's), and says how a connection
8
- * that came back to the app went (`?connected=`, `?failed=…&why=`).
8
+ * that came back to the app went (`?connected=`, `?failed=…&why=`). Below
9
+ * the providers, the sections other front ends add (`accountSections`, each
10
+ * shown with the address's query), then the person's own API keys.
9
11
  */
10
12
  import { type ReactNode } from "react";
11
13
  import type { ViewContext } from "../../../../../runtime/mod.js";
14
+ import type { AccountSection } from "../../contract.js";
12
15
  export declare const accountsView: (_: unknown, ctx: ViewContext<ReactNode>) => ReactNode;
16
+ /** The sections an `accountSections` resource adds, lowest `order` first (by key when they tie). */
17
+ export declare const sectionsOf: (given: unknown) => (AccountSection & {
18
+ key: string;
19
+ })[];
@@ -6,9 +6,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
6
  * tokens), live: renewed, lost or disconnected, it shows at once.
7
7
  * Connecting opens its dialog; the address opens one too
8
8
  * (`?connect=chatgpt`: the command palette's), and says how a connection
9
- * that came back to the app went (`?connected=`, `?failed=…&why=`).
9
+ * that came back to the app went (`?connected=`, `?failed=…&why=`). Below
10
+ * the providers, the sections other front ends add (`accountSections`, each
11
+ * shown with the address's query), then the person's own API keys.
10
12
  */
11
- import { useEffect, useState } from "react";
13
+ import { Fragment, useEffect, useState } from "react";
12
14
  import { Button, EmptyState, go, Icon, Notice, Page, Skeleton, Title, } from "../../../../../hosts/web/mod.js";
13
15
  import { ProviderCard } from "./card.js";
14
16
  import { ConnectDialog } from "./connect.js";
@@ -27,11 +29,17 @@ export const accountsView = (_, ctx) => {
27
29
  if (!providers || !accounts) {
28
30
  return (_jsxs(Page, { title: TITLE, description: ABOUT, icon: "lock", density: density, children: [_jsx(Title, { text: TITLE }), style, _jsx("div", { className: "account-skeleton", "aria-busy": "true", children: _jsx(Skeleton, { height: 112, radius: "xl" }) })] }));
29
31
  }
32
+ // Other front ends' sections, below the providers (`accountSections`), as the address asks.
33
+ const sections = sectionsOf(ctx.resources.accountSections).map((section) => (_jsx(Fragment, { children: ctx.show(section.view, {}, { query, mode: density }) }, section.key)));
30
34
  // The person's own API keys, below their accounts (`accounts.keys`).
31
35
  const keys = ctx.show("accounts.keys", {});
32
- return (_jsxs(Page, { title: TITLE, description: ABOUT, icon: "lock", density: density, children: [_jsx(Title, { text: TITLE }), style, _jsx(AccountsBody, { providers: providers, accounts: accounts, query: query, call: ctx.call }), keys] }));
36
+ return (_jsxs(Page, { title: TITLE, description: ABOUT, icon: "lock", density: density, children: [_jsx(Title, { text: TITLE }), style, _jsx(AccountsBody, { providers: providers, accounts: accounts, query: query, call: ctx.call, sections: sections }), keys] }));
33
37
  };
34
- function AccountsBody({ providers, accounts, query, call }) {
38
+ /** The sections an `accountSections` resource adds, lowest `order` first (by key when they tie). */
39
+ export const sectionsOf = (given) => Object.entries((given ?? {}))
40
+ .flatMap(([key, section]) => section?.view ? [{ ...section, key }] : [])
41
+ .sort((a, b) => (a.order ?? 0) - (b.order ?? 0) || a.key.localeCompare(b.key));
42
+ function AccountsBody({ providers, accounts, query, call, sections }) {
35
43
  const asked = providers.some((p) => p.name === query.connect) ? query.connect : undefined;
36
44
  const [connecting, setConnecting] = useState(asked);
37
45
  // Asked for by the address (the palette's "Connect…"), on this page already or not.
@@ -53,7 +61,9 @@ function AccountsBody({ providers, accounts, query, call }) {
53
61
  const leavingFrom = providers.find((p) => p.name === leaving);
54
62
  const leavingAccount = accountOf(leaving);
55
63
  if (!providers.length) {
56
- return (_jsx(EmptyState, { icon: "lock", title: "Nothing to connect yet", children: "This app doesn't offer accounts to connect." }));
64
+ return sections.length
65
+ ? _jsx("div", { className: "accounts", children: sections })
66
+ : (_jsx(EmptyState, { icon: "lock", title: "Nothing to connect yet", children: "This app doesn't offer accounts to connect." }));
57
67
  }
58
68
  return (_jsxs("div", { className: "accounts", children: [came && query.connected && accountOf(query.connected)?.status === "connected"
59
69
  ? (_jsxs(Notice, { tone: "success", role: "status", action: _jsx(Button, { size: "sm", variant: "ghost", onClick: clear, children: "Dismiss" }), children: [titleOf(query.connected), " is connected: agents working for you use it from now on."] }))
@@ -61,7 +71,7 @@ function AccountsBody({ providers, accounts, query, call }) {
61
71
  ? (_jsx(Notice, { tone: "warning", role: "alert", action: providers.some((p) => p.name === query.failed)
62
72
  ? (_jsx(Button, { size: "sm", onClick: () => setConnecting(query.failed), children: "Try again" }))
63
73
  : null, children: failedWhy(query.why, titleOf(query.failed)) }))
64
- : null, _jsx("ul", { className: "accounts-list", children: providers.map((provider) => (_jsx(ProviderCard, { provider: provider, account: accountOf(provider.name), onConnect: () => setConnecting(provider.name), onDisconnect: () => setLeaving(provider.name) }, provider.name))) }), _jsxs("p", { className: "accounts-foot", children: [_jsx(Icon, { name: "lock", size: 14 }), _jsx("span", { children: "Sign-ins stay on the server, never shown in the app or to agents' models. Disconnecting ends them at the provider too." })] }), connectingTo
74
+ : null, _jsx("ul", { className: "accounts-list", children: providers.map((provider) => (_jsx(ProviderCard, { provider: provider, account: accountOf(provider.name), onConnect: () => setConnecting(provider.name), onDisconnect: () => setLeaving(provider.name) }, provider.name))) }), _jsxs("p", { className: "accounts-foot", children: [_jsx(Icon, { name: "lock", size: 14 }), _jsx("span", { children: "Sign-ins stay on the server, never shown in the app or to agents' models. Disconnecting ends them at the provider too." })] }), sections, connectingTo
65
75
  ? (_jsx(ConnectDialog, { provider: connectingTo, open: !!connecting, again: !!accountOf(connectingTo.name), onClose: closeConnect, call: call }, connectingTo.name))
66
76
  : null, leavingFrom && leavingAccount
67
77
  ? (_jsx(DisconnectDialog, { provider: leavingFrom, account: leavingAccount, open: !!leaving, onClose: () => setLeaving(undefined), call: call }))
@@ -8,6 +8,12 @@
8
8
  * you type, a quiet word when its agents run on your plan (chat's
9
9
  * `conversation` resource) or would, if you reconnected it.
10
10
  *
11
+ * Other front ends add a section to the page, below the providers, with an
12
+ * `accountSections` resource: `{ <key>: { view, order } }`, its View given
13
+ * item `{}` and hints `{ query, mode }` (contract.ts's `AccountSection`).
14
+ * Computers' front end adds a person's plans, signed in on their own
15
+ * computers (`plans: { view: "computer.plans" }`).
16
+ *
11
17
  * For the shell's account menu, it names its page in `userMenu` (the menu
12
18
  * by the person's name, when the shell has one). Add it beside the web shell
13
19
  * and chat's front end:
@@ -8,6 +8,12 @@
8
8
  * you type, a quiet word when its agents run on your plan (chat's
9
9
  * `conversation` resource) or would, if you reconnected it.
10
10
  *
11
+ * Other front ends add a section to the page, below the providers, with an
12
+ * `accountSections` resource: `{ <key>: { view, order } }`, its View given
13
+ * item `{}` and hints `{ query, mode }` (contract.ts's `AccountSection`).
14
+ * Computers' front end adds a person's plans, signed in on their own
15
+ * computers (`plans: { view: "computer.plans" }`).
16
+ *
11
17
  * For the shell's account menu, it names its page in `userMenu` (the menu
12
18
  * by the person's name, when the shell has one). Add it beside the web shell
13
19
  * and chat's front end:
@@ -0,0 +1,8 @@
1
+ import { type PromptEvent } from "../shared/workloads.js";
2
+ /** One step's events, and which computer they come from. */
3
+ export type EngineEvent = PromptEvent | {
4
+ type: "computer";
5
+ computer: string;
6
+ };
7
+ export declare const engineAction: import("../../../../runtime/define.js").ActionDef;
8
+ export declare const engineCancelAction: import("../../../../runtime/define.js").ActionDef;