feat(webui): complete bang commands and literal output (NAN-291) (#6173)

* feat(webui): complete direct bang shell commands

Reuse the gateway user-shell side channel, retain failed drafts without reconnect replay, and preserve literal output across live delivery and history. Highlight the bang prefix before and after sending.

NAN-291

* fix(clients): preserve literal shell output through display metadata
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-26 23:35:26 +08:00
1 parent f23a6d1485
commit 7e5dcb79e0
43 files changed
+805 -100

No files matched your search

+6
View File
@@ -502,6 +502,8 @@ describe("gateway protocol", () => {
starts_turn: true,
media_urls: [{ kind: "file", url: "/api/media/sig/file", name: "report.pdf" }],
},
{ event: "message", chat_id: "one", text: " __pycache__ `ticks`\n", render_as: "text" },
{ event: "message", chat_id: "one", text: "**Markdown reply**" },
{ event: "delta", chat_id: "one", text: "hello" },
{ event: "stream_end", chat_id: "one", resuming: false },
{ event: "turn_end", chat_id: "one", latency_ms: 12 },
@@ -522,6 +524,10 @@ describe("gateway protocol", () => {
socket.emit("message", { data: JSON.stringify(frame) })
}
expect(delivered).toEqual(frames)
socket.emit("message", { data: JSON.stringify({
event: "message", chat_id: "one", text: "**Markdown reply**", render_as: true,
}) })
expect(delivered.at(-1)).toEqual({ event: "message", chat_id: "one", text: "**Markdown reply**" })
} finally {
client.close()
Object.defineProperty(globalThis, "WebSocket", { configurable: true, value: original })