Files
agent-radar 2ed3415fb7
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
源码快照 @ 2026-09-01 (source-only, 剔除非源码素材)
2026-09-01 20:17:27 +08:00

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
)
);
}