feat: compose continuous authoring workspace

This commit is contained in:
lda
2026-07-11 07:04:00 +07:00 Verified
parent b5f8ae0c5e
commit c76be621d9
13 changed files with 155 additions and 497 deletions
@@ -1,7 +1,4 @@
import { useMemo } from "react";
import { agentTextMessage } from "../../demo/agent/events.js";
import { AssistantOperatorThread } from "../chat/AssistantOperatorThread.js";
import { projectPreparedAuthoring } from "./authoring-recording.js";
import { AuthoringConversation } from "./AuthoringConversation.js";
import type { SceneBeatDefinition, SceneDefinition } from "../storyboard.js";
type AgentHandoffSceneProps = {
@@ -9,11 +6,6 @@ type AgentHandoffSceneProps = {
readonly beat: SceneBeatDefinition;
};
const requestMessages = [
agentTextMessage("handoff-user-1", "user", "We need to prepare a report workflow for the lda_report scenario. Use the available CLI tools to inspect, author, and deploy it."),
agentTextMessage("handoff-assistant-1", "assistant", "Let me inspect the available sources, capabilities, and schemas first."),
];
/**
* Full-screen prepared-authoring conversation for Scene 8.
*
@@ -23,28 +15,13 @@ const requestMessages = [
* prepared recording, not a live agent interaction.
*/
export const AgentHandoffScene = ({ beat }: AgentHandoffSceneProps) => {
const messages = useMemo(() => {
if (beat.id === "handoff") {
const recording = projectPreparedAuthoring();
const result: ReturnType<typeof agentTextMessage>[] = [];
let index = 0;
for (const phase of recording) {
for (const turn of phase.conversation) {
result.push(
agentTextMessage(`msg-${index++}`, turn.role, turn.text),
);
}
}
return result;
}
return requestMessages;
}, [beat.id]);
const phase = beat.id === "handoff" ? "deployment" : "discover";
return (
<AssistantOperatorThread
mode="full"
messages={messages}
ariaLabel="prepared authoring conversation"
<AuthoringConversation
throughPhase={phase}
activePhase={phase}
surface="stage"
/>
);
};