Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import type { AgentMessageContentVM } from "../contracts/agentMessageRowVM";
|
|
import type { AgentTranscriptPresentationKind } from "../contracts/agentTranscriptPresentation";
|
|
import type { AgentTranscriptRowVM } from "../contracts/agentTranscriptRowVM";
|
|
|
|
type AgentSystemNoticeVM = NonNullable<AgentMessageContentVM["systemNotice"]>;
|
|
|
|
export function resolveAgentTranscriptPresentationKind(
|
|
notice: Pick<AgentSystemNoticeVM, "command" | "commandStatus"> | null
|
|
): AgentTranscriptPresentationKind {
|
|
if (notice?.command !== "compact") {
|
|
return "content";
|
|
}
|
|
if (notice.commandStatus === "running") {
|
|
return "specific-progress";
|
|
}
|
|
if (
|
|
notice.commandStatus === "completed" ||
|
|
notice.commandStatus === "failed" ||
|
|
notice.commandStatus === "canceled"
|
|
) {
|
|
return "turn-boundary";
|
|
}
|
|
return "content";
|
|
}
|
|
|
|
export function agentTranscriptRowHasPresentationKind(
|
|
row: AgentTranscriptRowVM | undefined,
|
|
presentationKind: AgentTranscriptPresentationKind
|
|
): boolean {
|
|
return Boolean(
|
|
row?.kind === "message" &&
|
|
row.messages.some(
|
|
(message) => message.presentationKind === presentationKind
|
|
)
|
|
);
|
|
}
|