Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Burst mode: the card and the /burst command

Milind Sonie3b42c7fe2f9
diff --git a/src/components/BurstCard.test.ts b/src/components/BurstCard.test.ts
new file mode 100644
index 0000000000..af5fe481f0
--- /dev/null
+++ b/src/components/BurstCard.test.ts
@@ -0,0 +1,81 @@
+import { createElement } from "react";
+import { renderToStaticMarkup } from "react-dom/server";
+import { describe, expect, it, vi } from "vitest";
+
+import type { BurstCardData } from "../../shared/burst";
+
+vi.mock("@/state/store", () => ({ api: vi.fn(), openThread: vi.fn(), useStore: () => ({ state: {}, dispatch: vi.fn() }) }));
+vi.mock("@/lib/thread-preferences", () => ({ useShowThreads: () => true }));
+
+const { BurstCard, BurstRows } = await import("./BurstCard");
+
+const card = (over: Partial<BurstCardData> = {}): BurstCardData => ({
+ version: 1, burstId: "b1", botId: "bot", task: "Research these companies", phase: "preview", total: 20, requested: 20, parallel: 10, modelName: "Fast 1",
+ estimateMinutes: 6, counts: { queued: 20, running: 0, done: 0, failed: 0, cancelled: 0 }, sample: ["Acme", "Globex"], ...over,
+});
+const render = (data: BurstCardData) => renderToStaticMarkup(createElement(BurstCard, { card: data }));
+
+describe("BurstCard preview", () => {
+ it("offers Run, Edit and Cancel, with the plan and a sample of the tasks", () => {
+ const markup = render(card());
+ expect(markup).toContain("Burst: Research these companies");
+ expect(markup).toContain("20 tasks");
+ expect(markup).toContain("10 at once");
+ expect(markup).toContain("about 6 min");
+ expect(markup).toContain("Acme · Globex");
+ expect(markup).toContain("+18 more");
+ for (const label of ["Run", "Edit", "Cancel"]) expect(markup).toContain(`>${label}</button>`);
+ expect(markup).not.toContain("Retry failed");
+ });
+
+ it("says plainly what a small plan's task limit does, without a wall", () => {
+ const markup = render(card({ total: 10, requested: 20, taskLimit: 10, smallPlan: true, parallel: 2 }));
+ expect(markup).toContain("10 of the 20 tasks will run");
+ expect(markup).toContain("Pro runs more at once.");
+ expect(markup).toContain(">Run</button>");
+ });
+
+ it("names the limit without the upsell on a larger plan", () => {
+ const markup = render(card({ total: 200, requested: 300, taskLimit: 200 }));
+ expect(markup).toContain("200 of the 300 tasks will run");
+ expect(markup).not.toContain("Pro runs more");
+ });
+});
+
+describe("BurstCard progress", () => {
+ it("shows counts with Retry failed and Cancel all while it runs", () => {
+ const markup = render(card({ phase: "running", counts: { queued: 7, running: 10, done: 2, failed: 1, cancelled: 0 } }));
+ expect(markup).toContain("2 of 20 done");
+ expect(markup).toContain("10 running");
+ expect(markup).toContain("7 waiting");
+ expect(markup).toContain("1 failed");
+ expect(markup).toContain(">Retry failed</button>");
+ expect(markup).toContain(">Cancel all</button>");
+ expect(markup).not.toContain(">Run</button>");
+ });
+
+ it("names what did not finish once it settles, and keeps only Retry failed", () => {
+ const markup = render(card({ phase: "done", counts: { queued: 0, running: 0, done: 19, failed: 1, cancelled: 0 }, failed: [{ title: "Globex", reason: "It ran out of memory." }] }));
+ expect(markup).toContain("19 of 20 done");
+ expect(markup).toContain("Not finished: Globex");
+ expect(markup).toContain(">Retry failed</button>");
+ expect(markup).not.toContain(">Cancel all</button>");
+ });
+
+ it("says when it was cancelled, with nothing left to press but the tasks", () => {
+ const markup = render(card({ phase: "cancelled", counts: { queued: 0, running: 0, done: 3, failed: 0, cancelled: 17 } }));
+ expect(markup).toContain("Cancelled");
+ expect(markup).not.toContain("Retry failed");
+ expect(markup).not.toContain("Cancel all");
+ });
+
+ it("collapses the parts, and a part that started opens its own thread", () => {
+ expect(render(card({ phase: "running" }))).toContain("Show tasks");
+ const markup = renderToStaticMarkup(createElement(BurstRows, { botId: "bot", rows: [
+ { seq: 0, title: "Acme", status: "done", threadId: "t1" },
+ { seq: 1, title: "Globex", status: "queued" },
+ ] }));
+ expect(markup).toContain("Acme");
+ expect(markup.match(/<button/g)).toHaveLength(1);
+ });
+});
diff --git a/src/components/BurstCard.tsx b/src/components/BurstCard.tsx
new file mode 100644
index 0000000000..1caed8beb0
--- /dev/null
+++ b/src/components/BurstCard.tsx
@@ -0,0 +1,196 @@
+import { CheckCircle2, ChevronDown, ChevronRight, CircleAlert, Layers, Loader2, Square, XCircle } from "lucide-react";
+import { useEffect, useState } from "react";
+
+import { cn } from "@/lib/cn";
+import { t } from "@/lib/i18n";
+import { api, openThread, useStore } from "@/state/store";
+import { useShowThreads } from "@/lib/thread-preferences";
+import type { LocaleKey } from "@/locales";
+import type { BurstCardData, BurstChildRow, BurstChildStatus, BurstView } from "../../shared/burst";
+
+const BUTTON = "rounded-lg border border-hairline/50 px-2.5 py-1 text-[12px] font-medium text-ink-secondary hover:bg-raised hover:text-ink disabled:opacity-50";
+const PRIMARY = "rounded-lg bg-accent px-3 py-1 text-[12px] font-medium text-white hover:bg-accent/90 disabled:opacity-50";
+
+const STATUS: Record<BurstChildStatus, LocaleKey> = {
+ queued: "burst.status.queued", running: "burst.status.running", done: "burst.status.done", failed: "burst.status.failed", cancelled: "burst.status.cancelled",
+};
+
+function compact(value: string, limit: number): string {
+ const clean = value.replace(/\s+/g, " ").trim();
+ return clean.length > limit ? `${clean.slice(0, limit - 1).trimEnd()}…` : clean;
+}
+
+function StatusIcon({ status }: { status: BurstChildStatus }) {
+ const className = "size-3.5 shrink-0";
+ if (status === "running") return <Loader2 aria-hidden="true" className={cn(className, "animate-spin text-accent")} />;
+ if (status === "done") return <CheckCircle2 aria-hidden="true" className={cn(className, "text-success")} />;
+ if (status === "failed") return <XCircle aria-hidden="true" className={cn(className, "text-danger")} />;
+ if (status === "cancelled") return <Square aria-hidden="true" className={cn(className, "text-ink-tertiary")} />;
+ return <CircleAlert aria-hidden="true" className={cn(className, "text-ink-tertiary")} />;
+}
+
+/** What a phase reads as, once a burst is past its preview. */
+function headline(card: BurstCardData): string {
+ if (card.phase === "merging") return t("burst.phase.merging");
+ if (card.phase === "done") return `${t("burst.phase.done")} · ${t("burst.progress", { done: card.counts.done, total: card.total })}`;
+ if (card.phase === "cancelled") return t("burst.phase.cancelled");
+ return t("burst.progress", { done: card.counts.done, total: card.total });
+}
+
+export function BurstCounts({ card }: { card: BurstCardData }) {
+ const parts = [
+ card.counts.running > 0 && t("burst.running", { count: card.counts.running }),
+ card.counts.queued > 0 && t("burst.waiting", { count: card.counts.queued }),
+ card.counts.failed > 0 && t("burst.failed", { count: card.counts.failed }),
+ ].filter(Boolean);
+ return parts.length ? <p className="text-[12px] text-ink-secondary">{parts.join(" · ")}</p> : null;
+}
+
+/** The card a burst shows in its chat: a preview until the person presses Run, then one progress card. */
+export function BurstCard({ card }: { card: BurstCardData }) {
+ const [editing, setEditing] = useState(false);
+ const [open, setOpen] = useState(false);
+ const [view, setView] = useState<BurstView | null>(null);
+ const [busy, setBusy] = useState(false);
+ const [error, setError] = useState(false);
+ const moved = `${card.phase}:${card.counts.done}:${card.counts.running}:${card.counts.failed}:${card.counts.cancelled}`;
+ const live = open || editing;
+
+ useEffect(() => {
+ if (!live) return;
+ let current = true;
+ void api<BurstView>(`/api/bursts/${card.burstId}`).then((next) => { if (current) setView(next); }).catch(() => {});
+ return () => { current = false; };
+ }, [live, moved, card.burstId]);
+
+ async function press(action: "run" | "cancel" | "retry" | "edit", body?: unknown): Promise<boolean> {
+ setBusy(true);
+ setError(false);
+ try {
+ await api(`/api/bursts/${card.burstId}/${action}`, { method: "POST", ...(body === undefined ? {} : { body: JSON.stringify(body) }) });
+ return true;
+ } catch {
+ setError(true);
+ return false;
+ } finally {
+ setBusy(false);
+ }
+ }
+
+ const preview = card.phase === "preview";
+ const failedNames = card.failed?.map((one) => one.title).join(", ");
+ return (
+ <section aria-label={t("burst.statusLabel", { status: headline(card) })}
+ className="w-full max-w-[680px] rounded-2xl border border-hairline/45 bg-card px-3.5 py-3 shadow-sm">
+ <div className="flex items-start gap-3">
+ <div className="mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-xl bg-inset">
+ {card.phase === "running" || card.phase === "merging"
+ ? <Loader2 aria-hidden="true" className="size-4 animate-spin text-accent" />
+ : <Layers aria-hidden="true" className="size-4 text-ink-secondary" />}
+ </div>
+ <div className="min-w-0 flex-1 space-y-1">
+ <h3 className="truncate text-[14px] font-semibold text-ink">{t("burst.title", { task: compact(card.task, 120) })}</h3>
+ {preview ? (
+ <>
+ <p className="text-[12px] text-ink-secondary">{t("burst.plan", { count: card.total, model: card.modelName, parallel: card.parallel, minutes: card.estimateMinutes })}</p>
+ <p className="truncate text-[12px] text-ink-tertiary">{card.sample.join(" · ")}{card.total > card.sample.length ? ` · ${t("burst.moreItems", { count: card.total - card.sample.length })}` : ""}</p>
+ {card.taskLimit !== undefined && (
+ <p className="text-[12px] text-ink-secondary">{t("burst.limitCut", { total: card.total, requested: card.requested, limit: card.taskLimit })}{card.smallPlan ? ` ${t("burst.morePlan")}` : ""}</p>
+ )}
+ </>
+ ) : (
+ <>
+ <p aria-live="polite" className="text-[13px] font-medium text-ink">{headline(card)}</p>
+ <BurstCounts card={card} />
+ {failedNames && (
+ <p className="line-clamp-2 text-[12px] text-ink-secondary">
+ {card.failedMore ? t("burst.notFinishedMore", { names: failedNames, count: card.failedMore }) : t("burst.notFinished", { names: failedNames })}
+ </p>
+ )}
+ </>
+ )}
+ {error && <p className="text-[12px] text-danger">{t("burst.error.action")}</p>}
+ {editing && view && <BurstEditor view={view} busy={busy} onBack={() => setEditing(false)} onSave={(plan) => { void press("edit", plan).then((ok) => { if (ok) setEditing(false); }); }} />}
+ {!editing && (
+ <div className="flex flex-wrap items-center gap-1.5 pt-1.5">
+ {preview ? (
+ <>
+ <button type="button" disabled={busy} onClick={() => { void press("run"); }} className={PRIMARY}>{t("burst.run")}</button>
+ <button type="button" disabled={busy} onClick={() => { setError(false); setEditing(true); }} className={BUTTON}>{t("burst.edit")}</button>
+ <button type="button" disabled={busy} onClick={() => { void press("cancel"); }} className={BUTTON}>{t("burst.cancel")}</button>
+ </>
+ ) : (
+ <>
+ <button type="button" onClick={() => setOpen((value) => !value)} className={cn(BUTTON, "flex items-center gap-1")}>
+ {open ? <ChevronDown aria-hidden="true" className="size-3" /> : <ChevronRight aria-hidden="true" className="size-3" />}
+ {t(open ? "burst.hideTasks" : "burst.showTasks")}
+ </button>
+ {card.counts.failed > 0 && (card.phase === "running" || card.phase === "done") && (
+ <button type="button" disabled={busy} onClick={() => { void press("retry"); }} className={BUTTON}>{t("burst.retryFailed")}</button>
+ )}
+ {(card.phase === "running" || card.phase === "merging") && (
+ <button type="button" disabled={busy} onClick={() => { void press("cancel"); }} className={BUTTON}>{t("burst.cancelAll")}</button>
+ )}
+ </>
+ )}
+ </div>
+ )}
+ {open && view && !preview && <BurstRows botId={card.botId} rows={view.children} />}
+ </div>
+ </div>
+ </section>
+ );
+}
+
+function BurstEditor({ view, busy, onSave, onBack }: { view: BurstView; busy: boolean; onSave: (plan: { instructions: string; items: string[] }) => void; onBack: () => void }) {
+ const [instructions, setInstructions] = useState(view.instructions);
+ const [items, setItems] = useState(view.items.join("\n"));
+ const lines = items.split("\n").map((line) => line.trim()).filter(Boolean);
+ return (
+ <div className="space-y-2 pt-1.5">
+ <label className="block text-[12px] text-ink-secondary">
+ {t("burst.editInstructions")}
+ <textarea value={instructions} onChange={(event) => setInstructions(event.target.value)} rows={3}
+ className="mt-1 w-full rounded-lg border border-hairline/50 bg-transparent px-2 py-1.5 text-[13px] text-ink" />
+ </label>
+ <label className="block text-[12px] text-ink-secondary">
+ {t("burst.editItems")}
+ <textarea value={items} onChange={(event) => setItems(event.target.value)} rows={Math.min(10, Math.max(3, lines.length))}
+ className="mt-1 w-full rounded-lg border border-hairline/50 bg-transparent px-2 py-1.5 text-[13px] text-ink" />
+ </label>
+ <div className="flex gap-1.5">
+ <button type="button" disabled={busy || lines.length < 2} onClick={() => onSave({ instructions, items: lines })} className={PRIMARY}>{t("burst.save")}</button>
+ <button type="button" disabled={busy} onClick={onBack} className={BUTTON}>{t("burst.back")}</button>
+ </div>
+ </div>
+ );
+}
+
+/** The parts under the card, opened on demand; each started part opens its own thread. */
+export function BurstRows({ botId, rows }: { botId: string; rows: BurstChildRow[] }) {
+ const { state, dispatch } = useStore();
+ const showThreads = useShowThreads();
+ return (
+ <ul className="max-h-[280px] space-y-0.5 overflow-y-auto pt-1.5">
+ {rows.map((row) => {
+ const label = (
+ <>
+ <StatusIcon status={row.status} />
+ <span className="min-w-0 flex-1 truncate">{row.title}</span>
+ <span className="shrink-0 text-ink-tertiary">{t(STATUS[row.status])}</span>
+ </>
+ );
+ return (
+ <li key={row.seq}>
+ {row.threadId ? (
+ <button type="button" title={row.error ?? t("chat.openThread", { title: row.title })} onClick={() => openThread(dispatch, { botId, threadId: row.threadId! }, state, showThreads)}
+ className="flex w-full items-center gap-2 rounded-md px-1.5 py-1 text-left text-[12px] text-ink-secondary hover:bg-raised hover:text-ink">{label}</button>
+ ) : (
+ <div className="flex w-full items-center gap-2 px-1.5 py-1 text-[12px] text-ink-secondary">{label}</div>
+ )}
+ </li>
+ );
+ })}
+ </ul>
+ );
+}
diff --git a/src/components/Composer.slash.test.ts b/src/components/Composer.slash.test.ts
index 86d7fd69e0..208fb5d9f4 100644
--- a/src/components/Composer.slash.test.ts
+++ b/src/components/Composer.slash.test.ts
@@ -68,7 +68,7 @@ describe("the / menu in the composer", () => {
it("offers the built-in commands and skills at the start of a message", () => {
fill("/");
- expect(labels()).toEqual(["/goal", "/learn", "/setup", "/standup"]);
+ expect(labels()).toEqual(["/goal", "/learn", "/setup", "/burst", "/standup"]);
});
it("offers only skills after a space later in the message, and puts the pick in place", () => {
diff --git a/src/components/Composer.tsx b/src/components/Composer.tsx
index 75fe2f5d31..665a1e9023 100644
--- a/src/components/Composer.tsx
+++ b/src/components/Composer.tsx
@@ -87,6 +87,7 @@ import { serializeThreadRefs, threadTokenFromPaste, threadTokenSpacing } from "@
import {
composerSlashTrigger,
goalTextFromComposer,
+ builtInCommandText,
replaceComposerSlashTrigger,
skillSlashCommands,
slashCommandMatches,
@@ -318,7 +319,7 @@ export function Composer({
id: "setup",
label: "/setup",
description: t("composer.command.setupDesc"),
- });
+ }, { kind: "command", id: "burst", label: "/burst", description: t("composer.command.burstDesc") });
available.push(...skillSlashCommands(slashSkills));
return available.filter((command) => slashCommandMatches(command, slash.query));
}, [slash, dismissedSlashAt, group, bot, canLearn, state.instances, locale, slashSkills]);
@@ -384,7 +385,7 @@ export function Composer({
if (!slash || !command) return;
const spaceAfter = /^\s/.test(text.slice(slash.end)) ? "" : " ";
const replacement = command.kind === "skill" ? `${command.label}${spaceAfter}`
- : command.id === "learn" ? "/learn " : command.id === "setup" ? "/setup " : "";
+ : builtInCommandText(command.id);
const next = replaceComposerSlashTrigger(text, slash, replacement);
editText(next.text);
setCaret(next.caret);
diff --git a/src/components/RichMessageRow.tsx b/src/components/RichMessageRow.tsx
index 3b1cdd40b4..6b03da38d0 100644
--- a/src/components/RichMessageRow.tsx
+++ b/src/components/RichMessageRow.tsx
@@ -3,6 +3,7 @@ import type { Message } from "@/state/store";
import { t } from "@/lib/i18n";
import { AppMessage } from "./app/AppMessage";
import { BugReportNote } from "./BugReportNote";
+import { BurstCard } from "./BurstCard";
import { GoalRunRow } from "./GoalRunCard";
import { HelperKeySuggestion } from "./HelperKeySuggestion";
import { MessageBoundary } from "./MessageBoundary";
@@ -11,7 +12,7 @@ import { WidgetMessage } from "./widget/WidgetMessage";
export function richRowKind(message: Message): Message["kind"] {
// MausBot's follow-up is text the model reads, drawn under its intro's card row (OptionsCardRow).
if (message.helperFollowup) return "options";
- if (message.setupSuggestion || (message.kind === "goal.run" && message.goalRun)) return "widget";
+ if (message.setupSuggestion || (message.kind === "goal.run" && message.goalRun) || (message.kind === "burst" && message.burst)) return "widget";
if (message.kind === "widget" && !message.widget) return "text";
if (message.kind === "app" && !message.app) return "text";
return message.kind;
@@ -23,6 +24,8 @@ export function RichMessageRow({ botId, botName, threadId, message, room }: { bo
<MessageBoundary fallbackText={message.text ?? ""}>
{message.setupSuggestion
? <HelperKeySuggestion threadId={threadId} message={message} />
+ : message.kind === "burst" && message.burst
+ ? <div className="flex justify-start"><BurstCard card={message.burst} /></div>
: message.kind === "goal.run"
? <GoalRunRow botId={botId} threadId={threadId} message={message} />
: message.kind === "app"
diff --git a/src/components/SidebarThreadRow.test.ts b/src/components/SidebarThreadRow.test.ts
index ca8ee5df8d..3975d4171c 100644
--- a/src/components/SidebarThreadRow.test.ts
+++ b/src/components/SidebarThreadRow.test.ts
@@ -47,6 +47,13 @@ describe("sidebar thread visibility", () => {
expect(visibleSidebarThreads(rows, "8").map((task) => task.threadId)).toEqual(["0", "1", "2", "3", "4", "5", "7", "8", "9"]);
expect(visibleSidebarThreads(rows, "8", "", [], true)).toEqual(rows);
});
+
+ it("leaves a burst's parts to its card, unless one is open or needs the person", () => {
+ const openedBy = { botId: "b", name: "Bot", at: 1, burstId: "run-1" };
+ const parts = [{ threadId: "quiet", title: "Quiet", openedBy }, { threadId: "open", title: "Open", openedBy }, { threadId: "asks", title: "Asks", openedBy, unread: true }];
+ expect(visibleSidebarThreads(parts, "open").map((task) => task.threadId).sort()).toEqual(["asks", "open"]);
+ expect(visibleSidebarThreads(parts, "open", "", [], true)).toEqual(parts);
+ });
it("searches folder names and historical thread titles without the recent-row limit", () => {
expect(visibleSidebarThreads(tasks, "0", " RESEARCH ", [{ id: "research", name: "Research" }]).map((task) => task.threadId)).toEqual(["8", "9"]);
expect(visibleSidebarThreads(tasks, "0", "thread 9").map((task) => task.threadId)).toEqual(["9"]);
diff --git a/src/components/SidebarThreadRow.tsx b/src/components/SidebarThreadRow.tsx
index f9f1400e9d..820ea68726 100644
--- a/src/components/SidebarThreadRow.tsx
+++ b/src/components/SidebarThreadRow.tsx
@@ -131,6 +131,7 @@ export function visibleSidebarThreads<T extends ThreadRowTask>(tasks: T[], activ
let open = 0;
return orderedThreadList(tasks).filter((task) => {
if (task.pinned === true) return true;
+ if (task.openedBy?.burstId) return task.threadId === activeId || demandsAttention(task, activeId);
if (isArchived(task)) return task.threadId === activeId;
return task.closedBy || isSnoozed(task)
? demandsAttention(task, activeId)
diff --git a/src/lib/composer-commands.test.ts b/src/lib/composer-commands.test.ts
index 291ef19af5..d640b9f4e5 100644
--- a/src/lib/composer-commands.test.ts
+++ b/src/lib/composer-commands.test.ts
@@ -6,8 +6,7 @@ import {
replaceComposerSlashTrigger,
skillSlashCommands,
slashCommandMatches,
- type ComposerSlashCommandId,
-} from "./composer-commands";
+ type ComposerSlashCommandId, builtInCommandText } from "./composer-commands";
import { enabledSlashSkills } from "./use-slash-skills";
describe("composer slash commands", () => {
@@ -117,3 +116,12 @@ describe("composer slash commands", () => {
expect(enabledSlashSkills(null)).toEqual([]);
});
});
+
+describe("burst", () => {
+ it("leaves /burst in the composer for the person to finish, and /goal only flips the mode", () => {
+ expect(builtInCommandText("burst")).toBe("/burst ");
+ expect(builtInCommandText("learn")).toBe("/learn ");
+ expect(builtInCommandText("setup")).toBe("/setup ");
+ expect(builtInCommandText("goal")).toBe("");
+ });
+});
diff --git a/src/lib/composer-commands.ts b/src/lib/composer-commands.ts
index 0cbb1022ad..cc7fe82147 100644
--- a/src/lib/composer-commands.ts
+++ b/src/lib/composer-commands.ts
@@ -1,6 +1,6 @@
import { blankCode, offersSkillCommand } from "../../shared/skill-command";
-export type ComposerSlashCommandId = "goal" | "learn" | "setup";
+export type ComposerSlashCommandId = "goal" | "learn" | "setup" | "burst";
export type ComposerSlashCommand =
| { kind: "command"; id: ComposerSlashCommandId; label: `/${ComposerSlashCommandId}`; description: string }
@@ -44,6 +44,11 @@ export function goalTextFromComposer(text: string): string | null {
return match ? (match[1] ?? "").trimStart() : null;
}
+/** The text a picked built-in leaves in the composer; /goal only flips the composer's mode. */
+export function builtInCommandText(id: ComposerSlashCommandId): string {
+ return id === "goal" ? "" : `/${id} `;
+}
+
export function replaceComposerSlashTrigger(
text: string,
trigger: ComposerSlashTrigger,
diff --git a/src/lib/taskTimeline.ts b/src/lib/taskTimeline.ts
index c45398f784..23658d2e1a 100644
--- a/src/lib/taskTimeline.ts
+++ b/src/lib/taskTimeline.ts
@@ -5,7 +5,7 @@ import { redactSecretsInText } from "../../shared/redact.js";
export interface TimelineMessage {
id: string;
role: "bot" | "user";
- kind: "text" | "options" | "activity" | "screen" | "connector" | "secret" | "signin" | "routine.run" | "goal.run" | "digest" | "compaction" | "call" | "widget" | "app";
+ kind: "text" | "options" | "activity" | "screen" | "connector" | "secret" | "signin" | "routine.run" | "goal.run" | "burst" | "digest" | "compaction" | "call" | "widget" | "app";
text?: string;
tool?: { name: string; summary?: string; ok?: boolean };
png?: string;
diff --git a/src/locales/en.json b/src/locales/en.json
index 1354da1a07..b2879fcad8 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -2820,6 +2820,39 @@
"composer.command.goalBotDesc": "Keep this bot working until the goal is complete",
"composer.command.learnDesc": "Draft a reusable skill from this conversation",
"composer.command.setupDesc": "Have this bot interview you and set itself up",
+ "composer.command.burstDesc": "Run many parts of a job at once, then merge the results",
+ "burst.title": "Burst: {task}",
+ "burst.plan": "{count} tasks · {model} · {parallel} at once · about {minutes} min",
+ "burst.moreItems": "+{count} more",
+ "burst.limitCut": "{total} of the {requested} tasks will run: this plan runs up to {limit} per burst.",
+ "burst.morePlan": "Pro runs more at once.",
+ "burst.run": "Run",
+ "burst.edit": "Edit",
+ "burst.cancel": "Cancel",
+ "burst.progress": "{done} of {total} done",
+ "burst.running": "{count} running",
+ "burst.failed": "{count} failed",
+ "burst.waiting": "{count} waiting",
+ "burst.phase.merging": "Writing one result…",
+ "burst.phase.done": "Done",
+ "burst.phase.cancelled": "Cancelled",
+ "burst.retryFailed": "Retry failed",
+ "burst.cancelAll": "Cancel all",
+ "burst.showTasks": "Show tasks",
+ "burst.hideTasks": "Hide tasks",
+ "burst.notFinished": "Not finished: {names}",
+ "burst.notFinishedMore": "Not finished: {names}, and {count} more",
+ "burst.editInstructions": "Instructions every task gets",
+ "burst.editItems": "One task per line",
+ "burst.save": "Save",
+ "burst.back": "Back",
+ "burst.statusLabel": "Burst: {status}",
+ "burst.status.queued": "Waiting",
+ "burst.status.running": "Running",
+ "burst.status.done": "Done",
+ "burst.status.failed": "Failed",
+ "burst.status.cancelled": "Cancelled",
+ "burst.error.action": "That didn't work. Try again in a moment.",
"composer.command.skillTag": "skill",
"composer.busy.team": "The team",
"composer.busy.aBot": "A bot",
diff --git a/src/locales/pt-br.json b/src/locales/pt-br.json
index 3cc07ce43b..825cbbf725 100644
--- a/src/locales/pt-br.json
+++ b/src/locales/pt-br.json
@@ -2691,6 +2691,39 @@
"composer.command.goalBotDesc": "Manter este bot trabalhando até concluir o objetivo",
"composer.command.learnDesc": "Rascunhar uma habilidade reutilizável a partir desta conversa",
"composer.command.setupDesc": "Pedir a este bot que entreviste você e se configure sozinho",
+ "composer.command.burstDesc": "Executar muitas partes de um trabalho ao mesmo tempo e juntar os resultados",
+ "burst.title": "Burst: {task}",
+ "burst.plan": "{count} tarefas · {model} · {parallel} ao mesmo tempo · cerca de {minutes} min",
+ "burst.moreItems": "+{count} a mais",
+ "burst.limitCut": "{total} das {requested} tarefas serão executadas: este plano executa até {limit} por burst.",
+ "burst.morePlan": "O Pro executa mais ao mesmo tempo.",
+ "burst.run": "Executar",
+ "burst.edit": "Editar",
+ "burst.cancel": "Cancelar",
+ "burst.progress": "{done} de {total} concluídas",
+ "burst.running": "{count} em execução",
+ "burst.failed": "{count} com falha",
+ "burst.waiting": "{count} na fila",
+ "burst.phase.merging": "Escrevendo um único resultado…",
+ "burst.phase.done": "Concluído",
+ "burst.phase.cancelled": "Cancelado",
+ "burst.retryFailed": "Tentar novamente as que falharam",
+ "burst.cancelAll": "Cancelar tudo",
+ "burst.showTasks": "Mostrar tarefas",
+ "burst.hideTasks": "Ocultar tarefas",
+ "burst.notFinished": "Não concluídas: {names}",
+ "burst.notFinishedMore": "Não concluídas: {names} e mais {count}",
+ "burst.editInstructions": "Instruções que cada tarefa recebe",
+ "burst.editItems": "Uma tarefa por linha",
+ "burst.save": "Salvar",
+ "burst.back": "Voltar",
+ "burst.statusLabel": "Burst: {status}",
+ "burst.status.queued": "Na fila",
+ "burst.status.running": "Em execução",
+ "burst.status.done": "Concluída",
+ "burst.status.failed": "Com falha",
+ "burst.status.cancelled": "Cancelada",
+ "burst.error.action": "Não deu certo. Tente de novo em instantes.",
"composer.command.skillTag": "habilidade",
"composer.busy.team": "A equipe",
"composer.busy.aBot": "Um bot",
diff --git a/src/state/store.tsx b/src/state/store.tsx
index f45cebd9f5..15a424a1dd 100644
--- a/src/state/store.tsx
+++ b/src/state/store.tsx
@@ -43,7 +43,7 @@ import type { ProfileRequestCardData } from "../../shared/profile-request";
import type { ModelRequestCardData } from "../../shared/model-request";
import type { RoutineRequestCardData } from "../../shared/routine-request";
import type { RoutineRunCardData } from "../../shared/routine-run";
-import type { GroupGoalRunCardData } from "../../shared/group-goal-run";
+import type { GroupGoalRunCardData } from "../../shared/group-goal-run"; import type { BurstCardData } from "../../shared/burst";
import type { PlaceRow } from "../../shared/place-view";
import {
reviewedSkillSha256,
@@ -120,7 +120,7 @@ export type ComputerControlState = { held: boolean; helpReason: string | null; h
export interface Message extends Pick<import("../../shared/wire").WireMessage, "widget" | "app" | "fromApp" | "pointed" | "routedBy" | "quickModel" | "automation" | "publishedPage" | "sender" | "setupSuggestion" | "helperIntro" | "helperFollowup" | "setupOffer" | "savedSteps" | "setupChoices" | "setupChoicesPending" | "setupChoicesUpdating" | "setupRequest" | "relay" | "inbox" | "sentDirectly" | "doneWhen" | "bugReport"> {
id: string;
role: "bot" | "user";
- kind: "text" | "options" | "activity" | "screen" | "connector" | "secret" | "signin" | "routine.run" | "goal.run" | "digest" | "compaction" | "call" | "widget" | "app";
+ kind: "text" | "options" | "activity" | "screen" | "connector" | "secret" | "signin" | "routine.run" | "goal.run" | "burst" | "digest" | "compaction" | "call" | "widget" | "app";
text?: string;
digest?: TurnDigest;
compaction?: import("../../shared/wire").WireMessage["compaction"];
@@ -130,7 +130,7 @@ export interface Message extends Pick<import("../../shared/wire").WireMessage, "
secret?: SecretRequestCardData;
signIn?: import("../../shared/wire").SignInRequestCardData;
routineRun?: RoutineRunCardData;
- goalRun?: GroupGoalRunCardData;
+ goalRun?: GroupGoalRunCardData; burst?: BurstCardData;
call?: import("../../shared/wire").LiveCallRecord;
channelMode?: "chat" | "goal";
tool?: { name: string; ok?: boolean; spoken?: string; setup?: boolean; claudeUpdate?: boolean; place?: PlaceRow; limitResetsAt?: number; partial?: boolean; summary?: string; input?: string; output?: string ; itemId?: string; outputPath?: string; fullResult?: boolean; clipped?: boolean; nameCode?: string; nameParams?: Record<string, string | number>; summaryCode?: string; summaryParams?: Record<string, string | number>; rescue?: import("../../shared/first-reply-rescue").FirstReplyRescue; step?: import("../../shared/turn-progress").LiveStep; whose?: { person: string; app: string }; label?: string };
@@ -252,7 +252,7 @@ export interface ThreadOpener {
botId: string;
name: string;
delegationId?: string;
- at: number;
+ at: number; burstId?: string;
}
export interface ThreadCloser {