copilotz 1.0.0-rc.57 → 1.0.0-rc.58

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 (62) hide show
  1. package/AGENTS.md +4 -4
  2. package/CHANGELOG.md +57 -0
  3. package/README.md +2 -2
  4. package/hosts/web/pt-br/computers.d.ts +3 -2
  5. package/hosts/web/pt-br/computers.js +98 -0
  6. package/package.json +1 -1
  7. package/plugins/access/spaces/views/web/words.d.ts +1 -1
  8. package/plugins/agents/chat/actions/send.d.ts +1 -1
  9. package/plugins/agents/chat/actions/send.js +1 -1
  10. package/plugins/agents/chat/collections/message.d.ts +1 -1
  11. package/plugins/agents/chat/contract.d.ts +1 -1
  12. package/plugins/agents/chat/contract.js +1 -1
  13. package/plugins/agents/chat/views/message.js +9 -8
  14. package/plugins/billing/usage/views/web/words.d.ts +1 -1
  15. package/plugins/compute/computers/actions/upload.d.ts +1 -0
  16. package/plugins/compute/computers/actions/upload.js +35 -0
  17. package/plugins/compute/computers/actions/work.js +9 -23
  18. package/plugins/compute/computers/adapters/engine.js +4 -0
  19. package/plugins/compute/computers/collections/preview.d.ts +1 -1
  20. package/plugins/compute/computers/mod.d.ts +6 -0
  21. package/plugins/compute/computers/mod.js +10 -1
  22. package/plugins/compute/computers/program/agents/acp.js +30 -9
  23. package/plugins/compute/computers/program/agents/claude.js +9 -2
  24. package/plugins/compute/computers/program/agents/steps.d.ts +9 -2
  25. package/plugins/compute/computers/program/agents/steps.js +8 -8
  26. package/plugins/compute/computers/program/computer.js +5 -1
  27. package/plugins/compute/computers/program/version.d.ts +1 -1
  28. package/plugins/compute/computers/program/version.js +1 -1
  29. package/plugins/compute/computers/program/workloads/files.d.ts +16 -1
  30. package/plugins/compute/computers/program/workloads/files.js +159 -3
  31. package/plugins/compute/computers/program/workloads/search.d.ts +1 -1
  32. package/plugins/compute/computers/resources/downloads.js +1 -1
  33. package/plugins/compute/computers/resources/previews.js +2 -28
  34. package/plugins/compute/computers/resources/tools.d.ts +5 -0
  35. package/plugins/compute/computers/resources/tools.js +155 -1
  36. package/plugins/compute/computers/routes/upload.d.ts +30 -0
  37. package/plugins/compute/computers/routes/upload.js +169 -0
  38. package/plugins/compute/computers/shared/desks.d.ts +13 -1
  39. package/plugins/compute/computers/shared/desks.js +34 -0
  40. package/plugins/compute/computers/shared/streams.d.ts +13 -0
  41. package/plugins/compute/computers/shared/streams.js +36 -0
  42. package/plugins/compute/computers/shared/workloads.d.ts +44 -0
  43. package/plugins/compute/computers/shared/workloads.js +4 -0
  44. package/plugins/compute/computers/views/web/file-view.d.ts +5 -1
  45. package/plugins/compute/computers/views/web/file-view.js +4 -2
  46. package/plugins/compute/computers/views/web/files.d.ts +18 -1
  47. package/plugins/compute/computers/views/web/files.js +117 -16
  48. package/plugins/compute/computers/views/web/step.d.ts +6 -4
  49. package/plugins/compute/computers/views/web/step.js +43 -1
  50. package/plugins/compute/computers/views/web/style.d.ts +5 -5
  51. package/plugins/compute/computers/views/web/style.js +79 -8
  52. package/plugins/compute/computers/views/web/upload-tray.d.ts +70 -0
  53. package/plugins/compute/computers/views/web/upload-tray.js +249 -0
  54. package/plugins/compute/computers/views/web/uploads.d.ts +184 -0
  55. package/plugins/compute/computers/views/web/uploads.js +425 -0
  56. package/plugins/compute/computers/views/web/words.d.ts +1 -1
  57. package/plugins/compute/computers/views/web/words.js +98 -3
  58. package/plugins/compute/computers/views/web/workspace.js +3 -1
  59. package/plugins/compute/computers/web.js +2 -0
  60. package/plugins/models/shared/catalog.json +9279 -7578
  61. package/plugins/models/shared/generate.d.ts +4 -1
  62. package/plugins/models/shared/generate.js +44 -2
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.57`. Every docs page is Markdown at
7
+ goes with `copilotz@1.0.0-rc.58`. 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.57 react@19 react-dom@19
67
+ npm install copilotz@1.0.0-rc.58 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.57"` in
72
+ `deno add jsr:@copilotz/copilotz` and map `"copilotz": "jsr:@copilotz/copilotz@^1.0.0-rc.58"` 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.57). Read node_modules/copilotz/AGENTS.md first;
113
+ This app runs on Copilotz (copilotz@1.0.0-rc.58). 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,60 @@
1
+ ## 1.0.0-rc.58 — 2026-11-21
2
+
3
+ Files go between a chat and a computer both ways, and people put files on a computer from its page.
4
+ When a model hands over to the next in its list (a person's plan to an API key), the log and the
5
+ usage say why. A tool call held for a person's plan waits past Claude Code's 5-minute idle limit,
6
+ and the models catalog is refreshed.
7
+
8
+ **New:**
9
+
10
+ - **An agent saves a file sent in its chat on a computer** (`save_file`, the computers plugin): a
11
+ zip to unpack, a spreadsheet to work on, an image to edit, into the space's folder, where commands
12
+ and the other tools reach it. It's a write like `write_file`'s, asked first where writes are. Each
13
+ file a message carries now says its id to the agent
14
+ (`[file data.zip: application/zip, 3214000
15
+ bytes, id …]`, and `[image …, id …]`,
16
+ `[file notes.txt, id …]`), which the tool takes; it reads the file as the agent, so the rules
17
+ decide which it reaches.
18
+ - **An agent sends a file from a computer into its chat** (`send_file`): a report, a chart, a zip it
19
+ made, as its own message with the file (`chat.say`), up to a chat file's size (about 10 MB). Run
20
+ again as itself (a retried turn), it sends nothing more. Chat's contract exports `FILE_DATA`.
21
+ - **Uploads to a computer** (`PUT /computers/upload?desk=&path=[&replace=1]`, the Files view): a
22
+ person puts files in a space's folder on a computer, of up to 2 GiB each, streamed through to it
23
+ as they come and put in place once whole, so a broken upload leaves nothing. Past what one request
24
+ may carry on its way (Cloud Run's 32 MiB, a CDN's 100 MB), a file goes in parts, in order
25
+ (`&upload=&offset=&total=`), kept apart on the computer until the last; parts nobody finished go
26
+ after a day. Only where they may change the computer from its panel (`computer.upload`, on the
27
+ record: who put what where), a computer that sleeps woken first, and one between connections
28
+ waited for. A file there is kept unless replaced. The Files view takes files picked or dropped,
29
+ with each one's progress, and asks before replacing one.
30
+ - **The computer program says what it serves** (`Info.serves`), and takes a file streamed in
31
+ (`computer.files.put`). The app asks a computer what it serves before an upload, so one whose
32
+ program is older answers at once that it needs updating (501, `outdated`).
33
+
34
+ - **Why a model handed over, on the record.** A model of a list that doesn't answer and hands over
35
+ to the next (a person's plan falling back to an API key) is logged by the process
36
+ (`models: <model> didn't answer after 31.2 s, thinking (<code>: <words>); <next> answers instead
37
+ [thread=… agent=… turn=…]`),
38
+ and the model that answers instead says so on its usage (`fallback`, `fallbackWhy` tags). The
39
+ engine adapter logs a session it starts over. The computer program logs a plan's prompt that
40
+ failed, and a step the app stopped reading before it ended, with how long it ran (`computer.log`).
41
+
42
+ **Fixed:**
43
+
44
+ - **A tool call held for a person's plan no longer fails after 5 minutes.** Claude Code aborts a
45
+ tool that sends nothing for 5 minutes, and a call held for its answer is silent until it comes (a
46
+ person's yes, the app's next step). The computer program gives Claude Code's idle limit a day, as
47
+ its whole limit already was (`CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT`, and the server's own `timeout`
48
+ in its MCP config).
49
+
50
+ **Changed:**
51
+
52
+ - **The models catalog**, refreshed from models.dev (2026-11-21): Google's Gemini 4 Carbon, Neon and
53
+ Hydrogen among what's new, with their prices and reasoning.
54
+ - `computer.work`'s rules for a person working on a computer (in its space, its owner's where they
55
+ answer for it, a computer that sleeps woken) are `personalDesk`, which uploads share. A desk that
56
+ isn't there is `not_found` (it was `invalid`).
57
+
1
58
  ## 1.0.0-rc.57 — 2026-11-20
2
59
 
3
60
  Agents can run on the plan of the person they work for: Claude, ChatGPT through Codex, or Google AI
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.57 # Deno 2.9+ (or `deno add npm:copilotz@next`)
155
+ deno add jsr:@copilotz/copilotz@^1.0.0-rc.58 # 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.57"`) so the imports read the same everywhere.
169
+ (`"copilotz": "jsr:@copilotz/copilotz@^1.0.0-rc.58"`) 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
 
@@ -1,6 +1,7 @@
1
1
  /**
2
- * Computers' words in Brazilian Portuguese (a person's plans on their own computers): the keys
3
- * `hosts/web/WORDS.md` lists, `computers.*`.
2
+ * Computers' words in Brazilian Portuguese (a person's plans on their own computers, a
3
+ * computer's Files tab and uploading to it, an agent's calls that move a file between a chat and
4
+ * a computer): the keys `hosts/web/WORDS.md` lists, `computers.*`.
4
5
  */
5
6
  import type { Words } from "../words.js";
6
7
  export declare const computers: Words;
@@ -30,9 +30,31 @@ export const computers = {
30
30
  "computers.doneNext": "Seus agentes rodam nele a partir de agora, em todas as conversas e espaços daqui.",
31
31
  "computers.doneOn": "Em {computer}, pelo {cli}",
32
32
  "computers.doneTitle": "Seu {plan} está conectado",
33
+ "computers.dropTitle": "Solte para enviar",
34
+ "computers.dropTo": "Para {folder} em {computer}",
33
35
  "computers.failedEnded": "Ele parou sem entrar. Tente de novo, ou leia abaixo o que ele disse.",
34
36
  "computers.failedStart": "Não deu para entrar: {why}",
35
37
  "computers.failedTitle": "O {cli} não entrou",
38
+ "computers.filesDownload": "Baixar {name}",
39
+ "computers.filesEmpty": "Nada aqui ainda",
40
+ "computers.filesEmptyDrop": "Solte arquivos aqui para enviá-los. O que você e seus agentes fizerem nesta pasta também aparece aqui.",
41
+ "computers.filesEmptyText": "O que você e seus agentes fizerem nesta pasta aparece aqui.",
42
+ "computers.filesFilter": "Filtrar",
43
+ "computers.filesFilterLabel": "Filtrar esta pasta",
44
+ "computers.filesIn": "Em {folder}",
45
+ "computers.filesItsOwner": "o dono dele",
46
+ "computers.filesJustUploaded": "enviado",
47
+ "computers.filesNoMatch": "Nada aqui corresponde a “{filter}”.",
48
+ "computers.filesOn": "{folder}, em {computer}",
49
+ "computers.filesRefresh": "Atualizar",
50
+ "computers.filesUpTo": "Voltar para {folder}",
51
+ "computers.filesViewOnly": "Só {owner} muda arquivos em {computer} aqui. Você pode abri-los e baixá-los.",
52
+ "computers.filesWhere": "Onde, na pasta",
53
+ "computers.folderDropped": "“{name}” é uma pasta, e pastas não podem ser enviadas. Solte os arquivos dela, ou um zip dela.",
54
+ "computers.foldersDropped": {
55
+ one: "{count} pasta não foi enviada: pastas não podem ser. Solte os arquivos dela, ou um zip dela.",
56
+ other: "{count} pastas não foram enviadas: pastas não podem ser. Solte os arquivos delas, ou um zip de cada uma.",
57
+ },
36
58
  "computers.gotCode": "A página deu um código?",
37
59
  "computers.hideInstall": "Ocultar",
38
60
  "computers.howToFix": "Como usar",
@@ -43,9 +65,14 @@ export const computers = {
43
65
  "computers.installMissing": "O {cli} ainda não está instalado em {computer}. Num terminal lá, rode:",
44
66
  "computers.installThen": "Depois verifique de novo aqui. É a instalação oficial do {cli}.",
45
67
  "computers.keepAsIs": "Deixar como está",
68
+ "computers.keepBoth": "Manter os dois",
46
69
  "computers.listMore": "{rest} e {last}",
47
70
  "computers.listPair": "{first} e {second}",
48
71
  "computers.moreOn": "Mais de {computer}",
72
+ "computers.newFile": "Novo arquivo",
73
+ "computers.newFileMake": "Criar o arquivo",
74
+ "computers.newFileName": "O nome do novo arquivo",
75
+ "computers.newFilePlaceholder": "notas.md, ou src/novo.ts",
49
76
  "computers.noComputerText": "Os planos rodam pelos apps deles num computador seu, um Mac, um PC com Linux ou Windows, " +
50
77
  "enquanto ele estiver ligado. Conecte um, e entre aqui.",
51
78
  "computers.noComputerTitle": "Conecte um computador seu primeiro",
@@ -72,6 +99,18 @@ export const computers = {
72
99
  "vez, pelo app dele num computador seu, e ele vale em todas as conversas e espaços daqui.",
73
100
  "computers.plansPrivate": "Nada é cobrado aqui por essas chamadas. O login fica no seu computador: este app nunca o vê.",
74
101
  "computers.plansTitle": "Planos nos seus computadores",
102
+ "computers.replace": "Substituir",
103
+ "computers.replaceAll": {
104
+ one: "Fazer o mesmo com o outro arquivo que já está lá",
105
+ other: "Fazer o mesmo com os outros {count} arquivos que já estão lá",
106
+ },
107
+ "computers.replaceFolderText": "Um arquivo não substitui uma pasta. Envie o seu ao lado dela com outro nome, ou pule.",
108
+ "computers.replaceFolderTitle": "Já tem uma pasta chamada “{name}”",
109
+ "computers.replaceKeepAs": "Manter os dois envia o seu como “{name}”.",
110
+ "computers.replaceText": "{folder} já tem um arquivo chamado “{name}”. Substituir põe o seu no lugar dele.",
111
+ "computers.replaceThere": "O que está lá: {size}, alterado {time}",
112
+ "computers.replaceTitle": "Substituir “{name}”?",
113
+ "computers.replaceYours": "O seu: {size}, alterado {time}",
75
114
  "computers.rowInstalled": "Instalado, sem login",
76
115
  "computers.rowMissing": "O {cli} não está instalado",
77
116
  "computers.rowOld": "Não respondeu: o programa do computador talvez precise de atualização",
@@ -97,9 +136,16 @@ export const computers = {
97
136
  "computers.signInThrough": "Pelo {cli}, num computador seu.",
98
137
  "computers.signInTitle": "Entrar no seu {plan}",
99
138
  "computers.signedIn": "Conectado",
139
+ "computers.skip": "Pular",
100
140
  "computers.start": "Começar o login",
101
141
  "computers.stepCode": "Cole o código que ela der",
102
142
  "computers.stepEnterCode": "Abra a página de login, entre com a conta que tem o seu plano, e digite este código lá:",
143
+ "computers.stepSaved": "Salvou {file} em {path}",
144
+ "computers.stepSaves": "Salva {file} em {path}",
145
+ "computers.stepSavesFile": "Salva um arquivo desta conversa em {path}",
146
+ "computers.stepSavesFolder": "Salva um arquivo desta conversa na pasta do espaço",
147
+ "computers.stepSends": "Envia {path} para esta conversa",
148
+ "computers.stepSent": "Enviou {file}",
103
149
  "computers.stepSignIn": "Entre no seu {plan}",
104
150
  "computers.stepSignInHere": "Abra a página de login, e entre com a conta que tem o seu plano.",
105
151
  "computers.stepSignInThere": "Uma página de login abre no navegador de {computer}. Entre lá, com a conta que tem o seu plano.",
@@ -107,6 +153,58 @@ export const computers = {
107
153
  "computers.stepStart": "Abrindo o {cli} em {computer}",
108
154
  "computers.stepWake": "Acordando {computer}",
109
155
  "computers.tryAgain": "Tentar de novo",
156
+ "computers.upload": "Enviar",
157
+ "computers.uploadAsking": "Já tem um com este nome",
158
+ "computers.uploadCancel": "Cancelar o envio de {name}",
159
+ "computers.uploadCancelled": "Cancelado",
160
+ "computers.uploadDone": "Enviado",
161
+ "computers.uploadDoneAs": "Enviado como {name}",
162
+ "computers.uploadFailed": "Não foi enviado. Tente de novo.",
163
+ "computers.uploadFinishing": "Salvando em {computer}…",
164
+ "computers.uploadFolderThere": "Já tem uma pasta com esse nome, e um arquivo não a substitui.",
165
+ "computers.uploadForbidden": "Você não pode mudar arquivos neste computador.",
166
+ "computers.uploadFull": "Não tem mais espaço no disco de {computer}.",
167
+ "computers.uploadIn": "em {folder}",
168
+ "computers.uploadInvalid": "Esse nome não pode ser usado aqui.",
169
+ "computers.uploadNetwork": "A conexão caiu. Tente de novo.",
170
+ "computers.uploadNoLength": "O navegador não disse o tamanho dele. Tente de novo.",
171
+ "computers.uploadNoWake": "{computer} não acordou a tempo. Tente de novo.",
172
+ "computers.uploadNotFound": "Este computador não está mais neste espaço.",
173
+ "computers.uploadOffline": "{computer} está offline. Tente de novo quando ele estiver ligado.",
174
+ "computers.uploadOpen": "Abrir {name}",
175
+ "computers.uploadOutdated": "O programa do computador de {computer} é antigo demais para receber envios. Ele se atualiza sozinho, ou o dono dele o atualiza: depois tente de novo.",
176
+ "computers.uploadProgress": "{done} de {total}",
177
+ "computers.uploadProgressLabel": "Enviando {name}",
178
+ "computers.uploadQueued": "Esperando para enviar",
179
+ "computers.uploadReplaced": "Enviado no lugar do que estava lá",
180
+ "computers.uploadRestart": "Este envio foi interrompido e precisa começar de novo.",
181
+ "computers.uploadSignedOut": "Você saiu da sua conta. Entre de novo, e tente de novo.",
182
+ "computers.uploadSkipped": "Pulado: o que está lá fica",
183
+ "computers.uploadTooLarge": "Ele tem {size}: um arquivo pode ter no máximo {most}.",
184
+ "computers.uploadTooLargeHere": "Ele tem {size}: grande demais para enviar por este app.",
185
+ "computers.uploadUnavailable": "{computer} não conseguiu acordar. Tente de novo daqui a pouco.",
186
+ "computers.uploadWaiting": "Esperando {computer}…",
187
+ "computers.uploadWaking": "Acordando {computer}…",
188
+ "computers.uploading": {
189
+ one: "Enviando {count} arquivo",
190
+ other: "Enviando {count} arquivos",
191
+ },
192
+ "computers.uploads": "Envios",
193
+ "computers.uploadsAsking": {
194
+ one: "{count} espera por você",
195
+ other: "{count} esperam por você",
196
+ },
197
+ "computers.uploadsCancelAll": "Cancelar todos",
198
+ "computers.uploadsDone": {
199
+ one: "{count} arquivo enviado",
200
+ other: "{count} arquivos enviados",
201
+ },
202
+ "computers.uploadsFailed": {
203
+ one: "{count} não foi enviado",
204
+ other: "{count} não foram enviados",
205
+ },
206
+ "computers.uploadsHide": "Ocultar envios",
207
+ "computers.uploadsLeft": "faltam {size}",
110
208
  "computers.version": "versão {version}",
111
209
  "computers.waiting": "Esperando o login terminar…",
112
210
  "computers.wakeNote": "{computer} acorda primeiro: leva um momento.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "copilotz",
3
- "version": "1.0.0-rc.57",
3
+ "version": "1.0.0-rc.58",
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",
@@ -1 +1 @@
1
- export declare const say: import("../../../../../hosts/web/words.js").Say<"cancel" | "done" | "join" | "kind" | "id" | "person" | "view" | "name" | "ok" | "settings" | "people" | "invite" | "restore" | "space" | "details" | "save" | "emailPlaceholder" | "inviteTitle" | "personal" | "staff" | "archived" | "shared" | "roles" | "agents" | "theirPersonal" | "roleViewer" | "roleViewerLets" | "roleEditor" | "roleEditorLets" | "roleManager" | "roleManagerLets" | "agentEditorLets" | "agentViewerLets" | "aRole" | "anRole" | "listPair" | "listMore" | "invitedOne" | "invitedMany" | "kindPeople" | "newSpace" | "nameIt" | "newSpaceNote" | "createNamed" | "atMost" | "renameTitle" | "newName" | "renameNote" | "renameTo" | "archiveTitle" | "archiveNote" | "archiveNamed" | "keepIt" | "leaveTitle" | "leaveNote" | "leaveNamed" | "stay" | "peopleCount" | "agentsCount" | "workBoth" | "workPeopleOnly" | "rename" | "archiveMenu" | "leaveMenu" | "spaceNameLabel" | "renameSpace" | "justYou" | "personalAbout" | "membersNamed" | "inviteSomeone" | "newChat" | "newChatHere" | "moreOf" | "addAgent" | "agentsAboutPersonal" | "agentsAboutShared" | "noAgents" | "madeIn" | "madeElsewhere" | "appAgent" | "anAgent" | "makeAnswer" | "edit" | "removeFromSpace" | "answersNew" | "roleOf" | "joinNamed" | "decline" | "invitationTo" | "invitedTo" | "invitedYou" | "byAs" | "invitedAt" | "invitations" | "moreInvitations" | "invitationsWaiting" | "inviteAbout" | "addAgentTitle" | "addAgentAbout" | "theirEmail" | "theirRole" | "inviteHint" | "inviteHintMany" | "personalAlone" | "managersAdd" | "managersAddThis" | "whoToAdd" | "membersPersonal" | "waitingToJoin" | "invitePeople" | "spacesDrawing" | "spaceMembersIn" | "you" | "leaveThisSpace" | "takeOut" | "askedBy" | "askedByWhy" | "asked" | "askedWhy" | "letIn" | "turnDown" | "nameNewSpace" | "nameSpace" | "makeSpace" | "nothingSent" | "onlyReadsTitle" | "notWorkingTitle" | "notNow" | "makeEditorsSend" | "addSend" | "waitingReads" | "waitingAdd" | "askManagersEditor" | "askManagersAdd" | "aboutLabel" | "orgNamePersonal" | "orgNameOwner" | "orgNameOthers" | "orgNameLabel" | "yourRole" | "staffRole" | "kindPersonal" | "kindTeam" | "orgRoleLine" | "copyOrgId" | "seesYou" | "seesOwners" | "seesAsOwner" | "seesAsAdmin" | "seesTheirs" | "orgSaved" | "orgPersonalAlone" | "invitedHeading" | "removedHanded" | "removedPlain" | "onlyOwner" | "removeFromOrg" | "orgInvited" | "invitedTime" | "takeBackTo" | "takeBack" | "removeTitle" | "removeNamed" | "removeMeansOut" | "removeMeansPersonal" | "heirLabel" | "heirHint" | "youNamed" | "invitedYouAs" | "declineInvitation" | "inviteToNamed" | "renameNamed" | "restoreNamed" | "archiveNamedMore" | "leaveNamedMore" | "tabIn" | "thisSpace" | "spacesGroup" | "youreHere" | "createGroup" | "newSpaceMore" | "newSpaceNamed" | "keysAcceptInvitation" | "keysInvitation" | "keysInvite" | "keysRestore" | "keysPersonal" | "keysNewSpace" | "keysPick" | "keysCreate" | "panelMissing" | "panelLabel" | "sharedSpace" | "openPage" | "tabsOf" | "invitedNotJoined" | "invitedByYou" | "invitedBy" | "partsOf" | "notYourSpace" | "notInSpace" | "goHome" | "notInSpaceAbout" | "nothingHere" | "nothingHereAbout" | "isArchived" | "archivedNote" | "general" | "members" | "managersChange" | "nameSettingPersonal" | "nameSettingShared" | "copySpaceId" | "leave" | "leaveAbout" | "archiveSetting" | "archivedAt" | "archiveAbout" | "archiveReadableLead" | "archiveReadableRest" | "archiveApartLead" | "archiveApartRest" | "archiveBackLead" | "archiveBackRest" | "saved" | "answersAbout" | "answersViewersOnly" | "answersNone" | "answersLabel" | "answersNow" | "acrossOrg" | "acrossOrgHint" | "spacesUnder" | "nameArchived" | "personalHint" | "showWhat" | "hideWhat" | "showIn" | "hideIn">;
1
+ export declare const say: import("../../../../../hosts/web/words.js").Say<"cancel" | "done" | "join" | "kind" | "id" | "person" | "view" | "name" | "ok" | "settings" | "space" | "people" | "invite" | "restore" | "details" | "save" | "emailPlaceholder" | "inviteTitle" | "personal" | "staff" | "archived" | "shared" | "roles" | "agents" | "theirPersonal" | "roleViewer" | "roleViewerLets" | "roleEditor" | "roleEditorLets" | "roleManager" | "roleManagerLets" | "agentEditorLets" | "agentViewerLets" | "aRole" | "anRole" | "listPair" | "listMore" | "invitedOne" | "invitedMany" | "kindPeople" | "newSpace" | "nameIt" | "newSpaceNote" | "createNamed" | "atMost" | "renameTitle" | "newName" | "renameNote" | "renameTo" | "archiveTitle" | "archiveNote" | "archiveNamed" | "keepIt" | "leaveTitle" | "leaveNote" | "leaveNamed" | "stay" | "peopleCount" | "agentsCount" | "workBoth" | "workPeopleOnly" | "rename" | "archiveMenu" | "leaveMenu" | "spaceNameLabel" | "renameSpace" | "justYou" | "personalAbout" | "membersNamed" | "inviteSomeone" | "newChat" | "newChatHere" | "moreOf" | "addAgent" | "agentsAboutPersonal" | "agentsAboutShared" | "noAgents" | "madeIn" | "madeElsewhere" | "appAgent" | "anAgent" | "makeAnswer" | "edit" | "removeFromSpace" | "answersNew" | "roleOf" | "joinNamed" | "decline" | "invitationTo" | "invitedTo" | "invitedYou" | "byAs" | "invitedAt" | "invitations" | "moreInvitations" | "invitationsWaiting" | "inviteAbout" | "addAgentTitle" | "addAgentAbout" | "theirEmail" | "theirRole" | "inviteHint" | "inviteHintMany" | "personalAlone" | "managersAdd" | "managersAddThis" | "whoToAdd" | "membersPersonal" | "waitingToJoin" | "invitePeople" | "spacesDrawing" | "spaceMembersIn" | "you" | "leaveThisSpace" | "takeOut" | "askedBy" | "askedByWhy" | "asked" | "askedWhy" | "letIn" | "turnDown" | "nameNewSpace" | "nameSpace" | "makeSpace" | "nothingSent" | "onlyReadsTitle" | "notWorkingTitle" | "notNow" | "makeEditorsSend" | "addSend" | "waitingReads" | "waitingAdd" | "askManagersEditor" | "askManagersAdd" | "aboutLabel" | "orgNamePersonal" | "orgNameOwner" | "orgNameOthers" | "orgNameLabel" | "yourRole" | "staffRole" | "kindPersonal" | "kindTeam" | "orgRoleLine" | "copyOrgId" | "seesYou" | "seesOwners" | "seesAsOwner" | "seesAsAdmin" | "seesTheirs" | "orgSaved" | "orgPersonalAlone" | "invitedHeading" | "removedHanded" | "removedPlain" | "onlyOwner" | "removeFromOrg" | "orgInvited" | "invitedTime" | "takeBackTo" | "takeBack" | "removeTitle" | "removeNamed" | "removeMeansOut" | "removeMeansPersonal" | "heirLabel" | "heirHint" | "youNamed" | "invitedYouAs" | "declineInvitation" | "inviteToNamed" | "renameNamed" | "restoreNamed" | "archiveNamedMore" | "leaveNamedMore" | "tabIn" | "thisSpace" | "spacesGroup" | "youreHere" | "createGroup" | "newSpaceMore" | "newSpaceNamed" | "keysAcceptInvitation" | "keysInvitation" | "keysInvite" | "keysRestore" | "keysPersonal" | "keysNewSpace" | "keysPick" | "keysCreate" | "panelMissing" | "panelLabel" | "sharedSpace" | "openPage" | "tabsOf" | "invitedNotJoined" | "invitedByYou" | "invitedBy" | "partsOf" | "notYourSpace" | "notInSpace" | "goHome" | "notInSpaceAbout" | "nothingHere" | "nothingHereAbout" | "isArchived" | "archivedNote" | "general" | "members" | "managersChange" | "nameSettingPersonal" | "nameSettingShared" | "copySpaceId" | "leave" | "leaveAbout" | "archiveSetting" | "archivedAt" | "archiveAbout" | "archiveReadableLead" | "archiveReadableRest" | "archiveApartLead" | "archiveApartRest" | "archiveBackLead" | "archiveBackRest" | "saved" | "answersAbout" | "answersViewersOnly" | "answersNone" | "answersLabel" | "answersNow" | "acrossOrg" | "acrossOrgHint" | "spacesUnder" | "nameArchived" | "personalHint" | "showWhat" | "hideWhat" | "showIn" | "hideIn">;
@@ -5,7 +5,7 @@ export declare const MEDIA_TYPE_LENGTH = 127;
5
5
  /**
6
6
  * What a file's media type looks like: `type/subtype`, then parameters
7
7
  * (`audio/ogg; codecs=opus`, as WhatsApp sends voice notes), on one line:
8
- * an agent is told it (`[file a.bin: <type>, …]`).
8
+ * an agent is told it (`[file a.bin: <type>, …, id …]`).
9
9
  */
10
10
  export declare const MEDIA_TYPE: RegExp;
11
11
  export declare const sendAction: import("../../../../runtime/define.js").ActionDef;
@@ -49,7 +49,7 @@ export const MEDIA_TYPE_LENGTH = 127;
49
49
  /**
50
50
  * What a file's media type looks like: `type/subtype`, then parameters
51
51
  * (`audio/ogg; codecs=opus`, as WhatsApp sends voice notes), on one line:
52
- * an agent is told it (`[file a.bin: <type>, …]`).
52
+ * an agent is told it (`[file a.bin: <type>, …, id …]`).
53
53
  */
54
54
  export const MEDIA_TYPE = /^[A-Za-z0-9][\w!#$&^.+-]*\/[A-Za-z0-9][\w!#$&^.+-]*(?: *; *[\w!#$&^.+-]+=(?:[\w!#$&^.+-]+|"[ !#-\[\]-~]*"))* *$/;
55
55
  /**
@@ -508,6 +508,7 @@ export declare const message: {
508
508
  name: string;
509
509
  size: number;
510
510
  }[] | undefined;
511
+ turn?: string | undefined;
511
512
  toolCalls?: unknown[] | undefined;
512
513
  back?: {
513
514
  [x: string]: unknown;
@@ -518,7 +519,6 @@ export declare const message: {
518
519
  replyTo?: string | undefined;
519
520
  expectReply?: boolean | undefined;
520
521
  subthread?: string | undefined;
521
- turn?: string | undefined;
522
522
  drew?: string[] | undefined;
523
523
  tap?: {
524
524
  [x: string]: unknown;
@@ -16,7 +16,7 @@
16
16
  * `turn.requested`), its Actions (`chat.send`, `chat.stop`, `chat.move`…).
17
17
  */
18
18
  export type { File, FileAbout } from "./collections/file.js";
19
- export { FILE_CHARS, textual } from "./collections/file.js";
19
+ export { FILE_CHARS, FILE_DATA, textual } from "./collections/file.js";
20
20
  export type { Live, LiveCall } from "./collections/live.js";
21
21
  export { heldTold, isAnswer, type Message } from "./collections/message.js";
22
22
  export type { AdditionShown } from "./collections/shown.js";
@@ -1,4 +1,4 @@
1
- export { FILE_CHARS, textual } from "./collections/file.js";
1
+ export { FILE_CHARS, FILE_DATA, textual } from "./collections/file.js";
2
2
  export { heldTold, isAnswer } from "./collections/message.js";
3
3
  /** A chat's notes, by its id (`<chat>:notes`, see `chat.notes`). */
4
4
  export { notesOf } from "./shared/notes.js";
@@ -7,9 +7,10 @@ const viewable = (type) => /^image\/(png|jpeg|gif|webp)$/.test(type) || type ===
7
7
  /**
8
8
  * Its files, as an agent reads them: text files' content, what audio says,
9
9
  * images and PDFs as they are (named in the text too), the rest by name.
10
- * Each file's content is read on its own, all in the same pass: one answer
11
- * from the owner carries one file, never a message's files together, which
12
- * could pass the most one answer carries (16 MiB).
10
+ * Each says its id, which a tool takes to use the file itself (a computer's
11
+ * `save_file`). Each file's content is read on its own, all in the same
12
+ * pass: one answer from the owner carries one file, never a message's files
13
+ * together, which could pass the most one answer carries (16 MiB).
13
14
  */
14
15
  function attached(m, ctx) {
15
16
  if (!m.files?.length)
@@ -20,19 +21,19 @@ function attached(m, ctx) {
20
21
  ? ctx.db.collection("file").findOne({ _id: f.id }).value?.data
21
22
  : undefined;
22
23
  if (f.transcript !== undefined) {
23
- return `\n[${f.voice ? "voice message" : `audio ${f.name}`}, transcribed]\n${f.transcript}` +
24
- `\n[end of ${f.voice ? "voice message" : f.name}]`;
24
+ return `\n[${f.voice ? "voice message" : `audio ${f.name}`}, transcribed, id ${f.id}]\n` +
25
+ `${f.transcript}\n[end of ${f.voice ? "voice message" : f.name}]`;
25
26
  }
26
27
  if (data !== undefined && viewable(f.type)) {
27
28
  files.push({ name: f.name, type: f.type, data });
28
- return `\n[${f.type === "application/pdf" ? "pdf" : "image"} ${f.name}]`;
29
+ return `\n[${f.type === "application/pdf" ? "pdf" : "image"} ${f.name}, id ${f.id}]`;
29
30
  }
30
31
  if (data === undefined || !textual(f.type)) {
31
- return `\n[file ${f.name}: ${f.type}, ${f.size} bytes]`;
32
+ return `\n[file ${f.name}: ${f.type}, ${f.size} bytes, id ${f.id}]`;
32
33
  }
33
34
  const content = text(data);
34
35
  const cut = content.length > FILE_CHARS ? `${content.slice(0, FILE_CHARS)}\n[…cut]` : content;
35
- return `\n[file ${f.name}]\n${cut}\n[end of ${f.name}]`;
36
+ return `\n[file ${f.name}, id ${f.id}]\n${cut}\n[end of ${f.name}]`;
36
37
  });
37
38
  return { text: lines.join(""), files };
38
39
  }
@@ -1 +1 @@
1
- export declare const say: import("../../../../../hosts/web/words.js").Say<"kind" | "agent" | "person" | "time" | "seconds" | "model" | "tokens" | "activity" | "space" | "tryAgain" | "thisMonth" | "billing" | "month" | "day" | "onDay" | "justYou" | "anAgent" | "you" | "saved" | "calls" | "everyone" | "hours" | "plan" | "aConversation" | "yourPersonalSpace" | "minutes" | "uses" | "requests" | "unpriced" | "gbHours" | "notTiedToAnyone" | "spaceNotRecorded" | "spaceNotReached" | "personalSpaceOf" | "quoted" | "readError" | "whoseUsage" | "readAgain" | "ownUsage" | "keptTo" | "showingOnly" | "chipWhat" | "showAllNotOnly" | "showEverything" | "nothingUsedThisMonth" | "nothingUsedIn" | "emptyEveryone" | "emptyOwn" | "spentThisMonth" | "spentIn" | "spentByYouThisMonth" | "spentByYouIn" | "shareOfAll" | "shareOfBudget" | "budgetUsedUp" | "outOfCredits" | "creditsLeft" | "creditsLeftLasts" | "budgetLeft" | "budgetLeftLasts" | "budgetLeftEnough" | "meterLabel" | "meterValue" | "meterNow" | "versus" | "pointLastMonth" | "nothingByPoint" | "nothingIn" | "cachingSaved" | "cachingCost" | "staffOnly" | "costOf" | "marginOf" | "underCost" | "overCost" | "lastsLessThanDay" | "lastsDay" | "lastsDays" | "lastsWeeks" | "lastsMonths" | "lastsYear" | "savedNothing" | "savedNegative" | "hoursMinutes" | "byKind" | "bySpace" | "byPerson" | "byAgent" | "byModel" | "kindAgents" | "kindComputers" | "kindApps" | "purposeHistory" | "purposeMemory" | "purposeTranscription" | "purposeDraft" | "conversationUpkeep" | "otherModelUse" | "upkeepDetail" | "beforeSpaces" | "spendBy" | "theRest" | "chartLabel" | "rowsLabel" | "showAllAgain" | "seeOnly" | "rowCost" | "rowCostMargin" | "showFewer" | "showAll" | "fromInputCache" | "chartKeys" | "stillToCome" | "hideNumbers" | "showNumbers" | "spend" | "dayAnnounced" | "seriesAnnounced" | "yourKey" | "yourKeyTitle" | "planTitle" | "noKnownCost" | "staffCostMargin" | "activityEveryone" | "activityEveryoneFiltered" | "activityYours" | "activityYoursFiltered" | "nothingMatches" | "showOlder" | "aComputer" | "anApp" | "turnTitle" | "upkeepOf" | "modelCalls" | "fromCache" | "diskOf" | "snapshotOf" | "computerTitle" | "woke" | "appTitle" | "buildMinutes" | "meterTitle" | "hideModelCalls" | "showModelCalls" | "inColumn" | "fromCacheColumn" | "outColumn" | "costColumn">;
1
+ export declare const say: import("../../../../../hosts/web/words.js").Say<"kind" | "agent" | "person" | "time" | "seconds" | "model" | "space" | "tokens" | "activity" | "tryAgain" | "thisMonth" | "billing" | "month" | "day" | "onDay" | "justYou" | "anAgent" | "you" | "saved" | "calls" | "everyone" | "hours" | "plan" | "aConversation" | "yourPersonalSpace" | "minutes" | "uses" | "requests" | "unpriced" | "gbHours" | "notTiedToAnyone" | "spaceNotRecorded" | "spaceNotReached" | "personalSpaceOf" | "quoted" | "readError" | "whoseUsage" | "readAgain" | "ownUsage" | "keptTo" | "showingOnly" | "chipWhat" | "showAllNotOnly" | "showEverything" | "nothingUsedThisMonth" | "nothingUsedIn" | "emptyEveryone" | "emptyOwn" | "spentThisMonth" | "spentIn" | "spentByYouThisMonth" | "spentByYouIn" | "shareOfAll" | "shareOfBudget" | "budgetUsedUp" | "outOfCredits" | "creditsLeft" | "creditsLeftLasts" | "budgetLeft" | "budgetLeftLasts" | "budgetLeftEnough" | "meterLabel" | "meterValue" | "meterNow" | "versus" | "pointLastMonth" | "nothingByPoint" | "nothingIn" | "cachingSaved" | "cachingCost" | "staffOnly" | "costOf" | "marginOf" | "underCost" | "overCost" | "lastsLessThanDay" | "lastsDay" | "lastsDays" | "lastsWeeks" | "lastsMonths" | "lastsYear" | "savedNothing" | "savedNegative" | "hoursMinutes" | "byKind" | "bySpace" | "byPerson" | "byAgent" | "byModel" | "kindAgents" | "kindComputers" | "kindApps" | "purposeHistory" | "purposeMemory" | "purposeTranscription" | "purposeDraft" | "conversationUpkeep" | "otherModelUse" | "upkeepDetail" | "beforeSpaces" | "spendBy" | "theRest" | "chartLabel" | "rowsLabel" | "showAllAgain" | "seeOnly" | "rowCost" | "rowCostMargin" | "showFewer" | "showAll" | "fromInputCache" | "chartKeys" | "stillToCome" | "hideNumbers" | "showNumbers" | "spend" | "dayAnnounced" | "seriesAnnounced" | "yourKey" | "yourKeyTitle" | "planTitle" | "noKnownCost" | "staffCostMargin" | "activityEveryone" | "activityEveryoneFiltered" | "activityYours" | "activityYoursFiltered" | "nothingMatches" | "showOlder" | "aComputer" | "anApp" | "turnTitle" | "upkeepOf" | "modelCalls" | "fromCache" | "diskOf" | "snapshotOf" | "computerTitle" | "woke" | "appTitle" | "buildMinutes" | "meterTitle" | "hideModelCalls" | "showModelCalls" | "inColumn" | "fromCacheColumn" | "outColumn" | "costColumn">;
@@ -0,0 +1 @@
1
+ export declare const uploadAction: import("../../../../runtime/define.js").ActionDef;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * `computer.upload` `{ desk, path }`: a person putting a file on a space's
3
+ * computer (its desk there), at `path` in the space's folder: only where
4
+ * they may change it from its panel (`computer.work`'s rules), a computer
5
+ * that sleeps woken, and said to be in use. It answers where the bytes go,
6
+ * `{ computer, scope }`, for the upload route (routes/upload.ts) to stream
7
+ * them there: an Action is given JSON, never a stream. On the record: who
8
+ * put what where, never its content.
9
+ */
10
+ import { defineAction, inPerson } from "../../../../runtime/mod.js";
11
+ import { personalDesk } from "../shared/desks.js";
12
+ import { touch } from "../shared/wake.js";
13
+ export const uploadAction = defineAction({
14
+ description: "Puts a file on a space's computer, in its folder there: where its bytes go",
15
+ input: {
16
+ type: "object",
17
+ properties: {
18
+ desk: { type: "string" },
19
+ /** Where in the space's folder, relative to it. */
20
+ path: { type: "string", minLength: 1, maxLength: 4096 },
21
+ },
22
+ required: ["desk", "path"],
23
+ additionalProperties: false,
24
+ },
25
+ allow: inPerson,
26
+ run: async (ctx, input) => {
27
+ const { desk, woke } = await personalDesk(ctx, input.desk, true);
28
+ await touch(ctx, desk.computer);
29
+ return {
30
+ computer: desk.computer,
31
+ scope: { space: desk.in, folder: desk.folder, who: `person:${ctx.actor.id}` },
32
+ ...(woke !== undefined ? { woke } : {}),
33
+ };
34
+ },
35
+ });
@@ -9,12 +9,12 @@
9
9
  * a while by it; what only reads (a panel polling its jobs) neither wakes it
10
10
  * nor keeps it awake, so a page left open lets it sleep.
11
11
  */
12
- import { defineAction, forbidden, inPerson } from "../../../../runtime/mod.js";
12
+ import { defineAction, inPerson } from "../../../../runtime/mod.js";
13
+ import { personalDesk } from "../shared/desks.js";
13
14
  import { failed } from "../shared/failed.js";
14
15
  import { jobEnv } from "../shared/env.js";
15
- import { touch, wake } from "../shared/wake.js";
16
+ import { touch } from "../shared/wake.js";
16
17
  import { WORK } from "../shared/workloads.js";
17
- import { must } from "../../../access/spaces/contract.js";
18
18
  /** What a person may do on their computer from its panel. */
19
19
  const PANEL = {
20
20
  terminal: WORK.terminal,
@@ -49,27 +49,13 @@ export const workAction = defineAction({
49
49
  },
50
50
  allow: inPerson,
51
51
  run: async (ctx, input) => {
52
- // The rules reach only the desks of spaces the person is in; working there takes more.
53
- const desk = await ctx.db.collection("desk").findOne({ _id: input.desk });
54
- if (!desk)
55
- throw Object.assign(new Error("No such computer here"), { code: "invalid" });
56
- await must(ctx, "write", desk.in, "You can't work in this space.");
57
- // Where its owner answers for it, nobody else changes anything on it without them.
58
- if (desk.answers === "owner" && desk.owner !== ctx.actor.id && !READS.has(input.work)) {
59
- throw forbidden("Its owner keeps this computer's answers: only they work on it directly.");
60
- }
61
- const who = input.as && input.work.startsWith("jobs.") ? input.as : `person:${ctx.actor.id}`;
62
52
  // A computer that sleeps (a cloud computer) is woken first; used, it stays awake a while.
63
- if (!desk.online && !READS.has(input.work)) {
64
- const woke = await wake(ctx, desk.computer);
65
- if (typeof woke === "string") {
66
- throw Object.assign(new Error(woke), { code: "unavailable" });
67
- }
68
- if (!woke && input.work === "wake") {
69
- throw Object.assign(new Error("The computer is offline: its owner starts it again."), {
70
- code: "offline",
71
- });
72
- }
53
+ const { desk, woke } = await personalDesk(ctx, input.desk, !READS.has(input.work));
54
+ const who = input.as && input.work.startsWith("jobs.") ? input.as : `person:${ctx.actor.id}`;
55
+ if (woke === false && input.work === "wake") {
56
+ throw Object.assign(new Error("The computer is offline: its owner starts it again."), {
57
+ code: "offline",
58
+ });
73
59
  }
74
60
  // What changes something keeps it awake a while; reading (a panel polling its jobs) doesn't:
75
61
  // a person with it open keeps it awake with computer.view, up to the app's limit.
@@ -188,6 +188,10 @@ export const engineAdapter = {
188
188
  if ((event.code === "stale" || event.code === "lost" || event.code === "busy") &&
189
189
  !wrote && !tries) {
190
190
  stale = event.code;
191
+ // On the log, so a plan that keeps starting over (its whole history again) shows.
192
+ const where = request.tags?.thread ? ` [thread=${request.tags.thread}]` : "";
193
+ console.warn(`computers: ${engine} session ${session ?? "(new)"} ${event.code} ` +
194
+ `(${event.message}): starting afresh${where}`);
191
195
  break;
192
196
  }
193
197
  throw engineFailure(`engine_${event.code}`, event.message);
@@ -94,9 +94,9 @@ export declare const preview: {
94
94
  by: string;
95
95
  port: number;
96
96
  who: string;
97
+ space: string;
97
98
  computer: string;
98
99
  folder: string;
99
- space: string;
100
100
  visibility: "link" | "members";
101
101
  } & {
102
102
  _id: string;
@@ -16,6 +16,12 @@
16
16
  * managers' `env.set`) is what its jobs and shells run with, and its apps
17
17
  * (see collections/env-var.ts); secrets are sealed with `computers: { key }`.
18
18
  *
19
+ * Files cross between a chat and its space's computer: an agent saves one
20
+ * sent in the chat into the folder (`save_file`, a write like any other) and
21
+ * sends one from the folder into the chat (`send_file`); a person puts files
22
+ * there from the computer's page (`PUT /computers/upload`, streamed through
23
+ * to it: routes/upload.ts), where they may change it (`computer.upload`).
24
+ *
19
25
  * A computer also runs its owner's plans: Claude Code, Codex or Antigravity,
20
26
  * signed in there once (`computer.engines`, `computer.engine.login`), so an
21
27
  * agent's model calls for them run on their plan, through the CLI, instead
@@ -16,6 +16,12 @@
16
16
  * managers' `env.set`) is what its jobs and shells run with, and its apps
17
17
  * (see collections/env-var.ts); secrets are sealed with `computers: { key }`.
18
18
  *
19
+ * Files cross between a chat and its space's computer: an agent saves one
20
+ * sent in the chat into the folder (`save_file`, a write like any other) and
21
+ * sends one from the folder into the chat (`send_file`); a person puts files
22
+ * there from the computer's page (`PUT /computers/upload`, streamed through
23
+ * to it: routes/upload.ts), where they may change it (`computer.upload`).
24
+ *
19
25
  * A computer also runs its owner's plans: Claude Code, Codex or Antigravity,
20
26
  * signed in there once (`computer.engines`, `computer.engine.login`), so an
21
27
  * agent's model calls for them run on their plan, through the CLI, instead
@@ -55,12 +61,14 @@ import { shareAction } from "./actions/share.js";
55
61
  import { unshareAction } from "./actions/unshare.js";
56
62
  import { viewAction } from "./actions/view.js";
57
63
  import { workAction } from "./actions/work.js";
64
+ import { uploadAction } from "./actions/upload.js";
58
65
  import { computer } from "./collections/computer.js";
59
66
  import { desk } from "./collections/desk.js";
60
67
  import { enrollment } from "./collections/enrollment.js";
61
68
  import { envVar } from "./collections/env-var.js";
62
69
  import { preview } from "./collections/preview.js";
63
70
  import { previewRoutes } from "./resources/previews.js";
71
+ import { UPLOAD, uploadRoute } from "./routes/upload.js";
64
72
  import { tools } from "./resources/tools.js";
65
73
  import { upgradeAsksAction } from "./actions/upgrade-asks.js";
66
74
  import { contextViews } from "./views/context.js";
@@ -103,6 +111,7 @@ export const computers = definePlugin({
103
111
  "computer.move": moveAction,
104
112
  "computer.allowOrigin": allowOriginAction,
105
113
  "computer.work": workAction,
114
+ "computer.upload": uploadAction,
106
115
  // A space's environment: its managers' (env.values: the system's, an app's deploy).
107
116
  "env.set": envSetAction,
108
117
  "env.unset": envUnsetAction,
@@ -137,7 +146,7 @@ export const computers = definePlugin({
137
146
  // Agents with computer tools know, each turn, whose computer they work on and what waits for a yes.
138
147
  views: contextViews,
139
148
  // What jobs serve, at addresses of their own, once the app says where (`previews`).
140
- routes: previewRoutes,
149
+ routes: { ...previewRoutes, [UPLOAD]: uploadRoute },
141
150
  resources: {
142
151
  tools,
143
152
  computers: {},