An autopilot per thread continues the user's order run after run, with no time limit. Each run reports a checkpoint; after three runs without progress or three failed runs it pauses with Continue and Stop. Start, pause, stop and finish show as quiet lines in the conversation. Approvals during an autopilot run are parked as suggestions, and the temporary approval rules end with the autopilot. Claude-Session: https://claude.ai/code/session_01UmSCnoCgXqBp2fU3vwz4o1 Co-authored-by: Claude <noreply@anthropic.com>
33 lines
1018 B
TypeScript
33 lines
1018 B
TypeScript
import type { MessageBlock } from "@rakazo/contracts";
|
|
import { isToolActivityBlock } from "@rakazo/core";
|
|
|
|
export function isCenteredAgentEvent(blocks: readonly MessageBlock[]): boolean {
|
|
return blocks.some(
|
|
(block) =>
|
|
block.kind === "handoff" ||
|
|
block.kind === "bot_message_sent" ||
|
|
block.kind === "bot_message_received" ||
|
|
block.kind === "channel_message" ||
|
|
block.kind === "event" ||
|
|
block.kind === "autopilot",
|
|
);
|
|
}
|
|
|
|
export type MessagePresentationSegment = {
|
|
kind: "content";
|
|
blocks: MessageBlock[];
|
|
};
|
|
|
|
export function messagePresentationSegments(
|
|
blocks: readonly MessageBlock[],
|
|
): MessagePresentationSegment[] {
|
|
const content = blocks.filter(
|
|
(block) => block.kind !== "app_connect" && !isToolActivityBlock(block),
|
|
);
|
|
return content.length > 0 ? [{ kind: "content", blocks: content }] : [];
|
|
}
|
|
|
|
export function hasVisibleMessagePresentation(blocks: readonly MessageBlock[]): boolean {
|
|
return blocks.some((block) => !isToolActivityBlock(block));
|
|
}
|