agent-office 0.1.0: live agent activity office page (#478)
A new community page plugin by QingJ01: Agent Office, a page in magpie's window that shows each local agent session as a worker in an office (3D/2D) or a list, with status, current step and a resume command.
- Its host part (office.hooks.mjs, an async gateway hook) reads the session files of Claude Code, Codex, dsh, Gemini CLI, Qwen Code, Pi, omp, Qoder, WorkBuddy and CodeBuddy every 1.5 s and writes page/live.js beside the page. It opens no socket and sends nothing off the machine. The page makes no magpie.read calls and loads only its own files.
- Text switch: with text off, the host writes no prompt, reply, error or tool argument (the title falls back to the folder, the step to the tool name), and the page redacts whatever live.js holds.
- Options are read at module load from plugins.json in the host's cwd (magpie's config folder), with the XDG path as a fallback. npm specs are matched with @tag/@version stripped, a path spec by realpath against the package's own folder. It fails closed: text stays off until an install's options or a request's ctx.options turn it on.
- The disclosure (package description, registry summary, root README) says which session files it reads. magpie's install sheet still says "reads nothing" for such a page (yetone/magpie#4187).
Run at the reviewed head e76d1a3, on mote:
- bun test in packages/agent-office: 44 pass, 0 fail.
- The whole repo at origin/main 3462544 merged with e76d1a3: bun test 3275 pass, 8 skip, 0 fail (HOME sandboxed); bun scripts/check.mjs exit 0.
- The new privacy tests run against 9230da7's hooks: 5 of 11 red (@latest, @0.1.0, cwd-only config, no config, unmatched spec).
- e76d1a3's case (cwd plugins.json without this entry, XDG plugins.json with text:true), by hand: text stays off. With d4acdae's hooks: text on and the prompt leaks. No test covers this case. The privacy tests stay green with it reverted.
- Real magpie: main 0745db932, built for macOS with -tags nogui, run as a portable magpie (.portable marker) in a sandbox HOME. The plugin was added from a folder named zz-src, so no name guess can match. A decoy ~/.config/magpie/plugins.json said text:true. The sandbox HOME had a seeded Claude Code session with a secret prompt, reply and Bash argument. magpie web was driven in Playwright Chromium and WebKit (WebKit in zh). With text on, the prompt, reply and command showed. With text off, the page hid them within 0.3 s. live.js went text:false after the host restarted, and over 30 s of sampling no secret was on the page or in live.js. After a reload, the switch was off and nothing leaked. The frame requested only its own files under /_magpie/plugin/<token>/, with no request leaving 127.0.0.1:3592. The plugin host had no sockets (lsof).
Not changed: the XDG fallback can read another magpie's plugins.json, but only when the host's cwd has none. magpie starts the host in its own config folder, which always has one, so a real host never reaches it.
@@ -113,6 +113,7 @@ These add a page to magpie's window, in the app and in `magpie web`, under Plugi
|
||||
| Package | Page | Reads |
|
||||
|---|---|---|
|
||||
| [usage](packages/usage) | Usage glance: calls, errors, tokens and cost for today, 7 or 30 days, and the models behind them | `usage:summary` |
|
||||
| [agent-office](packages/agent-office) | What are my agents doing: live sessions as workers in a voxel office (3D/2D) or a list, with status, current step and resume commands | no `magpie.read`; its host part reads the local session files of Claude Code, Codex, dsh, Gemini CLI, Qwen Code, Pi, omp, Qoder, WorkBuddy and CodeBuddy, including prompts, replies and tool commands (`text:false` keeps statuses and tool names only) |
|
||||
| [chat](packages/chat) | Chat with magpie's models, your MCP servers, instructions and skills, by Magic_zero ([Magiczerowxy](https://github.com/Magiczerowxy)). Has a host part: a local service the page goes to | none (its service calls magpie's gateway) |
|
||||
|
||||
```sh
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
page/live.js
|
||||
page/live.js.tmp
|
||||
node_modules/
|
||||
.DS_Store
|
||||
@@ -0,0 +1,18 @@
|
||||
# Changelog
|
||||
|
||||
## 0.1.0 · 2026-10-29
|
||||
|
||||
首个公开发布版本。First public release.
|
||||
|
||||
### Added
|
||||
|
||||
- Live session readers for Claude Code, Codex, DeepSeek Harness, Gemini CLI, Qwen Code, Pi, omp, Qoder, WorkBuddy and CodeBuddy, with a gateway-hook fallback for other agents.
|
||||
- Isometric 3D and top-down 2D office, live list, per-agent details and resume commands, plus a draggable and resizable in-page floating window.
|
||||
- Real-time statuses, current tool steps, approval requests, completed and failed sessions.
|
||||
- Varied idle gestures: stretching, glancing, leg swinging and dozing, with reduced-motion support.
|
||||
- Front-aisle sofa boarding and exit, collision-safe pathfinding, worker separation and non-overlapping name tags.
|
||||
- Correct seating orientation, monitor screens, chair backs and sitting legs for every seat.
|
||||
- Real agent icons for the agents magpie knows, English and Chinese UI, and local-only text privacy controls.
|
||||
- Furniture and seated-worker compositing, with no workers painted through sofas, cushions, backrests or consoles.
|
||||
- The page follows magpie's window background without an outer grey ring.
|
||||
- 44 automated tests covering session parsing, package safety, pathfinding, sofa compositing, orientation and idle gestures.
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 QingJ01
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,148 @@
|
||||
# Agent Office · 我的 Agent 在干嘛
|
||||
|
||||
[](https://github.com/QingJ01/magpie-agent-office/releases)
|
||||
[](https://usemagpie.ai)
|
||||
[](#test)
|
||||
[](LICENSE)
|
||||
|
||||
**一个住在 magpie 窗口里的实时 Agent 办公室。** 直接读取各 Agent 自己的会话记录,把正在思考、执行工具、等待批准或已经完成的工作,变成太空站里的小人。支持等距 3D、俯视 2D、实时列表和可拖动的悬浮小窗。
|
||||
|
||||
A live activity dashboard for your coding agents inside [magpie](https://usemagpie.ai): every session becomes a little worker in a voxel space-station office, driven by the agent's own session files rather than guesses from network traffic.
|
||||
|
||||

|
||||
|
||||
## 快速开始 · Quick start
|
||||
|
||||
```sh
|
||||
magpie plugin add @magpie-community/page-agent-office
|
||||
```
|
||||
|
||||
安装后打开 **插件 › Agent 办公室**。默认显示真实会话,不是演示数据;第一次没有会话时会看到空办公室。想预览完整效果,可在 **设置 › 示例 Agent** 临时打开示例。
|
||||
|
||||
- **3D / 2D**:等距太空站或俯视图。
|
||||
- **办公室 / 列表**:实时状态、当前步骤、目录、模型和最近活动时间。
|
||||
- **点击小人或列表行**:查看任务、最近提问、工具步骤、回复摘要和续接命令。
|
||||
- **画中画**:可拖动、可缩放的悬浮小窗,✕ 或 Esc 放回。
|
||||
|
||||
支持直接读取会话文件的 Agent:Claude Code、Codex、DeepSeek Harness、Gemini CLI、Qwen Code、Pi、omp、Qoder、WorkBuddy、CodeBuddy。其他 Agent(Cursor、OpenCode、Copilot、Kimi 等)在通过 magpie 的模型工作时也会显示。
|
||||
|
||||
**它会读取什么:** 这些 Agent 写在本机的会话文件,包括提问、回复和工具命令,并在插件自己的目录里生成 `page/live.js` 供页面显示。设置里关闭「显示提问和回复」后只保留状态与工具名,不再写入提问、回复或命令参数。
|
||||
|
||||
仓库带有 `magpie-plugin` topic,因此也会出现在 **插件 › 发现 › 非官方插件 · GitHub**。插件市场的收录进展见 [magpie-community/plugins](https://github.com/magpie-community/plugins)。
|
||||
|
||||
[功能与状态](#where-a-worker-is-is-what-it-is-doing) · [数据来源](#how-it-knows) · [隐私](#privacy) · [设置](#options) · [限制](#what-it-cannot-know) · [开发测试](#test)
|
||||
|
||||
## Where a worker is, is what it is doing
|
||||
|
||||
| Status | Where | Sign |
|
||||
|---|---|---|
|
||||
| Thinking · 思考中 | at a desk | … |
|
||||
| Running tools · 执行中 | at a desk, typing, its screen lit | spinner, how long it has run |
|
||||
| Replying · 回复中 | at a desk | lines |
|
||||
| Waiting for you · 等你回应 | in the purple square, waving | **!** |
|
||||
| Done · 已完成 | on the sofa, asleep after 20 minutes | z |
|
||||
| Error · 错误 | at the broken console | × |
|
||||
|
||||
The counts at the top are how many need you (waiting for an approval or an answer, failed, or stuck), how many are working and how many are done. Below, real sessions: DeepSeek Harness running a tool, Codex done on the sofa, the panel of the first opened by a click:
|
||||
|
||||

|
||||
|
||||
## Which way each worker faces
|
||||
|
||||
A seat says which way its owner looks: at a desk the sitter faces the desk, so the monitor stands on the desk's far edge with its lit side toward them and the chair's back behind; on the left wall's sofa they look east and on the front sofa north, away from the backrest. The head shows a face when that side is toward the camera, a profile when it is east, and the back of the head when it is away.
|
||||
|
||||
## Movement and idle gestures
|
||||
|
||||
Completed agents occasionally stretch, glance sideways, swing their legs or nod off. Their schedules differ, and these gestures pause while walking or working. The new gestures respect the system's reduced-motion preference; name tags remain steady.
|
||||
|
||||
Sofas are blocked to normal foot traffic, including the space behind their backrests. Each seat has a front approach: walk through the aisle, board from the front, then leave by that same approach. Rerouting midway through boarding first returns to the aisle. Path smoothing checks every crossed grid cell, and an unreachable destination never falls back to walking straight through furniture.
|
||||
|
||||
## How it knows
|
||||
|
||||
From each agent's **own session file**, as the agent writes it — not a guess from traffic. The plugin's host part (it runs in magpie's plugin host while magpie is open) reads them every 1.5 seconds, only what changed:
|
||||
|
||||
| Agent | File it reads |
|
||||
|---|---|
|
||||
| Claude Code | `~/.claude/projects/*/*.jsonl` |
|
||||
| Codex | `~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl` (+ `session_index.jsonl` for titles) |
|
||||
| DeepSeek Harness | `~/.dsh/sessions/*/*/session.v4.jsonl.zstd` |
|
||||
| Gemini CLI · Qwen Code | `~/.gemini/tmp/*/chats/session-*`, `~/.qwen/tmp/*/chats/session-*` |
|
||||
| Pi · omp | `~/.pi/agent/sessions/*/*.jsonl`, `~/.omp/agent/sessions/*/*.jsonl` |
|
||||
| Qoder · WorkBuddy · CodeBuddy | their `projects/*/*.jsonl` (Claude Code's format) |
|
||||
|
||||
The `*_HOME` / `*_CONFIG_DIR` variables those agents honour are honoured here too. What each file says decides the status outright: a tool call with no result yet is **running**, an approval asked (Codex's `exec_approval_request`, DeepSeek Harness's `approval/asked`, Gemini's `awaiting_approval`) is **waiting for you**, a question tool is **asked you something**, the turn's end is **done**, an interruption is **stopped**, an error turn is **error**. A turn whose file hasn't moved for ten minutes is shown as stuck.
|
||||
|
||||
Every other agent (Cursor, OpenCode, Copilot, Kimi…) shows while it works through magpie: the module is also an [asynchronous gateway hook](https://usemagpie.ai/docs/plugins#gateway-request) that sees its requests. The hook returns no body, so no request changes.
|
||||
|
||||
Both write `page/live.js` beside the page, which the page loads every second (a plugin page has no network; its own files it may load). The green **live** dot by the title turns grey if the host stops writing.
|
||||
|
||||
All 60 agents magpie knows are named with their own icons, the files magpie itself shows (`page/icons`, from magpie's assets, MIT).
|
||||
|
||||
## Using it
|
||||
|
||||
Hovering only highlights a worker. **Click** a worker, its name tag or a row in the list to open its panel — the task, the last thing you asked, the step it's on, how its answer begins, its model and folder, and **Resume command**, shown selected so ⌘C / Ctrl+C copies it — which stays at the side until you close it (✕ or Esc) or click another agent.
|
||||
|
||||
## Privacy
|
||||
|
||||
- It reads the agents' session files on this computer, only reads them, and only the last two days'. Through the gateway it records only requests made on this computer (magpie's `origin: local`) unless you set `"remote": true`.
|
||||
- `live.js` holds the agent, the session id, the folder name and path, the model, the last prompt (200 characters), the first 280 characters of the last answer, and the names and targets of the last tool calls. It never holds a key, a header or a whole conversation. With `"text": false` (Settings › Show prompts and replies, off) it keeps statuses and tool names only.
|
||||
- `live.js` stays in the plugin's folder and is never sent anywhere. The page asks magpie for no data at all: its `permissions` list is empty.
|
||||
|
||||
## Picture in picture
|
||||
|
||||
**Picture in picture** (画中画) lifts the office into a small window of the page's own, over the rest of it: drag its bar to move it, drag its corner to reshape it, click ✕ or press Esc to put it back. Only the agents that need you keep their name tags there; hover any of them for the card.
|
||||
|
||||

|
||||
|
||||
magpie frames a plugin's page with `allow=""` and `sandbox="allow-scripts"`, so the browser's own floating window (a `<video>`'s picture-in-picture, or `documentPictureInPicture`) is refused a page inside it — that was tried first, and it left nothing on screen. A window drawn in the page is not.
|
||||
|
||||

|
||||

|
||||
|
||||
## Options
|
||||
|
||||
```json
|
||||
{ "mode": "office", "dim": "3d", "demo": false, "showDone": true, "hideAfter": "6h", "text": true, "remote": false }
|
||||
```
|
||||
|
||||
| Key | |
|
||||
|---|---|
|
||||
| `mode` | `office` or `list` |
|
||||
| `dim` | `3d` or `2d` |
|
||||
| `demo` | show sample agents (Settings › Sample agents) |
|
||||
| `showDone` | keep finished agents on the sofa |
|
||||
| `hideAfter` | when a finished or failed agent leaves: `1h`, `6h`, `24h`, `never` |
|
||||
| `text` | keep prompts and replies (`false`: statuses and tool names only) |
|
||||
| `remote` | the gateway part also records requests from other computers and gateway keys |
|
||||
| `approvalAfterSec` | for an agent seen only through the gateway: how long its tools run before it counts as waiting for you (90) |
|
||||
|
||||
The page saves the first five as you change them; a change restarts the plugin's host (magpie's options do), so it waits until it has been left alone a moment.
|
||||
|
||||
## What it cannot know
|
||||
|
||||
- **An agent whose files it doesn't read and that doesn't use magpie's models.** It has no record here at all.
|
||||
- **The model's word-by-word progress.** A file is written per message, so "replying" means the session's file is moving and the model has begun its answer.
|
||||
- **Sessions older than two days**, or more than the latest 40: they are left out to keep each read cheap.
|
||||
|
||||
## Files
|
||||
|
||||
- `lib/readers.mjs` — each agent's session format turned into its phase, step, prompt and answer. No I/O.
|
||||
- `lib/scan.mjs` — finds the files in each agent's folder and rereads only the ones that changed.
|
||||
- `lib/track.mjs` — what the gateway hook keeps, from requests and replies in each API (Anthropic Messages, Chat Completions, Responses, Gemini). No I/O, so the tests drive it directly.
|
||||
- `office.hooks.mjs` — the host part: scans every 1.5 s, sees the gateway's requests, writes `page/live.js`.
|
||||
- `page/agents.js`, `page/icons/` — every agent magpie knows, with its own icon.
|
||||
- `page/model.js` — statuses, counts, words (English and Chinese), agent marks, resume commands and sample agents, with no DOM.
|
||||
- `page/scene.js` — the office, drawn on a canvas in isometric 3D or top-down 2D.
|
||||
- `page/icons.js`, `page/app.js`, `page/index.html`, `page/style.css` — the page.
|
||||
|
||||
## Test
|
||||
|
||||
```sh
|
||||
bun test
|
||||
```
|
||||
|
||||
Checked in magpie 0.1.1318's own window (`magpie web`), in every view: 3D, 2D, list, and the window of its own.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
@@ -0,0 +1,320 @@
|
||||
import { afterAll, expect, test } from "bun:test"
|
||||
import { mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync, existsSync, utimesSync } from "node:fs"
|
||||
import { tmpdir } from "node:os"
|
||||
import { join } from "node:path"
|
||||
import { createTracker, outcomeOf, replyOf } from "./lib/track.mjs"
|
||||
import { readClaude, readCodex, readDsh, readGemini, readPi, toolLine } from "./lib/readers.mjs"
|
||||
import { createScanner } from "./lib/scan.mjs"
|
||||
import * as F from "./test/fixtures.mjs"
|
||||
|
||||
const dir = import.meta.dir
|
||||
const page = join(dir, "page")
|
||||
const read = (f) => readFileSync(join(page, f), "utf8")
|
||||
const pkg = JSON.parse(readFileSync(join(dir, "package.json"), "utf8"))
|
||||
|
||||
// the page's classic scripts, as the page loads them
|
||||
const scope = {}
|
||||
new Function("globalThis", read("agents.js"))(scope)
|
||||
new Function("globalThis", read("scene.js"))(scope)
|
||||
new Function("globalThis", read("model.js"))(scope)
|
||||
const M = scope.AgentOfficeModel
|
||||
const A = scope.AgentOfficeAgents
|
||||
const { NAV, BLOCKERS, DESKS, SOFA, ZONE_SPOTS } = scope.AgentOfficeScene
|
||||
|
||||
// every point of a way, sampled, is on a floor one may stand on
|
||||
const walkable = (pts) => {
|
||||
for (let i = 0; i < pts.length - 1; i++) {
|
||||
const [ax, ay] = pts[i], [bx, by] = pts[i + 1]
|
||||
const n = Math.ceil(Math.hypot(bx - ax, by - ay) / 0.1)
|
||||
for (let k = 0; k <= n; k++) {
|
||||
const x = ax + ((bx - ax) * k) / n, y = ay + ((by - ay) * k) / n
|
||||
if (!NAV.freeAt(x, y)) return `blocked at ${x.toFixed(2)},${y.toFixed(2)}`
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
const inside = ([x, y], [bx, by, bw, bd]) => x >= bx && x <= bx + bw && y >= by && y <= by + bd
|
||||
|
||||
const tmps = []
|
||||
const tmp = () => { const d = mkdtempSync(join(tmpdir(), "agent-office-")); tmps.push(d); return d }
|
||||
afterAll(() => { for (const d of tmps) rmSync(d, { recursive: true, force: true }) })
|
||||
|
||||
// ---- the package --------------------------------------------------------
|
||||
|
||||
test("a page magpie serves, with a host part and no reads", () => {
|
||||
expect(pkg.name).toBe("@magpie-community/page-agent-office")
|
||||
expect(pkg.main).toBeUndefined()
|
||||
expect(pkg.magpie.page.file).toBe("page/index.html")
|
||||
expect(pkg.magpie.hooks).toBe("./office.hooks.mjs")
|
||||
expect(pkg.magpie.permissions).toEqual([])
|
||||
const html = read("index.html")
|
||||
expect(html).toContain('<script src="_magpie/bridge.js"></script>')
|
||||
for (const m of html.matchAll(/<script([^>]*)>([\s\S]*?)<\/script>/g)) {
|
||||
expect(m[1]).toMatch(/\ssrc="/)
|
||||
expect(m[2].trim()).toBe("")
|
||||
}
|
||||
for (const m of html.matchAll(/(?:src|href)="([^"]+)"/g)) {
|
||||
if (m[1].startsWith("_magpie/")) continue
|
||||
expect(readdirSync(page)).toContain(m[1])
|
||||
}
|
||||
for (const f of ["index.html", "style.css", "agents.js", "model.js", "icons.js", "scene.js", "app.js", "icon.svg"]) expect(pkg.files).toContain(`page/${f}`)
|
||||
for (const f of ["page/icons", "lib", "office.hooks.mjs"]) expect(pkg.files).toContain(f)
|
||||
// screenshots are linked from GitHub: an install needs none of them
|
||||
expect(pkg.files).not.toContain("docs")
|
||||
expect(new Set(pkg.files).size).toBe(pkg.files.length)
|
||||
for (const m of readFileSync(join(dir, "README.md"), "utf8").matchAll(/!\[[^\]]*\]\(([^)]+)\)/g)) {
|
||||
// badges and screenshots are remote: nothing relative ships in the install
|
||||
expect(m[1]).toMatch(/^https:\/\//)
|
||||
expect(m[1]).not.toMatch(/^docs\//)
|
||||
}
|
||||
})
|
||||
|
||||
test("the page hides text itself when the switch is off", () => {
|
||||
const [a, b] = M.redact([
|
||||
{ title: "SECRET-TITLE", project: "secret-project", query: "SECRET-QUERY", reply: "SECRET-REPLY", error: "SECRET-ERROR", step: "Bash · SECRET-CMD curl x", brand: { name: "Claude" }, agent: "claude" },
|
||||
{ title: "SECRET-TITLE", project: "", query: "q", reply: "r", error: "e", step: "SECRET-CMD curl x", brand: { name: "Codex" }, agent: "codex" },
|
||||
])
|
||||
expect(a).toMatchObject({ title: "secret-project", query: "", reply: "", error: "", step: "Bash" })
|
||||
expect(b).toMatchObject({ title: "Codex", query: "", reply: "", error: "", step: "" })
|
||||
expect(read("app.js")).toContain("M.redact")
|
||||
})
|
||||
|
||||
test("the page reaches no clipboard API it cannot have", () => {
|
||||
const src = read("app.js")
|
||||
expect(src).not.toContain("navigator.clipboard")
|
||||
expect(src).not.toContain("execCommand")
|
||||
})
|
||||
|
||||
test("the page reads nothing of magpie's and reaches no network", () => {
|
||||
for (const f of readdirSync(page).filter((f) => f.endsWith(".js") && f !== "live.js")) {
|
||||
const src = read(f)
|
||||
expect(src).not.toMatch(/magpie\.read\(/)
|
||||
expect(src).not.toMatch(/\bfetch\(|XMLHttpRequest|WebSocket|sendBeacon|EventSource|importScripts|new Worker/)
|
||||
}
|
||||
})
|
||||
|
||||
test("every agent magpie knows, each with its own icon file", () => {
|
||||
const ids = Object.keys(A)
|
||||
expect(ids.length).toBeGreaterThanOrEqual(50)
|
||||
for (const id of ["claude", "codex", "gemini", "dsh", "grok", "agy", "cursor", "copilot", "opencode", "pi", "qwen", "kimi", "cline", "droid", "qoder", "workbuddy", "codebuddy", "zed", "hermes", "goose", "crush", "devin"]) {
|
||||
expect(A[id]).toBeDefined()
|
||||
}
|
||||
const icons = new Set(readdirSync(join(page, "icons")))
|
||||
let withIcon = 0
|
||||
for (const [id, a] of Object.entries(A)) if (a.icon) { expect(icons.has(a.icon)).toBe(true); withIcon++ }
|
||||
expect(withIcon).toBeGreaterThanOrEqual(50)
|
||||
expect(M.brand("claude")).toMatchObject({ name: "Claude Code", icon: "claudecode-color.svg" })
|
||||
expect(M.brand("codex").icon).toBe("codex-color.svg")
|
||||
expect(M.brand("dsh")).toMatchObject({ name: "DeepSeek Harness", icon: "deepseek-color.svg" })
|
||||
expect(M.brand("someone-new")).toMatchObject({ name: "someone-new", icon: "" })
|
||||
})
|
||||
|
||||
// ---- the agents' own files ---------------------------------------------
|
||||
|
||||
test("Claude Code: a tool out, then done; a question; an interruption", () => {
|
||||
const r = readClaude(F.claudeRunning)
|
||||
expect(r).toMatchObject({ phase: "tool", step: "Edit · /Users/me/app/a.ts", title: "Fix failing test", query: "fix the failing test", model: "claude-opus-5", project: "app", turns: 1 })
|
||||
expect(r.pending.map((p) => p.id)).toEqual(["t2"])
|
||||
const d = readClaude(F.claudeDone)
|
||||
expect(d).toMatchObject({ phase: "done", reply: "Fixed: the date was parsed in UTC." })
|
||||
expect(d.pending).toEqual([])
|
||||
expect(readClaude(F.claudeAsks).phase).toBe("ask")
|
||||
expect(readClaude(F.claudeInterrupted).phase).toBe("aborted")
|
||||
})
|
||||
|
||||
test("Codex: a running tool, an approval, done, aborted; its own prompts only", () => {
|
||||
const r = readCodex(F.codexRunning)
|
||||
expect(r).toMatchObject({ id: "019a-x", phase: "tool", model: "gpt-6.1-terra", project: "blog", query: "export the doc as markdown" })
|
||||
expect(r.step).toBe("exec · pandoc in.docx -o out.md")
|
||||
expect(readCodex(F.codexApproval)).toMatchObject({ phase: "approval", step: "shell · rm -rf dist" })
|
||||
expect(readCodex(F.codexDone)).toMatchObject({ phase: "done", reply: "Exported to out.md." })
|
||||
expect(readCodex(F.codexAborted).phase).toBe("aborted")
|
||||
})
|
||||
|
||||
test("DeepSeek Harness: an approval asked, then an error", () => {
|
||||
const r = readDsh(F.dshApproval)
|
||||
expect(r).toMatchObject({ id: "session-d1", phase: "approval", title: "Deploy the site", model: "deepseek-flash", query: "deploy to cloudflare", project: "site" })
|
||||
expect(r.step).toBe("bash · wrangler pages deploy ./dist")
|
||||
expect(readDsh(F.dshError)).toMatchObject({ phase: "error", error: "429: usage limit reached" })
|
||||
})
|
||||
|
||||
test("Gemini CLI and Pi", () => {
|
||||
expect(readGemini(F.geminiApproval)).toMatchObject({ phase: "approval", query: "align the chorus to 120 BPM", model: "gemini-3-pro" })
|
||||
expect(readPi(F.piDone)).toMatchObject({ phase: "done", reply: "Done: 12 tools, 5 ideas.", project: "notes" })
|
||||
})
|
||||
|
||||
test("a tool line reads like what it does", () => {
|
||||
expect(toolLine("Bash", { command: "bun test" })).toBe("Bash · bun test")
|
||||
expect(toolLine("exec", 'text(await tools.exec_command({cmd:"rg -n foo"}))')).toBe("exec · rg -n foo")
|
||||
expect(toolLine("shell", { command: ["git", "status"] })).toBe("shell · git status")
|
||||
})
|
||||
|
||||
test("the scanner reads each agent's folder, and only what changed", () => {
|
||||
const h = tmp()
|
||||
const cl = join(h, ".claude", "projects", "-Users-me-app")
|
||||
const cx = join(h, ".codex", "sessions", "2026", "10", "28")
|
||||
mkdirSync(cl, { recursive: true }); mkdirSync(cx, { recursive: true })
|
||||
writeFileSync(join(cl, "c1.jsonl"), F.claudeRunning)
|
||||
writeFileSync(join(cx, "rollout-2026-10-28T10-00-00-019a0000-0000-7000-8000-000000000001.jsonl"), F.codexApproval)
|
||||
const src = [
|
||||
{ agent: "claude", kind: "claude", root: join(h, ".claude", "projects"), depth: 1, match: (n) => n.endsWith(".jsonl") },
|
||||
{ agent: "codex", kind: "codex", root: join(h, ".codex", "sessions"), depth: 3, match: (n) => n.startsWith("rollout-") },
|
||||
]
|
||||
const sc = createScanner({ sources: src, days: 2 })
|
||||
const now = Date.now()
|
||||
let got = sc.scan(now)
|
||||
expect(got.map((s) => [s.agent, s.phase]).sort()).toEqual([["claude", "tool"], ["codex", "approval"]])
|
||||
// the agent writes on: the scanner reads the file again
|
||||
writeFileSync(join(cl, "c1.jsonl"), F.claudeDone)
|
||||
got = sc.scan(now + 1000)
|
||||
expect(got.find((s) => s.agent === "claude").phase).toBe("done")
|
||||
})
|
||||
|
||||
test("an active dsh session is decompressed only once per interval", () => {
|
||||
const h = tmp()
|
||||
const sd = join(h, "sessions", "--Users-me-site--", "session-z")
|
||||
mkdirSync(sd, { recursive: true })
|
||||
const file = join(sd, "session.v4.jsonl.zstd")
|
||||
const enc = (t) => new TextEncoder().encode(t)
|
||||
writeFileSync(file, Bun.zstdCompressSync(enc(F.dshApproval)))
|
||||
const sc = createScanner({
|
||||
sources: [{ agent: "dsh", kind: "dsh", root: join(h, "sessions"), depth: 2, match: (n) => n.endsWith(".zstd") }],
|
||||
days: 2,
|
||||
zstdEvery: 60000,
|
||||
})
|
||||
const now = Date.now()
|
||||
const orig = Bun.zstdDecompressSync
|
||||
let decodes = 0
|
||||
Bun.zstdDecompressSync = (...a) => { decodes++; return orig(...a) }
|
||||
try {
|
||||
let got = sc.scan(now)
|
||||
expect(decodes).toBe(1)
|
||||
expect(got[0].phase).toBe("approval")
|
||||
// the agent writes on: within the interval the last facts stand
|
||||
writeFileSync(file, Bun.zstdCompressSync(enc(F.dshError)))
|
||||
utimesSync(file, (now + 20000) / 1000, (now + 20000) / 1000)
|
||||
got = sc.scan(now + 1500)
|
||||
expect(decodes).toBe(1)
|
||||
expect(got[0].phase).toBe("approval")
|
||||
expect(got[0].touched).toBeGreaterThan(now)
|
||||
// once the interval has passed it reads the new state
|
||||
utimesSync(file, (now + 30000) / 1000, (now + 30000) / 1000)
|
||||
got = sc.scan(now + 62000)
|
||||
expect(decodes).toBe(2)
|
||||
expect(got[0].phase).toBe("error")
|
||||
} finally { Bun.zstdDecompressSync = orig }
|
||||
})
|
||||
|
||||
// ---- walking -------------------------------------------------------------
|
||||
|
||||
test("a worker walks around the desks, not through them", () => {
|
||||
// from the airlock door to the far desk seat and to the sofa
|
||||
const door = [0.6, 2.6]
|
||||
for (const seat of [...DESKS.map((d) => d.seat), ...SOFA, ...ZONE_SPOTS]) {
|
||||
const pts = NAV.path(door, [seat[0], seat[1]])
|
||||
expect(pts.length).toBeGreaterThan(0)
|
||||
const floorPath = pts.filter(p => p[2] === undefined)
|
||||
const bad = walkable([[door[0], door[1]], ...floorPath])
|
||||
expect(bad).toBe("")
|
||||
// Boarding is tested separately: it approaches perpendicular to the seat.
|
||||
expect(pts[pts.length - 1].slice(0, 2)).toEqual([seat[0], seat[1]])
|
||||
}
|
||||
// no way crosses a desk's body
|
||||
const pts = NAV.path([0.6, 2.6], [11.4, 6.75])
|
||||
for (const [x, y] of pts) for (const b of BLOCKERS) expect(inside([x, y], b)).toBe(false)
|
||||
})
|
||||
|
||||
test("a way is no longer than it has to be, and a straight line stays straight", () => {
|
||||
const direct = NAV.path([7.0, 8.6], [9.6, 8.6])
|
||||
expect(direct.length).toBe(1)
|
||||
const around = NAV.path([0.6, 2.6], [15.0, 11.0])
|
||||
expect(around.length).toBeGreaterThan(1)
|
||||
const len = (pts) => { let d = 0; let p = [0.6, 2.6]; for (const q of pts) { d += Math.hypot(q[0] - p[0], q[1] - p[1]); p = q } return d }
|
||||
// no wild detour: the straight line is 18.6
|
||||
expect(len(around)).toBeLessThan(18.6 * 1.9)
|
||||
})
|
||||
|
||||
// ---- the page's model ---------------------------------------------------
|
||||
|
||||
const S = (phase, extra = {}) => ({ key: "claude|x", source: "files", agent: "claude", session: "x", phase, touched: 0, updated: 0, ...extra })
|
||||
|
||||
test("statuses come from the file's own phase", () => {
|
||||
const now = 1_000_000
|
||||
expect(M.state(S("tool", { touched: now - 5000 }), now)).toEqual({ status: "executing", sub: "" })
|
||||
expect(M.state(S("approval", { touched: now - 600e3 }), now)).toEqual({ status: "waiting", sub: "approval" })
|
||||
expect(M.state(S("ask"), now)).toEqual({ status: "waiting", sub: "ask" })
|
||||
expect(M.state(S("done"), now)).toEqual({ status: "done", sub: "" })
|
||||
expect(M.state(S("aborted"), now)).toEqual({ status: "done", sub: "stopped" })
|
||||
expect(M.state(S("error"), now)).toEqual({ status: "error", sub: "" })
|
||||
expect(M.state(S("thinking", { touched: now - 1000 }), now).status).toBe("thinking")
|
||||
// the model writing its answer: the file moves and there is text
|
||||
expect(M.state(S("thinking", { touched: now - 1000, reply: "So far…" }), now).status).toBe("replying")
|
||||
// a turn whose file hasn't moved for ten minutes is stuck
|
||||
expect(M.state(S("tool", { touched: now - 11 * 60e3 }), now)).toEqual({ status: "error", sub: "stuck" })
|
||||
})
|
||||
|
||||
test("the office's agents, counts and resume commands", () => {
|
||||
const now = 10_000_000
|
||||
const list = M.agents(M.demo(now), now)
|
||||
expect(list.length).toBe(7)
|
||||
expect(M.counts(list)).toEqual({ needYou: 3, working: 2, done: 2 })
|
||||
expect(list.find((a) => a.title === "站点部署")).toMatchObject({ status: "waiting", sub: "approval" })
|
||||
expect(M.sorted(list)[0].status).toBe("waiting")
|
||||
expect(M.agents(M.demo(now), now + 7 * 3600e3, { hideAfter: "6h" }).every((a) => a.status !== "done")).toBe(true)
|
||||
expect(M.resume({ agent: "claude", session: "abc", cwd: "/a b" })).toBe("cd '/a b' && claude --resume abc")
|
||||
expect(M.resume({ agent: "codex", session: "019a", cwd: "/x" })).toBe("cd /x && codex resume 019a")
|
||||
expect(M.resume({ agent: "dsh", session: "session-1d68", cwd: "/x" })).toBe("cd /x && dsh --resume 1d68")
|
||||
expect(M.resume({ agent: "unknown", session: "x" })).toBe("")
|
||||
})
|
||||
|
||||
test("sample agents sit beside real ones, never instead of them", () => {
|
||||
const now = 10_000_000
|
||||
const real = { sessions: [S("tool", { key: "claude|real", title: "real work", touched: now - 1000 })] }
|
||||
const both = M.merge(real, M.demo(now))
|
||||
expect(both.sessions[0].key).toBe("claude|real")
|
||||
expect(M.agents(both, now).some((a) => a.title === "real work")).toBe(true)
|
||||
})
|
||||
|
||||
test("words, in English and Chinese", () => {
|
||||
expect(M.text("zh-CN").title).toBe("我的 Agent 在干嘛")
|
||||
expect(Object.keys(M.TEXT.zh).sort()).toEqual(Object.keys(M.TEXT.en).sort())
|
||||
for (const e of read("index.html").matchAll(/data-t="([^"]+)"/g)) expect(M.TEXT.en[e[1]]).toBeDefined()
|
||||
expect(M.ago(28 * 60e3, "zh")).toBe("28分钟前")
|
||||
expect(M.duration(130e3, "en")).toBe("2m 10s")
|
||||
})
|
||||
|
||||
// ---- the host part --------------------------------------------------------
|
||||
|
||||
test("the host part writes what it reads, and changes no request", async () => {
|
||||
const out = tmp()
|
||||
process.env.MAGPIE_AGENT_OFFICE_PAGE = out
|
||||
const hook = await import("./office.hooks.mjs")
|
||||
const h = tmp()
|
||||
const cl = join(h, "projects", "-Users-me-app")
|
||||
mkdirSync(cl, { recursive: true })
|
||||
writeFileSync(join(cl, "c1.jsonl"), F.claudeRunning)
|
||||
hook.start({ text: true, scanner: { sources: [{ agent: "claude", kind: "claude", root: join(h, "projects"), depth: 1, match: (n) => n.endsWith(".jsonl") }] } })
|
||||
hook.stop()
|
||||
const c = { origin: "local", protocol: "anthropic", agent: "cursor", session: "cu1", cwd: "/x", model: "m", query: "hi", options: {}, state: {}, report() {} }
|
||||
expect(await hook.onRequest({ model: "m", tools: [{ name: "x" }], messages: [{ role: "user", content: "hi" }] }, c)).toBeUndefined()
|
||||
hook.write()
|
||||
const live = readFileSync(join(out, "live.js"), "utf8")
|
||||
const snap = JSON.parse(live.slice("globalThis.AgentOfficeLive = ".length).replace(/;\s*$/, ""))
|
||||
const claude = snap.sessions.find((s) => s.agent === "claude")
|
||||
expect(claude).toMatchObject({ source: "files", phase: "tool", title: "Fix failing test" })
|
||||
// an agent whose files aren't read shows from the gateway
|
||||
expect(snap.sessions.find((s) => s.agent === "cursor")?.source).toBe("gateway")
|
||||
expect(live).not.toMatch(/authorization|x-api-key/i)
|
||||
})
|
||||
|
||||
test("the gateway part still reads replies in each API", () => {
|
||||
expect(outcomeOf(replyOf({ role: "assistant", content: [{ type: "text", text: "Which one?" }] }, "anthropic"))).toBe("ask")
|
||||
expect(outcomeOf(replyOf({ output: [{ type: "function_call", name: "shell", arguments: "{}" }] }, "responses"))).toBe("tools")
|
||||
const t = createTracker()
|
||||
expect(t.request({ model: "m", tools: [1], messages: [{ role: "user", content: "x" }] }, { origin: "remote", agent: "a", session: "s" }, 1)).toBeNull()
|
||||
})
|
||||
|
||||
test("live.js is no file of the package's", () => {
|
||||
expect(pkg.files.some((f) => f.includes("live"))).toBe(false)
|
||||
expect(readFileSync(join(dir, ".gitignore"), "utf8")).toContain("page/live.js")
|
||||
})
|
||||
|
After Width: | Height: | Size: 471 KiB |
|
After Width: | Height: | Size: 124 KiB |
|
After Width: | Height: | Size: 119 KiB |
|
After Width: | Height: | Size: 182 KiB |
|
After Width: | Height: | Size: 194 KiB |
@@ -0,0 +1,93 @@
|
||||
import { test, expect } from 'bun:test'
|
||||
import { readFileSync } from 'node:fs'
|
||||
const scope = {}
|
||||
new Function('globalThis', readFileSync(new URL('./page/scene.js', import.meta.url), 'utf8'))(scope)
|
||||
const { Scene, DESKS, SOFA, SOFA_FACE } = scope.AgentOfficeScene
|
||||
const V = { n: [0, -1], s: [0, 1], e: [1, 0], w: [-1, 0] }
|
||||
const dot = (a, b) => a[0] * b[0] + a[1] * b[1]
|
||||
|
||||
// A seat's facing must point at what its owner is meant to look at.
|
||||
test('every desk seat faces its own desk, and island pairs face each other', () => {
|
||||
for (const d of DESKS) {
|
||||
const v = V[d.face]
|
||||
const mid = [d.x + d.w / 2, d.y + d.d / 2]
|
||||
const toDesk = [mid[0] - d.seat[0], mid[1] - d.seat[1]]
|
||||
expect(dot(v, toDesk)).toBeGreaterThan(0.2)
|
||||
}
|
||||
const north = DESKS[4], south = DESKS[6]
|
||||
expect(dot(V[north.face], V[south.face])).toBe(-1)
|
||||
})
|
||||
|
||||
test('a sofa sitter faces away from the backrest', () => {
|
||||
expect(SOFA_FACE.length).toBe(SOFA.length)
|
||||
for (let i = 0; i < SOFA.length; i++) {
|
||||
const [x, y] = SOFA[i]
|
||||
const v = V[SOFA_FACE[i]]
|
||||
// left sofa: backrest at x .35-.75; front sofa: backrest at y 11.35-11.7
|
||||
const back = i < 5 ? [0.55, y] : [x, 11.5]
|
||||
expect(dot(v, [x - back[0], y - back[1]])).toBeGreaterThan(0.2)
|
||||
}
|
||||
})
|
||||
|
||||
// The monitor's lit side and the chair's back are drawn from the facing.
|
||||
const fakeCtx = () => new Proxy({}, {
|
||||
get: (o, k) => (k in o ? o[k] : k === 'createLinearGradient' ? () => ({ addColorStop() {} })
|
||||
: k === 'measureText' ? () => ({ width: 0 }) : () => {}),
|
||||
set: (o, k, v) => { o[k] = v; return true },
|
||||
})
|
||||
function spy(dim) {
|
||||
const s = Object.create(Scene.prototype)
|
||||
Object.assign(s, { dim, atSeat: {}, workers: new Map(), t: 0, s: 40, ox: 0, oy: 0, g: fakeCtx() })
|
||||
for (const name of ['box', 'poly', 'onFront', 'onBack', 'onLeft', 'onRight']) s[name] = () => {}
|
||||
s.depth = (x, y) => x + y
|
||||
s.P = (x, y, z = 0) => [x - y, x + y - z]
|
||||
return s
|
||||
}
|
||||
test('monitor screen faces the sitter and the chair back stands behind', () => {
|
||||
for (const d of DESKS) {
|
||||
const s = spy('3d')
|
||||
const faces = []
|
||||
s.onFront = () => faces.push('front')
|
||||
s.onBack = () => faces.push('back')
|
||||
const boxes = []
|
||||
s.box = (...a) => boxes.push(a)
|
||||
// the chair is a drawable of its own: run those too
|
||||
const chairKey = s.depth(d.seat[0], d.seat[1])
|
||||
const rest = s.props().filter((p) => p.k >= chairKey - 0.45 && p.k <= chairKey + 0.5)
|
||||
const props = s.props()
|
||||
const key = s.depth(d.x + d.w / 2, d.y + d.d)
|
||||
const deskProp = props.find((p) => Math.abs(p.k - key) < 1e-9)
|
||||
expect(deskProp).toBeDefined()
|
||||
deskProp.fn()
|
||||
const screenSide = faces[0]
|
||||
expect(screenSide).toBe(d.face === 's' ? 'back' : 'front')
|
||||
// chair back: a 0.1-deep slab behind the sitter, on the opposite side
|
||||
const cy = d.seat[1]
|
||||
for (const p of rest) p.fn()
|
||||
const chairBack = boxes.find(([x, y, z, w, h, hh]) => Math.abs(w - 0.56) < 1e-6 && Math.abs(h - 0.1) < 1e-6 && hh > 0.4)
|
||||
expect(chairBack).toBeDefined()
|
||||
const backY = chairBack[1]
|
||||
if (d.face === 'n') expect(backY).toBeGreaterThan(cy)
|
||||
else expect(backY).toBeLessThan(cy)
|
||||
}
|
||||
})
|
||||
|
||||
test('a sitter facing away shows no face; facing east shows the profile', () => {
|
||||
const draw = (facing) => {
|
||||
const s = spy('3d')
|
||||
const calls = []
|
||||
for (const n of ['onFront', 'onBack', 'onLeft', 'onRight']) s[n] = (...a) => calls.push([n, a[a.length - 1]])
|
||||
const w = { key: 'k', x: 4, y: 6, kind: 'sofa', slot: 0, walking: false, facing, phase: 0, skin: '#fff', hair: '#000', pants: '#000', color: '#f00',
|
||||
a: { status: 'done', seed: 3, brand: { color: '#f00' } } }
|
||||
s.worker(w)
|
||||
return calls
|
||||
}
|
||||
// dark eye pixels only get drawn toward the camera (+y) or east (+x)
|
||||
const eyesOn = (calls) => calls.filter(([, c]) => c === '#1f2937')
|
||||
expect(eyesOn(draw('s')).length).toBe(2)
|
||||
const east = eyesOn(draw('e'))
|
||||
expect(east.length).toBe(2)
|
||||
expect(east.every(([n]) => n === 'onRight')).toBe(true)
|
||||
expect(eyesOn(draw('n')).length).toBe(0)
|
||||
expect(eyesOn(draw('w')).length).toBe(0)
|
||||
})
|
||||
@@ -0,0 +1,353 @@
|
||||
// What each agent is really doing, read from the session files the agents
|
||||
// themselves write, as they write them: Claude Code's, Codex's, DeepSeek
|
||||
// Harness's, Gemini CLI's, Qwen Code's, Pi's and omp's, and any agent that
|
||||
// keeps Claude Code's format (Qoder, WorkBuddy, CodeBuddy). Every agent's
|
||||
// own record, whatever model it talks to: one that never passes magpie's
|
||||
// gateway is seen as well as one that does.
|
||||
//
|
||||
// Pure: a reader takes a file's text (its tail) and gives a session's facts.
|
||||
// No clock of its own, no I/O; lib/scan.mjs finds and reads the files.
|
||||
//
|
||||
// A session's facts: { agent, id, cwd, title, query, model, started, updated,
|
||||
// phase, step, reply, pending, error, turns }
|
||||
// phase is what its own record last said:
|
||||
// "thinking" a turn is under way, the model has the word
|
||||
// "tool" a tool call it made has no result yet
|
||||
// "approval" it asked to run something and waits for the user's yes
|
||||
// "ask" it asked the user a question and waits for the answer
|
||||
// "done" its turn ended
|
||||
// "aborted" the user stopped it
|
||||
// "error" its turn ended on an error
|
||||
|
||||
export const TEXT_MAX = 280
|
||||
export const QUERY_MAX = 200
|
||||
export const TITLE_MAX = 48
|
||||
|
||||
export function clip(s, n) {
|
||||
s = String(s ?? "").replace(/\s+/g, " ").trim()
|
||||
return s.length > n ? s.slice(0, n - 1).trimEnd() + "…" : s
|
||||
}
|
||||
|
||||
const ASK_TOOLS = /^(?:askuserquestion|ask_?user(?:_?question)?|request_?user_?input|ask_?followup_?question|ask_?human|exitplanmode|exit_plan_mode|user_?input|ask_user_question)$/i
|
||||
|
||||
function parseArgs(a) {
|
||||
if (a && typeof a === "object") return a
|
||||
try { return JSON.parse(a) } catch { return typeof a === "string" ? { input: a } : {} }
|
||||
}
|
||||
|
||||
// a tool call as a person reads it: "Bash · npm test"
|
||||
export function toolLine(name, args) {
|
||||
const a = parseArgs(args)
|
||||
const cmd = Array.isArray(a.command) ? a.command.join(" ") : a.command ?? a.cmd
|
||||
let what = cmd ?? a.file_path ?? a.path ?? a.filePath ?? a.pattern ?? a.query ?? a.url ?? a.description ?? a.title ?? a.prompt ?? a.code ?? a.input ?? ""
|
||||
if (typeof what !== "string") what = JSON.stringify(what)
|
||||
// Codex's code mode wraps a command in JS: show the command
|
||||
const inner = /exec_command\(\{\s*cmd:\s*"((?:[^"\\]|\\.)*)"/.exec(what)
|
||||
if (inner) what = inner[1].replace(/\\"/g, '"')
|
||||
const s = clip(what, 90)
|
||||
return s ? `${name} · ${s}` : String(name)
|
||||
}
|
||||
|
||||
function lines(text) {
|
||||
const out = []
|
||||
for (const l of String(text).split("\n")) {
|
||||
if (!l || l[0] !== "{") continue
|
||||
try { out.push(JSON.parse(l)) } catch {}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
function ms(t) {
|
||||
if (typeof t === "number") return t < 1e12 ? t * 1000 : t
|
||||
const n = Date.parse(t)
|
||||
return Number.isFinite(n) ? n : 0
|
||||
}
|
||||
|
||||
function textOf(content) {
|
||||
if (typeof content === "string") return content
|
||||
if (!Array.isArray(content)) return ""
|
||||
return content.map((c) => (typeof c === "string" ? c : c && (c.type === "text" || c.type === "input_text" || c.type === "output_text") ? c.text || "" : "")).filter(Boolean).join("\n")
|
||||
}
|
||||
|
||||
// what a person typed, not what the agent's harness wraps around it
|
||||
function realPrompt(t) {
|
||||
t = String(t ?? "").trim()
|
||||
if (!t) return ""
|
||||
// what the agent put in itself: the environment, instructions, AGENTS.md
|
||||
if (t.startsWith("<") || t.startsWith("# AGENTS.md") || t.startsWith("# Files mentioned by the user")) return ""
|
||||
if (/^\[Request interrupted/.test(t)) return ""
|
||||
if (/^Caveat: The messages below/.test(t)) return ""
|
||||
return t
|
||||
}
|
||||
|
||||
function base(p) {
|
||||
const s = String(p ?? "").replace(/[\\/]+$/, "")
|
||||
return s.slice(Math.max(s.lastIndexOf("/"), s.lastIndexOf("\\")) + 1)
|
||||
}
|
||||
|
||||
function fresh(agent, id) {
|
||||
return { agent, id, cwd: "", project: "", title: "", query: "", model: "", started: 0, updated: 0,
|
||||
phase: "", step: "", stepName: "", reply: "", pending: [], error: "", turns: 0 }
|
||||
}
|
||||
|
||||
function touch(s, t) {
|
||||
if (!t) return
|
||||
if (!s.started || t < s.started) s.started = t
|
||||
if (t > s.updated) s.updated = t
|
||||
}
|
||||
|
||||
function prompted(s, text, t) {
|
||||
const q = realPrompt(text)
|
||||
if (!q) return false
|
||||
s.query = clip(q, QUERY_MAX)
|
||||
if (!s.title) s.title = clip(q, TITLE_MAX)
|
||||
s.turns++
|
||||
s.phase = "thinking"
|
||||
s.reply = ""
|
||||
s.error = ""
|
||||
s.pending = []
|
||||
touch(s, t)
|
||||
return true
|
||||
}
|
||||
|
||||
function called(s, id, name, args, t) {
|
||||
const line = toolLine(name, args)
|
||||
s.pending.push({ id: String(id || line), name: String(name), line, at: t })
|
||||
s.step = line
|
||||
s.stepName = String(name)
|
||||
s.phase = ASK_TOOLS.test(name) ? "ask" : "tool"
|
||||
touch(s, t)
|
||||
}
|
||||
|
||||
function answered(s, id, t) {
|
||||
const i = s.pending.findIndex((p) => p.id === String(id))
|
||||
if (i >= 0) s.pending.splice(i, 1)
|
||||
else if (!id) s.pending.shift()
|
||||
if (!s.pending.length && (s.phase === "tool" || s.phase === "approval" || s.phase === "ask")) s.phase = "thinking"
|
||||
touch(s, t)
|
||||
}
|
||||
|
||||
// ---- Claude Code (and the agents that keep its format) ---------------------
|
||||
// ~/.claude/projects/<folder>/<session>.jsonl: one line per message; an
|
||||
// assistant message with tool_use blocks, then a user message whose
|
||||
// tool_result blocks answer them; stop_reason "end_turn" ends the turn.
|
||||
export function readClaude(text, agent = "claude", id = "") {
|
||||
const s = fresh(agent, id)
|
||||
for (const d of lines(text)) {
|
||||
const t = ms(d.timestamp)
|
||||
if (d.sessionId && !s.id) s.id = d.sessionId
|
||||
if (d.cwd) { s.cwd = d.cwd; s.project = base(d.cwd) }
|
||||
if (d.type === "custom-title" && d.customTitle) { s.title = clip(d.customTitle, TITLE_MAX); s.named = true }
|
||||
else if (d.type === "ai-title" && d.aiTitle && !s.named) s.title = clip(d.aiTitle, TITLE_MAX)
|
||||
if (d.isSidechain) continue
|
||||
const m = d.message
|
||||
if (!m) continue
|
||||
if (d.type === "user" && m.role === "user") {
|
||||
if (Array.isArray(m.content)) {
|
||||
let results = 0
|
||||
for (const b of m.content) if (b?.type === "tool_result") { answered(s, b.tool_use_id, t); results++ }
|
||||
if (results) continue
|
||||
const txt = textOf(m.content)
|
||||
if (/^\[Request interrupted/.test(txt.trim())) { s.phase = "aborted"; s.pending = []; touch(s, t); continue }
|
||||
if (!d.isMeta) prompted(s, txt, t)
|
||||
} else if (!d.isMeta) {
|
||||
if (/^\[Request interrupted/.test(String(m.content).trim())) { s.phase = "aborted"; s.pending = []; touch(s, t); continue }
|
||||
prompted(s, m.content, t)
|
||||
}
|
||||
continue
|
||||
}
|
||||
if (d.type === "assistant" && m.role === "assistant") {
|
||||
if (m.model && m.model !== "<synthetic>") s.model = m.model
|
||||
const blocks = Array.isArray(m.content) ? m.content : []
|
||||
const txt = blocks.filter((b) => b?.type === "text").map((b) => b.text).join("\n").trim()
|
||||
if (txt) s.reply = clip(txt, TEXT_MAX)
|
||||
for (const b of blocks) if (b?.type === "tool_use") called(s, b.id, b.name, b.input, t)
|
||||
if (d.isApiErrorMessage) { s.phase = "error"; s.error = clip(txt, 160); s.pending = [] }
|
||||
else if (m.stop_reason === "end_turn" || m.stop_reason === "stop_sequence") { s.phase = "done"; s.pending = [] }
|
||||
else if (!blocks.some((b) => b?.type === "tool_use") && s.phase !== "tool") s.phase = "thinking"
|
||||
touch(s, t)
|
||||
}
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
// ---- Codex ----------------------------------------------------------------
|
||||
// ~/.codex/sessions/YYYY/MM/DD/rollout-…-<thread>.jsonl: session_meta, then
|
||||
// response_items (messages, function_call / custom_tool_call and their
|
||||
// outputs) and event_msgs (task_started, task_complete, turn_aborted,
|
||||
// *_approval_request, error).
|
||||
export function readCodex(text, id = "") {
|
||||
const s = fresh("codex", id)
|
||||
for (const d of lines(text)) {
|
||||
const t = ms(d.timestamp)
|
||||
const p = d.payload || {}
|
||||
if (d.type === "session_meta") {
|
||||
s.id = p.id || p.session_id || s.id
|
||||
if (p.cwd) { s.cwd = p.cwd; s.project = base(p.cwd) }
|
||||
touch(s, ms(p.timestamp) || t)
|
||||
continue
|
||||
}
|
||||
if (d.type === "turn_context" && p.cwd) { s.cwd = p.cwd; s.project = base(p.cwd); if (p.model) s.model = p.model }
|
||||
if (d.type === "event_msg") {
|
||||
switch (p.type) {
|
||||
case "thread_settings_applied": if (p.thread_settings?.model) s.model = p.thread_settings.model; break
|
||||
case "thread_name_updated": if (p.thread_name) s.title = clip(p.thread_name, TITLE_MAX); break
|
||||
case "task_started": s.phase = "thinking"; s.pending = []; s.error = ""; touch(s, t); break
|
||||
case "user_message": prompted(s, p.message, t); break
|
||||
case "item_completed":
|
||||
if (p.item?.type === "UserMessage") prompted(s, textOf(p.item.content), t)
|
||||
break
|
||||
case "exec_approval_request": case "apply_patch_approval_request": case "request_permissions":
|
||||
s.phase = "approval"
|
||||
s.stepName = p.command ? "shell" : p.type === "apply_patch_approval_request" ? "apply_patch" : "request_permissions"
|
||||
s.step = p.command ? toolLine("shell", { command: p.command }) : s.stepName
|
||||
touch(s, t)
|
||||
break
|
||||
case "request_user_input": s.phase = "ask"; touch(s, t); break
|
||||
case "agent_message": if (p.message) s.reply = clip(p.message, TEXT_MAX); touch(s, t); break
|
||||
case "task_complete":
|
||||
s.phase = "done"; s.pending = []
|
||||
if (p.last_agent_message) s.reply = clip(p.last_agent_message, TEXT_MAX)
|
||||
touch(s, ms(p.completed_at) || t)
|
||||
break
|
||||
case "turn_aborted": s.phase = "aborted"; s.pending = []; touch(s, ms(p.completed_at) || t); break
|
||||
case "error": s.phase = "error"; s.error = clip(p.message, 160); s.pending = []; touch(s, t); break
|
||||
}
|
||||
continue
|
||||
}
|
||||
if (d.type === "response_item") {
|
||||
switch (p.type) {
|
||||
case "function_call": called(s, p.call_id, p.name, p.arguments, t); break
|
||||
case "custom_tool_call": called(s, p.call_id, p.name, p.input, t); break
|
||||
case "local_shell_call": called(s, p.call_id, "shell", { command: p.action?.command }, t); break
|
||||
case "function_call_output": case "custom_tool_call_output": case "local_shell_call_output": answered(s, p.call_id, t); break
|
||||
case "message":
|
||||
if (p.role === "assistant") { const x = textOf(p.content).trim(); if (x) s.reply = clip(x, TEXT_MAX) }
|
||||
touch(s, t)
|
||||
break
|
||||
case "reasoning": if (s.phase !== "tool" && s.phase !== "approval") s.phase = s.phase === "done" ? "done" : "thinking"; touch(s, t); break
|
||||
}
|
||||
}
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
// ---- DeepSeek Harness -----------------------------------------------------
|
||||
// ~/.dsh/sessions/<folder>/<session>/session.v4.jsonl.zstd: typed events —
|
||||
// session, turn/start, tool/call, approval/asked, approval/decided,
|
||||
// tool/result, assistant/message, turn/end {reason: completed|aborted|error}.
|
||||
export function readDsh(text, id = "") {
|
||||
const s = fresh("dsh", id)
|
||||
for (const d of lines(text)) {
|
||||
const t = ms(d.time || d.createdAt)
|
||||
const x = d.data || {}
|
||||
switch (d.type) {
|
||||
case "session": s.id = d.id || s.id; if (d.cwd) { s.cwd = d.cwd; s.project = base(d.cwd) } touch(s, ms(d.createdAt)); break
|
||||
case "session/title": if (x.title) s.title = clip(x.title, TITLE_MAX); break
|
||||
case "working-directory/change": if (x.cwd || x.to) { s.cwd = x.cwd || x.to; s.project = base(s.cwd) } break
|
||||
case "model/selection": if (x.model) s.model = x.model; break
|
||||
case "user/message": if (x.source?.kind === "user") prompted(s, textOf(x.content), t); break
|
||||
case "turn/start": s.phase = "thinking"; s.pending = []; s.error = ""; touch(s, t); break
|
||||
case "tool/call": called(s, x.callId, x.name, x.arguments, t); break
|
||||
case "approval/asked": s.phase = "approval"; touch(s, t); break
|
||||
case "approval/decided": if (s.phase === "approval") s.phase = s.pending.length ? "tool" : "thinking"; touch(s, t); break
|
||||
case "tool/result": answered(s, x.message?.toolCallId || x.message?.source?.callId, t); break
|
||||
case "assistant/message": {
|
||||
const c = x.message?.content
|
||||
const txt = Array.isArray(c) ? c.filter((b) => b?.type === "text").map((b) => b.text).join("\n").trim() : ""
|
||||
if (txt) s.reply = clip(txt, TEXT_MAX)
|
||||
touch(s, t)
|
||||
break
|
||||
}
|
||||
case "turn/end": {
|
||||
const k = x.reason?.kind
|
||||
s.pending = []
|
||||
if (k === "aborted") s.phase = "aborted"
|
||||
else if (k === "error") { s.phase = "error"; s.error = clip(x.reason?.error?.message, 160) }
|
||||
else s.phase = "done"
|
||||
touch(s, t)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
// ---- Gemini CLI / Qwen Code -----------------------------------------------
|
||||
// ~/.gemini/tmp/<project>/chats/session-*.json(l): messages, the model's
|
||||
// with toolCalls each carrying a status (scheduled, awaiting_approval,
|
||||
// executing, success, error, cancelled).
|
||||
export function readGemini(text, agent = "gemini", id = "") {
|
||||
const s = fresh(agent, id)
|
||||
let msgs = []
|
||||
const trimmed = String(text).trim()
|
||||
if (trimmed.startsWith("{") && !trimmed.includes("\n{")) {
|
||||
try { const j = JSON.parse(trimmed); msgs = j.messages || []; s.id = j.sessionId || id; touch(s, ms(j.startTime)) } catch {}
|
||||
} else {
|
||||
for (const d of lines(text)) {
|
||||
if (d.sessionId && !s.id) s.id = d.sessionId
|
||||
if (Array.isArray(d.messages)) msgs.push(...d.messages)
|
||||
else if (d.type) msgs.push(d)
|
||||
}
|
||||
}
|
||||
for (const m of msgs) {
|
||||
const t = ms(m.timestamp)
|
||||
if (m.type === "user") {
|
||||
const txt = typeof m.content === "string" ? m.content : textOf(m.content)
|
||||
if (!/functionResponse/.test(JSON.stringify(m.content || ""))) prompted(s, txt, t)
|
||||
continue
|
||||
}
|
||||
if (m.type === "gemini" || m.type === "model" || m.type === "assistant") {
|
||||
if (m.model) s.model = m.model
|
||||
const txt = typeof m.content === "string" ? m.content : textOf(m.content)
|
||||
if (txt.trim()) s.reply = clip(txt, TEXT_MAX)
|
||||
const calls = Array.isArray(m.toolCalls) ? m.toolCalls : []
|
||||
s.pending = []
|
||||
for (const c of calls) {
|
||||
const st = String(c.status || "").toLowerCase()
|
||||
if (c.name) s.stepName = String(c.name)
|
||||
if (st === "awaiting_approval") { s.phase = "approval"; s.step = toolLine(c.name, c.args) }
|
||||
else if (st === "scheduled" || st === "executing" || st === "validating") { s.pending.push({ id: c.id, name: c.name, line: toolLine(c.name, c.args), at: t }); s.step = toolLine(c.name, c.args) }
|
||||
else if (c.name) s.step = toolLine(c.name, c.args)
|
||||
}
|
||||
if (s.phase !== "approval") s.phase = s.pending.length ? "tool" : calls.length ? "thinking" : "done"
|
||||
touch(s, t)
|
||||
}
|
||||
if (m.type === "error") { s.phase = "error"; s.error = clip(m.content, 160); touch(s, t) }
|
||||
if (m.type === "info" && /cancel/i.test(String(m.content))) { s.phase = "aborted"; touch(s, t) }
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
// ---- Pi / omp ----------------------------------------------------------------
|
||||
// ~/.pi/agent/sessions/<folder>/<time>_<id>.jsonl: a session header, then
|
||||
// message lines whose message has a role (user, assistant, toolResult) and,
|
||||
// for the assistant, a stopReason (stop, toolUse, aborted, error).
|
||||
export function readPi(text, agent = "pi", id = "") {
|
||||
const s = fresh(agent, id)
|
||||
for (const d of lines(text)) {
|
||||
const t = ms(d.timestamp)
|
||||
if (d.type === "session") { s.id = d.id || s.id; if (d.cwd) { s.cwd = d.cwd; s.project = base(d.cwd) } touch(s, t); continue }
|
||||
if (d.type === "session_info" && d.name) s.title = clip(d.name, TITLE_MAX)
|
||||
if (d.type === "title_change" && d.title) s.title = clip(d.title, TITLE_MAX)
|
||||
if (d.type === "model_change") s.model = d.modelId || d.model || s.model
|
||||
const m = d.message
|
||||
if (d.type !== "message" || !m) continue
|
||||
if (m.role === "user") { prompted(s, textOf(m.content), t); continue }
|
||||
if (m.role === "toolResult") { answered(s, m.toolCallId, t); continue }
|
||||
if (m.role === "assistant") {
|
||||
if (m.model) s.model = m.model
|
||||
const parts = Array.isArray(m.content) ? m.content : []
|
||||
const txt = parts.filter((p) => p?.type === "text").map((p) => p.text).join("\n").trim()
|
||||
if (txt) s.reply = clip(txt, TEXT_MAX)
|
||||
for (const p of parts) if (p?.type === "toolCall") called(s, p.id, p.name, p.arguments, t)
|
||||
if (m.stopReason === "stop" || m.stopReason === "length") { s.phase = "done"; s.pending = [] }
|
||||
else if (m.stopReason === "aborted") { s.phase = "aborted"; s.pending = [] }
|
||||
else if (m.stopReason === "error") { s.phase = "error"; s.error = clip(m.errorMessage, 160); s.pending = [] }
|
||||
touch(s, t)
|
||||
}
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
export const READERS = { claude: readClaude, codex: readCodex, dsh: readDsh, gemini: readGemini, pi: readPi }
|
||||
@@ -0,0 +1,204 @@
|
||||
// Finds the session files each agent writes, in each agent's own folder,
|
||||
// and reads the ones that changed: whole when new, then only what was
|
||||
// appended. readers.mjs turns the text into a session's facts.
|
||||
//
|
||||
// Cheap on purpose: it runs every second or two while magpie is open. A
|
||||
// folder is listed only for files changed in the last `days`; a file is
|
||||
// read again only when its size or time moved; a big file is read from its
|
||||
// tail (a turn's state is in its last lines, and the start of the file —
|
||||
// the session header, its first prompt — is read once and kept).
|
||||
import { closeSync, existsSync, openSync, readFileSync, readSync, readdirSync, statSync } from "node:fs"
|
||||
import { homedir } from "node:os"
|
||||
import { basename, dirname, join } from "node:path"
|
||||
import { readClaude, readCodex, readDsh, readGemini, readPi } from "./readers.mjs"
|
||||
|
||||
const HEAD = 64 * 1024 // what is kept of a file's start: its header, its first prompt
|
||||
const TAIL = 512 * 1024 // what is read of a big file's end
|
||||
// A dsh session is one compressed file that is rewritten on every step, so
|
||||
// decoding all of it each 1.5 s tick is wasteful while it is being written.
|
||||
// The cap keeps a pathological file from stalling a tick, and an active one
|
||||
// is decoded at most once every ZSTD_EVERY: its last facts stand meanwhile.
|
||||
const ZSTD_MAX = 8 * 1024 * 1024
|
||||
const ZSTD_EVERY = 4000
|
||||
|
||||
function env(k) { return (process.env[k] || "").trim() }
|
||||
function home(...p) { return join(env("HOME") || homedir(), ...p) }
|
||||
function expand(p) { return p.startsWith("~/") ? home(p.slice(2)) : p }
|
||||
|
||||
// where each agent keeps its sessions: { agent, kind, root, depth, match }
|
||||
// depth: how many folders down from root the files sit
|
||||
export function sources() {
|
||||
const claude = env("CLAUDE_CONFIG_DIR") ? expand(env("CLAUDE_CONFIG_DIR")) : home(".claude")
|
||||
const codex = env("CODEX_HOME") ? expand(env("CODEX_HOME")) : home(".codex")
|
||||
const dsh = env("DSH_HOME") ? expand(env("DSH_HOME")) : home(".dsh")
|
||||
const pi = env("PI_CODING_AGENT_DIR") ? expand(env("PI_CODING_AGENT_DIR")) : home(".pi", "agent")
|
||||
const qoder = env("QODER_CONFIG_DIR") ? expand(env("QODER_CONFIG_DIR")) : home(".qoder")
|
||||
const qodercn = env("QODERCN_CONFIG_DIR") ? expand(env("QODERCN_CONFIG_DIR")) : home(".qoder-cn")
|
||||
const workbuddy = env("WORKBUDDY_CONFIG_DIR") ? expand(env("WORKBUDDY_CONFIG_DIR")) : home(".workbuddy")
|
||||
const codebuddy = env("CODEBUDDY_CONFIG_DIR") ? expand(env("CODEBUDDY_CONFIG_DIR")) : home(".codebuddy")
|
||||
const jsonl = (n) => n.endsWith(".jsonl")
|
||||
return [
|
||||
{ agent: "claude", kind: "claude", root: join(claude, "projects"), depth: 1, match: jsonl },
|
||||
{ agent: "codex", kind: "codex", root: join(codex, "sessions"), depth: 3, match: (n) => n.startsWith("rollout-") && n.endsWith(".jsonl") },
|
||||
{ agent: "dsh", kind: "dsh", root: join(dsh, "sessions"), depth: 2, match: (n) => n === "session.v4.jsonl.zstd" || n === "session.v4.jsonl" },
|
||||
{ agent: "gemini", kind: "gemini", root: home(".gemini", "tmp"), depth: 2, match: (n) => n.startsWith("session-") && (n.endsWith(".json") || n.endsWith(".jsonl")) },
|
||||
{ agent: "qwen", kind: "gemini", root: home(".qwen", "tmp"), depth: 2, match: (n) => n.startsWith("session-") && (n.endsWith(".json") || n.endsWith(".jsonl")) },
|
||||
{ agent: "pi", kind: "pi", root: join(pi, "sessions"), depth: 1, match: jsonl },
|
||||
{ agent: "omp", kind: "pi", root: home(".omp", "agent", "sessions"), depth: 1, match: jsonl },
|
||||
{ agent: "qoder", kind: "claude", root: join(qoder, "projects"), depth: 1, match: jsonl },
|
||||
{ agent: "qoder-cn", kind: "claude", root: join(qodercn, "projects"), depth: 1, match: jsonl },
|
||||
{ agent: "workbuddy", kind: "claude", root: join(workbuddy, "projects"), depth: 1, match: jsonl },
|
||||
{ agent: "codebuddy", kind: "claude", root: join(codebuddy, "projects"), depth: 1, match: jsonl },
|
||||
]
|
||||
}
|
||||
|
||||
// the files under root, `depth` folders down, changed since `since`
|
||||
function walk(root, depth, match, since, out) {
|
||||
let names
|
||||
try { names = readdirSync(root, { withFileTypes: true }) } catch { return }
|
||||
for (const e of names) {
|
||||
const p = join(root, e.name)
|
||||
if (depth > 0) {
|
||||
if (!e.isDirectory()) continue
|
||||
// Codex's YYYY/MM/DD: a whole old month or day is skipped by its name
|
||||
walk(p, depth - 1, match, since, out)
|
||||
} else if (e.isFile() && match(e.name)) {
|
||||
let st
|
||||
try { st = statSync(p) } catch { continue }
|
||||
if (st.mtimeMs >= since) out.push({ path: p, size: st.size, mtime: st.mtimeMs })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function readRange(path, from, len) {
|
||||
const fd = openSync(path, "r")
|
||||
try {
|
||||
const b = Buffer.alloc(len)
|
||||
const n = readSync(fd, b, 0, len, from)
|
||||
return b.subarray(0, n).toString("utf8")
|
||||
} finally { closeSync(fd) }
|
||||
}
|
||||
|
||||
function zstd(path) {
|
||||
const raw = readFileSync(path)
|
||||
if (typeof Bun !== "undefined" && Bun.zstdDecompressSync) return new TextDecoder().decode(Bun.zstdDecompressSync(raw))
|
||||
throw new Error("no zstd here")
|
||||
}
|
||||
|
||||
function readerFor(kind, agent) {
|
||||
switch (kind) {
|
||||
case "claude": return (t, id) => readClaude(t, agent, id)
|
||||
case "codex": return (t, id) => readCodex(t, id)
|
||||
case "dsh": return (t, id) => readDsh(t, id)
|
||||
case "gemini": return (t, id) => readGemini(t, agent, id)
|
||||
case "pi": return (t, id) => readPi(t, agent, id)
|
||||
}
|
||||
}
|
||||
|
||||
function idOf(src, path) {
|
||||
const name = basename(path)
|
||||
if (src.kind === "dsh") return basename(dirname(path))
|
||||
if (src.kind === "codex") { const m = /-([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:_[^.]*)?\.jsonl$/i.exec(name); return m ? m[1] : name }
|
||||
return name.replace(/\.jsonl?$/, "").replace(/^\d{4}-\d{2}-\d{2}T[^_]+_/, "")
|
||||
}
|
||||
|
||||
// Codex names a thread in session_index.jsonl ({id, thread_name}), the
|
||||
// latest line for an id winning
|
||||
function codexTitles() {
|
||||
const dir = env("CODEX_HOME") ? expand(env("CODEX_HOME")) : home(".codex")
|
||||
const out = new Map()
|
||||
try {
|
||||
for (const l of readFileSync(join(dir, "session_index.jsonl"), "utf8").split("\n")) {
|
||||
if (!l) continue
|
||||
try { const d = JSON.parse(l); if (d.id && d.thread_name) out.set(d.id, String(d.thread_name).trim()) } catch {}
|
||||
}
|
||||
} catch {}
|
||||
return out
|
||||
}
|
||||
|
||||
export function createScanner(opts = {}) {
|
||||
const o = { days: 2, max: 40, zstdMax: ZSTD_MAX, zstdEvery: ZSTD_EVERY, ...opts }
|
||||
const files = new Map() // path -> { size, mtime, head, session }
|
||||
let srcs = o.sources || sources()
|
||||
|
||||
// one pass: every changed file read again; gives the sessions, latest first
|
||||
function scan(now = Date.now()) {
|
||||
const since = now - o.days * 86400e3
|
||||
const found = []
|
||||
for (const src of srcs) {
|
||||
if (!existsSync(src.root)) continue
|
||||
const got = []
|
||||
walk(src.root, src.depth, src.match, since, got)
|
||||
for (const f of got) found.push({ ...f, src })
|
||||
}
|
||||
found.sort((a, b) => b.mtime - a.mtime)
|
||||
const keep = found.slice(0, o.max)
|
||||
const live = new Set(keep.map((f) => f.path))
|
||||
for (const p of files.keys()) if (!live.has(p)) files.delete(p)
|
||||
const out = []
|
||||
let titles = null
|
||||
for (const f of keep) {
|
||||
let c = files.get(f.path)
|
||||
const changed = !c || c.size !== f.size || c.mtime !== f.mtime
|
||||
if (changed) {
|
||||
const zstd = f.path.endsWith(".zstd")
|
||||
// decode an active compressed session at most once every
|
||||
// zstdEvery ms; its file time still says it is at work
|
||||
if (zstd && c?.session && now - (c.decodedAt || 0) < o.zstdEvery) {
|
||||
c.size = f.size
|
||||
c.mtime = f.mtime
|
||||
c.session.touched = Math.max(c.session.touched || 0, f.mtime)
|
||||
} else {
|
||||
try { c = readOne(f, c, now) } catch (e) { continue }
|
||||
files.set(f.path, c)
|
||||
}
|
||||
}
|
||||
if (!c.session) continue
|
||||
if (c.session.agent === "codex") {
|
||||
titles ??= codexTitles()
|
||||
const t = titles.get(c.session.id)
|
||||
if (t) c.session.title = t.length > 48 ? t.slice(0, 47) + "…" : t
|
||||
}
|
||||
out.push(c.session)
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
function readOne(f, was, now = Date.now()) {
|
||||
const read = readerFor(f.src.kind, f.src.agent)
|
||||
const id = idOf(f.src, f.path)
|
||||
let text
|
||||
if (f.path.endsWith(".zstd")) {
|
||||
if (f.size > o.zstdMax) return { size: f.size, mtime: f.mtime, session: was?.session || null, decodedAt: now }
|
||||
text = zstd(f.path)
|
||||
const s = read(text, id)
|
||||
s.path = f.path
|
||||
return { size: f.size, mtime: f.mtime, session: finish(s, f), decodedAt: now }
|
||||
} else if (f.size <= HEAD + TAIL) {
|
||||
text = readRange(f.path, 0, f.size)
|
||||
} else {
|
||||
// the start once (header, first prompt), and the end every time
|
||||
const head = was?.head ?? readRange(f.path, 0, HEAD)
|
||||
let tail = readRange(f.path, f.size - TAIL, TAIL)
|
||||
tail = tail.slice(tail.indexOf("\n") + 1)
|
||||
text = head.slice(0, head.lastIndexOf("\n") + 1) + tail
|
||||
const s = read(text, id)
|
||||
s.path = f.path
|
||||
return { size: f.size, mtime: f.mtime, head, session: finish(s, f) }
|
||||
}
|
||||
const s = read(text, id)
|
||||
s.path = f.path
|
||||
return { size: f.size, mtime: f.mtime, session: finish(s, f) }
|
||||
}
|
||||
|
||||
function finish(s, f) {
|
||||
if (!s.id) s.id = idOf(f.src, f.path)
|
||||
if (!s.updated) s.updated = f.mtime
|
||||
// the file's own time: a line being written is the session at work
|
||||
s.touched = f.mtime
|
||||
s.key = `${s.agent}|${s.id}`
|
||||
return s
|
||||
}
|
||||
|
||||
return { scan, files, setSources: (x) => { srcs = x; files.clear() } }
|
||||
}
|
||||
@@ -0,0 +1,245 @@
|
||||
// What each agent session is doing, worked out from the requests and replies
|
||||
// magpie's gateway sees: the gateway hook (office.hooks.mjs) hands every
|
||||
// request and every finished reply here, and the page draws what this
|
||||
// remembers. Pure: no file, no clock of its own (now is passed in), so a
|
||||
// test drives it.
|
||||
//
|
||||
// It keeps facts, not a status: whether a request is out, what the request
|
||||
// answered (the user, or a tool's result), and how the last reply ended
|
||||
// (with tool calls, a question, plain text, or an error). The page turns
|
||||
// them into a status against its own clock (page/model.js), so a session
|
||||
// whose tools have run for minutes reads as waiting for you without the
|
||||
// hook writing anything.
|
||||
|
||||
const TEXT_MAX = 280
|
||||
const QUERY_MAX = 200
|
||||
const TITLE_MAX = 48
|
||||
const SESSIONS_MAX = 60
|
||||
// a request with no answer this long is lost (the host keeps a run 15 min)
|
||||
const LOST_MS = 15 * 60 * 1000
|
||||
|
||||
// tools whose call is the agent asking the user something
|
||||
const ASK_TOOLS = /^(?:askuserquestion|ask_?user(?:_?question)?|request_?user_?input|ask_?followup_?question|ask_?human|exitplanmode|exit_plan_mode|user_?input)$/i
|
||||
|
||||
export function clip(s, n) {
|
||||
s = String(s ?? "").replace(/\s+/g, " ").trim()
|
||||
return s.length > n ? s.slice(0, n - 1).trimEnd() + "…" : s
|
||||
}
|
||||
|
||||
function textOf(content) {
|
||||
if (typeof content === "string") return content
|
||||
if (!Array.isArray(content)) return ""
|
||||
return content
|
||||
.map((p) => (typeof p === "string" ? p : p && (p.type === "text" || p.type === "output_text" || p.type === "input_text" || (p.text && !p.type)) ? p.text ?? "" : ""))
|
||||
.filter(Boolean)
|
||||
.join("\n")
|
||||
}
|
||||
|
||||
// what the request answers: "tool" when its last turn is a tool's result,
|
||||
// else "user"
|
||||
export function turnOf(body, protocol) {
|
||||
if (!body || typeof body !== "object") return "user"
|
||||
if (protocol === "responses") {
|
||||
const input = body.input
|
||||
if (!Array.isArray(input) || !input.length) return "user"
|
||||
const last = input[input.length - 1]
|
||||
return /_output$/.test(String(last?.type ?? "")) ? "tool" : "user"
|
||||
}
|
||||
if (protocol === "gemini") {
|
||||
const c = Array.isArray(body.contents) ? body.contents[body.contents.length - 1] : null
|
||||
return (c?.parts ?? []).some((p) => p?.functionResponse) ? "tool" : "user"
|
||||
}
|
||||
const msgs = Array.isArray(body.messages) ? body.messages : []
|
||||
const last = msgs[msgs.length - 1]
|
||||
if (!last) return "user"
|
||||
if (last.role === "tool" || last.role === "function") return "tool"
|
||||
if (Array.isArray(last.content) && last.content.some((b) => b?.type === "tool_result")) return "tool"
|
||||
return "user"
|
||||
}
|
||||
|
||||
export function hasTools(body) {
|
||||
if (!body || typeof body !== "object") return false
|
||||
if (Array.isArray(body.tools) && body.tools.length) return true
|
||||
if (Array.isArray(body.functions) && body.functions.length) return true
|
||||
return Array.isArray(body.config?.tools) && body.config.tools.length > 0
|
||||
}
|
||||
|
||||
function parseArgs(a) {
|
||||
if (a && typeof a === "object") return a
|
||||
try { return JSON.parse(a) } catch { return typeof a === "string" ? { input: a } : {} }
|
||||
}
|
||||
|
||||
// a tool call as a line a person reads: "Bash · npm test"
|
||||
export function toolLine(name, args) {
|
||||
const a = parseArgs(args)
|
||||
const cmd = Array.isArray(a.command) ? a.command.join(" ") : a.command ?? a.cmd
|
||||
const what = cmd ?? a.file_path ?? a.path ?? a.filePath ?? a.pattern ?? a.query ?? a.url ?? a.description ?? a.prompt ?? a.input ?? ""
|
||||
const s = clip(typeof what === "string" ? what : JSON.stringify(what), 80)
|
||||
return s ? `${name} · ${s}` : String(name)
|
||||
}
|
||||
|
||||
// how a reply ended: { text, tools: [{ name, line }] }
|
||||
export function replyOf(reply, protocol) {
|
||||
const out = { text: "", tools: [] }
|
||||
if (!reply || typeof reply !== "object") return out
|
||||
const add = (name, args) => { if (name) out.tools.push({ name: String(name), line: toolLine(name, args) }) }
|
||||
if (protocol === "responses") {
|
||||
const r = reply.response && Array.isArray(reply.response.output) ? reply.response : reply
|
||||
const texts = []
|
||||
for (const it of Array.isArray(r.output) ? r.output : []) {
|
||||
if (it?.type === "message") texts.push(textOf(it.content))
|
||||
else if (it?.type === "function_call") add(it.name, it.arguments)
|
||||
else if (it?.type === "custom_tool_call") add(it.name, it.input)
|
||||
else if (it?.type === "local_shell_call") add("shell", { command: it.action?.command })
|
||||
else if (it?.type === "web_search_call") add("web_search", { query: it.action?.query })
|
||||
}
|
||||
out.text = texts.join("\n")
|
||||
return out
|
||||
}
|
||||
if (protocol === "gemini") {
|
||||
const parts = reply.candidates?.[0]?.content?.parts ?? []
|
||||
out.text = parts.filter((p) => typeof p?.text === "string" && !p.thought).map((p) => p.text).join("")
|
||||
for (const p of parts) if (p?.functionCall) add(p.functionCall.name, p.functionCall.args)
|
||||
return out
|
||||
}
|
||||
if (Array.isArray(reply.choices)) {
|
||||
const m = reply.choices[0]?.message ?? {}
|
||||
out.text = textOf(m.content)
|
||||
for (const c of Array.isArray(m.tool_calls) ? m.tool_calls : []) add(c.function?.name, c.function?.arguments)
|
||||
if (m.function_call) add(m.function_call.name, m.function_call.arguments)
|
||||
return out
|
||||
}
|
||||
// Anthropic Messages
|
||||
const blocks = Array.isArray(reply.content) ? reply.content : []
|
||||
out.text = blocks.filter((b) => b?.type === "text").map((b) => b.text).join("\n")
|
||||
for (const b of blocks) if (b?.type === "tool_use" || b?.type === "server_tool_use") add(b.name, b.input)
|
||||
return out
|
||||
}
|
||||
|
||||
// whether a reply's last words ask the user something
|
||||
export function asks(text) {
|
||||
const t = String(text ?? "").replace(/[\s*_`>)\]"'”’」』]+$/u, "")
|
||||
return /[??]$/.test(t)
|
||||
}
|
||||
|
||||
export function outcomeOf(r) {
|
||||
if (r.tools.some((t) => ASK_TOOLS.test(t.name))) return "ask"
|
||||
if (r.tools.length) return "tools"
|
||||
return asks(r.text) ? "ask" : "text"
|
||||
}
|
||||
|
||||
function base(p) {
|
||||
const s = String(p ?? "").replace(/[\\/]+$/, "")
|
||||
return s.slice(Math.max(s.lastIndexOf("/"), s.lastIndexOf("\\")) + 1)
|
||||
}
|
||||
|
||||
export function keyOf(ctx) {
|
||||
const agent = ctx?.agent || "agent"
|
||||
if (ctx?.session) return `${agent}|${ctx.session}`
|
||||
if (ctx?.cwd) return `${agent}|cwd:${ctx.cwd}`
|
||||
return `${agent}|model:${ctx?.model || "?"}`
|
||||
}
|
||||
|
||||
export function createTracker(opts = {}) {
|
||||
const o = { text: true, remote: false, ...opts }
|
||||
const sessions = new Map()
|
||||
|
||||
function wanted(ctx) {
|
||||
if (!ctx) return false
|
||||
if (o.remote) return true
|
||||
// local by default: the page is this computer's; a hook on an older
|
||||
// magpie says no origin, and is taken as local
|
||||
return !ctx.origin || ctx.origin === "local"
|
||||
}
|
||||
|
||||
function prune(now) {
|
||||
for (const [k, s] of sessions) if (s.inflight > 0 && now - s.inflightSince > LOST_MS) {
|
||||
s.inflight = 0
|
||||
s.last = { at: now, outcome: "error", text: "", step: "", error: "lost" }
|
||||
sessions.set(k, s)
|
||||
}
|
||||
if (sessions.size <= SESSIONS_MAX) return
|
||||
const old = [...sessions.values()].filter((s) => !s.inflight).sort((a, b) => a.updated - b.updated)
|
||||
for (const s of old.slice(0, sessions.size - SESSIONS_MAX)) sessions.delete(s.key)
|
||||
}
|
||||
|
||||
// a request on its way: the session is at work
|
||||
function request(body, ctx, now) {
|
||||
if (!wanted(ctx)) return null
|
||||
const key = keyOf(ctx)
|
||||
let s = sessions.get(key)
|
||||
const tools = hasTools(body)
|
||||
// a side request (a quick topic check, a summary) of a session that
|
||||
// works with tools is not its work
|
||||
if (s && s.tools && !tools) return null
|
||||
if (!s) {
|
||||
s = { key, agent: ctx.agent || "agent", session: ctx.session || "", cwd: ctx.cwd || "", project: base(ctx.cwd),
|
||||
title: "", query: "", model: ctx.model || "", started: now, updated: now, turns: 0, steps: 0,
|
||||
tools, inflight: 0, inflightSince: 0, turn: "user", last: null }
|
||||
sessions.set(key, s)
|
||||
}
|
||||
const turn = turnOf(body, ctx.protocol)
|
||||
if (turn === "user" && ctx.query) {
|
||||
s.turns++
|
||||
if (o.text) {
|
||||
s.query = clip(ctx.query, QUERY_MAX)
|
||||
if (!s.title) s.title = clip(ctx.query, TITLE_MAX)
|
||||
}
|
||||
} else if (turn === "tool") s.steps++
|
||||
s.tools = s.tools || tools
|
||||
s.model = ctx.model || s.model
|
||||
if (ctx.cwd && !s.cwd) { s.cwd = ctx.cwd; s.project = base(ctx.cwd) }
|
||||
s.turn = turn
|
||||
if (!s.inflight) s.inflightSince = now
|
||||
s.inflight++
|
||||
s.updated = now
|
||||
prune(now)
|
||||
return key
|
||||
}
|
||||
|
||||
// a reply done: how it ended
|
||||
function response(reply, ctx, now, success) {
|
||||
const key = keyOf(ctx)
|
||||
const s = sessions.get(key)
|
||||
if (!s || !s.inflight) return null
|
||||
s.inflight--
|
||||
if (!s.inflight) s.inflightSince = 0
|
||||
s.updated = now
|
||||
if (!success) {
|
||||
s.last = { at: now, outcome: "error", text: "", step: s.last?.step ?? "" }
|
||||
return key
|
||||
}
|
||||
const r = replyOf(reply, ctx?.protocol ?? ctx?.request?.protocol)
|
||||
// a reply that says nothing and calls nothing (a stream cut short) is
|
||||
// no ending of its own
|
||||
if (!r.text && !r.tools.length && s.last) return key
|
||||
const outcome = outcomeOf(r)
|
||||
s.last = {
|
||||
at: now, outcome,
|
||||
text: o.text ? clip(r.text, TEXT_MAX) : "",
|
||||
step: r.tools.length ? (o.text ? r.tools.map((t) => t.line).join(" · ").slice(0, 160) : r.tools.map((t) => t.name).join(", ")) : s.last?.step ?? "",
|
||||
toolNames: r.tools.map((t) => t.name).slice(0, 6),
|
||||
}
|
||||
return key
|
||||
}
|
||||
|
||||
function snapshot(now) {
|
||||
prune(now)
|
||||
return { v: 1, written: now, text: o.text, sessions: [...sessions.values()].sort((a, b) => a.started - b.started) }
|
||||
}
|
||||
|
||||
// after a restart of the host: what was written last, nothing in flight
|
||||
function restore(snap, now) {
|
||||
for (const s of Array.isArray(snap?.sessions) ? snap.sessions : []) {
|
||||
if (!s || typeof s.key !== "string") continue
|
||||
if (s.inflight) {
|
||||
s.inflight = 0
|
||||
s.inflightSince = 0
|
||||
if (!s.last || s.last.at < s.updated) s.last = { at: now, outcome: "error", text: "", step: s.last?.step ?? "", error: "restarted" }
|
||||
}
|
||||
sessions.set(s.key, s)
|
||||
}
|
||||
}
|
||||
|
||||
return { request, response, snapshot, restore, sessions, options: o }
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
import { test, expect } from 'bun:test'
|
||||
import { readFileSync } from 'node:fs'
|
||||
const scope = {}
|
||||
new Function('globalThis', readFileSync(new URL('./page/scene.js', import.meta.url), 'utf8'))(scope)
|
||||
const { Scene, SOFA, SOFA_APPROACH, DESKS, NAV, idlePose } = scope.AgentOfficeScene
|
||||
const floorSafe = (from, path) => {
|
||||
let a = from
|
||||
for (const b of path) {
|
||||
if (b[2] === undefined) {
|
||||
const n = Math.max(1, Math.ceil(Math.hypot(b[0]-a[0], b[1]-a[1])*40))
|
||||
for (let i=0;i<=n;i++) expect(NAV.freeAt(a[0]+(b[0]-a[0])*i/n,a[1]+(b[1]-a[1])*i/n)).toBe(true)
|
||||
} else {
|
||||
const slot = b[2], seat = SOFA[slot], approach = SOFA_APPROACH[slot]
|
||||
const axis = slot < 5 ? 1 : 0
|
||||
expect(a[axis]).toBeCloseTo(seat[axis])
|
||||
expect(b[axis]).toBeCloseTo(seat[axis])
|
||||
expect([seat[1-axis],approach[1-axis]]).toContain(b[1-axis])
|
||||
}
|
||||
a = b
|
||||
}
|
||||
}
|
||||
test('all sofa transfers use a separate aisle exit and front approach', () => {
|
||||
for (let i=0;i<SOFA.length;i++) for(let j=0;j<SOFA.length;j++) {
|
||||
if(i===j) continue
|
||||
const p=NAV.path(SOFA[i],SOFA[j])
|
||||
expect(p.length).toBeGreaterThan(2)
|
||||
expect(p[0]).toEqual([...SOFA_APPROACH[i],i])
|
||||
expect(p.at(-2)).toEqual(SOFA_APPROACH[j])
|
||||
expect(p.at(-1)).toEqual([...SOFA[j],j])
|
||||
floorSafe(SOFA[i],p)
|
||||
}
|
||||
for(const seat of SOFA) for(const desk of DESKS) {
|
||||
const p=NAV.path(seat,desk.seat.slice(0,2))
|
||||
expect(p.length).toBeGreaterThan(0)
|
||||
floorSafe(seat,p)
|
||||
}
|
||||
})
|
||||
test('sofa cushions and rear gaps cannot be used as a corridor', () => {
|
||||
for(const [x,y] of SOFA) expect(NAV.freeAt(x,y)).toBe(false)
|
||||
expect(NAV.freeAt(0.45,6)).toBe(false)
|
||||
expect(NAV.freeAt(3.6,11.8)).toBe(false)
|
||||
expect(NAV.path([6,4],[7,6])).toEqual([]) // solid hologram table, no direct fallback
|
||||
})
|
||||
test('retargeting midway through boarding exits from the same front', () => {
|
||||
for(let i=0;i<7;i++) {
|
||||
const a=SOFA[i].map((v,k)=>(v+SOFA_APPROACH[i][k])/2)
|
||||
const p=NAV.path(a,[5,3],i)
|
||||
expect(p[0]).toEqual([...SOFA_APPROACH[i],i])
|
||||
floorSafe(a,p)
|
||||
const s=Object.create(Scene.prototype)
|
||||
expect(s.sofaGroup({walking:true,kind:'seat',transit:i})).toBe(i>=5?1:0)
|
||||
}
|
||||
})
|
||||
test('idle gestures vary by worker, pause during walking and respect reduced motion', () => {
|
||||
const w={a:{seed:5,status:'done'},walking:false}
|
||||
const kinds=new Set()
|
||||
for(let t=0;t<100;t+=0.25) {
|
||||
const p=idlePose(w,t)
|
||||
kinds.add(p.kind)
|
||||
expect(p.amount).toBeGreaterThanOrEqual(0)
|
||||
expect(p.amount).toBeLessThanOrEqual(1)
|
||||
}
|
||||
expect([...kinds].sort()).toEqual(['doze','look','rest','stretch','swing'])
|
||||
expect(idlePose({...w,walking:true},20).kind).toBe('rest')
|
||||
expect(idlePose(w,20,true).kind).toBe('rest')
|
||||
expect(idlePose({...w,a:{seed:5,status:'executing'}},20).kind).toBe('rest')
|
||||
expect(idlePose(w,20)).not.toEqual(idlePose({...w,a:{seed:6,status:'done'}},20))
|
||||
})
|
||||
|
||||
for (const dim of ['2d','3d']) test(`${dim}: walk to every sofa, remain seated, then leave via aisle`, () => {
|
||||
for (let slot=0;slot<7;slot++) {
|
||||
const s=Object.create(Scene.prototype)
|
||||
Object.assign(s,{dim,workers:new Map(),first:false,t:0})
|
||||
const agent={key:'person',seed:slot,status:'done',brand:{color:'#4466ff'}}
|
||||
s.setAgents([agent])
|
||||
const w=s.workers.get('person')
|
||||
const advance=()=>{
|
||||
for(let n=0;n<1800;n++) {
|
||||
s.step(1/60)
|
||||
if(w.walking && w.transit===null) expect(NAV.freeAt(w.x,w.y)).toBe(true)
|
||||
}
|
||||
expect(w.walking).toBe(false)
|
||||
expect(w.x).toBeCloseTo(w.tx)
|
||||
expect(w.y).toBeCloseTo(w.ty)
|
||||
}
|
||||
advance()
|
||||
const position=[w.x,w.y]
|
||||
s.setAgents([agent]);s.step(1/60)
|
||||
expect([w.x,w.y]).toEqual(position)
|
||||
expect(NAV.path(position,position)).toEqual([])
|
||||
s.setAgents([{...agent,status:'thinking'}])
|
||||
advance()
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,196 @@
|
||||
// The host side of Agent Office. magpie loads this module in its plugin host
|
||||
// (a Bun process that lives while magpie runs), so it does two things there:
|
||||
//
|
||||
// 1. Every second and a half it reads the session files the agents write
|
||||
// themselves — Claude Code's, Codex's, DeepSeek Harness's, Gemini CLI's,
|
||||
// Qwen Code's, Pi's, omp's, Qoder's, WorkBuddy's, CodeBuddy's — and so
|
||||
// knows what each one is really doing, whatever model it talks to:
|
||||
// thinking, running a tool, waiting for an approval or an answer, done,
|
||||
// stopped, failed (lib/scan.mjs, lib/readers.mjs).
|
||||
// 2. As an asynchronous gateway hook it also sees the requests that pass
|
||||
// magpie, so an agent whose files it can't read (Cursor, OpenCode,
|
||||
// Copilot, Kimi, …) still shows while it works through magpie
|
||||
// (lib/track.mjs). It returns no body: no request changes.
|
||||
//
|
||||
// It writes what it knows to page/live.js, beside the page, which the page
|
||||
// loads again every second (the page has no network; its own files it may
|
||||
// load). Only what changed is written. Nothing leaves this computer.
|
||||
import { mkdirSync, readFileSync, realpathSync, renameSync, writeFileSync } from "node:fs"
|
||||
import { dirname, join, resolve } from "node:path"
|
||||
import { fileURLToPath } from "node:url"
|
||||
import { createTracker } from "./lib/track.mjs"
|
||||
import { createScanner } from "./lib/scan.mjs"
|
||||
|
||||
const here = dirname(fileURLToPath(import.meta.url))
|
||||
// the page's folder, where live.js goes; a test points this elsewhere so it
|
||||
// never touches a real install's
|
||||
const PAGE = process.env.MAGPIE_AGENT_OFFICE_PAGE || join(here, "page")
|
||||
const LIVE = join(PAGE, "live.js")
|
||||
const PREFIX = "globalThis.AgentOfficeLive = "
|
||||
const EVERY = 1500
|
||||
|
||||
// the package's own name, so plugins.json's spec is found however it was
|
||||
// written: @magpie-community/page-agent-office, QingJ01/magpie-agent-office,
|
||||
// a folder, or the short name alone
|
||||
let packageName = ""
|
||||
let packageOptions = {}
|
||||
try {
|
||||
const own = JSON.parse(readFileSync(join(here, "package.json"), "utf8"))
|
||||
packageName = own.name || ""
|
||||
packageOptions = own.magpie?.options || {}
|
||||
} catch {}
|
||||
const ownDir = (() => { try { return realpathSync(here) } catch { return here } })()
|
||||
|
||||
let tracker = null
|
||||
let scanner = null
|
||||
let timer = null
|
||||
let ticking = null
|
||||
let last = ""
|
||||
// fail closed: until an install's options are read, or a request carries
|
||||
// them, no prompt, reply or command is written
|
||||
let options = { text: false }
|
||||
|
||||
function track(opts) {
|
||||
const o = { text: opts?.text !== false, remote: opts?.remote === true }
|
||||
if (tracker && tracker.options.text === o.text && tracker.options.remote === o.remote) return tracker
|
||||
const was = tracker
|
||||
tracker = createTracker(o)
|
||||
if (was) for (const [k, s] of was.sessions) tracker.sessions.set(k, s)
|
||||
return tracker
|
||||
}
|
||||
|
||||
// a session as the page wants it, from the agent's own files
|
||||
function fromFiles(s, text) {
|
||||
return {
|
||||
key: s.key, source: "files", agent: s.agent, session: s.id, cwd: s.cwd, project: s.project,
|
||||
// with text off the title falls back to the folder and the step to the
|
||||
// tool's name: a prompt and a command line can both carry secrets
|
||||
title: text ? (s.title || s.project || "") : (s.project || ""),
|
||||
query: text ? s.query : "", model: s.model,
|
||||
started: s.started, updated: Math.max(s.updated || 0, s.touched || 0), touched: s.touched,
|
||||
phase: s.phase || "done", step: text ? s.step : (s.stepName || ""), reply: text ? s.reply : "", error: text ? s.error : "",
|
||||
pendingSince: s.pending?.[0]?.at || 0, turns: s.turns,
|
||||
}
|
||||
}
|
||||
|
||||
export function snapshot(now = Date.now()) {
|
||||
const text = options.text !== false
|
||||
const sessions = []
|
||||
const seen = new Set()
|
||||
const fileAgents = new Set()
|
||||
if (scanner) {
|
||||
for (const s of scanner.scan(now)) {
|
||||
fileAgents.add(s.agent)
|
||||
if (seen.has(s.key)) continue
|
||||
seen.add(s.key)
|
||||
sessions.push(fromFiles(s, text))
|
||||
}
|
||||
}
|
||||
// what only the gateway saw: an agent whose files aren't read here
|
||||
if (tracker) {
|
||||
for (const g of tracker.snapshot(now).sessions) {
|
||||
if (seen.has(g.key) || fileAgents.has(g.agent)) continue
|
||||
seen.add(g.key)
|
||||
sessions.push({ ...g, source: "gateway" })
|
||||
}
|
||||
}
|
||||
return { v: 2, written: now, text, sessions }
|
||||
}
|
||||
|
||||
export function write(now = Date.now()) {
|
||||
timer = null
|
||||
let body
|
||||
try { body = JSON.stringify(snapshot(now)) } catch { return }
|
||||
// only a change is written; the time alone is no change
|
||||
const same = body.replace(/"written":\d+,/, "")
|
||||
if (same === last) return
|
||||
last = same
|
||||
try {
|
||||
mkdirSync(PAGE, { recursive: true })
|
||||
const tmp = LIVE + ".tmp"
|
||||
writeFileSync(tmp, PREFIX + body + ";\n")
|
||||
renameSync(tmp, LIVE)
|
||||
} catch {}
|
||||
}
|
||||
|
||||
function soon() {
|
||||
if (timer) return
|
||||
timer = setTimeout(write, 200)
|
||||
timer.unref?.()
|
||||
}
|
||||
|
||||
// the files are read from the moment the host loads this module
|
||||
export function start(opts = {}) {
|
||||
options = { ...options, ...opts }
|
||||
if (!scanner) scanner = createScanner({ days: 2, max: 40, ...(opts.scanner || {}) })
|
||||
if (!ticking) {
|
||||
write()
|
||||
ticking = setInterval(write, EVERY)
|
||||
ticking.unref?.()
|
||||
}
|
||||
}
|
||||
|
||||
export function stop() {
|
||||
if (ticking) clearInterval(ticking)
|
||||
ticking = null
|
||||
}
|
||||
|
||||
export async function onRequest(body, ctx) {
|
||||
// keep the loaded options when a request carries none: text:false must
|
||||
// not turn back into text:true because a field was missing
|
||||
options = { ...options, ...(ctx.options || {}) }
|
||||
start()
|
||||
const key = track(options).request(body, ctx, Date.now())
|
||||
ctx.state.office = key
|
||||
if (key) soon()
|
||||
ctx.report?.("skipped")
|
||||
return undefined
|
||||
}
|
||||
|
||||
export async function onResponse(reply, ctx) {
|
||||
if (!ctx.state?.office) return
|
||||
if (track(options).response(reply, ctx, Date.now(), ctx.success === true)) soon()
|
||||
}
|
||||
|
||||
// a spec as magpie writes it, or a package name, or a path to this folder
|
||||
function matchSpec(spec) {
|
||||
const raw = String(spec || "").trim()
|
||||
if (!raw) return false
|
||||
const pathLike = raw.startsWith("/") || raw.startsWith(".") || raw.startsWith("~") || raw.startsWith("file:")
|
||||
if (pathLike) {
|
||||
let p = raw.replace(/^file:\/\//, "").replace(/^file:/, "")
|
||||
if (p === "~" || p.startsWith("~/")) p = join(process.env.HOME || "", p === "~" ? "" : p.slice(2))
|
||||
try { return realpathSync(resolve(p)) === ownDir } catch { return false }
|
||||
}
|
||||
// an npm spec keeps a tag or version after its last @; a scheme's @ is
|
||||
// left alone
|
||||
let clean = raw.split("#")[0]
|
||||
if (!clean.includes("://")) {
|
||||
const at = clean.lastIndexOf("@")
|
||||
if (at > 0) clean = clean.slice(0, at)
|
||||
}
|
||||
const names = new Set([packageName, packageName.replace(/^@[^/]+\//, ""), "page-agent-office", "magpie-agent-office", "agent-office"].filter(Boolean))
|
||||
if (names.has(clean)) return true
|
||||
return names.has(clean.split(/[/:]/).filter(Boolean).pop() || "")
|
||||
}
|
||||
|
||||
function readOptions() {
|
||||
const cfg = process.env.XDG_CONFIG_HOME || join(process.env.HOME || "", ".config")
|
||||
// magpie starts the host in its config folder, which covers portable and
|
||||
// overridden installs; the XDG path stays as the fallback
|
||||
for (const file of [join(process.cwd(), "plugins.json"), join(cfg, "magpie", "plugins.json")]) {
|
||||
let list
|
||||
try { list = JSON.parse(readFileSync(file, "utf8")) } catch { continue }
|
||||
const me = (list.plugins || []).find((p) => matchSpec(p?.spec))
|
||||
// the config this host runs with decides; a file without our entry is
|
||||
// not a reason to consult another magpie's
|
||||
return me ? { ...packageOptions, ...(me.options || {}) } : null
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
// read what the plugin's options say about text, then start: a host that
|
||||
// loads this module starts watching at once, before any request
|
||||
const loaded = readOptions()
|
||||
if (loaded) options = { text: false, ...loaded }
|
||||
if (!process.env.MAGPIE_AGENT_OFFICE_PAGE) start()
|
||||
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"name": "@magpie-community/page-agent-office",
|
||||
"version": "0.1.0",
|
||||
"description": "我的 Agent 在干嘛:读取本机 Claude Code、Codex、DeepSeek Harness、Gemini CLI、Qwen Code、Pi、omp、Qoder、WorkBuddy、CodeBuddy 的会话文件(提问、回复与工具命令,可用 text:false 关闭文本),把每个会话画成太空站办公室里的小人(3D/2D)或列表。Live agent activity dashboard for magpie that reads local agent session files.",
|
||||
"type": "module",
|
||||
"files": [
|
||||
"page/index.html",
|
||||
"page/style.css",
|
||||
"page/agents.js",
|
||||
"page/model.js",
|
||||
"page/icons.js",
|
||||
"page/scene.js",
|
||||
"page/app.js",
|
||||
"page/icon.svg",
|
||||
"page/icons",
|
||||
"lib",
|
||||
"office.hooks.mjs",
|
||||
"CHANGELOG.md",
|
||||
"README.md",
|
||||
"LICENSE"
|
||||
],
|
||||
"keywords": [
|
||||
"magpie",
|
||||
"magpie-plugin",
|
||||
"magpie-page",
|
||||
"agents",
|
||||
"status",
|
||||
"office",
|
||||
"dashboard",
|
||||
"opencode"
|
||||
],
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/magpie-community/plugins.git",
|
||||
"directory": "packages/agent-office"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/magpie-community/plugins/issues"
|
||||
},
|
||||
"homepage": "https://github.com/magpie-community/plugins/tree/main/packages/agent-office#readme",
|
||||
"engines": {
|
||||
"magpie": ">=0.1.1318"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "bun test"
|
||||
},
|
||||
"magpie": {
|
||||
"page": {
|
||||
"title": "Agent Office",
|
||||
"titles": {
|
||||
"zh": "Agent 办公室",
|
||||
"zh-TW": "Agent 辦公室",
|
||||
"ja": "エージェントオフィス",
|
||||
"de": "Agent-Büro"
|
||||
},
|
||||
"file": "page/index.html",
|
||||
"icon": "page/icon.svg"
|
||||
},
|
||||
"hooks": "./office.hooks.mjs",
|
||||
"permissions": [],
|
||||
"options": {
|
||||
"mode": "office",
|
||||
"dim": "3d",
|
||||
"demo": false,
|
||||
"showDone": true,
|
||||
"hideAfter": "6h",
|
||||
"text": true,
|
||||
"remote": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,305 @@
|
||||
// Every agent magpie knows, with its own icon (page/icons, from magpie's
|
||||
// assets, MIT): what the name tags, cards and legend show. Generated from
|
||||
// magpie's internal/agent; a classic script, it sets globalThis.AgentOfficeAgents.
|
||||
globalThis.AgentOfficeAgents = {
|
||||
"agy": {
|
||||
"name": "Antigravity CLI",
|
||||
"icon": "antigravity-color.svg",
|
||||
"color": "#3b82f6"
|
||||
},
|
||||
"aionui": {
|
||||
"name": "AionUi",
|
||||
"icon": "aionui.svg",
|
||||
"color": null
|
||||
},
|
||||
"air": {
|
||||
"name": "JetBrains Air",
|
||||
"icon": "air.svg",
|
||||
"color": null
|
||||
},
|
||||
"alma": {
|
||||
"name": "Alma",
|
||||
"icon": "alma.png",
|
||||
"color": null
|
||||
},
|
||||
"ante": {
|
||||
"name": "Ante",
|
||||
"icon": null,
|
||||
"color": null
|
||||
},
|
||||
"aside": {
|
||||
"name": "Aside",
|
||||
"icon": "aside.svg",
|
||||
"color": null
|
||||
},
|
||||
"astrbot": {
|
||||
"name": "AstrBot",
|
||||
"icon": "astrbot.svg",
|
||||
"color": null
|
||||
},
|
||||
"atomcode": {
|
||||
"name": "AtomCode",
|
||||
"icon": "atomcode.png",
|
||||
"color": null
|
||||
},
|
||||
"cindy": {
|
||||
"name": "Cindy",
|
||||
"icon": "cindy.png",
|
||||
"color": null
|
||||
},
|
||||
"claude": {
|
||||
"name": "Claude Code",
|
||||
"icon": "claudecode-color.svg",
|
||||
"color": "#d97757"
|
||||
},
|
||||
"claude-desktop": {
|
||||
"name": "Claude Desktop",
|
||||
"icon": "claude-color.svg",
|
||||
"color": "#d97757"
|
||||
},
|
||||
"cline": {
|
||||
"name": "Cline",
|
||||
"icon": "cline.svg",
|
||||
"color": "#0ea5e9"
|
||||
},
|
||||
"codebuddy": {
|
||||
"name": "CodeBuddy Code",
|
||||
"icon": "codebuddy-color.svg",
|
||||
"color": "#0284c7"
|
||||
},
|
||||
"codex": {
|
||||
"name": "Codex",
|
||||
"icon": "codex-color.svg",
|
||||
"color": "#5b5bd6"
|
||||
},
|
||||
"commandcode": {
|
||||
"name": "Command Code",
|
||||
"icon": "commandcode.svg",
|
||||
"color": null
|
||||
},
|
||||
"copilot": {
|
||||
"name": "Copilot CLI",
|
||||
"icon": "githubcopilot.svg",
|
||||
"color": "#7c3aed"
|
||||
},
|
||||
"crush": {
|
||||
"name": "Crush",
|
||||
"icon": "crush.png",
|
||||
"color": "#db2777"
|
||||
},
|
||||
"cursor": {
|
||||
"name": "Cursor CLI",
|
||||
"icon": "cursor.svg",
|
||||
"color": "#334155"
|
||||
},
|
||||
"devin": {
|
||||
"name": "Devin",
|
||||
"icon": "devin.svg",
|
||||
"color": "#0f9d7a"
|
||||
},
|
||||
"droid": {
|
||||
"name": "Droid",
|
||||
"icon": "factory.svg",
|
||||
"color": "#f97316"
|
||||
},
|
||||
"dsh": {
|
||||
"name": "DeepSeek Harness",
|
||||
"icon": "deepseek-color.svg",
|
||||
"color": "#4d6bfe"
|
||||
},
|
||||
"empryo": {
|
||||
"name": "Empryo",
|
||||
"icon": "empryo-color.svg",
|
||||
"color": null
|
||||
},
|
||||
"gemini": {
|
||||
"name": "Gemini CLI",
|
||||
"icon": "geminicli-color.svg",
|
||||
"color": "#3b7cf4"
|
||||
},
|
||||
"goose": {
|
||||
"name": "Goose",
|
||||
"icon": "goose.svg",
|
||||
"color": "#111827"
|
||||
},
|
||||
"grok": {
|
||||
"name": "Grok Build",
|
||||
"icon": "xai.svg",
|
||||
"color": "#1f2937"
|
||||
},
|
||||
"grok-app": {
|
||||
"name": "Grok App",
|
||||
"icon": "grok.svg",
|
||||
"color": "#1f2937"
|
||||
},
|
||||
"hanako": {
|
||||
"name": "OpenHanako",
|
||||
"icon": "hanako.png",
|
||||
"color": null
|
||||
},
|
||||
"hermes": {
|
||||
"name": "Hermes Agent",
|
||||
"icon": "hermes.svg",
|
||||
"color": "#a16207"
|
||||
},
|
||||
"jcode": {
|
||||
"name": "jcode",
|
||||
"icon": "jcode.svg",
|
||||
"color": null
|
||||
},
|
||||
"kilo": {
|
||||
"name": "Kilo Code",
|
||||
"icon": "kilocode.svg",
|
||||
"color": null
|
||||
},
|
||||
"kimi": {
|
||||
"name": "Kimi Code",
|
||||
"icon": "kimi.svg",
|
||||
"color": "#111827"
|
||||
},
|
||||
"kiro": {
|
||||
"name": "Kiro",
|
||||
"icon": "kiro-color.svg",
|
||||
"color": "#7c3aed"
|
||||
},
|
||||
"kirocrew": {
|
||||
"name": "Kiro Crew",
|
||||
"icon": null,
|
||||
"color": null
|
||||
},
|
||||
"lody": {
|
||||
"name": "Lody",
|
||||
"icon": "lody.png",
|
||||
"color": null
|
||||
},
|
||||
"minimax-code": {
|
||||
"name": "MiniMax Code",
|
||||
"icon": "minimax-color.svg",
|
||||
"color": "#e5484d"
|
||||
},
|
||||
"morph": {
|
||||
"name": "Mister Morph",
|
||||
"icon": "mistermorph-color.svg",
|
||||
"color": null
|
||||
},
|
||||
"mothx": {
|
||||
"name": "MothX",
|
||||
"icon": "mothx.png",
|
||||
"color": null
|
||||
},
|
||||
"muse": {
|
||||
"name": "Muse Code",
|
||||
"icon": "meta-color.svg",
|
||||
"color": null
|
||||
},
|
||||
"newmax": {
|
||||
"name": "NewMax",
|
||||
"icon": null,
|
||||
"color": null
|
||||
},
|
||||
"omp": {
|
||||
"name": "omp",
|
||||
"icon": "omp.svg",
|
||||
"color": null
|
||||
},
|
||||
"openchamber": {
|
||||
"name": "OpenChamber",
|
||||
"icon": "openchamber.svg",
|
||||
"color": null
|
||||
},
|
||||
"opencode": {
|
||||
"name": "OpenCode",
|
||||
"icon": "opencode.svg",
|
||||
"color": "#334155"
|
||||
},
|
||||
"openpencil": {
|
||||
"name": "OpenPencil",
|
||||
"icon": null,
|
||||
"color": null
|
||||
},
|
||||
"pencil": {
|
||||
"name": "Pencil",
|
||||
"icon": null,
|
||||
"color": null
|
||||
},
|
||||
"penguin": {
|
||||
"name": "PenguinHarness",
|
||||
"icon": "penguin-color.svg",
|
||||
"color": null
|
||||
},
|
||||
"pi": {
|
||||
"name": "Pi",
|
||||
"icon": "pi.svg",
|
||||
"color": "#0f766e"
|
||||
},
|
||||
"pi-desktop": {
|
||||
"name": "PI-Desktop",
|
||||
"icon": "pi.svg",
|
||||
"color": null
|
||||
},
|
||||
"qoder": {
|
||||
"name": "Qoder",
|
||||
"icon": "qoder.svg",
|
||||
"color": "#16a34a"
|
||||
},
|
||||
"qoder-cn": {
|
||||
"name": "Qoder CN",
|
||||
"icon": "qoder.svg",
|
||||
"color": "#16a34a"
|
||||
},
|
||||
"qwen": {
|
||||
"name": "Qwen Code",
|
||||
"icon": "qwen-color.svg",
|
||||
"color": "#615ced"
|
||||
},
|
||||
"raycast": {
|
||||
"name": "Raycast",
|
||||
"icon": "raycast.svg",
|
||||
"color": null
|
||||
},
|
||||
"reasonix": {
|
||||
"name": "Reasonix Studio",
|
||||
"icon": "reasonix-color.svg",
|
||||
"color": null
|
||||
},
|
||||
"snow": {
|
||||
"name": "Snow CLI",
|
||||
"icon": "snow.png",
|
||||
"color": null
|
||||
},
|
||||
"stepcode": {
|
||||
"name": "StepCode",
|
||||
"icon": "stepfun-color.svg",
|
||||
"color": null
|
||||
},
|
||||
"t3code": {
|
||||
"name": "T3 Code",
|
||||
"icon": "t3code.svg",
|
||||
"color": null
|
||||
},
|
||||
"trae": {
|
||||
"name": "Trae",
|
||||
"icon": "trae.svg",
|
||||
"color": "#ef4444"
|
||||
},
|
||||
"workbuddy": {
|
||||
"name": "WorkBuddy",
|
||||
"icon": "workbuddy-color.svg",
|
||||
"color": "#0284c7"
|
||||
},
|
||||
"zcode": {
|
||||
"name": "ZCode",
|
||||
"icon": "zcode.png",
|
||||
"color": "#2563eb"
|
||||
},
|
||||
"zed": {
|
||||
"name": "Zed",
|
||||
"icon": "zed.svg",
|
||||
"color": "#0751cf"
|
||||
},
|
||||
"zoo-code": {
|
||||
"name": "Zoo Code",
|
||||
"icon": "zoo-code.png",
|
||||
"color": null
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,539 @@
|
||||
// The page: loads live.js (what the plugin's host part wrote) again every
|
||||
// second, works out each agent's status (model.js), and draws the office
|
||||
// (scene.js) or the list. It reads nothing of magpie's but its own options,
|
||||
// and has no network: live.js is one of its own files.
|
||||
//
|
||||
// Interaction, kept calm on purpose: nothing opens because the pointer
|
||||
// passes over it. Hovering only highlights. A click on a worker, its name
|
||||
// tag, or a row opens that agent's panel at the side, which stays put (it
|
||||
// doesn't ride the animation) until it's closed or another agent is
|
||||
// clicked. The DOM is updated in place: nothing is rebuilt each second.
|
||||
(async () => {
|
||||
const M = globalThis.AgentOfficeModel
|
||||
const I = globalThis.AgentOfficeIcons
|
||||
const { Scene } = globalThis.AgentOfficeScene
|
||||
const $ = (id) => document.getElementById(id)
|
||||
const theme = await magpie.ready
|
||||
let lang = theme.lang
|
||||
let opts = {}
|
||||
try { opts = (await magpie.options.get()) || {} } catch {}
|
||||
const view = {
|
||||
mode: opts.mode === "list" ? "list" : "office",
|
||||
dim: opts.dim === "2d" ? "2d" : "3d",
|
||||
demo: opts.demo === true,
|
||||
showDone: opts.showDone !== false,
|
||||
hideAfter: M.HIDE[opts.hideAfter] !== undefined ? opts.hideAfter : M.DEFAULTS.hideAfter,
|
||||
text: opts.text !== false,
|
||||
approvalAfterSec: Number(opts.approvalAfterSec) > 0 ? Number(opts.approvalAfterSec) : M.DEFAULTS.approvalAfterSec,
|
||||
}
|
||||
const state = { snap: null, loaded: false, list: [], open: "", hover: "", showText: true }
|
||||
let floatHome = null
|
||||
const t = () => M.text(lang)
|
||||
const el = (tag, cls, text) => {
|
||||
const e = document.createElement(tag)
|
||||
if (cls) e.className = cls
|
||||
if (text != null) e.textContent = text
|
||||
return e
|
||||
}
|
||||
// a status as a person reads it: the sub-state says more than the six
|
||||
function label(a) {
|
||||
const w = t()
|
||||
if (a.sub === "approval") return w.approval
|
||||
if (a.sub === "ask") return w.ask
|
||||
if (a.sub === "stopped") return w.stopped
|
||||
if (a.sub === "stuck") return M.fill(w.stuck, M.duration(Date.now() - a.at, lang))
|
||||
return w[a.status]
|
||||
}
|
||||
|
||||
// ---- words -----------------------------------------------------------
|
||||
function words() {
|
||||
document.querySelectorAll("[data-t]").forEach((e) => { e.textContent = t()[e.dataset.t] })
|
||||
$("pip").textContent = floatHome ? t().pipOn : t().pip
|
||||
document.documentElement.lang = lang || "en"
|
||||
statusLegend()
|
||||
lastLegend = ""
|
||||
}
|
||||
|
||||
function statusLegend() {
|
||||
$("statusLegend").replaceChildren(...M.STATUSES.map((s) => {
|
||||
const e = el("span", "lg")
|
||||
const dot = el("i")
|
||||
dot.style.background = M.COLORS[s]
|
||||
e.append(dot, document.createTextNode(t()[s]))
|
||||
return e
|
||||
}))
|
||||
}
|
||||
|
||||
// the agents in the office now, each once, by its own icon
|
||||
let lastLegend = ""
|
||||
function brandLegend() {
|
||||
const ids = []
|
||||
for (const a of state.list) if (!ids.includes(a.agent)) ids.push(a.agent)
|
||||
const sig = ids.join(",")
|
||||
if (sig === lastLegend) return
|
||||
lastLegend = sig
|
||||
$("brandLegend").replaceChildren(...ids.map((id) => {
|
||||
const b = M.brand(id)
|
||||
const e = el("span", "lg")
|
||||
e.append(I.mark(b, 18), document.createTextNode(b.name))
|
||||
return e
|
||||
}))
|
||||
}
|
||||
|
||||
// ---- reading live.js ---------------------------------------------------
|
||||
let loading = false
|
||||
function load() {
|
||||
if (loading) return
|
||||
loading = true
|
||||
const s = document.createElement("script")
|
||||
s.src = "live.js?t=" + Date.now()
|
||||
const done = () => { loading = false; s.remove() }
|
||||
s.onload = () => {
|
||||
const snap = globalThis.AgentOfficeLive || null
|
||||
const changed = snap?.written !== state.snap?.written
|
||||
state.snap = snap
|
||||
state.loaded = true
|
||||
done()
|
||||
if (changed) refresh()
|
||||
}
|
||||
s.onerror = () => { const first = !state.loaded; state.loaded = true; done(); if (first) refresh() }
|
||||
document.head.append(s)
|
||||
}
|
||||
|
||||
function snapshot(now) {
|
||||
if (!view.demo) return state.snap
|
||||
state.demoSnap ??= M.demo(now)
|
||||
return M.merge(state.snap, state.demoSnap)
|
||||
}
|
||||
|
||||
// ---- the office ------------------------------------------------------
|
||||
const scene = new Scene($("office"), { dim: view.dim, onFrame: place })
|
||||
const tags = new Map()
|
||||
|
||||
function tagFor(a) {
|
||||
let e = tags.get(a.key)
|
||||
if (!e) {
|
||||
e = el("button", "tag")
|
||||
e.type = "button"
|
||||
e.dataset.key = a.key
|
||||
e.addEventListener("click", (ev) => { ev.stopPropagation(); open(a.key) })
|
||||
e.addEventListener("mouseenter", () => highlight(a.key))
|
||||
e.addEventListener("mouseleave", () => highlight(""))
|
||||
$("tags").append(e)
|
||||
tags.set(a.key, e)
|
||||
}
|
||||
const sig = [a.brand.icon, a.brand.name, a.title, a.status].join("|")
|
||||
if (e.dataset.sig !== sig) {
|
||||
e.dataset.sig = sig
|
||||
const name = el("span", "tn", a.title)
|
||||
const dot = el("i", "td")
|
||||
dot.style.background = M.COLORS[a.status]
|
||||
e.replaceChildren(I.mark(a.brand, 15), name, dot)
|
||||
e.dataset.status = a.status
|
||||
e._w = 0 // measured again on the next frame
|
||||
}
|
||||
e.title = `${a.brand.name} · ${label(a)}`
|
||||
return e
|
||||
}
|
||||
|
||||
// each frame: the tags follow their workers; nothing else moves with them
|
||||
function place(anchors) {
|
||||
const seen = new Set()
|
||||
// in the small window only the ones that need you keep a name tag
|
||||
const few = floatHome ? new Set(state.list.filter((a) => a.status === "waiting" || a.status === "error" || a.key === state.open).map((a) => a.key)) : null
|
||||
const shown = []
|
||||
for (const p of anchors) {
|
||||
const e = tags.get(p.key)
|
||||
if (!e) continue
|
||||
if (!e._w) e._w = e.offsetWidth || 90
|
||||
shown.push({ e, p })
|
||||
}
|
||||
// two tags that would sit on each other are stacked, the lower one first
|
||||
shown.sort((a, b) => a.p.y - b.p.y || a.p.x - b.p.x)
|
||||
const placed = []
|
||||
const H = 24
|
||||
for (const it of shown) {
|
||||
let y = it.p.y
|
||||
for (let pass = 0; pass < 6; pass++) {
|
||||
const hit = placed.find((q) => Math.abs(q.x - it.p.x) < (q.w + it.e._w) / 2 + 4 && Math.abs(q.y - y) < H)
|
||||
if (!hit) break
|
||||
y = hit.y - H
|
||||
}
|
||||
it.y = y
|
||||
placed.push({ x: it.p.x, y, w: it.e._w })
|
||||
}
|
||||
for (const it of shown) {
|
||||
seen.add(it.p.key)
|
||||
const tf = `translate(${Math.round(it.p.x)}px, ${Math.round(it.y)}px) translate(-50%, -100%)`
|
||||
if (it.e.style.transform !== tf) it.e.style.transform = tf
|
||||
}
|
||||
for (const [k, e] of tags) {
|
||||
const hide = !seen.has(k) || (few ? !few.has(k) : false)
|
||||
if (e.hidden !== hide) e.hidden = hide
|
||||
}
|
||||
}
|
||||
|
||||
// the pointer over a worker or its tag only highlights it
|
||||
function highlight(key) {
|
||||
if (state.hover === key) return
|
||||
state.hover = key
|
||||
scene.highlight = key
|
||||
for (const [k, e] of tags) e.classList.toggle("hot", k === key)
|
||||
}
|
||||
|
||||
let moveQueued = false
|
||||
$("office").addEventListener("pointermove", (e) => {
|
||||
if (moveQueued) return
|
||||
moveQueued = true
|
||||
const x = e.offsetX, y = e.offsetY
|
||||
requestAnimationFrame(() => {
|
||||
moveQueued = false
|
||||
const k = scene.hit(x, y)
|
||||
$("office").style.cursor = k ? "pointer" : ""
|
||||
highlight(k)
|
||||
})
|
||||
})
|
||||
$("office").addEventListener("pointerleave", () => highlight(""))
|
||||
$("office").addEventListener("click", (e) => {
|
||||
const k = scene.hit(e.offsetX, e.offsetY)
|
||||
if (k) open(k)
|
||||
else close()
|
||||
})
|
||||
|
||||
// ---- the panel ---------------------------------------------------------
|
||||
// one agent, opened by a click, at the side; it doesn't move with the
|
||||
// scene and is updated in place each second
|
||||
const panel = $("pop")
|
||||
const P = {}
|
||||
;(() => {
|
||||
const head = el("div", "ph")
|
||||
P.mark = el("span", "pmk")
|
||||
P.agent = el("span", "pa")
|
||||
P.when = el("span", "pw")
|
||||
P.close = el("button", "px", "✕")
|
||||
P.close.type = "button"
|
||||
P.close.setAttribute("aria-label", "Close")
|
||||
P.close.addEventListener("click", close)
|
||||
head.append(P.mark, P.agent, P.when, P.close)
|
||||
P.title = el("div", "pt")
|
||||
P.status = el("div", "ps")
|
||||
P.stIcon = el("span", "pi")
|
||||
P.stText = el("span", "pst")
|
||||
P.stMore = el("span", "pn")
|
||||
P.status.append(P.stIcon, P.stText, P.stMore)
|
||||
P.query = el("div", "pq")
|
||||
P.step = el("div", "pstep")
|
||||
P.err = el("div", "perr")
|
||||
P.reply = el("div", "pr")
|
||||
const foot = el("div", "pf")
|
||||
P.meta = el("span", "pm")
|
||||
P.copy = el("button", "pc")
|
||||
P.copy.type = "button"
|
||||
P.copy.addEventListener("click", (e) => { e.stopPropagation(); showCommand(P.copy.dataset.value, P.copy) })
|
||||
foot.append(P.meta, P.copy)
|
||||
P.src = el("div", "psrc")
|
||||
panel.replaceChildren(head, P.title, P.status, P.query, P.step, P.err, P.reply, foot, P.src)
|
||||
})()
|
||||
panel.addEventListener("click", (e) => e.stopPropagation())
|
||||
|
||||
const ICON = { done: "✓", error: "!", waiting: "?", thinking: "…", executing: "⟳", replying: "✎" }
|
||||
function fillPanel(a) {
|
||||
const w = t()
|
||||
const setText = (node, s) => { if (node.textContent !== s) node.textContent = s }
|
||||
if (P.mark.dataset.icon !== a.brand.icon + a.brand.name) {
|
||||
P.mark.dataset.icon = a.brand.icon + a.brand.name
|
||||
P.mark.replaceChildren(I.mark(a.brand, 18))
|
||||
}
|
||||
setText(P.agent, a.brand.name)
|
||||
setText(P.when, M.ago(Date.now() - a.at, lang))
|
||||
setText(P.title, a.title)
|
||||
P.status.className = "ps " + a.status
|
||||
setText(P.stIcon, ICON[a.status] || "")
|
||||
setText(P.stText, label(a))
|
||||
const more = a.status === "executing" && a.since > 3000 ? M.fill(w.ran, M.duration(a.since, lang)) : a.turns ? M.fill(w.turns, a.turns) : ""
|
||||
setText(P.stMore, more)
|
||||
const q = a.query || (state.showText ? "" : w.quiet)
|
||||
setText(P.query, q); P.query.hidden = !q
|
||||
setText(P.step, a.step ? "› " + a.step : ""); P.step.hidden = !a.step
|
||||
setText(P.err, a.error); P.err.hidden = !a.error
|
||||
setText(P.reply, a.reply ? "← " + a.reply : ""); P.reply.hidden = !a.reply
|
||||
setText(P.meta, [a.model, a.project].filter(Boolean).join(" · "))
|
||||
const copy = a.resume || a.session
|
||||
P.copy.hidden = !copy
|
||||
const box = P.copy.nextElementSibling
|
||||
if (box?.classList.contains("pcopy")) box.remove()
|
||||
if (copy && P.copy.dataset.value !== copy) {
|
||||
P.copy.dataset.value = copy
|
||||
P.copy.dataset.label = a.resume ? w.copyResume : w.copySession
|
||||
P.copy.textContent = P.copy.dataset.label
|
||||
}
|
||||
setText(P.src, a.source === "files" ? w.fromFiles : w.via)
|
||||
}
|
||||
|
||||
function open(key) {
|
||||
if (state.open === key) return close()
|
||||
const a = state.list.find((x) => x.key === key)
|
||||
if (!a) return
|
||||
state.open = key
|
||||
scene.selected = key
|
||||
fillPanel(a)
|
||||
panel.hidden = false
|
||||
for (const [k, e] of tags) e.classList.toggle("on", k === key)
|
||||
for (const tr of $("rows").children) tr.classList.toggle("on", tr.dataset.key === key)
|
||||
}
|
||||
function close() {
|
||||
if (!state.open) return
|
||||
state.open = ""
|
||||
scene.selected = ""
|
||||
panel.hidden = true
|
||||
for (const e of tags.values()) e.classList.remove("on")
|
||||
for (const tr of $("rows").children) tr.classList.remove("on")
|
||||
}
|
||||
|
||||
// magpie frames a page with allow="", so a page cannot reach the
|
||||
// clipboard. Show the command selected instead: ⌘C / Ctrl+C copies it
|
||||
// without a step that can only fail.
|
||||
function showCommand(s, btn) {
|
||||
const box = el("input", "pcopy")
|
||||
box.readOnly = true
|
||||
box.value = s
|
||||
box.setAttribute("aria-label", btn.dataset.label || "")
|
||||
btn.hidden = true
|
||||
btn.after(box)
|
||||
box.focus()
|
||||
box.select()
|
||||
}
|
||||
|
||||
// ---- the list --------------------------------------------------------
|
||||
// rows kept by key and updated in place, so nothing jumps under the pointer
|
||||
const rowsByKey = new Map()
|
||||
function rowFor(a) {
|
||||
let r = rowsByKey.get(a.key)
|
||||
if (!r) {
|
||||
const tr = el("tr")
|
||||
tr.dataset.key = a.key
|
||||
tr.tabIndex = 0
|
||||
const c = () => { const td = el("td"); tr.append(td); return td }
|
||||
r = { tr, ag: c(), task: c(), st: c(), dir: c(), model: c(), when: c() }
|
||||
r.ag.className = "ag"; r.task.className = "task"; r.dir.className = "mono"; r.model.className = "mono"; r.when.className = "muted"
|
||||
r.mark = el("span"); r.name = el("span"); r.ag.append(r.mark, r.name)
|
||||
r.title = el("div", "lt"); r.sub = el("div", "ls"); r.task.append(r.title, r.sub)
|
||||
r.badge = el("span", "badge"); r.st.append(r.badge)
|
||||
tr.addEventListener("click", () => open(a.key))
|
||||
tr.addEventListener("keydown", (e) => { if (e.key === "Enter") open(a.key) })
|
||||
rowsByKey.set(a.key, r)
|
||||
}
|
||||
const set = (n, s) => { if (n.textContent !== s) n.textContent = s }
|
||||
if (r.mark.dataset.icon !== a.brand.icon) { r.mark.dataset.icon = a.brand.icon; r.mark.replaceChildren(I.mark(a.brand, 16)) }
|
||||
set(r.name, a.brand.name)
|
||||
set(r.title, a.title)
|
||||
set(r.sub, a.status === "waiting" || a.status === "done" || a.status === "error" ? a.error || a.reply || a.step || a.query : a.step || a.query)
|
||||
r.badge.style.setProperty("--c", M.COLORS[a.status])
|
||||
set(r.badge, label(a))
|
||||
set(r.dir, a.project)
|
||||
set(r.model, a.model)
|
||||
set(r.when, M.ago(Date.now() - a.at, lang))
|
||||
r.tr.classList.toggle("on", a.key === state.open)
|
||||
return r.tr
|
||||
}
|
||||
function rows() {
|
||||
const list = M.sorted(state.list)
|
||||
$("emptyList").hidden = list.length > 0
|
||||
$("emptyList").textContent = emptyText()
|
||||
const want = list.map(rowFor)
|
||||
const body = $("rows")
|
||||
const keys = new Set(list.map((a) => a.key))
|
||||
for (const [k, r] of rowsByKey) if (!keys.has(k)) { r.tr.remove(); rowsByKey.delete(k) }
|
||||
// put rows in order, moving only the ones out of place
|
||||
want.forEach((tr, i) => { if (body.children[i] !== tr) body.insertBefore(tr, body.children[i] || null) })
|
||||
}
|
||||
|
||||
function emptyText() {
|
||||
return state.loaded && state.snap ? t().empty : t().noFile
|
||||
}
|
||||
|
||||
// ---- everything ------------------------------------------------------
|
||||
function refresh() {
|
||||
const now = Date.now()
|
||||
// text off in the page as well as the host: a stale live.js or a host
|
||||
// that has not restarted yet must not render what the switch hid
|
||||
state.showText = view.text && state.snap?.text !== false
|
||||
state.list = M.agents(snapshot(now), now, view)
|
||||
if (!state.showText) state.list = M.redact(state.list)
|
||||
const c = M.counts(state.list)
|
||||
const set = (id, v) => { const n = $(id); if (n.textContent !== String(v)) n.textContent = v }
|
||||
set("nNeed", c.needYou)
|
||||
set("nWork", c.working)
|
||||
set("nDone", c.done)
|
||||
$("counts").classList.toggle("alert", c.needYou > 0)
|
||||
scene.setAgents(state.list)
|
||||
const keys = new Set(state.list.map((a) => a.key))
|
||||
for (const [k, e] of tags) if (!keys.has(k)) { e.remove(); tags.delete(k) }
|
||||
for (const a of state.list) tagFor(a)
|
||||
if (state.open) {
|
||||
const a = state.list.find((x) => x.key === state.open)
|
||||
if (a) fillPanel(a)
|
||||
else close()
|
||||
}
|
||||
$("empty").hidden = state.list.length > 0
|
||||
if (!$("empty").hidden) $("empty").textContent = emptyText()
|
||||
set("note", view.demo ? t().demoOn : "")
|
||||
const age = state.snap?.written ? now - state.snap.written : 0
|
||||
const live = $("live")
|
||||
live.classList.toggle("stale", !!state.snap && age > 15000)
|
||||
live.title = state.snap ? M.fill(t().stale, M.ago(age, lang)) : ""
|
||||
if (view.mode === "list") rows()
|
||||
brandLegend()
|
||||
document.title = c.needYou ? `(${c.needYou}) ${t().title}` : t().title
|
||||
}
|
||||
|
||||
function select(group, attr, value) {
|
||||
$(group).querySelectorAll("button").forEach((b) => b.setAttribute("aria-selected", String(b.dataset[attr] === value)))
|
||||
}
|
||||
|
||||
function setMode(m) {
|
||||
view.mode = m
|
||||
select("modes", "mode", m)
|
||||
$("stage").hidden = m !== "office"
|
||||
$("listview").hidden = m !== "list"
|
||||
$("dims").classList.toggle("off", m !== "office")
|
||||
if (m === "office") { scene.resize(); scene.start() } else scene.stop()
|
||||
refresh()
|
||||
}
|
||||
|
||||
// saving restarts the plugin's host (magpie's options do), so a change
|
||||
// waits until it has been left alone a moment, and only a real change is
|
||||
// written
|
||||
let saving = null
|
||||
let saved = JSON.stringify(opts)
|
||||
const textOn = () => $("optText").checked
|
||||
function wanted() {
|
||||
return { ...opts, mode: view.mode, dim: view.dim, demo: view.demo, showDone: view.showDone, hideAfter: view.hideAfter, text: textOn() }
|
||||
}
|
||||
function save() {
|
||||
clearTimeout(saving)
|
||||
saving = setTimeout(async () => {
|
||||
saving = null
|
||||
const next = wanted()
|
||||
if (JSON.stringify(next) === saved) return
|
||||
try { opts = await magpie.options.set(next); saved = JSON.stringify(opts) } catch {}
|
||||
}, 2500)
|
||||
}
|
||||
|
||||
$("modes").addEventListener("click", (e) => {
|
||||
const m = e.target.closest("button")?.dataset.mode
|
||||
if (!m || m === view.mode) return
|
||||
setMode(m)
|
||||
save()
|
||||
})
|
||||
$("dims").addEventListener("click", (e) => {
|
||||
const d = e.target.closest("button")?.dataset.dim
|
||||
if (!d || d === view.dim) return
|
||||
view.dim = d
|
||||
select("dims", "dim", d)
|
||||
scene.setDim(d)
|
||||
if (view.mode !== "office") setMode("office")
|
||||
save()
|
||||
})
|
||||
|
||||
// settings
|
||||
const menu = $("settings")
|
||||
$("settingsBtn").addEventListener("click", (e) => {
|
||||
e.stopPropagation()
|
||||
menu.hidden = !menu.hidden
|
||||
$("settingsBtn").setAttribute("aria-expanded", String(!menu.hidden))
|
||||
})
|
||||
document.addEventListener("click", (e) => { if (!menu.hidden && !menu.contains(e.target) && e.target !== $("settingsBtn")) { menu.hidden = true; $("settingsBtn").setAttribute("aria-expanded", "false") } })
|
||||
$("optDemo").checked = view.demo
|
||||
$("optDone").checked = view.showDone
|
||||
$("optText").checked = opts.text !== false
|
||||
select("optHide", "hide", view.hideAfter)
|
||||
$("optDemo").addEventListener("change", (e) => { view.demo = e.target.checked; state.demoSnap = null; refresh(); save() })
|
||||
$("optDone").addEventListener("change", (e) => { view.showDone = e.target.checked; refresh(); save() })
|
||||
$("optText").addEventListener("change", (e) => { view.text = e.target.checked; refresh(); save() })
|
||||
$("optHide").addEventListener("click", (e) => {
|
||||
const h = e.target.closest("button")?.dataset.hide
|
||||
if (!h) return
|
||||
view.hideAfter = h
|
||||
select("optHide", "hide", h)
|
||||
refresh()
|
||||
save()
|
||||
})
|
||||
|
||||
// picture in picture: the office in a window of the page's own (magpie's
|
||||
// frame refuses the browser's own floating window to a sandboxed page).
|
||||
// Its bar moves it, its corner reshapes it, ✕ or Escape puts it back.
|
||||
function openFloat() {
|
||||
if (floatHome) return
|
||||
const stage = $("stage")
|
||||
const ph = el("div", "stage-slot", t().floating)
|
||||
stage.parentElement.insertBefore(ph, stage)
|
||||
floatHome = { parent: ph.parentElement, ph }
|
||||
$("floatslot").append(stage)
|
||||
$("float").hidden = false
|
||||
$("float").style.cssText = ""
|
||||
$("pip").classList.add("on")
|
||||
$("pip").textContent = t().pipOn
|
||||
scene.resize()
|
||||
}
|
||||
function closeFloat() {
|
||||
if (!floatHome) return
|
||||
floatHome.parent.insertBefore($("stage"), floatHome.ph)
|
||||
floatHome.ph.remove()
|
||||
floatHome = null
|
||||
$("float").hidden = true
|
||||
$("pip").classList.remove("on")
|
||||
$("pip").textContent = t().pip
|
||||
scene.resize()
|
||||
}
|
||||
$("floatClose").addEventListener("click", closeFloat)
|
||||
$("floatbar").addEventListener("pointerdown", (e) => {
|
||||
if (e.target.closest(".fclose")) return
|
||||
const f = $("float")
|
||||
const box = f.getBoundingClientRect()
|
||||
const dx = e.clientX - box.left, dy = e.clientY - box.top
|
||||
f.setPointerCapture?.(e.pointerId)
|
||||
const move = (m) => {
|
||||
const x = Math.max(0, Math.min(innerWidth - box.width, m.clientX - dx))
|
||||
const y = Math.max(0, Math.min(innerHeight - box.height, m.clientY - dy))
|
||||
Object.assign(f.style, { left: x + "px", top: y + "px", right: "auto", bottom: "auto" })
|
||||
}
|
||||
const up = () => { removeEventListener("pointermove", move); removeEventListener("pointerup", up) }
|
||||
addEventListener("pointermove", move)
|
||||
addEventListener("pointerup", up)
|
||||
e.preventDefault()
|
||||
})
|
||||
$("pip").addEventListener("click", () => {
|
||||
if (floatHome) return closeFloat()
|
||||
if (view.mode !== "office") setMode("office")
|
||||
openFloat()
|
||||
})
|
||||
|
||||
// the canvas is sized only when its box really changes
|
||||
let resizeQueued = false
|
||||
new ResizeObserver(() => {
|
||||
if (resizeQueued) return
|
||||
resizeQueued = true
|
||||
requestAnimationFrame(() => { resizeQueued = false; scene.resize() })
|
||||
}).observe($("stage"))
|
||||
document.addEventListener("keydown", (e) => {
|
||||
if (e.key !== "Escape") return
|
||||
if (state.open) return close()
|
||||
if (floatHome) closeFloat()
|
||||
})
|
||||
document.addEventListener("visibilitychange", () => {
|
||||
if (document.hidden) scene.stop()
|
||||
else if (view.mode === "office") scene.start()
|
||||
})
|
||||
magpie.onTheme((th) => { lang = th.lang; words(); refresh() })
|
||||
|
||||
select("modes", "mode", view.mode)
|
||||
select("dims", "dim", view.dim)
|
||||
words()
|
||||
setMode(view.mode)
|
||||
load()
|
||||
// the host writes live.js within a second and a half of a change; the
|
||||
// page looks every second, and "N min ago" moves with its own clock
|
||||
setInterval(load, 1000)
|
||||
setInterval(() => { if (state.open) { const a = state.list.find((x) => x.key === state.open); if (a) fillPanel(a) } }, 5000)
|
||||
})()
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M8 1.8 14 5v6l-6 3.2L2 11V5z M2 5l6 3.2L14 5 M8 8.2v6" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linejoin="round"/><circle cx="8" cy="5" r="1.1" fill="currentColor"/></svg>
|
||||
|
After Width: | Height: | Size: 260 B |
@@ -0,0 +1,33 @@
|
||||
// Each agent's mark: its own icon, the file magpie itself shows for it
|
||||
// (page/icons, copied from magpie's assets with page/agents.js). An agent
|
||||
// magpie has no icon for gets its initial on its colour. A classic script:
|
||||
// it sets globalThis.AgentOfficeIcons.
|
||||
(() => {
|
||||
// an element with the agent's mark, size px square
|
||||
function mark(brand, size = 16) {
|
||||
const s = document.createElement("span")
|
||||
s.className = "mark"
|
||||
s.style.width = s.style.height = size + "px"
|
||||
if (brand.icon) {
|
||||
const img = document.createElement("img")
|
||||
img.src = "icons/" + brand.icon
|
||||
img.alt = ""
|
||||
img.width = img.height = size
|
||||
img.decoding = "async"
|
||||
img.draggable = false
|
||||
// a file that doesn't load falls back to the initial
|
||||
img.onerror = () => { img.remove(); letter(s, brand, size) }
|
||||
s.append(img)
|
||||
} else letter(s, brand, size)
|
||||
return s
|
||||
}
|
||||
|
||||
function letter(s, brand, size) {
|
||||
s.classList.add("letter")
|
||||
s.style.background = brand.color
|
||||
s.style.fontSize = Math.round(size * 0.62) + "px"
|
||||
s.textContent = String(brand.name || "?").trim().charAt(0).toUpperCase()
|
||||
}
|
||||
|
||||
globalThis.AgentOfficeIcons = { mark }
|
||||
})()
|
||||
@@ -0,0 +1 @@
|
||||
<svg fill="currentColor" height="1em" style="flex:none;line-height:1" viewBox="0 0 80 80" width="1em" xmlns="http://www.w3.org/2000/svg"><title>AionUi</title><path d="M40 20Q38 22 25 40Q23 42 26 42L30 42Q32 40 40 30Q48 40 50 42L54 42Q57 42 55 40Q42 22 40 20Z"></path><circle cx="40" cy="46" r="3"></circle><path d="M18 50Q40 70 62 50" fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="3.5"></path></svg>
|
||||
|
After Width: | Height: | Size: 425 B |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 7.5 KiB |
@@ -0,0 +1,28 @@
|
||||
<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_3720_17128)">
|
||||
<path d="M56.9375 31.6738C56.9388 31.7823 56.9404 31.8911 56.9404 32C56.9404 32.0644 56.9389 32.1291 56.9385 32.1934C56.8345 45.8783 45.7094 56.9395 32 56.9395C30.6085 56.9395 29.2434 56.8256 27.9141 56.6064C27.3793 56.518 27.2976 55.8201 27.7266 55.542C27.7811 55.5724 27.8436 55.5948 27.9141 55.6064C29.2434 55.8256 30.6085 55.9395 32 55.9395C45.6095 55.9395 56.6693 45.0389 56.9316 31.4922C56.9328 31.5525 56.9367 31.6134 56.9375 31.6738Z" fill="#000"/>
|
||||
<path d="M38.3145 39.5625C38.4856 39.6394 38.5389 39.859 38.4209 40.0049C34.4382 44.9261 30.045 48.5593 26.0938 50.6084C22.5921 52.4242 20.0866 52.7156 18.4785 52.3613C17.4846 52.1422 16.6878 51.4063 16.2383 50.4932C15.6369 49.2714 15.2416 47.5446 15.3105 45.2578C15.3665 47.0556 15.728 48.4563 16.2383 49.4932C16.6878 50.4063 17.4846 51.1422 18.4785 51.3613C20.0866 51.7156 22.5921 51.4242 26.0938 49.6084C29.9246 47.6218 34.168 44.144 38.0527 39.4492C38.139 39.4867 38.2269 39.5231 38.3145 39.5625Z" fill="#000"/>
|
||||
<path d="M18.4385 24.8818C18.5499 24.977 18.5727 25.1403 18.4922 25.2627C17.7302 26.4181 17.0255 27.5814 16.3799 28.7441C13.4388 33.9918 11.6671 39.2061 11.1826 43.6816C11.121 44.2476 10.3717 44.44 10.0986 43.9404C8.19024 40.4472 7.09384 36.4468 7.06152 32.1934C7.06107 32.1291 7.05957 32.0644 7.05957 32C7.05957 31.8911 7.06023 31.7823 7.06152 31.6738C7.0625 31.598 7.06574 31.5219 7.06738 31.4463C7.14038 35.6053 8.22812 39.5165 10.0986 42.9404C10.3717 43.44 11.121 43.2476 11.1826 42.6816C11.6671 38.2061 13.4388 32.9918 16.3799 27.7441C16.9457 26.725 17.5585 25.7066 18.2139 24.6924C18.289 24.7563 18.3645 24.8187 18.4385 24.8818Z" fill="#000"/>
|
||||
<path d="M45.8057 39.1992C46.9619 40.1962 48.2518 41.281 49.6797 42.4785C49.8546 42.6252 49.8869 42.8825 49.7529 43.0674L49.5391 43.3604C48.0723 42.1301 46.7519 41.0208 45.5752 40.002C45.4638 39.9055 45.4435 39.7401 45.5264 39.6182C45.6209 39.479 45.7128 39.3386 45.8057 39.1992Z" fill="#000"/>
|
||||
<path d="M25.6172 34.2979C25.7798 36.4917 24.8232 38.9809 22.7842 42.542L22.6963 42.4785C22.5152 42.3468 22.4666 42.095 22.5791 41.9014C24.4462 38.6877 25.4669 36.3316 25.6172 34.2979Z" fill="#000"/>
|
||||
<path d="M48.2588 16.5908C48.2898 17.673 48.2144 18.9446 48.0137 20.4385C47.2724 24.9108 45.1103 30.3267 41.5459 35.7334C41.4431 35.8894 41.2184 35.9059 41.0928 35.7676C38.9435 33.4009 37.9884 31.4093 38.1523 29.04C38.2891 30.9892 39.2524 32.741 41.0928 34.7676C41.2184 34.9059 41.4431 34.8894 41.5459 34.7334C45.1103 29.3267 47.2724 23.9108 48.0137 19.4385C48.1556 18.382 48.2352 17.4366 48.2588 16.5908Z" fill="#000"/>
|
||||
<path d="M32 1.12988C48.0163 1.12988 61 14.5033 61 31C61 31.1667 60.9958 31.333 60.9932 31.499C60.7335 15.2333 47.8538 2.12988 32 2.12988C16.1462 2.12989 3.26551 15.2333 3.00586 31.499C3.00322 31.333 3 31.1667 3 31C3 14.5033 15.9837 1.12989 32 1.12988Z" fill="#000"/>
|
||||
<path d="M39.3936 18.7578C39.543 18.5909 39.7983 18.5597 39.9795 18.6914L41.1709 19.5576C41.3519 19.6893 41.4014 19.9402 41.2891 20.1338C41.2189 20.2546 41.1499 20.3746 41.082 20.4932L39.9795 19.6914C39.7983 19.5597 39.543 19.5909 39.3936 19.7578C33.7757 26.0312 31.0071 26.8222 25.0586 23.7402C24.8966 23.6561 24.8507 23.4426 24.9668 23.3018C25.0854 23.158 25.2066 23.0168 25.3262 22.875C31.0923 25.7954 33.8602 24.9368 39.3936 18.7578Z" fill="#000"/>
|
||||
<path d="M36.5615 7.50586C36.9481 7.7182 36.9404 8.33763 36.4873 8.54883C31.6315 10.8118 26.3765 15.0772 21.7588 20.8066C21.6218 20.9752 21.4853 21.1451 21.3496 21.3164C21.2583 21.4316 21.0951 21.4616 20.9697 21.3848C19.4694 20.4652 17.7925 19.4036 15.8906 18.2129C15.6971 18.0918 15.443 18.1407 15.3086 18.3252L13.9873 20.1436C13.9407 20.1045 13.8936 20.0657 13.8467 20.0264C13.6715 19.8796 13.6401 19.6224 13.7744 19.4375L15.3086 17.3252C15.443 17.1407 15.6971 17.0918 15.8906 17.2129C17.7925 18.4036 19.4694 19.4652 20.9697 20.3848C21.0951 20.4616 21.2583 20.4316 21.3496 20.3164C21.4853 20.1451 21.6218 19.9752 21.7588 19.8066C26.3765 14.0772 31.6315 9.81182 36.4873 7.54883C36.5138 7.53646 36.538 7.52087 36.5615 7.50586Z" fill="#000"/>
|
||||
<path d="M61 33C60.9999 49.4967 48.0162 62.8701 32 62.8701C15.9838 62.8701 3.00006 49.4967 3 33C3 32.8327 3.0032 32.6657 3.00586 32.499C3.26462 48.7655 16.1456 61.8701 32 61.8701C47.8544 61.8701 60.7344 48.7655 60.9932 32.499C60.9958 32.6657 61 32.8327 61 33Z" fill="#000"/>
|
||||
<path d="M43.3584 42.5928C43.4489 42.477 43.6115 42.4456 43.7373 42.5215C45.1138 43.3522 46.6296 44.2992 48.3174 45.3545C48.5111 45.4756 48.7661 45.4261 48.9004 45.2412L49.5391 44.3604C49.5858 44.3996 49.6326 44.439 49.6797 44.4785C49.8546 44.6252 49.8869 44.8825 49.7529 45.0674L48.9004 46.2412C48.7661 46.4261 48.5111 46.4756 48.3174 46.3545C46.6296 45.2992 45.1138 44.3522 43.7373 43.5215C43.6115 43.4456 43.4489 43.477 43.3584 43.5928C38.5834 49.7097 33.0004 54.2085 27.8174 56.4932C27.7849 56.5075 27.7546 56.5238 27.7266 56.542C27.3397 56.3262 27.3543 55.6974 27.8174 55.4932C33.0004 53.2085 38.5834 48.7097 43.3584 42.5928Z" fill="#000"/>
|
||||
<path d="M21.5029 28.0957C21.6014 27.9422 21.8185 27.9207 21.9482 28.0488C24.6046 30.6719 25.8071 32.7273 25.6172 35.2979C25.4596 33.1711 24.2515 31.3232 21.9482 29.0488C21.8185 28.9207 21.6014 28.9422 21.5029 29.0957C20.9328 29.9845 20.4005 30.8726 19.9062 31.7559C17.5103 36.0815 16.0483 40.3126 15.5186 43.9463C15.3981 44.7727 15.3321 45.5427 15.3105 46.2578C15.2799 45.2747 15.3398 44.1727 15.5186 42.9463C16.0483 39.3126 17.5103 35.0815 19.9062 30.7559C20.4005 29.8726 20.9328 28.9845 21.5029 28.0957Z" fill="#000"/>
|
||||
<path d="M24.4736 44.2783C29.8543 38.2684 32.7749 37.0727 38.3145 39.5625C38.4856 39.6394 38.5389 39.859 38.4209 40.0049C38.2995 40.1549 38.1749 40.3016 38.0527 40.4492C32.681 38.1138 29.7693 39.3634 24.4736 45.2783C24.3243 45.4451 24.0699 45.4761 23.8887 45.3447L22.6963 44.4785C22.5152 44.3468 22.4666 44.095 22.5791 43.9014C22.6492 43.7807 22.7165 43.6603 22.7842 43.542L23.8887 44.3447C24.0699 44.4761 24.3243 44.4451 24.4736 44.2783Z" fill="#000"/>
|
||||
<path d="M53.0791 20.8086C53.1398 20.2357 53.902 20.048 54.167 20.5596C55.8921 23.8955 56.8861 27.6714 56.9375 31.6738C56.9388 31.7823 56.9404 31.8911 56.9404 32C56.9404 32.0644 56.9389 32.1291 56.9385 32.1934C56.9377 32.2931 56.9336 32.3927 56.9316 32.4922C56.853 28.557 55.866 24.8451 54.167 21.5596C53.902 21.048 53.1398 21.2357 53.0791 21.8086C52.4968 27.3425 50.01 33.89 45.8057 40.1992C45.7286 40.1327 45.6511 40.0677 45.5752 40.002C45.4638 39.9055 45.4435 39.7401 45.5264 39.6182C49.9012 33.181 52.4839 26.4647 53.0791 20.8086Z" fill="#000"/>
|
||||
<path d="M32 7.05957C33.4955 7.05957 34.9607 7.19106 36.3838 7.44336C36.9135 7.53751 36.9932 8.23002 36.5615 8.50586C36.5093 8.47719 36.4502 8.45517 36.3838 8.44336C34.9607 8.19106 33.4955 8.05957 32 8.05957C18.411 8.05957 7.36181 18.928 7.06738 32.4463C7.0659 32.3621 7.06216 32.2778 7.06152 32.1934C7.06107 32.1291 7.05957 32.0644 7.05957 32C7.05957 31.8911 7.06023 31.7823 7.06152 31.6738C7.23633 18.0503 18.335 7.05957 32 7.05957Z" fill="#000"/>
|
||||
<path d="M41.1709 21.5576C41.3519 21.6893 41.4014 21.9402 41.2891 22.1338C39.3629 25.4482 38.3005 27.8985 38.1523 30.04C37.9904 27.7304 38.9905 25.1439 41.082 21.4932L41.1709 21.5576Z" fill="#000"/>
|
||||
<path d="M13.9873 21.1436C15.6527 22.5379 17.1354 23.769 18.4385 24.8818C18.5499 24.977 18.5727 25.1403 18.4922 25.2627C18.3981 25.4054 18.3062 25.5495 18.2139 25.6924C16.9284 24.5984 15.4742 23.3896 13.8467 22.0264C13.6715 21.8796 13.6401 21.6224 13.7744 21.4375L13.9873 21.1436Z" fill="#000"/>
|
||||
<path d="M37.3555 12.8906C40.9317 11.1236 43.5958 10.8706 45.3682 11.3281C46.4364 11.604 47.2999 12.4117 47.7061 13.4375C48.1054 14.4465 48.3088 15.7939 48.2588 17.5908C48.2213 16.2817 48.0276 15.2499 47.7061 14.4375C47.2999 13.4117 46.4364 12.604 45.3682 12.3281C43.5958 11.8706 40.9317 12.1236 37.3555 13.8906C33.5314 15.7802 29.1715 19.3163 25.3262 23.875C25.2381 23.8304 25.1481 23.7866 25.0586 23.7402C24.8966 23.6561 24.8507 23.4426 24.9668 23.3018C28.8975 18.5362 33.4125 14.8389 37.3555 12.8906Z" fill="#000"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M32 2.12988C48.0163 2.12988 61 15.5031 61 31.9999C61 48.4966 48.0163 61.8699 32 61.8699C15.9837 61.8699 3 48.4966 3 31.9999C3 15.5031 15.9837 2.12988 32 2.12988ZM54.1672 20.5599C53.9023 20.0478 53.1393 20.2356 53.079 20.809C52.4838 26.4652 49.901 33.181 45.5262 39.6182C45.4433 39.7401 45.4638 39.9052 45.5752 40.0017C46.7896 41.0531 48.1568 42.2012 49.6801 43.4788C49.8552 43.6256 49.8869 43.8829 49.7526 44.0678L48.9002 45.241C48.7659 45.4259 48.5114 45.4753 48.3176 45.3541C46.6298 44.2989 45.1138 43.3523 43.7373 42.5216C43.6113 42.4456 43.4484 42.4768 43.3579 42.5927C38.5829 48.7096 33.0007 53.2087 27.8177 55.4933C27.289 55.7263 27.3443 56.5125 27.9144 56.6066C29.2437 56.8258 30.6086 56.9399 32 56.9399C45.7095 56.9399 56.8351 45.8781 56.9389 32.193C56.9393 32.1287 56.94 32.0643 56.94 31.9999C56.94 31.8909 56.9392 31.782 56.9379 31.6734C56.8865 27.6709 55.8923 23.8958 54.1672 20.5599ZM21.9484 28.0484C21.8186 27.9203 21.6017 27.942 21.5033 28.0955C20.9329 28.9845 20.4005 29.8729 19.9061 30.7563C17.5102 35.082 16.0482 39.3126 15.5184 42.9463C15.0127 46.4154 15.4486 48.889 16.238 50.4929C16.6876 51.4063 17.4848 52.1422 18.4789 52.3612C20.087 52.7155 22.5924 52.4244 26.0942 50.6085C30.0455 48.5594 34.4382 44.9263 38.4209 40.005C38.539 39.8592 38.4857 39.6399 38.3145 39.563C32.7748 37.073 29.8542 38.2682 24.4733 44.2784C24.3239 44.4453 24.0697 44.4759 23.8885 44.3443L22.6967 43.4784C22.5155 43.3468 22.4664 43.0951 22.5789 42.9014C26.8059 35.6256 26.7065 32.7469 21.9484 28.0484ZM32 7.05988C18.335 7.05988 7.23679 18.0499 7.06198 31.6734C7.06069 31.782 7.06 31.8909 7.06 31.9999C7.06 32.0643 7.06068 32.1287 7.06113 32.193C7.0934 36.4466 8.19033 40.4468 10.0988 43.9402C10.3719 44.44 11.1217 44.2476 11.183 43.6813C11.6675 39.2057 13.4387 33.9916 16.3798 28.7439C17.0254 27.5811 17.7299 26.4183 18.4919 25.2628C18.5726 25.1404 18.5502 24.977 18.4387 24.8818C17.0991 23.7378 15.5692 22.4693 13.8466 21.0263C13.6714 20.8795 13.6396 20.6221 13.774 20.4372L15.3083 18.3256C15.4426 18.1407 15.6972 18.0914 15.8909 18.2126C17.7928 19.4034 19.4698 20.4649 20.9701 21.3845C21.0955 21.4614 21.2582 21.4318 21.3495 21.3166C21.4854 21.1452 21.6218 20.975 21.759 20.8063C26.3767 15.0768 31.6318 10.8118 36.4876 8.54883C37.002 8.30908 36.9422 7.54283 36.3834 7.44377C34.9603 7.19147 33.4955 7.05988 32 7.05988ZM45.3678 11.3285C43.5954 10.8709 40.9315 11.1233 37.3552 12.8903C33.4122 14.8386 28.8977 18.5361 24.967 23.3017C24.8507 23.4426 24.8966 23.6564 25.0588 23.7404C31.0074 26.8224 33.7759 26.0313 39.3938 19.7578C39.5432 19.5909 39.7978 19.5598 39.979 19.6915L41.1708 20.5573C41.352 20.689 41.4014 20.9402 41.2888 21.1339C37.2317 28.1154 37.0009 31.2617 41.0932 35.7678C41.2188 35.9061 41.4426 35.8898 41.5454 35.7338C45.11 30.327 47.2726 24.9111 48.0139 20.4387C48.4575 17.1374 48.2936 14.9211 47.7062 13.4372C47.3 12.4113 46.4361 11.6043 45.3678 11.3285Z" fill="#000"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_3720_17128">
|
||||
<rect width="64" height="64" fill="#000"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 11 KiB |
@@ -0,0 +1 @@
|
||||
<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>AstrBot</title><g fill="#2f86bd" transform="matrix(0.048 0 0 0.048 1.8384 1.7392)"><path d="m246.3 328.1-17.8 41.2c-6.4 14.8-26.9 14.8-33.3 0l-17.8-41.2c-14.9-34.2-41.8-61.4-75.3-76.3l-48.8-21.6c-14.7-6.5-14.7-27.9 0-34.4l47.2-21c34.4-15.3 61.7-43.5 76.4-78.8l18-43.7c6.3-15.2 27.3-15.2 33.6 0l18 43.7c14.7 35.3 42 63.6 76.4 78.8l47.2 21c14.7 6.5 14.7 27.9 0 34.4l-48.8 21.6c-33.5 14.8-60.4 42.1-75.3 76.2z" transform="translate(0 35)"/><path d="m402.2 449.3-5.3 12.2c-3.5 7.9-14.4 7.9-17.9 0l-5.3-12.2c-8.4-19.3-23.6-34.6-42.4-43l-15.4-6.9c-7.9-3.5-7.9-14.9 0-18.4l14.5-6.5c19.4-8.6 34.8-24.5 43.1-44.5l5.4-13.1c3.4-8.1 14.6-8.1 18 0l5.4 13.1c8.3 19.9 23.7 35.8 43.1 44.5l14.5 6.5c7.9 3.5 7.9 14.9 0 18.4l-15.4 6.9c-19 8.3-34.1 23.7-42.5 43z" transform="matrix(0.95 0 0 0.95 22 -278)"/></g></svg>
|
||||
|
After Width: | Height: | Size: 922 B |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 7.9 KiB |
@@ -0,0 +1 @@
|
||||
<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Claude</title><path d="M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z" fill="#D97757" fill-rule="nonzero"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1 @@
|
||||
<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Claude Code</title><path clip-rule="evenodd" d="M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z" fill="#D97757" fill-rule="evenodd"></path></svg>
|
||||
|
After Width: | Height: | Size: 424 B |
@@ -0,0 +1 @@
|
||||
<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Cline</title><path d="M17.035 3.991c2.75 0 4.98 2.24 4.98 5.003v1.667l1.45 2.896a1.01 1.01 0 01-.002.909l-1.448 2.864v1.668c0 2.762-2.23 5.002-4.98 5.002H7.074c-2.751 0-4.98-2.24-4.98-5.002V17.33l-1.48-2.855a1.01 1.01 0 01-.003-.927l1.482-2.887V8.994c0-2.763 2.23-5.003 4.98-5.003h9.962zM8.265 9.6a2.274 2.274 0 00-2.274 2.274v4.042a2.274 2.274 0 004.547 0v-4.042A2.274 2.274 0 008.265 9.6zm7.326 0a2.274 2.274 0 00-2.274 2.274v4.042a2.274 2.274 0 104.548 0v-4.042A2.274 2.274 0 0015.59 9.6z"></path><path d="M12.054 5.558a2.779 2.779 0 100-5.558 2.779 2.779 0 000 5.558z"></path></svg>
|
||||
|
After Width: | Height: | Size: 750 B |
@@ -0,0 +1 @@
|
||||
<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>CodeBuddy</title><path d="M18.821 0H5.18A5.179 5.179 0 000 5.179V18.82A5.179 5.179 0 005.179 24H18.82A5.179 5.179 0 0024 18.821V5.18A5.179 5.179 0 0018.821 0z" fill="url(#lobe-icons-code-buddy-_R_0_)"></path><path d="M18.777 1.647c.28-.02.536.114.972.51 1.018.926 2.437 2.828 3.318 4.452l.34.631.482.24.11.06v3.638a5.206 5.206 0 00-5.32-1.23c-.491.166-1.021.471-2.08 1.082l-6.09 3.516c-1.057.61-1.586.916-1.975 1.259a5.208 5.208 0 00-1.493 5.572c.165.49.471 1.02 1.082 2.08l.315.543h-3.26c-.685 0-1.34-.135-1.939-.377-.169-.956-.009-1.789.469-2.335.158-.18.164-.189.13-.493a11.846 11.846 0 01-.057-1.711l.02-.444-.667-1.18C2.1 15.622 1.445 14.078 1.192 12.9c-.133-.647-.125-.934.04-1.146.1-.128.427-.261.822-.334.994-.175 3.162-.017 5.575.41l.25.043.551-.487c.915-.81 1.522-1.264 2.641-1.962 1.167-.73 2.484-1.331 3.967-1.807l.476-.152.261-.688c.937-2.471 1.896-4.293 2.58-4.9.235-.21.25-.22.422-.23z" fill="#fff"></path><path d="M12.139 18.2a1.203 1.203 0 011.642.44l1.296 2.243a1.204 1.204 0 01-2.083 1.203l-1.296-2.243a1.203 1.203 0 01.44-1.644zM18.629 14.452a1.203 1.203 0 011.642.44l1.295 2.244a1.203 1.203 0 11-2.083 1.203l-1.295-2.243a1.203 1.203 0 01.44-1.644z" fill="#fff"></path><defs><radialGradient cx="0" cy="0" gradientTransform="matrix(-9.00009 -16 16 -9.00009 21 24.5)" gradientUnits="userSpaceOnUse" id="lobe-icons-code-buddy-_R_0_" r="1"><stop stop-color="#2EA99D"></stop><stop offset="1" stop-color="#6C4DFF"></stop></radialGradient></defs></svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1 @@
|
||||
<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Codex</title><path d="M19.503 0H4.496A4.496 4.496 0 000 4.496v15.007A4.496 4.496 0 004.496 24h15.007A4.496 4.496 0 0024 19.503V4.496A4.496 4.496 0 0019.503 0z" fill="#fff"></path><path d="M9.064 3.344a4.578 4.578 0 012.285-.312c1 .115 1.891.54 2.673 1.275.01.01.024.017.037.021a.09.09 0 00.043 0 4.55 4.55 0 013.046.275l.047.022.116.057a4.581 4.581 0 012.188 2.399c.209.51.313 1.041.315 1.595a4.24 4.24 0 01-.134 1.223.123.123 0 00.03.115c.594.607.988 1.33 1.183 2.17.289 1.425-.007 2.71-.887 3.854l-.136.166a4.548 4.548 0 01-2.201 1.388.123.123 0 00-.081.076c-.191.551-.383 1.023-.74 1.494-.9 1.187-2.222 1.846-3.711 1.838-1.187-.006-2.239-.44-3.157-1.302a.107.107 0 00-.105-.024c-.388.125-.78.143-1.204.138a4.441 4.441 0 01-1.945-.466 4.544 4.544 0 01-1.61-1.335c-.152-.202-.303-.392-.414-.617a5.81 5.81 0 01-.37-.961 4.582 4.582 0 01-.014-2.298.124.124 0 00.006-.056.085.085 0 00-.027-.048 4.467 4.467 0 01-1.034-1.651 3.896 3.896 0 01-.251-1.192 5.189 5.189 0 01.141-1.6c.337-1.112.982-1.985 1.933-2.618.212-.141.413-.251.601-.33.215-.089.43-.164.646-.227a.098.098 0 00.065-.066 4.51 4.51 0 01.829-1.615 4.535 4.535 0 011.837-1.388zm3.482 10.565a.637.637 0 000 1.272h3.636a.637.637 0 100-1.272h-3.636zM8.462 9.23a.637.637 0 00-1.106.631l1.272 2.224-1.266 2.136a.636.636 0 101.095.649l1.454-2.455a.636.636 0 00.005-.64L8.462 9.23z" fill="url(#lobe-icons-codex-_R_0_)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-codex-_R_0_" x1="12" x2="12" y1="3" y2="21"><stop stop-color="#B1A7FF"></stop><stop offset=".5" stop-color="#7A9DFF"></stop><stop offset="1" stop-color="#3941FF"></stop></linearGradient></defs></svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1 @@
|
||||
<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 144 144" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Command Code</title><path fill-rule="evenodd" clip-rule="evenodd" d="M73.1399 5.87207H70.4648C53.6901 5.87207 41.6998 5.88454 32.5877 7.10962C23.6446 8.312 18.3583 10.5847 14.4715 14.4715C10.5847 18.3583 8.312 23.6446 7.10962 32.5877C5.88454 41.6998 5.87207 53.6901 5.87207 70.4648V73.1398C5.87207 89.9145 5.88454 101.905 7.10962 111.017C8.312 119.96 10.5847 125.246 14.4715 129.133C18.3583 133.02 23.6446 135.293 32.5877 136.495C41.6998 137.72 53.6901 137.733 70.4648 137.733H73.1398C89.9145 137.733 101.905 137.72 111.017 136.495C119.96 135.293 125.246 133.02 129.133 129.133C133.02 125.246 135.293 119.96 136.495 111.017C137.72 101.905 137.733 89.9146 137.733 73.1399V70.4648C137.733 53.6901 137.72 41.6998 136.495 32.5877C135.293 23.6446 133.02 18.3583 129.133 14.4715C125.246 10.5847 119.96 8.312 111.017 7.10962C101.905 5.88454 89.9146 5.87207 73.1399 5.87207ZM10.3193 10.3193C0 20.6387 0 37.2474 0 70.4648V73.1398C0 106.357 0 122.966 10.3193 133.285C20.6387 143.605 37.2474 143.605 70.4648 143.605H73.1398C106.357 143.605 122.966 143.605 133.285 133.285C143.605 122.966 143.605 106.357 143.605 73.1399V70.4648C143.605 37.2474 143.605 20.6387 133.285 10.3193C122.966 0 106.357 0 73.1399 0H70.4648C37.2474 0 20.6387 0 10.3193 10.3193Z"/><path d="M98.8049 27.6163C89.3295 27.6163 81.6214 35.3243 81.6214 44.7997V52.1641H61.9832V44.7997C61.9832 35.3243 54.2752 27.6163 44.7997 27.6163C35.3243 27.6163 27.6163 35.3243 27.6163 44.7997C27.6163 54.2752 35.3243 61.9832 44.7997 61.9832H52.1641V81.6214H44.7997C35.3243 81.6214 27.6163 89.3295 27.6163 98.8049C27.6163 108.28 35.3243 115.988 44.7997 115.988C54.2752 115.988 61.9832 108.28 61.9832 98.8049V91.4406H81.6214V98.8049C81.6214 108.28 89.3295 115.988 98.8049 115.988C108.28 115.988 115.988 108.28 115.988 98.8049C115.988 89.3295 108.28 81.6214 98.8049 81.6214H91.4406V61.9832H98.8049C108.28 61.9832 115.988 54.2752 115.988 44.7997C115.988 35.3243 108.28 27.6163 98.8049 27.6163ZM91.4406 52.1641V44.7997C91.4406 40.7248 94.73 37.4354 98.8049 37.4354C102.88 37.4354 106.169 40.7248 106.169 44.7997C106.169 48.8747 102.88 52.1641 98.8049 52.1641H91.4406ZM44.7997 52.1641C40.7248 52.1641 37.4354 48.8747 37.4354 44.7997C37.4354 40.7248 40.7248 37.4354 44.7997 37.4354C48.8747 37.4354 52.1641 40.7248 52.1641 44.7997V52.1641H44.7997ZM61.9832 81.6214V61.9832H81.6214V81.6214H61.9832ZM98.8049 106.169C94.73 106.169 91.4406 102.88 91.4406 98.8049V91.4406H98.8049C102.88 91.4406 106.169 94.73 106.169 98.8049C106.169 102.88 102.88 106.169 98.8049 106.169ZM44.7997 106.169C40.7248 106.169 37.4354 102.88 37.4354 98.8049C37.4354 94.73 40.7248 91.4406 44.7997 91.4406H52.1641V98.8049C52.1641 102.88 48.8747 106.169 44.7997 106.169Z"/></svg>
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 16 KiB |
@@ -0,0 +1 @@
|
||||
<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Cursor</title><path d="M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z"></path></svg>
|
||||
|
After Width: | Height: | Size: 547 B |
@@ -0,0 +1 @@
|
||||
<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>DeepSeek</title><path d="M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z" fill="#4D6BFE"></path></svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
@@ -0,0 +1 @@
|
||||
<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Devin</title><path d="M2.033 9.867l2.554 1.483a.589.589 0 00.592 0l2.554-1.483.01-.008a.608.608 0 00.11-.084l.013-.015a.631.631 0 00.076-.1c.003-.005.008-.01.01-.016a.558.558 0 00.052-.125l.007-.028a.611.611 0 00.019-.14V7.868c0-.572.307-1.105.8-1.392a1.595 1.595 0 011.598 0l1.277.742a.54.54 0 00.129.053l.028.01c.044.01.088.015.133.016h.006l.013-.002a.587.587 0 00.27-.074l.011-.004 2.554-1.483a.596.596 0 00.297-.516V2.253a.595.595 0 00-.297-.516L12.293.257a.587.587 0 00-.591 0L9.148 1.737l-.01.01a.609.609 0 00-.109.083l-.014.015a.632.632 0 00-.076.1c-.003.005-.008.01-.01.016a.57.57 0 00-.052.124l-.007.028a.612.612 0 00-.018.14v1.483c0 .572-.307 1.105-.8 1.393a1.597 1.597 0 01-1.599 0l-1.276-.742a.603.603 0 00-.13-.053l-.028-.008a.658.658 0 00-.133-.018h-.02a.57.57 0 00-.269.074c-.003.002-.008.002-.012.005L2.033 5.872a.596.596 0 00-.297.515v2.966c0 .213.113.41.297.515z"></path><path d="M15.943 10.607a1.596 1.596 0 011.599 0l1.276.74c.041.025.085.04.13.055l.028.008c.043.01.088.016.133.018h.005c.005 0 .01-.002.014-.003a.474.474 0 00.122-.016l.021-.005a.616.616 0 00.126-.052c.004-.002.009-.002.013-.005l2.554-1.482a.597.597 0 00.297-.516V6.383a.596.596 0 00-.297-.515l-2.552-1.483a.587.587 0 00-.592 0l-2.553 1.482-.011.008a.61.61 0 00-.108.084l-.014.016a.637.637 0 00-.076.1c-.003.005-.008.01-.01.016a.57.57 0 00-.052.124l-.007.029a.612.612 0 00-.018.14v1.482c0 .572-.307 1.105-.8 1.393a1.597 1.597 0 01-1.599 0l-1.276-.742a.584.584 0 00-.13-.053l-.028-.008a.62.62 0 00-.133-.018h-.02a.587.587 0 00-.269.074l-.012.004L9.15 10a.596.596 0 00-.296.516v2.966c0 .212.112.409.296.515l2.554 1.483s.008.002.012.005c.04.022.082.04.126.052l.02.004a.57.57 0 00.123.017l.014.002h.006c.054 0 .108-.01.16-.025a.587.587 0 00.13-.054l1.277-.741a1.597 1.597 0 012.398 1.392v1.482c0 .049.007.095.019.14l.007.028a.619.619 0 00.051.125c.004.006.008.01.01.016a.6.6 0 00.076.1l.014.015c.033.032.069.06.108.084.004.002.006.006.011.008l2.554 1.483a.59.59 0 00.593 0l2.554-1.483a.597.597 0 00.296-.516v-2.965a.595.595 0 00-.296-.516l-2.554-1.483s-.008-.002-.012-.005a.54.54 0 00-.126-.051c-.007-.003-.013-.003-.02-.005a.635.635 0 00-.125-.017h-.018a.557.557 0 00-.16.026.588.588 0 00-.13.053l-1.276.742a1.595 1.595 0 01-1.598 0 1.615 1.615 0 010-2.785l-.005-.001z"></path><path d="M14.848 18.265l-2.554-1.482-.012-.005a.526.526 0 00-.126-.052c-.007-.002-.014-.002-.02-.005a.64.64 0 00-.124-.017h-.02a.56.56 0 00-.16.026.588.588 0 00-.13.053l-1.276.742a1.594 1.594 0 01-1.598 0c-.493-.286-.8-.82-.8-1.393V14.65a.563.563 0 00-.018-.14l-.008-.028a.604.604 0 00-.051-.124l-.01-.017a.603.603 0 00-.076-.1l-.014-.015a.596.596 0 00-.109-.084c-.003-.002-.005-.006-.01-.008L5.178 12.65a.587.587 0 00-.591 0l-2.554 1.483a.596.596 0 00-.297.516v2.965c0 .213.113.41.297.516l2.554 1.483.012.004a.618.618 0 00.267.074l.016.002h.007a.55.55 0 00.16-.026.584.584 0 00.129-.053l1.277-.742a1.597 1.597 0 012.398 1.393v1.482c0 .05.007.095.019.14l.007.028c.013.044.03.085.051.125l.01.016c.022.036.047.07.076.1l.014.015c.032.032.069.06.109.084l.01.008 2.554 1.483a.587.587 0 00.593 0l2.554-1.483a.596.596 0 00.296-.515v-2.966a.596.596 0 00-.296-.516h-.002z"></path></svg>
|
||||
|
After Width: | Height: | Size: 3.2 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 192 192" width="192" height="192" role="img" aria-label="Empryo"><g transform="translate(16 16)"><defs><mask id="mote-small-cutout" maskUnits="userSpaceOnUse" x="0" y="0" width="160" height="160" style="mask-type:luminance"><g style="transform-origin:34px 40px"><path d="M34 40L26 30" fill="none" stroke="#fff" stroke-width="4.5" stroke-linecap="round"/></g><g style="transform-origin:79px 24px"><path d="M79 24L82 11" fill="none" stroke="#fff" stroke-width="4.5" stroke-linecap="round"/></g><g style="transform-origin:130px 51px"><path d="M130 51L144 48" fill="none" stroke="#fff" stroke-width="4.5" stroke-linecap="round"/></g><g style="transform-origin:120px 113px"><path d="M120 113L130 126" fill="none" stroke="#fff" stroke-width="4.5" stroke-linecap="round"/></g><g style="transform-origin:57px 127px"><path d="M57 127L49 142" fill="none" stroke="#fff" stroke-width="4.5" stroke-linecap="round"/></g><g style="transform-origin:24px 76px"><path d="M24 76L9 73" fill="none" stroke="#fff" stroke-width="4.5" stroke-linecap="round"/></g><path d="M37 38C50 18 86 15 110 29C135 33 144 63 136 88C137 114 111 136 82 132C55 142 29 119 27 97C14 77 20 49 37 38Z" fill="#fff"/><path d="M44 43C56 29 85 26 105 38C125 40 134 64 127 86C128 107 107 126 83 122C61 132 38 112 36 93C26 75 30 53 44 43Z" fill="#000"/><circle cx="99" cy="66" r="25" fill="#fff"/><circle cx="99" cy="66" r="10" fill="#000"/><circle cx="104" cy="60" r="3" fill="#fff"/></mask></defs><g id="empryo-mark" mask="url(#mote-small-cutout)"><g data-cilium="0" style="transform-origin:34px 40px"><path d="M34 40L26 30" fill="none" stroke="#31697e" stroke-width="4.5" stroke-linecap="round"/></g><g data-cilium="2" style="transform-origin:79px 24px"><path d="M79 24L82 11" fill="none" stroke="#31697e" stroke-width="4.5" stroke-linecap="round"/></g><g data-cilium="4" style="transform-origin:130px 51px"><path d="M130 51L144 48" fill="none" stroke="#31697e" stroke-width="4.5" stroke-linecap="round"/></g><g data-cilium="6" style="transform-origin:120px 113px"><path d="M120 113L130 126" fill="none" stroke="#31697e" stroke-width="4.5" stroke-linecap="round"/></g><g data-cilium="8" style="transform-origin:57px 127px"><path d="M57 127L49 142" fill="none" stroke="#31697e" stroke-width="4.5" stroke-linecap="round"/></g><g data-cilium="10" style="transform-origin:24px 76px"><path d="M24 76L9 73" fill="none" stroke="#31697e" stroke-width="4.5" stroke-linecap="round"/></g><path data-motion="membrane" d="M37 38C50 18 86 15 110 29C135 33 144 63 136 88C137 114 111 136 82 132C55 142 29 119 27 97C14 77 20 49 37 38Z" fill="#31697e"/><path d="M44 43C56 29 85 26 105 38C125 40 134 64 127 86C128 107 107 126 83 122C61 132 38 112 36 93C26 75 30 53 44 43Z" fill="#000"/><circle cx="99" cy="66" r="25" fill="#a34170"/><circle cx="99" cy="66" r="10" fill="#000"/><circle cx="104" cy="60" r="3" fill="#a34170"/></g></g></svg>
|
||||
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
@@ -0,0 +1 @@
|
||||
<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Gemini CLI</title><path d="M0 4.391A4.391 4.391 0 014.391 0h15.217A4.391 4.391 0 0124 4.391v15.217A4.391 4.391 0 0119.608 24H4.391A4.391 4.391 0 010 19.608V4.391z" fill="url(#lobe-icons-gemini-cli-_R_0_)"></path><path clip-rule="evenodd" d="M19.74 1.444a2.816 2.816 0 012.816 2.816v15.48a2.816 2.816 0 01-2.816 2.816H4.26a2.816 2.816 0 01-2.816-2.816V4.26A2.816 2.816 0 014.26 1.444h15.48zM7.236 8.564l7.752 3.728-7.752 3.727v2.802l9.557-4.596v-3.866L7.236 5.763v2.801z" fill="#1E1E2E" fill-rule="evenodd"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-gemini-cli-_R_0_" x1="24" x2="0" y1="6.587" y2="16.494"><stop stop-color="#EE4D5D"></stop><stop offset=".328" stop-color="#B381DD"></stop><stop offset=".476" stop-color="#207CFE"></stop></linearGradient></defs></svg>
|
||||
|
After Width: | Height: | Size: 921 B |
@@ -0,0 +1 @@
|
||||
<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>GithubCopilot</title><path d="M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z"></path></svg>
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
@@ -0,0 +1 @@
|
||||
<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Goose</title><path d="M21.595 23.61c1.167-.254 2.405-.944 2.405-.944l-2.167-1.784a12.124 12.124 0 01-2.695-3.131 12.127 12.127 0 00-3.97-4.049l-.794-.462a1.115 1.115 0 01-.488-.815.844.844 0 01.154-.575c.413-.582 2.548-3.115 2.94-3.44.503-.416 1.065-.762 1.586-1.159.074-.056.148-.112.221-.17.003-.002.007-.004.009-.007.167-.131.325-.272.45-.438.453-.524.563-.988.59-1.193-.061-.197-.244-.639-.753-1.148.319.02.705.272 1.056.569.235-.376.481-.773.727-1.171.165-.266-.08-.465-.086-.471h-.001V3.22c-.007-.007-.206-.25-.471-.086-.567.35-1.134.702-1.639 1.021 0 0-.597-.012-1.305.599a2.464 2.464 0 00-.438.45l-.007.009c-.058.072-.114.147-.17.221-.397.521-.743 1.083-1.16 1.587-.323.391-2.857 2.526-3.44 2.94a.842.842 0 01-.574.153 1.115 1.115 0 01-.815-.488l-.462-.794a12.123 12.123 0 00-4.049-3.97 12.133 12.133 0 01-3.13-2.695L1.332 0S.643 1.238.39 2.405c.352.428 1.27 1.49 2.34 2.302C1.58 4.167.73 3.75.06 3.4c-.103.765-.063 1.92.043 2.816.726.317 1.961.806 3.219 1.066-1.006.236-2.11.278-2.961.262.15.554.358 1.119.64 1.688.119.263.25.52.39.77.452.125 2.222.383 3.164.171l-2.51.897a27.776 27.776 0 002.544 2.726c2.031-1.092 2.494-1.241 4.018-2.238-2.467 2.008-3.108 2.828-3.8 3.67l-.483.678c-.25.351-.469.725-.65 1.117-.61 1.31-1.47 4.1-1.47 4.1-.154.486.202.842.674.674 0 0 2.79-.861 4.1-1.47.392-.182.766-.4 1.118-.65l.677-.483c.227-.187.453-.37.701-.586 0 0 1.705 2.02 3.458 3.349l.896-2.511c-.211.942.046 2.712.17 3.163.252.142.509.272.772.392.569.28 1.134.49 1.688.64-.016-.853.026-1.956.261-2.962.26 1.258.75 2.493 1.067 3.219.895.106 2.051.146 2.816.043a73.87 73.87 0 01-1.308-2.67c.811 1.07 1.874 1.988 2.302 2.34h-.001z"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1 @@
|
||||
<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Grok</title><path d="M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815"></path></svg>
|
||||
|
After Width: | Height: | Size: 756 B |
|
After Width: | Height: | Size: 21 KiB |
@@ -0,0 +1 @@
|
||||
<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="12 16 40 40" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Hermes Agent</title><path d="M21 20h7v14h8V20h7v32h-7V40h-8v12h-7zM13 21l7 3v6l-7-3zM51 21l-7 3v6l7-3z"></path></svg>
|
||||
|
After Width: | Height: | Size: 284 B |
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1 @@
|
||||
<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Kilo Code</title><path d="M0 0v24h24V0H0zm22.222 22.222H1.778V1.778h20.444v20.444zm-7.555-4.964h2.222v1.778h-2.794L12.89 17.83v-2.794h1.778v2.222zm4 0h-1.778v-2.222h-2.222v-1.778h2.793l1.207 1.207v2.793zm-7.556-2.591H9.333v-1.778h1.778v1.778zm-5.778-1.778h1.778v4h4v1.778H6.54L5.333 17.46V12.89zm13.334-3.556v1.778h-5.778V9.333h1.987V7.111h-1.987V5.333h2.558l1.206 1.207v2.793h2.014zm-11.556-2h2.222l1.778 1.778v2H9.333v-2H7.111v2H5.333V5.333h1.778v2zm4 0H9.333v-2h1.778v2z"></path></svg>
|
||||
|
After Width: | Height: | Size: 652 B |
@@ -0,0 +1 @@
|
||||
<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Kimi</title><path d="M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z"></path><path d="M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z"></path></svg>
|
||||
|
After Width: | Height: | Size: 786 B |
@@ -0,0 +1 @@
|
||||
<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Kiro</title><path d="M18.8 0H5.2A5.2 5.2 0 000 5.2v13.6A5.2 5.2 0 005.2 24h13.6a5.2 5.2 0 005.2-5.2V5.2A5.2 5.2 0 0018.8 0z" fill="#9046FF"></path><path d="M7.97 16.376c-1.644 3.642 1.86 4.556 4.443 2.424.76 2.39 3.608.607 4.631-1.247 2.251-4.084 1.342-8.249 1.108-9.108-1.6-5.859-9.6-5.869-10.976.03-.323 1.033-.328 2.206-.507 3.423-.09.617-.16 1.009-.393 1.655-.139.373-.323.7-.62 1.257-.458.865-.264 2.53 2.101 1.665l.224-.1h-.01l-.001.001z" fill="#fff"></path><path d="M12.722 10.985c-.656 0-.755-.785-.755-1.252 0-.423.074-.756.218-.97a.61.61 0 01.537-.283c.229 0 .428.095.567.289.159.218.243.55.243.964 0 .785-.303 1.252-.805 1.252h-.005zm2.703 0c-.656 0-.755-.785-.755-1.252 0-.423.074-.756.219-.97a.61.61 0 01.536-.283c.229 0 .428.095.567.289.159.218.243.55.243.964 0 .785-.303 1.252-.805 1.252h-.005z" fill="#000"></path></svg>
|
||||
|
After Width: | Height: | Size: 960 B |
|
After Width: | Height: | Size: 5.9 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -25 150 150" width="1em" height="1em"><title>Meta</title><defs><linearGradient gradientUnits="userSpaceOnUse" id="meta-a" x1="124.599" x2="159.703" y1="96.689" y2="57.25"><stop offset="0.21" stop-color="#0278F1"></stop><stop offset="0.533" stop-color="#0180FA"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="meta-b" x1="43.859" x2="0" y1="4.984" y2="63.795"><stop offset="0.427" stop-color="#0165E0"></stop><stop offset="0.917" stop-color="#0180FA"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="meta-c" x1="28.409" x2="134.567" y1="28.907" y2="71.769"><stop stop-color="#0064E0"></stop><stop offset="0.656" stop-color="#0066E2"></stop><stop offset="1" stop-color="#0278F1"></stop></linearGradient></defs><path d="M107.654 0c-12.3 0-21.915 9.264-30.618 21.032C65.076 5.802 55.073 0 43.103 0 18.698 0 0 31.76 0 65.376 0 86.41 10.177 99.679 27.223 99.679c12.268 0 21.092-5.784 36.778-33.203 0 0 6.539-11.547 11.037-19.501a514.1 514.1 0 0 1 4.98 8.227l7.356 12.374c14.329 23.977 22.312 32.103 36.778 32.103C140.758 99.68 150 86.23 150 64.757 150 29.56 130.88 0 107.654 0ZM52.039 59.051C39.322 78.987 34.922 83.455 27.841 83.455c-7.287 0-11.617-6.397-11.617-17.804 0-24.404 12.167-49.359 26.672-49.359 7.855 0 14.42 4.537 24.474 18.93-9.547 14.645-15.33 23.83-15.33 23.83Zm47.999-2.51-8.795-14.667c-2.38-3.87-4.66-7.428-6.862-10.689 7.927-12.234 14.465-18.33 22.241-18.33 16.155 0 29.079 23.786 29.079 53.002 0 11.137-3.647 17.599-11.205 17.599-7.244 0-10.704-4.785-24.458-26.914Z" fill="#0180FA"></path><path d="M145.119 34.888h-14.878c3.44 8.718 5.46 19.42 5.46 30.969 0 11.137-3.647 17.599-11.205 17.599-1.403 0-2.663-.18-3.884-.63V99.5a33.48 33.48 0 0 0 3.54.18C140.758 99.68 150 86.23 150 64.756c0-10.702-1.768-20.882-4.881-29.868Z" fill="url(#meta-a)"></path><path d="M43.103 0c.253 0 .505.003.756.008v16.308c-.319-.016-.64-.024-.962-.024-14.138 0-26.055 23.706-26.65 47.503H.014C.588 30.77 19.08 0 43.103 0Z" fill="url(#meta-b)"></path><path d="M43.103 0c11.115 0 20.534 5.004 31.4 17.913 3.055 3.817 6.74 8.777 10.682 14.511l.017.025.024-.003c1.939 2.912 3.94 6.05 6.017 9.428l8.795 14.668c13.754 22.13 17.214 26.913 24.458 26.913h.103v16.22c-.148.003-.297.004-.447.004-14.466 0-22.449-8.126-36.778-32.103l-7.356-12.374a587.065 587.065 0 0 0-2.287-3.822l.019-.045c-5.483-8.971-8.971-14.454-11.962-18.44l-.05.037c-9.15-12.59-15.42-16.64-22.842-16.64h-.034V.001l.24-.001Z" fill="url(#meta-c)"></path></svg>
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
@@ -0,0 +1 @@
|
||||
<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Minimax</title><defs><linearGradient id="lobe-icons-minimax-_R_0_" x1="0%" x2="100.182%" y1="50.057%" y2="50.057%"><stop offset="0%" stop-color="#E2167E"></stop><stop offset="100%" stop-color="#FE603C"></stop></linearGradient></defs><path d="M16.278 2c1.156 0 2.093.927 2.093 2.07v12.501a.74.74 0 00.744.709.74.74 0 00.743-.709V9.099a2.06 2.06 0 012.071-2.049A2.06 2.06 0 0124 9.1v6.561a.649.649 0 01-.652.645.649.649 0 01-.653-.645V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v7.472a2.037 2.037 0 01-2.048 2.026 2.037 2.037 0 01-2.048-2.026v-12.5a.785.785 0 00-.788-.753.785.785 0 00-.789.752l-.001 15.904A2.037 2.037 0 0113.441 22a2.037 2.037 0 01-2.048-2.026V18.04c0-.356.292-.645.652-.645.36 0 .652.289.652.645v1.934c0 .263.142.506.372.638.23.131.514.131.744 0a.734.734 0 00.372-.638V4.07c0-1.143.937-2.07 2.093-2.07zm-5.674 0c1.156 0 2.093.927 2.093 2.07v11.523a.648.648 0 01-.652.645.648.648 0 01-.652-.645V4.07a.785.785 0 00-.789-.78.785.785 0 00-.789.78v14.013a2.06 2.06 0 01-2.07 2.048 2.06 2.06 0 01-2.071-2.048V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v3.8a2.06 2.06 0 01-2.071 2.049A2.06 2.06 0 010 12.9v-1.378c0-.357.292-.646.652-.646.36 0 .653.29.653.646V12.9c0 .418.343.757.766.757s.766-.339.766-.757V9.099a2.06 2.06 0 012.07-2.048 2.06 2.06 0 012.071 2.048v8.984c0 .419.343.758.767.758.423 0 .766-.339.766-.758V4.07c0-1.143.937-2.07 2.093-2.07z" fill="url(#lobe-icons-minimax-_R_0_)" fill-rule="nonzero"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 10 KiB |
@@ -0,0 +1 @@
|
||||
<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="12 16 40 40" width="1em" xmlns="http://www.w3.org/2000/svg"><title>omp</title><path d="M14 16h36v8H40v32h-8V24h-6v22h-8V24h-4z"></path></svg>
|
||||
|
After Width: | Height: | Size: 240 B |
@@ -0,0 +1,11 @@
|
||||
<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
||||
<!-- OpenChamber's logo (github.com/openchamber/openchamber, MIT: packages/web/public/favicon.svg) -->
|
||||
<g transform="translate(16, 16) scale(0.48)">
|
||||
<path d="M0 0 L-26 -15 L-26 15 L0 30 Z" fill="#000" fill-opacity="0.25" stroke="#000" stroke-width="4" stroke-linejoin="round"/>
|
||||
<path d="M0 0 L26 -15 L26 15 L0 30 Z" fill="#000" fill-opacity="0.4" stroke="#000" stroke-width="4" stroke-linejoin="round"/>
|
||||
<path d="M0 -30 L-26 -15 L0 0 L26 -15 Z" fill="none" stroke="#000" stroke-width="4" stroke-linejoin="round"/>
|
||||
<g transform="matrix(0.866, 0.5, -0.866, 0.5, 0, -15) scale(0.55)">
|
||||
<rect x="-12" y="-14" width="24" height="28" fill="#000" fill-opacity="0.4" stroke="#000" stroke-width="8"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 824 B |
@@ -0,0 +1 @@
|
||||
<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>opencode</title><path d="M16 6H8v12h8V6zm4 16H4V2h16v20z"></path></svg>
|
||||
|
After Width: | Height: | Size: 235 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="139 129 954 954"><defs><clipPath id="rounded"><rect x="139" y="129" width="954" height="954" rx="230"/></clipPath><linearGradient id="a" x1="432" x2="978" y1="304" y2="884" gradientUnits="userSpaceOnUse"><stop stop-color="#111b2a"/><stop offset="1" stop-color="#091423"/></linearGradient><linearGradient id="b"><stop stop-color="#0e1928"/><stop offset=".4" stop-color="#0b2963"/><stop offset=".7" stop-color="#054ac8"/><stop offset=".82" stop-color="#0258f4"/><stop offset="1" stop-color="#015dfc"/></linearGradient><linearGradient xlink:href="#b" id="c" x1="964" x2="1065" y1="451" y2="423" gradientUnits="userSpaceOnUse"/><linearGradient xlink:href="#b" id="d" x1="365" x2="260" y1="800" y2="860" gradientUnits="userSpaceOnUse"/><linearGradient xlink:href="#b" id="e" x1="442" x2="350" y1="836" y2="905" gradientUnits="userSpaceOnUse"/></defs><g clip-path="url(#rounded)"><path fill="#fefefe" d="M0 0h1254v1254H0Z"/><path fill="#015dfc" d="M475 558v3c-1 0-3 1-4 1-16 4-31 9-47 14-1 0-2 1-4 1-76 26-179 67-217 143-7 15-9 29-4 45 2 5 4 10 8 14s4 4 4 6c1 1 3 1 4 2s2 1 3 2c9 6 18 10 29 14 4 1 4 1 8 3v2c-23 4-48-1-67-14-12-9-19-19-22-34-2-28 8-50 27-71 1-2 3-4 5-6s4-4 5-6l3-3h2c1-1 1-3 2-4 20-19 44-35 69-48 1-1 3-2 4-2 14-8 29-15 44-21l9-3c36-15 74-26 112-34 1 0 2 0 3-1 17-3 17-3 24-3m571 110c-7 13-22 25-33 35l-3 3c-7 6-15 12-23 18-1 1-2 2-3 2-71 54-153 93-236 122-1 0-2 1-3 1-31 11-63 20-95 27-1 0-1 0-4 1-65 14-132 17-198 8 0-1-1-1-1-2 4-1 7-2 11-2 141-16 278-54 423-118 1 0 2-1 3-1 26-12 51-24 75-38 1 0 1 0 5-3 14-8 27-16 40-24 1-1 2-1 4-2 11-8 21-16 32-24 4-3 4-3 6-3"/><path fill="url(#a)" d="M532 329c35 18 68 41 97 68l9 6 12 12c3 3 6 6 10 9 3 3 6 5 8 8 36 34 36 34 56 42l-3-3-17-17c1-5 2-8 5-13 0-1 0-1 2-4 1-2 1-4 2-5 1-2 2-3 2-5 13-26 25-51 45-72 0-1 0-1 2-3 24-26 60-37 94-39 20-1 39 1 58 6 19 6 39 8 58 2-1 6-3 10-7 14-3 2-6 4-9 5 1 1 2 1 3 2 16 11 26 24 30 44 3 18 3 18 0 24h3c50-4 50-4 71 10 2 2 2 2 3 7-5 5-10 6-16 8-31 9-53 23-72 49-1 1-2 2-3 4-24 33-41 70-57 108-17 42-39 80-68 114-1 1-1 2-2 2-10 12-22 24-34 34-2 1-4 3-6 5-12 10-24 18-37 26-1 1-3 2-4 3-73 47-165 69-251 56-21-3-38 2-58 8-1 0-1 0-4 1-2 1-3 1-4 2-2 0-3 0-4 1-6 2-8 7-11 13-4 7-8 14-13 20l-3 3c-9 11-19 23-34 26-6 0-7 0-11-4-2-3-1-6-1-10v-3c-1 1-3 2-4 3-7 4-12 6-20 5-4-2-5-3-6-7 0-8 3-13 8-18h-3c-4-1-4-1-6-3-2-4-2-5-1-9 17-29 46-44 77-53-17-3-37-6-53 2-2 2-4 5-6 7-4 6-9 11-14 16l-3 3c-12 12-27 25-45 29-5 0-6 0-10-4-2-2-2-2-2-6 1-5 2-7 4-11-10 3-10 3-13 4-5 1-8 1-13 0-4-4-4-4-5-8 1-7 6-11 11-16-2-1-3-1-5-2l-2-2c1-11 11-18 19-25 18-16 40-27 63-35 5-2 9-4 13-8l4-4c-2 0-3-1-5-1-18-4-34-10-50-21v-3h3c33-3 64-17 86-42 3-3 6-7 8-11 3-3 6-7 10-10 2-3 4-5 6-8 6-7 13-14 19-21 2-1 3-2 4-3 7-7 14-14 22-20 2-2 4-4 6-5 32-27 68-49 104-69l3 3c9 7 20 10 32 12-2-1-3-2-5-3-24-15-41-37-55-62 0-1 0-1-3-5-5-8-9-16-14-25-15-27-32-52-51-76-1-1-2-3-3-4-6-8-13-15-19-23-4-4-8-9-12-14-1-1-2-2-3-4-12-15-12-15-12-23 1-4 1-4 3-6 25-15 74 11 97 22m288 38-3 3c-16 14-26 35-27 56 0 15 1 27 8 40 1 1 1 2 2 3 10 18 25 29 44 38 2 0 3 1 5 1v2l-3 1c-43 10-81 41-108 76-2 2-4 5-6 7-4 5-8 11-12 16-5 7-11 14-17 21-2 3-5 7-8 10-47 58-107 90-180 104-30 6-56 19-81 38-2 2-4 3-6 4-2 2-3 3-5 4 3 3 9 4 13 6 7 2 14 4 21 7 27 10 54 17 83 20h4c80 7 163-20 228-65 1-1 2-2 4-3 25-17 50-37 69-61 2-2 3-5 5-7 28-32 46-71 62-109 17-40 36-78 63-112-3-2-6-3-10-4-15-4-26-12-37-23 1-2 2-3 3-5 7-10 9-21 7-33-4-19-12-32-29-43-29-16-64-13-89 8"/><path fill="url(#c)" d="M985 405h3c0 2 1 4 1 6h4c49-5 49-5 67 7 4 4 4 4 6 7-1 2-1 3-2 5-1 0-2 1-4 1-3 1-6 2-10 3l-9 3c-19 6-35 15-49 30l-3 3-5 5-6 6c-3-1-5-3-8-4 1-5 2-7 6-11l-12-3c0-1-1-3-1-4 1-1 1-2 2-3 3-5 5-9 6-14 1-2 1-3 2-5 2-6 2-6 2-8l3-3c1-3 1-5 2-8 1-5 2-8 5-13"/><path fill="url(#d)" d="M308 782c1 0 1 1 2 1v4c1 1 3 1 4 2v2c2 0 3-1 5-1l2 2c8 8 15 11 26 11 3 1 7 3 10 4h5l3 1c-2 8-8 14-14 20-2 3-3 5-5 7-13 14-31 31-51 32-5 0-5 0-9-3-2-6 0-11 3-17q-4.5 0-9 3c-5 2-10 2-15 1-3-1-3-1-6-4-1-5 0-8 3-12 2-3 4-5 7-8l-6-3c0-2-1-4-1-6 10-12 21-23 35-31h3v-2c3-1 5-2 8-3"/><path fill="url(#e)" d="M393 824c1 1 2 1 3 2h4c6 1 7 3 11 6 3 1 7 2 10 3 1 1 2 1 4 2 3 1 3 1 8 2 6 1 7 2 10 7l-1 3h-2c-1 2-1 3-2 5-9 19-25 45-45 53-6 2-10 4-16 2-4-4-4-5-4-10 0-2 1-4 1-6-1 0-2 1-3 1-1 1-2 2-3 2-1 1-3 2-4 2-5 3-9 3-15 3-3-2-5-3-6-7 0-7 3-13 8-18-1 0-3-1-4-1-4-1-4-1-6-3-1-5 0-7 2-11 1-2 2-3 3-4s1-2 2-3l8-8c0-1 0-1 3-3 23-22 23-22 34-19"/><path fill="#0e1827" d="M880 387c10 6 19 13 23 25 1 7 1 12-2 18-4 5-8 8-15 8-8 0-11-2-16-7-4-9-3-17 0-25 2-4 2-4 6-8h2c-4-6-10-8-17-10h-15c2-4 2-4 5-6 10-3 20 1 29 5m-3 16c-2 2-2 2-2 6s0 4 4 8c5-3 5-3 6-6 0-3 0-3-3-8Z"/></g></svg>
|
||||
|
After Width: | Height: | Size: 4.5 KiB |
@@ -0,0 +1 @@
|
||||
<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Pi</title><path clip-rule="evenodd" d="M1 1h16.5v11H12v5.5H6.5V23H1V1zm5.5 5.5V12H12V6.5H6.5z"></path><path d="M17.5 12H23v11h-5.5V12z"></path></svg>
|
||||
|
After Width: | Height: | Size: 313 B |
|
After Width: | Height: | Size: 6.1 KiB |
@@ -0,0 +1 @@
|
||||
<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Qwen</title><path d="M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z" fill="url(#lobe-icons-qwen-_R_0_)" fill-rule="nonzero"></path><defs><linearGradient id="lobe-icons-qwen-_R_0_" x1="0%" x2="100%" y1="0%" y2="0%"><stop offset="0%" stop-color="#6336E7" stop-opacity=".84"></stop><stop offset="100%" stop-color="#6F69F7" stop-opacity=".84"></stop></linearGradient></defs></svg>
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
@@ -0,0 +1 @@
|
||||
<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Raycast</title><path d="M6.004 15.492v2.504L0 11.992l1.258-1.249Zm2.504 2.504H6.004L12.008 24l1.253-1.253zm14.24-4.747L24 11.997 12.003 0 10.75 1.251 15.491 6h-2.865L9.317 2.692 8.065 3.944l2.06 2.06H8.691v9.31H18v-1.432l2.06 2.06 1.252-1.252-3.312-3.32V8.506ZM6.63 5.372 5.38 6.625l1.342 1.343 1.251-1.253Zm10.655 10.655-1.247 1.251 1.342 1.343 1.253-1.251zM3.944 8.059 2.692 9.31l3.312 3.314v-2.506zm9.936 9.937h-2.504l3.314 3.312 1.25-1.252z"/></svg>
|
||||
|
After Width: | Height: | Size: 617 B |
@@ -0,0 +1,48 @@
|
||||
<!--
|
||||
Reasonix Studio app icon, from esengine/DeepSeek-Reasonix/desktop/electron/assets/icon.svg.
|
||||
MIT License
|
||||
Copyright (c) 2026 Reasonix Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
-->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
|
||||
<defs>
|
||||
<linearGradient id="tile" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0" stop-color="#23211d"/>
|
||||
<stop offset="1" stop-color="#0b0a09"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="gold" x1="0" y1="0" x2="1" y2="1">
|
||||
<stop offset="0" stop-color="#f6dc9a"/>
|
||||
<stop offset=".48" stop-color="#d4a652"/>
|
||||
<stop offset="1" stop-color="#9a6b25"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="rim" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0" stop-color="#e2bd6e" stop-opacity=".55"/>
|
||||
<stop offset="1" stop-color="#e2bd6e" stop-opacity=".08"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<rect x="103" y="103" width="818" height="818" rx="190" fill="url(#tile)"/>
|
||||
<rect x="106" y="106" width="812" height="812" rx="187" fill="none" stroke="url(#rim)" stroke-width="6"/>
|
||||
<g fill="url(#gold)" transform="translate(512 512) scale(1.9) translate(-359.74 -192.62)">
|
||||
<path d="M369.75,185.3c2.09,1.76,4.98,2.41,7.95,1.06,1.18-.54,1.96-1.91,1.47-3.25-3.92-10.71-14.97-18.54-19.38-12.48-.54.74-.52,1.7-.11,2.29.32.47.97.57,1.82.4,2.68-.56,6.02,1.31,5.7,4.3-.33,3.12.3,5.79,2.56,7.69Z"/>
|
||||
<path d="M434.28,204.78c10.12-11.32,16.46-25.01,18.67-40.07,5.04-32.93-11.31-63.01-42.11-75.75-10.83-4.35-21.95-6.2-33.76-6.09l-114.5.03v219.42s56.29-.04,56.29-.04v-77.17c-1.86-.69-3.15-1.27-3.15-1.27-12.24-5.59-21.6-15.29-26.74-27.44-6.56-15.51-4.54-32.9,5.78-46.12,10.28-12.84,24.31-16.92,40.41-14.67,5.95.83,12.3-6.15,24.4-4.81.81.09,1.63.7,1.71,1.18.28,1.65-4.4,2.54-4.4,7.05,0,1.9.85,4.1,2.65,5.36,6.17,4.33,11.51,9.19,17.1,14.22,2.72,2.44,11.93,9.31,14.27,3.72,1.37-3.26,2.27-6.68,3.18-10.15.45-1.72-.5-2.74-1.89-3.56-9.5-5.63-13.08-17.35-9.37-27.74.36-1,1.29-1.49,2.08-1.52,3.19-.14,1.49,5.78,9.38,8.21,7.49,2.31,7.71,8.53,11.35,6.05,8.48-5.78,11.54-1.05,19.41-8.46.81-.76,2.2-.82,3.04-.23.52.36.97,1.29.93,2.38-.23,6.26-2.67,12.24-6.95,16.84-8.09,8.69-14.89,4.53-15.33,10.62-1.29,17.86-7.13,35.69-19.81,48.66-.41.42-.65,1.01-.58,1.41.07.42.57.83,1.12,1.01l10.68,3.63c1.51.51,2.6,1.87,2.41,3.31-.17,1.26-1.17,2.37-2.61,2.85-7.84,2.59-16.26,2.14-24.24-.27-10.56,8.89-23.54,13.48-37.68,12.93l20.53,28.34,33.49,45.73,66.85-.09-56.68-76.53c13.19-3.89,24.78-10.87,34.07-20.94Z"/>
|
||||
<circle cx="362.14" cy="177.19" r="1.58"/>
|
||||
<path d="M300.31,167.85c-3.53.43-5.65,2.96-5.31,6.74,2.39,26.35,26.7,47.92,53.94,42.72,5.8-1.11,11.08-3.41,15.36-7.74-9.27-7.98-13.79-16.12-21.41-24.13-10.91-11.47-26.43-19.54-42.58-17.59Z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 6.2 KiB |
@@ -0,0 +1 @@
|
||||
<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Stepfun</title><path d="M22.012 0h1.032v.927H24v.968h-.956V3.78h-1.032V1.896h-1.878v-.97h1.878V0zM2.6 12.371V1.87h.969v10.502h-.97zm10.423.66h10.95v.918h-6.208v9.579h-4.742V13.03zM5.629 3.333v12.356H0v4.51h10.386V8L20.859 8l-.003-4.668-15.227.001z" fill="url(#lobe-icons-stepfun-_R_0_)" fill-rule="evenodd"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-stepfun-_R_0_" x1="1.646" x2="18.342" y1="1.916" y2="22.091"><stop stop-color="#01A9FF"></stop><stop offset="1" stop-color="#0160FF"></stop></linearGradient></defs></svg>
|
||||
|
After Width: | Height: | Size: 676 B |
@@ -0,0 +1,4 @@
|
||||
<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<!-- T3 Code's T3 mark (github.com/pingdotgg/t3code, assets/prod/logo.svg, MIT), its letters alone so it draws as a mask -->
|
||||
<path d="M33.4509 93V47.56H15.5309V37H64.3309V47.56H46.4109V93H33.4509ZM86.7253 93.96C82.832 93.96 78.9653 93.4533 75.1253 92.44C71.2853 91.3733 68.032 89.88 65.3653 87.96L70.4053 78.04C72.5386 79.5867 75.0186 80.8133 77.8453 81.72C80.672 82.6267 83.5253 83.08 86.4053 83.08C89.6586 83.08 92.2186 82.44 94.0853 81.16C95.952 79.88 96.8853 78.12 96.8853 75.88C96.8853 73.7467 96.0586 72.0667 94.4053 70.84C92.752 69.6133 90.0853 69 86.4053 69H80.4853V60.44L96.0853 42.76L97.5253 47.4H68.1653V37H107.365V45.4L91.8453 63.08L85.2853 59.32H89.0453C95.9253 59.32 101.125 60.8667 104.645 63.96C108.165 67.0533 109.925 71.0267 109.925 75.88C109.925 79.0267 109.099 81.9867 107.445 84.76C105.792 87.48 103.259 89.6933 99.8453 91.4C96.432 93.1067 92.0586 93.96 86.7253 93.96Z" fill="black"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1013 B |
@@ -0,0 +1 @@
|
||||
<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>TRAE</title><path d="M24 20.541H3.428v-3.426H0V3.4h24V20.54zM3.428 17.115h17.144V6.827H3.428v10.288zm8.573-5.196l-2.425 2.424-2.424-2.424 2.424-2.424 2.425 2.424zm6.857-.001l-2.424 2.423-2.425-2.423 2.425-2.425 2.424 2.425z"></path></svg>
|
||||
|
After Width: | Height: | Size: 402 B |
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="64.0003" height="64"><defs><linearGradient id="gradient_0" gradientTransform="matrix(3.91889e-15 64 -64.0003 3.91887e-15 32.0002 -1.95943e-15)" gradientUnits="userSpaceOnUse" x1="0" y1="0" x2="1" y2="0"><stop offset="0" stop-color="#0EC7A8"/><stop offset="1" stop-color="#00C885"/></linearGradient></defs><rect fill="url(#gradient_0)" width="64.0003" height="64" rx="13.8106" ry="13.8106"/><defs><filter id="filter_0" x="-3" y="13" width="78" height="69" filterUnits="userSpaceOnUse"><feGaussianBlur stdDeviation="4.4002" result="blur"/></filter></defs><g transform="matrix(1 0 0 1 18 18)" filter="url(#filter_0)"><clipPath id="clip_0"><path d="M63.9867 13.197Q63.9935 13.3503 63.9969 13.5037Q64.0003 13.6571 64.0003 13.8106L64.0003 50.1894Q64.0003 55.91 59.9553 59.955Q55.9103 64 50.1898 64L13.8106 64Q8.09 64 4.045 59.955Q0 55.91 0 50.1894L0 13.8106Q0 13.6571 0.0034 13.5037Q0.0068 13.3503 0.0136 13.197L63.9867 13.197Z" clip-rule="evenodd"/></clipPath><g clip-path="url(#clip_0)"><circle fill="#FFE255" fill-opacity="0.49" transform="matrix(1 0 0 1 14.7525 31.197)" cx="20.5928" cy="20.5928" r="20.5928"/></g></g><clipPath id="clip_1"><rect width="64.0003" height="64" rx="13.8106" ry="13.8106"/></clipPath><g clip-path="url(#clip_1)"><defs><linearGradient id="gradient_1" gradientTransform="matrix(4.35136e-15 60.044 78.3872 0 39.1936 -2.86512e-06)" gradientUnits="userSpaceOnUse" x1="0" y1="0" x2="1" y2="0"><stop offset="0" stop-color="#FFF" stop-opacity="0.8"/><stop offset="0.4377" stop-color="#FFF"/><stop offset="1" stop-color="#FFF"/></linearGradient></defs><path fill="url(#gradient_1)" fill-opacity="1" transform="matrix(0.866025 -0.5 0.5 0.866025 -7.25994 37.2434)" d="M10.4632 2.7569C11.0168 1.0854 11.4183 0.4342 12.0804 0.1628C12.482 0 13.4155 0.1302 14.4249 0.4884C16.9539 1.411 21.7513 4.6672 26.755 8.8677L27.276 9.3018L29.1971 8.9111C32.3882 8.2598 34.3961 8.0211 37.9128 7.9017C41.5815 7.7714 45.4237 8.1405 49.4831 9.0196L50.7856 9.3018L52.3051 8.0645C57.7647 3.6035 62.4102 0.6729 64.798 0.1845C65.6229 0.0109 65.6663 0.0109 66.0788 0.2171C66.7517 0.5427 67.1642 1.1939 67.6418 2.6918C68.7597 6.1867 69.4978 12.4712 69.3675 17.3989L69.3133 19.3092L70.1056 20.5031C70.8654 21.6645 71.9833 23.7918 72.3741 24.8121C72.5477 25.2788 72.5912 25.3114 73.0145 25.3765C74.9248 25.6696 76.694 27.7644 77.5731 30.7926C78.3655 33.517 78.3872 37.4027 77.6382 40.203C77.508 40.648 77.1498 41.5597 76.835 42.211C75.7171 44.4903 74.0022 45.8362 72.1896 45.8471C71.8205 45.847 71.7771 45.8796 71.3864 46.5743C70.0538 48.9871 68.2229 51.1078 65.931 52.9197L65.931 18.983L12.3947 18.983L12.3947 53.6887C12.3876 53.6834 12.3806 53.6781 12.3735 53.6727C9.8011 51.7407 7.2938 48.8536 6.165 46.5308C5.872 45.9122 5.8069 45.847 5.3727 45.7385C3.0608 45.1632 1.1397 42.4932 0.3473 38.7703C0.0326 37.2833 0 34.0597 0.2822 32.5075C0.9551 28.8823 2.7352 26.2882 5.0905 25.4851C5.6983 25.2788 5.72 25.268 6.0456 24.5191C6.5775 23.2926 7.5001 21.5559 8.1947 20.4922L8.8351 19.4937L8.8677 15.8793C8.9328 10.257 9.4755 5.8177 10.4632 2.7569ZM12.5027 53.7693C16.8022 56.9564 22.7683 58.8585 31.0748 59.6967C34.5807 60.044 42.7971 60.0114 46.4874 59.6207C53.3471 58.9152 59.0672 57.2654 63.1482 54.8341C63.7166 54.4938 64.2642 54.1388 64.7905 53.7693L12.5027 53.7693Z" fill-rule="evenodd"/><path fill="#FFF" transform="matrix(0.866025 -0.5 0.5 0.866025 29.5937 50.1354)" d="M6.4145 3.2072L6.4145 10.1152Q6.4145 11.4436 5.4751 12.383Q4.5357 13.3224 3.2072 13.3224L3.2072 13.3224Q1.8788 13.3224 0.9394 12.383Q0 11.4436 0 10.1152L0 3.2072Q0 1.8788 0.9394 0.9394Q1.8788 0 3.2072 0L3.2072 0Q4.5357 0 5.4751 0.9394Q6.4145 1.8788 6.4145 3.2072Z"/><path fill="#FFF" transform="matrix(0.866025 -0.5 0.5 0.866025 46.9001 40.1434)" d="M6.4145 3.2072L6.4145 10.1152Q6.4145 11.4436 5.4751 12.383Q4.5357 13.3224 3.2072 13.3224L3.2072 13.3224Q1.8788 13.3224 0.9394 12.383Q0 11.4436 0 10.1152L0 3.2072Q0 1.8788 0.9394 0.9394Q1.8788 0 3.2072 0L3.2072 0Q4.5357 0 5.4751 0.9394Q6.4145 1.8788 6.4145 3.2072Z"/></g></svg>
|
||||
|
After Width: | Height: | Size: 4.0 KiB |
@@ -0,0 +1 @@
|
||||
<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Grok</title><path d="M6.469 8.776L16.512 23h-4.464L2.005 8.776H6.47zm-.004 7.9l2.233 3.164L6.467 23H2l4.465-6.324zM22 2.582V23h-3.659V7.764L22 2.582zM22 1l-9.952 14.095-2.233-3.163L17.533 1H22z"></path></svg>
|
||||
|
After Width: | Height: | Size: 372 B |
|
After Width: | Height: | Size: 8.0 KiB |
@@ -0,0 +1 @@
|
||||
<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 96 96" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Zed</title><path clip-rule="evenodd" d="M9 6C7.34315 6 6 7.34315 6 9V75H0V9C0 4.02944 4.02944 0 9 0H89.3787C93.3878 0 95.3955 4.84715 92.5607 7.68198L43.0551 57.1875H57V51H63V58.6875C63 61.1728 60.9853 63.1875 58.5 63.1875H37.0551L26.7426 73.5H73.5V36H79.5V73.5C79.5 76.8137 76.8137 79.5 73.5 79.5H20.7426L10.2426 90H87C88.6569 90 90 88.6569 90 87V21H96V87C96 91.9706 91.9706 96 87 96H6.62132C2.61224 96 0.604504 91.1529 3.43934 88.318L52.7574 39H39V45H33V37.5C33 35.0147 35.0147 33 37.5 33H58.7574L69.2574 22.5H22.5V60H16.5V22.5C16.5 19.1863 19.1863 16.5 22.5 16.5H75.2574L85.7574 6H9Z"/></svg>
|
||||
|
After Width: | Height: | Size: 760 B |
|
After Width: | Height: | Size: 18 KiB |
@@ -0,0 +1,78 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Agent Office</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<script src="_magpie/bridge.js"></script>
|
||||
<script src="agents.js"></script>
|
||||
<script src="model.js"></script>
|
||||
<script src="icons.js"></script>
|
||||
<script src="scene.js"></script>
|
||||
<script src="app.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<main class="card" id="card">
|
||||
<header class="top">
|
||||
<h1><span class="eyes" aria-hidden="true"><i></i><i></i></span><span data-t="title">What are my agents doing</span><span class="live" id="live"><i></i><span data-t="live">live</span></span></h1>
|
||||
<div class="counts" id="counts">
|
||||
<span class="count need"><i></i><span data-t="needYou">Need you</span> <b id="nNeed">0</b></span>
|
||||
<span class="count work"><i></i><span data-t="working">Working</span> <b id="nWork">0</b></span>
|
||||
<span class="count done"><i></i><span data-t="doneN">Done</span> <b id="nDone">0</b></span>
|
||||
</div>
|
||||
</header>
|
||||
<nav class="bar">
|
||||
<div class="seg dark" role="tablist" id="modes">
|
||||
<button type="button" role="tab" data-mode="office" data-t="office">Office</button>
|
||||
<button type="button" role="tab" data-mode="list" data-t="list">List</button>
|
||||
</div>
|
||||
<div class="seg plain" role="tablist" id="dims">
|
||||
<button type="button" role="tab" data-dim="2d">2D</button>
|
||||
<button type="button" role="tab" data-dim="3d">3D</button>
|
||||
</div>
|
||||
<span class="note" id="note"></span>
|
||||
<span class="grow"></span>
|
||||
<button type="button" class="btn" id="pip" data-t="pip">Picture in picture</button>
|
||||
<div class="menu-wrap">
|
||||
<button type="button" class="btn" id="settingsBtn" aria-haspopup="true" aria-expanded="false"><span data-t="settings">Settings</span> <span class="chev">⌄</span></button>
|
||||
<div class="menu" id="settings" hidden>
|
||||
<label class="row"><input type="checkbox" id="optDemo"> <span data-t="demo">Sample agents</span></label>
|
||||
<label class="row"><input type="checkbox" id="optDone"> <span data-t="showDone">Show finished agents</span></label>
|
||||
<label class="row"><input type="checkbox" id="optText"> <span data-t="showText">Show prompts and replies</span></label>
|
||||
<div class="row col">
|
||||
<span data-t="hideAfter">Leave the office after</span>
|
||||
<div class="seg small" id="optHide">
|
||||
<button type="button" data-hide="1h" data-t="h1">1 hour</button>
|
||||
<button type="button" data-hide="6h" data-t="h6">6 hours</button>
|
||||
<button type="button" data-hide="24h" data-t="h24">24 hours</button>
|
||||
<button type="button" data-hide="never" data-t="never">Never</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<section class="stage" id="stage">
|
||||
<canvas id="office"></canvas>
|
||||
<div class="tags" id="tags"></div>
|
||||
<div class="empty" id="empty" hidden></div>
|
||||
</section>
|
||||
<section class="listview" id="listview" hidden>
|
||||
<table>
|
||||
<thead><tr><th data-t="agent">Agent</th><th data-t="task">Task</th><th data-t="status">Status</th><th data-t="project">Folder</th><th data-t="model">Model</th><th data-t="last">Last active</th></tr></thead>
|
||||
<tbody id="rows"></tbody>
|
||||
</table>
|
||||
<p class="empty-list" id="emptyList" hidden></p>
|
||||
</section>
|
||||
<aside class="pop" id="pop" hidden></aside>
|
||||
<footer>
|
||||
<div class="legend" id="statusLegend"></div>
|
||||
<div class="legend brands" id="brandLegend"></div>
|
||||
</footer>
|
||||
</main>
|
||||
<div class="float" id="float" hidden>
|
||||
<div class="floatbar" id="floatbar"><span class="fdots" aria-hidden="true"><i></i><i></i></span><span data-t="pip">Picture in picture</span><button type="button" class="fclose" id="floatClose" aria-label="Close">✕</button></div>
|
||||
<div class="floatslot" id="floatslot"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,240 @@
|
||||
// What the page shows, worked out from live.js (globalThis.AgentOfficeLive,
|
||||
// written by the plugin's host part) without the DOM, so a test can check
|
||||
// it. A classic script: it sets globalThis.AgentOfficeModel.
|
||||
//
|
||||
// A session from an agent's own files says its phase outright (thinking,
|
||||
// tool, approval, ask, done, aborted, error); the page only adds that a
|
||||
// session whose file has not moved for a long while, mid-turn, is stuck.
|
||||
// A session only the gateway saw (an agent whose files aren't read) is
|
||||
// worked out from its requests, as before.
|
||||
(() => {
|
||||
const TEXT = {
|
||||
en: {
|
||||
title: "What are my agents doing", needYou: "Need you", working: "Working", doneN: "Done",
|
||||
office: "Office", list: "List", pip: "Picture in picture", settings: "Settings",
|
||||
thinking: "Thinking", executing: "Running tools", replying: "Replying", waiting: "Waiting for you",
|
||||
done: "Done", error: "Error", stopped: "Stopped", idle: "Idle",
|
||||
approval: "Waiting for your approval", ask: "Asked you something", stuck: "No word for {n}",
|
||||
copyResume: "Copy resume command", copySession: "Copy session id", copied: "Copied",
|
||||
justNow: "just now", sAgo: "{n}s ago", mAgo: "{n} min ago", hAgo: "{n} h ago", dAgo: "{n} d ago",
|
||||
empty: "No agent has been at work in the last two days. Start Claude Code, Codex, DeepSeek Harness, Gemini CLI… and it walks in here.",
|
||||
noFile: "Starting… the plugin reads your agents' sessions in magpie's plugin host.",
|
||||
demo: "Sample agents", showDone: "Show finished agents", showText: "Show prompts and replies",
|
||||
hideAfter: "Leave the office after", h1: "1 hour", h6: "6 hours", h24: "24 hours", never: "Never",
|
||||
demoOn: "Showing sample agents", turns: "{n} turns", noPrompt: "(no prompt)",
|
||||
project: "Folder", model: "Model", status: "Status", task: "Task", last: "Last active", agent: "Agent",
|
||||
quiet: "Text off: only statuses are kept",
|
||||
floating: "The office has its own window here: move it, reshape it, or ✕ it to put it back",
|
||||
pipOn: "Put it back", ran: "running {n}", via: "seen through magpie's gateway", fromFiles: "from its own session file",
|
||||
live: "live", stale: "Last update {n}",
|
||||
},
|
||||
zh: {
|
||||
title: "我的 Agent 在干嘛", needYou: "需要你", working: "工作中", doneN: "已完成",
|
||||
office: "办公室", list: "列表", pip: "画中画", settings: "设置",
|
||||
thinking: "思考中", executing: "执行中", replying: "回复中", waiting: "等你回应",
|
||||
done: "已完成", error: "错误", stopped: "已中断", idle: "摸鱼中",
|
||||
approval: "等你批准", ask: "在问你问题", stuck: "已 {n} 没有动静",
|
||||
copyResume: "复制续接命令", copySession: "复制会话 ID", copied: "已复制",
|
||||
justNow: "刚刚", sAgo: "{n}秒前", mAgo: "{n}分钟前", hAgo: "{n}小时前", dAgo: "{n}天前",
|
||||
empty: "最近两天没有 Agent 在干活。打开 Claude Code、Codex、DeepSeek Harness、Gemini CLI……它就会走进这间办公室。",
|
||||
noFile: "正在启动……插件在 magpie 的插件宿主里读取各个 Agent 的会话。",
|
||||
demo: "示例 Agent", showDone: "显示已完成的 Agent", showText: "显示提问和回复",
|
||||
hideAfter: "多久后离开办公室", h1: "1 小时", h6: "6 小时", h24: "24 小时", never: "从不",
|
||||
demoOn: "正在显示示例 Agent", turns: "{n} 轮", noPrompt: "(没有提问)",
|
||||
project: "目录", model: "模型", status: "状态", task: "任务", last: "最近活动", agent: "Agent",
|
||||
quiet: "已关闭文本:只记录状态",
|
||||
floating: "办公室在这里的小窗中:可拖动、可缩放,点 ✕ 放回去",
|
||||
pipOn: "放回去", ran: "已运行 {n}", via: "经 magpie 网关看到", fromFiles: "来自它自己的会话文件",
|
||||
live: "实时", stale: "最近更新 {n}",
|
||||
},
|
||||
}
|
||||
// the six the page draws, in the legend's order
|
||||
const STATUSES = ["thinking", "executing", "replying", "waiting", "done", "error"]
|
||||
const COLORS = { thinking: "#8b6cf6", executing: "#3b82f6", replying: "#10b981", waiting: "#f59e0b", done: "#22a35a", error: "#ef4444", idle: "#9ca3af" }
|
||||
const HIDE = { "1h": 3600e3, "6h": 6 * 3600e3, "24h": 24 * 3600e3, never: Infinity }
|
||||
const DEFAULTS = { mode: "office", dim: "3d", demo: false, showDone: true, hideAfter: "6h", approvalAfterSec: 90 }
|
||||
// a turn whose file hasn't moved this long is stuck, not working
|
||||
const STUCK_MS = 10 * 60e3
|
||||
|
||||
function text(lang) {
|
||||
return String(lang || "").toLowerCase().startsWith("zh") ? TEXT.zh : TEXT.en
|
||||
}
|
||||
function fill(s, n) { return String(s).replace("{n}", n) }
|
||||
|
||||
function hash(s) {
|
||||
let h = 2166136261
|
||||
for (const c of String(s)) h = Math.imul(h ^ c.codePointAt(0), 16777619)
|
||||
return h >>> 0
|
||||
}
|
||||
|
||||
// an agent as magpie names it, with its own icon (page/agents.js)
|
||||
function brand(agent) {
|
||||
const all = globalThis.AgentOfficeAgents || {}
|
||||
const id = String(agent || "agent")
|
||||
const a = all[id] || all[id.replace(/-cli$/, "")] || null
|
||||
const color = a?.color || `hsl(${hash(id) % 360} 55% 45%)`
|
||||
return { id, name: a?.name || id, icon: a?.icon || "", color }
|
||||
}
|
||||
|
||||
// { status, sub }: status one of STATUSES; sub says more (approval, ask,
|
||||
// stopped, stuck) for the card and the list
|
||||
function state(s, now, opts = {}) {
|
||||
if (s.source === "files" || s.phase) {
|
||||
const quiet = now - (s.touched || s.updated || now)
|
||||
switch (s.phase) {
|
||||
case "approval": return { status: "waiting", sub: "approval" }
|
||||
case "ask": return { status: "waiting", sub: "ask" }
|
||||
case "error": return { status: "error", sub: "" }
|
||||
case "aborted": return { status: "done", sub: "stopped" }
|
||||
case "done": return { status: "done", sub: "" }
|
||||
case "tool": return quiet > STUCK_MS ? { status: "error", sub: "stuck" } : { status: "executing", sub: "" }
|
||||
case "thinking": default:
|
||||
if (quiet > STUCK_MS) return { status: "error", sub: "stuck" }
|
||||
// a reply being written: the model has the word and the file moves
|
||||
return { status: s.reply && quiet < 4000 ? "replying" : "thinking", sub: "" }
|
||||
}
|
||||
}
|
||||
// only the gateway saw it: from its requests
|
||||
const approval = (Number(opts.approvalAfterSec) || DEFAULTS.approvalAfterSec) * 1000
|
||||
if (s.inflight > 0) return { status: now - (s.inflightSince || now) > 8000 ? "replying" : "thinking", sub: "" }
|
||||
const l = s.last
|
||||
if (!l) return { status: "thinking", sub: "" }
|
||||
if (l.outcome === "error") return { status: "error", sub: "" }
|
||||
if (l.outcome === "ask") return { status: "waiting", sub: "ask" }
|
||||
if (l.outcome === "tools") return now - l.at > approval ? { status: "waiting", sub: "approval" } : { status: "executing", sub: "" }
|
||||
return { status: "done", sub: "" }
|
||||
}
|
||||
function status(s, now, opts) { return state(s, now, opts).status }
|
||||
|
||||
function ago(ms, lang) {
|
||||
const t = text(lang)
|
||||
const s = Math.max(0, Math.round(ms / 1000))
|
||||
if (s < 10) return t.justNow
|
||||
if (s < 60) return fill(t.sAgo, s)
|
||||
if (s < 3600) return fill(t.mAgo, Math.floor(s / 60))
|
||||
if (s < 86400) return fill(t.hAgo, Math.floor(s / 3600))
|
||||
return fill(t.dAgo, Math.floor(s / 86400))
|
||||
}
|
||||
|
||||
// 45 000 → "45s"; 130 000 → "2m 10s"; 3 900 000 → "1h 5m"
|
||||
function duration(ms, lang) {
|
||||
const zh = text(lang) === TEXT.zh
|
||||
const s = Math.max(0, Math.round(ms / 1000))
|
||||
if (s < 60) return zh ? s + "秒" : s + "s"
|
||||
const m = Math.floor(s / 60), r = s % 60
|
||||
if (m < 60) return zh ? `${m}分${r ? r + "秒" : ""}` : `${m}m${r ? " " + r + "s" : ""}`
|
||||
const h = Math.floor(m / 60), mm = m % 60
|
||||
return zh ? `${h}小时${mm ? mm + "分" : ""}` : `${h}h${mm ? " " + mm + "m" : ""}`
|
||||
}
|
||||
|
||||
function shellQuote(s) {
|
||||
return /^[A-Za-z0-9._:@%+=/-]+$/.test(s) ? s : `'${String(s).replace(/'/g, `'\\''`)}'`
|
||||
}
|
||||
|
||||
// the command that picks the session up again, where the agent has one
|
||||
function resume(s) {
|
||||
const id0 = String(s.session || "")
|
||||
if (!id0 || id0.startsWith("cwd:") || id0.startsWith("model:")) return ""
|
||||
const id = shellQuote(id0)
|
||||
const cd = s.cwd ? `cd ${shellQuote(s.cwd)} && ` : ""
|
||||
switch (s.agent) {
|
||||
case "claude": return `${cd}claude --resume ${id}`
|
||||
case "codex": return `${cd}codex resume ${id}`
|
||||
case "opencode": return `${cd}opencode --session ${id}`
|
||||
case "gemini": return `${cd}gemini --resume ${id}`
|
||||
case "qwen": return `${cd}qwen --resume ${id}`
|
||||
case "pi": return `${cd}pi --session ${id}`
|
||||
case "dsh": return `${cd}dsh --resume ${shellQuote(id0.replace(/^session-/, ""))}`
|
||||
default: return ""
|
||||
}
|
||||
}
|
||||
|
||||
// the agents to draw: [{ key, agent, brand, title, status, sub, at, … }]
|
||||
function agents(snap, now, opts = {}) {
|
||||
const o = { ...DEFAULTS, ...opts }
|
||||
const hide = HIDE[o.hideAfter] ?? HIDE["6h"]
|
||||
const out = []
|
||||
for (const s of Array.isArray(snap?.sessions) ? snap.sessions : []) {
|
||||
if (!s || typeof s.key !== "string") continue
|
||||
const { status: st, sub } = state(s, now, o)
|
||||
const at = Math.max(s.updated || 0, s.touched || 0, s.last?.at || 0)
|
||||
const quiet = now - at
|
||||
if ((st === "done" || st === "error") && quiet > hide) continue
|
||||
if (st === "done" && !o.showDone) continue
|
||||
const b = brand(s.agent)
|
||||
// how long the current step has gone on
|
||||
const since = s.pendingSince ? now - s.pendingSince : quiet
|
||||
out.push({
|
||||
key: s.key, agent: s.agent, brand: b, session: s.session || "", status: st, sub, source: s.source || "gateway",
|
||||
idle: st === "done" && quiet > 20 * 60e3,
|
||||
title: s.title || s.project || b.name, project: s.project || "", cwd: s.cwd || "",
|
||||
query: s.query || "", step: s.step || s.last?.step || "", reply: s.reply || s.last?.text || "", error: s.error || "",
|
||||
model: s.model || "", at, since, started: s.started || at, turns: s.turns || 0,
|
||||
resume: resume(s), seed: hash(s.key),
|
||||
})
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
function counts(list) {
|
||||
const c = { needYou: 0, working: 0, done: 0 }
|
||||
for (const a of list) {
|
||||
// an agent that failed or stalled needs you as much as one that asked
|
||||
if (a.status === "waiting" || a.status === "error") c.needYou++
|
||||
else if (a.status === "thinking" || a.status === "executing" || a.status === "replying") c.working++
|
||||
else if (a.status === "done") c.done++
|
||||
}
|
||||
return c
|
||||
}
|
||||
|
||||
// the list's order: what needs you, what works, then the rest, latest first
|
||||
const RANK = { waiting: 0, error: 1, thinking: 2, executing: 2, replying: 2, done: 3 }
|
||||
function sorted(list) {
|
||||
return list.slice().sort((a, b) => (RANK[a.status] - RANK[b.status]) || (b.at - a.at))
|
||||
}
|
||||
|
||||
// the page's own side of text off: whatever live.js holds, no prompt,
|
||||
// reply, error or tool argument is shown. A tool step keeps its name only.
|
||||
function redact(list) {
|
||||
return list.map((a) => {
|
||||
const step = String(a.step || "")
|
||||
const name = step.includes(" · ") ? step.split(" · ")[0]
|
||||
: /^[A-Za-z0-9_.-]{1,40}$/.test(step) ? step : ""
|
||||
return { ...a, title: a.project || a.brand?.name || a.agent || "", query: "", reply: "", error: "", step: name }
|
||||
})
|
||||
}
|
||||
|
||||
// what the page draws: what the host wrote, and, with sample agents on,
|
||||
// theirs beside it — never instead of it
|
||||
function merge(real, demo) {
|
||||
const sessions = [...(Array.isArray(real?.sessions) ? real.sessions : []), ...(Array.isArray(demo?.sessions) ? demo.sessions : [])]
|
||||
return { ...(real || {}), sessions, demo: true }
|
||||
}
|
||||
|
||||
// sample agents, for a first look (Settings › Sample agents)
|
||||
function demo(now) {
|
||||
const m = 60e3
|
||||
const S = (agent, session, cwd, title, query, model, phase, extra) => ({
|
||||
key: `demo|${agent}|${session}`, source: "files", agent, session, cwd, project: cwd.split("/").pop(), title, query, model,
|
||||
started: now - 50 * m, updated: now - 1000, touched: now - 1000, phase, turns: 3, ...extra,
|
||||
})
|
||||
return { v: 2, written: now, text: true, demo: true, sessions: [
|
||||
S("codex", "demo-1", "/Users/me/blog", "封面图", "用 punk skill 生成文章封面", "gpt-6-astra", "done",
|
||||
{ touched: now - 28 * m, updated: now - 28 * m, step: "image_gen · cover.png", reply: "已用内置生图完成「方块世界」封面,PNG · 1600×900,放进 assets/cover.png。" }),
|
||||
S("claude", "demo-2", "/Users/me/oh-my-x", "oh-my-x", "给 CLI 加一个 --json 输出", "claude-opus-5", "tool",
|
||||
{ touched: now - 3000, pendingSince: now - 42000, step: "Bash · bun test" }),
|
||||
S("claude", "demo-3", "/Users/me/x", "X 选题", "下周发什么?给我 5 个选题", "claude-sonnet-5", "ask",
|
||||
{ touched: now - 2 * m, step: "AskUserQuestion · 工具测评还是工作流?", reply: "我列了 5 个方向。你更想写工具测评,还是写自己的工作流?" }),
|
||||
S("dsh", "demo-4", "/Users/me/site", "站点部署", "部署到 Cloudflare Pages", "deepseek-flash", "approval",
|
||||
{ touched: now - 40000, step: "bash · wrangler pages deploy ./dist" }),
|
||||
S("gemini", "demo-5", "/Users/me/music", "自动修歌", "把副歌的节拍对齐到 120 BPM", "gemini-3-pro", "thinking",
|
||||
{ touched: now - 1500, reply: "" }),
|
||||
S("qwen", "demo-6", "/Users/me/notes", "工具整理", "整理这周收藏的工具和思路", "qwen3-coder", "done",
|
||||
{ touched: now - 40 * m, updated: now - 40 * m, reply: "整理好了:12 个工具、5 条思路,按「写作 / 编程 / 效率」分组写进 weekly.md。" }),
|
||||
S("codex", "demo-7", "/Users/me/app", "支付接入", "接入 Stripe 订阅", "gpt-6.1-terra", "error",
|
||||
{ touched: now - 6 * m, error: "429: usage limit reached", step: "exec · npm run test:e2e" }),
|
||||
] }
|
||||
}
|
||||
|
||||
globalThis.AgentOfficeModel = { TEXT, STATUSES, COLORS, DEFAULTS, HIDE, STUCK_MS, text, fill, hash, brand, state, status, ago, duration, resume, agents, counts, sorted, demo, merge, redact }
|
||||
})()
|
||||
@@ -0,0 +1,987 @@
|
||||
// The office: a voxel space-station room drawn on a canvas, in isometric 3D
|
||||
// or a flat top-down 2D, with one little worker per agent session. Where a
|
||||
// worker is shows what it is doing: at a desk while it thinks, runs tools or
|
||||
// replies; in the purple square when it needs you; on the sofa when it is
|
||||
// done (asleep once it has been done a while); at the broken console on an
|
||||
// error. A classic script: it sets globalThis.AgentOfficeScene.
|
||||
(() => {
|
||||
const ROOM = { w: 16, d: 12, wall: 3.1 }
|
||||
|
||||
// ---- colours ---------------------------------------------------------
|
||||
function rgb(c) {
|
||||
if (c.startsWith("hsl")) {
|
||||
const [h, s, l] = c.match(/[\d.]+/g).map(Number)
|
||||
const a = (s / 100) * Math.min(l / 100, 1 - l / 100)
|
||||
const f = (n) => { const k = (n + h / 30) % 12; return Math.round(255 * (l / 100 - a * Math.max(-1, Math.min(k - 3, 9 - k, 1)))) }
|
||||
return [f(0), f(8), f(4)]
|
||||
}
|
||||
const h = c.replace("#", "")
|
||||
const n = parseInt(h.length === 3 ? h.replace(/./g, "$&$&") : h, 16)
|
||||
return [(n >> 16) & 255, (n >> 8) & 255, n & 255]
|
||||
}
|
||||
const shadeCache = new Map()
|
||||
function shade(c, f) {
|
||||
const k = c + f
|
||||
let v = shadeCache.get(k)
|
||||
if (v) return v
|
||||
const [r, g, b] = rgb(c)
|
||||
const m = (x) => Math.max(0, Math.min(255, Math.round(f < 0 ? x * (1 + f) : x + (255 - x) * f)))
|
||||
v = `rgb(${m(r)},${m(g)},${m(b)})`
|
||||
shadeCache.set(k, v)
|
||||
return v
|
||||
}
|
||||
|
||||
const SKIN = ["#f2c7a5", "#e8b48a", "#c98d62", "#8d5a3b", "#f5d6bf"]
|
||||
const HAIR = ["#2b2118", "#5a3825", "#a0522d", "#1f2937", "#d4a24c", "#7c2d12", "#111111", "#c2410c"]
|
||||
const PANTS = ["#334155", "#1e3a8a", "#374151", "#3f3f46", "#78350f"]
|
||||
|
||||
// ---- the room's furniture and where workers go ---------------------
|
||||
// A seat is where a worker sits; `face` is the way they look — toward
|
||||
// the desk, away from the sofa's back, into the room. The monitor, the
|
||||
// chair's back and the head all follow from it (FACE below).
|
||||
const DESKS = [
|
||||
{ x: 3.2, y: 0.55, w: 1.7, d: 0.9, seat: [4.05, 1.95], face: "n" },
|
||||
{ x: 5.9, y: 0.55, w: 1.7, d: 0.9, seat: [6.75, 1.95], face: "n" },
|
||||
{ x: 8.6, y: 0.55, w: 1.7, d: 0.9, seat: [9.45, 1.95], face: "n" },
|
||||
{ x: 11.3, y: 0.55, w: 1.7, d: 0.9, seat: [12.15, 1.95], face: "n" },
|
||||
// the island: two desks back to back, the sitters facing each other
|
||||
{ x: 10.6, y: 4.6, w: 1.6, d: 0.8, seat: [11.4, 4.0], face: "s", island: true },
|
||||
{ x: 12.4, y: 4.6, w: 1.6, d: 0.8, seat: [13.2, 4.0], face: "s", island: true },
|
||||
{ x: 10.6, y: 5.4, w: 1.6, d: 0.8, seat: [11.4, 6.75], face: "n", island: true },
|
||||
{ x: 12.4, y: 5.4, w: 1.6, d: 0.8, seat: [13.2, 6.75], face: "n", island: true },
|
||||
]
|
||||
const SOFA = [[1.1, 4.84], [1.1, 5.72], [1.1, 6.6], [1.1, 7.48], [1.1, 8.36], [3.1, 10.95], [4.3, 10.95]]
|
||||
// Its backrest is to the west of the left sofa and to the south of the
|
||||
// front one, so a sitter looks east and north respectively.
|
||||
const SOFA_FACE = ["e", "e", "e", "e", "e", "n", "n"]
|
||||
// a direction as a vector; the camera looks from +y, +x
|
||||
const FACE = { n: [0, -1], s: [0, 1], e: [1, 0], w: [-1, 0] }
|
||||
// Entry/exit points are on the aisle side, never behind a backrest.
|
||||
const SOFA_APPROACH = SOFA.map(([x, y], i) => i < 5 ? [2.05, y] : [x, 10.0])
|
||||
const ZONE = { x: 4.2, y: 7.2, w: 4.4, d: 3.4 }
|
||||
const ZONE_SPOTS = []
|
||||
for (let j = 0; j < 3; j++) for (let i = 0; i < 4; i++) ZONE_SPOTS.push([ZONE.x + 0.6 + i * 1.05 + (j % 2) * 0.3, ZONE.y + 0.6 + j * 1.05])
|
||||
const ERROR_SPOTS = [[12.3, 9.6], [14.5, 8.6], [12.9, 10.45], [14.6, 10.3]]
|
||||
const WANDER = [[7.0, 4.4], [8.6, 5.7], [6.0, 5.8], [9.0, 8.0], [10.2, 9.0], [2.8, 3.2], [5.0, 3.4], [9.6, 2.9], [2.4, 6.0]]
|
||||
const DOOR = [0.6, 2.6]
|
||||
|
||||
// What stands on the floor and can't be walked through, and the places a
|
||||
// worker goes, which are free even inside a piece of furniture (a seat).
|
||||
const BLOCKERS = [
|
||||
...DESKS.map((d) => [d.x, d.y, d.w, d.d]),
|
||||
[0, 4.1, 1.5, 5.0], // full sofa and the gap behind its backrest
|
||||
[2.5, 10.55, 2.4, 1.45], // full sofa and rear wall gap
|
||||
[6.3, 5.2, 1.6, 1.6], // the holo table
|
||||
[1.85, 9.65, 0.9, 0.9], // drums
|
||||
[8.4, 10.5, 1.35, 1.25], // crates
|
||||
[12.65, 8.85, 1.2, 1.2], // the reactor
|
||||
[14.3, 6.6, 1.2, 1.6], // the broken console
|
||||
[14.0, 0.5, 1.6, 1.0], // the console on the far wall
|
||||
]
|
||||
const FREE = [...DESKS.map((d) => d.seat), ...SOFA_APPROACH, ...ZONE_SPOTS, ...ERROR_SPOTS, ...WANDER, DOOR]
|
||||
|
||||
// A coarse grid of where a worker may walk, and the shortest way across
|
||||
// it: eight neighbours, diagonals only when both sides are free, then
|
||||
// the corners are cut away so the walk looks like a person's.
|
||||
const CELL = 0.3
|
||||
const NAV = (() => {
|
||||
const w = Math.ceil(ROOM.w / CELL), h = Math.ceil(ROOM.d / CELL)
|
||||
const blocked = new Uint8Array(w * h)
|
||||
const R = 0.17 // half a worker's breadth: keeps them off the furniture's edge
|
||||
const near = (x, y, x0, y0, x1, y1, pad) => x >= x0 - pad && x <= x1 + pad && y >= y0 - pad && y <= y1 + pad
|
||||
for (let j = 0; j < h; j++) {
|
||||
for (let i = 0; i < w; i++) {
|
||||
const x = i * CELL + CELL / 2, y = j * CELL + CELL / 2
|
||||
let b = x < 0.42 + R || y < 0.42 + R || x > ROOM.w - 0.42 - R || y > ROOM.d - 0.42 - R ? 1 : 0
|
||||
for (const [bx, by, bw, bd] of BLOCKERS) if (near(x, y, bx, by, bx + bw, by + bd, R)) b = 1
|
||||
// a seat is standable even when it sits on a piece of furniture
|
||||
for (const [fx, fy] of FREE) if (near(x, y, fx, fy, fx, fy, 0.2)) b = 0
|
||||
blocked[j * w + i] = b
|
||||
}
|
||||
}
|
||||
const inside = (i, j) => i >= 0 && j >= 0 && i < w && j < h
|
||||
const free = (i, j) => inside(i, j) && !blocked[j * w + i]
|
||||
const freeAt = (x, y) => free(Math.floor(x / CELL), Math.floor(y / CELL))
|
||||
// the nearest free cell to a point that is in one
|
||||
function open(x, y) {
|
||||
const i0 = Math.floor(x / CELL), j0 = Math.floor(y / CELL)
|
||||
if (free(i0, j0)) return [i0, j0]
|
||||
for (let r = 1; r < 30; r++) {
|
||||
for (let dj = -r; dj <= r; dj++) for (let di = -r; di <= r; di++) {
|
||||
if (Math.max(Math.abs(di), Math.abs(dj)) !== r) continue
|
||||
if (free(i0 + di, j0 + dj)) return [i0 + di, j0 + dj]
|
||||
}
|
||||
}
|
||||
return [i0, j0]
|
||||
}
|
||||
// Visit every crossed grid cell, including both sides of a corner.
|
||||
// Coarse distance sampling can miss a tiny slice of an obstacle.
|
||||
const clear = (a, b) => {
|
||||
const dx = b[0] - a[0], dy = b[1] - a[1]
|
||||
const cuts = [0, 1]
|
||||
for (const [start, delta] of [[a[0], dx], [a[1], dy]]) {
|
||||
if (Math.abs(delta) < 1e-10) continue
|
||||
const lo = Math.min(start, start + delta), hi = Math.max(start, start + delta)
|
||||
for (let n = Math.floor(lo / CELL) + 1; n * CELL < hi; n++) {
|
||||
cuts.push((n * CELL - start) / delta)
|
||||
}
|
||||
}
|
||||
cuts.sort((x, y) => x - y)
|
||||
let previous = null
|
||||
for (let k = 0; k < cuts.length - 1; k++) {
|
||||
if (cuts[k + 1] - cuts[k] < 1e-10) continue
|
||||
const t = (cuts[k] + cuts[k + 1]) / 2
|
||||
const i = Math.floor((a[0] + dx * t) / CELL), j = Math.floor((a[1] + dy * t) / CELL)
|
||||
if (!free(i, j)) return false
|
||||
if (previous && i !== previous[0] && j !== previous[1] &&
|
||||
(!free(i, previous[1]) || !free(previous[0], j))) return false
|
||||
previous = [i, j]
|
||||
}
|
||||
return freeAt(...a) && freeAt(...b)
|
||||
}
|
||||
// from one point to another, as the corners to walk by
|
||||
function corridor(from, to) {
|
||||
if (!freeAt(...from) || !freeAt(...to)) return []
|
||||
const [si, sj] = open(from[0], from[1])
|
||||
const [gi, gj] = open(to[0], to[1])
|
||||
const start = sj * w + si, goal = gj * w + gi
|
||||
if (start === goal) return [[to[0], to[1]]]
|
||||
const prev = new Int32Array(w * h).fill(-1)
|
||||
prev[start] = start
|
||||
const q = [start]
|
||||
for (let head = 0; head < q.length; head++) {
|
||||
const c = q[head]
|
||||
if (c === goal) break
|
||||
const ci = c % w, cj = (c - ci) / w
|
||||
for (let dj = -1; dj <= 1; dj++) for (let di = -1; di <= 1; di++) {
|
||||
if (!di && !dj) continue
|
||||
const ni = ci + di, nj = cj + dj
|
||||
if (!free(ni, nj)) continue
|
||||
// no slipping between two pieces that touch at a corner
|
||||
if (di && dj && (!free(ci + di, cj) || !free(ci, cj + dj))) continue
|
||||
const n = nj * w + ni
|
||||
if (prev[n] !== -1) continue
|
||||
prev[n] = c
|
||||
q.push(n)
|
||||
}
|
||||
}
|
||||
if (prev[goal] === -1) return [] // never fall back to walking through furniture
|
||||
const cells = []
|
||||
for (let c = goal; c !== start; c = prev[c]) cells.push(c)
|
||||
cells.push(start)
|
||||
cells.reverse()
|
||||
const pts = cells.map((c) => { const i = c % w; return [i * CELL + CELL / 2, ((c - i) / w) * CELL + CELL / 2] })
|
||||
pts[0] = [from[0], from[1]]
|
||||
pts[pts.length - 1] = [to[0], to[1]]
|
||||
// cut the corners: keep a point only when the way past it isn't clear
|
||||
const out = []
|
||||
let i = 0
|
||||
while (i < pts.length - 1) {
|
||||
let j = pts.length - 1
|
||||
while (j > i + 1 && !clear(pts[i], pts[j])) j--
|
||||
out.push(pts[j])
|
||||
i = j
|
||||
}
|
||||
if (!out.length) out.push(pts[pts.length - 1])
|
||||
return out
|
||||
}
|
||||
const seatAt = p => SOFA.findIndex(q => Math.hypot(q[0] - p[0], q[1] - p[1]) < 0.04)
|
||||
function path(from, to, transit = null) {
|
||||
if (Math.hypot(to[0] - from[0], to[1] - from[1]) < 0.001) return []
|
||||
const entry = seatAt(to)
|
||||
const exit = Number.isInteger(transit) ? transit : seatAt(from)
|
||||
const a = exit >= 0 ? SOFA_APPROACH[exit] : from
|
||||
const b = entry >= 0 ? SOFA_APPROACH[entry] : to
|
||||
const middle = corridor(a, b)
|
||||
if (!middle.length) return []
|
||||
// Third coordinate identifies a controlled boarding/alighting segment.
|
||||
return [...(exit >= 0 ? [[...a, exit]] : []), ...middle,
|
||||
...(entry >= 0 ? [[...to, entry]] : [])]
|
||||
}
|
||||
return { w, h, CELL, blocked, free, freeAt, path, open, clear }
|
||||
|
||||
})()
|
||||
|
||||
function rnd(seed, i) {
|
||||
let x = (seed ^ Math.imul(i + 1, 0x9e3779b1)) >>> 0
|
||||
x ^= x >>> 16; x = Math.imul(x, 0x85ebca6b) >>> 0; x ^= x >>> 13
|
||||
return (x >>> 0) / 4294967296
|
||||
}
|
||||
|
||||
function idlePose(w, time, reduced = false) {
|
||||
const neutral = { kind: "rest", amount: 0, phase: 0 }
|
||||
if (reduced || w.walking || w.a.status !== "done") return neutral
|
||||
const seed = w.a.seed || 0
|
||||
const cycle = Math.floor((time + (seed % 19)) / 22)
|
||||
const phase = ((time + (seed % 19)) % 22 + 22) % 22
|
||||
if (phase >= 4) return neutral
|
||||
return { kind: ["stretch", "look", "swing", "doze"][(seed + cycle) % 4],
|
||||
amount: Math.sin(Math.PI * phase / 4), phase }
|
||||
}
|
||||
|
||||
class Scene {
|
||||
constructor(canvas, opts = {}) {
|
||||
this.c = canvas
|
||||
this.g = canvas.getContext("2d")
|
||||
this.dim = opts.dim === "2d" ? "2d" : "3d"
|
||||
this.onFrame = opts.onFrame || (() => {})
|
||||
this.workers = new Map()
|
||||
this.t = 0
|
||||
this.last = 0
|
||||
this.running = false
|
||||
this.first = true
|
||||
this.reducedMotion = globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches || false
|
||||
this.stars = Array.from({ length: 140 }, (_, i) => [rnd(7, i), rnd(11, i), rnd(13, i)])
|
||||
this.resize()
|
||||
}
|
||||
|
||||
// ---- geometry ----------------------------------------------------
|
||||
P(x, y, z = 0) {
|
||||
if (this.dim === "3d") return [this.ox + (x - y) * this.s * 0.866, this.oy + (x + y) * this.s * 0.5 - z * this.s]
|
||||
return [this.ox + x * this.s, this.oy + y * this.s * 0.82 - z * this.s * 0.5]
|
||||
}
|
||||
depth(x, y, z = 0) {
|
||||
return this.dim === "3d" ? x + y + z * 0.001 : y + z * 0.001
|
||||
}
|
||||
|
||||
resize() {
|
||||
const r = this.c.getBoundingClientRect()
|
||||
const dpr = Math.min(2, globalThis.devicePixelRatio || 1)
|
||||
this.W = Math.max(200, r.width)
|
||||
this.H = Math.max(160, r.height)
|
||||
this.c.width = Math.round(this.W * dpr)
|
||||
this.c.height = Math.round(this.H * dpr)
|
||||
this.g.setTransform(dpr, 0, 0, dpr, 0, 0)
|
||||
this.fit()
|
||||
}
|
||||
|
||||
fit() {
|
||||
// the room's corners at scale 1, then scale and centre it
|
||||
this.s = 1; this.ox = 0; this.oy = 0
|
||||
const pts = []
|
||||
for (const [x, y] of [[0, 0], [ROOM.w, 0], [0, ROOM.d], [ROOM.w, ROOM.d]]) {
|
||||
pts.push(this.P(x, y, 0))
|
||||
if (x === 0 || y === 0) pts.push(this.P(x, y, this.dim === "3d" ? ROOM.wall : 0.9))
|
||||
}
|
||||
const xs = pts.map((p) => p[0]), ys = pts.map((p) => p[1])
|
||||
const bw = Math.max(...xs) - Math.min(...xs), bh = Math.max(...ys) - Math.min(...ys)
|
||||
const pad = this.dim === "3d" ? 0.04 : 0.06
|
||||
this.s = Math.min((this.W * (1 - pad * 2)) / bw, (this.H * (1 - pad * 2)) / bh)
|
||||
this.ox = (this.W - bw * this.s) / 2 - Math.min(...xs) * this.s
|
||||
this.oy = (this.H - bh * this.s) / 2 - Math.min(...ys) * this.s + (this.dim === "3d" ? this.H * 0.02 : 0)
|
||||
}
|
||||
|
||||
setDim(dim) {
|
||||
this.dim = dim === "2d" ? "2d" : "3d"
|
||||
this.fit()
|
||||
}
|
||||
|
||||
// ---- drawing primitives ----------------------------------------
|
||||
poly(pts, fill, stroke) {
|
||||
const g = this.g
|
||||
g.beginPath()
|
||||
pts.forEach(([x, y], i) => (i ? g.lineTo(x, y) : g.moveTo(x, y)))
|
||||
g.closePath()
|
||||
if (fill) { g.fillStyle = fill; g.fill() }
|
||||
if (stroke) { g.strokeStyle = stroke; g.lineWidth = 1; g.stroke() }
|
||||
}
|
||||
|
||||
box(x, y, z, w, d, h, color, o = {}) {
|
||||
const P = (a, b, c) => this.P(a, b, c)
|
||||
const top = [P(x, y, z + h), P(x + w, y, z + h), P(x + w, y + d, z + h), P(x, y + d, z + h)]
|
||||
const line = o.line === false ? null : "rgba(0,0,0,.18)"
|
||||
if (this.dim === "3d") {
|
||||
this.poly([P(x, y + d, z), P(x + w, y + d, z), P(x + w, y + d, z + h), P(x, y + d, z + h)], o.left || shade(color, -0.18), line)
|
||||
this.poly([P(x + w, y, z), P(x + w, y + d, z), P(x + w, y + d, z + h), P(x + w, y, z + h)], o.right || shade(color, -0.36), line)
|
||||
} else {
|
||||
this.poly([P(x, y + d, z), P(x + w, y + d, z), P(x + w, y + d, z + h), P(x, y + d, z + h)], o.left || shade(color, -0.28), line)
|
||||
}
|
||||
this.poly(top, o.top || color, line)
|
||||
}
|
||||
|
||||
// the face of a box one looks at (the +y face): a rectangle on it, u
|
||||
// across 0–1, v up 0–1
|
||||
onFront(x, y, z, w, d, h, u0, v0, u1, v1, color) {
|
||||
const P = (a, c) => this.P(x + a * w, y + d, z + c * h)
|
||||
this.poly([P(u0, v0), P(u1, v0), P(u1, v1), P(u0, v1)], color)
|
||||
}
|
||||
onBack(x, y, z, w, d, h, u0, v0, u1, v1, color) {
|
||||
const P = (a, c) => this.P(x + a * w, y, z + c * h)
|
||||
this.poly([P(u0, v0), P(u1, v0), P(u1, v1), P(u0, v1)], color)
|
||||
}
|
||||
onLeft(x, y, z, w, d, h, u0, v0, u1, v1, color) {
|
||||
if (this.dim !== "3d") return
|
||||
const P = (a, c) => this.P(x, y + a * d, z + c * h)
|
||||
this.poly([P(u0, v0), P(u1, v0), P(u1, v1), P(u0, v1)], color)
|
||||
}
|
||||
onRight(x, y, z, w, d, h, u0, v0, u1, v1, color) {
|
||||
if (this.dim !== "3d") return
|
||||
const P = (a, c) => this.P(x + w, y + a * d, z + c * h)
|
||||
this.poly([P(u0, v0), P(u1, v0), P(u1, v1), P(u0, v1)], color)
|
||||
}
|
||||
|
||||
text(s, x, y, size, color, font = "600", align = "center") {
|
||||
const g = this.g
|
||||
g.font = `${font} ${size}px -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`
|
||||
g.textAlign = align
|
||||
g.textBaseline = "middle"
|
||||
g.fillStyle = color
|
||||
g.fillText(s, x, y)
|
||||
}
|
||||
|
||||
// ---- the room ----------------------------------------------------
|
||||
background() {
|
||||
const g = this.g
|
||||
const sky = g.createLinearGradient(0, 0, 0, this.H)
|
||||
sky.addColorStop(0, "#05070f")
|
||||
sky.addColorStop(1, "#0b1020")
|
||||
g.fillStyle = sky
|
||||
g.fillRect(0, 0, this.W, this.H)
|
||||
for (const [a, b, c] of this.stars) {
|
||||
const tw = 0.5 + 0.5 * Math.sin(this.t * (0.6 + c) + a * 40)
|
||||
g.fillStyle = `rgba(255,255,255,${0.15 + 0.55 * c * tw})`
|
||||
g.fillRect(a * this.W, b * this.H, c > 0.8 ? 2 : 1, c > 0.8 ? 2 : 1)
|
||||
}
|
||||
if (this.dim !== "3d") return
|
||||
// the planet, behind the far wall's windows
|
||||
const R = this.s * 5.6
|
||||
const [px, py] = this.P(ROOM.w * 0.86, -2.6, 4.6)
|
||||
g.save()
|
||||
g.beginPath()
|
||||
g.arc(px, py, R, 0, Math.PI * 2)
|
||||
g.clip()
|
||||
const base = g.createRadialGradient(px - R * 0.35, py - R * 0.35, R * 0.1, px, py, R)
|
||||
base.addColorStop(0, "#f2a35e")
|
||||
base.addColorStop(1, "#b34e1f")
|
||||
g.fillStyle = base
|
||||
g.fillRect(px - R, py - R, R * 2, R * 2)
|
||||
const bands = ["#f6c48b", "#d9773b", "#fbe0b8", "#c85f29", "#efae6c", "#a8441b"]
|
||||
g.translate(px, py)
|
||||
g.rotate(-0.28)
|
||||
for (let i = 0; i < 9; i++) {
|
||||
g.fillStyle = bands[i % bands.length]
|
||||
g.globalAlpha = 0.55
|
||||
const yb = -R + (i + 0.3) * (R * 2) / 9 + Math.sin(i * 1.7 + this.t * 0.05) * 3
|
||||
g.fillRect(-R * 1.2, yb, R * 2.4, R * (0.07 + (i % 3) * 0.04))
|
||||
}
|
||||
g.globalAlpha = 1
|
||||
g.rotate(0.28)
|
||||
const shadow = g.createRadialGradient(R * 0.45, R * 0.45, R * 0.2, 0, 0, R * 1.05)
|
||||
shadow.addColorStop(0, "rgba(0,0,0,0)")
|
||||
shadow.addColorStop(0.55, "rgba(0,0,0,0)")
|
||||
shadow.addColorStop(1, "rgba(5,7,15,.75)")
|
||||
g.fillStyle = shadow
|
||||
g.fillRect(-R, -R, R * 2, R * 2)
|
||||
g.restore()
|
||||
}
|
||||
|
||||
floor() {
|
||||
const dark = "#262932", light = "#2d313b"
|
||||
for (let x = 0; x < ROOM.w; x++) for (let y = 0; y < ROOM.d; y++) {
|
||||
const P = (a, b) => this.P(a, b, 0)
|
||||
this.poly([P(x, y), P(x + 1, y), P(x + 1, y + 1), P(x, y + 1)], (x + y) % 2 ? dark : light)
|
||||
}
|
||||
// the room's edge
|
||||
if (this.dim === "3d") {
|
||||
const t = 0.25
|
||||
this.poly([this.P(0, ROOM.d, 0), this.P(ROOM.w, ROOM.d, 0), this.P(ROOM.w, ROOM.d, -t), this.P(0, ROOM.d, -t)], "#1b1d24")
|
||||
this.poly([this.P(ROOM.w, 0, 0), this.P(ROOM.w, ROOM.d, 0), this.P(ROOM.w, ROOM.d, -t), this.P(ROOM.w, 0, -t)], "#14161b")
|
||||
}
|
||||
// the glowing guide lines
|
||||
const g = this.g
|
||||
g.save()
|
||||
g.strokeStyle = "rgba(125, 211, 252, .55)"
|
||||
g.shadowColor = "rgba(125, 211, 252, .9)"
|
||||
g.shadowBlur = 8
|
||||
g.lineWidth = 2
|
||||
g.beginPath()
|
||||
let [a, b] = this.P(2.6, 3.2, 0.01); g.moveTo(a, b)
|
||||
;[a, b] = this.P(9.6, 3.2, 0.01); g.lineTo(a, b)
|
||||
;[a, b] = this.P(9.6, 10.1, 0.01); g.lineTo(a, b)
|
||||
g.stroke()
|
||||
g.restore()
|
||||
// the square where an agent waits for you
|
||||
g.save()
|
||||
const pulse = 0.55 + 0.25 * Math.sin(this.t * 2.2)
|
||||
g.strokeStyle = `rgba(192, 132, 252, ${pulse})`
|
||||
g.shadowColor = "rgba(192, 132, 252, .9)"
|
||||
g.shadowBlur = 10
|
||||
g.lineWidth = 2.5
|
||||
const z = ZONE
|
||||
this.poly([this.P(z.x, z.y, 0.01), this.P(z.x + z.w, z.y, 0.01), this.P(z.x + z.w, z.y + z.d, 0.01), this.P(z.x, z.y + z.d, 0.01)], "rgba(192,132,252,.07)")
|
||||
g.beginPath()
|
||||
;[[z.x, z.y], [z.x + z.w, z.y], [z.x + z.w, z.y + z.d], [z.x, z.y + z.d], [z.x, z.y]].forEach(([x, y], i) => {
|
||||
const [sx, sy] = this.P(x, y, 0.01)
|
||||
i ? g.lineTo(sx, sy) : g.moveTo(sx, sy)
|
||||
})
|
||||
g.stroke()
|
||||
g.restore()
|
||||
}
|
||||
|
||||
walls() {
|
||||
const H = ROOM.wall
|
||||
if (this.dim !== "3d") {
|
||||
this.box(-0.35, -0.35, 0, ROOM.w + 0.35, 0.35, 0.9, "#9aa1ad")
|
||||
this.box(-0.35, 0, 0, 0.35, ROOM.d, 0.9, "#8a919c")
|
||||
return
|
||||
}
|
||||
const g = this.g
|
||||
// the far wall (y = 0) with its big windows onto the planet
|
||||
const far = (x0, x1, z0, z1) => [this.P(x0, 0, z0), this.P(x1, 0, z0), this.P(x1, 0, z1), this.P(x0, 0, z1)]
|
||||
g.save()
|
||||
g.beginPath()
|
||||
far(0, ROOM.w, 0, H).forEach(([x, y], i) => (i ? g.lineTo(x, y) : g.moveTo(x, y)))
|
||||
g.closePath()
|
||||
const wins = []
|
||||
for (let x = 1.6; x < ROOM.w - 1; x += 2.35) wins.push([x, x + 1.9])
|
||||
for (const [a, b] of wins) {
|
||||
const pts = far(a, b, 1.05, H - 0.35)
|
||||
g.moveTo(pts[0][0], pts[0][1])
|
||||
for (const p of pts.slice(1)) g.lineTo(p[0], p[1])
|
||||
g.closePath()
|
||||
}
|
||||
g.fillStyle = "#c9ccd3"
|
||||
g.fill("evenodd")
|
||||
g.restore()
|
||||
for (const [a, b] of wins) {
|
||||
// glass and frame
|
||||
this.poly(far(a, b, 1.05, H - 0.35), "rgba(120,170,255,.06)", "#7d838f")
|
||||
this.poly(far((a + b) / 2 - 0.04, (a + b) / 2 + 0.04, 1.05, H - 0.35), "#7d838f")
|
||||
}
|
||||
this.poly(far(0, ROOM.w, 0, 0.32), "#9097a3")
|
||||
this.poly([this.P(0, -0.25, H), this.P(ROOM.w, -0.25, H), this.P(ROOM.w, 0, H), this.P(0, 0, H)], "#e6e8ec")
|
||||
// the left wall (x = 0): the airlock and small portholes
|
||||
const left = (y0, y1, z0, z1) => [this.P(0, y0, z0), this.P(0, y1, z0), this.P(0, y1, z1), this.P(0, y0, z1)]
|
||||
this.poly(left(0, ROOM.d, 0, H), "#a9aeb8")
|
||||
this.poly(left(0, ROOM.d, 0, 0.32), "#80868f")
|
||||
this.poly([this.P(-0.25, 0, H), this.P(0, 0, H), this.P(0, ROOM.d, H), this.P(-0.25, ROOM.d, H)], "#d7d9de")
|
||||
// airlock door
|
||||
this.poly(left(1.7, 3.5, 0, 2.3), "#4b5563")
|
||||
this.poly(left(1.82, 2.58, 0.05, 2.18), "#6b7280")
|
||||
this.poly(left(2.62, 3.38, 0.05, 2.18), "#6b7280")
|
||||
this.poly(left(1.7, 3.5, 2.38, 2.74), "#1f2937")
|
||||
this.signText("AIRLOCK", 0, 2.6, 2.56, "left", "#f6c453")
|
||||
for (const y0 of [5.2, 8.0]) {
|
||||
this.poly(left(y0, y0 + 1.6, 1.25, 2.35), "#0b1020", "#6b7280")
|
||||
for (const [a, b, c] of this.stars.slice(0, 10)) {
|
||||
const [sx, sy] = this.P(0, y0 + 0.1 + a * 1.4, 1.35 + b * 0.9)
|
||||
g.fillStyle = `rgba(255,255,255,${0.3 + c * 0.6})`
|
||||
g.fillRect(sx, sy, 1, 1)
|
||||
}
|
||||
}
|
||||
// the station's name on the far wall
|
||||
const [nx, ny] = this.P(ROOM.w - 2.2, 0, 2.55)
|
||||
g.save()
|
||||
g.translate(nx, ny)
|
||||
g.transform(1, 0.577, 0, 1, 0, 0)
|
||||
g.fillStyle = "#1f2937"
|
||||
g.fillRect(-this.s * 1.5, -this.s * 0.24, this.s * 3, this.s * 0.48)
|
||||
this.text("ORBITAL STATION 7", 0, 0, Math.max(7, this.s * 0.26), "#e5e7eb", "800")
|
||||
g.restore()
|
||||
}
|
||||
|
||||
signText(s, x, y, z, side, color) {
|
||||
const g = this.g
|
||||
const [sx, sy] = this.P(x, y, z)
|
||||
g.save()
|
||||
g.translate(sx, sy)
|
||||
if (side === "left") g.transform(1, -0.577, 0, 1, 0, 0)
|
||||
this.text(s, 0, 0, Math.max(7, this.s * 0.22), color, "800")
|
||||
g.restore()
|
||||
}
|
||||
|
||||
// ---- furniture: each a drawable with a depth -------------------
|
||||
props() {
|
||||
const out = []
|
||||
const add = (x, y, w, d, fn) => out.push({ k: this.depth(x + w / 2, y + d), fn })
|
||||
const S = this
|
||||
const glow = (c) => shade(c, 0.1 + 0.08 * Math.sin(this.t * 3))
|
||||
for (const [i, dk] of DESKS.entries()) {
|
||||
const who = this.atSeat?.[i]
|
||||
add(dk.x, dk.y, dk.w, dk.d, () => {
|
||||
// desk
|
||||
S.box(dk.x, dk.y, 0, dk.w, dk.d, 0.62, "#e5e7eb")
|
||||
S.box(dk.x + 0.06, dk.y + 0.06, 0.62, dk.w - 0.12, dk.d - 0.12, 0.05, "#f6c453")
|
||||
// The monitor stands on the desk's far edge and its screen faces
|
||||
// the sitter: a north-facing sitter reads the +y face, a
|
||||
// south-facing one the -y face.
|
||||
const south = dk.face === "s"
|
||||
const my = south ? dk.y + dk.d - 0.25 : dk.y + 0.12
|
||||
const screen = who ? glow(who.color) : "#1f2937"
|
||||
S.box(dk.x + dk.w / 2 - 0.08, my + 0.05, 0.67, 0.16, 0.1, 0.22, "#4b5563")
|
||||
S.box(dk.x + 0.25, my, 0.85, dk.w - 0.5, 0.12, 0.5, "#374151")
|
||||
const face = south ? "onBack" : "onFront"
|
||||
S[face](dk.x + 0.25, my, 0.85, dk.w - 0.5, 0.12, 0.5, 0.06, 0.1, 0.94, 0.9, screen)
|
||||
if (who) {
|
||||
// lines of code scrolling on the screen
|
||||
for (let l = 0; l < 3; l++) {
|
||||
const u = 0.12 + 0.15 * ((l + Math.floor(this.t * 3)) % 3)
|
||||
S[face](dk.x + 0.25, my, 0.85, dk.w - 0.5, 0.12, 0.5, 0.12, 0.25 + l * 0.2, 0.12 + u * 3, 0.32 + l * 0.2, "rgba(255,255,255,.55)")
|
||||
}
|
||||
}
|
||||
})
|
||||
// the chair, its own drawable so the worker sits in it; its back
|
||||
// stands behind the sitter, opposite the way they look
|
||||
const [cx, cy] = dk.seat
|
||||
out.push({ k: this.depth(cx, cy) - 0.05, fn: () => {
|
||||
S.box(cx - 0.28, cy - 0.28, 0, 0.56, 0.56, 0.36, "#9ca3af")
|
||||
} })
|
||||
const backY = dk.face === "s" ? cy - 0.32 : cy + 0.22
|
||||
out.push({ k: this.depth(cx, backY + 0.06), fn: () => S.box(cx - 0.28, backY, 0.36, 0.56, 0.1, 0.5, "#6b7280") })
|
||||
}
|
||||
// A sofa and its seated occupants are one compositing group. Sorting
|
||||
// cushions and people independently lets the next cushion/armrest
|
||||
// paint over a neighbour's torso, even after splitting the backrest.
|
||||
out.push(this.sofaLayer(false), this.sofaLayer(true))
|
||||
|
||||
// the holo table with its planet
|
||||
add(6.3, 5.2, 1.6, 1.6, () => {
|
||||
S.box(6.3, 5.2, 0, 1.6, 1.6, 0.25, "#6b7280")
|
||||
S.box(6.55, 5.45, 0.25, 1.1, 1.1, 0.5, "#9ca3af")
|
||||
S.box(6.75, 5.65, 0.75, 0.7, 0.7, 0.08, "#e5e7eb")
|
||||
const [hx, hy] = S.P(7.1, 6.0, 1.45 + Math.sin(this.t * 1.5) * 0.06)
|
||||
const g = S.g
|
||||
const r = S.s * 0.32
|
||||
g.save()
|
||||
g.globalAlpha = 0.85
|
||||
const beam = g.createLinearGradient(hx, hy, hx, hy + S.s * 0.7)
|
||||
beam.addColorStop(0, "rgba(147,197,253,.0)")
|
||||
beam.addColorStop(1, "rgba(147,197,253,.35)")
|
||||
g.fillStyle = beam
|
||||
g.beginPath(); g.moveTo(hx - r * 1.1, hy); g.lineTo(hx + r * 1.1, hy); g.lineTo(hx + r * 0.5, hy + S.s * 0.68); g.lineTo(hx - r * 0.5, hy + S.s * 0.68); g.fill()
|
||||
g.fillStyle = "#93c5fd"
|
||||
g.beginPath(); g.arc(hx, hy, r, 0, Math.PI * 2); g.fill()
|
||||
g.strokeStyle = "#dbeafe"; g.lineWidth = 2
|
||||
g.beginPath(); g.ellipse(hx, hy, r * 1.7, r * 0.45, -0.2 + Math.sin(this.t) * 0.05, 0, Math.PI * 2); g.stroke()
|
||||
g.restore()
|
||||
})
|
||||
// a stack of drums
|
||||
add(1.8, 9.6, 1.0, 1.0, () => {
|
||||
S.box(1.85, 9.65, 0, 0.9, 0.9, 0.45, "#e0a52a")
|
||||
S.box(1.85, 9.65, 0.45, 0.9, 0.9, 0.12, "#9ca3af")
|
||||
S.box(1.85, 9.65, 0.57, 0.9, 0.9, 0.45, "#f2b630")
|
||||
S.box(1.95, 9.75, 1.02, 0.7, 0.7, 0.08, "#9ca3af")
|
||||
})
|
||||
// crates
|
||||
add(8.4, 10.5, 1.4, 1.2, () => {
|
||||
for (const [x, y, z] of [[8.4, 10.5, 0], [9.1, 10.5, 0], [8.4, 11.15, 0], [9.1, 11.15, 0], [8.75, 10.8, 0.55]]) {
|
||||
S.box(x, y, z, 0.6, 0.6, 0.55, "#1f2937", { top: "#111827" })
|
||||
S.box(x + 0.15, y + 0.15, z + 0.55, 0.3, 0.3, 0.01, "#f6c453", { line: false })
|
||||
}
|
||||
})
|
||||
// the robot dog
|
||||
const rx = 11.3 + Math.sin(this.t * 0.4) * 0.8
|
||||
add(rx, 10.9, 0.8, 0.5, () => {
|
||||
S.box(rx, 10.9, 0.15, 0.7, 0.45, 0.3, "#3f3f46")
|
||||
S.box(rx + 0.55, 10.95, 0.4, 0.3, 0.35, 0.25, "#27272a")
|
||||
S.box(rx + 0.05, 10.9, 0, 0.1, 0.1, 0.15, "#18181b")
|
||||
S.box(rx + 0.55, 11.25, 0, 0.1, 0.1, 0.15, "#18181b")
|
||||
S.box(rx + 0.8, 11.0, 0.5, 0.06, 0.08, 0.06, "#f6c453", { line: false })
|
||||
})
|
||||
// the reactor, and the console that throws errors
|
||||
add(12.6, 8.8, 1.3, 1.3, () => {
|
||||
S.box(12.65, 8.85, 0, 1.2, 1.2, 0.35, "#27272a")
|
||||
S.box(12.8, 9.0, 0.35, 0.9, 0.9, 0.55, "#e0a52a")
|
||||
S.box(12.95, 9.15, 0.9, 0.6, 0.6, 0.2, "#d4d4d8")
|
||||
})
|
||||
const broken = this.errors > 0
|
||||
add(14.3, 6.6, 1.2, 1.6, () => {
|
||||
S.box(14.3, 6.6, 0, 1.2, 1.6, 0.75, "#3f3f46")
|
||||
S.box(14.4, 6.7, 0.75, 0.9, 1.4, 0.55, "#52525b")
|
||||
S.onRight(14.4, 6.7, 0.75, 0.9, 1.4, 0.55, 0.1, 0.15, 0.9, 0.85, broken ? (Math.sin(this.t * 8) > 0 ? "#ef4444" : "#7f1d1d") : "#0ea5e9")
|
||||
S.box(14.75, 7.25, 1.3, 0.2, 0.2, 0.2, broken ? "#ef4444" : "#22c55e", { line: false })
|
||||
})
|
||||
// a console on the far wall's right
|
||||
add(14.0, 0.5, 1.6, 1.0, () => {
|
||||
S.box(14.0, 0.5, 0, 1.6, 1.0, 0.8, "#4b5563")
|
||||
S.box(14.1, 0.5, 0.8, 1.4, 0.35, 0.6, "#374151")
|
||||
S.onFront(14.1, 0.5, 0.8, 1.4, 0.35, 0.6, 0.1, 0.15, 0.9, 0.85, glow("#f59e0b"))
|
||||
})
|
||||
return out
|
||||
}
|
||||
|
||||
sofaLayer(front) {
|
||||
return { k: front ? this.depth(3.7, 11.7) : this.depth(1.1, 9.1), fn: () => {
|
||||
if (front) {
|
||||
for (let i = 0; i < 2; i++) {
|
||||
const x = 2.5 + i * 1.2
|
||||
this.box(x, 11.35, 0, 1.2, 0.35, 0.95, "#d99a1e")
|
||||
this.box(x, 10.55, 0, 1.2, 0.8, 0.42, "#f2b630")
|
||||
}
|
||||
this.box(2.5, 10.55, 0, 0.12, 1.15, 0.7, "#d99a1e")
|
||||
} else {
|
||||
for (let i = 0; i < 5; i++) {
|
||||
const y = 4.4 + i * 0.88
|
||||
this.box(0.35, y, 0, 0.4, 0.88, 0.95, "#d99a1e")
|
||||
this.box(0.7, y, 0, 0.8, 0.88, 0.42, "#f2b630")
|
||||
}
|
||||
this.box(0.7, 4.1, 0, 0.8, 0.3, 0.7, "#d99a1e")
|
||||
this.box(0.7, 8.8, 0, 0.8, 0.3, 0.7, "#d99a1e")
|
||||
}
|
||||
const seated = [...this.workers.values()].filter(w =>
|
||||
this.sofaGroup(w) === (front ? 1 : 0))
|
||||
seated.sort((a, b) => this.depth(a.x, a.y) - this.depth(b.x, b.y))
|
||||
for (const w of seated) this.worker(w)
|
||||
} }
|
||||
}
|
||||
|
||||
sofaGroup(w) {
|
||||
if (Number.isInteger(w.transit)) return w.transit >= 5 ? 1 : 0
|
||||
if (w.kind === "sofa" && !w.walking) return w.slot >= 5 ? 1 : 0
|
||||
// The aisle is in front: a distant backrest must not cover its walkers.
|
||||
if (w.x >= 1.5 && w.x <= 2.5 && w.y >= 4.1 && w.y <= 9.1) return 0
|
||||
if (w.x >= 2.5 && w.x <= 4.9 && w.y >= 9.8 && w.y <= 10.55) return 1
|
||||
return -1
|
||||
}
|
||||
|
||||
// ---- workers -------------------------------------------------------
|
||||
setAgents(list) {
|
||||
const seen = new Set()
|
||||
const used = { seat: new Set(), sofa: new Set(), zone: new Set(), err: new Set(), wander: new Set() }
|
||||
const kindOf = (a) => (a.status === "waiting" ? "zone" : a.status === "error" ? "err" : a.status === "done" ? "sofa" : "seat")
|
||||
const spots = {
|
||||
seat: DESKS.map((d) => [d.seat[0], d.seat[1], d.face || "n"]),
|
||||
sofa: SOFA.map(([x, y], i) => [x, y, SOFA_FACE[i]]),
|
||||
zone: ZONE_SPOTS.map(([x, y]) => [x, y, "s"]),
|
||||
err: ERROR_SPOTS.map(([x, y]) => [x, y, "s"]),
|
||||
wander: WANDER.map(([x, y]) => [x, y, "s"]),
|
||||
}
|
||||
// the ones whose place is still theirs keep it
|
||||
for (const a of list) {
|
||||
const w = this.workers.get(a.key)
|
||||
if (w && w.kind === kindOf(a) && w.slot >= 0) used[w.kind].add(w.slot)
|
||||
}
|
||||
for (const a of list) {
|
||||
seen.add(a.key)
|
||||
let w = this.workers.get(a.key)
|
||||
if (!w) {
|
||||
const sk = SKIN[a.seed % SKIN.length], hr = HAIR[(a.seed >>> 5) % HAIR.length]
|
||||
// its own place in the doorway, so a crowd doesn't stand in one spot
|
||||
const [sx, sy] = this.first ? [null, null] : [DOOR[0], DOOR[1] + (((a.seed >>> 3) % 7) - 3) * 0.3]
|
||||
w = { key: a.key, x: sx, y: sy, skin: sk, hair: hr, pants: PANTS[(a.seed >>> 9) % PANTS.length], long: (a.seed >>> 13) % 3 === 0, kind: "", slot: -1, phase: rnd(a.seed, 3) * 6 }
|
||||
this.workers.set(a.key, w)
|
||||
}
|
||||
w.a = a
|
||||
w.color = a.brand.color
|
||||
let kind = kindOf(a)
|
||||
if (w.kind !== kind || w.slot < 0) {
|
||||
const n = spots[kind].length
|
||||
let slot = -1
|
||||
for (let i = 0; i < n; i++) {
|
||||
const j = (a.seed + i) % n
|
||||
if (!used[kind].has(j)) { slot = j; break }
|
||||
}
|
||||
if (slot < 0) {
|
||||
// no room left there: stand about
|
||||
kind = "wander"
|
||||
for (let i = 0; i < WANDER.length; i++) {
|
||||
const j = (a.seed + i) % WANDER.length
|
||||
if (!used.wander.has(j)) { slot = j; break }
|
||||
}
|
||||
if (slot < 0) slot = a.seed % WANDER.length
|
||||
}
|
||||
used[kind].add(slot)
|
||||
w.kind = kind
|
||||
w.slot = slot
|
||||
}
|
||||
const [tx, ty, facing] = spots[w.kind][w.slot]
|
||||
const to = tx + "," + ty
|
||||
if (w.pathTo !== to) { w.pathTo = to; w.path = null }
|
||||
w.tx = tx; w.ty = ty
|
||||
w.facing = facing || "s"
|
||||
if (w.x == null) { w.x = tx; w.y = ty }
|
||||
}
|
||||
for (const k of [...this.workers.keys()]) if (!seen.has(k)) this.workers.delete(k)
|
||||
this.first = false
|
||||
this.atSeat = {}
|
||||
for (const w of this.workers.values()) if (w.kind === "seat") this.atSeat[w.slot] = w
|
||||
this.errors = list.filter((a) => a.status === "error").length
|
||||
}
|
||||
|
||||
step(dt) {
|
||||
const v = 2.6 * dt
|
||||
for (const w of this.workers.values()) {
|
||||
if (!w.path) w.path = NAV.path([w.x, w.y], [w.tx, w.ty], w.transit)
|
||||
w.transit = w.path[0]?.[2] ?? null
|
||||
let left = v
|
||||
while (left > 1e-6 && w.path.length) {
|
||||
w.transit = w.path[0][2] ?? null
|
||||
const [px, py] = w.path[0]
|
||||
const dx = px - w.x, dy = py - w.y
|
||||
const d = Math.hypot(dx, dy)
|
||||
if (d <= left) { w.x = px; w.y = py; w.path.shift(); left -= d }
|
||||
else {
|
||||
w.x += (dx / d) * left
|
||||
w.y += (dy / d) * left
|
||||
w.dir = Math.abs(dx) > Math.abs(dy) ? (dx > 0 ? "x" : "-x") : (dy > 0 ? "y" : "-y")
|
||||
left = 0
|
||||
}
|
||||
}
|
||||
w.walking = w.path.length > 0
|
||||
if (!w.walking) w.transit = null
|
||||
}
|
||||
this.spread()
|
||||
}
|
||||
|
||||
// nobody stands inside anybody: the ones on the move give way, and a
|
||||
// pair that meet both step aside, as long as the floor is free there
|
||||
spread() {
|
||||
const ws = [...this.workers.values()].filter((w) => w.x != null)
|
||||
const min = 0.34
|
||||
for (let i = 0; i < ws.length; i++) {
|
||||
for (let j = i + 1; j < ws.length; j++) {
|
||||
const a = ws[i], b = ws[j]
|
||||
if (!a.walking && !b.walking) continue
|
||||
if (Number.isInteger(a.transit) || Number.isInteger(b.transit)) continue
|
||||
let dx = b.x - a.x, dy = b.y - a.y
|
||||
let d = Math.hypot(dx, dy)
|
||||
if (d >= min) continue
|
||||
if (d < 1e-4) { dx = (i % 2 ? 1 : -1) * 0.01; dy = 0.004; d = 0.011 }
|
||||
const push = ((min - d) / 2) * 1.05
|
||||
const ux = dx / d, uy = dy / d
|
||||
const ax = a.x - ux * push, ay = a.y - uy * push
|
||||
const bx = b.x + ux * push, by = b.y + uy * push
|
||||
if (a.walking && NAV.clear([a.x, a.y], [ax, ay]) && NAV.freeAt(ax, ay)) { a.x = ax; a.y = ay }
|
||||
if (b.walking && NAV.clear([b.x, b.y], [bx, by]) && NAV.freeAt(bx, by)) { b.x = bx; b.y = by }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
worker(w) {
|
||||
const S = this, t = this.t + w.phase, a = w.a
|
||||
const st = a.status
|
||||
const sitting = !w.walking && (w.kind === "seat" || w.kind === "sofa")
|
||||
const pose = idlePose(w, this.t, this.reducedMotion)
|
||||
const sleeping = sitting && w.kind === "sofa" && (a.idle || pose.kind === "doze")
|
||||
const f0 = w.walking ? "s" : (w.facing || "s")
|
||||
let { x, y } = w
|
||||
let z = 0
|
||||
if (w.walking) z = Math.abs(Math.sin(t * 9)) * 0.06
|
||||
else if (st === "waiting") z = Math.max(0, Math.sin(t * 5)) * 0.18
|
||||
const bw = 0.44, bd = 0.3
|
||||
const bx = x - bw / 2, by = y - bd / 2
|
||||
// shadow, and a ring when it is the one picked or pointed at
|
||||
const [shx, shy] = S.P(x, y, 0)
|
||||
const ry = this.dim === "3d" ? 0.16 : 0.12
|
||||
S.g.fillStyle = "rgba(0,0,0,.28)"
|
||||
S.g.beginPath()
|
||||
S.g.ellipse(shx, shy, S.s * 0.3, S.s * ry, 0, 0, Math.PI * 2)
|
||||
S.g.fill()
|
||||
if (this.selected === w.key || this.highlight === w.key) {
|
||||
S.g.save()
|
||||
S.g.strokeStyle = this.selected === w.key ? "rgba(255,255,255,.95)" : "rgba(255,255,255,.55)"
|
||||
S.g.lineWidth = this.selected === w.key ? 2.5 : 1.5
|
||||
S.g.beginPath()
|
||||
S.g.ellipse(shx, shy, S.s * 0.46, S.s * ry * 1.5, 0, 0, Math.PI * 2)
|
||||
S.g.stroke()
|
||||
S.g.restore()
|
||||
}
|
||||
let hip = 0.34
|
||||
const dir = FACE[w.facing] || FACE.s
|
||||
const swing = pose.kind === "swing" ? Math.sin(pose.phase * 5) * pose.amount * 0.09 : 0
|
||||
if (sitting) {
|
||||
hip = 0.4
|
||||
const thigh = 0.4, legW = 0.16
|
||||
if (dir[1] !== 0) {
|
||||
// thighs out along y, shins down at their far end
|
||||
const ty = dir[1] > 0 ? by + bd - 0.1 : by - thigh + 0.1
|
||||
S.box(bx + 0.04, ty, hip - 0.02, legW, thigh, 0.13, w.pants)
|
||||
S.box(bx + bw - legW - 0.04, ty, hip - 0.02, legW, thigh, 0.13, w.pants)
|
||||
const sy = dir[1] > 0 ? ty + thigh - 0.14 : ty
|
||||
S.box(bx + 0.04, sy + swing, 0, legW, 0.14, hip, w.pants)
|
||||
S.box(bx + bw - legW - 0.04, sy - swing, 0, legW, 0.14, hip, w.pants)
|
||||
} else {
|
||||
// thighs out along x, shins down at their far end
|
||||
const tx = dir[0] > 0 ? bx + bw - 0.1 : bx - thigh + 0.1
|
||||
S.box(tx, by + 0.05, hip - 0.02, thigh, 0.16, 0.13, w.pants)
|
||||
S.box(tx, by + bd - 0.21, hip - 0.02, thigh, 0.16, 0.13, w.pants)
|
||||
const sx = dir[0] > 0 ? tx + thigh - 0.14 : tx
|
||||
S.box(sx, by + 0.05 + swing, 0, 0.14, 0.16, hip, w.pants)
|
||||
S.box(sx, by + bd - 0.21 - swing, 0, 0.14, 0.16, hip, w.pants)
|
||||
}
|
||||
} else {
|
||||
const step = w.walking ? Math.sin(t * 9) * 0.08 : 0
|
||||
S.box(bx + 0.04, by + 0.07 + step, z, 0.16, 0.16, hip, w.pants)
|
||||
S.box(bx + bw - 0.2, by + 0.07 - step, z, 0.16, 0.16, hip, w.pants)
|
||||
}
|
||||
const stretch = pose.kind === "stretch" ? pose.amount : 0
|
||||
const zb = (sitting ? hip + 0.08 : hip) + z + stretch * 0.07
|
||||
const sleepTilt = sleeping ? 0.06 : 0
|
||||
// body
|
||||
S.box(bx, by, zb, bw, bd, 0.42, w.color)
|
||||
if (f0 === "s") S.onFront(bx, by, zb, bw, bd, 0.42, 0.38, 0.55, 0.62, 0.95, "rgba(255,255,255,.85)")
|
||||
else if (f0 === "e") S.onRight(bx, by, zb, bw, bd, 0.42, 0.38, 0.55, 0.62, 0.95, "rgba(255,255,255,.85)")
|
||||
// arms
|
||||
let armUp = 0
|
||||
if (st === "waiting" && !w.walking) armUp = 1
|
||||
const typing = sitting && w.kind === "seat" && (st === "executing" || st === "replying")
|
||||
const ay = typing ? Math.sin(t * 18) * 0.03 : 0
|
||||
S.box(bx - 0.12 - stretch * 0.06, by + 0.06 + ay, zb + 0.08 + stretch * 0.42, 0.12, 0.16, 0.32, shade(w.color, -0.1))
|
||||
if (armUp) {
|
||||
const wave = Math.sin(t * 10) * 0.08
|
||||
S.box(bx + bw, by + 0.06 + wave, zb + 0.32, 0.12, 0.14, 0.42, shade(w.color, -0.1))
|
||||
S.box(bx + bw, by + 0.06 + wave, zb + 0.74, 0.12, 0.14, 0.12, w.skin)
|
||||
} else {
|
||||
S.box(bx + bw + stretch * 0.06, by + 0.06 - ay, zb + 0.08 + stretch * 0.42, 0.12, 0.16, 0.32, shade(w.color, -0.1))
|
||||
}
|
||||
// head: a sitter facing the camera shows a face, one facing away the
|
||||
// back of the head, one facing east a profile. A flat (2D) view can
|
||||
// only show the +y face, so east/west are drawn as a face there.
|
||||
const hs = 0.46
|
||||
const glance = pose.kind === "look" ? Math.sin(pose.phase * 2.2) * pose.amount * 0.07 : 0
|
||||
const hx = x - hs / 2 + sleepTilt + glance, hy = y - hs / 2 + (sleeping ? 0.04 : 0)
|
||||
const hz = zb + 0.42 - (sleeping ? 0.06 : 0) - (pose.kind === "doze" ? pose.amount * 0.07 : 0)
|
||||
S.box(hx, hy, hz, hs, hs, hs, w.skin)
|
||||
const f = this.dim === "2d" && (w.facing === "e" || w.facing === "w") ? "s" : (w.facing || "s")
|
||||
const eyes = (cols) => {
|
||||
const draw = f === "s" ? "onFront" : "onRight"
|
||||
if (f !== "s" && f !== "e") return
|
||||
if (sleeping) {
|
||||
S[draw](hx, hy, hz, hs, hs, hs, cols[0], 0.5, cols[0] + 0.2, 0.55, "#1f2937")
|
||||
S[draw](hx, hy, hz, hs, hs, hs, cols[1], 0.5, cols[1] + 0.2, 0.55, "#1f2937")
|
||||
return
|
||||
}
|
||||
const blink = (Math.sin(t * 1.3) > 0.97) ? 0.03 : 0.14
|
||||
S[draw](hx, hy, hz, hs, hs, hs, cols[0], 0.45, cols[0] + 0.12, 0.45 + blink, "#1f2937")
|
||||
S[draw](hx, hy, hz, hs, hs, hs, cols[1], 0.45, cols[1] + 0.12, 0.45 + blink, "#1f2937")
|
||||
}
|
||||
if (f === "s") {
|
||||
S.onFront(hx, hy, hz, hs, hs, hs, 0, 0.78, 1, 1, w.hair) // fringe
|
||||
S.onRight(hx, hy, hz, hs, hs, hs, 0, 0.45, 1, 1, w.hair)
|
||||
eyes([0.22, 0.66])
|
||||
if (!sleeping) {
|
||||
S.onFront(hx, hy, hz, hs, hs, hs, 0.12, 0.3, 0.26, 0.38, "rgba(244,114,182,.45)")
|
||||
S.onFront(hx, hy, hz, hs, hs, hs, 0.74, 0.3, 0.88, 0.38, "rgba(244,114,182,.45)")
|
||||
}
|
||||
} else if (f === "e") {
|
||||
// looking east: the camera sees the right side of the head
|
||||
S.onFront(hx, hy, hz, hs, hs, hs, 0, 0.2, 1, 1, w.hair)
|
||||
S.onRight(hx, hy, hz, hs, hs, hs, 0, 0.72, 1, 1, w.hair)
|
||||
eyes([0.3, 0.62])
|
||||
} else {
|
||||
// facing away: hair on both faces the camera can see
|
||||
S.onFront(hx, hy, hz, hs, hs, hs, 0, 0.15, 1, 1, w.hair)
|
||||
S.onRight(hx, hy, hz, hs, hs, hs, 0, 0.15, 1, 1, w.hair)
|
||||
}
|
||||
if (w.long) S.onRight(hx, hy, hz, hs, hs, hs, 0, 0, 1, 0.5, w.hair)
|
||||
// hair on top
|
||||
S.box(hx - 0.03, hy - 0.03, hz + hs, hs + 0.06, hs + 0.06, 0.1, w.hair)
|
||||
const top = S.P(x, y, (sitting ? 0.48 : 0.34) + 0.42 + hs + 0.1)
|
||||
w.screen = { x: top[0], y: top[1], r: S.s * 0.5, foot: S.P(x, y, 0) }
|
||||
}
|
||||
|
||||
// the little sign over a worker's head
|
||||
bubble(w) {
|
||||
const a = w.a, g = this.g
|
||||
if (!w.screen) return
|
||||
const { x, y } = w.screen
|
||||
const r = Math.max(7, this.s * 0.2)
|
||||
const bx = x + this.s * 0.42, by = y - this.s * 0.1
|
||||
const t = this.t + w.phase
|
||||
const pill = (fill, draw) => {
|
||||
g.save()
|
||||
g.fillStyle = fill
|
||||
g.shadowColor = "rgba(0,0,0,.3)"; g.shadowBlur = 4
|
||||
g.beginPath(); g.arc(bx, by, r, 0, Math.PI * 2); g.fill()
|
||||
g.restore()
|
||||
draw()
|
||||
}
|
||||
if (a.status === "waiting") {
|
||||
const s = 1 + 0.12 * Math.sin(t * 6)
|
||||
g.save(); g.translate(bx, by); g.scale(s, s); g.translate(-bx, -by)
|
||||
pill("#f59e0b", () => this.text("!", bx, by + 0.5, r * 1.4, "#fff", "900"))
|
||||
g.restore()
|
||||
} else if (a.status === "error") {
|
||||
pill("#ef4444", () => this.text("×", bx, by, r * 1.5, "#fff", "900"))
|
||||
} else if (a.status === "thinking") {
|
||||
pill("rgba(255,255,255,.95)", () => {
|
||||
for (let i = 0; i < 3; i++) {
|
||||
g.fillStyle = `rgba(139,108,246,${0.35 + 0.65 * (Math.floor(t * 3) % 3 === i ? 1 : 0)})`
|
||||
g.beginPath(); g.arc(bx - r * 0.45 + i * r * 0.45, by, r * 0.16, 0, Math.PI * 2); g.fill()
|
||||
}
|
||||
})
|
||||
} else if (a.status === "executing") {
|
||||
pill("rgba(255,255,255,.95)", () => {
|
||||
g.save(); g.translate(bx, by); g.rotate(t * 3)
|
||||
g.strokeStyle = "#3b82f6"; g.lineWidth = Math.max(1.5, r * 0.22)
|
||||
g.beginPath(); g.arc(0, 0, r * 0.5, 0, Math.PI * 1.4); g.stroke()
|
||||
g.restore()
|
||||
})
|
||||
} else if (a.status === "replying") {
|
||||
pill("rgba(255,255,255,.95)", () => {
|
||||
g.fillStyle = "#10b981"
|
||||
for (let i = 0; i < 3; i++) {
|
||||
const len = 0.5 + 0.4 * Math.abs(Math.sin(t * 4 + i))
|
||||
g.fillRect(bx - r * 0.55, by - r * 0.4 + i * r * 0.33, r * 1.1 * len, Math.max(1.2, r * 0.15))
|
||||
}
|
||||
})
|
||||
} else if (a.idle) {
|
||||
for (let i = 0; i < 2; i++) {
|
||||
const p = ((t * 0.6 + i * 0.5) % 1)
|
||||
this.text("z", x + this.s * (0.2 + p * 0.35), y - this.s * (0.1 + p * 0.6), Math.max(8, this.s * (0.2 + 0.1 * i)), `rgba(226,232,240,${1 - p})`, "800")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
frame(now) {
|
||||
if (!this.running) return
|
||||
const dt = Math.min(0.05, (now - (this.last || now)) / 1000)
|
||||
this.last = now
|
||||
this.t += dt
|
||||
this.step(dt)
|
||||
this.draw()
|
||||
this.raf = requestAnimationFrame((n) => this.frame(n))
|
||||
}
|
||||
|
||||
draw() {
|
||||
const g = this.g
|
||||
g.clearRect(0, 0, this.W, this.H)
|
||||
this.background()
|
||||
this.floor()
|
||||
this.walls()
|
||||
const items = this.props()
|
||||
// a person sitting is ordered by the seat's front edge, not their
|
||||
// middle, so their legs are over the cushion and not inside it
|
||||
for (const w of this.workers.values()) {
|
||||
if (this.sofaGroup(w) >= 0) continue // boarding, seated, or alighting
|
||||
const sits = !w.walking && (w.kind === "seat" || w.kind === "sofa")
|
||||
items.push({ k: this.depth(w.x, w.y + (sits ? 0.34 : 0)) + 0.02, fn: () => this.worker(w) })
|
||||
}
|
||||
items.sort((a, b) => a.k - b.k)
|
||||
for (const it of items) it.fn()
|
||||
for (const w of this.workers.values()) this.bubble(w)
|
||||
const anchors = []
|
||||
for (const w of this.workers.values()) if (w.screen) anchors.push({ key: w.key, x: w.screen.x, y: w.screen.y - this.s * 0.25, r: w.screen.r, fx: w.screen.foot[0], fy: w.screen.foot[1] })
|
||||
this.onFrame(anchors)
|
||||
}
|
||||
|
||||
start() {
|
||||
if (this.running) return
|
||||
this.running = true
|
||||
this.last = 0
|
||||
this.raf = requestAnimationFrame((n) => this.frame(n))
|
||||
}
|
||||
stop() {
|
||||
this.running = false
|
||||
cancelAnimationFrame(this.raf)
|
||||
}
|
||||
|
||||
// the worker under a point of the canvas, or ""
|
||||
hit(px, py) {
|
||||
let best = "", bd = Infinity
|
||||
for (const w of this.workers.values()) {
|
||||
if (!w.screen) continue
|
||||
const cx = w.screen.x, cy = (w.screen.y + w.screen.foot[1]) / 2
|
||||
const h = (w.screen.foot[1] - w.screen.y) / 2 + 4
|
||||
const dx = Math.abs(px - cx), dy = Math.abs(py - cy)
|
||||
if (dx < this.s * 0.45 && dy < h) {
|
||||
const d = dx + dy
|
||||
if (d < bd) { bd = d; best = w.key }
|
||||
}
|
||||
}
|
||||
return best
|
||||
}
|
||||
}
|
||||
|
||||
globalThis.AgentOfficeScene = { Scene, ROOM, DESKS, SOFA, ZONE, ZONE_SPOTS, NAV, BLOCKERS, SOFA_APPROACH, SOFA_FACE, DESKS, idlePose }
|
||||
})()
|
||||
@@ -0,0 +1,167 @@
|
||||
:root {
|
||||
--bg: var(--magpie-bg, #fff);
|
||||
--card: var(--magpie-card, #f6f6f7);
|
||||
--fg: var(--magpie-fg, #1d1d1f);
|
||||
--muted: var(--magpie-muted, #6e6e73);
|
||||
--line: var(--magpie-line, #e5e5ea);
|
||||
--accent: var(--magpie-accent, #4f46e5);
|
||||
--font: var(--magpie-font, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif);
|
||||
--mono: var(--magpie-code, ui-monospace, SFMono-Regular, Menlo, monospace);
|
||||
--sheet: var(--card);
|
||||
--think: #8b6cf6; --exec: #3b82f6; --reply: #10b981; --wait: #f59e0b; --done: #22a35a; --err: #ef4444;
|
||||
}
|
||||
[data-theme="dark"] { --sheet: #1c1c1f; }
|
||||
* { box-sizing: border-box; }
|
||||
/* the page paints no background of its own: magpie's shows through, so
|
||||
there is never a ring of a different colour at the frame's edge */
|
||||
html, body { margin: 0; height: 100%; background: transparent; color: var(--fg); }
|
||||
/* no card around the page: it meets magpie's own background, so the
|
||||
window's inset shows no ring of a different colour */
|
||||
body { padding: 18px 24px 12px; font: 13px/1.45 var(--font); }
|
||||
button { font: inherit; color: inherit; }
|
||||
|
||||
.card { display: flex; flex-direction: column; height: 100%; min-height: 520px; }
|
||||
body.panel, .card { background: none; }
|
||||
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
|
||||
h1 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
|
||||
.eyes { display: inline-flex; gap: 2px; }
|
||||
.eyes i { width: 11px; height: 13px; border-radius: 50%; background: #fff; border: 1.5px solid #1f2937; position: relative; }
|
||||
.eyes i::after { content: ""; position: absolute; width: 5px; height: 6px; border-radius: 50%; background: #1f2937; left: 1px; top: 3px; animation: look 6s infinite; }
|
||||
@keyframes look { 0%, 40% { left: 1px; } 50%, 90% { left: 4px; } 100% { left: 1px; } }
|
||||
.counts { display: flex; gap: 22px; color: var(--muted); font-size: 14px; }
|
||||
.count { display: inline-flex; align-items: center; gap: 6px; }
|
||||
.count i { width: 9px; height: 9px; border-radius: 50%; }
|
||||
.count b { color: var(--fg); font-variant-numeric: tabular-nums; margin-left: 2px; }
|
||||
.need i { background: var(--wait); } .work i { background: var(--exec); } .done i { background: var(--done); }
|
||||
.counts.alert .need { color: var(--wait); }
|
||||
.counts.alert .need i { animation: pulse 1.2s infinite; }
|
||||
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(245, 158, 11, .25); } }
|
||||
|
||||
.bar { display: flex; align-items: center; gap: 14px; padding: 14px 0; }
|
||||
.grow { flex: 1; }
|
||||
.note { color: var(--muted); font-size: 12px; }
|
||||
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; }
|
||||
.seg button { border: 0; background: none; padding: 6px 15px; border-radius: 8px; color: var(--muted); font-size: 14px; cursor: pointer; }
|
||||
.seg.dark { background: var(--bg); border: 1px solid var(--line); }
|
||||
.seg.dark button[aria-selected="true"] { background: #1f1f22; color: #fff; }
|
||||
[data-theme="dark"] .seg.dark button[aria-selected="true"] { background: #f4f4f5; color: #111; }
|
||||
.seg.plain button[aria-selected="true"] { background: rgba(0, 0, 0, .07); color: var(--fg); }
|
||||
[data-theme="dark"] .seg.plain button[aria-selected="true"] { background: rgba(255, 255, 255, .1); }
|
||||
.seg.off { opacity: .45; }
|
||||
.seg.small { background: var(--card); border: 1px solid var(--line); }
|
||||
.seg.small button { padding: 3px 9px; font-size: 12px; }
|
||||
.seg.small button[aria-selected="true"] { background: var(--bg); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
|
||||
.btn { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 7px 15px; font-size: 14px; cursor: pointer; }
|
||||
.btn:hover { border-color: var(--muted); }
|
||||
.btn.on { background: #1f1f22; color: #fff; }
|
||||
.chev { font-size: 11px; opacity: .6; margin-left: 2px; }
|
||||
.menu-wrap { position: relative; }
|
||||
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 260px; padding: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .16); }
|
||||
.menu .row { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
|
||||
.menu .row:hover { background: var(--card); }
|
||||
.menu .row.col { flex-direction: column; align-items: flex-start; cursor: default; }
|
||||
.menu .row.col:hover { background: none; }
|
||||
|
||||
.stage { position: relative; flex: 1; min-height: 340px; border-radius: 14px; overflow: hidden; background: #05070f; }
|
||||
.stage[hidden], .listview[hidden] { display: none; }
|
||||
canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
|
||||
.tags { position: absolute; inset: 0; pointer-events: none; }
|
||||
.tag { position: absolute; left: 0; top: 0; pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; max-width: 220px; padding: 3px 10px 3px 4px; border: 0; border-radius: 999px; background: rgba(236, 238, 243, .9); color: #1f2937; font: 600 12px/1.3 var(--font); box-shadow: 0 2px 8px rgba(0, 0, 0, .35); cursor: pointer; white-space: nowrap; will-change: transform; transition: background .12s, box-shadow .12s; }
|
||||
.tag[hidden] { display: none; } /* the rule above would otherwise show it */
|
||||
.tag .mark { flex: none; }
|
||||
.tag .tn { overflow: hidden; text-overflow: ellipsis; }
|
||||
.tag .td { flex: none; width: 6px; height: 6px; border-radius: 50%; }
|
||||
.tag.hot { background: #fff; }
|
||||
.tag.on { background: #fff; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent), 0 2px 8px rgba(0, 0, 0, .35); z-index: 3; }
|
||||
.tag[data-status="waiting"]:not(.on) { box-shadow: 0 0 0 2px var(--wait), 0 2px 8px rgba(0, 0, 0, .35); }
|
||||
.tag[data-status="error"]:not(.on) { box-shadow: 0 0 0 2px var(--err), 0 2px 8px rgba(0, 0, 0, .35); }
|
||||
.mark { display: inline-flex; align-items: center; justify-content: center; flex: none; overflow: hidden; vertical-align: middle; border-radius: 4px; }
|
||||
.mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
|
||||
.mark.letter { color: #fff; font-weight: 800; border-radius: 5px; line-height: 1; }
|
||||
|
||||
/* the panel: one agent, opened by a click, fixed at the stage's corner */
|
||||
.card { position: relative; }
|
||||
.pop { position: absolute; z-index: 20; right: 36px; top: 214px; width: min(400px, calc(100% - 72px)); max-height: calc(100% - 300px); overflow: auto; padding: 14px 18px 12px; background: #fff; color: #1f2937; border-radius: 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, .4); font-size: 13.5px; animation: pop-in .14s ease-out; }
|
||||
.pop[hidden] { display: none; }
|
||||
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
|
||||
.ph { display: flex; align-items: center; gap: 8px; }
|
||||
.pmk { display: inline-flex; }
|
||||
.pa { color: #4b5563; font-size: 13px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.pw { color: #9ca3af; font-size: 12.5px; white-space: nowrap; }
|
||||
.px { border: 0; background: none; color: #9ca3af; font-size: 13px; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
|
||||
.px:hover { color: #111827; background: #f3f4f6; }
|
||||
.pt { margin: 6px 0 2px; font-size: 17px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
|
||||
.ps { display: flex; align-items: center; gap: 7px; margin: 8px 0; font-weight: 700; }
|
||||
.ps .pi { width: 16px; text-align: center; }
|
||||
.ps .pn { margin-left: auto; color: #9ca3af; font-weight: 500; font-size: 12px; }
|
||||
.ps.done { color: var(--done); } .ps.error { color: var(--err); } .ps.waiting { color: var(--wait); }
|
||||
.ps.thinking { color: var(--think); } .ps.executing { color: var(--exec); } .ps.replying { color: var(--reply); }
|
||||
.pq { margin: 6px 0; color: #374151; overflow-wrap: anywhere; }
|
||||
.pstep { margin: 6px 0; padding: 6px 9px; border-radius: 8px; background: #f3f4f6; color: #374151; font: 12px/1.45 var(--mono); overflow-wrap: anywhere; }
|
||||
.perr { margin: 6px 0; padding: 6px 9px; border-radius: 8px; background: rgba(239, 68, 68, .09); color: #b91c1c; font-size: 12.5px; overflow-wrap: anywhere; }
|
||||
.pr { color: #374151; margin: 8px 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
|
||||
.pf { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; color: #9ca3af; font-size: 12.5px; }
|
||||
.pm { font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.pc { border: 0; background: none; color: #6b7280; cursor: pointer; padding: 0; white-space: nowrap; }
|
||||
.pc:hover { color: #1f2937; text-decoration: underline; }
|
||||
.pcopy { width: 100%; margin-top: 6px; font: 12px var(--mono); padding: 4px 6px; border: 1px solid #e5e7eb; border-radius: 6px; }
|
||||
.psrc { margin-top: 6px; color: #b0b5bd; font-size: 11.5px; }
|
||||
|
||||
.empty { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); max-width: 560px; padding: 10px 16px; border-radius: 12px; background: rgba(15, 23, 42, .78); color: #e2e8f0; text-align: center; font-size: 13px; backdrop-filter: blur(4px); }
|
||||
|
||||
/* the live dot by the title: green while the host writes, grey once it stops */
|
||||
.live { display: inline-flex; align-items: center; gap: 5px; margin-left: 10px; padding: 2px 8px; border-radius: 999px; background: rgba(34, 163, 90, .1); color: var(--done); font-size: 11.5px; font-weight: 600; letter-spacing: 0; }
|
||||
.live i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: live 2s infinite; }
|
||||
.live.stale { background: rgba(156, 163, 175, .15); color: var(--muted); }
|
||||
.live.stale i { animation: none; }
|
||||
@keyframes live { 50% { opacity: .35; } }
|
||||
tbody tr.on td { background: var(--accent-soft, rgba(79, 70, 229, .08)); }
|
||||
|
||||
.listview { flex: 1; overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
|
||||
table { width: 100%; border-collapse: collapse; }
|
||||
th { position: sticky; top: 0; background: var(--bg); text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
|
||||
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
|
||||
tr:last-child td { border-bottom: 0; }
|
||||
tbody tr { cursor: pointer; }
|
||||
tbody tr:hover { background: var(--card); }
|
||||
td.ag { white-space: nowrap; font-weight: 600; }
|
||||
td.ag .mark { margin-right: 6px; }
|
||||
td.task { max-width: 420px; }
|
||||
.lt { font-weight: 600; }
|
||||
.ls { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
|
||||
td.mono { font-family: var(--mono); font-size: 12px; color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
th:last-child, td.muted { white-space: nowrap; }
|
||||
td.muted { color: var(--muted); white-space: nowrap; }
|
||||
.badge { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--c); }
|
||||
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
|
||||
.empty-list { color: var(--muted); padding: 24px; text-align: center; }
|
||||
|
||||
footer { padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
|
||||
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 13px; }
|
||||
.legend.brands { font-size: 14px; color: var(--fg); opacity: .8; }
|
||||
.lg { display: inline-flex; align-items: center; gap: 6px; }
|
||||
.lg > i { width: 8px; height: 8px; border-radius: 50%; }
|
||||
|
||||
/* the office in a window of its own inside the page: what the frame lets
|
||||
a page do when the browser won't float its canvas */
|
||||
.float { position: fixed; right: 22px; bottom: 22px; z-index: 60; width: 460px; height: 330px; min-width: 260px; min-height: 200px; display: flex; flex-direction: column; overflow: hidden; resize: both; border-radius: 14px; background: #05070f; box-shadow: 0 24px 60px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .12); }
|
||||
.float[hidden] { display: none; }
|
||||
.floatbar { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; background: #15161c; color: #e5e7eb; font-size: 12px; cursor: move; user-select: none; flex: none; }
|
||||
.fdots { display: inline-flex; gap: 3px; }
|
||||
.fdots i { width: 7px; height: 7px; border-radius: 50%; background: #4b5563; }
|
||||
.floatbar span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.fclose { border: 0; background: none; color: #9ca3af; font-size: 13px; line-height: 1; padding: 4px 2px; cursor: pointer; }
|
||||
.fclose:hover { color: #fff; }
|
||||
.float .tag { font-size: 10.5px; padding: 2px 7px 2px 3px; max-width: 130px; }
|
||||
.float .tag .tn { max-width: 84px; }
|
||||
.floatslot { position: relative; flex: 1; min-height: 0; }
|
||||
.floatslot > .stage { position: absolute; inset: 0; min-height: 0; border-radius: 0; }
|
||||
.stage-slot { flex: 1; min-height: 340px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); font-size: 13px; }
|
||||
|
||||
@media (max-width: 720px) {
|
||||
body { padding: 8px; }
|
||||
.card { padding: 14px; }
|
||||
.counts { gap: 12px; font-size: 13px; }
|
||||
.bar { flex-wrap: wrap; }
|
||||
td.mono, th:nth-child(4), th:nth-child(5) { display: none; }
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
import { afterAll, expect, test } from "bun:test"
|
||||
import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"
|
||||
import { tmpdir } from "node:os"
|
||||
import { join } from "node:path"
|
||||
import { pathToFileURL } from "node:url"
|
||||
import { spawnSync } from "node:child_process"
|
||||
|
||||
const dir = import.meta.dir
|
||||
const tmps = []
|
||||
const tmp = () => { const d = mkdtempSync(join(tmpdir(), "agent-office-privacy-")); tmps.push(d); return d }
|
||||
afterAll(() => { for (const d of tmps) rmSync(d, { recursive: true, force: true }) })
|
||||
|
||||
const claudeLine = (o) => JSON.stringify(o)
|
||||
const T = (n) => `2026-10-28T10:${String(n).padStart(2, "0")}:00.000Z`
|
||||
const SECRET_PROMPT = "SECRET-PROMPT please do not leak"
|
||||
const SECRET_REPLY = "SECRET-REPLY"
|
||||
const SECRET_CMD = "SECRET-CMD curl -u admin:hunter2 x"
|
||||
|
||||
function seedSession(home) {
|
||||
const project = join(home, ".claude", "projects", "-Users-me-secret-project")
|
||||
mkdirSync(project, { recursive: true })
|
||||
writeFileSync(join(project, "secret.jsonl"), [
|
||||
claudeLine({ type: "user", sessionId: "secret", cwd: "/Users/me/secret-project", timestamp: T(1), message: { role: "user", content: SECRET_PROMPT } }),
|
||||
claudeLine({ type: "assistant", sessionId: "secret", cwd: "/Users/me/secret-project", timestamp: T(2), message: { role: "assistant", model: "claude-opus-5", stop_reason: "tool_use", content: [{ type: "text", text: SECRET_REPLY }, { type: "tool_use", id: "t1", name: "Bash", input: { command: SECRET_CMD } }] } }),
|
||||
].join("\n"))
|
||||
}
|
||||
|
||||
function runHost(spec, options, after = "", where = "xdg") {
|
||||
const home = tmp()
|
||||
const cfg = tmp()
|
||||
const work = tmp()
|
||||
seedSession(home)
|
||||
if (where !== "none") {
|
||||
const doc = JSON.stringify({ plugins: [{ spec, options }] })
|
||||
if (where === "cwd") writeFileSync(join(work, "plugins.json"), doc)
|
||||
else {
|
||||
mkdirSync(join(cfg, "magpie"), { recursive: true })
|
||||
writeFileSync(join(cfg, "magpie", "plugins.json"), doc)
|
||||
}
|
||||
}
|
||||
const out = tmp()
|
||||
const mod = pathToFileURL(join(dir, "office.hooks.mjs")).href
|
||||
const code = `const h = await import(${JSON.stringify(mod + "?privacy=" + Math.random())}); h.start(); ${after} h.stop(); h.write();`
|
||||
const env = { ...process.env, HOME: home, XDG_CONFIG_HOME: cfg, XDG_CACHE_HOME: join(home, ".cache"), MAGPIE_AGENT_OFFICE_PAGE: out }
|
||||
// an agent's own home override must not reach the sessions of the real user
|
||||
for (const k of ["CLAUDE_CONFIG_DIR", "CODEX_HOME", "DSH_HOME", "PI_CODING_AGENT_DIR", "QODER_CONFIG_DIR", "QODERCN_CONFIG_DIR", "WORKBUDDY_CONFIG_DIR", "CODEBUDDY_CONFIG_DIR", "GROK_HOME", "FACTORY_HOME_OVERRIDE", "CURSOR_CONFIG_DIR", "KIMI_CODE_HOME", "MINIMAX_DATA_DIR", "CLINE_SESSION_DATA_DIR", "CLINE_DATA_DIR", "CLINE_DIR"]) delete env[k]
|
||||
const r = spawnSync(process.execPath, ["-e", code], { cwd: where === "cwd" ? work : dir, env, encoding: "utf8" })
|
||||
if (r.status !== 0) throw new Error(`host run failed: ${r.stderr || r.stdout}`)
|
||||
return readFileSync(join(out, "live.js"), "utf8")
|
||||
}
|
||||
|
||||
const snapshot = (live) => JSON.parse(live.slice("globalThis.AgentOfficeLive = ".length).replace(/;\s*$/, ""))
|
||||
const noSecrets = (live) => {
|
||||
for (const secret of [SECRET_PROMPT, "SECRET-PROMPT", SECRET_REPLY, SECRET_CMD, "SECRET-CMD", "hunter2"]) expect(live).not.toContain(secret)
|
||||
}
|
||||
|
||||
// The host is loaded the way magpie loads it, with an install's options and
|
||||
// one Claude Code session that carries a secret in the prompt, the reply and
|
||||
// a tool argument. With text off none of the three may reach live.js.
|
||||
// magpie writes npm specs with @latest (or a pinned @version); a local
|
||||
// folder is written as its absolute path.
|
||||
const specs = [
|
||||
"@magpie-community/page-agent-office@latest",
|
||||
"@magpie-community/page-agent-office@0.1.0",
|
||||
"@magpie-community/page-agent-office",
|
||||
"QingJ01/magpie-agent-office",
|
||||
dir,
|
||||
]
|
||||
for (const spec of specs) {
|
||||
test(`${spec}: text:false writes no prompt, reply or tool argument`, () => {
|
||||
const live = runHost(spec, { text: false })
|
||||
const snap = snapshot(live)
|
||||
expect(snap.text).toBe(false)
|
||||
expect(snap.sessions.length).toBe(1)
|
||||
const s = snap.sessions[0]
|
||||
expect(s.title).toBe("secret-project")
|
||||
expect(s.step).toBe("Bash")
|
||||
expect(s.query).toBe("")
|
||||
expect(s.reply).toBe("")
|
||||
noSecrets(live)
|
||||
})
|
||||
}
|
||||
|
||||
test("a portable magpie's plugins.json in the host cwd is read", () => {
|
||||
const live = runHost("@magpie-community/page-agent-office@latest", { text: false }, "", "cwd")
|
||||
expect(snapshot(live).text).toBe(false)
|
||||
noSecrets(live)
|
||||
})
|
||||
|
||||
test("no plugins.json fails closed", () => {
|
||||
const live = runHost("@magpie-community/page-agent-office@latest", { text: true }, "", "none")
|
||||
expect(snapshot(live).text).toBe(false)
|
||||
noSecrets(live)
|
||||
})
|
||||
|
||||
test("an unmatched spec fails closed", () => {
|
||||
const live = runHost("someone-else@latest", { text: true })
|
||||
expect(snapshot(live).text).toBe(false)
|
||||
noSecrets(live)
|
||||
})
|
||||
|
||||
test("a request's ctx.options can turn text on after failing closed", () => {
|
||||
const call = `await h.onRequest({ model: "m", tools: [{ name: "Bash" }], messages: [{ role: "user", content: "x" }] }, { origin: "local", protocol: "anthropic", agent: "cursor", session: "g2", cwd: "/tmp", model: "m", query: "SECRET-GATEWAY-PROMPT", options: { text: true }, state: {}, report() {} });`
|
||||
const live = runHost("someone-else@latest", { text: false }, call)
|
||||
expect(snapshot(live).text).toBe(true)
|
||||
expect(live).toContain("SECRET-GATEWAY-PROMPT")
|
||||
})
|
||||
|
||||
test("a request without ctx.options keeps text:false", () => {
|
||||
const call = `await h.onRequest({ model: "m", tools: [{ name: "Bash" }], messages: [{ role: "user", content: "x" }] }, { origin: "local", protocol: "anthropic", agent: "cursor", session: "g1", cwd: "/tmp", model: "m", query: "SECRET-GATEWAY-PROMPT", state: {}, report() {} });`
|
||||
const live = runHost("@magpie-community/page-agent-office", { text: false }, call)
|
||||
const snap = JSON.parse(live.slice("globalThis.AgentOfficeLive = ".length).replace(/;\s*$/, ""))
|
||||
expect(snap.text).toBe(false)
|
||||
expect(live).not.toContain("SECRET-GATEWAY-PROMPT")
|
||||
})
|
||||
|
||||
test("text:true still shows what the session says", () => {
|
||||
const live = runHost("@magpie-community/page-agent-office@latest", { text: true })
|
||||
expect(live).toContain("SECRET-PROMPT")
|
||||
expect(live).toContain("SECRET-REPLY")
|
||||
expect(live).toContain("SECRET-CMD")
|
||||
})
|
||||
@@ -0,0 +1,26 @@
|
||||
import { test, expect } from 'bun:test'
|
||||
import { readFileSync } from 'node:fs'
|
||||
const scope = {}
|
||||
new Function('globalThis', readFileSync(new URL('./page/scene.js', import.meta.url), 'utf8'))(scope)
|
||||
const { Scene, SOFA } = scope.AgentOfficeScene
|
||||
for (const dim of ['2d', '3d']) {
|
||||
test(`${dim}: sofa occupants are painted after all sofa surfaces`, () => {
|
||||
const scene = Object.create(Scene.prototype)
|
||||
scene.dim = dim
|
||||
scene.workers = new Map(SOFA.map(([x, y], slot) => [slot, { x, y, slot, kind: 'sofa', walking: false }]))
|
||||
const calls = []
|
||||
scene.box = () => calls.push('furniture')
|
||||
scene.worker = w => calls.push(w.slot)
|
||||
for (const front of [false, true]) {
|
||||
calls.length = 0
|
||||
scene.sofaLayer(front).fn()
|
||||
expect(calls.filter(x => typeof x === 'number').sort()).toEqual(front ? [5, 6] : [0, 1, 2, 3, 4])
|
||||
const firstPerson = calls.findIndex(x => typeof x === 'number')
|
||||
expect(calls.slice(firstPerson).every(x => typeof x === 'number')).toBe(true)
|
||||
}
|
||||
scene.workers.get(0).walking = true
|
||||
calls.length = 0
|
||||
scene.sofaLayer(false).fn()
|
||||
expect(calls).not.toContain(0)
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
// Session files as each agent writes them, cut to the lines that matter and
|
||||
// with private text replaced. Taken from real Claude Code 2.1, Codex 0.x
|
||||
// (ChatGPT app), DeepSeek Harness v4, Gemini CLI and Pi files.
|
||||
const j = (o) => JSON.stringify(o)
|
||||
const T = (s) => `2026-10-28T10:${String(s).padStart(2, "0")}:00.000Z`
|
||||
|
||||
// Claude Code: a prompt, a tool call answered, a second tool call still out
|
||||
export const claudeRunning = [
|
||||
j({ type: "user", sessionId: "c1", cwd: "/Users/me/app", timestamp: T(1), message: { role: "user", content: "fix the failing test" } }),
|
||||
j({ type: "assistant", sessionId: "c1", timestamp: T(2), message: { role: "assistant", model: "claude-opus-5", stop_reason: "tool_use", content: [{ type: "text", text: "Running the tests." }, { type: "tool_use", id: "t1", name: "Bash", input: { command: "bun test" } }] } }),
|
||||
j({ type: "user", sessionId: "c1", timestamp: T(3), message: { role: "user", content: [{ type: "tool_result", tool_use_id: "t1", content: "1 fail" }] } }),
|
||||
j({ type: "assistant", sessionId: "c1", timestamp: T(4), message: { role: "assistant", model: "claude-opus-5", stop_reason: "tool_use", content: [{ type: "tool_use", id: "t2", name: "Edit", input: { file_path: "/Users/me/app/a.ts" } }] } }),
|
||||
j({ type: "ai-title", sessionId: "c1", aiTitle: "Fix failing test" }),
|
||||
].join("\n")
|
||||
export const claudeDone = claudeRunning + "\n" + [
|
||||
j({ type: "user", sessionId: "c1", timestamp: T(5), message: { role: "user", content: [{ type: "tool_result", tool_use_id: "t2", content: "ok" }] } }),
|
||||
j({ type: "assistant", sessionId: "c1", timestamp: T(6), message: { role: "assistant", model: "claude-opus-5", stop_reason: "end_turn", content: [{ type: "text", text: "Fixed: the date was parsed in UTC." }] } }),
|
||||
].join("\n")
|
||||
export const claudeAsks = claudeRunning.split("\n").slice(0, 3).join("\n") + "\n" +
|
||||
j({ type: "assistant", sessionId: "c1", timestamp: T(4), message: { role: "assistant", stop_reason: "tool_use", content: [{ type: "tool_use", id: "t3", name: "AskUserQuestion", input: { question: "Keep the old API?" } }] } })
|
||||
export const claudeInterrupted = claudeRunning + "\n" +
|
||||
j({ type: "user", sessionId: "c1", timestamp: T(5), message: { role: "user", content: [{ type: "text", text: "[Request interrupted by user for tool use]" }] } })
|
||||
|
||||
// Codex: session_meta, a turn, a custom tool call with no output yet
|
||||
export const codexRunning = [
|
||||
j({ timestamp: T(1), type: "session_meta", payload: { id: "019a-x", cwd: "/Users/me/blog", timestamp: T(1) } }),
|
||||
j({ timestamp: T(1), type: "event_msg", payload: { type: "thread_settings_applied", thread_settings: { model: "gpt-6.1-terra" } } }),
|
||||
j({ timestamp: T(2), type: "event_msg", payload: { type: "task_started", turn_id: "u1" } }),
|
||||
j({ timestamp: T(2), type: "response_item", payload: { type: "message", role: "user", content: [{ type: "input_text", text: "<environment_context>…</environment_context>" }] } }),
|
||||
j({ timestamp: T(2), type: "event_msg", payload: { type: "item_completed", item: { type: "UserMessage", content: [{ type: "text", text: "export the doc as markdown" }] } } }),
|
||||
j({ timestamp: T(3), type: "response_item", payload: { type: "custom_tool_call", call_id: "k1", name: "exec", input: 'text(await tools.exec_command({cmd:"pandoc in.docx -o out.md"}))' } }),
|
||||
].join("\n")
|
||||
export const codexApproval = codexRunning + "\n" + j({ timestamp: T(4), type: "event_msg", payload: { type: "exec_approval_request", command: ["rm", "-rf", "dist"] } })
|
||||
export const codexDone = codexRunning + "\n" + [
|
||||
j({ timestamp: T(4), type: "response_item", payload: { type: "custom_tool_call_output", call_id: "k1", output: "ok" } }),
|
||||
j({ timestamp: T(5), type: "event_msg", payload: { type: "task_complete", last_agent_message: "Exported to out.md.", completed_at: 1793196300 } }),
|
||||
].join("\n")
|
||||
export const codexAborted = codexRunning + "\n" + j({ timestamp: T(4), type: "event_msg", payload: { type: "turn_aborted", reason: "interrupted" } })
|
||||
|
||||
// DeepSeek Harness v4: typed events
|
||||
const D = (seq, type, data, extra = {}) => j({ type, seq, time: 1793196000000 + seq * 1000, data, ...extra })
|
||||
export const dshApproval = [
|
||||
j({ type: "session", version: 4, id: "session-d1", createdAt: 1793196000000, cwd: "/Users/me/site" }),
|
||||
D(1, "session/title", { title: "Deploy the site" }),
|
||||
D(2, "model/selection", { provider: "magpie", model: "deepseek-flash" }),
|
||||
D(3, "user/message", { content: [{ type: "text", text: "Time sampled while preparing…" }], source: { kind: "time-context" } }),
|
||||
D(4, "user/message", { content: [{ type: "text", text: "deploy to cloudflare" }], source: { kind: "user" } }),
|
||||
D(5, "turn/start", { turn: 1 }),
|
||||
D(6, "tool/call", { callId: "b1", name: "bash", arguments: JSON.stringify({ command: "wrangler pages deploy ./dist" }) }),
|
||||
D(7, "approval/asked", { id: "a1", toolName: "bash", callId: "b1" }),
|
||||
].join("\n")
|
||||
export const dshError = dshApproval + "\n" + [
|
||||
D(8, "approval/decided", { id: "a1", outcome: "allowed-once" }),
|
||||
D(9, "tool/result", { message: { toolCallId: "b1", content: [{ type: "text", text: "ok" }] } }),
|
||||
D(10, "turn/end", { turn: 1, reason: { kind: "error", error: { message: "429: usage limit reached" } } }),
|
||||
].join("\n")
|
||||
|
||||
// Gemini CLI: one JSON document, a tool awaiting approval
|
||||
export const geminiApproval = j({ sessionId: "g1", startTime: T(1), messages: [
|
||||
{ id: "1", type: "user", timestamp: T(1), content: "align the chorus to 120 BPM" },
|
||||
{ id: "2", type: "gemini", timestamp: T(2), model: "gemini-3-pro", content: "", toolCalls: [{ id: "x", name: "run_shell_command", status: "awaiting_approval", args: { command: "ffmpeg -i a.wav" } }] },
|
||||
] })
|
||||
|
||||
// Pi: header, prompt, a tool call and its result, then a final stop
|
||||
export const piDone = [
|
||||
j({ type: "session", id: "p1", cwd: "/Users/me/notes", timestamp: T(1) }),
|
||||
j({ type: "message", timestamp: T(2), message: { role: "user", content: [{ type: "text", text: "tidy my notes" }] } }),
|
||||
j({ type: "message", timestamp: T(3), message: { role: "assistant", model: "qwen3", content: [{ type: "toolCall", id: "r1", name: "read", arguments: { path: "a.md" } }], stopReason: "toolUse" } }),
|
||||
j({ type: "message", timestamp: T(4), message: { role: "toolResult", toolCallId: "r1", content: [] } }),
|
||||
j({ type: "message", timestamp: T(5), message: { role: "assistant", content: [{ type: "text", text: "Done: 12 tools, 5 ideas." }], stopReason: "stop" } }),
|
||||
].join("\n")
|
||||
@@ -89,6 +89,8 @@
|
||||
"summary": { "en": "A page in magpie's window with calls, errors, tokens and cost for today, 7 or 30 days, and the models behind them. Reads only your usage summary.", "zh": "在 magpie 窗口里一眼看到今天、7 天或 30 天的调用、错误、token、费用和对应模型。只读取用量汇总。" } },
|
||||
{ "package": "@magpie-community/page-chat", "name": "Chat", "kind": "page", "community": true,
|
||||
"summary": { "en": "A chat page in magpie's window by Magic_zero: talk to magpie's own models with your MCP servers, instructions and skills, images and LaTeX. Runs a local service on 127.0.0.1 that only its own page can use.", "zh": "Magic_zero 做的 magpie 窗口内「对话」页面:用 magpie 自己的模型聊天,带上你的 MCP 服务器、指令和技能,支持图片与 LaTeX。本地服务只在 127.0.0.1,只给自己的页面用。" } },
|
||||
{ "package": "@magpie-community/page-agent-office", "name": "Agent Office", "kind": "page", "community": true,
|
||||
"summary": { "en": "Reads the session files of Claude Code, Codex, DeepSeek Harness, Gemini CLI, Qwen Code, Pi, omp, Qoder, WorkBuddy and CodeBuddy on this computer (prompts, replies and tool commands; text can be turned off) and shows each session as a worker in a voxel space-station office (3D/2D) or a live list, with approvals, current steps and resume commands.", "zh": "读取本机 Claude Code、Codex、DeepSeek Harness、Gemini CLI、Qwen Code、Pi、omp、Qoder、WorkBuddy、CodeBuddy 的会话文件(含提问、回复与工具命令,可关闭文本),把每个会话画成方块太空站办公室里的小人(3D/2D)或实时列表,显示批准、当前步骤与续接命令。" } },
|
||||
{"package": "@magpie-community/agent-kimi-desktop", "name": "Kimi", "kind": "agent", "community": true, "summary": {"en": "Kimi desktop Work on Magpie's Agents page: select a model from Magpie, then disconnect to restore the original service. Not Kimi Code CLI.", "zh": "把普通 Kimi 桌面版 Work 接入 Magpie Agent 页,使用已配置的模型;断开恢复原连接。不是 Kimi Code CLI。"}},
|
||||
{ "package": "@magpie-community/hooks-mail-watch", "name": "Mail Watch", "kind": "middleware", "community": true,
|
||||
"summary": { "en": "Email alerts when a provider call fails or a quota window runs out: your own SMTP account, your own words in the mail, and your own list of what to watch, with cooldowns and an hourly cap so a bad hour stays bounded — plus an optional periodic usage digest.", "zh": "供应商调用失败或额度窗口用尽时发邮件提醒:用你自己的 SMTP 账号、自己的邮件文案、自己勾选的监控事项;同类事件冷却合并,另有每小时上限,糟糕的一小时不会失控;另可开启定期用量摘要。" } },
|
||||
|
||||