Render Markdown, add ask_human context, simplify inbox responses, group inbox by task

This commit is contained in:
Ian Gulliver
2026-10-14 10:37:04 -07:00
parent e9fd7de556
commit ca2644374d
25 changed files with 950 additions and 283 deletions
+5 -5
View File
@@ -1,5 +1,6 @@
import { post } from "./api.js";
import { ago, errorText, h, replace } from "./dom.js";
import { inlineMarkdown, markdown } from "./markdown.js";
import { currentSession, findTask, onEach, state } from "./state.js";
const models = ["", "opus", "sonnet", "haiku"];
export function mountTranscript(root) {
@@ -145,11 +146,11 @@ function renderEvent(ev, tools) {
const when = h("time", { dateTime: ev.created_at, title: ev.created_at }, ago(ev.created_at));
switch (ev.kind) {
case "user.message":
return h("div", { class: "msg user" }, h("div", { class: "who" }, ev.actor, " ", when), h("div", { class: "text" }, String(p["text"])));
return h("div", { class: "msg user" }, h("div", { class: "who" }, ev.actor, " ", when), markdown(String(p["text"]), "text md"));
case "agent.message":
return h("div", { class: "msg agent" }, h("div", { class: "text" }, String(p["text"])));
return h("div", { class: "msg agent" }, markdown(String(p["text"]), "text md"));
case "agent.thinking":
return h("details", { class: "thinking" }, h("summary", {}, "thinking"), h("div", { class: "text" }, String(p["text"])));
return h("details", { class: "thinking" }, h("summary", {}, "thinking"), markdown(String(p["text"]), "text md"));
case "agent.tool_call": {
const result = h("div", { class: "tool-result pending" }, "running…");
tools.set(String(p["id"]), result);
@@ -197,7 +198,6 @@ export function reportCard(p) {
const sections = [
["done", "Done"],
["deviations", "Deviations from plan"],
["open_questions", "Open questions"],
["risks", "Risks"],
["next_steps", "Next steps"],
];
@@ -206,7 +206,7 @@ export function reportCard(p) {
if (items.length === 0) {
return null;
}
return h("div", { class: `report-section ${key}` }, h("h4", {}, label), h("ul", {}, ...items.map((i) => h("li", {}, i))));
return h("div", { class: `report-section ${key}` }, h("h4", {}, label), h("ul", {}, ...items.map((i) => h("li", {}, inlineMarkdown(i)))));
}));
}
function toolBrief(input) {