copilotz 1.0.0-rc.56 → 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.
- package/AGENTS.md +4 -4
- package/CHANGELOG.md +31 -0
- package/README.md +2 -2
- package/hosts/web/pt-br/computers.d.ts +6 -0
- package/hosts/web/pt-br/computers.js +115 -0
- package/hosts/web/pt-br/mod.d.ts +2 -2
- package/hosts/web/pt-br/mod.js +14 -3
- package/package.json +1 -1
- package/plugins/access/accounts/contract.d.ts +19 -1
- package/plugins/access/accounts/mod.d.ts +4 -1
- package/plugins/access/accounts/mod.js +4 -1
- package/plugins/access/accounts/views/web/accounts.d.ts +8 -1
- package/plugins/access/accounts/views/web/accounts.js +16 -6
- package/plugins/access/accounts/web.d.ts +6 -0
- package/plugins/access/accounts/web.js +6 -0
- package/plugins/compute/computers/actions/engine.d.ts +8 -0
- package/plugins/compute/computers/actions/engine.js +142 -0
- package/plugins/compute/computers/actions/engines.d.ts +15 -0
- package/plugins/compute/computers/actions/engines.js +111 -0
- package/plugins/compute/computers/adapters/engine.d.ts +34 -0
- package/plugins/compute/computers/adapters/engine.js +224 -0
- package/plugins/compute/computers/collections/computer.d.ts +19 -0
- package/plugins/compute/computers/collections/computer.js +6 -0
- package/plugins/compute/computers/mod.d.ts +8 -0
- package/plugins/compute/computers/mod.js +22 -0
- package/plugins/compute/computers/program/agents/acp.d.ts +44 -0
- package/plugins/compute/computers/program/agents/acp.js +452 -0
- package/plugins/compute/computers/program/agents/claude.d.ts +4 -0
- package/plugins/compute/computers/program/agents/claude.js +432 -0
- package/plugins/compute/computers/program/agents/codex.d.ts +78 -0
- package/plugins/compute/computers/program/agents/codex.js +580 -0
- package/plugins/compute/computers/program/agents/engines.d.ts +32 -0
- package/plugins/compute/computers/program/agents/engines.js +381 -0
- package/plugins/compute/computers/program/agents/mcp.d.ts +28 -0
- package/plugins/compute/computers/program/agents/mcp.js +252 -0
- package/plugins/compute/computers/program/agents/permission.d.ts +11 -0
- package/plugins/compute/computers/program/agents/permission.js +46 -0
- package/plugins/compute/computers/program/agents/rpc.d.ts +37 -0
- package/plugins/compute/computers/program/agents/rpc.js +192 -0
- package/plugins/compute/computers/program/agents/steps.d.ts +61 -0
- package/plugins/compute/computers/program/agents/steps.js +146 -0
- package/plugins/compute/computers/program/agents/types.d.ts +136 -0
- package/plugins/compute/computers/program/agents/types.js +13 -0
- package/plugins/compute/computers/program/agents/write.d.ts +2 -0
- package/plugins/compute/computers/program/agents/write.js +13 -0
- package/plugins/compute/computers/program/computer.d.ts +4 -1
- package/plugins/compute/computers/program/computer.js +15 -2
- package/plugins/compute/computers/program/version.d.ts +1 -1
- package/plugins/compute/computers/program/version.js +1 -1
- package/plugins/compute/computers/program/workloads/agents.d.ts +29 -0
- package/plugins/compute/computers/program/workloads/agents.js +38 -0
- package/plugins/compute/computers/program/workloads/search.d.ts +1 -1
- package/plugins/compute/computers/resources/downloads.js +1 -1
- package/plugins/compute/computers/resources/engines.d.ts +30 -0
- package/plugins/compute/computers/resources/engines.js +22 -0
- package/plugins/compute/computers/shared/engines.d.ts +51 -0
- package/plugins/compute/computers/shared/engines.js +47 -0
- package/plugins/compute/computers/shared/workloads.d.ts +128 -0
- package/plugins/compute/computers/shared/workloads.js +8 -0
- package/plugins/compute/computers/views/web/plan-card.d.ts +30 -0
- package/plugins/compute/computers/views/web/plan-card.js +85 -0
- package/plugins/compute/computers/views/web/plan-shared.d.ts +18 -0
- package/plugins/compute/computers/views/web/plan-shared.js +45 -0
- package/plugins/compute/computers/views/web/plan-sign-in.d.ts +26 -0
- package/plugins/compute/computers/views/web/plan-sign-in.js +207 -0
- package/plugins/compute/computers/views/web/plan-states.d.ts +138 -0
- package/plugins/compute/computers/views/web/plan-states.js +225 -0
- package/plugins/compute/computers/views/web/plans-palette.d.ts +11 -0
- package/plugins/compute/computers/views/web/plans-palette.js +40 -0
- package/plugins/compute/computers/views/web/plans.d.ts +22 -0
- package/plugins/compute/computers/views/web/plans.js +156 -0
- package/plugins/compute/computers/views/web/style.d.ts +4 -3
- package/plugins/compute/computers/views/web/style.js +163 -2
- package/plugins/compute/computers/views/web/words.d.ts +1 -0
- package/plugins/compute/computers/views/web/words.js +131 -0
- package/plugins/compute/computers/web.d.ts +9 -4
- package/plugins/compute/computers/web.js +19 -5
- package/plugins/models/shared/generate.js +1 -0
- package/plugins/models/shared/provider.d.ts +8 -1
- package/plugins/models/shared/provider.js +9 -2
- package/plugins/models/shared/types.d.ts +2 -0
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
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
|
+
|
|
1
32
|
## 1.0.0-rc.56 — 2026-11-18
|
|
2
33
|
|
|
3
34
|
A security fix: `runtime.bytes` no longer serves an outside actor what no rule speaks for. And the
|
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.
|
|
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.
|
|
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,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
|
+
};
|
package/hosts/web/pt-br/mod.d.ts
CHANGED
|
@@ -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,
|
|
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
|
package/hosts/web/pt-br/mod.js
CHANGED
|
@@ -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,
|
|
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: {
|
|
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
|
@@ -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
|
-
|
|
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
|
|
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;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A model call on a plan's CLI (see shared/engines.ts), for the `engine`
|
|
3
|
+
* model adapter (adapters/engine.ts): one step of an agent's turn, run on a
|
|
4
|
+
* computer of the person it works for, its events as they come
|
|
5
|
+
* (`computer.agents.prompt`, see shared/workloads.ts). Called inline, from
|
|
6
|
+
* the turn's job: the stream is handed back as it is.
|
|
7
|
+
*
|
|
8
|
+
* Only while someone's there: a turn a routine set going (no one present)
|
|
9
|
+
* fails, and its model list moves on (to an API key). The first event says
|
|
10
|
+
* which computer it ran on, for the adapter to come back to it.
|
|
11
|
+
*/
|
|
12
|
+
import { defineAction, failure, people, personOf } from "../../../../runtime/mod.js";
|
|
13
|
+
import { originOf } from "../../../agents/chat/contract.js";
|
|
14
|
+
import { engineComputer, engineFailure, ENGINES, signedOut, } from "../shared/engines.js";
|
|
15
|
+
import { failed } from "../shared/failed.js";
|
|
16
|
+
import { touch, wake } from "../shared/wake.js";
|
|
17
|
+
import { WORK } from "../shared/workloads.js";
|
|
18
|
+
const decoder = new TextDecoder();
|
|
19
|
+
/** JSON lines from a job's output, one value each. */
|
|
20
|
+
async function* lines(output) {
|
|
21
|
+
let buffer = "";
|
|
22
|
+
for await (const chunk of output) {
|
|
23
|
+
buffer += decoder.decode(chunk, { stream: true });
|
|
24
|
+
for (let at = buffer.indexOf("\n"); at >= 0; at = buffer.indexOf("\n")) {
|
|
25
|
+
const line = buffer.slice(0, at).trim();
|
|
26
|
+
buffer = buffer.slice(at + 1);
|
|
27
|
+
if (line)
|
|
28
|
+
yield JSON.parse(line);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (buffer.trim())
|
|
32
|
+
yield JSON.parse(buffer);
|
|
33
|
+
}
|
|
34
|
+
export const engineAction = defineAction({
|
|
35
|
+
description: "Runs one step of an agent's model call on its person's plan, on their computer",
|
|
36
|
+
// What goes through is the conversation and the agent's instructions: never recorded.
|
|
37
|
+
record: false,
|
|
38
|
+
input: {
|
|
39
|
+
type: "object",
|
|
40
|
+
properties: {
|
|
41
|
+
engine: { enum: [...ENGINES] },
|
|
42
|
+
model: { type: "string" },
|
|
43
|
+
/** The computer an earlier step ran on, to come back to (its session lives there). */
|
|
44
|
+
computer: { type: "string" },
|
|
45
|
+
session: { type: "string" },
|
|
46
|
+
instructions: { type: "string" },
|
|
47
|
+
tools: { type: "array" },
|
|
48
|
+
prompt: { type: "array" },
|
|
49
|
+
id: { type: "string" },
|
|
50
|
+
from: { type: "integer", minimum: 0 },
|
|
51
|
+
results: { type: "array" },
|
|
52
|
+
},
|
|
53
|
+
required: ["engine", "model", "instructions", "tools", "prompt", "id"],
|
|
54
|
+
additionalProperties: false,
|
|
55
|
+
},
|
|
56
|
+
allow: people,
|
|
57
|
+
run: async function* (ctx, input) {
|
|
58
|
+
const person = personOf(ctx.actor);
|
|
59
|
+
if (!person)
|
|
60
|
+
throw failure("forbidden", "A plan runs only for a person.", { public: true });
|
|
61
|
+
if (originOf(ctx.actor)) {
|
|
62
|
+
throw engineFailure("engine_unattended", "A plan's CLI runs only while its person is there: this runs on its own.");
|
|
63
|
+
}
|
|
64
|
+
const computer = await engineComputer(ctx, person, input.engine, input.computer);
|
|
65
|
+
// A session lives on the computer that started it: another computer starts afresh.
|
|
66
|
+
const same = computer._id === input.computer;
|
|
67
|
+
if (!computer.online) {
|
|
68
|
+
const woke = await wake(ctx, computer._id);
|
|
69
|
+
if (woke !== true) {
|
|
70
|
+
throw engineFailure("engine_offline", typeof woke === "string"
|
|
71
|
+
? woke
|
|
72
|
+
: `${computer.name ?? "Your computer"} is offline: your plan runs there.`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const touched = touch(ctx, computer._id);
|
|
76
|
+
yield { type: "computer", computer: computer._id };
|
|
77
|
+
// Its session, or the answer it was in, is on another computer: a fresh one, given it all.
|
|
78
|
+
if (!same && (input.session || input.from !== undefined || input.results)) {
|
|
79
|
+
await touched;
|
|
80
|
+
yield {
|
|
81
|
+
i: 0,
|
|
82
|
+
type: "failed",
|
|
83
|
+
code: "stale",
|
|
84
|
+
message: "The session is on another computer: start afresh here",
|
|
85
|
+
};
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const job = await ctx.workers.dispatch("computer", computer._id, WORK.agentsPrompt, {
|
|
89
|
+
engine: input.engine,
|
|
90
|
+
model: input.model,
|
|
91
|
+
...(same && input.session ? { session: input.session } : {}),
|
|
92
|
+
instructions: input.instructions,
|
|
93
|
+
tools: input.tools,
|
|
94
|
+
prompt: input.prompt,
|
|
95
|
+
id: input.id,
|
|
96
|
+
...(same && input.from !== undefined ? { from: input.from } : {}),
|
|
97
|
+
...(same && input.results ? { results: input.results } : {}),
|
|
98
|
+
}, { signal: ctx.signal }).catch((error) => {
|
|
99
|
+
throw error.code === "offline"
|
|
100
|
+
? engineFailure("engine_offline", `${computer.name ?? "Your computer"} went offline.`)
|
|
101
|
+
: error;
|
|
102
|
+
});
|
|
103
|
+
try {
|
|
104
|
+
for await (const event of lines(job.output)) {
|
|
105
|
+
// Signed out there: calls stop going to it until it's signed in again.
|
|
106
|
+
if (event.type === "failed" && event.code === "signed_out") {
|
|
107
|
+
await signedOut(ctx, computer._id, input.engine);
|
|
108
|
+
}
|
|
109
|
+
yield event;
|
|
110
|
+
}
|
|
111
|
+
await job.done;
|
|
112
|
+
}
|
|
113
|
+
finally {
|
|
114
|
+
await touched;
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
export const engineCancelAction = defineAction({
|
|
119
|
+
description: "Stops what an agent's model call is doing on its person's plan",
|
|
120
|
+
input: {
|
|
121
|
+
type: "object",
|
|
122
|
+
properties: { computer: { type: "string" }, session: { type: "string" } },
|
|
123
|
+
required: ["computer", "session"],
|
|
124
|
+
additionalProperties: false,
|
|
125
|
+
},
|
|
126
|
+
allow: people,
|
|
127
|
+
run: async (ctx, input) => {
|
|
128
|
+
const person = personOf(ctx.actor);
|
|
129
|
+
const computer = person
|
|
130
|
+
? await ctx.as().db.collection("computer").findOne({ _id: input.computer, owner: person })
|
|
131
|
+
: null;
|
|
132
|
+
if (!computer?.online)
|
|
133
|
+
return { ok: false };
|
|
134
|
+
const answer = await ctx.workers.call("computer", input.computer, WORK.agentsCancel, {
|
|
135
|
+
session: input.session,
|
|
136
|
+
});
|
|
137
|
+
const error = failed(answer);
|
|
138
|
+
if (error)
|
|
139
|
+
throw error;
|
|
140
|
+
return { ok: true };
|
|
141
|
+
},
|
|
142
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Computer } from "../collections/computer.js";
|
|
2
|
+
import { type EngineName, type EngineSeen } from "../shared/engines.js";
|
|
3
|
+
/** One computer of theirs, and its engines. */
|
|
4
|
+
export type ComputerEngines = {
|
|
5
|
+
computer: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
online: boolean;
|
|
8
|
+
/** A computer the app keeps (a cloud computer): `kind`, and how it is. */
|
|
9
|
+
status?: Computer["status"];
|
|
10
|
+
/** Others' agents work on it as its owner: their plans can't run here. */
|
|
11
|
+
shared: boolean;
|
|
12
|
+
engines: Partial<Record<EngineName, EngineSeen>>;
|
|
13
|
+
};
|
|
14
|
+
export declare const enginesAction: import("../../../../runtime/define.js").ActionDef;
|
|
15
|
+
export declare const engineLoginAction: import("../../../../runtime/define.js").ActionDef;
|