A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.
Merge remote-tracking branch 'origin/dev' into HEAD
Fei2411e265192b5ab8
diff --cc ds-bot/client.jsindex df423116,6dd0945d..4fb6ab44--- a/ds-bot/client.js+++ b/ds-bot/client.js@@@ -5005,38 -4944,25 +5008,25 @@@ function SettledQuestion({ question, anconst selected = Array.isArray(answer?.selected) ? answer.selected : [];const custom = typeof answer?.custom === "string" ? answer.custom.trim() : "";const answered = closed === void 0 && (selected.length > 0 || custom !== "");- const row = (key, label, { letter, description, chosen }) => (0, import_react9.createElement)(- "div",- { key, className: "bt-q-opt" },- letter ? (0, import_react9.createElement)("span", { className: "bt-key", "aria-hidden": true }, letter) : null,- (0, import_react9.createElement)(- "span",- { className: "bt-q-body" },- (0, import_react9.createElement)("span", { className: "bt-q-label" }, label),- description ? (0, import_react9.createElement)("span", { className: "bt-q-desc" }, description) : null- ),- chosen ? (0, import_react9.createElement)("span", { className: "bt-q-check", title: t("Selected") }, (0, import_react9.createElement)(CheckIcon)) : null- );- const rows2 = options.map((option, index) => row(`o-${index}`, option.label, { letter: keyLetter(index), description: option.description, chosen: answered && selected.includes(option.label) }));- if (answered) {- selected.filter((label) => !options.some((option) => option.label === label)).forEach((label, index) => rows2.push(row(`s-${index}`, label, { chosen: true })));- if (custom !== "") rows2.push(row("own", custom, { chosen: true }));- }+ const chosen = answered ? [+ ...selected.map((label) => ({ label, at: options.findIndex((option) => option.label === label) })),+ ...custom !== "" ? [{ label: custom, at: options.length }] : []+ ] : [];- return (0, import_react8.createElement)(+ return (0, import_react9.createElement)("div",- { className: answered ? "bt-q bt-q-settled" : "bt-q bt-q-settled bt-q-dismissed", role: "group", "aria-label": prompt },+ { className: answered ? "bt-q bt-q-settled bt-q-answered" : "bt-q bt-q-settled bt-q-dismissed", role: "group", "aria-label": prompt },- (0, import_react8.createElement)(+ (0, import_react9.createElement)("div",{ className: "bt-q-head" },- (0, import_react9.createElement)(- "div",- { className: "bt-q-text" },- prompt ? (0, import_react9.createElement)("p", { className: "bt-q-title" }, prompt) : null,- question?.detail ? (0, import_react9.createElement)("div", { className: "bt-q-detail" }, question.detail) : null- ),- (0, import_react8.createElement)("div", { className: "bt-q-text" }, prompt ? (0, import_react8.createElement)("p", { className: "bt-q-title" }, prompt) : null),- answered ? null : (0, import_react8.createElement)("span", { className: "bt-q-badge" }, closedLabel(closed))++ (0, import_react9.createElement)("div", { className: "bt-q-text" }, prompt ? (0, import_react9.createElement)("p", { className: "bt-q-title" }, prompt) : null),+ answered ? null : (0, import_react9.createElement)("span", { className: "bt-q-badge" }, closedLabel(closed))),- rows2.length > 0 ? (0, import_react9.createElement)("div", { className: "bt-q-list", role: "group", "aria-label": t(answered ? "Your answer" : "Options") }, rows2) : null- chosen.length > 0 ? (0, import_react8.createElement)("div", { className: "bt-q-list", role: "group", "aria-label": t("Your answer") }, chosen.map(({ label, at }, index) => (0, import_react8.createElement)(++ chosen.length > 0 ? (0, import_react9.createElement)("div", { className: "bt-q-list", role: "group", "aria-label": t("Your answer") }, chosen.map(({ label, at }, index) => (0, import_react9.createElement)(+ "div",+ { key: `${label}-${index}`, className: "bt-q-opt", title: t("Selected") },- at >= 0 ? (0, import_react8.createElement)("span", { className: "bt-key", "aria-hidden": true }, keyLetter(at)) : null,- (0, import_react8.createElement)("span", { className: "bt-q-body" }, (0, import_react8.createElement)("span", { className: "bt-q-label" }, label))++ at >= 0 ? (0, import_react9.createElement)("span", { className: "bt-key", "aria-hidden": true }, keyLetter(at)) : null,++ (0, import_react9.createElement)("span", { className: "bt-q-body" }, (0, import_react9.createElement)("span", { className: "bt-q-label" }, label))+ ))) : null);}function QuestionCard({ matched }) {@@@ -8086,22 -8012,21 +8076,21 @@@ function PendingView({ sessionId, viewfunction WidgetCell({ sessionId, callId, args, done, isError, roster, actions, heldCards }) {const record = roster.views?.[sessionId];if (record !== void 0 && record.callId === callId) {- if (heldCards?.[heldCardKey("view", record.id)] > 0) return (0, import_react15.createElement)(CellEmpty);- return (0, import_react15.createElement)(PendingView, { sessionId, view: record, actions, inline: true });+ if (heldCards?.[heldCardKey("view", record.id)] > 0) return (0, import_react16.createElement)(CellEmpty);+ return (0, import_react16.createElement)(PendingView, { sessionId, view: record, actions, inline: true });}- if (done && isError) return (0, import_react15.createElement)(CellEmpty, { className: "bt-q-gone" });+ if (done && isError) return (0, import_react16.createElement)(CellEmpty, { className: "bt-q-gone" });const shown = checkShownView(args?.text?.("title"), args?.value?.("view"));- if (shown.error !== void 0) return (0, import_react15.createElement)(CellEmpty, { className: "bt-q-gone" });+ if (shown.error !== void 0) return (0, import_react16.createElement)(CellEmpty, { className: "bt-q-gone" });if (shown.interactive || args?.value?.("await_reply") === true) {const closed = callId === void 0 ? void 0 : roster.closedCards?.[sessionId]?.[callId];- if (closed === void 0) return (0, import_react15.createElement)(CellEmpty, { className: "bt-q-gone" });- return (0, import_react15.createElement)(ClosedView, { title: shown.title, closed });+ if (closed === void 0) return (0, import_react16.createElement)(CellEmpty, { className: "bt-q-gone" });- return (0, import_react16.createElement)(ClosedView, { title: shown.title, view: shown.view, closed });++ return (0, import_react16.createElement)(ClosedView, { title: shown.title, closed });}- return (0, import_react15.createElement)("div", { className: "bt-q-inline" }, (0, import_react15.createElement)(Card, { title: shown.title, view: shown.view }));+ return (0, import_react16.createElement)("div", { className: "bt-q-inline" }, (0, import_react16.createElement)(Card, { title: shown.title, view: shown.view }));}- function ClosedView({ title, view, closed }) {- const head = (0, import_react16.createElement)("span", { className: "bt-view-closed" }, (0, import_react16.createElement)("span", { className: "bt-view-closed-title" }, title ?? ""), (0, import_react16.createElement)("span", { className: "bt-q-badge" }, closedLabel(closed)));- return (0, import_react16.createElement)("div", { className: "bt-q-inline" }, (0, import_react16.createElement)(Card, { title: head, view, settled: true }));+ function ClosedView({ title, closed }) {- return (0, import_react15.createElement)("div", { className: "bt-q-inline" }, (0, import_react15.createElement)(SettledQuestion, { question: { question: title || t("View") }, closed }));++ return (0, import_react16.createElement)("div", { className: "bt-q-inline" }, (0, import_react16.createElement)(SettledQuestion, { question: { question: title || t("View") }, closed }));}function WidgetDock({ sessionId, useRoster, useCards, useHeldCards, actions }) {const view = useRoster((value) => value.views?.[sessionId]);@@@ -24531,10 -24368,11 +24528,11 @@@ var import_react58 = require("react")var failedAnswers = /* @__PURE__ */ new Map();function ProposalCard({ proposal, initialError = "", onFailure, onResolved, actions }) {const outcome = proposal.outcome;- const [busy, setBusy] = (0, import_react56.useState)(false);- const [error, setError] = (0, import_react56.useState)(initialError);- const [open, setOpen] = (0, import_react56.useState)(false);- const busyRef = (0, import_react56.useRef)(false);- const titleId = (0, import_react56.useId)();+ const [busy, setBusy] = (0, import_react58.useState)(false);+ const [error, setError] = (0, import_react58.useState)(initialError);++ const [open, setOpen] = (0, import_react58.useState)(false);+ const busyRef = (0, import_react58.useRef)(false);+ const titleId = (0, import_react58.useId)();const answer = (approve) => {if (busyRef.current) return;busyRef.current = true;@@@ -24550,47 -24388,58 +24548,58 @@@});};const update = proposal.action === "update";+ const agents = proposal.kind === "agents";- const rows2 = (0, import_react56.useMemo)(() => lineDiff(update ? proposal.previous?.content : "", proposal.content), [update, proposal.previous?.content, proposal.content]);+ const rows2 = (0, import_react58.useMemo)(() => lineDiff(update ? proposal.previous?.content : "", proposal.content), [update, proposal.previous?.content, proposal.content]);- if (proposal.kind === "agents") {- const blocks = proposal.edits.map((edit) => [+ const change = agents ? [- (0, import_react56.createElement)(FileBox, { key: "file", name: "AGENTS.md", path: proposal.folder, state: proposal.exists === false ? "Added" : "Modified", blocks: proposal.edits.map((edit) => [++ (0, import_react58.createElement)(FileBox, { key: "file", name: "AGENTS.md", path: proposal.folder, state: proposal.exists === false ? "Added" : "Modified", blocks: proposal.edits.map((edit) => [...(edit.op === "add" ? [] : editLines(edit.old)).map((line) => ({ kind: "removed", line })),...(edit.op === "remove" ? [] : editLines(edit.text)).map((line) => ({ kind: "added", line }))- ]);+ ]) }),- ...proposal.edits.map((edit, index) => edit.why ? (0, import_react56.createElement)("p", { className: "bt-learning-why", key: `why-${index}` }, edit.why) : null)++ ...proposal.edits.map((edit, index) => edit.why ? (0, import_react58.createElement)("p", { className: "bt-learning-why", key: `why-${index}` }, edit.why) : null)+ ] : [- (0, import_react56.createElement)(FileBox, { key: "file", name: "SKILL.md", path: `skills/${proposal.name}`, state: update ? "Updated" : "Added", blocks: [rows2] }),- proposal.why ? (0, import_react56.createElement)("p", { className: "bt-learning-why", key: "why" }, proposal.why) : null++ (0, import_react58.createElement)(FileBox, { key: "file", name: "SKILL.md", path: `skills/${proposal.name}`, state: update ? "Updated" : "Added", blocks: [rows2] }),++ proposal.why ? (0, import_react58.createElement)("p", { className: "bt-learning-why", key: "why" }, proposal.why) : null+ ];+ const kind = t(agents ? "AGENTS.md update" : update ? "Skill update" : "New skill");+ if (outcome) {+ const what = agents ? proposal.folder : proposal.name;- return (0, import_react56.createElement)(+ return (0, import_react58.createElement)("section",- { className: "bt-q bt-learning-card", role: "group", "aria-labelledby": titleId, "aria-busy": busy, "data-outcome": outcome },- (0, import_react58.createElement)(ProposalHead, { titleId, icon: PencilIcon, title: t("AGENTS.md update"), outcome }),- (0, import_react58.createElement)(FileBox, { name: "AGENTS.md", path: proposal.folder, state: proposal.exists === false ? "Added" : "Modified", blocks }),- proposal.edits.map((edit, index) => edit.why ? (0, import_react58.createElement)("p", { className: "bt-learning-why", key: index }, edit.why) : null),- error ? (0, import_react58.createElement)("div", { className: "bt-learning-error", role: "alert" }, error) : null,- outcome ? null : (0, import_react58.createElement)(ProposalFoot, { busy, answer })+ { className: "bt-q bt-q-settled bt-learning-card bt-learning-settled", role: "group", "aria-label": `${kind} · ${what}`, "data-outcome": outcome },- (0, import_react56.createElement)(++ (0, import_react58.createElement)(+ "button",+ { type: "button", className: "bt-learning-fold", "aria-expanded": open, onClick: () => setOpen(!open) },- (0, import_react56.createElement)("span", { className: "bt-learning-icon", "aria-hidden": true }, (0, import_react56.createElement)(agents ? PencilIcon : MemoryIcon)),- (0, import_react56.createElement)("span", { className: "bt-learning-kind" }, kind),- (0, import_react56.createElement)("span", { className: "bt-learning-sum" }, `${t(outcome === "approved" ? "Approved" : "Declined")} · ${what}`)++ (0, import_react58.createElement)("span", { className: "bt-learning-icon", "aria-hidden": true }, (0, import_react58.createElement)(agents ? PencilIcon : MemoryIcon)),++ (0, import_react58.createElement)("span", { className: "bt-learning-kind" }, kind),++ (0, import_react58.createElement)("span", { className: "bt-learning-sum" }, `${t(outcome === "approved" ? "Approved" : "Declined")} · ${what}`)+ ),+ open ? change : null);}const oldDetail = update && typeof proposal.previous?.description === "string" && proposal.previous.description !== proposal.description ? proposal.previous.description : void 0;- return (0, import_react56.createElement)(+ return (0, import_react58.createElement)("section",- { className: "bt-q bt-learning-card", role: "group", "aria-labelledby": titleId, "aria-busy": busy, "data-outcome": outcome },- (0, import_react58.createElement)(ProposalHead, { titleId, title: proposal.name, kind: t(update ? "Skill update" : "New skill"), detail: proposal.description, oldDetail, outcome }),- (0, import_react58.createElement)(FileBox, { name: "SKILL.md", path: `skills/${proposal.name}`, state: update ? "Updated" : "Added", blocks: [rows2] }),- proposal.why ? (0, import_react58.createElement)("p", { className: "bt-learning-why" }, proposal.why) : null,+ { className: "bt-q bt-learning-card", role: "group", "aria-labelledby": titleId, "aria-busy": busy },- agents ? (0, import_react56.createElement)(ProposalHead, { titleId, icon: PencilIcon, title: kind }) : (0, import_react56.createElement)(ProposalHead, { titleId, title: proposal.name, kind, detail: proposal.description, oldDetail }),++ agents ? (0, import_react58.createElement)(ProposalHead, { titleId, icon: PencilIcon, title: kind }) : (0, import_react58.createElement)(ProposalHead, { titleId, title: proposal.name, kind, detail: proposal.description, oldDetail }),+ change,- error ? (0, import_react56.createElement)("div", { className: "bt-learning-error", role: "alert" }, error) : null,- (0, import_react56.createElement)(ProposalFoot, { busy, answer })+ error ? (0, import_react58.createElement)("div", { className: "bt-learning-error", role: "alert" }, error) : null,- outcome ? null : (0, import_react58.createElement)(ProposalFoot, { busy, answer })++ (0, import_react58.createElement)(ProposalFoot, { busy, answer }));}- function ProposalHead({ titleId, icon: icon2 = MemoryIcon, title, kind, detail, oldDetail, outcome }) {+ function ProposalHead({ titleId, icon: icon2 = MemoryIcon, title, kind, detail, oldDetail }) {- return (0, import_react56.createElement)(+ return (0, import_react58.createElement)("div",{ className: "bt-q-head" },- (0, import_react56.createElement)("span", { className: "bt-learning-icon", "aria-hidden": true }, (0, import_react56.createElement)(icon2)),- (0, import_react56.createElement)(+ (0, import_react58.createElement)("span", { className: "bt-learning-icon", "aria-hidden": true }, (0, import_react58.createElement)(icon2)),+ (0, import_react58.createElement)("div",{ className: "bt-q-text" },- (0, import_react56.createElement)("p", { className: "bt-q-title", id: titleId }, title),- kind ? (0, import_react56.createElement)("div", { className: "bt-q-detail" }, kind) : null,- oldDetail ? (0, import_react56.createElement)("p", { className: "bt-learning-description bt-learning-old" }, (0, import_react56.createElement)("del", null, oldDetail)) : null,- detail ? (0, import_react56.createElement)("p", { className: "bt-learning-description" }, detail) : null+ (0, import_react58.createElement)("p", { className: "bt-q-title", id: titleId }, title),+ kind ? (0, import_react58.createElement)("div", { className: "bt-q-detail" }, kind) : null,+ oldDetail ? (0, import_react58.createElement)("p", { className: "bt-learning-description bt-learning-old" }, (0, import_react58.createElement)("del", null, oldDetail)) : null,+ detail ? (0, import_react58.createElement)("p", { className: "bt-learning-description" }, detail) : null),- outcome ? (0, import_react58.createElement)("span", { className: "bt-q-badge" }, t(outcome === "approved" ? "Approved" : "Declined")) : (0, import_react58.createElement)("span", { className: "bt-q-badge bt-learning-status" }, (0, import_react58.createElement)("span", { className: "bt-learning-dot", "aria-hidden": true }), t("Awaiting approval"))- (0, import_react56.createElement)("span", { className: "bt-q-badge bt-learning-status" }, (0, import_react56.createElement)("span", { className: "bt-learning-dot", "aria-hidden": true }), t("Awaiting approval"))++ (0, import_react58.createElement)("span", { className: "bt-q-badge bt-learning-status" }, (0, import_react58.createElement)("span", { className: "bt-learning-dot", "aria-hidden": true }), t("Awaiting approval")));}function ProposalFoot({ busy, answer }) {