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
40 lines
1.3 KiB
TypeScript
40 lines
1.3 KiB
TypeScript
import { useMemo } from "react";
|
|
import { translate } from "../../../i18n";
|
|
import type { AgentTranscriptEditRetryControl } from "../../../shared/agentConversation/components/useAgentTranscriptEditRetryProjection";
|
|
import { useAgentGUIEditRetryController } from "../controller/useAgentGUIEditRetryController";
|
|
|
|
export function useAgentGUIDetailEditRetry(input: {
|
|
agentSessionId: string | null;
|
|
workspaceId: string;
|
|
}) {
|
|
const controller = useAgentGUIEditRetryController(input);
|
|
const control = useMemo<AgentTranscriptEditRetryControl | undefined>(() => {
|
|
const eligibleTurnId = controller.presentation.editableTurnId?.trim() ?? "";
|
|
if (!eligibleTurnId) {
|
|
return undefined;
|
|
}
|
|
return {
|
|
agentSessionId: input.agentSessionId ?? "",
|
|
eligibleTurnId,
|
|
pending: controller.presentation.state === "processing",
|
|
labels: {
|
|
edit: translate("agentHost.agentGui.editRetryEditMessage"),
|
|
cancel: translate("agentHost.agentGui.editRetryCancel"),
|
|
submit: translate("agentHost.agentGui.send")
|
|
},
|
|
onSubmit: controller.submit
|
|
};
|
|
}, [
|
|
controller.presentation.editableTurnId,
|
|
controller.presentation.state,
|
|
controller.submit,
|
|
input.agentSessionId
|
|
]);
|
|
|
|
return {
|
|
control,
|
|
presentation: controller.presentation,
|
|
recover: controller.recover
|
|
};
|
|
}
|