Skip to content

A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.

Show what a local agent is doing and use the agents' own logos

Fei2411c5a24e889a78
diff --git a/AGENTS.md b/AGENTS.md
index 1a0c927d..3b28c294 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -21,7 +21,7 @@ The Bot team:
1. **Build on DSH; never patch it.** Bot features use the documented plugin APIs. The desktop app starts DSH only through its documented entry points (`@deepseek-ai/dsh/profile-boot`, the `dsh` CLI). Never patch DeepSeek Harness or depend on files inside a DSH install. If something is missing in DSH, stop and say so; do not work around it with a patch.
2. **No secrets.** Never write, print or commit API keys, tokens, cookies or `DSH_HOME` contents. Use the mock model (`ds-bot/dev/mock-llm.mjs`) for tests; it needs no key.
-3. **Only original material.** Do not copy code, text, icons, logos or graphics from other products or websites. Code under a license compatible with Apache 2.0 is the only exception: say where it comes from and add its notice to the `NOTICE` file.
+3. **Only original material.** Do not copy code, text, icons, logos or graphics from other products or websites. Code under a license compatible with Apache 2.0 is the only exception: say where it comes from and add its notice to the `NOTICE` file. This rule is about DS Bot's own interface. To name a third-party product that DS Bot connects to (for example the agent CLI a Bot runs on), use that product's official logo, and list it in `NOTICE` with its source and owner.
4. **`client.js` is generated.** Change `ds-bot/src/client/`, then run `npm run build` and commit both files. Never edit `client.js` by hand.
5. **Do not touch the user's own DSH data.** The desktop app keeps its data in its own `DSH_HOME`; its import only reads `~/.dsh` and never writes there. The test bench keeps its data in `.dsh-test-<name>/`. Never point a test at `~/.dsh`, at the desktop app's data or at a DSH that the user runs.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 4e8a7b1a..ffcee307 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -13,7 +13,7 @@ Collaborators of this repository push branches here and open pull requests into
1. **Build on DSH; never patch it.** The Bot features are a DSH plugin: use the plugin APIs that DSH documents (Cordis services, the plugin client entry, profile patches). The desktop app starts DSH only through the entry points that DSH documents (`@deepseek-ai/dsh/profile-boot`, the `dsh` command). Do not patch DeepSeek Harness, and do not depend on files inside a DSH install. When a feature needs something that DSH does not offer, open an issue here first; the fix can belong in DSH.
2. **Bots run in DSH Sessions.** A Bot keeps its identity while its work runs in DSH Sessions: one for its own chat, one for each group, a fresh one when the context fills up. Every turn goes through the normal DSH agent loop, tools and model routes. Do not add a second agent runtime.
3. **No real secrets anywhere.** Do not commit API keys, tokens, cookies, `DSH_HOME` folders, logs or screenshots with personal data. The tests and the test bench use a scripted mock model and need no key.
-4. **Only original material.** Do not copy code, text, icons, logos or other graphics from other products or websites. Code under a license compatible with Apache 2.0 is the only exception: say where it comes from and add its notice to a `NOTICE` file.
+4. **Only original material.** Do not copy code, text, icons, logos or other graphics from other products or websites. Code under a license compatible with Apache 2.0 is the only exception: say where it comes from and add its notice to a `NOTICE` file. This rule is about DS Bot's own interface. To name a third-party product that DS Bot connects to (for example the agent CLI a Bot runs on), use that product's official logo, and list it in `NOTICE` with its source and owner.
5. **Every change is tested.** Run the unit tests and the client check for every change (see [Test a change](#test-a-change)).
## How we work
diff --git a/NOTICE b/NOTICE
index 07454ce1..9e3841cc 100644
--- a/NOTICE
+++ b/NOTICE
@@ -211,3 +211,11 @@ their ideas; it does not contain their code.
(packages/experimental/client-ui-voice-input), MIT: the voice chat
records with the same steps (record, resample to 16 kHz mono, PCM16 WAV)
before it calls the plugin's speech service.
+
+Agent logos (ds-bot/src/client/agent-logos.js)
+The logos name the agent CLI a Bot runs on. Each is a trademark of its owner:
+Claude (Anthropic), Cursor (Anysphere), Gemini (Google), OpenCode (SST),
+Cline (Cline Bot Inc.), Qwen (Alibaba Cloud), Devin (Cognition AI),
+OpenAI (OpenAI). DS Bot is not affiliated with or endorsed by these owners.
+Vector marks from Simple Icons (https://simpleicons.org), CC0-1.0.
+Devin and OpenAI marks from the vendors' application icons.
diff --git a/ds-bot/client.js b/ds-bot/client.js
index e6269f70..ddfba6bd 100644
--- a/ds-bot/client.js
+++ b/ds-bot/client.js
@@ -270,6 +270,8 @@ var ZH = {
Sessions: "会话",
"Open this earlier session": "打开这个较早的会话",
"Session {number}": "会话 {number}",
+ "Current session": "当前会话",
+ "Current": "当前",
"This key comes from outside DS Bot, such as an environment variable, and cannot be changed here.": "这个 key 来自 DS Bot 之外(例如环境变量),这里改不了。",
"and {count} more": "还有 {count} 个",
"Remove {name}? Bots on its models need another model.": "删除 {name}?用它的模型的 Bot 要换一个模型。",
@@ -4211,6 +4213,22 @@ div:has(> nav [class*="_marks"]){display:none!important}
.bt-uimages{display:block;font-size:12px;opacity:.7}
.bt-utime{margin-top:-4px;font-size:11px;line-height:14px;color:var(--bt-ink-3);font-variant-numeric:tabular-nums;white-space:nowrap}
.bt-earlier .bt-event{margin:4px 0}
+.bt-agent-sessions-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
+.bt-agent-sessions-new{display:inline-flex;align-items:center;gap:4px;border:0;background:none;padding:2px 6px;border-radius:6px;font-size:12px;color:var(--bt-ink-2);cursor:pointer}
+.bt-agent-sessions-new:hover{background:var(--bt-hover);color:var(--bt-ink-1,inherit)}
+.bt-agent-sessions-new svg{width:12px;height:12px}
+.bt-agent-sessions{display:flex;flex-direction:column;border:1px solid var(--bt-line-2);border-radius:10px;overflow:hidden}
+.bt-agent-session{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:9px 12px;border:0;border-top:1px solid var(--bt-line-2);background:none;text-align:left;font-size:13px;color:var(--bt-ink-1,inherit);cursor:pointer}
+.bt-agent-session:first-child{border-top:0}
+.bt-agent-session:hover:not(:disabled){background:var(--bt-hover)}
+.bt-agent-session.is-current{background:var(--bt-hover);cursor:default;font-weight:600}
+.bt-agent-session-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
+.bt-agent-session-meta{flex:0 0 auto;font-size:12px;font-weight:400;color:var(--bt-ink-3,var(--bt-ink-2))}
+.bt-agent-activity{display:flex;flex-direction:column;gap:2px;margin:4px 0 6px;max-width:100%}
+.bt-agent-act{display:flex;align-items:center;gap:8px;min-height:22px;font-size:12.5px;line-height:18px;color:var(--bt-ink-2);min-width:0}
+.bt-agent-act-mark{flex:0 0 6px;width:6px;height:6px;border-radius:50%;background:var(--bt-ink-3,currentColor);opacity:.55}
+.bt-agent-act-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
+.bt-agent-act code{font:12px ui-monospace,SFMono-Regular,Menlo,monospace;background:var(--bt-hover);border-radius:4px;padding:1px 5px;color:var(--bt-ink-1,inherit)}
.bt-part-line{display:flex;align-items:center;gap:10px;margin:10px 0 6px;font-size:11px;line-height:14px;color:var(--bt-ink-3)}
.bt-part-line::before,.bt-part-line::after{content:"";flex:1;height:1px;background:var(--bt-line)}
/* The dock wrapper also holds the context meter, so it stays hidden until a side question is in it. */
@@ -4605,6 +4623,56 @@ var ImIcon = lineIcon(["M6.5 3.5h7A1.5 1.5 0 0 1 15 5v10a1.5 1.5 0 0 1-1.5 1.5h-
var QueueIcon = lineIcon(["M4 6h12", "M4 10h12", "M4 14h8", "M14 12.5l2 1.5-2 1.5"]);
var SETTINGS_ICONS = { general: GearIcon, bots: PeopleIcon, groups: ChatsIcon, im: ImIcon, usage: GaugeIcon };
+// src/client/agent-logos.js
+var AGENT_LOGOS = {
+ "claude-code": {
+ "kind": "path",
+ "d": "m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z",
+ "hex": "D97757",
+ "title": "Claude"
+ },
+ "cursor-cli": {
+ "kind": "path",
+ "d": "M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23",
+ "hex": "000000",
+ "title": "Cursor"
+ },
+ "gemini-cli": {
+ "kind": "path",
+ "d": "M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81",
+ "hex": "8E75B2",
+ "title": "Google Gemini"
+ },
+ "opencode": {
+ "kind": "path",
+ "d": "M22 24H2V0h20zM17 4.8H7v14.4h10z",
+ "hex": "000000",
+ "title": "OpenCode"
+ },
+ "cline": {
+ "kind": "path",
+ "d": "m23.365 13.556-1.442-2.895V8.994c0-2.764-2.218-5.002-4.954-5.002h-2.464c.178-.367.276-.779.276-1.213A2.77 2.77 0 0 0 12.018 0a2.77 2.77 0 0 0-2.763 2.779c0 .434.098.846.276 1.213H7.067c-2.736 0-4.954 2.238-4.954 5.002v1.667L.64 13.549c-.149.29-.149.636 0 .927l1.472 2.855v1.667C2.113 21.762 4.33 24 7.067 24h9.902c2.736 0 4.954-2.238 4.954-5.002V17.33l1.44-2.865c.143-.286.143-.622.002-.91m-12.854 2.36a2.27 2.27 0 0 1-2.261 2.273 2.27 2.27 0 0 1-2.261-2.273v-4.042A2.27 2.27 0 0 1 8.249 9.6a2.267 2.267 0 0 1 2.262 2.274zm7.285 0a2.27 2.27 0 0 1-2.26 2.273 2.27 2.27 0 0 1-2.262-2.273v-4.042A2.267 2.267 0 0 1 15.535 9.6a2.267 2.267 0 0 1 2.261 2.274z",
+ "hex": "18181B",
+ "title": "Cline"
+ },
+ "qwen-code": {
+ "kind": "path",
+ "d": "M23.919 14.545 20.817 9.17l1.47-2.544a.56.56 0 0 0 0-.566l-1.633-2.83a.57.57 0 0 0-.49-.283h-6.207L12.487.402a.57.57 0 0 0-.49-.284H8.732a.56.56 0 0 0-.49.284L5.139 5.775h-2.94a.56.56 0 0 0-.49.284L.077 8.887a.56.56 0 0 0 0 .567L3.18 14.83l-1.47 2.545a.56.56 0 0 0 0 .566l1.634 2.83a.57.57 0 0 0 .49.283h6.205l1.47 2.545a.57.57 0 0 0 .49.284h3.266a.57.57 0 0 0 .49-.284l3.104-5.375h2.94a.57.57 0 0 0 .49-.283l1.634-2.828a.55.55 0 0 0-.004-.568M8.733.686l1.634 2.828-1.634 2.828H21.8L20.164 9.17H7.425L5.63 6.06Zm1.306 19.801-6.205-.002 1.634-2.83h3.265L2.201 6.344h3.267q3.182 5.517 6.367 11.032zm10.124-5.66L18.53 12l-6.532 11.315-1.634-2.83c2.129-3.673 4.25-7.351 6.373-11.028h3.592l3.102 5.374z",
+ "hex": "6950EF",
+ "title": "QWen"
+ },
+ "devin-cli": {
+ "kind": "image",
+ "src": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAHhlWElmTU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAIdpAAQAAAABAAAATgAAAAAAAACQAAAAAQAAAJAAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAECgAwAEAAAAAQAAAEAAAAAAlNz6EQAAAAlwSFlzAAAWJQAAFiUBSVIk8AAABwlJREFUeAHtW19IVUkcHv+mZqZBWW2Um6sYhaKsUqitpYQ9bGzgqgsSRLEQtKL1FFJQL/XS1kOB9BCtLxa9WEb2IIRGbQ+SEEURmbqlsZVWkub/336/C1fu8Z6ZO+ece67G3oHxnDPzm99833fP/D2jEOEQViCsQFiBsAL/XwUi7FAfHBxMSE5Oz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/MoziFM4VDGJyP8641FnzjB8E1YgrEBYgbACYQW0FfgPnSun0N/d+rAAAAAASUVORK5CYII=",
+ "title": "Devin"
+ },
+ "codex-cli": {
+ "kind": "image",
+ "src": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAeGVYSWZNTQAqAAAACAAEARoABQAAAAEAAAA+ARsABQAAAAEAAABGASgAAwAAAAEAAgAAh2kABAAAAAEAAABOAAAAAAAAAJAAAAABAAAAkAAAAAEAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAQKADAAQAAAABAAAAQAAAAACU3PoRAAAACXBIWXMAABYlAAAWJQFJUiTwAAABzWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczpleGlmPSJodHRwOi8vbnMuYWRvYmUuY29tL2V4aWYvMS4wLyI+CiAgICAgICAgIDxleGlmOkNvbG9yU3BhY2U+MTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+MTAyNDwvZXhpZjpQaXhlbFhEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj4xMDI0PC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CsHtO6kAAA5aSURBVHgB7Zvbb9zFFc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oyskXlTkxy6TAJKAyKlUmycwQPE2AKCf+mBWmZ7lnvhx3b7zUGGr2jzqWOti6bIAYFLUmr8ArSpoX9Td9IxefY7oT1eOHk9sRnE+aUjMrxvJ7dm/ZPabn2U2L3D8PTDsNLsNKPzu4BGiAONUQHju/QN6R/z+D+v2+NdyvfJk7vh84g58XDYAkQe0oS4gajoKeJbmx1RX9VIOB2pOb9p/fiW1X/2iYof+JfB0p+Cqy98WoCVQAiFUn2M0U9i99e7Cvvd43e77vHa+uxQejelU6hgAkSE0AsH9vyI1I6C2mt6yF3Sbiuay++XUxmUus7oqE0BwJ+jWPX5YO37j1sLuV7xx7525jQ4m2vWsDHI6KDw8dxwAJr1YiuZSw1xk2NO6UB2V8FMymbNz5XE2uFov0GsLG9UDSH+3/pRWTgGHu9xz/mK8xPYrCkBcFHPBTPyvx+X63VyCtiTSb25ynO8IfbnnfFzzYvQzAaCZGTcZCR89BvEcNt5JO29e78LyZw7AhQxd6Tqn7YpOVwFY0dsv4a9qwFUNWOEIrHgT+B/pm+ClJc9ojAAAAABJRU5ErkJggg==",
+ "title": "OpenAI"
+ }
+};
+
// src/client/agent-routes.js
var AGENT_BADGES = {
"devin-cli": ["DV", "violet"],
@@ -4619,19 +4687,36 @@ var AGENT_BADGES = {
"goose": ["GS", "brown"]
};
var CUSTOM = ["AC", "rose"];
+var logoOf = (engine) => AGENT_LOGOS[engine];
var badgeOf = (engine) => AGENT_BADGES[engine] ?? (engine?.startsWith("acp-") ? CUSTOM : void 0);
var isLocalRoute = (ref) => badgeOf(String(ref ?? "").split("/")[0]) !== void 0;
function agentAvatar(engine) {
+ const logo = logoOf(engine);
+ if (logo?.kind === "image") return { image: logo.src };
const badge = badgeOf(engine);
if (badge === void 0) return void 0;
const [glyph, ink] = badge;
- const svg2 = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><rect width="64" height="64" rx="16" fill="${INKS[ink][0]}"/><text x="32" y="41" text-anchor="middle" font-size="26" font-weight="700" fill="${INKS.black[1]}" font-family="system-ui,sans-serif">${glyph}</text></svg>`;
+ const mark2 = logo?.kind === "path" ? `<rect width="64" height="64" rx="16" fill="${INKS.black[1]}"/><g transform="translate(14 14) scale(1.5)"><path d="${logo.d}" fill="#${logo.hex}"/></g>` : `<rect width="64" height="64" rx="16" fill="${INKS[ink][0]}"/><text x="32" y="41" text-anchor="middle" font-size="26" font-weight="700" fill="${INKS.black[1]}" font-family="system-ui,sans-serif">${glyph}</text>`;
+ const svg2 = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">${mark2}</svg>`;
return { image: `data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(svg2)))}` };
}
// src/client/agent-badge.js
var import_react4 = require("react");
function AgentBadge({ engine, size = 15 }) {
+ const logo = logoOf(engine);
+ const style = { flexShrink: 0, marginLeft: 4, verticalAlign: -2 };
+ if (logo?.kind === "image") {
+ return (0, import_react4.createElement)("img", { src: logo.src, width: size, height: size, alt: "", title: logo.title, className: "bt-agent-badge", style: { ...style, borderRadius: 4 } });
+ }
+ if (logo?.kind === "path") {
+ return (0, import_react4.createElement)(
+ "svg",
+ { width: size, height: size, viewBox: "0 0 24 24", className: "bt-agent-badge", role: "img", "aria-label": logo.title, style: { ...style, color: `#${logo.hex}` } },
+ (0, import_react4.createElement)("title", null, logo.title),
+ (0, import_react4.createElement)("path", { d: logo.d, fill: "currentColor" })
+ );
+ }
const badge = badgeOf(engine);
if (badge === void 0) return null;
const [glyph, ink] = badge;
@@ -4643,10 +4728,10 @@ function AgentBadge({ engine, size = 15 }) {
viewBox: "0 0 20 20",
className: "bt-agent-badge",
"aria-hidden": true,
- style: { color: inkFill(ink), flexShrink: 0, marginLeft: 4, verticalAlign: -2 }
+ style: { ...style, color: inkFill(ink) }
},
(0, import_react4.createElement)("rect", { x: 1, y: 1, width: 18, height: 18, rx: 5, fill: "currentColor", fillOpacity: 0.16, stroke: "currentColor", strokeWidth: 1.4 }),
- (0, import_react4.createElement)("text", { x: 10, y: 13.6, textAnchor: "middle", fontSize: 7.5, fontWeight: 700, fill: "currentColor", style: { letterSpacing: "0.02em" } }, glyph)
+ (0, import_react4.createElement)("text", { x: 10, y: 13.6, textAnchor: "middle", fontSize: 7.5, fontWeight: 700, fill: "currentColor" }, glyph)
);
}
@@ -6392,10 +6477,9 @@ var PROPS = {
number: ["id", "label", "min", "max", "step", "value", "unit"],
options: ["id", "options", "multi"],
confirm: ["id", "confirmLabel", "cancelLabel"],
- form: ["id", "fields", "submitLabel", "cancelLabel"],
+ form: ["id", "fields", "submitLabel"],
submit: ["id", "label"]
};
-var FIELD_PROPS = ["id", "label", "placeholder", "value", "multiline", "readOnly"];
var MAX_DEPTH = 8;
var MAX_NODES = 64;
var MAX_CHILDREN = 16;
@@ -6420,17 +6504,17 @@ function viewBytes(title, view) {
}
var NUMERIC = ["value", "percent", "min", "max", "step", "height"];
var numeric = (value) => typeof value === "string" && value.trim() !== "" && !Number.isNaN(Number(value)) ? Number(value) : value;
-function normalizeView(value, inFormFields = false) {
- if (Array.isArray(value)) return value.map((item) => normalizeView(item, inFormFields));
+function normalizeView(value) {
+ if (Array.isArray(value)) return value.map(normalizeView);
if (!isRecord(value)) return value;
const keys = Object.keys(value);
if (keys.length === 1 && keys[0] === "item") {
- const inner = normalizeView(value.item, inFormFields);
+ const inner = normalizeView(value.item);
if (Array.isArray(inner)) return inner;
}
const out = {};
- for (const key of keys) Object.defineProperty(out, key, { value: normalizeView(value[key], inFormFields || key === "fields"), writable: true, enumerable: true, configurable: true });
- for (const field of NUMERIC) if ((field !== "value" || !inFormFields) && Object.hasOwn(out, field)) out[field] = numeric(out[field]);
+ for (const key of keys) Object.defineProperty(out, key, { value: normalizeView(value[key]), writable: true, enumerable: true, configurable: true });
+ for (const field of NUMERIC) if (Object.hasOwn(out, field)) out[field] = numeric(out[field]);
if (Array.isArray(out.values)) out.values = out.values.map(numeric);
return out;
}
@@ -6728,7 +6812,6 @@ function checkForm(node, path2, ctx) {
const idError = checkId(node, path2, ctx);
if (idError !== void 0) return idError;
if (node.submitLabel !== void 0 && typeof node.submitLabel !== "string") return `${path2}.submitLabel: expected a string`;
- if (node.cancelLabel !== void 0 && typeof node.cancelLabel !== "string") return `${path2}.cancelLabel: expected a string`;
if (!Array.isArray(node.fields)) return `${path2}.fields: expected an array of at most ${MAX_FIELDS} fields`;
if (node.fields.length > MAX_FIELDS) return `${path2}.fields: ${node.fields.length} fields exceeds the limit of ${MAX_FIELDS}`;
const seen = /* @__PURE__ */ new Set();
@@ -6737,7 +6820,7 @@ function checkForm(node, path2, ctx) {
const at = `${path2}.fields[${index}]`;
if (!isRecord(field)) return `${at}: expected a field object`;
for (const key of Object.keys(field)) {
- if (!FIELD_PROPS.includes(key)) return `${at}.${key}: unknown property ${quoted(key)}; allowed: ${allowed(FIELD_PROPS)}`;
+ if (key !== "id" && key !== "label" && key !== "placeholder") return `${at}.${key}: unknown property ${quoted(key)}; allowed: id, label, placeholder`;
}
if (typeof field.id !== "string" || field.id === "") return `${at}.id: expected a non-empty string`;
if (field.id === "__proto__") return `${at}.id: "__proto__" cannot be an id`;
@@ -6745,12 +6828,6 @@ function checkForm(node, path2, ctx) {
seen.add(field.id);
if (typeof field.label !== "string") return `${at}.label: expected a string`;
if (field.placeholder !== void 0 && typeof field.placeholder !== "string") return `${at}.placeholder: expected a string`;
- if (field.value !== void 0) {
- if (typeof field.value !== "string") return `${at}.value: expected a string`;
- if (field.value.length > MAX_TEXT) return `${at}.value: ${field.value.length} characters exceeds the limit of ${MAX_TEXT}`;
- }
- if (field.multiline !== void 0 && typeof field.multiline !== "boolean") return `${at}.multiline: expected a boolean`;
- if (field.readOnly !== void 0 && typeof field.readOnly !== "boolean") return `${at}.readOnly: expected a boolean`;
}
return void 0;
}
@@ -6900,7 +6977,7 @@ function componentSummary(node, lookup) {
case "confirm":
return "confirm";
case "form":
- return `form: ${(Array.isArray(node.fields) ? node.fields : []).map((field) => field?.label || field?.id).filter(Boolean).join("/")}`;
+ return `form: ${(Array.isArray(node.fields) ? node.fields : []).map((field) => field?.label ?? field?.id).filter(Boolean).join("/")}`;
case "submit":
return `submit: ${node.label ?? "Send"}`;
default:
@@ -6978,19 +7055,15 @@ function validateConfirm(values) {
return { confirmed: values.confirmed };
}
function validateForm(node, values) {
- if (values.canceled === true) return { canceled: true };
if (!isRecord(values.fields)) return { error: "values.fields: expected an object of field ids to strings" };
- const declaredFields = (node.fields ?? []).filter((field) => typeof field?.id === "string");
- const declared = declaredFields.map((field) => field.id);
- const byId = new Map(declaredFields.map((field) => [field.id, field]));
+ const declared = (node.fields ?? []).map((field) => field?.id).filter((id) => typeof id === "string");
const allowedIds = new Set(declared);
const fields = {};
for (const [key, value] of Object.entries(values.fields)) {
if (!allowedIds.has(key)) return { error: `values.fields.${key}: unknown field; allowed: ${allowed(declared)}` };
if (typeof value !== "string") return { error: `values.fields.${key}: expected a string` };
if (value.length > MAX_TEXT) return { error: `values.fields.${key}: ${value.length} characters exceeds the limit of ${MAX_TEXT}` };
- const spec = byId.get(key);
- fields[key] = spec?.readOnly === true ? spec.value ?? "" : value;
+ fields[key] = value;
}
return { fields };
}
@@ -7608,12 +7681,11 @@ function SettledOptions({ node, answer }) {
))
);
}
-function ConfirmInput({ node, onSubmit, busy = false, footStart = null }) {
+function ConfirmInput({ node, onSubmit, busy = false }) {
const ui2 = useViewUi();
return (0, import_react15.createElement)(
"div",
{ className: "dv-q-foot" },
- footStart ? (0, import_react15.createElement)("div", { className: "dv-q-foot-start" }, footStart) : null,
(0, import_react15.createElement)("button", { type: "button", className: "dv-q-btn", disabled: busy, onClick: () => onSubmit?.(node.id, { confirmed: false }) }, node.cancelLabel ?? ui2.t("Cancel")),
(0, import_react15.createElement)("button", { type: "button", className: "dv-q-submit", disabled: busy, onClick: () => onSubmit?.(node.id, { confirmed: true }) }, node.confirmLabel ?? ui2.t("Confirm"))
);
@@ -7632,15 +7704,12 @@ function SettledConfirm({ node, answer }) {
const label = confirmed ? node.confirmLabel ?? ui2.t("Confirm") : node.cancelLabel ?? ui2.t("Cancel");
return (0, import_react15.createElement)("span", { className: "dv-q-badge" }, label);
}
-function FormInput({ node, onSubmit, busy = false, footStart = null }) {
+function FormInput({ node, onSubmit, busy = false }) {
const ui2 = useViewUi();
const fields = fieldsOf(node);
- const [draft, setDraft] = (0, import_react15.useState)(() => Object.fromEntries(fields.map((field) => [field.id, field.value ?? ""])));
+ const [draft, setDraft] = (0, import_react15.useState)({});
const submit = () => {
- if (!busy) onSubmit?.(node.id, { fields: Object.fromEntries(fields.map((field) => [field.id, field.readOnly === true ? field.value ?? "" : draft[field.id] ?? ""])) });
- };
- const cancel = () => {
- if (!busy) onSubmit?.(node.id, { canceled: true });
+ if (!busy) onSubmit?.(node.id, { fields: Object.fromEntries(fields.map((field) => [field.id, draft[field.id] ?? ""])) });
};
return (0, import_react15.createElement)(
"form",
@@ -7651,109 +7720,52 @@ function FormInput({ node, onSubmit, busy = false, footStart = null }) {
submit();
}
},
- fields.map((field) => {
- const val = field.readOnly === true ? field.value ?? "" : draft[field.id] ?? "";
- const hasLabel = typeof field.label === "string" && field.label.trim() !== "";
- const multiline = field.multiline === true;
- const readOnly = field.readOnly === true;
- const heading = !multiline && !hasLabel;
- const labelText = hasLabel ? field.label : field.placeholder ?? field.id;
- return (0, import_react15.createElement)(
- "label",
- {
- key: field.id,
- className: "dv-widget-field",
- "data-inline": !multiline && hasLabel ? "" : void 0,
- "data-heading": heading ? "" : void 0,
- "data-multiline": multiline ? "" : void 0,
- "data-readonly": readOnly ? "" : void 0
- },
- hasLabel ? (0, import_react15.createElement)("span", { className: "dv-widget-field-label" }, field.label) : null,
- (0, import_react15.createElement)(
- "span",
- { className: "dv-q-field" },
- multiline ? (0, import_react15.createElement)("textarea", {
- className: "dv-q-input dv-q-textarea",
- rows: Math.min(10, Math.max(3, (val.match(/\n/g)?.length ?? 0) + 1)),
- value: val,
- autoComplete: "off",
- spellCheck: false,
- readOnly: busy || readOnly,
- "aria-label": labelText,
- placeholder: field.placeholder ?? void 0,
- onChange: (event) => {
- if (!busy && !readOnly) setDraft((current) => ({ ...current, [field.id]: event.target.value }));
- },
- onKeyDown: (event) => {
- if (event.key !== "Enter" || !event.metaKey && !event.ctrlKey || event.nativeEvent?.isComposing) return;
- event.preventDefault();
- submit();
- }
- }) : (0, import_react15.createElement)("input", {
- className: "dv-q-input",
- type: "text",
- value: val,
- autoComplete: "off",
- spellCheck: false,
- readOnly: busy || readOnly,
- "aria-label": labelText,
- placeholder: field.placeholder ?? void 0,
- onChange: (event) => {
- if (!busy && !readOnly) setDraft((current) => ({ ...current, [field.id]: event.target.value }));
- },
- onKeyDown: (event) => {
- if (event.key !== "Enter" || event.nativeEvent?.isComposing) return;
- event.preventDefault();
- submit();
- }
- })
- )
- );
- }),
- (0, import_react15.createElement)(
- "div",
- { className: "dv-q-foot" },
- footStart ? (0, import_react15.createElement)("div", { className: "dv-q-foot-start" }, footStart) : null,
- node.cancelLabel ? (0, import_react15.createElement)("button", { type: "button", className: "dv-q-btn", disabled: busy, onClick: cancel }, node.cancelLabel) : null,
- (0, import_react15.createElement)("button", { type: "submit", className: "dv-q-submit", disabled: busy }, node.submitLabel ?? ui2.t("Submit"))
- )
+ fields.map((field) => (0, import_react15.createElement)(
+ "label",
+ { key: field.id, className: "dv-widget-field" },
+ (0, import_react15.createElement)("span", { className: "dv-widget-field-label" }, field.label),
+ (0, import_react15.createElement)(
+ "span",
+ { className: "dv-q-field" },
+ (0, import_react15.createElement)("input", {
+ className: "dv-q-input",
+ type: "text",
+ value: draft[field.id] ?? "",
+ autoComplete: "off",
+ spellCheck: false,
+ readOnly: busy,
+ "aria-label": field.label,
+ placeholder: field.placeholder ?? void 0,
+ onChange: (event) => {
+ if (!busy) setDraft((current) => ({ ...current, [field.id]: event.target.value }));
+ },
+ onKeyDown: (event) => {
+ if (event.key !== "Enter" || event.nativeEvent.isComposing) return;
+ event.preventDefault();
+ submit();
+ }
+ })
+ )
+ )),
+ (0, import_react15.createElement)("div", { className: "dv-q-foot" }, (0, import_react15.createElement)("button", { type: "submit", className: "dv-q-submit", disabled: busy }, node.submitLabel ?? ui2.t("Submit")))
);
}
function SettledForm({ node, answer }) {
- const ui2 = useViewUi();
- const ans = answerValues(answer, node);
- const fields = ans?.fields;
+ const fields = answerValues(answer, node)?.fields;
const values = fields !== null && typeof fields === "object" ? fields : {};
- const canceled = ans?.canceled === true;
- const badge = canceled ? node.cancelLabel ?? ui2.t("Cancel") : node.cancelLabel !== void 0 && ans !== void 0 ? node.submitLabel ?? ui2.t("Submit") : null;
return (0, import_react15.createElement)(
"div",
{ className: "dv-widget-form" },
- fieldsOf(node).map((field) => {
- const val = values[field.id] ?? field.value ?? "";
- const hasLabel = typeof field.label === "string" && field.label.trim() !== "";
- const multiline = field.multiline === true;
- const heading = !multiline && !hasLabel;
- const labelText = hasLabel ? field.label : field.placeholder ?? field.id;
- return (0, import_react15.createElement)(
- "label",
- {
- key: field.id,
- className: "dv-widget-field",
- "data-inline": !multiline && hasLabel ? "" : void 0,
- "data-heading": heading ? "" : void 0,
- "data-multiline": multiline ? "" : void 0,
- "data-readonly": field.readOnly === true ? "" : void 0
- },
- hasLabel ? (0, import_react15.createElement)("span", { className: "dv-widget-field-label" }, field.label) : null,
- (0, import_react15.createElement)(
- "span",
- { className: "dv-q-field" },
- multiline ? (0, import_react15.createElement)("textarea", { className: "dv-q-input dv-q-textarea", rows: Math.min(10, Math.max(2, (val.match(/\n/g)?.length ?? 0) + 1)), value: val, disabled: true, readOnly: true, "aria-label": labelText }) : (0, import_react15.createElement)("input", { className: "dv-q-input", type: "text", value: val, disabled: true, readOnly: true, "aria-label": labelText })
- )
- );
- }),
- badge ? (0, import_react15.createElement)("div", { className: "dv-q-foot" }, (0, import_react15.createElement)("span", { className: "dv-q-badge" }, badge)) : null
+ fieldsOf(node).map((field) => (0, import_react15.createElement)(
+ "label",
+ { key: field.id, className: "dv-widget-field" },
+ (0, import_react15.createElement)("span", { className: "dv-widget-field-label" }, field.label),
+ (0, import_react15.createElement)(
+ "span",
+ { className: "dv-q-field" },
+ (0, import_react15.createElement)("input", { className: "dv-q-input", type: "text", value: values[field.id] ?? "", disabled: true, readOnly: true, "aria-label": field.label })
+ )
+ ))
);
}
function SubmitInput({ node, ctx }) {
@@ -8006,14 +8018,14 @@ function WidgetNode({ node, ctx }) {
case "options":
return ctx.settled ? (0, import_react15.createElement)(SettledOptions, { node, answer: ctx.answer }) : (0, import_react15.createElement)(OptionsInput, { node, onSubmit: ctx.onSubmit, keys: ctx.keys, busy: ctx.busy });
case "confirm":
- return ctx.settled ? (0, import_react15.createElement)(SettledConfirm, { node, answer: ctx.answer }) : (0, import_react15.createElement)(ConfirmInput, { node, onSubmit: ctx.onSubmit, busy: ctx.busy, footStart: ctx.footStart });
+ return ctx.settled ? (0, import_react15.createElement)(SettledConfirm, { node, answer: ctx.answer }) : (0, import_react15.createElement)(ConfirmInput, { node, onSubmit: ctx.onSubmit, busy: ctx.busy });
case "form":
- return ctx.settled ? (0, import_react15.createElement)(SettledForm, { node, answer: ctx.answer }) : (0, import_react15.createElement)(FormInput, { node, onSubmit: ctx.onSubmit, busy: ctx.busy, footStart: ctx.footStart });
+ return ctx.settled ? (0, import_react15.createElement)(SettledForm, { node, answer: ctx.answer }) : (0, import_react15.createElement)(FormInput, { node, onSubmit: ctx.onSubmit, busy: ctx.busy });
default:
return null;
}
}
-function WidgetView({ view, onSubmit, settled = false, answer = null, busy = false, footStart = null, registerChart, refreshCharts }) {
+function WidgetView({ view, onSubmit, settled = false, answer = null, busy = false, registerChart, refreshCharts }) {
const inputs = viewInputs(view);
const [values, setValues] = (0, import_react15.useState)(() => Object.fromEntries(inputs.map((node) => [node.id, inputDefault(node)])));
const sent = answer?.values?.inputs;
@@ -8024,7 +8036,6 @@ function WidgetView({ view, onSubmit, settled = false, answer = null, busy = fal
settled,
answer,
busy,
- footStart,
keys: !settled && countType(view, "options") === 1,
lookup: viewScope(view, current),
values: current,
@@ -8105,16 +8116,15 @@ function ViewMenu({ charts }) {
open ? (0, import_react15.createElement)(ViewMenuList, { charts, pick: pick2 }) : null
);
}
-function WidgetCard({ title, icon: icon2, footStart, view, onSubmit, onDismiss, busy = false, raised = false, settled = false, answer = null }) {
+function WidgetCard({ title, view, onSubmit, onDismiss, busy = false, raised = false, settled = false, answer = null }) {
const ui2 = useViewUi();
const titleId = (0, import_react15.useId)();
const { charts, registerChart, refreshCharts } = useChartHandles();
const framed = raised || hasControls(view);
const className = ["dv-view", framed ? "dv-q" : "dv-view-bare", settled ? "dv-q-settled" : "", raised ? "dv-q-raised" : ""].filter(Boolean).join(" ");
- const head = title || icon2 || onDismiss || countType(view, "chart") > 0 ? (0, import_react15.createElement)(
+ const head = title || onDismiss || countType(view, "chart") > 0 ? (0, import_react15.createElement)(
"div",
{ className: "dv-view-head" },
- icon2 ? (0, import_react15.createElement)("span", { className: "dv-view-icon", "aria-hidden": true }, icon2) : null,
title ? (0, import_react15.createElement)("p", { className: "dv-view-title", id: titleId }, title) : (0, import_react15.createElement)("span", { className: "dv-view-title" }),
countType(view, "chart") > 0 ? (0, import_react15.createElement)(ViewMenu, { charts }) : null,
onDismiss ? (0, import_react15.createElement)("button", { type: "button", className: "dv-q-x", "aria-label": ui2.t("Dismiss view"), title: ui2.t("Dismiss"), onClick: onDismiss, disabled: busy }, (0, import_react15.createElement)(CloseIcon2)) : null
@@ -8129,7 +8139,7 @@ function WidgetCard({ title, icon: icon2, footStart, view, onSubmit, onDismiss,
"aria-busy": busy || void 0
},
head,
- (0, import_react15.createElement)("div", { className: "dv-view-body" }, (0, import_react15.createElement)(WidgetView, { view, onSubmit, settled, answer, busy, footStart: settled ? null : footStart, registerChart, refreshCharts }))
+ (0, import_react15.createElement)("div", { className: "dv-view-body" }, (0, import_react15.createElement)(WidgetView, { view, onSubmit, settled, answer, busy, registerChart, refreshCharts }))
);
}
function AnsweredView({ node }) {
@@ -8153,9 +8163,7 @@ function AnsweredView({ node }) {
var WIDGET_CSS = `
.dv-view{min-width:0}
.dv-view-bare{display:flex;flex-direction:column;gap:8px;width:100%;color:var(--dv-ink);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif;animation:dv-veil-in .2s ease-out backwards}
-.dv-view-head{display:flex;align-items:center;gap:8px;min-width:0}
-.dv-view-icon{flex:none;width:22px;height:22px;border-radius:6px;background:var(--dv-hover);color:var(--dv-ink-2);display:inline-flex;align-items:center;justify-content:center}
-.dv-view-icon svg{width:14px;height:14px}
+.dv-view-head{display:flex;align-items:flex-start;gap:8px;min-width:0}
.dv-view-title{flex:1 1 0;min-width:0;margin:0;font-size:13px;line-height:18px;font-weight:500;color:var(--dv-ink);overflow-wrap:anywhere}
.dv-q-settled .dv-view-title{color:var(--dv-ink-2)}
.dv-view-tools{position:relative;flex:none;align-self:flex-start;opacity:0;transition:opacity .12s ease}
@@ -8191,14 +8199,6 @@ var WIDGET_CSS = `
.dv-widget-field{display:flex;flex-direction:column;gap:4px;min-width:0}
.dv-widget-field-label{font-size:12px;line-height:16px;color:var(--dv-ink-2)}
.dv-widget-field .dv-q-field:has(.dv-q-input:disabled){cursor:default;opacity:.75}
-.dv-widget-field[data-inline]{flex-direction:row;align-items:center;gap:12px;padding:7px 0;border-bottom:.5px solid var(--dv-line)}
-.dv-widget-field[data-inline] .dv-widget-field-label{flex:none;min-width:44px;font-size:13px;line-height:20px}
-.dv-widget-field[data-inline] .dv-q-field{border:0;border-radius:0;padding:0;min-height:20px;background:none}
-.dv-widget-field[data-inline][data-readonly] .dv-q-input{color:var(--dv-ink-2);cursor:default}
-.dv-widget-field[data-heading] .dv-q-field{border:0;border-radius:0;padding:2px 0;min-height:24px;background:none}
-.dv-widget-field[data-heading] .dv-q-input{font-size:16px;line-height:22px;font-weight:600}
-.dv-widget-field[data-multiline]:not(:has(.dv-widget-field-label)) .dv-q-field{border:0;border-radius:0;padding:4px 0;background:none}
-.dv-q-textarea{max-height:240px;overflow-y:auto;line-height:22px}
.dv-widget-progress{display:flex;flex-direction:column;gap:5px;min-width:0}
.dv-widget-progress-label{display:flex;justify-content:space-between;gap:8px;font-size:12px;line-height:16px;color:var(--dv-ink-2);font-variant-numeric:tabular-nums}
.dv-widget-progress-name{color:var(--dv-ink);font-weight:500}
@@ -8329,8 +8329,7 @@ button.dv-q-opt:active{background:var(--dv-active)}
.dv-q-submit:disabled{opacity:.4;cursor:default}
.dv-q-btn{background:var(--dv-hover);color:var(--dv-ink)}
.dv-q-btn:hover{background:var(--dv-active)}
-.dv-q-foot{display:flex;align-items:center;justify-content:flex-end;gap:8px}
-.dv-q-foot-start{margin-right:auto;display:flex;align-items:center}
+.dv-q-foot{display:flex;justify-content:flex-end;gap:8px}
.dv-menu{position:fixed;pointer-events:auto;z-index:60;min-width:200px;padding:6px;border-radius:12px;background:var(--dv-main);border:.5px solid var(--dv-line-2);box-shadow:0 10px 20px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1),0 0 0 1px rgba(228,228,228,.04);display:flex;flex-direction:column;gap:2px;transform-origin:var(--dv-origin,top left);animation:dv-veil-in .14s ease-out;font-family:var(--dsw-font-family,-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif);box-sizing:border-box}
.dv-menu.dv-view-menu{position:absolute;z-index:4}
.dv-menu button{display:flex;align-items:center;gap:4px;width:100%;min-height:30px;text-align:left;border:0;background:none;border-radius:6px;padding:6px 8px;font:inherit;font-size:13px;line-height:18px;color:var(--dv-ink);cursor:pointer;box-sizing:border-box}
@@ -8361,7 +8360,6 @@ var DEEP_VIEW_CSS = THEME_CSS + QUESTION_CSS + WIDGET_CSS;
// node_modules/deep-view/src/core/reply.js
var REPLY_KIND = "user-question-reply";
-var REPLY_SOURCE_KIND = "deep-view-reply";
function viewCardText(args) {
let card = args;
if (typeof card === "string") {
@@ -8416,16 +8414,10 @@ function viewAnswerText(view, answer) {
}
});
parts.push(values.confirmed ? confirmLabel ?? "Confirmed" : cancelLabel ?? "Cancelled");
- } else if (values.canceled === true) {
- let cancelLabel;
- eachNode(view, (node) => {
- if (node.id === answer.action) cancelLabel = node.cancelLabel;
- });
- parts.push(cancelLabel ?? "Cancelled");
} else if (isRecord2(values.fields)) {
const labels = /* @__PURE__ */ new Map();
eachNode(view, (node) => {
- for (const field of Array.isArray(node.fields) ? node.fields : []) labels.set(field?.id, field?.label || field?.id);
+ for (const field of Array.isArray(node.fields) ? node.fields : []) labels.set(field?.id, field?.label ?? field?.id);
});
parts.push(...Object.entries(values.fields).map(([key, value]) => `${labels.get(key) ?? key}: ${value}`));
}
@@ -8461,7 +8453,6 @@ function actionSummary(answer, view) {
let text;
if (Array.isArray(values.selected)) text = `selected: ${values.selected.join(", ")}`;
else if (typeof values.confirmed === "boolean") text = values.confirmed ? "confirmed" : "cancelled";
- else if (values.canceled === true) text = "cancelled";
else if (isRecord2(values.fields)) text = Object.entries(values.fields).map(([key, value]) => `${key}: ${value}`).join("; ");
else if (inputs !== "") text = "";
else text = typeof answer.action === "string" && answer.action !== "" ? answer.action : "(skipped)";
@@ -12364,7 +12355,11 @@ var visibleReasoning = (text) => {
const end = text.indexOf("</signature>");
return end === -1 ? "" : text.slice(end + "</signature>".length).replace(/^(\r?\n)+/, "");
};
-var stepReasoning = (step) => step.blocks.filter((block) => block.kind === "reasoning").map((block) => visibleReasoning(block.text)).join("\n").trim();
+var ACTIVITY = "▸ ";
+var isActivity = (line) => line.startsWith(ACTIVITY);
+var reasoningText = (step) => step.blocks.filter((block) => block.kind === "reasoning").map((block) => visibleReasoning(block.text)).join("\n");
+var stepReasoning = (step) => reasoningText(step).split("\n").filter((line) => !isActivity(line)).join("\n").trim();
+var stepActivity = (step) => reasoningText(step).split("\n").filter(isActivity).map((line) => line.slice(ACTIVITY.length).trim()).filter(Boolean);
// src/shared/group-replies.js
var RELAY_LIST = /"replies"\s*:\s*\[/;
@@ -13342,7 +13337,8 @@ function AssistantCell({ node, groupPart, sessionId, openFile, fileMentions, use
useLiveNote(actions, sessionId, `text:${node.key ?? data.seq}`, !hidden && running && texts2.length > 0 ? { text: true } : null);
if (hidden) return (0, import_react31.createElement)(CellEmpty);
const relays = relayPart(data, groupPart) ? relaysBefore(contexts, steps, data) : [];
- if (texts2.length === 0 && !reasoning && relays.length === 0) return (0, import_react31.createElement)(CellEmpty);
+ const activity = groupPart === "response" ? [] : stepActivity(data);
+ if (texts2.length === 0 && !reasoning && relays.length === 0 && activity.length === 0) return (0, import_react31.createElement)(CellEmpty);
const selfId = roster.byId[sessionId]?.id ?? sessionId;
const speaker = layoutOf(roster.prefs) === "flat" ? roster.byId[sessionId] : void 0;
const head = speaker !== void 0 && opensReply(steps, data, shown) && (reasoning !== "" || texts2.length > 0 && !(groupPart === "response" && shown && turnReasoning(steps, data) !== ""));
@@ -13363,6 +13359,7 @@ function AssistantCell({ node, groupPart, sessionId, openFile, fileMentions, use
});
}),
head ? (0, import_react31.createElement)(SpeakerHead, { bot: speaker, time: data.time }) : null,
+ activity.length ? (0, import_react31.createElement)("div", { className: "bt-agent-activity" }, activity.map((line, index) => (0, import_react31.createElement)("div", { key: index, className: "bt-agent-act", title: line }, (0, import_react31.createElement)("span", { className: "bt-agent-act-mark", "aria-hidden": true }), (0, import_react31.createElement)("span", { className: "bt-agent-act-text" }, activityParts(line))))) : null,
reasoning ? (0, import_react31.createElement)(ThinkingRow, {
text: reasoning,
live: thinking !== void 0,
@@ -13374,6 +13371,7 @@ function AssistantCell({ node, groupPart, sessionId, openFile, fileMentions, use
texts2.length ? (0, import_react31.createElement)(Bubbles, { texts: texts2, roster, selfId, actions, streaming: running, sessionId, msgKey: `${sessionId}:${data.turn}:${node.key ?? data.seq ?? ""}`, useUi, mentions, fold: FOLD_HUGE, time: speaker === void 0 ? data.time : void 0 }) : null
);
}
+var activityParts = (line) => line.split("`").map((part, index) => index % 2 === 1 ? (0, import_react31.createElement)("code", { key: index }, part) : part);
function EventLine({ prefix, bots, joiner = t("and"), onOpen, whole = false }) {
if (whole && bots.length === 1) {
return (0, import_react31.createElement)(
@@ -23933,6 +23931,41 @@ function GroupOverview({ room: room2, roster, actions, usage, useWork, openSetti
) : null
];
}
+function AgentSessions({ bot, part, run: run2, useSessions }) {
+ const ids = [part, ...(bot.parts ?? []).filter((id) => id !== part).slice().reverse()];
+ const rows2 = useSessions((list) => ids.map((id) => list.byId?.[id]), rowsEqual);
+ const total = ids.length;
+ return (0, import_react57.createElement)(
+ "div",
+ { className: "bt-drawer-model" },
+ (0, import_react57.createElement)(
+ "div",
+ { className: "bt-agent-sessions-head" },
+ (0, import_react57.createElement)("div", { className: "bt-section-title" }, t("Sessions")),
+ (0, import_react57.createElement)("button", { type: "button", className: "bt-agent-sessions-new", onClick: () => run2(call("bot-new-part", { botId: bot.id })) }, (0, import_react57.createElement)(PlusIcon), t("New session"))
+ ),
+ (0, import_react57.createElement)("div", { className: "bt-agent-sessions" }, ids.map((id, index) => {
+ const row = rows2[index];
+ const current = index === 0;
+ const when3 = row?.updatedAt ?? row?.createdAt;
+ const label = row?.title && row.title.trim() !== "" ? row.title : t("Session {number}", { number: total - index });
+ return (0, import_react57.createElement)(
+ "button",
+ {
+ key: id,
+ type: "button",
+ disabled: current,
+ className: `bt-agent-session${current ? " is-current" : ""}`,
+ title: current ? t("Current session") : t("Open this earlier session"),
+ onClick: current ? void 0 : () => run2(call("bot-open-part", { botId: bot.id, sessionId: id }))
+ },
+ (0, import_react57.createElement)("span", { className: "bt-agent-session-name" }, label),
+ (0, import_react57.createElement)("span", { className: "bt-agent-session-meta" }, current ? t("Current") : when3 ? new Date(when3).toLocaleString(void 0, { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" }) : "")
+ );
+ }))
+ );
+}
+var rowsEqual = (a, b) => a.length === b.length && a.every((row, index) => row?.title === b[index]?.title && row?.updatedAt === b[index]?.updatedAt);
function DetailsDrawer({ sessionId, startRenaming, startTab, hasStrip, roster, actions, useSessions, useSessionStatus, useActivity, useWork, useBrowserTabs, useBrowserPages, useComputer }) {
const owner = roster.byId[sessionId];
const part = owner ? currentPart(owner) : sessionId;
@@ -24065,18 +24098,9 @@ function DetailsDrawer({ sessionId, startRenaming, startTab, hasStrip, roster, a
{ key: "model", className: "bt-drawer-model" },
(0, import_react57.createElement)("div", { className: "bt-section-title" }, t("Model")),
(0, import_react57.createElement)(ModelMenu, { bot, roster, actions, run: run2, wide: true }),
- modelOf(bot, roster) ? null : (0, import_react57.createElement)("div", { className: "bt-note" }, t("Pick a model and {name} can start.", { name: bot.name })),
- bot.engine ? (0, import_react57.createElement)("div", { className: "bt-kv" }, (0, import_react57.createElement)("span", null, t("Agent")), (0, import_react57.createElement)(AgentBadge, { engine: bot.engine })) : null
+ modelOf(bot, roster) ? null : (0, import_react57.createElement)("div", { className: "bt-note" }, t("Pick a model and {name} can start.", { name: bot.name }))
),
- bot.engine ? (0, import_react57.createElement)(
- "div",
- { key: "sessions", className: "bt-drawer-model" },
- (0, import_react57.createElement)("div", { className: "bt-section-title" }, t("Sessions")),
- [
- (0, import_react57.createElement)("button", { key: "new", type: "button", className: "bt-soft bt-soft-sm", onClick: () => run2(call("bot-new-part", { botId: bot.id })) }, t("New session")),
- ...(bot.parts ?? []).slice().reverse().map((part2, index) => (0, import_react57.createElement)("button", { key: part2, type: "button", className: "bt-soft bt-soft-sm", title: t("Open this earlier session"), onClick: () => run2(call("bot-open-part", { botId: bot.id, sessionId: part2 })) }, t("Session {number}", { number: (bot.parts ?? []).length - index })))
- ]
- ) : null,
+ bot.engine ? (0, import_react57.createElement)(AgentSessions, { key: "sessions", bot, part, run: run2, useSessions }) : null,
(0, import_react57.createElement)(PermissionRow, { key: "permission", bot, roster, actions, run: run2 }),
(0, import_react57.createElement)(BotConnectors, { key: "connectors", bot, roster, actions, run: run2 }),
(0, import_react57.createElement)(
diff --git a/ds-bot/src/client/agent-badge.js b/ds-bot/src/client/agent-badge.js
index 827b19d2..acf06b2b 100644
--- a/ds-bot/src/client/agent-badge.js
+++ b/ds-bot/src/client/agent-badge.js
@@ -1,17 +1,26 @@
-// The engine badge next to an abot's name: the route's original monogram, small.
+// The engine badge next to an abot's name: the agent's own logo, small; a
+// monogram only for agents that have none here.
import { createElement as h } from 'react'
import { inkFill } from './inks.js'
-import { badgeOf } from './agent-routes.js'
+import { badgeOf, logoOf } from './agent-routes.js'
export function AgentBadge({ engine, size = 15 }) {
+ const logo = logoOf(engine)
+ const style = { flexShrink: 0, marginLeft: 4, verticalAlign: -2 }
+ if (logo?.kind === 'image') {
+ return h('img', { src: logo.src, width: size, height: size, alt: '', title: logo.title, className: 'bt-agent-badge', style: { ...style, borderRadius: 4 } })
+ }
+ if (logo?.kind === 'path') {
+ return h('svg', { width: size, height: size, viewBox: '0 0 24 24', className: 'bt-agent-badge', role: 'img', 'aria-label': logo.title, style: { ...style, color: `#${logo.hex}` } },
+ h('title', null, logo.title), h('path', { d: logo.d, fill: 'currentColor' }))
+ }
const badge = badgeOf(engine)
if (badge === undefined) return null
const [glyph, ink] = badge
return h('svg', {
- width: size, height: size, viewBox: '0 0 20 20', className: 'bt-agent-badge',
- 'aria-hidden': true,
- style: { color: inkFill(ink), flexShrink: 0, marginLeft: 4, verticalAlign: -2 },
+ width: size, height: size, viewBox: '0 0 20 20', className: 'bt-agent-badge', 'aria-hidden': true,
+ style: { ...style, color: inkFill(ink) },
},
h('rect', { x: 1, y: 1, width: 18, height: 18, rx: 5, fill: 'currentColor', fillOpacity: 0.16, stroke: 'currentColor', strokeWidth: 1.4 }),
- h('text', { x: 10, y: 13.6, textAnchor: 'middle', fontSize: 7.5, fontWeight: 700, fill: 'currentColor', style: { letterSpacing: '0.02em' } }, glyph))
+ h('text', { x: 10, y: 13.6, textAnchor: 'middle', fontSize: 7.5, fontWeight: 700, fill: 'currentColor' }, glyph))
}
diff --git a/ds-bot/src/client/agent-logos.js b/ds-bot/src/client/agent-logos.js
new file mode 100644
index 00000000..91ff1af8
--- /dev/null
+++ b/ds-bot/src/client/agent-logos.js
@@ -0,0 +1,52 @@
+// The official marks of the agent CLIs DS Bot drives, shown only to name the
+// agent a Bot runs on. The trademarks belong to their owners (see NOTICE).
+// Vector marks: Simple Icons 16.36.0 (CC0-1.0). Devin and OpenAI: the vendors' app icons.
+// Brand colors are content, not theme: hex digits without '#', added at use.
+export const AGENT_LOGOS = {
+ "claude-code": {
+ "kind": "path",
+ "d": "m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z",
+ "hex": "D97757",
+ "title": "Claude"
+ },
+ "cursor-cli": {
+ "kind": "path",
+ "d": "M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23",
+ "hex": "000000",
+ "title": "Cursor"
+ },
+ "gemini-cli": {
+ "kind": "path",
+ "d": "M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81",
+ "hex": "8E75B2",
+ "title": "Google Gemini"
+ },
+ "opencode": {
+ "kind": "path",
+ "d": "M22 24H2V0h20zM17 4.8H7v14.4h10z",
+ "hex": "000000",
+ "title": "OpenCode"
+ },
+ "cline": {
+ "kind": "path",
+ "d": "m23.365 13.556-1.442-2.895V8.994c0-2.764-2.218-5.002-4.954-5.002h-2.464c.178-.367.276-.779.276-1.213A2.77 2.77 0 0 0 12.018 0a2.77 2.77 0 0 0-2.763 2.779c0 .434.098.846.276 1.213H7.067c-2.736 0-4.954 2.238-4.954 5.002v1.667L.64 13.549c-.149.29-.149.636 0 .927l1.472 2.855v1.667C2.113 21.762 4.33 24 7.067 24h9.902c2.736 0 4.954-2.238 4.954-5.002V17.33l1.44-2.865c.143-.286.143-.622.002-.91m-12.854 2.36a2.27 2.27 0 0 1-2.261 2.273 2.27 2.27 0 0 1-2.261-2.273v-4.042A2.27 2.27 0 0 1 8.249 9.6a2.267 2.267 0 0 1 2.262 2.274zm7.285 0a2.27 2.27 0 0 1-2.26 2.273 2.27 2.27 0 0 1-2.262-2.273v-4.042A2.267 2.267 0 0 1 15.535 9.6a2.267 2.267 0 0 1 2.261 2.274z",
+ "hex": "18181B",
+ "title": "Cline"
+ },
+ "qwen-code": {
+ "kind": "path",
+ "d": "M23.919 14.545 20.817 9.17l1.47-2.544a.56.56 0 0 0 0-.566l-1.633-2.83a.57.57 0 0 0-.49-.283h-6.207L12.487.402a.57.57 0 0 0-.49-.284H8.732a.56.56 0 0 0-.49.284L5.139 5.775h-2.94a.56.56 0 0 0-.49.284L.077 8.887a.56.56 0 0 0 0 .567L3.18 14.83l-1.47 2.545a.56.56 0 0 0 0 .566l1.634 2.83a.57.57 0 0 0 .49.283h6.205l1.47 2.545a.57.57 0 0 0 .49.284h3.266a.57.57 0 0 0 .49-.284l3.104-5.375h2.94a.57.57 0 0 0 .49-.283l1.634-2.828a.55.55 0 0 0-.004-.568M8.733.686l1.634 2.828-1.634 2.828H21.8L20.164 9.17H7.425L5.63 6.06Zm1.306 19.801-6.205-.002 1.634-2.83h3.265L2.201 6.344h3.267q3.182 5.517 6.367 11.032zm10.124-5.66L18.53 12l-6.532 11.315-1.634-2.83c2.129-3.673 4.25-7.351 6.373-11.028h3.592l3.102 5.374z",
+ "hex": "6950EF",
+ "title": "QWen"
+ },
+ "devin-cli": {
+ "kind": "image",
+ "src": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAHhlWElmTU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAIdpAAQAAAABAAAATgAAAAAAAACQAAAAAQAAAJAAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAECgAwAEAAAAAQAAAEAAAAAAlNz6EQAAAAlwSFlzAAAWJQAAFiUBSVIk8AAABwlJREFUeAHtW19IVUkcHv+mZqZBWW2Um6sYhaKsUqitpYQ9bGzgqgsSRLEQtKL1FFJQL/XS1kOB9BCtLxa9WEb2IIRGbQ+SEEURmbqlsZVWkub/336/C1fu8Z6ZO+ece67G3oHxnDPzm99833fP/D2jEOEQViCsQFiBsAL/XwUi7FAfHBxMSE5Ozo2Ojs6NiIhIR0yFn6TIyMi4mZmZGDxH4d6Wbxme2dlZQpiJioqawv047Ebw/C9iz/T0dPenT5+6165dOyYrH5T03t7euMnJyT9A8imjWUwBojwFtlrGGBSy852MjIxkQenOxUTaDAtjZKzz8Tt6Hh0dzcOv/o9ZhYsxjbEyZh3SAdvp2NjYd0uWLOlAm07XcbhYbPDD9IyPj/+UkJAwoMIUqcqEk4jY2Ng/vzXyzIk7Z8bOHFQclQJ8+fKlBOR/VTlQ5X38+FH09PSoTFzNw4hRwRxsV4IOpclOG0c5ampqoszMTEpMTKS6ujoaGBiw48pxGYwMTbYE4LEenUmPVQSdnZ1UWlpKqNQQ161bRxcuXKCvX79adenInjkwF8sivHv3LgNjqzbaV69e0cGDBykmJsZAfL4QBQUFdPv2bUekrBRmDszFsgDDw8NFOhWhjdGZM2do1apVSuLzhaisrKRnz57pVOHYhrlYFgCTiZ91aj5//rwl4r5C8NvA/YXbgbnIBJCOAhhGlsoK+aZ/+PDB99HSPebvAm3UUhk7xiouUgGw0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7pcjHwwKZGic5w8/r1a6qurvab+8OZcnjktUGgjQyd+nVsmIuBnM7D27dvN0O5SZ0K2ObOnTu0detWJWkWZeXKlYTVIWF1qOvakR1zYC46nA023d3dyVitWTrXglNZdPHiRVq/fr2fEHxw4sCBA4QzQ44IWS3MHJiLgZzuA2Zd6nWmBA2OpHj2+DGGe4TgPT8+OrMQYWpqqlWXr58dvtv95gT0o0ePiHdsed2/UAEcqv2I6SbcvXuXzwb/vVDgndbL2JmDLl9TO3QgBRhHQ9NjOWXsU54xA3u+KSmriThkVA2H4z7+F/UtY2XMVnkq7bHl9Qva8uCiZg5wjJGxKsnYzXz58uUPGBn+wtiq91k2hGoxJhzCbGKMVvjZOp+C7/Ob8R8jZdiM/BEcv8euTgquSzGtjUHl0Zji8hQbF1vu/fDDN6exnLyomQbZKVz5v0OGkNaH+UcXTpy1b9iw4SnSLIVgIIyor6+P27ZtW2x8fHwMYhTWB5E4IxwM33Nk+CwAevVZ/MoziFM4VDGJyP8641FnzjB8E1YgrEBYgbACYQW0FfgPnSun0N/d+rAAAAAASUVORK5CYII=",
+ "title": "Devin"
+ },
+ "codex-cli": {
+ "kind": "image",
+ "src": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAeGVYSWZNTQAqAAAACAAEARoABQAAAAEAAAA+ARsABQAAAAEAAABGASgAAwAAAAEAAgAAh2kABAAAAAEAAABOAAAAAAAAAJAAAAABAAAAkAAAAAEAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAQKADAAQAAAABAAAAQAAAAACU3PoRAAAACXBIWXMAABYlAAAWJQFJUiTwAAABzWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLj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pm+ClJc9ojAAAAABJRU5ErkJggg==",
+ "title": "OpenAI"
+ }
+}
diff --git a/ds-bot/src/client/agent-routes.js b/ds-bot/src/client/agent-routes.js
index de13d29d..51cf5ffd 100644
--- a/ds-bot/src/client/agent-routes.js
+++ b/ds-bot/src/client/agent-routes.js
@@ -1,7 +1,8 @@
// Local-agent routes and their badge marks, kept free of React so plain modules
-// (the create-Bot payload, tests) can use them. Every mark is an original
-// monogram: a one- or two-letter glyph on one of the team's ink colors.
+// (the create-Bot payload, tests) can use them. An agent shows its own logo
+// (agent-logos.js); the monogram is for agents without one.
import { INKS } from './inks.js'
+import { AGENT_LOGOS } from './agent-logos.js'
// route -> [glyph, ink name]. Custom agents (acp-*) share the 'AC' mark.
export const AGENT_BADGES = {
@@ -18,6 +19,8 @@ export const AGENT_BADGES = {
}
const CUSTOM = ['AC', 'rose']
+export const logoOf = engine => AGENT_LOGOS[engine]
+
export const badgeOf = engine => AGENT_BADGES[engine] ?? (engine?.startsWith('acp-') ? CUSTOM : undefined)
// A model ref's provider part is a local-agent route when the CLIs serve it.
@@ -25,9 +28,14 @@ export const isLocalRoute = ref => badgeOf(String(ref ?? '').split('/')[0]) !==
// A badge-style avatar image for a new abot: the monogram large on its ink.
export function agentAvatar(engine) {
+ const logo = logoOf(engine)
+ if (logo?.kind === 'image') return { image: logo.src }
const badge = badgeOf(engine)
if (badge === undefined) return undefined
const [glyph, ink] = badge
- const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><rect width="64" height="64" rx="16" fill="${INKS[ink][0]}"/><text x="32" y="41" text-anchor="middle" font-size="26" font-weight="700" fill="${INKS.black[1]}" font-family="system-ui,sans-serif">${glyph}</text></svg>`
+ const mark = logo?.kind === 'path'
+ ? `<rect width="64" height="64" rx="16" fill="${INKS.black[1]}"/><g transform="translate(14 14) scale(1.5)"><path d="${logo.d}" fill="#${logo.hex}"/></g>`
+ : `<rect width="64" height="64" rx="16" fill="${INKS[ink][0]}"/><text x="32" y="41" text-anchor="middle" font-size="26" font-weight="700" fill="${INKS.black[1]}" font-family="system-ui,sans-serif">${glyph}</text>`
+ const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">${mark}</svg>`
return { image: `data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(svg)))}` }
}
diff --git a/ds-bot/src/client/cells.js b/ds-bot/src/client/cells.js
index 13642d5e..700bf33d 100644
--- a/ds-bot/src/client/cells.js
+++ b/ds-bot/src/client/cells.js
@@ -17,7 +17,7 @@ import { AppAccessCall, ComputerCallRow, ComputerHandoffCall } from './computer.
import { t } from './i18n.js'
import { call } from './api.js'
import { failureLabel } from './diagnostics.js'
-import { turnReasoning, thinkingStep, opensReply } from './turn-reasoning.js'
+import { turnReasoning, thinkingStep, opensReply, stepActivity } from './turn-reasoning.js'
import { parseReplies, stackReplies } from '../shared/group-replies.js'
import { FOLD_AT, FOLD_HUGE, stripLongNote, useFold } from './fold.js'
import { noHover, useViewport, viewBottom } from './motion.js'
@@ -275,7 +275,8 @@ export function AssistantCell({ node, groupPart, sessionId, openFile, fileMentio
// DSH 0.2; the step that answers it shows the event line where it was read,
// once, in the step's first cell.
const relays = relayPart(data, groupPart) ? relaysBefore(contexts, steps, data) : []
- if (texts.length === 0 && !reasoning && relays.length === 0) return h(CellEmpty)
+ const activity = groupPart === 'response' ? [] : stepActivity(data)
+ if (texts.length === 0 && !reasoning && relays.length === 0 && activity.length === 0) return h(CellEmpty)
const selfId = roster.byId[sessionId]?.id ?? sessionId
// The flat layout heads a reply with who speaks, once per Turn: in the step that opens
// it, in that step's reasoning part when the reasoning shows there.
@@ -295,6 +296,7 @@ export function AssistantCell({ node, groupPart, sessionId, openFile, fileMentio
})
}),
head ? h(SpeakerHead, { bot: speaker, time: data.time }) : null,
+ activity.length ? h('div', { className: 'bt-agent-activity' }, activity.map((line, index) => h('div', { key: index, className: 'bt-agent-act', title: line }, h('span', { className: 'bt-agent-act-mark', 'aria-hidden': true }), h('span', { className: 'bt-agent-act-text' }, activityParts(line))))) : null,
reasoning ? h(ThinkingRow, {
text: reasoning, live: thinking !== undefined, viewKey: `${sessionId}:${data.turn}`,
// The live clock counts the settled steps too: backing `at` by the settled
@@ -304,6 +306,9 @@ export function AssistantCell({ node, groupPart, sessionId, openFile, fileMentio
texts.length ? h(Bubbles, { texts, roster, selfId, actions, streaming: running, sessionId, msgKey: `${sessionId}:${data.turn}:${node.key ?? data.seq ?? ''}`, useUi, mentions, fold: FOLD_HUGE, time: speaker === undefined ? data.time : undefined }) : null)
}
+// `code` in an activity line is the command or path the agent works on.
+const activityParts = line => line.split('`').map((part, index) => (index % 2 === 1 ? h('code', { key: index }, part) : part))
+
function EventLine({ prefix, bots, joiner = t('and'), onOpen, whole = false }) {
if (whole && bots.length === 1) {
return h('div', { className: 'bt-event' },
diff --git a/ds-bot/src/client/details-drawer.js b/ds-bot/src/client/details-drawer.js
index 4d32ab76..fcbd7fa7 100644
--- a/ds-bot/src/client/details-drawer.js
+++ b/ds-bot/src/client/details-drawer.js
@@ -3,7 +3,6 @@ import { isMainOf } from './sources.js'
import { HEADER, currentPart, runStatsOf, stripHeader, usageOf } from './text.js'
import { PlusIcon, ShareIcon, CloseIcon, ChevronLeftIcon, GearIcon } from './icons.js'
import { botState, BotMark, BotAvatar } from './mark.js'
-import { AgentBadge } from './agent-badge.js'
import { call } from './api.js'
import { GlobeIcon, Favicon, PanelMenu, menuItemFor } from './browser-pane.js'
import { drawerMenuKeys } from './side-model.js'
@@ -196,6 +195,33 @@ function GroupOverview({ room, roster, actions, usage, useWork, openSettings })
]
}
+// A local agent Bot's sessions: the current one first, then the earlier ones,
+// newest first. Each row names when it started and how it was last titled.
+function AgentSessions({ bot, part, run, useSessions }) {
+ const ids = [part, ...(bot.parts ?? []).filter(id => id !== part).slice().reverse()]
+ const rows = useSessions(list => ids.map(id => list.byId?.[id]), rowsEqual)
+ const total = ids.length
+ return h('div', { className: 'bt-drawer-model' },
+ h('div', { className: 'bt-agent-sessions-head' },
+ h('div', { className: 'bt-section-title' }, t('Sessions')),
+ h('button', { type: 'button', className: 'bt-agent-sessions-new', onClick: () => run(call('bot-new-part', { botId: bot.id })) }, h(PlusIcon), t('New session'))),
+ h('div', { className: 'bt-agent-sessions' }, ids.map((id, index) => {
+ const row = rows[index]
+ const current = index === 0
+ const when = row?.updatedAt ?? row?.createdAt
+ const label = row?.title && row.title.trim() !== '' ? row.title : t('Session {number}', { number: total - index })
+ return h('button', {
+ key: id, type: 'button', disabled: current,
+ className: `bt-agent-session${current ? ' is-current' : ''}`,
+ title: current ? t('Current session') : t('Open this earlier session'),
+ onClick: current ? undefined : () => run(call('bot-open-part', { botId: bot.id, sessionId: id })),
+ },
+ h('span', { className: 'bt-agent-session-name' }, label),
+ h('span', { className: 'bt-agent-session-meta' }, current ? t('Current') : when ? new Date(when).toLocaleString(undefined, { month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' }) : ''))
+ })))
+}
+const rowsEqual = (a, b) => a.length === b.length && a.every((row, index) => row?.title === b[index]?.title && row?.updatedAt === b[index]?.updatedAt)
+
export function DetailsDrawer({ sessionId, startRenaming, startTab, hasStrip, roster, actions, useSessions, useSessionStatus, useActivity, useWork, useBrowserTabs, useBrowserPages, useComputer }) {
const owner = roster.byId[sessionId]
const part = owner ? currentPart(owner) : sessionId
@@ -299,11 +325,8 @@ export function DetailsDrawer({ sessionId, startRenaming, startTab, hasStrip, ro
h('div', { className: 'bt-section-title' }, t('Model')),
h(ModelMenu, { bot, roster, actions, run, wide: true }),
modelOf(bot, roster) ? null : h('div', { className: 'bt-note' }, t('Pick a model and {name} can start.', { name: bot.name })),
- bot.engine ? h('div', { className: 'bt-kv' }, h('span', null, t('Agent')), h(AgentBadge, { engine: bot.engine })) : null),
- bot.engine ? h('div', { key: 'sessions', className: 'bt-drawer-model' },
- h('div', { className: 'bt-section-title' }, t('Sessions')),
- [h('button', { key: 'new', type: 'button', className: 'bt-soft bt-soft-sm', onClick: () => run(call('bot-new-part', { botId: bot.id })) }, t('New session')),
- ...(bot.parts ?? []).slice().reverse().map((part, index) => h('button', { key: part, type: 'button', className: 'bt-soft bt-soft-sm', title: t('Open this earlier session'), onClick: () => run(call('bot-open-part', { botId: bot.id, sessionId: part })) }, t('Session {number}', { number: (bot.parts ?? []).length - index })))]) : null,
+ ),
+ bot.engine ? h(AgentSessions, { key: 'sessions', bot, part, run, useSessions }) : null,
h(PermissionRow, { key: 'permission', bot, roster, actions, run }),
h(BotConnectors, { key: 'connectors', bot, roster, actions, run }),
h('div', { key: 'folder', className: 'bt-drawer-model' },
diff --git a/ds-bot/src/client/i18n.js b/ds-bot/src/client/i18n.js
index 3d05df88..d70dfd9e 100644
--- a/ds-bot/src/client/i18n.js
+++ b/ds-bot/src/client/i18n.js
@@ -234,6 +234,8 @@ const ZH = {
Sessions: '会话',
'Open this earlier session': '打开这个较早的会话',
'Session {number}': '会话 {number}',
+ 'Current session': '当前会话',
+ 'Current': '当前',
'This key comes from outside DS Bot, such as an environment variable, and cannot be changed here.': '这个 key 来自 DS Bot 之外(例如环境变量),这里改不了。',
'and {count} more': '还有 {count} 个',
'Remove {name}? Bots on its models need another model.': '删除 {name}?用它的模型的 Bot 要换一个模型。',
diff --git a/ds-bot/src/client/styles.js b/ds-bot/src/client/styles.js
index 1bb6cc9a..8c98918a 100644
--- a/ds-bot/src/client/styles.js
+++ b/ds-bot/src/client/styles.js
@@ -1235,6 +1235,22 @@ div:has(> nav [class*="_marks"]){display:none!important}
.bt-uimages{display:block;font-size:12px;opacity:.7}
.bt-utime{margin-top:-4px;font-size:11px;line-height:14px;color:var(--bt-ink-3);font-variant-numeric:tabular-nums;white-space:nowrap}
.bt-earlier .bt-event{margin:4px 0}
+.bt-agent-sessions-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
+.bt-agent-sessions-new{display:inline-flex;align-items:center;gap:4px;border:0;background:none;padding:2px 6px;border-radius:6px;font-size:12px;color:var(--bt-ink-2);cursor:pointer}
+.bt-agent-sessions-new:hover{background:var(--bt-hover);color:var(--bt-ink-1,inherit)}
+.bt-agent-sessions-new svg{width:12px;height:12px}
+.bt-agent-sessions{display:flex;flex-direction:column;border:1px solid var(--bt-line-2);border-radius:10px;overflow:hidden}
+.bt-agent-session{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:9px 12px;border:0;border-top:1px solid var(--bt-line-2);background:none;text-align:left;font-size:13px;color:var(--bt-ink-1,inherit);cursor:pointer}
+.bt-agent-session:first-child{border-top:0}
+.bt-agent-session:hover:not(:disabled){background:var(--bt-hover)}
+.bt-agent-session.is-current{background:var(--bt-hover);cursor:default;font-weight:600}
+.bt-agent-session-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
+.bt-agent-session-meta{flex:0 0 auto;font-size:12px;font-weight:400;color:var(--bt-ink-3,var(--bt-ink-2))}
+.bt-agent-activity{display:flex;flex-direction:column;gap:2px;margin:4px 0 6px;max-width:100%}
+.bt-agent-act{display:flex;align-items:center;gap:8px;min-height:22px;font-size:12.5px;line-height:18px;color:var(--bt-ink-2);min-width:0}
+.bt-agent-act-mark{flex:0 0 6px;width:6px;height:6px;border-radius:50%;background:var(--bt-ink-3,currentColor);opacity:.55}
+.bt-agent-act-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
+.bt-agent-act code{font:12px ui-monospace,SFMono-Regular,Menlo,monospace;background:var(--bt-hover);border-radius:4px;padding:1px 5px;color:var(--bt-ink-1,inherit)}
.bt-part-line{display:flex;align-items:center;gap:10px;margin:10px 0 6px;font-size:11px;line-height:14px;color:var(--bt-ink-3)}
.bt-part-line::before,.bt-part-line::after{content:"";flex:1;height:1px;background:var(--bt-line)}
/* The dock wrapper also holds the context meter, so it stays hidden until a side question is in it. */
diff --git a/ds-bot/src/client/turn-reasoning.js b/ds-bot/src/client/turn-reasoning.js
index 92fe1af3..16d2d9bb 100644
--- a/ds-bot/src/client/turn-reasoning.js
+++ b/ds-bot/src/client/turn-reasoning.js
@@ -35,4 +35,10 @@ const visibleReasoning = text => {
return end === -1 ? '' : text.slice(end + '</signature>'.length).replace(/^(\r?\n)+/, '')
}
-const stepReasoning = step => step.blocks.filter(block => block.kind === 'reasoning').map(block => visibleReasoning(block.text)).join('\n').trim()
+// A local agent's own tool calls ride its reasoning as lines that start with
+// "▸ ". They show as activity rows of their step, not folded into the thought.
+const ACTIVITY = '▸ '
+const isActivity = line => line.startsWith(ACTIVITY)
+const reasoningText = step => step.blocks.filter(block => block.kind === 'reasoning').map(block => visibleReasoning(block.text)).join('\n')
+const stepReasoning = step => reasoningText(step).split('\n').filter(line => !isActivity(line)).join('\n').trim()
+export const stepActivity = step => reasoningText(step).split('\n').filter(isActivity).map(line => line.slice(ACTIVITY.length).trim()).filter(Boolean)
diff --git a/ds-bot/src/host/local-agents/acp.js b/ds-bot/src/host/local-agents/acp.js
index f33ba805..f7567e16 100644
--- a/ds-bot/src/host/local-agents/acp.js
+++ b/ds-bot/src/host/local-agents/acp.js
@@ -60,7 +60,7 @@ export class AcpEngine {
let session = this.sessions.get(dshSessionId)
if (session === undefined) {
const queue = new EventQueue()
- session = { dshSessionId, acpSessionId: undefined, dead: false, modes: [], push: event => queue.push(event), next: () => queue.next() }
+ session = { dshSessionId, acpSessionId: undefined, dead: false, modes: [], toolCalls: new Map(), push: event => queue.push(event), next: () => queue.next() }
this.sessions.set(dshSessionId, session)
}
return session
@@ -76,10 +76,14 @@ export class AcpEngine {
case 'agent_thought_chunk': session.push({ type: 'thought', text: textOf(update.content) }); break
case 'tool_call':
case 'tool_call_update': {
- const label = update.title ?? update.kind ?? 'tool'
- const status = update.status
- if (status === undefined || status === 'in_progress' || status === 'pending') session.push({ type: 'activity', text: `▸ ${label}` })
- else if (status === 'failed') session.push({ type: 'activity', text: `▸ ${label} (failed)` })
+ // A permission request names the call only by id; its title, kind and
+ // input came with the call's own updates, so they are kept here.
+ const id = update.toolCallId
+ const known = id === undefined ? undefined : session.toolCalls.get(id)
+ const call = mergeCall(known, update)
+ if (id !== undefined) session.toolCalls.set(id, call)
+ if (known === undefined) session.push({ type: 'activity', text: `▸ ${describeCall(call)}` })
+ else if (update.status === 'failed' && known.status !== 'failed') session.push({ type: 'activity', text: `▸ ${describeCall(call)} — failed` })
break
}
case 'plan': session.push({ type: 'thought', text: planText(update.entries) }); break
@@ -107,8 +111,8 @@ export class AcpEngine {
}
session.push({
type: 'permission', id, reply,
- action: params?.toolCall?.title ?? params?.toolCall?.kind ?? 'The agent asks to run an action',
- detail: detailText(params?.toolCall),
+ action: describeCall(callOf(session, params?.toolCall)),
+ detail: detailText(callOf(session, params?.toolCall)),
options,
})
})
@@ -185,6 +189,26 @@ export class AcpEngine {
const configOptionsOf = (options, category) => options.find(option => (option.category ?? option.id) === category)
const textOf = content => (Array.isArray(content) ? content : [content]).filter(block => block?.type === 'text').map(block => block.text).join('')
const planText = entries => (entries ?? []).map(entry => `- ${entry.content ?? entry.title ?? ''}`).join('\n')
+const mergeCall = (known, update) => ({
+ ...known,
+ ...Object.fromEntries(Object.entries(update).filter(([key, value]) => key !== 'sessionUpdate' && value !== undefined && value !== null)),
+})
+const callOf = (session, toolCall) => mergeCall(toolCall?.toolCallId === undefined ? undefined : session.toolCalls.get(toolCall.toolCallId), toolCall ?? {})
+const VERBS = { read: 'Read', edit: 'Edit', delete: 'Delete', move: 'Move', search: 'Search', execute: 'Run', think: 'Think', fetch: 'Fetch' }
+const inputOf = call => (call.rawInput !== null && typeof call.rawInput === 'object' ? call.rawInput : {})
+// One line a person can act on: what kind of action, on what.
+export const describeCall = (call) => {
+ const input = inputOf(call)
+ const command = input.command ?? input.cmd
+ const target = typeof command === 'string' ? `\`${command.length > 160 ? `${command.slice(0, 157)}…` : command}\``
+ : (call.locations ?? []).map(location => location?.path).filter(Boolean).join(', ')
+ || input.path || input.file_path || input.url || input.query || input.pattern || ''
+ const verb = VERBS[call.kind]
+ const title = typeof call.title === 'string' && call.title.trim() !== '' ? call.title.trim() : undefined
+ if (title !== undefined && (target === '' || title.includes(String(target).replaceAll('`', '')))) return title
+ if (verb !== undefined && target !== '') return `${verb} ${target}`
+ return [title ?? verb ?? 'Use a tool', target].filter(Boolean).join(': ')
+}
const detailText = (toolCall) => {
if (toolCall === undefined) return ''
const parts = []
diff --git a/ds-bot/test/fixtures/fake-acp.mjs b/ds-bot/test/fixtures/fake-acp.mjs
index b8a9e2f3..a24db134 100644
--- a/ds-bot/test/fixtures/fake-acp.mjs
+++ b/ds-bot/test/fixtures/fake-acp.mjs
@@ -38,9 +38,12 @@ async function runPrompt(session, prompt, requestId) {
}
if (text.includes('hang')) return // session/cancel releases it below
if (text.includes('ask-permission')) {
+ // Like Devin: the call's kind and input arrive with its tool_call update;
+ // the permission request names it only by id.
+ update(sessionId, { sessionUpdate: 'tool_call', toolCallId: 'perm-call', kind: 'execute', status: 'pending', rawInput: { command: 'rm -rf /tmp/x' } })
const answer = await ask('session/request_permission', {
sessionId,
- toolCall: { title: 'Run rm -rf /tmp/x', kind: 'execute', rawInput: { command: 'rm -rf /tmp/x' } },
+ toolCall: { toolCallId: 'perm-call' },
options: [
{ optionId: 'allow-once', name: 'Allow once', kind: 'allow_once' },
{ optionId: 'reject', name: 'Reject', kind: 'reject_once' },
diff --git a/ds-bot/test/local-agents.test.js b/ds-bot/test/local-agents.test.js
index d6bbfe1d..0c98b015 100644
--- a/ds-bot/test/local-agents.test.js
+++ b/ds-bot/test/local-agents.test.js
@@ -129,6 +129,8 @@ test('a permission prompt bridges to approve_agent_action and fails closed', asy
const ask = await collect(adapter.stream(options('s1', [user('m1', 'ask-permission')])))
assert.equal(ask.finish.kind, 'tool-calls')
assert.equal(ask.calls[0].name, 'approve_agent_action')
+ // The request named the call only by id; the card still says what it runs.
+ assert.equal(JSON.parse(ask.calls[0].arguments ?? JSON.stringify(ask.calls[0].args)).action, 'Run `rm -rf /tmp/x`')
// An allowed answer picks the agent's allow option: the tool returns its
// structured decision, and only {"decision":"allow"} counts.
const allowed = await collect(adapter.stream(options('s1', [user('m1', 'ask-permission'), toolResult('m2', ask.calls[0].id, JSON.stringify({ decision: 'allow' }))])))