Render Markdown, add ask_human context, simplify inbox responses, group inbox by task
This commit is contained in:
+5
-5
@@ -1,5 +1,6 @@
|
||||
import { post, type ByreEvent } 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"];
|
||||
@@ -163,13 +164,13 @@ function renderEvent(ev: ByreEvent, tools: Map<string, HTMLElement>): HTMLElemen
|
||||
|
||||
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…");
|
||||
@@ -233,7 +234,6 @@ export function reportCard(p: Record<string, unknown>): HTMLElement {
|
||||
const sections: [string, string][] = [
|
||||
["done", "Done"],
|
||||
["deviations", "Deviations from plan"],
|
||||
["open_questions", "Open questions"],
|
||||
["risks", "Risks"],
|
||||
["next_steps", "Next steps"],
|
||||
];
|
||||
@@ -245,7 +245,7 @@ export function reportCard(p: Record<string, unknown>): HTMLElement {
|
||||
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)))));
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user