From 8be6c946f90efc8c1db806aaafd125e8a4979050 Mon Sep 17 00:00:00 2001 From: David McKay Date: Thu, 3 Dec 2026 07:47:30 -0800 Subject: [PATCH] Any Bot can send the person a file it made, with its contents A connected Bot that works on its own machine had no way to hand the person a file: computer_send_file reads a path on the Bot's OpenBot computer, and is offered only with that computer. The Bot said it had no file-attachment channel and told the person to pick the file up from a path on its machine. send_file carries the file's name and contents (text, or base64), and every Bot holds it on every run. The server answers it, checks the bytes as it checks an upload, and answers in the shape computer_send_file does, so the conversation draws the same file card, live and after a reload. This adds the shared name, description and prompt lines, the tool's words, and the card's renderer. --- .../components/channels/chat-transcript.tsx | 5 +- app/src/components/tasks/turn-work.ts | 4 +- app/src/lib/computers/sent-file.ts | 3 +- app/src/lib/copilot/provider.tsx | 3 + app/src/lib/copilot/send-file-tool.tsx | 91 +++++++++++ app/src/lib/markdown.tsx | 3 +- app/tests/send-file-tool.test.tsx | 154 ++++++++++++++++++ shared/attachments.test.ts | 9 +- shared/bot-prompt.ts | 23 ++- shared/send-file.ts | 32 +++- shared/tests/artifacts-prompt.test.ts | 22 +++ shared/tool-name.ts | 8 + 12 files changed, 345 insertions(+), 12 deletions(-) create mode 100644 app/src/lib/copilot/send-file-tool.tsx create mode 100644 app/tests/send-file-tool.test.tsx diff --git a/app/src/components/channels/chat-transcript.tsx b/app/src/components/channels/chat-transcript.tsx index 0cfaad3aee..346576b317 100644 --- a/app/src/components/channels/chat-transcript.tsx +++ b/app/src/components/channels/chat-transcript.tsx @@ -17,7 +17,7 @@ import { } from "@openbot/shared/generate-image"; import { answeredBy } from "@openbot/shared/handoff-markers"; import { readBrief, readTaskReport } from "@openbot/shared/orchestration"; -import { SEND_FILE_TOOL } from "@openbot/shared/send-file"; +import { isSendFileTool } from "@openbot/shared/send-file"; import { SUBAGENT_TOOL } from "@openbot/shared/subagent"; import { answersTheModel, @@ -2720,7 +2720,8 @@ export function ChatTranscript({ const made = parseGenerateImageResult(item.result); return made?.ok ? [{ name: made.image.name, url: made.image.url }] : []; } - if (item.toolCall.function.name !== SEND_FILE_TOOL) return []; + // A file from the Bot's computer, or one it sent with its contents: the same answer. + if (!isSendFileTool(item.toolCall.function.name)) return []; const file = sentFileOf(readOutcome(item.result)); return file ? [{ name: file.name, url: file.url }] : []; }); diff --git a/app/src/components/tasks/turn-work.ts b/app/src/components/tasks/turn-work.ts index 221d92c0d1..b0ba5afd2f 100644 --- a/app/src/components/tasks/turn-work.ts +++ b/app/src/components/tasks/turn-work.ts @@ -1,4 +1,4 @@ -import { SEND_FILE_TOOL } from "@openbot/shared/send-file"; +import { isSendFileTool } from "@openbot/shared/send-file"; import { SUBAGENT_TOOL } from "@openbot/shared/subagent"; import { isPlanStep } from "@/components/channels/plan-turns"; import { @@ -64,7 +64,7 @@ export const NO_TURN_WORK: TurnWorkFolds = { at: new Map(), inside: new Set() }; function isWorkStep(item: Extract): boolean { if (item.result === undefined || asksThePerson(item.result)) return false; const { name, arguments: args } = item.toolCall.function; - if (name === SEND_FILE_TOOL && sentFileOf(readOutcome(item.result))) + if (isSendFileTool(name) && sentFileOf(readOutcome(item.result))) return false; if (name.startsWith("mcp__") || name === SUBAGENT_TOOL) return true; // A Bot's plan is how the work went, folded with it once the answer is in. diff --git a/app/src/lib/computers/sent-file.ts b/app/src/lib/computers/sent-file.ts index 038d5a87b4..37ca68ba27 100644 --- a/app/src/lib/computers/sent-file.ts +++ b/app/src/lib/computers/sent-file.ts @@ -3,7 +3,8 @@ import { acceptedFileTypeOf } from "@openbot/shared/attachments"; /** * A file a Bot sent from its computer into the conversation, as its tool call's answer carries it. * - * `computer_send_file` answers `{ ok: true, file: { attachmentId, name, mimeType, sizeBytes, url } }`. + * `computer_send_file` answers `{ ok: true, file: { attachmentId, name, mimeType, sizeBytes, url } }`, + * and so does `send_file`, which carries a file's contents from wherever the Bot made it. * The server stored the file as an attachment of the conversation, so the card reads everything it * draws from this answer: a reopened conversation shows the same card from the stored answer alone, * and every member of the conversation reads the file from the same address. diff --git a/app/src/lib/copilot/provider.tsx b/app/src/lib/copilot/provider.tsx index b4760d2a18..81029f0ec9 100644 --- a/app/src/lib/copilot/provider.tsx +++ b/app/src/lib/copilot/provider.tsx @@ -30,6 +30,7 @@ import { MemoryTools } from "./memory-tool"; import { OrchestrationTools } from "./orchestration-tools"; import { PlanTool } from "./plan-tool"; import { SandboxedTools } from "./sandboxed-tools"; +import { SendFileTool } from "./send-file-tool"; import { SignInTool } from "./sign-in-tool"; import { SkillTools } from "./skill-tools"; @@ -112,6 +113,8 @@ export function CopilotProvider({ children }: { children: ReactNode }) { {/* A Bot making a picture: its card, from the call and its stored answer. Runs on the server. */} + {/* A Bot sending a file with its contents: the file's card, from its stored answer. Server-run. */} + {/* A Bot's checklist of a long job, open while it runs. Answered on the server. */} {/* A Bot reading, answering and resolving comments on an artifact. Runs on the server. */} diff --git a/app/src/lib/copilot/send-file-tool.tsx b/app/src/lib/copilot/send-file-tool.tsx new file mode 100644 index 0000000000..fff506efe8 --- /dev/null +++ b/app/src/lib/copilot/send-file-tool.tsx @@ -0,0 +1,91 @@ +import { useRenderTool } from "@copilotkit/react-core/v2"; +import { outcomeForPerson } from "@openbot/shared/approval-outcomes"; +import { SEND_FILE_CONTENTS_TOOL } from "@openbot/shared/send-file"; +import { useContext } from "react"; +import { z } from "zod"; +import { SentFileCard } from "@/components/channels/sent-file-card"; +import { ToolLine } from "@/components/channels/tool-line"; +import { TurnInFlightContext } from "@/components/gallery/streaming"; +import { readOutcome } from "@/lib/computers/activity"; +import { sentFileOf } from "@/lib/computers/sent-file"; + +/** + * How a Bot sending a file with its contents (`send_file`) reads in the conversation: the same file + * card a file from the Bot's computer draws (`SentFileCard`), from the stored answer, so a reload + * draws the same card. + * + * RENDER ONLY. `send_file` runs on the server for every Bot, built-in or connected over AG-UI, which + * checks the bytes as it checks an upload, stores them as a file of the conversation and answers with + * it. Nothing here registers a tool or decides anything. + * + * NEVER THE CONTENTS. The arguments carry the whole file while they stream; the line names the file + * and nothing else. + */ +const parameters = z.object({ + name: z.string().optional(), + content: z.string().optional(), + encoding: z.string().optional(), +}); + +/** One call, as its card or its line. A component, so it can read whether its turn is running. */ +export function SendFileCall({ + name, + result, +}: { + name?: string; + result?: unknown; +}) { + const turnRunning = useContext(TurnInFlightContext); + const outcome = readOutcome(result); + const sent = sentFileOf(outcome); + if (sent) return ; + const answered = outcome !== null; + const refused = outcome?.refused === true; + const failed = answered && outcome?.ok === false && !refused; + const reason = outcomeForPerson(String(outcome?.reason ?? "")); + return ( + + ); +} + +export function SendFileTool() { + useRenderTool({ + name: SEND_FILE_CONTENTS_TOOL, + parameters, + render: ({ parameters: given, result }) => ( + + ), + }); + return null; +} + +/** + * The file's name from the call's arguments, once it is whole text. While they stream they are + * anything (see `argumentsSoFar` in generate-image-tool.tsx), and the contents are never read here. + */ +export function nameSoFar(given: unknown): string | undefined { + if (!given || typeof given !== "object" || Array.isArray(given)) + return undefined; + const { name } = given as Record; + if (typeof name !== "string" || !name.trim()) return undefined; + return name.trim().split(/[\\/]/).pop() || undefined; +} diff --git a/app/src/lib/markdown.tsx b/app/src/lib/markdown.tsx index 12dc3d6b02..e461776ebc 100644 --- a/app/src/lib/markdown.tsx +++ b/app/src/lib/markdown.tsx @@ -189,7 +189,8 @@ export type LinkedFile = { name: string; url: string }; const NO_FILES: readonly LinkedFile[] = []; /** - * The files a conversation was sent (a Bot's `computer_send_file` answers), for the Bot's words that + * The files a conversation was sent (a Bot's `computer_send_file` and `send_file` answers, and its + * pictures), for the Bot's words that * link one of them. The transcript provides it; a surface with no conversation has none. */ export const SentFilesContext = createContext(NO_FILES); diff --git a/app/tests/send-file-tool.test.tsx b/app/tests/send-file-tool.test.tsx new file mode 100644 index 0000000000..6a233d6e1c --- /dev/null +++ b/app/tests/send-file-tool.test.tsx @@ -0,0 +1,154 @@ +import { afterAll, afterEach, beforeAll, expect, test } from "bun:test"; +import { CopilotKitProvider } from "@copilotkit/react-core/v2"; +import { GlobalRegistrator } from "@happy-dom/global-registrator"; +import { SEND_FILE_CONTENTS_TOOL } from "@openbot/shared/send-file"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { + createMemoryHistory, + createRootRoute, + createRouter, + RouterProvider, +} from "@tanstack/react-router"; +import { cleanup, render, within } from "@testing-library/react"; +import { HttpResponse, http } from "msw"; +import { setupServer } from "msw/node"; +import { ChatTranscript } from "@/components/channels/chat-transcript"; +import { attachmentAddress } from "@/lib/channels/attachments"; +import { SendFileTool } from "@/lib/copilot/send-file-tool"; +import { readableTurns } from "@/lib/copilot/thread-messages"; +import { settleReactWork } from "./settle-react-work"; + +/** + * A file a Bot sent with its contents (`send_file`), as the conversation draws it, live and after a + * reload: the same card a file from the Bot's computer draws. + * + * Found by a customer's connected Bot, which works on its own machine: it had no way to hand the + * person a file, and told them to pick it up from a path there. The server now answers `send_file` + * for every Bot in the shape `computer_send_file` answers, and the app draws it. + * + * Every conversation here is read the way a reopened one is: turns in the history store's own + * dialect, through `readableTurns`, into the app's transcript with the renderer the app registers. + * The server is faked at the HTTP boundary only, answering an attachment's address as the real one + * does. + */ + +const FILE = "9d2f7a41-3c1b-4e55-a0d8-6b7c8e9f0a12"; +const NOTES = "# Offsite notes\n\n- Book the venue\n- Send the agenda\n"; + +const server = setupServer( + http.head( + "*/api/v2/organizations/:organizationId/attachments/:id", + () => new HttpResponse(null, { status: 200 }), + ), + http.all("*", () => new HttpResponse(null, { status: 404 })), +); + +beforeAll(() => { + GlobalRegistrator.register({ url: "http://localhost/" }); + server.listen({ onUnhandledRequest: "bypass" }); +}); +afterEach(() => { + cleanup(); + server.resetHandlers(); +}); +afterAll(async () => { + server.close(); + await settleReactWork(); + GlobalRegistrator.unregister(); +}); + +/** A conversation in which the person asked for notes and the Bot sent them with `send_file`. */ +function storedThread(args: Record, answer: unknown) { + return [ + { id: "u1", role: "user", content: "Write up the offsite notes for me" }, + { + id: "a1", + role: "assistant", + content: null, + toolCalls: [{ id: "call_send", name: SEND_FILE_CONTENTS_TOOL, args }], + }, + { + id: "r1", + role: "tool", + toolCallId: "call_send", + content: JSON.stringify(answer), + }, + { id: "a2", role: "assistant", content: "Here are the notes." }, + ]; +} + +function draw(stored: unknown[]) { + const { messages, unreadable } = readableTurns(stored); + expect(unreadable).toBe(0); + const client = new QueryClient({ + defaultOptions: { queries: { retry: false } }, + }); + const rootRoute = createRootRoute({ + component: () => ( + + + + + ), + }); + const router = createRouter({ + routeTree: rootRoute, + history: createMemoryHistory({ initialEntries: ["/"] }), + }); + return render( + + + , + ); +} + +test("a file a Bot sent with its contents is a card that downloads the stored file, now and on reload, and never shows the contents", async () => { + const answer = { + ok: true, + file: { + attachmentId: FILE, + name: "offsite-notes.md", + mimeType: "text/markdown", + sizeBytes: 54, + url: `/api/attachments/${FILE}`, + }, + }; + // A reload draws from the stored thread, which is this same list: drawn twice, from scratch. + for (let pass = 0; pass < 2; pass += 1) { + const view = draw( + storedThread({ name: "offsite-notes.md", content: NOTES }, answer), + ); + const card = within( + await view.findByRole("figure", { + name: "File from the Bot: offsite-notes.md", + }), + ); + expect(card.getByText("Markdown · 54 bytes")).toBeTruthy(); + const download = card.getByRole("button", { + name: "Download offsite-notes.md", + }); + expect(download.getAttribute("href")).toBe( + attachmentAddress(`/api/attachments/${FILE}`), + ); + expect(download.getAttribute("download")).toBe("offsite-notes.md"); + // The arguments carried the whole file; none of it is drawn. + expect(view.container.textContent).not.toContain("Book the venue"); + cleanup(); + } +}); + +test("a file that was refused is one line with the server's reason, and no card", async () => { + const reason = + "setup.exe can't be sent. Bots can send images (PNG, JPEG, GIF, WebP), PDFs, and text, Markdown, CSV or JSON files."; + const view = draw( + storedThread( + { name: "setup.exe", content: "TVqQAAMAAAAEAAAA", encoding: "base64" }, + { ok: false, refused: true, reason }, + ), + ); + expect(await view.findByText("Blocked: Send a file")).toBeTruthy(); + // The sentence names the file, so the line does not say the name twice. + expect(view.getByText(reason)).toBeTruthy(); + expect(view.queryByRole("figure")).toBeNull(); + expect(view.queryByRole("button", { name: /Download/ })).toBeNull(); +}); diff --git a/shared/attachments.test.ts b/shared/attachments.test.ts index 658d40212f..b12f54f356 100644 --- a/shared/attachments.test.ts +++ b/shared/attachments.test.ts @@ -18,7 +18,11 @@ import { officeFileTypeOfMainPart, shouldClaimPaste, } from "./attachments"; -import { SEND_FILE_TOOL_DESCRIPTION, sendFileUnsupported } from "./send-file"; +import { + SEND_FILE_CONTENTS_TOOL_DESCRIPTION, + SEND_FILE_TOOL_DESCRIPTION, + sendFileUnsupported, +} from "./send-file"; /** * TODAY'S SET OF FILES, PINNED. A person attaches and a Bot sends from this one list, so a change to @@ -162,6 +166,9 @@ describe("the one list of files OpenBot takes", () => { "images (PNG, JPEG, GIF, WebP), PDFs, Word documents, Excel workbooks, PowerPoint presentations, and text, Markdown, CSV or JSON files"; expect(acceptedFilesInWords()).toBe(words); expect(SEND_FILE_TOOL_DESCRIPTION).toContain(`You can send ${words};`); + expect(SEND_FILE_CONTENTS_TOOL_DESCRIPTION).toContain( + `You can send ${words};`, + ); expect(sendFileUnsupported("tool.bin")).toBe( `tool.bin can't be sent. Bots can send ${words}.`, ); diff --git a/shared/bot-prompt.ts b/shared/bot-prompt.ts index ff7a63a8a2..379294d36d 100644 --- a/shared/bot-prompt.ts +++ b/shared/bot-prompt.ts @@ -13,7 +13,7 @@ import { PAGE_API_GUIDE } from "./artifacts/page-api-guide"; import { ARTIFACT_CREATE_TOOL } from "./artifacts/tools"; import { SHOW_APP_ACCESS_TOOL } from "./connect-prompt"; import { DELEGATE_TOOL, DELEGATING_GUIDANCE } from "./orchestration"; -import { SEND_FILE_TOOL } from "./send-file"; +import { SEND_FILE_CONTENTS_TOOL, SEND_FILE_TOOL } from "./send-file"; import { SUBAGENT_TOOL } from "./subagent"; const OPENING_A_PAGE_LINES = [ @@ -383,9 +383,21 @@ const SEND_FILE_LINES = [ "conversation.", ]; +/** + * Sending a file made anywhere else, with its contents (`send_file`). Every Bot holds it. Found by a + * customer's connected Bot, which made a report on its own machine and told the person to pick it up + * from a path there. + */ +const SEND_CONTENTS_LINES = [ + "The person cannot open any path on your machine. When you make a file for them anywhere OpenBot", + "can't reach, or write one out yourself, call send_file with its name and contents so it arrives in", + "the conversation. Never tell them to pick a file up from a path.", +]; + /** * How a Bot delivers its work, in its own section ("artifacts") after how it answers, for a run that - * holds the artifact tools, the computer's send-file tool, or both. + * holds the artifact tools, the computer's send-file tool, the tool that sends a file's contents, or + * any of them together. * * EVERY BOT THAT HOLDS THEM, WHATEVER RUNS IT, keyed on the run's tools as `delegatingGuidance` is: a * built-in Bot and a connected AG-UI Bot are offered the same tools and told the same words, and a run @@ -397,7 +409,8 @@ export function artifactsGuidance( const holds = (name: string) => tools.some((tool) => tool.name === name); const artifacts = holds(ARTIFACT_CREATE_TOOL); const sends = holds(SEND_FILE_TOOL); - if (!artifacts && !sends) return []; + const sendsContents = holds(SEND_FILE_CONTENTS_TOOL); + if (!artifacts && !sends && !sendsContents) return []; return promptSection( "artifacts", [ @@ -405,8 +418,10 @@ export function artifactsGuidance( ...(artifacts ? [...ARTIFACT_LINES, "", ...fileLines(holds("computer_run_command"))] : []), - ...(artifacts && sends ? [""] : []), + ...(artifacts && (sends || sendsContents) ? [""] : []), ...(sends ? SEND_FILE_LINES : []), + ...(sends && sendsContents ? [""] : []), + ...(sendsContents ? SEND_CONTENTS_LINES : []), ]), // What a page can ask its viewer for (window.openbot), word for word as the page runtime // answers it, so a Bot writing a page knows it whatever runs the Bot. diff --git a/shared/send-file.ts b/shared/send-file.ts index e25ca5a482..2654596ffe 100644 --- a/shared/send-file.ts +++ b/shared/send-file.ts @@ -17,13 +17,43 @@ export const SEND_FILE_TOOL = "computer_send_file"; * What a Bot may send is what a person may attach: the one list in attachments.ts * (`ACCEPTED_FILE_TYPES`). The description and the refusal both say it from there. */ -export const SEND_FILE_TOOL_DESCRIPTION = `Send a file from your workspace to the person, into this conversation, where they and everyone in it can open and download it. Use this whenever you made a file for them (a chart, a report, a spreadsheet, a slide deck, a CSV, a PDF) instead of only saying where it is: they cannot reach your computer's files any other way. Give the path relative to your workspace, such as reports/august.pdf. You can send ${acceptedFilesInWords()}; anything else is refused. You are told whether it arrived. It shows in the conversation as a card with its own Download button; to link it in your words, link the url the answer gives, never its path on your computer, which nobody else can open.`; +export const SEND_FILE_TOOL_DESCRIPTION = `Send a file from your workspace to the person, into this conversation, where they and everyone in it can open and download it. Use this whenever you made a file for them (a chart, a report, a spreadsheet, a slide deck, a CSV, a PDF) instead of only saying where it is: they cannot reach your computer's files any other way. Give the path relative to your workspace, such as reports/august.pdf. You can send ${acceptedFilesInWords()}; anything else is refused. You are told whether it arrived. It shows in the conversation as a card with its own Download button; to link it in your words, link the url the answer gives, never its path on your computer, which nobody else can open. A file that isn't in your workspace goes with send_file instead, with its contents.`; + +/** + * A Bot sending a file it has the contents of, wherever it made it: its own machine, a connected + * Bot's sandbox, or text it wrote out. Every Bot holds it on every run, whether or not it has an + * OpenBot computer, and the server answers it: it stores the bytes exactly as it stores a file from + * the computer (the same types, limits and checks), and answers in the same shape, so the + * conversation draws the same card (app/src/lib/copilot/send-file-tool.tsx). + * + * WHY A SECOND TOOL, NOT A SECOND WAY TO CALL THE FIRST. `computer_send_file` names a path, and the + * server pulls that path through the computer's governed download; it is offered only with the + * computer. A Bot that works on its own machine has no such computer, and no path OpenBot can reach. + * Folded into one tool, its path would mean nothing for most of the Bots that hold it, and its + * offer could follow neither the computer nor every Bot. So the computer keeps its tool, and this one + * carries the bytes. + * + * Found by a customer's connected Bot, which said it had "no file-attachment channel" and told the + * person to pick the file up from a path on its machine. + */ +export const SEND_FILE_CONTENTS_TOOL = "send_file"; + +/** How the contents are written: the text itself, or base64 for anything that isn't text. */ +export const SEND_FILE_ENCODINGS = ["text", "base64"] as const; +export type SendFileEncoding = (typeof SEND_FILE_ENCODINGS)[number]; + +export const SEND_FILE_CONTENTS_TOOL_DESCRIPTION = `Send a file you made to the person, into this conversation, where they and everyone in it can open and download it. Give its name with its extension, such as report.md or chart.png, and its whole contents: the text itself for a text file (Markdown, plain text, CSV, JSON), or the bytes in base64 with encoding "base64" for anything else (a PDF, a picture, a spreadsheet, a slide deck). Use this whenever you made a file for them anywhere OpenBot can't reach, such as on your own machine, or wrote one out yourself: the person can't open any path on your machine, so never tell them to pick a file up from one. For a file in your OpenBot computer's workspace, use ${SEND_FILE_TOOL} with its path instead. You can send ${acceptedFilesInWords()}; anything else is refused, and so is a file over the size limit. You are told whether it arrived. It shows in the conversation as a card with its own Download button; to link it in your words, link the url the answer gives.`; /** What the person reads when a Bot tried to send a kind of file it can't. */ export function sendFileUnsupported(name: string): string { return `${name} can't be sent. Bots can send ${acceptedFilesInWords()}.`; } +/** The tools whose answer is a file the Bot sent, in the one shape the card reads. */ +export function isSendFileTool(name: string): boolean { + return name === SEND_FILE_TOOL || name === SEND_FILE_CONTENTS_TOOL; +} + /** What a surface with no conversation to send into answers. */ export const SEND_FILE_NO_CONVERSATION = "Files can only be sent in a conversation. Nothing was sent."; diff --git a/shared/tests/artifacts-prompt.test.ts b/shared/tests/artifacts-prompt.test.ts index 5efa8629b8..114986e0db 100644 --- a/shared/tests/artifacts-prompt.test.ts +++ b/shared/tests/artifacts-prompt.test.ts @@ -95,6 +95,28 @@ describe("artifacts first", () => { ); }); + /* + * A customer's connected Bot works on its own machine, with no OpenBot computer. It made a report + * there and told the person to pick it up from a path. Every Bot holds `send_file`, and every Bot + * that holds it is told to send a file it made with its contents, never to point at a path. + */ + test("a Bot with no OpenBot computer is told to send what it made with send_file, never to point at a path", () => { + const said = flat(artifactsGuidance([{ name: "send_file" }]).join(" ")); + expect(said).toStartWith(""); + expect(said).toContain("call send_file with its name and contents"); + expect(said).toContain("never tell them to pick a file up from a path"); + expect(said).not.toContain("computer_send_file"); + // With the computer too, both are said: the path for its workspace, the contents for the rest. + const both = flat( + artifactsGuidance([ + { name: "computer_send_file" }, + { name: "send_file" }, + ]).join(" "), + ); + expect(both).toContain("call computer_send_file with its path"); + expect(both).toContain("call send_file with its name and contents"); + }); + test("the working rules carry the section after how to answer, for the run's tools", () => { for (const brought of [false, true]) { const sections = workingGuidance({ diff --git a/shared/tool-name.ts b/shared/tool-name.ts index 610a4fdf4b..29677c4aac 100644 --- a/shared/tool-name.ts +++ b/shared/tool-name.ts @@ -32,6 +32,7 @@ import { UPDATE_PLAN_TOOL } from "./plan"; import { READ_RESULT_PART } from "./read-result-part"; import { RECALL_EARLIER_RESULTS } from "./recall-earlier-results"; import { RESEARCH_ROLE_LABELS, researchRoleOfTool } from "./research"; +import { SEND_FILE_CONTENTS_TOOL } from "./send-file"; import { SUBAGENT_TOOL } from "./subagent"; import { lowerFirst, nameInWords } from "./tool-name-words"; import { CALL_FOUND_TOOL, SEARCH_TOOLS } from "./tool-search"; @@ -1006,6 +1007,13 @@ const OWN_TOOLS: Record = { attempted: "Send a file", subject: "path", }, + // A file a Bot sent with its contents, from wherever it made it. Read as the computer's send is. + [SEND_FILE_CONTENTS_TOOL]: { + running: "Sending a file", + done: "Sent a file", + attempted: "Send a file", + failed: "Didn't send a file", + }, // A Bot's checklist of a long job. The app draws it as one (plan-tool.tsx); where it does not, a // line. Its answer is a note for the model. [UPDATE_PLAN_TOOL]: {