A reply that ran in Plan mode now records bot_messages.plan_mode (from the job's params) and shows a Turn Plan mode off button under it while the conversation is still in the mode: one click turns it off and puts "Plan mode is off, go ahead." in the composer, never sending it. The planning prompt, the tool gate's refusal and the file-escape review fault now point at that button, so a bot says what it will do once the mode is off instead of handing the work back to the user to paste.
15 lines
555 B
TypeScript
15 lines
555 B
TypeScript
import type { BUN_SQLITE_COBBLE_BOTS_QUEUE } from "@/db/types/db";
|
|
import parseJobJson from "@/src/bots-queue/parse-job-json";
|
|
|
|
type Params = {
|
|
job: Pick<BUN_SQLITE_COBBLE_BOTS_QUEUE, "params">;
|
|
};
|
|
|
|
/**
|
|
* The reply behind a job ran in Plan mode (`params.plan_mode`, set from the
|
|
* user's message or a card asked in it). Its answer is recorded with the
|
|
* flag, so the thread can offer to leave the mode under it.
|
|
*/
|
|
export default function jobPlanMode({ job }: Params): boolean {
|
|
return Boolean(parseJobJson({ text: job.params })?.plan_mode);
|
|
} |