cortico-world-agent-speed 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +62 -0
- package/LICENSE +662 -21
- package/LICENSE-MIT +21 -0
- package/README.md +28 -17
- package/THIRD_PARTY_NOTICES.md +69 -0
- package/activity.d.ts +15 -0
- package/activity.js +230 -38
- package/describe.json +806 -0
- package/dist/webui.css +2 -0
- package/dist/webui.css.map +7 -0
- package/dist/webui.js +2 -0
- package/dist/webui.js.map +7 -0
- package/host/app-store.cjs +68 -0
- package/host/cursor.cjs +67 -0
- package/host/electron-main.cjs +666 -0
- package/host/input-shape.cjs +63 -0
- package/host/mouse-lease.cjs +77 -0
- package/host/overlay.cjs +139 -0
- package/host/portrait.cjs +52 -0
- package/host/preload.cjs +62 -0
- package/host/renderer-gone.cjs +24 -0
- package/host/windows.cjs +251 -0
- package/package.json +28 -7
- package/scripts/build-webui.mjs +40 -0
- package/scripts/speech-bank/build.py +166 -0
- package/scripts/speech-bank/dicts.py +76 -0
- package/src/ENV_PROMPT.en.md +51 -0
- package/src/ENV_PROMPT.md +51 -0
- package/src/asr/address.ts +25 -0
- package/src/asr/hotkey.ts +335 -0
- package/src/asr/result.ts +51 -0
- package/src/asr/segmenter.ts +269 -0
- package/src/asr/sherpa.ts +280 -0
- package/src/asr/simplify.ts +38 -0
- package/src/asr/system-recognizer.ts +292 -0
- package/src/asr/system-sapi.ps1 +173 -0
- package/src/asr/transcription-api.ts +176 -0
- package/src/chat.ts +212 -0
- package/src/config.ts +481 -0
- package/src/cua/ENV_PROMPT.en.md +29 -0
- package/src/cua/ENV_PROMPT.md +29 -0
- package/src/cua/config.ts +88 -0
- package/src/cua/cua.ts +712 -0
- package/src/cua/engine/darwin.ts +410 -0
- package/src/cua/engine/display.ts +55 -0
- package/src/cua/engine/fail.ts +15 -0
- package/src/cua/engine/foreground.ts +8 -0
- package/src/cua/engine/image.ts +57 -0
- package/src/cua/engine/keys.ts +70 -0
- package/src/cua/engine/linux-keys.ts +29 -0
- package/src/cua/engine/linux.ts +343 -0
- package/src/cua/engine/mac-keys.ts +57 -0
- package/src/cua/engine/user-activity.ts +54 -0
- package/src/cua/engine/wait-idle.ts +31 -0
- package/src/cua/engine/win32.ts +299 -0
- package/src/cua/engine-child.ts +274 -0
- package/src/cua/engine-ipc.ts +140 -0
- package/src/cua/i18n/de.ts +53 -0
- package/src/cua/i18n/en.ts +63 -0
- package/src/cua/i18n/es-419.ts +53 -0
- package/src/cua/i18n/fr.ts +53 -0
- package/src/cua/i18n/index.ts +26 -0
- package/src/cua/i18n/it.ts +53 -0
- package/src/cua/i18n/ja.ts +53 -0
- package/src/cua/i18n/ko.ts +53 -0
- package/src/cua/i18n/pt-BR.ts +53 -0
- package/src/cua/i18n/ru.ts +59 -0
- package/src/cua/i18n/zh-Hant.ts +53 -0
- package/src/cua/i18n/zh.ts +59 -0
- package/src/cua/model-text.ts +252 -0
- package/src/cua/terminal.ts +31 -0
- package/src/cua/tools.ts +153 -0
- package/src/definition.ts +146 -0
- package/src/host-reason.ts +32 -0
- package/src/i18n/de.ts +409 -0
- package/src/i18n/en.ts +443 -0
- package/src/i18n/es-419.ts +409 -0
- package/src/i18n/fr.ts +409 -0
- package/src/i18n/index.ts +56 -0
- package/src/i18n/it.ts +409 -0
- package/src/i18n/ja.ts +409 -0
- package/src/i18n/ko.ts +409 -0
- package/src/i18n/pt-BR.ts +409 -0
- package/src/i18n/ru.ts +415 -0
- package/src/i18n/zh-Hant.ts +409 -0
- package/src/i18n/zh.ts +440 -0
- package/src/index.ts +15 -0
- package/src/model-text.ts +344 -0
- package/src/moves.ts +101 -0
- package/src/pack-import.ts +236 -0
- package/src/packs.ts +449 -0
- package/src/runtime/download.ts +29 -0
- package/src/runtime/store.ts +293 -0
- package/src/script.ts +202 -0
- package/src/self.ts +247 -0
- package/src/server.ts +479 -0
- package/src/speech/data/CMUDICT-LICENSE +33 -0
- package/src/speech/data/IPADIC-COPYING +71 -0
- package/src/speech/data/UNICODE-LICENSE +39 -0
- package/src/speech/data/en.tsv.gz +0 -0
- package/src/speech/data/ja-ipadic.tsv.gz +0 -0
- package/src/speech/data/ja-unihan.tsv.gz +0 -0
- package/src/speech/data/zh.json +1 -0
- package/src/speech/index.ts +204 -0
- package/src/speech/ipa.ts +83 -0
- package/src/speech/japanese.ts +105 -0
- package/src/speech/jukujikun.ts +22 -0
- package/src/speech/korean.ts +35 -0
- package/src/speech/lang.ts +151 -0
- package/src/speech/rules.ts +72 -0
- package/src/speech/syllable.ts +76 -0
- package/src/status.ts +164 -0
- package/src/tools.ts +110 -0
- package/src/webui/api-rows.css +2 -0
- package/src/webui/api-rows.ts +44 -0
- package/src/webui/client.ts +462 -0
- package/src/webui/dress-dialog.css +14 -0
- package/src/webui/dress-dialog.ts +117 -0
- package/src/webui/key-capture.ts +60 -0
- package/src/webui/shared/modal.css +13 -0
- package/src/webui/shared/modal.ts +77 -0
- package/src/webui/shared/problem.css +15 -0
- package/src/webui/shared/problem.ts +217 -0
- package/src/webui/shared/strings.ts +5 -0
- package/src/webui/style.css +39 -0
- package/src/window-host.ts +116 -0
- package/src/world.ts +2838 -0
- package/web/activity-motion.js +54 -0
- package/web/appearance.js +60 -0
- package/web/body-host.js +257 -0
- package/web/coo/coo.js +384 -0
- package/web/coo/figure.js +15 -0
- package/web/coo/figure.json +1224 -0
- package/web/dist/dress-dialog.css +1 -0
- package/web/dist/dress-dialog.js +1 -0
- package/web/drag-row.js +49 -0
- package/web/drag.js +149 -0
- package/web/dress.css +170 -0
- package/web/dress.html +37 -0
- package/web/dress.js +786 -0
- package/web/figure-frame.html +16 -0
- package/web/figure-frame.js +127 -0
- package/web/frame-loop.js +55 -0
- package/web/hints.js +77 -0
- package/web/i18n/de.js +170 -0
- package/web/i18n/en.js +177 -0
- package/web/i18n/es-419.js +170 -0
- package/web/i18n/fr.js +170 -0
- package/web/i18n/it.js +170 -0
- package/web/i18n/ja.js +170 -0
- package/web/i18n/ko.js +170 -0
- package/web/i18n/pt-BR.js +170 -0
- package/web/i18n/ru.js +170 -0
- package/web/i18n/zh-Hant.js +170 -0
- package/web/i18n/zh.js +175 -0
- package/web/i18n.js +54 -0
- package/web/kit/body.js +1079 -0
- package/web/kit/rig.js +242 -0
- package/web/looks.js +70 -0
- package/web/mic-worklet.js +36 -0
- package/web/mic.js +117 -0
- package/web/motion-frames.js +80 -0
- package/web/motion-level.js +40 -0
- package/web/new-year-2027.svg +238 -0
- package/web/overlay.html +16 -0
- package/web/overlay.js +100 -0
- package/web/pet-app.js +2992 -0
- package/web/pet.css +642 -0
- package/web/pet.html +21 -0
- package/web/scale-slider.js +259 -0
- package/web/show-hide.js +49 -0
- package/web/sound.js +245 -0
- package/web/speech/zh.json +1 -0
- package/web/speech/zh.ogg +0 -0
- package/web/speech.js +197 -0
- package/web/stage.js +160 -0
- package/web/swap-motion.js +119 -0
- package/web/ui.js +195 -0
- package/index.js +0 -127
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Agent Speed fork
|
|
2
|
+
|
|
3
|
+
- Replaced the separate renderer with the pinned Coopanion Desktop Pet World and official Coo figure. The extension has independent settings, runtime, storage, tool names and window lifecycle.
|
|
4
|
+
- Agent Speed activity animates the figure locally through the official window's connection. Supported desktop releases use either the live IPC feed or the v1 local snapshot.
|
|
5
|
+
- DeepSeek Chan artwork is not redistributed; the official dressing page can import separately licensed figure packs.
|
|
6
|
+
|
|
7
|
+
# Upstream Desktop Pet change history
|
|
8
|
+
|
|
9
|
+
## Unreleased
|
|
10
|
+
|
|
11
|
+
- Each end of the pet window's and the dressing window's renderer is logged at WARN with its reason and exit code (in hex on Windows), noting when its page had not finished loading (`host/renderer-gone.cjs` `watchRenderer`, which an app can use for its own windows). Until the page loads again, the host stops sending it the cursor and the other windows' positions. Lines of the window process starting with `[warn] ` are logged at WARN, the rest at debug as before.
|
|
12
|
+
- The description of `window.electronFile` says it is used only while `CORTICO_DESKTOP_PET_HOST` is not set.
|
|
13
|
+
- Windows: after the scale of the pet window's display changes while the app runs, the window covers the work area again; it used to come out sized by the ratio of the old and new scales.
|
|
14
|
+
- Config `asr.serviceEnabled` (on by default): off, the recognition service does not start while voice input is on; the voice panel's `start` and `stop` methods write it, and `state` carries it. With `asr.recording.transcript` off and the endpoint taking `audio/wav`, a batch goes as its recording once captured, without waiting for recognition; a transcript recognized afterwards is stored as a `desktop-pet.self` `transcript` record and sent to chat pages as `transcript { cursor, text }`, never delivered.
|
|
15
|
+
- Config `cua.risksConfirmed` (off by default): the person confirmed computer use's risks in the settings window. While it is on, the pet's `cua` hover button turns computer use on as well as off (`prefs` `cua: true`, which the World refuses otherwise); the page's `prefs.cua` carries `confirmed`.
|
|
16
|
+
- The 「语音输入」 panel shows the explanations of the engine, how to talk, opening on press, the recording, the transcript and the recording limit whole, in the page's text font; status details (paths, the window, the runtime) keep to two lines.
|
|
17
|
+
- Config `window.fade` (0–95, in steps of 5, 0 by default): how transparent the body is, in percent, whatever it does (talking, asking, held, the typing box open); no bubble fades with it, nor the hover buttons, the menu and the sliders. On Windows, `window.fadeWhenFullscreen` (off by default) takes `window.fullscreenFade` (40 by default) in its place while a fullscreen window covers the pet's display. The change fades over 0.2 s.
|
|
18
|
+
- Hover buttons `fade` and `cua`. `fade` shows a transparency slider over the head, in the size slider's place and as it opens and pins; it sets the transparency in force. `cua` shows whether computer use is on: a click switches it off (`prefs` `cua: false`), or, while off, opens the settings window's switch through `controls.openCuaSettings`. The page's `prefs` carry `fade`, `fadeWhenFullscreen`, `fullscreenFade` and `cua: { on, canOpen }`; each slider over the head is its own `.head-slider[data-kind]` element (was `#sizer`).
|
|
19
|
+
- Text past its cap stays in the field and is not sent; the field's border turns red and the count shows beside the send button: the typing box (500 characters, with a line under it pointing to the Chat page while the text is within that page's cap; the expand button is disabled past it), a written answer (200) and a dialog's text field (its `maxLength`, 200 when absent). Before, the fields' `maxlength` cut pasted text without a word. The chat stream's `init` carries `textMax` and `answerMax`, and the page's `prefs.bot` carries `textMax: { box, chat }`; the World still cuts text past them.
|
|
20
|
+
- Every bubble with a close button (a question, a confirmation, an app's dialog that can be closed, the typing box) has it outside the bubble on its right, a small round button drawn as the hover buttons are; the bubble keeps its usual right padding, and a question's choices take its whole width. The × is drawn in the button's middle. Placed by the screen's right side, the bubble moves over so the button stays on the screen; the cursor on the button holds the bubble as it does on the bubble, and the OBS overlay's capture and `pet_see_self`'s picture count the button with the bubble. Before, the × sat in the bubble's top right corner.
|
|
21
|
+
- Once its text runs past one row, the typing box's text takes the field's whole width, with the expand and send buttons under it, until the box is cleared; its close button and scrollbar sit outside the bubble on its right: a small round button drawn as the hover buttons are, and under it, centred, a thumb on a faint track while the text scrolls (dragged, it scrolls the text; a press on the track pages; the wheel over it scrolls), and text cut off at the field's top or bottom fades out there; the textarea's own scrollbar is not shown, and the bubble keeps its usual right padding. The empty box's hint keeps to one row in every language (the field is as wide as the hint, and the bubble goes past its usual widest when the hint needs it, fitted again when `bubbleSize` or `fontSize` changes), so the box no longer shrinks by a row at the first key. Before, the text kept to the part of the field the buttons left and scrolled with the system's scrollbar inside it.
|
|
22
|
+
- An automatic input bubble fades 0.5 s after the reply's last line is written out, before the reply's bubble closes (or 0.5 s after the reply closes, if that comes first); it faded 1 s after the reply closed.
|
|
23
|
+
- A line of Coo's or of the person's that wraps takes the narrowest bubble that holds it in as many lines (`balancedWidth` in `web/ui.js`): its lines come out about as long as each other and the bubble no longer stays at its widest with blank space after them. Bubbles up are fitted again when `bubbleSize`, `fontSize` or the window's width changes, so a line does not wrap into one more row.
|
|
24
|
+
- A bubble's tail keeps its base on the bubble's straight bottom edge at any `bubbleSize`: its tip stays 29px times the size from the bubble's sides (`tailAt` and `TAIL_EDGE` in `web/ui.js`), and the narrowest bubble is 58px times the size wide (it was 46px). By a bubble's side, and on a bubble of a word or two, the tail used to reach into the rounded corners and break the outline there, more so at larger sizes.
|
|
25
|
+
- A bubble's tail draws its line as wide as the bubble's border is drawn, at any `bubbleSize` and display scale; enlarged, the line grew thicker with the tail, and it stayed 2.5px where the border is drawn 2px.
|
|
26
|
+
- Config `window.sayBubbleHoldSec` and `saidBubbleHoldSec` (integer seconds, 0–60, 0 by default): 1–60 holds each part of a line that long once typed out, or an input bubble that long from when it was sent or recognized; 0 keeps the automatic holds. `pet_say` receipts count a fixed speech hold, for the line and for those queued ahead of it.
|
|
27
|
+
- Config `asr.recording` (`enabled` and `transcript` on, `maxMinutes` 5 by default, 1–7): while `enabled` is on and the endpoint takes `audio/wav`, a `desktop-pet.speech` event carries the batch's recording as a WAV attachment; with `transcript` off its text leaves out what was recognized. A batch whose recording runs past `maxMinutes` goes as text alone. The voice panel has a row for each, and its `state` carries `recording` with `range` and `endpointTakesAudio`; panel method `setRecording`.
|
|
28
|
+
- The managed Electron runtime that hosts the pet window outside an app has a Windows arm64 build (`win32-arm64`).
|
|
29
|
+
- Config `window.hideFromCapture` (Windows, off by default): on, the pet window is left out of screenshots and screen recordings (`setContentProtection`), those of `pet_cua_screenshot` included.
|
|
30
|
+
- Config `window.overTaskbar` (Windows, on by default): off, the pet window ends at the work area's bottom and no longer reaches down over the taskbar.
|
|
31
|
+
- A pack the pet page could not run is logged at WARN with its id and the reason, and listed in `GET /api/figures/status` `problems` until the page shows it. The `desktop-pet.figure` event of the failure carries the reason in `meta.figure.reason`, which the chat page shows.
|
|
32
|
+
- A kit body walks up to the screen edges as far as its figure's `extent` allows, each side by what `extent` reaches on that side as the body faces now (`extent` mirrored about x=128 facing left): a lopsided body that turns round at an edge moves in with the turn. Its hover buttons sit by the wider side of `extent` (`side.reach`). A figure without `extent` keeps the 104-unit margin. The `bounds` a pack's `moves` receive carry in `minX` and `maxX` where a walk to that side ends. `createPet` takes `opts.startFacing` (1 or -1).
|
|
33
|
+
- The right-click menu shows only the actions picked as hover buttons (`hoverButtons`), beside the run controls the app lends; the actions not picked are no longer listed there. `hoverButtons` may be empty (0–6, it was 1–6), from the settings window and from `pet_set`: no buttons on hover, and a menu of the run controls alone, or none without them.
|
|
34
|
+
- A pet dialog takes `{ kind: 'pick', options, value?, min?, max, confirm }`: cards of which `min` (1 when absent) to `max` are picked, answered as `{ picked: [index, …] }` in the cards' order, holding only indices of its own cards.
|
|
35
|
+
- `PET_ACTIONS`, `MAX_HOVER_BUTTONS`, `hoverButtonList` and the type `PetAction` are exported.
|
|
36
|
+
- Tool `pet_see_self` (no arguments): a PNG of the body as the pet window draws it at the moment of the call, over a grey backdrop, without the page's bubbles and buttons, with a line naming the figure and its dress. The World sends the page a `portrait` order; the page answers `portrait` with `{ png, width, height }` (from `petHost.portrait(rect)`, `host/portrait.cjs`) or `{ failed }` (`tab`, `hidden`, `no-body`, `capture`). Figure packs take no part in it.
|
|
37
|
+
- Each figure keeps its own size: the config's `figureScales` holds, per pack id, the `window.scale` a figure had when another replaced it, and a figure put on takes its own back unless the size changed with it. `POST /api/prefs` takes `scale`, and `POST /api/skin` an optional `scale` to put the look on at. Saved looks keep an optional `scale` (`SavedLook.scale`); one without it goes on at its figure's own size, or at the size on screen when the figure has none.
|
|
38
|
+
- `size` is a pet action (`PET_ACTIONS`, `hoverButtons`): hovering its button shows a size slider over the body. The dressing page has a size row under the figures. Both draw the slider of `web/scale-slider.js`.
|
|
39
|
+
- A describer's `PetStatus` may carry `countdown`, the seconds a call lasts. When that call starts running (RunPhase `running`), `StatusTracker` sends `endsAt` in its place, the Date.now() milliseconds the countdown ends, and only while the call runs; the page shows the whole seconds left after `text`, out of what screen readers read. A describer that sets no `countdown` behaves as before. `waitSeconds(seconds)` is exported: how long `pet_cua_wait` waits for an argument, 0–30, 1 when absent.
|
|
40
|
+
- Sound kind `alert` (`worlds.desktop-pet.sounds.alert`, on by default) plays once as a confirmation bubble shows. Packs cannot file sounds under it.
|
|
41
|
+
- A click on a line's bubble, away from its links, ends the whole line and the page reports `skipped` with the line's id; questions and confirmations still close only by their × or an answer.
|
|
42
|
+
- While the pet window is hidden the page ticks the body with `draw` false (`tick { dt, draw }`, `step(dt, draw)`): the body moves on without drawing, so walks still arrive. `kit.createBody` honours it; a pack that ignores it draws as before.
|
|
43
|
+
- `kit.createBody(host, { ground: 'free' })` builds a body that stands anywhere on the stage above the floor, seen from above: it walks to any point, is set down where it is let go of, and a throw tosses it across the stage. Such a body reports `y` (the stage y its feet stand on) in `layout()`, in `arrived` and `interrupted`; the World keeps it with the remembered position (`petY`, hands it back as `start.y` and `init.startY`) and names it in `pet_move_to`'s receipt. `place(x, facing, y)` takes an optional `y`. Bodies without `y` behave as before.
|
|
44
|
+
- `kit.createBody` answers the pack's own targets through `opts.moves`: `{ id: (params, bounds) => ({ x, y? }) | null }`.
|
|
45
|
+
- Every body hears `set({ status })`, the kind of work the status bubble shows (or null); the kit hands it to the figure as `frame.status`.
|
|
46
|
+
- figure.json may add `voice` (`{ pitch }`, 0.5–2), sounds of kind `talk` (played letter by letter in place of the synthesized babble), `effects` (`{ reach }`, how far past its box a pack draws, in 256-unit squares, 0–2: the halo's window and the OBS overlay's capture grow by it) and `bubble` (`{ light, dark }` of `{ fill, text, line }`, on the pack or a preset) for the bot's bubbles. Older apps skip all of them; `/api/figures` lists `voice`, `effects` and `bubble`.
|
|
47
|
+
- A sound in figure.json may set `repeat`, what happens when it is asked for while its last play has not ended: `restart` fades that play out over 30 ms and plays from the start, `finish` leaves this one out, `overlap` (the default) plays over it. `talk` sounds ignore it; a value this version does not know is named in the scan's problems and plays as `overlap`. Older apps play every sound as `overlap`.
|
|
48
|
+
|
|
49
|
+
- `HOST_ENV` and `HOST_MAIN` are internal to the window host and no longer exported. Embedding apps configure the command with `CORTICO_DESKTOP_PET_HOST`.
|
|
50
|
+
- An app can lend the bot's name as `botName()` in `desktopPetDefinition`'s assembly; it is read at each use, so the menu header, the chat page (a `bot` frame) and computer use's question follow a rename without a World restart. Without it the World keeps the name it was mounted with. `DesktopPetWorldOptions.botName` and `CuaOptions.botName` are functions now.
|
|
51
|
+
- `pet_walk_to` is now `pet_move_to`, with the same `to` and `run` and an optional `params`. A bot that names the old tool has to use the new name.
|
|
52
|
+
- Figure packs may declare targets of their own for it (`moves` in figure.json): the World checks the call's params against the pack and the body does the move (`move(args, id)`), reporting `arrived` or `interrupted` as walks do. The bot reads the targets in `{{pet.moves}}` and hears of added and removed ones on a figure switch. Packs without `moves`, Coo and the whale among them, behave as before.
|
|
53
|
+
- A pack that `needs` `windows` gets the visible top edges of the other windows on the pet's display in `host.bounds().ledges`, and those windows whole in `host.bounds().windows` (front first, each with an opaque id and, except on macOS, whether it is the foreground window), on Windows, macOS and Linux under X11 (the last two not yet tried on a machine); the window process reads none for other packs. `petHost.onWindows` hands the page `{ ledges, windows }`.
|
|
54
|
+
- The window host's `--pet-url` is `http://127.0.0.1:<port>/pet#key=<credential>`, the credential random. A host set by `CORTICO_DESKTOP_PET_HOST` passes the URL on and loads it unchanged, the part after `#` included. `petUrl`, `petState().url` and the panel's links carry no credential.
|
|
55
|
+
- The pet window's socket (`host=window`) and the OBS overlay source (`role=overlay-source`) put that credential in the `/socket` query as `key`; a socket without it or with another one is answered 403.
|
|
56
|
+
- Browser writes (every method but GET and HEAD) and the WebSocket are accepted only with the service's own HTTP origin, port included (`http://127.0.0.1:<port>` or `http://localhost:<port>`); any other Origin is answered 421. A client that sends no Origin is accepted.
|
|
57
|
+
- `POST /api/figures/import/install` answers 409 with `{ conflicts: [id, …] }` when a chosen pack's id is installed or `figures/<id>/` exists, and then changes no file and keeps the staged import. The same request with the same `token` and `replace: [id, …]` naming every conflicting id replaces them. An install without conflicts takes no new field. Once an install passes these checks its token is spent.
|
|
58
|
+
|
|
59
|
+
## 0.2.0
|
|
60
|
+
|
|
61
|
+
- Needs Cortico 0.2.0 (world contract 6): the panels are declared by `webUi()`, and the panel bundle is `dist/webui.js` and `dist/webui.css`.
|
|
62
|
+
- Self-description: `describe` on the definition lists every tool, computer use included, and every event; written out to `describe.json`.
|