@oh-story/dsh 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/client/index.tsx", "../src/client/file-activity.ts", "../src/client/file-tree.ts", "../src/client/jsonl-preview.tsx", "../src/client/markdown-preview.tsx", "../src/client/drama-production.ts", "../src/client/drama-production-view.tsx", "../src/client/workbench-ui.ts", "../src/client/production-prompts.ts", "../src/client/production-runtime.ts", "../src/production-intent.ts", "../src/client/production-intents.ts", "../src/client/video-studio.tsx", "../src/client/workbench-presence.ts", "inline-css:/home/runner/work/oh-story-dsh/oh-story-dsh/packages/dsh-plugin/src/client/plugin.css"],
4
- "sourcesContent": ["import type { Context as ClientContext } from \"@deepseek-ai/cordis\";\nimport type { ISessions } from \"@deepseek-ai/dsh-api-session-controller/client\";\nimport { defineStore } from \"@deepseek-ai/dsh-client-store\";\nimport type { IConversation, PartialAssistant, RunningToolCall } from \"@deepseek-ai/dsh-client-ui-conversation/client\";\nimport type {} from \"@deepseek-ai/dsh-client-ui-chat/client\";\nimport type {} from \"@deepseek-ai/dsh-client-ui-layout/client\";\nimport type {} from \"@deepseek-ai/dsh-client-ui-renderer/client\";\nimport type {} from \"@deepseek-ai/dsh-client-ui-session/client\";\nimport type { PropsRenderSlots, PropsRuntime, PropsStore } from \"@deepseek-ai/dsh-client-ui-slots\";\nimport type { ToolCallViewProps } from \"@deepseek-ai/dsh-client-ui-tool/client\";\nimport { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport {\n creativeRelativePath,\n fileMutations,\n latestSettledMutation,\n mutatingCallIds,\n preferredWorkbenchFile,\n previewMutation,\n streamingAssistant,\n workbenchLabel,\n workbenchModeForPath,\n type WorkbenchMode\n} from \"./file-activity.js\";\nimport { buildFileTree, type FileTreeNode } from \"./file-tree.js\";\nimport { JsonlPreview } from \"./jsonl-preview.js\";\nimport { MarkdownPreview } from \"./markdown-preview.js\";\nimport {\n creatorDocumentPaths,\n episodeDirectoryForPath,\n isCreatorDocumentPath,\n parseEpisodeProduction,\n type DramaDocumentTarget,\n type DramaProductionSection\n} from \"./drama-production.js\";\nimport { DramaProductionView } from \"./drama-production-view.js\";\nimport { createPendingJob, type\n CanvasPoint,\n mediaTargetFromPath,\n type ProductionJob,\n type ProductionMediaVersion,\n type ProductionQueueEntry,\n type ProductionSequenceItem\n} from \"./production-runtime.js\";\nimport { settledProductionIntents, type SettledProductionIntent } from \"./production-intents.js\";\nimport { OH_STORY_PRODUCTION_TOOL_NAME } from \"../production-intent.js\";\nimport { VideoStudio, type VideoProject } from \"./video-studio.js\";\nimport {\n hasCreativeProject,\n readWorkbenchPreference,\n resolveWorkbenchOpen,\n workbenchPreferenceStorage,\n writeWorkbenchPreference,\n type WorkbenchPreference\n} from \"./workbench-presence.js\";\nimport { endpoint, handleTabKey } from \"./workbench-ui.js\";\nimport styles from \"./plugin.css?inline\";\n\nexport const name = \"oh-story\";\nexport const inject = [\"slots\", \"sessions\", \"conversation\"];\n\ndeclare module \"@deepseek-ai/dsh-client-ui-slots\" {\n interface SlotMap {\n \"oh-story.workspace\": { kind: \"single\"; scope: \"session\" };\n }\n}\n\ninterface WorkspaceFile {\n readonly path: string;\n readonly bytes: number;\n readonly version: string;\n readonly kind: \"text\" | \"media\";\n readonly mimeType?: string | undefined;\n}\ninterface WorkspacePayload {\n readonly cwd: string;\n readonly files: readonly WorkspaceFile[];\n readonly games: readonly GameProject[];\n readonly videos: readonly VideoProject[];\n readonly shortDrama: Record<string, unknown> | null;\n readonly metadataErrors: readonly string[];\n readonly mode: \"dsh-session\";\n}\ninterface GameProject {\n readonly id: string;\n readonly root: string;\n readonly title: string;\n readonly source: \"workspace\" | \"example\";\n readonly previewReady: boolean;\n readonly previewUrl?: string | undefined;\n readonly previewVersion: string;\n}\ninterface FilePayload {\n readonly path: string;\n readonly content: string;\n readonly bytes: number;\n readonly version: string;\n}\ninterface FileBuffer {\n readonly content: string;\n readonly saved: string;\n readonly source: \"disk\" | \"human\" | \"agent\";\n readonly version: string;\n readonly saving?: boolean | undefined;\n readonly error?: string | undefined;\n readonly missing?: boolean | undefined;\n readonly conflict?: {\n readonly message: string;\n readonly theirs?: string | undefined;\n readonly theirsVersion?: string | undefined;\n } | undefined;\n}\n\ninterface WorkbenchMemory {\n buffers: Record<string, FileBuffer>;\n workbenchPreference: WorkbenchPreference | undefined;\n editorMode: \"preview\" | \"source\" | \"production\";\n expanded: Record<string, boolean>;\n selected: string | undefined;\n workbench: WorkbenchMode;\n gameTab: \"preview\" | \"design\";\n gameProjectId: string | undefined;\n gamePane: \"studio\" | \"chat\";\n videoTab: \"preview\" | \"artifacts\";\n videoProjectId: string | undefined;\n videoPane: \"studio\" | \"chat\";\n productionSection: DramaProductionSection;\n productionSelectedIds: Record<string, string | undefined>;\n productionJobs: Record<string, ProductionJob[]>;\n productionSelections: Record<string, Record<string, string>>;\n productionReferences: Record<string, Record<string, string[]>>;\n productionSequence: Record<string, ProductionSequenceItem[]>;\n productionCanvas: Record<string, Record<string, CanvasPoint>>;\n productionZoom: Record<string, number>;\n productionIntentCalls: Record<string, boolean>;\n}\n\ntype Update<T> = T | ((current: T) => T);\n\nfunction applyUpdate<T>(current: T, update: Update<T>): T {\n return typeof update === \"function\" ? (update as (value: T) => T)(current) : update;\n}\n\nfunction createWorkbenchStore() {\n return defineStore({\n init: (): WorkbenchMemory => ({\n buffers: {},\n workbenchPreference: undefined,\n editorMode: \"preview\",\n expanded: {},\n selected: undefined,\n workbench: \"story\",\n gameTab: \"preview\",\n gameProjectId: undefined,\n gamePane: \"studio\",\n videoTab: \"preview\",\n videoProjectId: undefined,\n videoPane: \"studio\",\n productionSection: \"shots\",\n productionSelectedIds: {},\n productionJobs: {},\n productionSelections: {},\n productionReferences: {},\n productionSequence: {},\n productionCanvas: {},\n productionZoom: {},\n productionIntentCalls: {}\n }),\n actions: {\n setBuffers: (draft, update: Update<Record<string, FileBuffer>>) => {\n draft.buffers = applyUpdate(draft.buffers, update);\n },\n setWorkbenchPreference: (draft, update: Update<WorkbenchPreference | undefined>) => {\n draft.workbenchPreference = applyUpdate(draft.workbenchPreference, update);\n },\n setEditorMode: (draft, update: Update<WorkbenchMemory[\"editorMode\"]>) => {\n draft.editorMode = applyUpdate(draft.editorMode, update);\n },\n setExpanded: (draft, update: Update<Record<string, boolean>>) => {\n draft.expanded = applyUpdate(draft.expanded, update);\n },\n setSelected: (draft, update: Update<string | undefined>) => {\n draft.selected = applyUpdate(draft.selected, update);\n },\n setWorkbench: (draft, update: Update<WorkbenchMode>) => {\n draft.workbench = applyUpdate(draft.workbench, update);\n },\n setGameTab: (draft, update: Update<WorkbenchMemory[\"gameTab\"]>) => {\n draft.gameTab = applyUpdate(draft.gameTab, update);\n },\n setGameProjectId: (draft, update: Update<string | undefined>) => {\n draft.gameProjectId = applyUpdate(draft.gameProjectId, update);\n },\n setGamePane: (draft, update: Update<WorkbenchMemory[\"gamePane\"]>) => {\n draft.gamePane = applyUpdate(draft.gamePane, update);\n },\n setVideoTab: (draft, update: Update<WorkbenchMemory[\"videoTab\"]>) => {\n draft.videoTab = applyUpdate(draft.videoTab, update);\n },\n setVideoProjectId: (draft, update: Update<string | undefined>) => {\n draft.videoProjectId = applyUpdate(draft.videoProjectId, update);\n },\n setVideoPane: (draft, update: Update<WorkbenchMemory[\"videoPane\"]>) => {\n draft.videoPane = applyUpdate(draft.videoPane, update);\n },\n setProductionSection: (draft, update: Update<DramaProductionSection>) => {\n draft.productionSection = applyUpdate(draft.productionSection, update);\n },\n setProductionSelectedIds: (draft, update: Update<Record<string, string | undefined>>) => {\n draft.productionSelectedIds = applyUpdate(draft.productionSelectedIds, update);\n },\n setProductionJobs: (draft, update: Update<Record<string, ProductionJob[]>>) => {\n draft.productionJobs = applyUpdate(draft.productionJobs, update);\n },\n setProductionSelections: (draft, update: Update<Record<string, Record<string, string>>>) => {\n draft.productionSelections = applyUpdate(draft.productionSelections, update);\n },\n setProductionReferences: (draft, update: Update<Record<string, Record<string, string[]>>>) => {\n draft.productionReferences = applyUpdate(draft.productionReferences, update);\n },\n setProductionSequence: (draft, update: Update<Record<string, ProductionSequenceItem[]>>) => {\n draft.productionSequence = applyUpdate(draft.productionSequence, update);\n },\n setProductionCanvas: (draft, update: Update<Record<string, Record<string, CanvasPoint>>>) => {\n draft.productionCanvas = applyUpdate(draft.productionCanvas, update);\n },\n setProductionZoom: (draft, update: Update<Record<string, number>>) => {\n draft.productionZoom = applyUpdate(draft.productionZoom, update);\n },\n setProductionIntentCalls: (draft, update: Update<Record<string, boolean>>) => {\n draft.productionIntentCalls = applyUpdate(draft.productionIntentCalls, update);\n }\n }\n });\n}\n\nclass WorkspaceRequestError extends Error {\n constructor(readonly status: number, message: string) { super(message); }\n}\n\nconst GROUP_ORDER: Readonly<Record<WorkbenchMode, readonly string[]>> = {\n story: [\"\u6B63\u6587\", \"\u5927\u7EB2\", \"\u8BBE\u5B9A\", \"\u8FFD\u8E2A\", \"\u5BF9\u6807\", \"\u53C2\u8003\u8D44\u6599\"],\n drama: [\"\u9879\u76EE\", \"\u8F93\u5165\", \"\u9879\u76EE\u5F00\u53D1\", \"\u8BBE\u5B9A\u96C6\", \"\u5267\u96C6\", \"\u5BA1\u67E5\", \"\u521B\u4F5C\u8005\u51B3\u7B56\", \"\u4EA4\u4ED8\"],\n game: [\"game-adaptations\"],\n video: [\"video-recaps\"]\n};\n\nconst WORKBENCH_MODES = [\"story\", \"drama\", \"game\", \"video\"] as const;\nconst EDITOR_MODES = [\"preview\", \"source\", \"production\"] as const;\n\nfunction groupForPath(path: string): string {\n return path === \"short-drama.json\" ? \"\u9879\u76EE\" : path.split(\"/\", 1)[0] ?? \"\u5176\u4ED6\";\n}\n\nasync function json<T>(response: Response): Promise<T> {\n const value = await response.json() as T & { readonly error?: string };\n if (!response.ok) throw new WorkspaceRequestError(response.status, value.error ?? `HTTP ${String(response.status)}`);\n return value;\n}\n\nfunction FileTreeNodes({\n nodes,\n depth,\n expanded,\n selected,\n activityPath,\n onToggle,\n onSelect\n}: {\n readonly nodes: readonly FileTreeNode[];\n readonly depth: number;\n readonly expanded: Readonly<Record<string, boolean>>;\n readonly selected: string | undefined;\n readonly activityPath: string | undefined;\n readonly onToggle: (path: string, open: boolean) => void;\n readonly onSelect: (path: string) => void;\n}) {\n return <>{nodes.map((node) => {\n if (node.kind === \"file\") return <button\n type=\"button\"\n key={node.path}\n style={{ \"--oh-story-indent\": `${String(depth * 14)}px` } as CSSProperties}\n title={node.path}\n aria-label={node.path}\n data-file-path={node.path}\n data-agent-target={node.path === activityPath || undefined}\n aria-current={node.path === selected ? \"page\" : undefined}\n onClick={() => { onSelect(node.path); }}\n >{node.name}</button>;\n const open = selected?.startsWith(`${node.path}/`) === true || expanded[node.path] === true;\n return <details className=\"oh-story-file-folder\" key={node.path} open={open} onToggle={(event) => { onToggle(node.path, event.currentTarget.open); }}>\n <summary style={{ \"--oh-story-indent\": `${String(depth * 14)}px` } as CSSProperties} title={node.path}>{node.name}<span>{node.fileCount}</span></summary>\n <FileTreeNodes\n nodes={node.children}\n depth={depth + 1}\n expanded={expanded}\n selected={selected}\n activityPath={activityPath}\n onToggle={onToggle}\n onSelect={onSelect}\n />\n </details>;\n })}</>;\n}\n\nfunction useWorkspace(sessionId: string): {\n readonly workspace: WorkspacePayload | undefined;\n readonly error: string | undefined;\n readonly loading: boolean;\n readonly reload: () => void;\n} {\n const [version, setVersion] = useState(0);\n const [workspace, setWorkspace] = useState<WorkspacePayload>();\n const [error, setError] = useState<string>();\n const [loading, setLoading] = useState(true);\n const reload = useCallback(() => {\n setLoading(true);\n setVersion((value) => value + 1);\n }, []);\n useEffect(() => {\n const controller = new AbortController();\n setError(undefined);\n void fetch(endpoint(\"workspace\", sessionId), { signal: controller.signal })\n .then((response) => json<WorkspacePayload>(response))\n .then(setWorkspace)\n .catch((reason: unknown) => {\n if (!controller.signal.aborted) setError(reason instanceof Error ? reason.message : String(reason));\n })\n .finally(() => { if (!controller.signal.aborted) setLoading(false); });\n return () => { controller.abort(); };\n }, [sessionId, version]);\n return { workspace, error, loading, reload };\n}\n\nfunction isolatedPreviewUrl(path: string, version: string, revision: number): { readonly href: string; readonly isolated: boolean } {\n const url = new URL(path, globalThis.location.origin);\n if (url.hostname === \"127.0.0.1\") url.hostname = \"localhost\";\n else if (url.hostname === \"localhost\") url.hostname = \"127.0.0.1\";\n url.searchParams.set(\"build\", version);\n url.searchParams.set(\"reload\", String(revision));\n return { href: url.toString(), isolated: url.origin !== globalThis.location.origin };\n}\n\n/**\n * An iframe fires `load`, not `error`, when a navigation commits an HTTP error response, so the\n * frame's own events cannot tell a working preview from the route's JSON error body. Probe the\n * same URL out of band and report a non-OK or non-HTML answer as a real failure.\n */\nfunction PreviewProbe({ href, onFailed }: { readonly href: string; readonly onFailed: () => void }) {\n // Hold the callback in a ref so an inline arrow from the caller cannot re-trigger the probe.\n const failedRef = useRef(onFailed);\n useEffect(() => { failedRef.current = onFailed; }, [onFailed]);\n useEffect(() => {\n const controller = new AbortController();\n void fetch(href, { signal: controller.signal })\n .then((response) => {\n if (controller.signal.aborted) return;\n const type = response.headers.get(\"content-type\") ?? \"\";\n if (!response.ok || !type.includes(\"text/html\")) failedRef.current();\n })\n .catch(() => { if (!controller.signal.aborted) failedRef.current(); });\n return () => { controller.abort(); };\n }, [href]);\n return null;\n}\n\nfunction GamePreview({ project, building }: { readonly project: GameProject; readonly building: boolean }) {\n const shellRef = useRef<HTMLDivElement>(null);\n const fullscreenButtonRef = useRef<HTMLButtonElement>(null);\n const restoreFullscreenFocus = useRef(false);\n const [focused, setFocused] = useState(false);\n const [loaded, setLoaded] = useState(false);\n const [loadError, setLoadError] = useState(false);\n const [revision, setRevision] = useState(0);\n const [loadedVersion, setLoadedVersion] = useState(project.previewVersion);\n useEffect(() => {\n const document = shellRef.current?.ownerDocument;\n if (document === undefined) return;\n const restore = (): void => {\n if (document.fullscreenElement !== null || !restoreFullscreenFocus.current) return;\n restoreFullscreenFocus.current = false;\n fullscreenButtonRef.current?.focus();\n };\n document.addEventListener(\"fullscreenchange\", restore);\n return () => { document.removeEventListener(\"fullscreenchange\", restore); };\n }, []);\n if (!project.previewReady || project.previewUrl === undefined) return <div className=\"oh-game-preview-empty\">\n <span aria-hidden>\u25EB</span>\n <strong>\u8FD8\u6CA1\u6709\u53EF\u8BD5\u73A9\u7248\u672C</strong>\n <p>\u5728\u53F3\u4FA7 Chat \u4F7F\u7528 <code>/novel-to-game quick</code>\uFF0C\u4EA7\u7269\u5199\u5165 <code>game-adaptations/&lt;project&gt;/build/app/</code> \u540E\u4F1A\u81EA\u52A8\u51FA\u73B0\u5728\u8FD9\u91CC\u3002</p>\n <div className=\"oh-game-prompt-example\"><span>\u63CF\u8FF0\u793A\u4F8B</span><q>\u628A\u300A\u4F5C\u54C1\u540D\u300B\u6539\u7F16\u6210\u7F51\u9875\u4E92\u52A8\u6E38\u620F\uFF0C\u76EE\u6807\u73A9\u5BB6\u662F\u2026\u2026\uFF0C\u6838\u5FC3\u73A9\u6CD5\u662F\u2026\u2026\uFF0C\u5E0C\u671B\u6574\u4F53\u98CE\u683C\u2026\u2026</q></div>\n </div>;\n const preview = isolatedPreviewUrl(project.previewUrl, loadedVersion, revision);\n const pending = project.previewVersion !== loadedVersion;\n /** Accept the newer build the creator just chose. */\n const reload = (): void => {\n setLoaded(false);\n setLoadError(false);\n setLoadedVersion(project.previewVersion);\n setRevision((value) => value + 1);\n };\n /** Re-run the build the creator already accepted; never silently adopt a newer one. */\n const refresh = (): void => {\n setLoaded(false);\n setLoadError(false);\n setRevision((value) => value + 1);\n };\n const runtimeState = loadError ? \"\u9884\u89C8\u8F7D\u5165\u5931\u8D25 \u00B7 \u53EF\u91CD\u65B0\u8F7D\u5165\"\n : building ? \"Agent \u6B63\u5728\u66F4\u65B0\u6E38\u620F\u6587\u4EF6 \u00B7 \u5F53\u524D\u9884\u89C8\u4FDD\u6301\u4E0D\u53D8\"\n : pending ? \"\u65B0\u7248\u672C\u5DF2\u5C31\u7EEA \u00B7 \u7531\u4F60\u51B3\u5B9A\u4F55\u65F6\u8F7D\u5165\"\n : loaded ? (preview.isolated ? \"\u9884\u89C8\u5DF2\u8F7D\u5165\" : \"\u9884\u89C8\u5DF2\u8F7D\u5165 \u00B7 \u5F53\u524D\u90E8\u7F72\u65E0\u6CD5\u9694\u79BB\u6765\u6E90\uFF0C\u5B58\u6863\u529F\u80FD\u4E0D\u53EF\u7528\")\n : \"\u6B63\u5728\u8F7D\u5165\u9884\u89C8\u2026\";\n const fullscreen = (): void => {\n const shell = shellRef.current;\n if (shell === null) return;\n restoreFullscreenFocus.current = true;\n void shell.requestFullscreen().catch(() => { restoreFullscreenFocus.current = false; });\n };\n return <div ref={shellRef} className=\"oh-game-preview-shell\" data-state={loadError ? \"error\" : building ? \"building\" : loaded ? \"ready\" : \"loading\"}>\n <div className=\"oh-game-preview-status\">\n <span className=\"oh-game-runtime-state\" role=\"status\" aria-live=\"polite\" title={runtimeState}><i aria-hidden /><em>{runtimeState}</em></span>\n <div>\n {pending && !building && <button type=\"button\" onClick={reload}>\u8F7D\u5165\u65B0\u7248\u672C</button>}\n <button className=\"oh-game-reload\" type=\"button\" onClick={refresh} aria-label=\"\u91CD\u65B0\u8F7D\u5165\u6E38\u620F\"><span aria-hidden>\u21BB</span><b>\u5237\u65B0</b></button>\n <button ref={fullscreenButtonRef} type=\"button\" onClick={fullscreen}>\u5168\u5C4F\u8BD5\u73A9</button>\n </div>\n </div>\n <PreviewProbe href={preview.href} onFailed={() => { setLoaded(false); setLoadError(true); }} />\n <iframe\n key={`${project.id}:${loadedVersion}:${String(revision)}`}\n src={preview.href}\n title={`\u300A${project.title}\u300B\u53EF\u8BD5\u73A9\u9884\u89C8`}\n sandbox={preview.isolated\n ? \"allow-scripts allow-same-origin allow-forms allow-modals allow-downloads\"\n : \"allow-scripts allow-forms allow-modals allow-downloads\"}\n allow=\"autoplay; fullscreen; gamepad\"\n allowFullScreen\n referrerPolicy=\"no-referrer\"\n onLoad={() => { setLoadError(false); setLoaded(true); }}\n onError={() => { setLoaded(false); setLoadError(true); }}\n onFocus={() => { setFocused(true); }}\n onBlur={() => { setFocused(false); }}\n />\n <div className=\"oh-game-focus-hint\" data-focused={focused || undefined}>{focused ? \"\u6E38\u620F\u6B63\u5728\u63A5\u6536\u952E\u9F20\u8F93\u5165\" : \"\u70B9\u51FB\u753B\u9762\u8FDB\u5165\u8BD5\u73A9\"}</div>\n </div>;\n}\n\nfunction GameDesign({\n project,\n files,\n selected,\n sessionId,\n onSelect\n}: {\n readonly project: GameProject;\n readonly files: readonly WorkspaceFile[];\n readonly selected: string | undefined;\n readonly sessionId: string;\n readonly onSelect: (path: string) => void;\n}) {\n const documents = useMemo(() => files.filter((file) => file.path.startsWith(`${project.root}/`) && (\n /\\.(?:md|txt|json|jsonl|html|css|[cm]?js|tsx?|jsx)$/iu.test(file.path)\n )), [files, project.root]);\n const preferred = selected !== undefined && documents.some((file) => file.path === selected)\n ? selected\n : documents.find((file) => file.path === `${project.root}/PRODUCT_BRIEF.md`)?.path ?? documents[0]?.path;\n const [path, setPath] = useState(preferred);\n const [content, setContent] = useState<string>();\n const [error, setError] = useState<string>();\n useEffect(() => { setPath(preferred); }, [preferred, project.id]);\n useEffect(() => {\n if (path === undefined || project.source === \"example\") { setContent(undefined); return; }\n const controller = new AbortController();\n setContent(undefined);\n setError(undefined);\n void fetch(endpoint(\"file\", sessionId, path), { signal: controller.signal })\n .then((response) => json<FilePayload>(response))\n .then((file) => { setContent(file.content); })\n .catch((reason: unknown) => { if (!controller.signal.aborted) setError(reason instanceof Error ? reason.message : String(reason)); });\n return () => { controller.abort(); };\n }, [path, project.source, sessionId]);\n if (project.source === \"example\") return <div className=\"oh-game-design-empty\">\n <strong>\u5185\u7F6E\u5B8C\u6574\u793A\u4F8B</strong>\n <p>\u300A\u91D1\u74F6\u6885 \u00B7 \u98CE\u6708\u603B\u8D26\u300B\u7684\u5B8C\u6574\u53EF\u73A9\u6784\u5EFA\u4E0E QA \u6821\u9A8C\u7ED3\u679C\u968F\u63D2\u4EF6\u6253\u5305\uFF0C\u53EF\u76F4\u63A5\u5728\u5DE6\u4FA7\u8BD5\u73A9\u3002\u4E0A\u6E38\u7684\u4EA7\u54C1\u7B80\u62A5\u3001\u5206\u6790\u3001\u6982\u5FF5\u3001\u8BBE\u8BA1\u4E0E\u6E90\u5C0F\u8BF4\u4E0D\u968F\u5305\u5206\u53D1\uFF0C\u53EF\u5728 novel-to-game \u4ED3\u5E93\u67E5\u770B\u5B8C\u6574\u521B\u4F5C\u8FC7\u7A0B\u3002</p>\n <code>novel-to-game/examples/jin-ping-mei</code>\n </div>;\n if (documents.length === 0 || path === undefined) return <div className=\"oh-game-design-empty\">\u5F53\u524D\u9879\u76EE\u8FD8\u6CA1\u6709\u53EF\u68C0\u67E5\u7684\u8BBE\u8BA1\u6216\u6E90\u6587\u4EF6\u3002</div>;\n const markdown = path.toLocaleLowerCase().endsWith(\".md\");\n return <div className=\"oh-game-design\">\n <label>\u9879\u76EE\u6587\u4EF6<select value={path} onChange={(event) => {\n setPath(event.target.value);\n onSelect(event.target.value);\n }}>{documents.map((file) => <option value={file.path} key={file.path}>{file.path.slice(project.root.length + 1)}</option>)}</select></label>\n {error !== undefined ? <div className=\"oh-story-error\">{error}</div>\n : content === undefined ? <div className=\"oh-game-design-empty\">\u6B63\u5728\u8F7D\u5165\u6587\u4EF6\u2026</div>\n : markdown ? <MarkdownPreview content={content} label={path} />\n : <pre className=\"oh-game-source\" aria-label={`${path} \u6E90\u7801`}>{content}</pre>}\n </div>;\n}\n\nfunction GameStudio({\n sessionId,\n workspace,\n building,\n selected,\n gameTab,\n gameProjectId,\n hidden,\n onGameTab,\n onGameProject,\n workbenches,\n paneId,\n labelledBy,\n onWorkbench,\n onCollapse,\n onSelect\n}: {\n readonly sessionId: string;\n readonly workspace: WorkspacePayload;\n readonly building: boolean;\n readonly selected: string | undefined;\n readonly gameTab: WorkbenchMemory[\"gameTab\"];\n readonly gameProjectId: string | undefined;\n readonly hidden: boolean;\n readonly onGameTab: (tab: WorkbenchMemory[\"gameTab\"]) => void;\n readonly onGameProject: (id: string) => void;\n readonly workbenches: readonly WorkbenchMode[];\n readonly paneId: string;\n readonly labelledBy: string;\n readonly onWorkbench: (mode: WorkbenchMode) => void;\n readonly onCollapse: () => void;\n readonly onSelect: (path: string) => void;\n}) {\n const project = workspace.games.find((value) => value.id === gameProjectId) ?? workspace.games[0];\n const studioRef = useRef<HTMLElement>(null);\n const tabsId = useId();\n useLayoutEffect(() => {\n const studio = studioRef.current;\n if (studio === null) return;\n const publishWidth = () => {\n studio.toggleAttribute(\"data-oh-game-narrow\", studio.clientWidth <= 300);\n };\n publishWidth();\n const observer = new ResizeObserver(publishWidth);\n observer.observe(studio);\n return () => { observer.disconnect(); };\n }, []);\n useEffect(() => {\n if (project !== undefined && project.id !== gameProjectId) onGameProject(project.id);\n }, [gameProjectId, onGameProject, project]);\n if (project === undefined) return <main ref={studioRef} id={paneId} className=\"oh-game-studio\" role=\"tabpanel\" aria-labelledby={labelledBy} hidden={hidden}><div className=\"oh-game-design-empty\">\u6E38\u620F\u80FD\u529B\u6B63\u5728\u8F7D\u5165\u2026</div></main>;\n const tabs = [\"preview\", \"design\"] as const;\n return <main ref={studioRef} id={paneId} className=\"oh-game-studio\" data-source={project.source} role=\"tabpanel\" aria-labelledby={labelledBy} hidden={hidden}>\n <header className=\"oh-game-toolbar\">\n <div className=\"oh-workbench-cluster\">\n {workbenches.length > 1 && <div className=\"oh-game-mode-tabs\" role=\"tablist\" aria-label=\"\u521B\u4F5C\u5DE5\u4F5C\u53F0\">\n {workbenches.map((mode) => <button\n type=\"button\"\n role=\"tab\"\n key={mode}\n aria-selected={mode === \"game\"}\n tabIndex={mode === \"game\" ? 0 : -1}\n onKeyDown={(event) => { handleTabKey(event, workbenches, \"game\", onWorkbench); }}\n onClick={() => { onWorkbench(mode); }}\n >{workbenchLabel(mode)}</button>)}\n </div>}\n <button className=\"oh-workbench-collapse\" type=\"button\" title=\"\u6536\u8D77\u521B\u4F5C\u5DE5\u4F5C\u53F0\" aria-label=\"\u6536\u8D77\u521B\u4F5C\u5DE5\u4F5C\u53F0\" onClick={onCollapse}>\u00D7</button>\n </div>\n <label className=\"oh-game-project\" title=\"\u5207\u6362\u9879\u76EE\u5C06\u91CD\u65B0\u8F7D\u5165\u8BD5\u73A9\"><span>\u6E38\u620F\u9879\u76EE</span><select aria-label=\"\u6E38\u620F\u9879\u76EE\uFF1B\u5207\u6362\u5C06\u91CD\u65B0\u8F7D\u5165\u8BD5\u73A9\" value={project.id} onChange={(event) => { onGameProject(event.target.value); }}>\n {workspace.games.some((item) => item.source === \"workspace\") && <optgroup label=\"\u6211\u7684\u9879\u76EE\">{workspace.games.filter((item) => item.source === \"workspace\").map((item) => <option value={item.id} key={item.id}>{`\u6211\u7684\u9879\u76EE \u00B7 ${item.title}`}</option>)}</optgroup>}\n {workspace.games.some((item) => item.source === \"example\") && <optgroup label=\"\u5185\u7F6E\u793A\u4F8B\">{workspace.games.filter((item) => item.source === \"example\").map((item) => <option value={item.id} key={item.id}>{`\u5185\u7F6E\u793A\u4F8B \u00B7 ${item.title}`}</option>)}</optgroup>}\n </select></label>\n <div className=\"oh-game-tabs\" role=\"tablist\" aria-label=\"\u6E38\u620F\u5DE5\u4F5C\u53F0\">\n {tabs.map((tab) => <button\n key={tab}\n type=\"button\"\n role=\"tab\"\n tabIndex={gameTab === tab ? 0 : -1}\n aria-selected={gameTab === tab}\n id={`${tabsId}-${tab}-tab`}\n aria-controls={`${tabsId}-${tab}-panel`}\n onKeyDown={(event) => { handleTabKey(event, tabs, gameTab, onGameTab); }}\n onClick={() => { onGameTab(tab); }}\n >{tab === \"preview\" ? \"\u8BD5\u73A9\" : project.source === \"example\" ? \"\u8BF4\u660E\" : \"\u9879\u76EE\u6587\u4EF6\"}</button>)}\n </div>\n </header>\n <div className=\"oh-game-panels\">\n <div className=\"oh-game-panel\" role=\"tabpanel\" id={`${tabsId}-preview-panel`} aria-labelledby={`${tabsId}-preview-tab`} hidden={gameTab !== \"preview\"}>\n <GamePreview key={`${project.id}:${String(project.previewReady)}`} project={project} building={building} />\n </div>\n <div className=\"oh-game-panel\" role=\"tabpanel\" id={`${tabsId}-design-panel`} aria-labelledby={`${tabsId}-design-tab`} hidden={gameTab !== \"design\"}>\n <GameDesign project={project} files={workspace.files} selected={selected} sessionId={sessionId} onSelect={onSelect} />\n </div>\n </div>\n </main>;\n}\n\nfunction CreativeWorkbench({\n sessionId,\n runningCalls,\n partial,\n settledMutation,\n sessionRunning,\n productionQueue,\n productionIntents,\n sendProductionPrompt,\n cancelProduction,\n removeQueuedProduction,\n workspace,\n error,\n workspaceLoading,\n reload,\n open,\n creativeProject,\n useStore,\n actions\n}: {\n readonly sessionId: string;\n readonly runningCalls: readonly RunningToolCall[];\n readonly partial: PartialAssistant | null;\n readonly settledMutation: string | undefined;\n readonly sessionRunning: boolean;\n readonly productionQueue: readonly ProductionQueueEntry[];\n readonly productionIntents: readonly SettledProductionIntent[];\n readonly workspace: WorkspacePayload | undefined;\n readonly error: string | undefined;\n readonly workspaceLoading: boolean;\n readonly reload: () => void;\n readonly open: boolean;\n readonly creativeProject: boolean;\n} & Pick<WorkbenchSlotProps, \"useStore\" | \"actions\" | \"sendProductionPrompt\" | \"cancelProduction\" | \"removeQueuedProduction\">) {\n const activities = useMemo(\n () => fileMutations(runningCalls, partial),\n [partial, runningCalls]\n );\n const normalizedActivities = useMemo(() => activities.flatMap((activity) => {\n const path = creativeRelativePath(activity.path, workspace?.cwd);\n return path === undefined ? [] : [{ activity, path }];\n }), [activities, workspace?.cwd]);\n const primaryActivity = normalizedActivities.at(-1);\n const activityPaths = useMemo(() => new Set(normalizedActivities.map((value) => value.path)), [normalizedActivities]);\n const activity = primaryActivity?.activity;\n const activityPath = primaryActivity?.path;\n const workbench = useStore((memory) => memory.workbench);\n const setWorkbench = actions.setWorkbench;\n const gameTab = useStore((memory) => memory.gameTab);\n const setGameTab = actions.setGameTab;\n const gameProjectId = useStore((memory) => memory.gameProjectId);\n const setGameProjectId = actions.setGameProjectId;\n const gamePane = useStore((memory) => memory.gamePane);\n const setGamePane = actions.setGamePane;\n const videoTab = useStore((memory) => memory.videoTab);\n const setVideoTab = actions.setVideoTab;\n const videoProjectId = useStore((memory) => memory.videoProjectId);\n const setVideoProjectId = actions.setVideoProjectId;\n const videoPane = useStore((memory) => memory.videoPane);\n const setVideoPane = actions.setVideoPane;\n const selected = useStore((memory) => memory.selected);\n const setSelected = actions.setSelected;\n const buffers = useStore((memory) => memory.buffers);\n const setBuffers = actions.setBuffers;\n const buffersRef = useRef<Record<string, FileBuffer>>({});\n const expanded = useStore((memory) => memory.expanded);\n const setExpanded = actions.setExpanded;\n const productionSection = useStore((memory) => memory.productionSection);\n const setProductionSection = actions.setProductionSection;\n const productionSelectedIds = useStore((memory) => memory.productionSelectedIds);\n const productionJobsByEpisode = useStore((memory) => memory.productionJobs);\n const productionSelectionsByEpisode = useStore((memory) => memory.productionSelections);\n const productionReferencesByEpisode = useStore((memory) => memory.productionReferences);\n const productionSequenceByEpisode = useStore((memory) => memory.productionSequence);\n const productionCanvasByEpisode = useStore((memory) => memory.productionCanvas);\n const productionZoomByEpisode = useStore((memory) => memory.productionZoom);\n const productionIntentCalls = useStore((memory) => memory.productionIntentCalls);\n const surfaceRef = useRef<HTMLDivElement>(null);\n const setWorkbenchPreference = actions.setWorkbenchPreference;\n const applyWorkbenchPreference = useCallback((preference: WorkbenchPreference): void => {\n setWorkbenchPreference(preference);\n writeWorkbenchPreference(workbenchPreferenceStorage(), workspace?.cwd, preference);\n }, [setWorkbenchPreference, workspace?.cwd]);\n const compactTabsId = useId();\n const compactStudioId = `${compactTabsId}-studio-panel`;\n const compactVideoStudioId = `${compactTabsId}-video-studio-panel`;\n const compactChatId = `${compactTabsId}-chat-panel`;\n const navRef = useRef<HTMLElement>(null);\n const activityBases = useRef(new Map<string, { readonly path: string; readonly base: string }>());\n const previousSignals = useRef<ReadonlySet<string>>(new Set());\n const previousSettledMutation = useRef(settledMutation);\n const saveLocks = useRef(new Set<string>());\n const buffer = selected === undefined ? undefined : buffers[selected];\n const selectedFile = workspace?.files.find((file) => file.path === selected);\n const selectedMedia = selectedFile?.kind === \"media\";\n const dirty = buffer?.source === \"human\" && buffer.content !== buffer.saved;\n const saving = buffer?.saving === true;\n const fileError = buffer?.error;\n const conflict = buffer?.conflict;\n const selectedLower = selected?.toLocaleLowerCase();\n const markdown = selectedLower?.endsWith(\".md\") === true;\n const jsonl = selectedLower?.endsWith(\".jsonl\") === true;\n const structured = jsonl || selectedLower?.endsWith(\".json\") === true;\n const previewable = markdown || jsonl;\n const episodeDirectory = episodeDirectoryForPath(selected);\n const productionAvailable = selected !== undefined && isCreatorDocumentPath(selected) && episodeDirectory !== undefined;\n const editorModes = productionAvailable ? EDITOR_MODES : EDITOR_MODES.filter((mode) => mode !== \"production\");\n const episodeDocumentPaths = useMemo(\n () => episodeDirectory === undefined ? [] : creatorDocumentPaths(workspace?.files.filter((file) => file.kind === \"text\") ?? [], episodeDirectory),\n [episodeDirectory, workspace?.files]\n );\n const episodeDocuments = useMemo(() => Object.fromEntries(episodeDocumentPaths.flatMap((path) => {\n const current = buffers[path];\n return current === undefined || current.missing === true ? [] : [[path, current.content] as const];\n })), [buffers, episodeDocumentPaths]);\n const episodeProduction = useMemo(\n () => episodeDirectory === undefined ? undefined : parseEpisodeProduction(episodeDocuments, episodeDirectory),\n [episodeDirectory, episodeDocuments]\n );\n const productionLibrary = useMemo(() => (workspace?.files ?? []).flatMap((file): ProductionMediaVersion[] => {\n if (file.kind !== \"media\" || file.mimeType?.startsWith(\"audio/\") === true) return [];\n if (!file.path.startsWith(\"\u5267\u96C6/\") && !file.path.startsWith(\"\u4EA4\u4ED8/\")) return [];\n const targetId = file.path.toLocaleUpperCase().match(/(?:SHOT|IMG|MOTION|VISUAL)-[A-Z0-9-]+/u)?.[0] ?? file.path.split(\"/\").at(-2) ?? \"PROJECT-MEDIA\";\n return [{\n id: `workspace:${file.path}:${file.version}`,\n targetId,\n kind: file.mimeType?.startsWith(\"image/\") === true ? \"image\" : \"video\",\n url: endpoint(\"media\", sessionId, file.path),\n path: file.path\n }];\n }), [sessionId, workspace?.files]);\n const productionVersions = useMemo(() => {\n if (episodeProduction === undefined) return [];\n const episodeName = episodeProduction.episodeDirectory.split(\"/\").at(-1) ?? \"\";\n const knownTargets = [\n ...episodeProduction.shots.map((shot) => shot.id),\n ...episodeProduction.assets.map((asset) => asset.id),\n ...episodeProduction.visualAssets.map((asset) => asset.id),\n ...episodeProduction.motions.map((motion) => motion.id)\n ].sort((left, right) => right.length - left.length);\n const motionTargets = new Map(episodeProduction.motions.flatMap((motion) => motion.shotId === undefined ? [] : [[motion.id, motion.shotId] as const]));\n const fromWorkspace = productionLibrary.flatMap((version) => {\n if (version.path === undefined || (!version.path.startsWith(`${episodeProduction.episodeDirectory}/`) && !version.path.startsWith(`\u4EA4\u4ED8/${episodeName}/`))) return [];\n const matched = mediaTargetFromPath(version.path, knownTargets);\n const composition = /(?:^|\\/)\u6210\u7247-[^/]+\\.mp4$/iu.test(version.path);\n if (matched === undefined && !composition) return [];\n const targetId = matched === undefined ? episodeProduction.episodeDirectory : motionTargets.get(matched) ?? matched;\n return [{ ...version, targetId }];\n });\n const byId = new Map<string, ProductionMediaVersion>();\n for (const version of fromWorkspace) byId.set(version.id, version);\n return [...byId.values()];\n }, [episodeProduction, productionLibrary]);\n const productionSelectedId = episodeDirectory === undefined ? undefined : productionSelectedIds[episodeDirectory];\n const productionJobs = episodeDirectory === undefined ? [] : productionJobsByEpisode[episodeDirectory] ?? [];\n const productionSelections = episodeDirectory === undefined ? {} : productionSelectionsByEpisode[episodeDirectory] ?? {};\n const productionReferences = episodeDirectory === undefined ? {} : productionReferencesByEpisode[episodeDirectory] ?? {};\n const productionSequence = episodeDirectory === undefined ? [] : productionSequenceByEpisode[episodeDirectory] ?? [];\n const productionCanvas = episodeDirectory === undefined ? {} : productionCanvasByEpisode[episodeDirectory] ?? {};\n const productionZoom = episodeDirectory === undefined ? .65 : productionZoomByEpisode[episodeDirectory] ?? .65;\n const setProductionSelectedId = useCallback((selectedId: string | undefined) => {\n if (episodeDirectory !== undefined) actions.setProductionSelectedIds((current) => ({ ...current, [episodeDirectory]: selectedId }));\n }, [actions, episodeDirectory]);\n const setProductionJobs = useCallback((jobs: ProductionJob[]) => {\n if (episodeDirectory !== undefined) actions.setProductionJobs((current) => ({ ...current, [episodeDirectory]: jobs }));\n }, [actions, episodeDirectory]);\n const setProductionSelections = useCallback((selections: Record<string, string>) => {\n if (episodeDirectory !== undefined) actions.setProductionSelections((current) => ({ ...current, [episodeDirectory]: selections }));\n }, [actions, episodeDirectory]);\n const setProductionReferences = useCallback((references: Record<string, string[]>) => {\n if (episodeDirectory !== undefined) actions.setProductionReferences((current) => ({ ...current, [episodeDirectory]: references }));\n }, [actions, episodeDirectory]);\n const setProductionSequence = useCallback((sequence: ProductionSequenceItem[]) => {\n if (episodeDirectory !== undefined) actions.setProductionSequence((current) => ({ ...current, [episodeDirectory]: sequence }));\n }, [actions, episodeDirectory]);\n const setProductionCanvas = useCallback((canvas: Record<string, CanvasPoint>) => {\n if (episodeDirectory !== undefined) actions.setProductionCanvas((current) => ({ ...current, [episodeDirectory]: canvas }));\n }, [actions, episodeDirectory]);\n const setProductionZoom = useCallback((zoom: number) => {\n if (episodeDirectory !== undefined) actions.setProductionZoom((current) => ({ ...current, [episodeDirectory]: zoom }));\n }, [actions, episodeDirectory]);\n const editorMode = useStore((memory) => memory.editorMode);\n const setEditorMode = actions.setEditorMode;\n const modeSelection = useRef(selected);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const editorPositions = useRef(new Map<string, { readonly scrollTop: number; readonly selectionStart: number; readonly selectionEnd: number }>());\n const editorReady = buffer !== undefined && buffer.missing !== true;\n const workspaceKind = workbench === \"game\" || workbench === \"video\" ? undefined : workbench;\n const gameBuilding = normalizedActivities.some(({ path }) => path.startsWith(\"game-adaptations/\"));\n const videoBuilding = normalizedActivities.some(({ path }) => path.startsWith(\"video-recaps/\"));\n\n useEffect(() => { buffersRef.current = buffers; }, [buffers]);\n\n const rememberEditorPosition = useCallback((): void => {\n const element = textareaRef.current;\n if (element === null || selected === undefined || element.getAttribute(\"aria-label\") !== selected) return;\n editorPositions.current.set(selected, {\n scrollTop: element.scrollTop,\n selectionStart: element.selectionStart,\n selectionEnd: element.selectionEnd\n });\n }, [selected]);\n\n useLayoutEffect(() => {\n if (editorMode !== \"source\" || selected === undefined || !editorReady) return;\n const element = textareaRef.current;\n const position = editorPositions.current.get(selected);\n if (element === null || position === undefined) return;\n const end = Math.min(position.selectionEnd, element.value.length);\n element.setSelectionRange(Math.min(position.selectionStart, end), end);\n element.scrollTop = position.scrollTop;\n }, [editorMode, editorReady, selected]);\n\n useEffect(() => {\n const warn = (event: BeforeUnloadEvent): void => {\n if (!Object.values(buffersRef.current).some((value) => value.source === \"human\" && value.content !== value.saved)) return;\n event.preventDefault();\n };\n globalThis.addEventListener(\"beforeunload\", warn);\n return () => { globalThis.removeEventListener(\"beforeunload\", warn); };\n }, []);\n\n const expandPath = useCallback((path: string): void => {\n const segments = path.split(\"/\");\n const ancestors = [groupForPath(path)];\n for (let index = 1; index < segments.length - 1; index += 1) ancestors.push(segments.slice(0, index + 1).join(\"/\"));\n setExpanded((current) => {\n const next = { ...current };\n for (const ancestor of ancestors) next[ancestor] = true;\n return next;\n });\n }, []);\n\n const revealPath = useCallback((path: string): void => {\n rememberEditorPosition();\n const nextWorkbench = workbenchModeForPath(path) ?? \"story\";\n setWorkbench(nextWorkbench);\n if (nextWorkbench === \"game\" && !path.includes(\"/build/app/\")) setGameTab(\"design\");\n setSelected(path);\n expandPath(path);\n }, [expandPath, rememberEditorPosition]);\n\n useEffect(() => {\n if (workspace === undefined) return;\n const pending = productionIntents.filter(({ callId }) => productionIntentCalls[callId] !== true);\n if (pending.length === 0) return;\n for (const { intent } of pending) {\n if (intent.action === \"open_section\" || intent.action === \"focus_target\") {\n const documentPath = [\"\u5206\u955C.md\", \"\u56FE\u7247\u63D0\u793A\u8BCD.md\", \"\u89C6\u89C9\u8BBE\u5B9A.md\", \"\u5267\u672C.md\", \"\u89C6\u9891\u63D0\u793A\u8BCD.md\"]\n .map((name) => `${intent.episode}/${name}`)\n .find((path) => workspace.files.some((file) => file.path === path));\n if (documentPath !== undefined) {\n setWorkbench(\"drama\");\n setSelected(documentPath);\n expandPath(documentPath);\n globalThis.setTimeout(() => { setEditorMode(\"production\"); }, 0);\n }\n }\n if (intent.action === \"open_section\") setProductionSection(intent.section ?? \"shots\");\n else if (intent.action === \"focus_target\") {\n actions.setProductionSelectedIds((current) => ({ ...current, [intent.episode]: intent.targetId }));\n setProductionSection(intent.section ?? (intent.targetId?.startsWith(\"SHOT-\") === true ? \"shots\" : \"assets\"));\n } else if (intent.action === \"set_sequence\") {\n actions.setProductionSequence((current) => ({\n ...current,\n [intent.episode]: (intent.shotIds ?? []).map((shotId) => ({ shotId }))\n }));\n } else if (intent.action === \"track_job\" && intent.jobId !== undefined && intent.targetId !== undefined && intent.jobKind !== undefined) {\n const { jobId, targetId, jobKind } = intent;\n actions.setProductionJobs((current) => {\n const jobs = current[intent.episode] ?? [];\n if (jobs.some((job) => job.id === jobId)) {\n return {\n ...current,\n [intent.episode]: jobs.map((job) => job.id === jobId ? {\n ...job,\n targetId,\n kind: jobKind,\n status: \"running\",\n progress: Math.max(10, job.progress),\n prompt: intent.prompt ?? job.prompt,\n expectedOutputs: intent.expectedOutputs ?? job.expectedOutputs,\n error: undefined\n } : job)\n };\n }\n return {\n ...current,\n [intent.episode]: [...jobs, {\n ...createPendingJob({\n id: jobId,\n targetId,\n kind: jobKind,\n prompt: intent.prompt ?? \"\",\n expectedOutputs: intent.expectedOutputs\n }),\n status: \"running\",\n progress: 10\n }]\n };\n });\n }\n }\n actions.setProductionIntentCalls((current) => ({\n ...current,\n ...Object.fromEntries(pending.map(({ callId }) => [callId, true]))\n }));\n }, [actions, expandPath, productionIntentCalls, productionIntents, setEditorMode, setProductionSection, setSelected, setWorkbench, workspace]);\n\n // Latch first entry into the game workbench: before that the Studio must not mount, or every\n // session downloads and runs the bundled example in a display:none iframe. Once mounted it\n // stays mounted so the running game survives later navigation.\n const openedGame = useRef(false);\n if (workbench === \"game\") openedGame.current = true;\n const gameStudioMounted = openedGame.current;\n const openedVideo = useRef(false);\n if (workbench === \"video\") openedVideo.current = true;\n const videoStudioMounted = openedVideo.current;\n\n const followAgentPath = useCallback((path: string): void => {\n expandPath(path);\n const current = selected === undefined ? undefined : buffersRef.current[selected];\n const preserveFocusedDraft = path !== selected\n && current?.source === \"human\"\n && current.content !== current.saved\n && surfaceRef.current?.ownerDocument.activeElement === textareaRef.current;\n if (preserveFocusedDraft) return;\n // The editor textarea is not mounted in the Game Studio, so the draft guard above can never\n // fire there. Never preempt a running game: agent writes may expand the tree, not navigate.\n if ((workbench === \"game\" && gameTab === \"preview\") || (workbench === \"video\" && videoTab === \"preview\")) return;\n revealPath(path);\n }, [expandPath, gameTab, revealPath, selected, videoTab, workbench]);\n\n useEffect(() => {\n if (activityPath !== undefined && activityPath === selected && !selectedMedia) setEditorMode(\"source\");\n }, [activityPath, selected, selectedMedia]);\n\n useEffect(() => {\n if (modeSelection.current === selected) return;\n modeSelection.current = selected;\n setEditorMode(selected !== undefined && activityPaths.has(selected) ? \"source\" : selectedMedia || previewable ? \"preview\" : \"source\");\n }, [activityPaths, previewable, selected, selectedMedia]);\n\n useEffect(() => {\n if (workspaceLoading) return;\n if (activityPath !== undefined) return;\n if (selected !== undefined && (\n (workspace?.files.some((file) => file.path === selected) ?? false)\n || buffers[selected] !== undefined\n ) && workbenchModeForPath(selected) === workbench) return;\n setSelected(workspace === undefined ? undefined : preferredWorkbenchFile(workspace.files, workbench));\n }, [activityPath, buffers, selected, workbench, workspace, workspaceLoading]);\n\n useEffect(() => {\n if (workspace === undefined || workspaceLoading) return;\n const paths = new Set(workspace.files.map((file) => file.path));\n setBuffers((current) => {\n let changed = false;\n const next = { ...current };\n for (const [path, value] of Object.entries(current)) {\n if (paths.has(path) || activityPaths.has(path)) continue;\n if (value.source === \"human\" && value.content !== value.saved) {\n if (value.missing !== true) {\n next[path] = { ...value, missing: true, error: \"\u6587\u4EF6\u5DF2\u4ECE workspace \u79FB\u9664\u3002\u672C\u5730\u8349\u7A3F\u4ECD\u4FDD\u7559\uFF0C\u53EF\u590D\u5236\u540E\u653E\u5F03\u8349\u7A3F\u3002\" };\n changed = true;\n }\n } else {\n delete next[path];\n changed = true;\n }\n }\n return changed ? next : current;\n });\n }, [activityPaths, workspace, workspaceLoading]);\n\n useEffect(() => {\n if (selected === undefined || selectedMedia || activityPaths.has(selected)) return;\n if (!(workspace?.files.some((file) => file.path === selected) ?? false)) return;\n const controller = new AbortController();\n setBuffers((current) => {\n const existing = current[selected];\n return existing === undefined ? current : { ...current, [selected]: { ...existing, error: undefined } };\n });\n void fetch(endpoint(\"file\", sessionId, selected), { signal: controller.signal })\n .then((response) => json<FilePayload>(response))\n .then((file) => {\n setBuffers((current) => {\n const existing = current[file.path];\n if (existing?.source === \"human\" && existing.content !== existing.saved) {\n if (existing.version === file.version) return { ...current, [file.path]: { ...existing, missing: false, error: undefined } };\n return {\n ...current,\n [file.path]: {\n ...existing,\n missing: false,\n error: undefined,\n conflict: {\n message: `${file.path} \u5DF2\u5728\u78C1\u76D8\u4E0A\u66F4\u65B0\uFF1B\u4F60\u7684\u672C\u5730\u8349\u7A3F\u6CA1\u6709\u88AB\u8986\u76D6\u3002`,\n theirs: file.content,\n theirsVersion: file.version\n }\n }\n };\n }\n return {\n ...current,\n [file.path]: { content: file.content, saved: file.content, source: \"disk\", version: file.version }\n };\n });\n })\n .catch((reason: unknown) => {\n if (controller.signal.aborted) return;\n setBuffers((current) => {\n const existing = current[selected];\n return existing === undefined ? current : {\n ...current,\n [selected]: { ...existing, error: reason instanceof Error ? reason.message : String(reason) }\n };\n });\n });\n return () => { controller.abort(); };\n }, [activityPaths, selected, selectedMedia, sessionId, workspace?.files]);\n\n useEffect(() => {\n if (!productionAvailable) return;\n const missing = episodeDocumentPaths.filter((path) => buffersRef.current[path] === undefined && !activityPaths.has(path));\n if (missing.length === 0) return;\n const controller = new AbortController();\n void Promise.all(missing.map((path) => fetch(endpoint(\"file\", sessionId, path), { signal: controller.signal }).then((response) => json<FilePayload>(response))))\n .then((files) => {\n setBuffers((current) => {\n const next = { ...current };\n for (const file of files) {\n const existing = next[file.path];\n if (existing?.source === \"human\" && existing.content !== existing.saved) continue;\n next[file.path] = { content: file.content, saved: file.content, source: \"disk\", version: file.version };\n }\n return next;\n });\n })\n .catch((reason: unknown) => {\n if (!controller.signal.aborted) {\n setBuffers((current) => {\n const next = { ...current };\n for (const path of missing) {\n const existing = next[path];\n if (existing !== undefined) next[path] = { ...existing, error: reason instanceof Error ? reason.message : String(reason) };\n }\n return next;\n });\n }\n });\n return () => { controller.abort(); };\n }, [activityPaths, episodeDocumentPaths, productionAvailable, sessionId]);\n\n useEffect(() => {\n if (normalizedActivities.length === 0) return;\n for (const { path } of normalizedActivities) expandPath(path);\n if (activityPath !== undefined) followAgentPath(activityPath);\n setBuffers((current) => {\n let next = current;\n for (const { activity: currentActivity, path } of normalizedActivities) {\n const existing = next[path];\n if (existing?.source === \"human\" && existing.content !== existing.saved) {\n next = {\n ...next,\n [path]: {\n ...existing,\n conflict: { message: `${path} \u6B63\u7531 Agent \u4FEE\u6539\uFF1B\u4F60\u7684\u672C\u5730\u8349\u7A3F\u5DF2\u9501\u5B9A\uFF0C\u4E0D\u4F1A\u88AB\u8986\u76D6\u3002` }\n }\n };\n continue;\n }\n let basis = activityBases.current.get(currentActivity.callId);\n if (basis === undefined || basis.path !== path) {\n basis = { path, base: existing?.content ?? \"\" };\n activityBases.current.set(currentActivity.callId, basis);\n }\n const preview = previewMutation(currentActivity, basis.base);\n if (preview === undefined || (existing?.source === \"agent\" && existing.content === preview)) continue;\n next = {\n ...next,\n [path]: {\n content: preview,\n saved: existing?.saved ?? \"\",\n source: \"agent\",\n version: existing?.version ?? \"\"\n }\n };\n }\n return next;\n });\n }, [activityPath, expandPath, followAgentPath, normalizedActivities]);\n\n useEffect(() => {\n const signals = new Set(mutatingCallIds(runningCalls));\n for (const { activity: currentActivity } of normalizedActivities) signals.add(currentActivity.callId.split(\":\", 1)[0] ?? currentActivity.callId);\n const settled = [...previousSignals.current].some((callId) => !signals.has(callId));\n for (const callId of activityBases.current.keys()) {\n if (!signals.has(callId.split(\":\", 1)[0] ?? callId)) activityBases.current.delete(callId);\n }\n previousSignals.current = signals;\n if (!settled) return;\n reload();\n }, [normalizedActivities, reload, runningCalls]);\n\n useEffect(() => {\n if (settledMutation === undefined || settledMutation === previousSettledMutation.current) return;\n // The signal carries an absolute path, so creativeRelativePath cannot resolve it until the\n // workspace (and its cwd) has loaded. Consuming the signal first would burn it: the effect\n // re-runs when cwd arrives, but the guard above then short-circuits and the agent's file is\n // never selected. Wait for cwd instead of dropping the follow.\n if (workspace?.cwd === undefined) return;\n previousSettledMutation.current = settledMutation;\n const path = creativeRelativePath(settledMutation.slice(settledMutation.indexOf(\"\\0\") + 1), workspace.cwd);\n if (path !== undefined) followAgentPath(path);\n reload();\n }, [followAgentPath, reload, settledMutation, workspace?.cwd]);\n\n useEffect(() => {\n if (selected === undefined) return;\n for (const button of navRef.current?.querySelectorAll<HTMLButtonElement>(\"button[data-file-path]\") ?? []) {\n if (button.dataset.filePath === selected) {\n button.scrollIntoView({ block: \"nearest\" });\n break;\n }\n }\n }, [selected]);\n\n useEffect(() => {\n if (!open || normalizedActivities.length > 0 || workspace === undefined) return;\n const sessionSurface = surfaceRef.current?.parentElement;\n if (sessionSurface === undefined || sessionSurface === null) return;\n const knownPaths = new Set(workspace.files.map((file) => file.path));\n const followOfficialFileLink = (event: MouseEvent): void => {\n const origin = event.target;\n if (!(origin instanceof Element)) return;\n const control = origin.closest<HTMLElement>(\"button, a\");\n if (control === null || control.closest(\".oh-story-split-surface\") !== null) return;\n const candidates = [control.title, control.getAttribute(\"aria-label\"), control.textContent];\n for (const candidate of candidates) {\n const path = creativeRelativePath(candidate?.trim().replace(/^(?:Open|\u6253\u5F00)\\s+/u, \"\"), workspace.cwd);\n if (path === undefined || !knownPaths.has(path)) continue;\n event.preventDefault();\n event.stopPropagation();\n revealPath(path);\n break;\n }\n };\n sessionSurface.addEventListener(\"click\", followOfficialFileLink, true);\n return () => { sessionSurface.removeEventListener(\"click\", followOfficialFileLink, true); };\n }, [normalizedActivities.length, open, revealPath, workspace]);\n\n useEffect(() => {\n if (workbench !== \"game\" && workbench !== \"video\") return;\n const surface = surfaceRef.current;\n const sessionSurface = surface?.parentElement;\n const chat = Array.from(sessionSurface?.children ?? []).find((child) => child !== surface && child instanceof HTMLElement);\n if (!(chat instanceof HTMLElement)) return;\n const previous = {\n id: chat.id,\n role: chat.getAttribute(\"role\"),\n labelledBy: chat.getAttribute(\"aria-labelledby\")\n };\n chat.id = compactChatId;\n chat.setAttribute(\"role\", \"tabpanel\");\n chat.setAttribute(\"aria-labelledby\", `${compactTabsId}-chat-tab`);\n return () => {\n chat.id = previous.id;\n if (previous.role === null) chat.removeAttribute(\"role\");\n else chat.setAttribute(\"role\", previous.role);\n if (previous.labelledBy === null) chat.removeAttribute(\"aria-labelledby\");\n else chat.setAttribute(\"aria-labelledby\", previous.labelledBy);\n };\n }, [compactChatId, compactTabsId, workbench]);\n\n const savePath = useCallback(async (path: string) => {\n if (saveLocks.current.has(path)) return;\n const submitted = buffersRef.current[path];\n if (submitted === undefined || submitted.missing === true || submitted.content === submitted.saved) return;\n saveLocks.current.add(path);\n setBuffers((current) => {\n const existing = current[path];\n return existing === undefined ? current : { ...current, [path]: { ...existing, saving: true, error: undefined } };\n });\n try {\n const file = await json<FilePayload>(await fetch(endpoint(\"file\", sessionId, path), {\n method: \"PUT\",\n headers: { \"content-type\": \"application/json\" },\n body: JSON.stringify({ content: submitted.content, baseVersion: submitted.version })\n }));\n setBuffers((current) => {\n const latest = current[path];\n if (latest === undefined) return current;\n const unchanged = latest.content === submitted.content;\n return {\n ...current,\n [path]: {\n content: unchanged ? file.content : latest.content,\n saved: file.content,\n source: unchanged ? \"disk\" : \"human\",\n version: file.version,\n saving: false\n }\n };\n });\n reload();\n } catch (reason) {\n if (reason instanceof WorkspaceRequestError && reason.status === 412) {\n try {\n const theirs = await json<FilePayload>(await fetch(endpoint(\"file\", sessionId, path)));\n setBuffers((current) => {\n const latest = current[path];\n if (latest === undefined) return current;\n return {\n ...current,\n [path]: {\n ...latest,\n saving: false,\n conflict: {\n message: `${path} \u5DF2\u5728\u78C1\u76D8\u4E0A\u66F4\u65B0\uFF1B\u8BF7\u9009\u62E9\u4FDD\u7559\u54EA\u4E00\u7248\u3002`,\n theirs: theirs.content,\n theirsVersion: theirs.version\n }\n }\n };\n });\n } catch (refreshError) {\n setBuffers((current) => {\n const existing = current[path];\n return existing === undefined ? current : {\n ...current,\n [path]: { ...existing, saving: false, error: refreshError instanceof Error ? refreshError.message : String(refreshError) }\n };\n });\n }\n } else {\n setBuffers((current) => {\n const existing = current[path];\n return existing === undefined ? current : {\n ...current,\n [path]: { ...existing, saving: false, error: reason instanceof Error ? reason.message : String(reason) }\n };\n });\n }\n } finally {\n saveLocks.current.delete(path);\n }\n }, [reload, sessionId]);\n\n useEffect(() => {\n if (!open) return;\n const saveShortcut = (event: KeyboardEvent): void => {\n if (!(event.metaKey || event.ctrlKey) || event.key.toLocaleLowerCase() !== \"s\") return;\n event.preventDefault();\n if (selected !== undefined) void savePath(selected);\n };\n globalThis.addEventListener(\"keydown\", saveShortcut);\n return () => { globalThis.removeEventListener(\"keydown\", saveShortcut); };\n }, [open, savePath, selected]);\n\n const groups = useMemo(() => {\n const value = new Map<string, WorkspaceFile[]>();\n const all = [...(workspace?.files ?? [])].filter((file) => workbenchModeForPath(file.path) === workbench);\n if (activityPath !== undefined && !all.some((file) => file.path === activityPath)) all.push({ path: activityPath, bytes: 0, version: \"\", kind: \"text\" });\n all.sort((left, right) => left.path.localeCompare(right.path, \"zh-Hans-CN\"));\n for (const file of all) {\n const directory = groupForPath(file.path);\n const files = value.get(directory) ?? [];\n files.push(file);\n value.set(directory, files);\n }\n const order = GROUP_ORDER[workbench];\n return [...value.entries()].sort(([left], [right]) => {\n const leftIndex = order.indexOf(left);\n const rightIndex = order.indexOf(right);\n return (leftIndex < 0 ? order.length : leftIndex) - (rightIndex < 0 ? order.length : rightIndex)\n || left.localeCompare(right, \"zh-Hans-CN\");\n });\n }, [activityPath, workbench, workspace]);\n\n const selectWorkbench = (next: WorkbenchMode): void => {\n setWorkbench(next);\n if (next === \"game\" || next === \"video\") {\n if (next === \"game\") setGameTab(\"preview\");\n else setVideoTab(\"preview\");\n setSelected(undefined);\n return;\n }\n const target = workspace === undefined ? undefined : preferredWorkbenchFile(workspace.files, next);\n if (target === undefined) setSelected(undefined);\n else revealPath(target);\n };\n const selectEditorMode = (next: WorkbenchMemory[\"editorMode\"]): void => {\n if (next === \"preview\") rememberEditorPosition();\n setEditorMode(next);\n };\n const navigateProductionTarget = (target: DramaDocumentTarget): void => {\n const content = buffersRef.current[target.path]?.content ?? \"\";\n const before = content.slice(0, target.offset);\n const approximateScrollTop = Math.max(0, before.split(/\\r?\\n/u).length * 28 - 96);\n editorPositions.current.set(target.path, { scrollTop: approximateScrollTop, selectionStart: target.offset, selectionEnd: target.offset });\n modeSelection.current = target.path;\n revealPath(target.path);\n setEditorMode(\"source\");\n };\n const selectedLabel = selected ?? `\u5728\u5F53\u524D DSH workspace \u4E2D\u9009\u62E9${workbenchLabel(workbench)}\u6587\u4EF6`;\n const selectedBasename = selected?.split(\"/\").at(-1) ?? selectedLabel;\n const selectedGroup = selected === undefined ? undefined : groupForPath(selected);\n const toggleGroup = (key: string, open: boolean): void => {\n setExpanded((current) => ({ ...current, [key]: open }));\n };\n const resolveConflict = (keepLocal: boolean): void => {\n if (selected === undefined || conflict?.theirs === undefined || conflict.theirsVersion === undefined) return;\n const theirs = conflict.theirs;\n const theirsVersion = conflict.theirsVersion;\n setBuffers((current) => {\n const existing = current[selected];\n if (existing === undefined) return current;\n return {\n ...current,\n [selected]: keepLocal\n ? { ...existing, saved: theirs, version: theirsVersion, source: \"human\", conflict: undefined }\n : { content: theirs, saved: theirs, source: \"disk\", version: theirsVersion }\n };\n });\n };\n\n if (!open) {\n // Without creative work there is nothing to reveal, so the plugin leaves the\n // official conversation exactly as DSH renders it. A failed workspace request\n // still offers the way in, because that error is only readable inside the workbench.\n if (!creativeProject && error === undefined) return null;\n return <div ref={surfaceRef} className=\"oh-story-split-surface\" data-open=\"false\">\n <style>{styles}</style>\n <button className=\"oh-story-launcher\" type=\"button\" title={error ?? \"\u6253\u5F00\u521B\u4F5C\u5DE5\u4F5C\u53F0\"} aria-label=\"\u6253\u5F00\u521B\u4F5C\u5DE5\u4F5C\u53F0\" onClick={() => { applyWorkbenchPreference(\"open\"); }}>\n <span aria-hidden>\u2726</span><b>\u521B\u4F5C\u5DE5\u4F5C\u53F0</b>\n </button>\n </div>;\n }\n\n return <div ref={surfaceRef} className=\"oh-story-split-surface\" data-open=\"true\" data-workbench={workbench}>\n <style>{styles}</style>\n {(workbench === \"game\" || workbench === \"video\") && <div className=\"oh-game-mobile-switcher\" role=\"tablist\" aria-label={workbench === \"game\" ? \"\u7A84\u5C4F\u6E38\u620F\u5DE5\u4F5C\u53F0\" : \"\u7A84\u5C4F\u89C6\u9891\u5DE5\u4F5C\u53F0\"}>\n {([\"studio\", \"chat\"] as const).map((pane) => <button\n type=\"button\"\n role=\"tab\"\n key={pane}\n id={`${compactTabsId}-${pane}-tab`}\n aria-controls={pane === \"chat\" ? compactChatId : workbench === \"game\" ? compactStudioId : compactVideoStudioId}\n aria-selected={(workbench === \"game\" ? gamePane : videoPane) === pane}\n tabIndex={(workbench === \"game\" ? gamePane : videoPane) === pane ? 0 : -1}\n onKeyDown={(event) => { handleTabKey(event, [\"studio\", \"chat\"] as const, workbench === \"game\" ? gamePane : videoPane, workbench === \"game\" ? setGamePane : setVideoPane); }}\n onClick={() => { if (workbench === \"game\") setGamePane(pane); else setVideoPane(pane); }}\n >{pane === \"studio\" ? \"\u5236\u4F5C\" : \"\u5BF9\u8BDD\"}</button>)}\n </div>}\n {workbench === \"game\" && workspace === undefined && <main id={compactStudioId} className=\"oh-game-studio\" role=\"tabpanel\" aria-labelledby={`${compactTabsId}-studio-tab`}><div className=\"oh-game-design-empty\">{error ?? \"\u6B63\u5728\u8FDE\u63A5\u6E38\u620F\u5DE5\u4F5C\u53F0\u2026\"}</div></main>}\n {workspace !== undefined && gameStudioMounted && <GameStudio\n sessionId={sessionId}\n workspace={workspace}\n building={gameBuilding}\n selected={selected}\n gameTab={gameTab}\n gameProjectId={gameProjectId}\n hidden={workbench !== \"game\"}\n onGameTab={setGameTab}\n onGameProject={setGameProjectId}\n workbenches={WORKBENCH_MODES}\n paneId={compactStudioId}\n labelledBy={`${compactTabsId}-studio-tab`}\n onWorkbench={selectWorkbench}\n onCollapse={() => { applyWorkbenchPreference(\"closed\"); }}\n onSelect={revealPath}\n />}\n {workbench === \"video\" && workspace === undefined && <main id={compactVideoStudioId} className=\"oh-video-studio\" role=\"tabpanel\" aria-labelledby={`${compactTabsId}-studio-tab`}><div className=\"oh-video-preview-empty\">{error ?? \"\u6B63\u5728\u8FDE\u63A5\u89C6\u9891\u5DE5\u4F5C\u53F0\u2026\"}</div></main>}\n {workspace !== undefined && videoStudioMounted && <VideoStudio\n sessionId={sessionId}\n projects={workspace.videos}\n running={videoBuilding}\n projectId={videoProjectId}\n tab={videoTab}\n hidden={workbench !== \"video\"}\n workbenches={WORKBENCH_MODES}\n paneId={compactVideoStudioId}\n labelledBy={`${compactTabsId}-studio-tab`}\n onProject={setVideoProjectId}\n onTab={setVideoTab}\n onWorkbench={selectWorkbench}\n onCollapse={() => { applyWorkbenchPreference(\"closed\"); }}\n />}\n {workbench !== \"game\" && workbench !== \"video\" && <>\n <aside className=\"oh-story-tree\">\n <div className=\"oh-story-brand\">\n <span className=\"oh-story-brand-cluster\"><strong>\u2726 <span>Oh Story</span></strong>{workspaceKind !== undefined && <span className=\"oh-story-kind\">{workspaceKind === \"story\" ? \"\u5C0F\u8BF4\" : \"\u77ED\u5267\"}</span>}</span>\n <span className=\"oh-story-brand-actions\">\n <button type=\"button\" onClick={reload} title=\"\u5237\u65B0\" aria-label=\"\u5237\u65B0\u9879\u76EE\u6587\u4EF6\">\u21BB</button>\n <button type=\"button\" onClick={() => { applyWorkbenchPreference(\"closed\"); }} title=\"\u6536\u8D77\u521B\u4F5C\u5DE5\u4F5C\u53F0\" aria-label=\"\u6536\u8D77\u521B\u4F5C\u5DE5\u4F5C\u53F0\">\u00D7</button>\n </span>\n </div>\n {workspace !== undefined && <div className=\"oh-story-mode-tabs\" role=\"tablist\" aria-label=\"\u521B\u4F5C\u5DE5\u4F5C\u53F0\">\n {WORKBENCH_MODES.map((mode) => <button\n type=\"button\"\n role=\"tab\"\n key={mode}\n tabIndex={workbench === mode ? 0 : -1}\n aria-selected={workbench === mode}\n onKeyDown={(event) => { handleTabKey(event, WORKBENCH_MODES, workbench, selectWorkbench); }}\n onClick={() => { selectWorkbench(mode); }}\n >{workbenchLabel(mode)}</button>)}\n </div>}\n {error !== undefined && <div className=\"oh-story-error\">{error}</div>}\n {workspace?.metadataErrors.map((message) => <div className=\"oh-story-warning\" key={message}>{message}</div>)}\n <nav ref={navRef} aria-label={workbench === \"story\" ? \"\u5C0F\u8BF4\u9879\u76EE\u6587\u4EF6\" : \"\u77ED\u5267\u9879\u76EE\u6587\u4EF6\"}>\n {groups.map(([directory, files]) => {\n const groupOpen = selectedGroup === directory || expanded[directory] === true;\n return <details className=\"oh-story-file-group\" key={directory} open={groupOpen} onToggle={(event) => { toggleGroup(directory, event.currentTarget.open); }}>\n <summary>{directory}<span>{files.length}</span></summary>\n <FileTreeNodes\n nodes={buildFileTree(files, directory)}\n depth={1}\n expanded={expanded}\n selected={selected}\n activityPath={activityPath}\n onToggle={toggleGroup}\n onSelect={revealPath}\n />\n </details>;\n })}\n </nav>\n </aside>\n <main className=\"oh-story-editor\">\n <header>\n <span className=\"oh-story-editor-path\" title={selected}><span>{selectedLabel}</span><strong>{selectedBasename}</strong></span>\n <div className=\"oh-story-editor-actions\">\n {(previewable || productionAvailable) && !selectedMedia && <div className=\"oh-story-editor-tabs\" role=\"tablist\" aria-label={productionAvailable ? \"\u77ED\u5267\u6587\u6863\u67E5\u770B\u65B9\u5F0F\" : markdown ? \"Markdown \u67E5\u770B\u65B9\u5F0F\" : \"JSONL \u67E5\u770B\u65B9\u5F0F\"}>\n {editorModes.map((mode) => <button\n type=\"button\"\n role=\"tab\"\n key={mode}\n tabIndex={editorMode === mode ? 0 : -1}\n aria-selected={editorMode === mode}\n onKeyDown={(event) => { handleTabKey(event, editorModes, editorMode, selectEditorMode); }}\n onClick={() => { selectEditorMode(mode); }}\n >{mode === \"preview\" ? \"\u9884\u89C8\" : mode === \"source\" ? \"\u6E90\u7801\" : \"\u751F\u4EA7\"}</button>)}\n </div>}\n {(dirty || saving) && selected !== undefined && <button className=\"oh-story-save\" type=\"button\" disabled={saving || buffer?.missing === true} onClick={() => { void savePath(selected); }}>\n {saving ? \"\u4FDD\u5B58\u4E2D\u2026\" : \"\u4FDD\u5B58\"}\n </button>}\n </div>\n </header>\n {activity !== undefined && activityPath !== undefined && activityPath === selected && <div className=\"oh-story-stream\" data-stage={activity.stage} role=\"status\" aria-live=\"polite\">\u25CF {activity.stage === \"running\" ? \"Agent \u6B63\u5728\u5E94\u7528\u4FEE\u6539\" : \"Agent \u6B63\u5728\u751F\u6210\u6587\u4EF6\u5185\u5BB9\"}</div>}\n {conflict !== undefined && <div className=\"oh-story-conflict\" role=\"alert\">\n <span>{conflict.message}</span>\n {conflict.theirs !== undefined && conflict.theirsVersion !== undefined && selected !== undefined && <div>\n <button type=\"button\" onClick={() => { resolveConflict(false); }}>\u8F7D\u5165\u78C1\u76D8\u7248\u672C</button>\n <button type=\"button\" onClick={() => { resolveConflict(true); }}>\u4FDD\u7559\u672C\u5730\u8349\u7A3F</button>\n </div>}\n </div>}\n {fileError !== undefined && <div className=\"oh-story-error\">{fileError}</div>}\n {selected === undefined\n ? <div className=\"oh-story-empty\">{workbench === \"story\"\n ? <>\u5F53\u524D workspace \u8FD8\u6CA1\u6709\u5C0F\u8BF4\u6587\u4EF6\u3002\u53EF\u5728\u53F3\u4FA7 Chat \u4E2D\u8FD0\u884C <code>/story-setup</code>\u3002</>\n : <>\u5F53\u524D workspace \u8FD8\u6CA1\u6709\u77ED\u5267\u9879\u76EE\u3002\u53EF\u5728\u53F3\u4FA7 Chat \u4E2D\u8FD0\u884C <code>/short-drama</code>\u3002</>}</div>\n : selectedMedia && selectedFile !== undefined\n ? <div className=\"oh-story-media-document\">{selectedFile.mimeType?.startsWith(\"image/\") === true\n ? <img src={endpoint(\"media\", sessionId, selectedFile.path)} alt={selectedFile.path} />\n : selectedFile.mimeType?.startsWith(\"audio/\") === true\n ? <audio src={endpoint(\"media\", sessionId, selectedFile.path)} controls />\n : <video src={endpoint(\"media\", sessionId, selectedFile.path)} controls preload=\"metadata\" />}</div>\n : buffer === undefined\n ? <div className=\"oh-story-empty\">\u6B63\u5728\u52A0\u8F7D {selected}\u2026</div>\n : buffer.missing === true\n ? <div className=\"oh-story-empty\">\u6587\u4EF6\u5DF2\u4ECE workspace \u79FB\u9664\uFF0C\u672C\u5730\u8349\u7A3F\u4ECD\u4FDD\u7559\u3002\u8BF7\u5148\u590D\u5236\u9700\u8981\u7684\u5185\u5BB9\uFF0C\u518D\u653E\u5F03\u8349\u7A3F\u3002<button type=\"button\" onClick={() => {\n setBuffers((current) => {\n const next = { ...current };\n delete next[selected];\n return next;\n });\n setSelected(workspace === undefined ? undefined : preferredWorkbenchFile(workspace.files, workbench));\n }}>\u653E\u5F03\u672C\u5730\u8349\u7A3F</button></div>\n : editorMode === \"production\" && productionAvailable && episodeProduction !== undefined\n ? <DramaProductionView\n sessionId={sessionId}\n production={episodeProduction}\n sessionRunning={sessionRunning}\n queue={productionQueue}\n section={productionSection}\n selectedId={productionSelectedId}\n jobs={productionJobs}\n versions={productionVersions}\n libraryVersions={productionLibrary}\n selections={productionSelections}\n manualReferences={productionReferences}\n sequence={productionSequence}\n canvas={productionCanvas}\n zoom={productionZoom}\n onSectionChange={setProductionSection}\n onSelect={setProductionSelectedId}\n onNavigate={navigateProductionTarget}\n onJobsChange={setProductionJobs}\n onSelectionsChange={setProductionSelections}\n onManualReferencesChange={setProductionReferences}\n onOpenMedia={(path) => { revealPath(path); }}\n onSequenceChange={setProductionSequence}\n onCanvasChange={setProductionCanvas}\n onZoomChange={setProductionZoom}\n onDispatchPrompt={sendProductionPrompt}\n onCancelTurn={cancelProduction}\n onRemoveQueued={removeQueuedProduction}\n onRefresh={reload}\n />\n : previewable && editorMode === \"preview\"\n ? markdown\n ? <MarkdownPreview content={buffer.content} label={selected} />\n : <JsonlPreview content={buffer.content} label={selected} />\n : <textarea\n ref={textareaRef}\n value={buffer.content}\n data-format={structured ? \"structured\" : \"prose\"}\n onBlur={rememberEditorPosition}\n onScroll={rememberEditorPosition}\n onSelect={rememberEditorPosition}\n onChange={(event) => {\n const content = event.target.value;\n setBuffers((current) => ({\n ...current,\n [selected]: {\n content,\n saved: current[selected]?.saved ?? \"\",\n source: \"human\",\n version: current[selected]?.version ?? \"\",\n conflict: current[selected]?.conflict,\n saving: current[selected]?.saving\n }\n }));\n }}\n spellCheck={!structured}\n aria-label={selected}\n />}\n </main>\n </>}\n </div>;\n}\n\ninterface ProductionConversationFace {\n readonly sendProductionPrompt: (prompt: string) => Promise<void>;\n readonly cancelProduction: () => Promise<void>;\n readonly removeQueuedProduction: (itemId: string) => Promise<void>;\n}\n\ntype WorkbenchSlotProps = PropsRuntime<\"oh-story.workspace\"> & PropsStore<ReturnType<typeof createWorkbenchStore>> & ProductionConversationFace;\n\n/** Mount beside the official conversation without replacing Chat or Composer. */\nfunction CreativeSplitBridge({ sessionId, useSession, useChat, useStore, actions, sendProductionPrompt, cancelProduction, removeQueuedProduction }: WorkbenchSlotProps) {\n const marker = useRef<HTMLSpanElement>(null);\n const [target, setTarget] = useState<HTMLElement>();\n const runningCalls = useChat((snapshot) => snapshot.legacy.runningCalls);\n const partial = useChat((snapshot) => streamingAssistant(snapshot.timeline));\n const settledMutation = useChat((snapshot) => latestSettledMutation(snapshot));\n const workbench = useStore((memory) => memory.workbench);\n const gamePane = useStore((memory) => memory.gamePane);\n const videoPane = useStore((memory) => memory.videoPane);\n const sessionRunning = useSession((snapshot) => snapshot.running);\n const productionQueue = useSession((snapshot) => snapshot.queue.map((item) => ({ id: item.id, preview: item.preview })));\n const chat = useChat((snapshot) => snapshot);\n const productionIntents = useMemo(() => settledProductionIntents(chat), [chat]);\n const { workspace, error, loading: workspaceLoading, reload } = useWorkspace(sessionId);\n const chosenPreference = useStore((memory) => memory.workbenchPreference);\n const creativeProject = hasCreativeProject(workspace);\n // The Session Store holds this Session's choice; localStorage carries the workspace's\n // last choice across restarts. Reading it here keeps the decision in the same render\n // that learns the workspace, so a collapsed workbench never flashes the layout open.\n const storedPreference = useMemo(\n () => readWorkbenchPreference(workbenchPreferenceStorage(), workspace?.cwd),\n [workspace?.cwd]\n );\n const preference = chosenPreference ?? storedPreference;\n const open = resolveWorkbenchOpen(preference, creativeProject);\n useLayoutEffect(() => {\n const document = marker.current?.ownerDocument;\n if (document === undefined) return;\n const locate = (): void => {\n const anchor = document.querySelector<HTMLElement>(\"[data-conversation-scroll] > [data-slot='conversation.session']\");\n setTarget((current) => current === anchor ? current : anchor ?? undefined);\n };\n locate();\n const observer = new MutationObserver(locate);\n observer.observe(document.body, { childList: true, subtree: true });\n return () => { observer.disconnect(); };\n }, [sessionId]);\n useLayoutEffect(() => {\n const scroller = target?.parentElement;\n if (scroller === undefined || scroller === null) return;\n if (!open) {\n // A collapsed workbench returns the conversation to DSH untouched, so the only\n // measurement left is where that column sits: the launcher floats over its corner.\n const publishSeam = (): void => {\n const box = scroller.getBoundingClientRect();\n scroller.style.setProperty(\"--oh-story-seam-top\", `${String(box.top)}px`);\n scroller.style.setProperty(\"--oh-story-seam-right\", `${String(scroller.ownerDocument.documentElement.clientWidth - box.right)}px`);\n };\n publishSeam();\n const seams = new ResizeObserver(publishSeam);\n seams.observe(scroller);\n const view = scroller.ownerDocument.defaultView;\n view?.addEventListener(\"resize\", publishSeam);\n return () => {\n seams.disconnect();\n view?.removeEventListener(\"resize\", publishSeam);\n scroller.style.removeProperty(\"--oh-story-seam-top\");\n scroller.style.removeProperty(\"--oh-story-seam-right\");\n };\n }\n const composerSeat = (): HTMLElement | null => scroller.querySelector(\":scope > [data-composer-seat]\");\n // The seat overlaps the Chat column here, so a reader parked at the tail has\n // to be carried across every layout pass; losing the tail does not merely\n // scroll it out of sight, it leaves the last lines behind the Composer.\n // Being parked cannot be read inside the pass \u2014 a reflow moves the tail\n // before the observer runs \u2014 and it cannot be read from scroll events alone\n // either: the Chat settles over several frames after a resize and every one\n // of those frames scrolls without the reader asking. So only a scroll the\n // reader actually drove releases the tail; reaching the bottom always\n // reclaims it.\n const parkedAtTail = (): boolean => scroller.scrollHeight - scroller.scrollTop - scroller.clientHeight <= 8;\n let parked = parkedAtTail();\n let drivenAt = 0;\n const markDriven = (event: Event): void => {\n if (event.target instanceof Node && composerSeat()?.contains(event.target) === true) return;\n drivenAt = performance.now();\n };\n const trackParked = (): void => {\n if (parkedAtTail()) parked = true;\n else if (performance.now() - drivenAt < 400) parked = false;\n };\n const publishLayout = (): void => {\n scroller.style.setProperty(\"--oh-story-scroll-height\", `${String(scroller.clientHeight)}px`);\n // DSH 0.1.2 grows the seat with the streaming Todo panel while\n // --dsh-composer-height keeps reporting the bare input height. Publish the\n // measurement beside it rather than over it: the CSS takes the larger, so\n // writing the variable DSH also owns can never turn into a resize duel.\n scroller.style.setProperty(\"--oh-story-composer-height\", `${String(composerSeat()?.getBoundingClientRect().height ?? 0)}px`);\n scroller.dataset.ohStoryWorkbench = workbench;\n const studioPane = workbench === \"video\" ? videoPane : gamePane;\n scroller.dataset.ohStudioPane = studioPane;\n const compactAt = workbench === \"game\" || workbench === \"video\" ? 720 : 620;\n const mediumAt = workbench === \"game\" || workbench === \"video\" ? 960 : 900;\n const layout = scroller.clientWidth < compactAt ? \"compact\" : scroller.clientWidth < mediumAt ? \"medium\" : \"wide\";\n if (scroller.dataset.ohStoryLayout !== layout) scroller.dataset.ohStoryLayout = layout;\n if (parked) scroller.scrollTop = scroller.scrollHeight - scroller.clientHeight;\n };\n const observer = new ResizeObserver(publishLayout);\n const observed = new WeakSet<Element>();\n // The official seat and Chat flow mount and remount independently of this\n // bridge. The flow is observed because a resized Chat keeps re-wrapping for\n // several frames afterwards: pinning once against the height the first frame\n // reports leaves the reader behind the Composer again once it settles.\n let flowObserved = false;\n const observePanes = (): void => {\n const flow = scroller.querySelector(\"[data-chat-flow]\");\n flowObserved = flow !== null;\n for (const pane of [composerSeat(), flow]) {\n if (pane === null || observed.has(pane)) continue;\n observed.add(pane);\n observer.observe(pane);\n }\n };\n publishLayout();\n scroller.addEventListener(\"scroll\", trackParked, { passive: true });\n for (const driven of [\"wheel\", \"touchmove\", \"pointerdown\", \"keydown\"]) {\n scroller.addEventListener(driven, markDriven, { passive: true });\n }\n observer.observe(scroller);\n observePanes();\n const seats = new MutationObserver(() => { observePanes(); publishLayout(); });\n seats.observe(scroller, { childList: true });\n // The flow mounts below the seat's level, and streaming mutates it token by\n // token: watch the subtree only until it has been found once.\n const panes = new MutationObserver(() => { if (!flowObserved) observePanes(); });\n panes.observe(scroller, { childList: true, subtree: true });\n return () => {\n panes.disconnect();\n scroller.removeEventListener(\"scroll\", trackParked);\n for (const driven of [\"wheel\", \"touchmove\", \"pointerdown\", \"keydown\"]) {\n scroller.removeEventListener(driven, markDriven);\n }\n observer.disconnect();\n seats.disconnect();\n scroller.style.removeProperty(\"--oh-story-scroll-height\");\n scroller.style.removeProperty(\"--oh-story-composer-height\");\n delete scroller.dataset.ohStoryLayout;\n delete scroller.dataset.ohStoryWorkbench;\n delete scroller.dataset.ohStudioPane;\n };\n }, [gamePane, open, target, videoPane, workbench]);\n return <>\n <span ref={marker} className=\"oh-story-bridge-marker\" aria-hidden />\n {target === undefined ? null : createPortal(<CreativeWorkbench\n sessionId={sessionId}\n runningCalls={runningCalls}\n partial={partial}\n settledMutation={settledMutation}\n sessionRunning={sessionRunning}\n productionQueue={productionQueue}\n productionIntents={productionIntents}\n workspace={workspace}\n error={error}\n workspaceLoading={workspaceLoading}\n reload={reload}\n open={open}\n creativeProject={creativeProject}\n sendProductionPrompt={sendProductionPrompt}\n cancelProduction={cancelProduction}\n removeQueuedProduction={removeQueuedProduction}\n useStore={useStore}\n actions={actions}\n />, target)}\n </>;\n}\n\ntype WorkbenchSeatProps = PropsRuntime<\"shell.overlay\"> & PropsRenderSlots<\"oh-story.workspace\">;\n\nfunction WorkbenchSeat({ SessionProvider, renderSlot }: WorkbenchSeatProps) {\n return <SessionProvider>{renderSlot(\"oh-story.workspace\", {})}</SessionProvider>;\n}\n\nfunction argsOf(block: ToolCallViewProps[\"block\"]): Record<string, unknown> {\n const raw = (\"kind\" in block ? block.call?.argsRaw : block.argsRaw) ?? \"{}\";\n try {\n const value = JSON.parse(raw) as unknown;\n return typeof value === \"object\" && value !== null && !Array.isArray(value) ? value as Record<string, unknown> : {};\n } catch { return {}; }\n}\n\nfunction resultOf(block: ToolCallViewProps[\"block\"]): string | undefined {\n if (!(\"kind\" in block)) return undefined;\n return block.content.map((item) => item.type === \"text\" ? item.text : JSON.stringify(item, null, 2)).join(\"\\n\");\n}\n\nfunction RoleToolView({ block, inspect }: ToolCallViewProps) {\n const args = argsOf(block);\n const role = typeof args.role === \"string\" ? args.role : \"story-role\";\n const output = resultOf(block);\n const state = !(\"kind\" in block) ? \"running\" : block.isError ? \"error\" : \"done\";\n return <details className=\"oh-story-role\" data-state={state}>\n <style>{styles}</style>\n <summary><span>\u2726 Role</span><strong>{role}</strong><em>{state === \"running\" ? \"\u8FD0\u884C\u4E2D\" : state === \"error\" ? \"\u5931\u8D25\" : \"\u5B8C\u6210\"}</em></summary>\n {output !== undefined && <pre>{output}</pre>}\n {inspect !== undefined && <button type=\"button\" onClick={inspect}>\u5728\u8F68\u8FF9\u4E2D\u68C0\u67E5</button>}\n </details>;\n}\n\nfunction ProductionToolView({ block, inspect }: ToolCallViewProps) {\n const args = argsOf(block);\n const action = typeof args.action === \"string\" ? args.action : \"production\";\n const episode = typeof args.episode === \"string\" ? args.episode : \"\u77ED\u5267\";\n const state = !(\"kind\" in block) ? \"running\" : block.isError ? \"error\" : \"done\";\n return <details className=\"oh-story-role\" data-state={state}>\n <style>{styles}</style>\n <summary><span>\u25A6 \u751F\u4EA7</span><strong>{episode} \u00B7 {action}</strong><em>{state === \"running\" ? \"\u6267\u884C\u4E2D\" : state === \"error\" ? \"\u5931\u8D25\" : \"\u5DF2\u5E94\u7528\"}</em></summary>\n {resultOf(block) !== undefined && <pre>{resultOf(block)}</pre>}\n {inspect !== undefined && <button type=\"button\" onClick={inspect}>\u5728\u8F68\u8FF9\u4E2D\u68C0\u67E5</button>}\n </details>;\n}\n\n/** Register only official DSH surfaces; the split bridge never replaces Chat. */\nexport function apply(context: ClientContext): void {\n context.slots.inject(\"shell.overlay\", () => {\n const disposeSeat = context.slots.register({\n name: \"shell.overlay\",\n id: \"oh-story-workspace\",\n order: -100,\n children: { \"oh-story.workspace\": { kind: \"single\", scope: \"session\" } }\n }, WorkbenchSeat);\n const disposeWorkbench = context.slots.register({\n name: \"oh-story.workspace\",\n store: createWorkbenchStore,\n inject: (sessionId) => {\n const binding = (context.sessions as unknown as ISessions).binding(sessionId);\n const conversation = binding?.ctx.get(\"conversation\");\n if (binding === undefined || conversation === undefined) {\n return {\n sendProductionPrompt: () => Promise.reject(new Error(\"DSH \u4F1A\u8BDD\u5F53\u524D\u4E0D\u53EF\u7528\u3002\")),\n cancelProduction: () => Promise.reject(new Error(\"DSH \u4F1A\u8BDD\u5F53\u524D\u4E0D\u53EF\u7528\u3002\")),\n removeQueuedProduction: () => Promise.reject(new Error(\"DSH \u4F1A\u8BDD\u5F53\u524D\u4E0D\u53EF\u7528\u3002\"))\n };\n }\n return {\n sendProductionPrompt: (prompt: string) => conversation.send(prompt),\n cancelProduction: () => conversation.cancel(),\n removeQueuedProduction: (itemId: string) => conversation.updateQueue(itemId as Parameters<IConversation[\"updateQueue\"]>[0], { kind: \"remove\" })\n };\n }\n }, CreativeSplitBridge);\n return [disposeSeat, disposeWorkbench];\n });\n context.slots.inject(\"tool.call.toolview\", () => context.slots.register({\n name: \"tool.call.toolview\",\n key: \"oh_story_role\"\n }, RoleToolView));\n context.slots.inject(\"tool.call.toolview\", () => context.slots.register({\n name: \"tool.call.toolview\",\n key: OH_STORY_PRODUCTION_TOOL_NAME\n }, ProductionToolView));\n}\n\nexport default { name, inject, apply };\n", "import type { AssistantChatData, ChatSnapshot } from \"@deepseek-ai/dsh-client-ui-chat/client\";\nimport type {\n ConversationTimelineSnapshot,\n PartialAssistant,\n RunningToolCall,\n ToolCallBlock\n} from \"@deepseek-ai/dsh-client-ui-conversation/client\";\n\nexport type MutationToolName = \"write\" | \"edit\" | \"str_replace_editor\";\n\nexport interface FileMutationActivity {\n readonly callId: string;\n readonly name: MutationToolName;\n readonly argsRaw: string;\n readonly stage: \"streaming\" | \"running\";\n readonly path: string | undefined;\n readonly operation: \"replace-file\" | \"replace-text\" | \"insert-text\" | undefined;\n readonly oldText: string | undefined;\n readonly newText: string | undefined;\n readonly replaceAll: boolean;\n}\n\ninterface JsonStringPrefix {\n readonly value: string;\n readonly complete: boolean;\n}\n\nexport type WorkbenchMode = \"story\" | \"drama\" | \"game\" | \"video\";\n\nconst WORKBENCH_LABELS: Readonly<Record<WorkbenchMode, string>> = {\n story: \"\u5C0F\u8BF4\",\n drama: \"\u77ED\u5267\",\n game: \"\u6E38\u620F\",\n video: \"\u89C6\u9891\"\n};\n\nexport function workbenchLabel(mode: WorkbenchMode): string {\n return WORKBENCH_LABELS[mode];\n}\n\nexport interface WorkspaceFilePath {\n readonly path: string;\n}\n\nconst STORY_DIRECTORIES = new Set([\"\u6B63\u6587\", \"\u5927\u7EB2\", \"\u8BBE\u5B9A\", \"\u8FFD\u8E2A\", \"\u5BF9\u6807\", \"\u53C2\u8003\u8D44\u6599\"]);\nconst DRAMA_DIRECTORIES = new Set([\"\u8F93\u5165\", \"\u9879\u76EE\u5F00\u53D1\", \"\u8BBE\u5B9A\u96C6\", \"\u5267\u96C6\", \"\u4EA4\u4ED8\", \"\u521B\u4F5C\u8005\u51B3\u7B56\", \"\u5BA1\u67E5\"]);\nconst GAME_DIRECTORY = \"game-adaptations\";\nconst VIDEO_DIRECTORY = \"video-recaps\";\nconst EDITABLE_EXTENSION = /\\.(?:md|txt|json|jsonl|html|css|[cm]?js|tsx?|jsx)$/iu;\nconst MUTATING_CALLS = new Set([\"write\", \"edit\", \"str_replace_editor\", \"bash\", \"run_code\", \"oh_story_role\"]);\n\n/** Read the latest running Assistant step, including tool-only steps hidden from the Chat list. */\nexport function streamingAssistant(timeline: ConversationTimelineSnapshot): PartialAssistant | null {\n for (const turnNumber of timeline.turnOrder.toReversed()) {\n const turn = timeline.turns.get(turnNumber);\n if (turn === undefined) continue;\n for (const step of turn.steps.toReversed()) {\n const assistant: AssistantChatData | undefined = step.data.get(\"assistant-step\");\n if (assistant?.status === \"running\") return assistant;\n }\n }\n return null;\n}\n\nfunction decodeEscape(character: string): string | undefined {\n switch (character) {\n case \"\\\"\": return \"\\\"\";\n case \"\\\\\": return \"\\\\\";\n case \"/\": return \"/\";\n case \"b\": return \"\\b\";\n case \"f\": return \"\\f\";\n case \"n\": return \"\\n\";\n case \"r\": return \"\\r\";\n case \"t\": return \"\\t\";\n default: return undefined;\n }\n}\n\n/** Read a JSON string even while the model is still streaming its closing quote. */\nexport function jsonStringPrefix(raw: string, key: string): JsonStringPrefix | undefined {\n const match = new RegExp(`\"${key.replace(/[.*+?^${}()|[\\]\\\\]/gu, \"\\\\$&\")}\"\\\\s*:\\\\s*\"`, \"u\").exec(raw);\n if (match === null) return undefined;\n let value = \"\";\n for (let index = match.index + match[0].length; index < raw.length; index += 1) {\n const character = raw[index] ?? \"\";\n if (character === \"\\\"\") return { value, complete: true };\n if (character !== \"\\\\\") { value += character; continue; }\n const escape = raw[index + 1];\n if (escape === undefined) return { value, complete: false };\n if (escape === \"u\") {\n const hex = raw.slice(index + 2, index + 6);\n if (!/^[\\da-f]{4}$/iu.test(hex)) return { value, complete: false };\n value += String.fromCharCode(Number.parseInt(hex, 16));\n index += 5;\n continue;\n }\n const decoded = decodeEscape(escape);\n if (decoded === undefined) return { value, complete: false };\n value += decoded;\n index += 1;\n }\n return { value, complete: false };\n}\n\nfunction completedString(raw: string, key: string): string | undefined {\n const value = jsonStringPrefix(raw, key);\n return value?.complete === true ? value.value : undefined;\n}\n\nfunction parsedArgs(raw: string): Record<string, unknown> | undefined {\n try {\n const value = JSON.parse(raw) as unknown;\n return typeof value === \"object\" && value !== null && !Array.isArray(value) ? value as Record<string, unknown> : undefined;\n } catch { return undefined; }\n}\n\nfunction mutationFromArgs(name: string, callId: string, argsRaw: string, stage: FileMutationActivity[\"stage\"]): FileMutationActivity | undefined {\n const complete = parsedArgs(argsRaw);\n if (name === \"write\") {\n return {\n callId, name, argsRaw, stage,\n path: jsonStringPrefix(argsRaw, \"file_path\")?.value,\n operation: \"replace-file\",\n oldText: undefined,\n newText: jsonStringPrefix(argsRaw, \"content\")?.value,\n replaceAll: false\n };\n }\n if (name === \"edit\") {\n return {\n callId, name, argsRaw, stage,\n path: jsonStringPrefix(argsRaw, \"file_path\")?.value,\n operation: \"replace-text\",\n oldText: completedString(argsRaw, \"old_string\"),\n newText: jsonStringPrefix(argsRaw, \"new_string\")?.value,\n replaceAll: complete?.replace_all === true\n };\n }\n if (name !== \"str_replace_editor\") return undefined;\n const command = completedString(argsRaw, \"command\");\n if (command === \"view\") return undefined;\n const path = jsonStringPrefix(argsRaw, \"path\")?.value;\n if (command === \"create\") {\n return {\n callId, name, argsRaw, stage, path,\n operation: \"replace-file\",\n oldText: undefined,\n newText: jsonStringPrefix(argsRaw, \"file_text\")?.value,\n replaceAll: false\n };\n }\n if (command === \"str_replace\") {\n return {\n callId, name, argsRaw, stage, path,\n operation: \"replace-text\",\n oldText: completedString(argsRaw, \"old_str\"),\n newText: jsonStringPrefix(argsRaw, \"new_str\")?.value ?? (complete !== undefined ? \"\" : undefined),\n replaceAll: complete?.replace_all === true\n };\n }\n if (command === \"insert\") {\n return {\n callId, name, argsRaw, stage, path,\n operation: \"insert-text\",\n oldText: undefined,\n newText: jsonStringPrefix(argsRaw, \"new_str\")?.value,\n replaceAll: false\n };\n }\n return { callId, name, argsRaw, stage, path, operation: undefined, oldText: undefined, newText: undefined, replaceAll: false };\n}\n\nfunction visitRunning(blocks: readonly ToolCallBlock[], visit: (call: RunningToolCall) => void): void {\n for (const block of blocks) {\n if (!(\"kind\" in block)) visit(block);\n visitRunning(block.subCalls, visit);\n }\n}\n\n/** Return every active file mutation in official DSH dispatch order, including nested Code Mode calls. */\nexport function fileMutations(\n runningCalls: readonly RunningToolCall[],\n partial: PartialAssistant | null = null\n): FileMutationActivity[] {\n const values: FileMutationActivity[] = [];\n visitRunning(runningCalls, (call) => {\n const mutation = mutationFromArgs(call.name, call.callId, call.argsRaw, \"running\");\n if (mutation !== undefined) values.push(mutation);\n });\n for (const block of partial?.blocks ?? []) {\n if (block.kind !== \"tool-call\") continue;\n const value = mutationFromArgs(block.name, block.callId, block.argsRaw, \"streaming\");\n if (value !== undefined && !values.some((candidate) => candidate.callId === value.callId)) values.push(value);\n }\n return values;\n}\n\n/** Running calls whose settlement may have changed creative files. */\nexport function mutatingCallIds(runningCalls: readonly RunningToolCall[]): ReadonlySet<string> {\n const ids = new Set<string>();\n visitRunning(runningCalls, (call) => { if (MUTATING_CALLS.has(call.name)) ids.add(call.callId); });\n return ids;\n}\n\nfunction settledMutationSignals(block: ToolCallBlock): string[] {\n const nested = block.subCalls.flatMap(settledMutationSignals);\n if (!(\"kind\" in block) || block.isError) return nested;\n if (block.call === null) return nested;\n const mutation = mutationFromArgs(block.call.name, block.callId, block.call.argsRaw, \"running\");\n return mutation?.path === undefined ? nested : [`${block.callId}\\0${mutation.path}`, ...nested];\n}\n\n/** Latest durable successful mutation, used when a fast call skips the live render window. */\nexport function latestSettledMutation(chat: ChatSnapshot): string | undefined {\n for (const key of chat.order.toReversed()) {\n const node = chat.nodes.get(key);\n if (node?.kind !== \"tool-call\") continue;\n const root = (node.data as { readonly root?: ToolCallBlock }).root;\n const signal = root === undefined ? undefined : settledMutationSignals(root).at(-1);\n if (signal !== undefined) return signal;\n }\n return undefined;\n}\n\n/** Convert a DSH tool path to the creative-relative path accepted by the narrow route. */\nexport function creativeRelativePath(path: string | undefined, cwd: string | undefined): string | undefined {\n if (path === undefined || path === \"\") return undefined;\n const normalized = path.replaceAll(\"\\\\\", \"/\");\n const root = cwd?.replaceAll(\"\\\\\", \"/\").replace(/\\/$/u, \"\");\n const insideRoot = root !== undefined && normalized.startsWith(`${root}/`);\n if ((normalized.startsWith(\"/\") || /^[a-z]:\\//iu.test(normalized) || normalized.startsWith(\"file:\")) && !insideRoot) return undefined;\n const relative = insideRoot ? normalized.slice(root.length + 1) : normalized.replace(/^\\.\\//u, \"\");\n const [directory] = relative.split(\"/\", 1);\n const creative = directory !== undefined && (STORY_DIRECTORIES.has(directory) || DRAMA_DIRECTORIES.has(directory) || directory === GAME_DIRECTORY || directory === VIDEO_DIRECTORY);\n if ((!creative && relative !== \"short-drama.json\") || !EDITABLE_EXTENSION.test(relative)) return undefined;\n if (relative.split(\"/\").some((part) => part === \"..\" || part === \".\" || part === \"\")) return undefined;\n return relative;\n}\n\nexport function workbenchModeForPath(path: string | undefined): WorkbenchMode | undefined {\n if (path === \"short-drama.json\") return \"drama\";\n const directory = path?.split(\"/\", 1)[0];\n if (directory !== undefined && STORY_DIRECTORIES.has(directory)) return \"story\";\n if (directory !== undefined && DRAMA_DIRECTORIES.has(directory)) return \"drama\";\n if (directory === GAME_DIRECTORY) return \"game\";\n if (directory === VIDEO_DIRECTORY) return \"video\";\n return undefined;\n}\n\n/** Choose the first useful document when a creative workbench opens. */\nexport function preferredWorkbenchFile(\n files: readonly WorkspaceFilePath[],\n mode: WorkbenchMode\n): string | undefined {\n const matching = files.filter((file) => workbenchModeForPath(file.path) === mode);\n const preferences = mode === \"story\"\n ? [/^\u6B63\u6587\\/.*\\.md$/u, /^\u5927\u7EB2\\/.*\\.md$/u, /\\.md$/u]\n : mode === \"drama\" ? [\n /^\u5267\u96C6\\/EP0*1\\/\u5267\u672C\\.md$/u,\n /^\u5267\u96C6\\/.*\\/\u5267\u672C\\.md$/u,\n /^\u5267\u96C6\\/EP0*1\\/screenplay\\.md$/iu,\n /^\u5267\u96C6\\/.*\\/screenplay\\.md$/iu,\n /^\u9879\u76EE\u5F00\u53D1\\/creative-brief\\.md$/u,\n /^\u8F93\u5165\\/.*\\.md$/u,\n /\\.md$/u,\n /^short-drama\\.json$/u\n ] : mode === \"game\" ? [\n /^game-adaptations\\/[^/]+\\/PRODUCT_BRIEF\\.md$/u,\n /^game-adaptations\\/[^/]+\\/design\\/GAME_DESIGN\\.md$/u,\n /^game-adaptations\\/[^/]+\\/qa\\/verification\\.json$/u,\n /^game-adaptations\\/[^/]+\\/build\\/app\\/index\\.html$/u,\n /\\.md$/u\n ] : [\n /^video-recaps\\/[^/]+\\/work\\/recap_story_plan\\.json$/u,\n /^video-recaps\\/[^/]+\\/work\\/narration\\.json$/u,\n /^video-recaps\\/[^/]+\\/work\\/assembly_manifest\\.json$/u\n ];\n for (const pattern of preferences) {\n const match = matching.find((file) => pattern.test(file.path));\n if (match !== undefined) return match.path;\n }\n return matching[0]?.path;\n}\n\n/** Project one streamed mutation over its immediate predecessor. */\nexport function previewMutation(activity: FileMutationActivity, base: string): string | undefined {\n if (activity.operation === \"replace-file\") return activity.newText;\n if (activity.operation === \"replace-text\") {\n if (activity.oldText === undefined || activity.newText === undefined || activity.oldText === \"\") return undefined;\n if (activity.replaceAll) return base.includes(activity.oldText) ? base.split(activity.oldText).join(activity.newText) : undefined;\n const at = base.indexOf(activity.oldText);\n return at < 0 ? undefined : `${base.slice(0, at)}${activity.newText}${base.slice(at + activity.oldText.length)}`;\n }\n if (activity.operation === \"insert-text\") {\n if (activity.newText === undefined) return undefined;\n const rawLine = /\"insert_line\"\\s*:\\s*(\\d+)/u.exec(activity.argsRaw)?.[1];\n if (rawLine === undefined) return undefined;\n const line = Number.parseInt(rawLine, 10);\n const parts = base.split(\"\\n\");\n const at = Math.max(0, Math.min(parts.length, line));\n parts.splice(at, 0, activity.newText);\n return parts.join(\"\\n\");\n }\n return undefined;\n}\n", "export interface FileTreeInput {\n readonly path: string;\n readonly bytes: number;\n}\n\nexport interface FileTreeFile {\n readonly kind: \"file\";\n readonly name: string;\n readonly path: string;\n readonly bytes: number;\n}\n\nexport interface FileTreeDirectory {\n readonly kind: \"directory\";\n readonly name: string;\n readonly path: string;\n readonly fileCount: number;\n readonly children: readonly FileTreeNode[];\n}\n\nexport type FileTreeNode = FileTreeFile | FileTreeDirectory;\n\ninterface MutableDirectory {\n readonly name: string;\n readonly path: string;\n readonly directories: Map<string, MutableDirectory>;\n readonly files: FileTreeFile[];\n}\n\nfunction directory(name: string, path: string): MutableDirectory {\n return { name, path, directories: new Map(), files: [] };\n}\n\nfunction compareNames(left: { readonly name: string }, right: { readonly name: string }): number {\n return left.name.localeCompare(right.name, \"zh-Hans-CN\", { numeric: true });\n}\n\nfunction freezeDirectory(value: MutableDirectory): FileTreeDirectory {\n const directories = [...value.directories.values()].map(freezeDirectory).sort(compareNames);\n const files = [...value.files].sort(compareNames);\n return {\n kind: \"directory\",\n name: value.name,\n path: value.path,\n fileCount: files.length + directories.reduce((sum, child) => sum + child.fileCount, 0),\n children: [...directories, ...files]\n };\n}\n\nexport function buildFileTree(files: readonly FileTreeInput[], group: string): readonly FileTreeNode[] {\n const root = directory(group, group);\n for (const file of files) {\n const relative = file.path.startsWith(`${group}/`) ? file.path.slice(group.length + 1) : file.path;\n const segments = relative.split(\"/\").filter((segment) => segment !== \"\");\n const name = segments.pop();\n if (name === undefined) continue;\n let parent = root;\n for (const segment of segments) {\n const path = `${parent.path}/${segment}`;\n const child = parent.directories.get(segment) ?? directory(segment, path);\n parent.directories.set(segment, child);\n parent = child;\n }\n parent.files.push({ kind: \"file\", name, path: file.path, bytes: file.bytes });\n }\n return freezeDirectory(root).children;\n}\n", "const TITLE_KEYS = [\n \"display_name\", \"title\", \"name\", \"shot_id\", \"scene_id\", \"episode_id\", \"character_id\",\n \"location_id\", \"view_id\", \"prop_id\", \"state_id\", \"decision_id\", \"occurrence_id\", \"record_id\", \"id\"\n] as const;\n\nexport interface JsonlRecord {\n readonly line: number;\n readonly raw: string;\n readonly value?: unknown;\n readonly title: string;\n readonly type?: string;\n readonly status?: string;\n readonly error?: string;\n}\n\nfunction objectRecord(value: unknown): Record<string, unknown> | undefined {\n return typeof value === \"object\" && value !== null && !Array.isArray(value) ? value as Record<string, unknown> : undefined;\n}\n\nfunction stringField(record: Record<string, unknown>, keys: readonly string[]): string | undefined {\n for (const key of keys) {\n const value = record[key];\n if (typeof value === \"string\" && value.trim() !== \"\") return value;\n }\n return undefined;\n}\n\nfunction metadata(value: unknown, line: number): Pick<JsonlRecord, \"title\" | \"type\" | \"status\"> {\n const record = objectRecord(value);\n if (record === undefined) return { title: typeof value === \"string\" ? value : JSON.stringify(value) ?? `\u7B2C ${String(line)} \u884C` };\n const type = stringField(record, [\"record_type\", \"type\", \"kind\"]);\n const acceptance = objectRecord(record.creator_acceptance);\n const status = stringField(record, [\"status\"]) ?? (acceptance === undefined ? undefined : stringField(acceptance, [\"status\"]));\n return {\n title: stringField(record, TITLE_KEYS) ?? `\u8BB0\u5F55 ${String(line)}`,\n ...(type === undefined ? {} : { type }),\n ...(status === undefined ? {} : { status })\n };\n}\n\nexport function parseJsonl(content: string): JsonlRecord[] {\n const records: JsonlRecord[] = [];\n const lines = content.replaceAll(\"\\r\\n\", \"\\n\").split(\"\\n\");\n for (const [index, raw] of lines.entries()) {\n if (raw.trim() === \"\") continue;\n try {\n const value = JSON.parse(raw) as unknown;\n records.push({ line: index + 1, raw, value, ...metadata(value, index + 1) });\n } catch (error) {\n records.push({\n line: index + 1,\n raw,\n title: `\u7B2C ${String(index + 1)} \u884C\u683C\u5F0F\u9519\u8BEF`,\n error: error instanceof Error ? error.message : String(error)\n });\n }\n }\n return records;\n}\n\nconst PREVIEW_LIMIT = 200;\n\nexport function JsonlPreview({ content, label }: { readonly content: string; readonly label: string }) {\n const records = parseJsonl(content);\n if (records.length === 0) return <div className=\"oh-story-markdown-empty\">\u8FD9\u4E2A JSONL \u6587\u4EF6\u8FD8\u662F\u7A7A\u7684\u3002</div>;\n const valid = records.filter((record) => record.error === undefined).length;\n const errors = records.length - valid;\n const visible = records.slice(0, PREVIEW_LIMIT);\n return <section className=\"oh-story-jsonl\" aria-label={`${label} \u7ED3\u6784\u5316\u9884\u89C8`}>\n <header className=\"oh-story-jsonl-summary\">\n <strong>{errors === 0 ? `${String(valid)} \u6761\u8BB0\u5F55` : `${String(valid)} \u6761\u6709\u6548\u8BB0\u5F55`}</strong>\n {errors > 0 && <span>{String(errors)} \u6761\u683C\u5F0F\u9519\u8BEF</span>}\n {records.length > PREVIEW_LIMIT && <span>\u4EC5\u663E\u793A\u524D {String(PREVIEW_LIMIT)} \u6761</span>}\n </header>\n <div className=\"oh-story-jsonl-records\">\n {visible.map((record) => record.error === undefined\n ? <details key={record.line} open={records.length <= 2}>\n <summary>\n <span>\u7B2C {String(record.line)} \u884C</span>\n <strong>{record.title}</strong>\n {record.type !== undefined && <code>{record.type}</code>}\n {record.status !== undefined && <em>{record.status}</em>}\n </summary>\n <pre><code>{JSON.stringify(record.value, null, 2)}</code></pre>\n </details>\n : <div className=\"oh-story-jsonl-error\" key={record.line} role=\"alert\">\n <strong>{record.title}</strong>\n <span>{record.error}</span>\n <pre>{record.raw}</pre>\n </div>)}\n </div>\n </section>;\n}\n", "import type { ReactNode } from \"react\";\n\nconst INLINE = /(`[^`\\n]+`|\\*\\*[^*\\n]+\\*\\*|~~[^~\\n]+~~|\\[[^\\]\\n]+\\]\\(https?:\\/\\/[^)\\s]+\\)|\\*[^*\\n]+\\*)/gu;\n\nfunction inline(source: string, key: string): ReactNode[] {\n const nodes: ReactNode[] = [];\n let cursor = 0;\n for (const match of source.matchAll(INLINE)) {\n const token = match[0];\n const index = match.index;\n if (index > cursor) nodes.push(source.slice(cursor, index));\n if (token.startsWith(\"`\")) nodes.push(<code key={`${key}-${String(index)}`}>{token.slice(1, -1)}</code>);\n else if (token.startsWith(\"**\")) nodes.push(<strong key={`${key}-${String(index)}`}>{token.slice(2, -2)}</strong>);\n else if (token.startsWith(\"~~\")) nodes.push(<del key={`${key}-${String(index)}`}>{token.slice(2, -2)}</del>);\n else if (token.startsWith(\"*\")) nodes.push(<em key={`${key}-${String(index)}`}>{token.slice(1, -1)}</em>);\n else {\n const link = /^\\[([^\\]]+)\\]\\((https?:\\/\\/[^)\\s]+)\\)$/u.exec(token);\n nodes.push(link === null ? token : <a key={`${key}-${String(index)}`} href={link[2]} target=\"_blank\" rel=\"noreferrer\">{link[1]}</a>);\n }\n cursor = index + token.length;\n }\n if (cursor < source.length) nodes.push(source.slice(cursor));\n return nodes;\n}\n\ntype Alignment = \"left\" | \"center\" | \"right\" | undefined;\ninterface ListItem { readonly text: string; readonly checked?: boolean }\n\nexport type MarkdownBlock =\n | { readonly kind: \"code\"; readonly lines: readonly string[]; readonly language?: string }\n | { readonly kind: \"heading\"; readonly text: string; readonly level: number }\n | { readonly kind: \"quote\"; readonly lines: readonly string[] }\n | { readonly kind: \"ul\" | \"ol\"; readonly items: readonly ListItem[]; readonly start?: number }\n | { readonly kind: \"table\"; readonly headers: readonly string[]; readonly rows: readonly (readonly string[])[]; readonly alignments: readonly Alignment[] }\n | { readonly kind: \"rule\" }\n | { readonly kind: \"paragraph\"; readonly lines: readonly string[] };\n\nfunction splitTableRow(line: string): string[] {\n let source = line.trim();\n if (source.startsWith(\"|\")) source = source.slice(1);\n if (source.endsWith(\"|\")) source = source.slice(0, -1);\n const cells: string[] = [];\n let cell = \"\";\n for (let index = 0; index < source.length; index += 1) {\n const character = source[index] ?? \"\";\n if (character === \"\\\\\" && source[index + 1] === \"|\") {\n cell += \"|\";\n index += 1;\n } else if (character === \"|\") {\n cells.push(cell.trim());\n cell = \"\";\n } else cell += character;\n }\n cells.push(cell.trim());\n return cells;\n}\n\nfunction tableAlignments(line: string): Alignment[] | undefined {\n const cells = splitTableRow(line);\n if (cells.length === 0 || !cells.every((cell) => /^:?-{3,}:?$/u.test(cell))) return undefined;\n return cells.map((cell) => {\n if (cell.startsWith(\":\") && cell.endsWith(\":\")) return \"center\";\n if (cell.endsWith(\":\")) return \"right\";\n if (cell.startsWith(\":\")) return \"left\";\n return undefined;\n });\n}\n\nfunction beginsBlock(lines: readonly string[], index: number): boolean {\n const line = lines[index] ?? \"\";\n return /^(`{3,}|~{3,})\\s*[\\w-]*\\s*$/u.test(line)\n || /^#{1,6}\\s+/u.test(line)\n || /^(?:-{3,}|\\*{3,}|_{3,})\\s*$/u.test(line)\n || /^>\\s?/u.test(line)\n || /^[-*+]\\s+/u.test(line)\n || /^\\d+[.)]\\s+/u.test(line)\n || (line.includes(\"|\") && tableAlignments(lines[index + 1] ?? \"\") !== undefined);\n}\n\nexport function parseMarkdownBlocks(markdown: string): MarkdownBlock[] {\n const lines = markdown.replaceAll(\"\\r\\n\", \"\\n\").split(\"\\n\");\n const result: MarkdownBlock[] = [];\n for (let index = 0; index < lines.length;) {\n const line = lines[index] ?? \"\";\n if (line.trim() === \"\") { index += 1; continue; }\n\n const fence = /^(`{3,}|~{3,})\\s*([\\w-]*)\\s*$/u.exec(line);\n if (fence !== null) {\n const marker = fence[1] ?? \"```\";\n const markerCharacter = marker[0] ?? \"`\";\n const closing = new RegExp(`^${markerCharacter}{${String(marker.length)},}\\\\s*$`, \"u\");\n const code: string[] = [];\n index += 1;\n while (index < lines.length && !closing.test(lines[index] ?? \"\")) { code.push(lines[index] ?? \"\"); index += 1; }\n if (index < lines.length) index += 1;\n result.push({ kind: \"code\", lines: code, ...(fence[2] === undefined || fence[2] === \"\" ? {} : { language: fence[2] }) });\n continue;\n }\n\n const heading = /^(#{1,6})\\s+(.+)$/u.exec(line);\n if (heading !== null) {\n result.push({ kind: \"heading\", text: heading[2] ?? \"\", level: heading[1]?.length ?? 1 });\n index += 1;\n continue;\n }\n if (/^(?:-{3,}|\\*{3,}|_{3,})\\s*$/u.test(line)) { result.push({ kind: \"rule\" }); index += 1; continue; }\n\n const alignments = line.includes(\"|\") ? tableAlignments(lines[index + 1] ?? \"\") : undefined;\n if (alignments !== undefined) {\n const headers = splitTableRow(line);\n const rows: string[][] = [];\n index += 2;\n while (index < lines.length && (lines[index] ?? \"\").includes(\"|\") && (lines[index] ?? \"\").trim() !== \"\") {\n rows.push(splitTableRow(lines[index] ?? \"\"));\n index += 1;\n }\n result.push({ kind: \"table\", headers, rows, alignments });\n continue;\n }\n\n if (/^>\\s?/u.test(line)) {\n const quote: string[] = [];\n while (index < lines.length && /^>\\s?/u.test(lines[index] ?? \"\")) {\n quote.push((lines[index] ?? \"\").replace(/^>\\s?/u, \"\"));\n index += 1;\n }\n result.push({ kind: \"quote\", lines: quote });\n continue;\n }\n\n const unordered = /^[-*+]\\s+(.+)$/u.exec(line);\n const ordered = /^(\\d+)[.)]\\s+(.+)$/u.exec(line);\n if (unordered !== null || ordered !== null) {\n const kind = unordered !== null ? \"ul\" : \"ol\";\n const items: ListItem[] = [];\n const pattern = kind === \"ul\" ? /^[-*+]\\s+(.+)$/u : /^\\d+[.)]\\s+(.+)$/u;\n const start = ordered === null ? undefined : Number(ordered[1]);\n while (index < lines.length) {\n const item = pattern.exec(lines[index] ?? \"\");\n if (item === null) break;\n const source = item[1] ?? \"\";\n const task = /^\\[([ xX])\\]\\s+(.+)$/u.exec(source);\n items.push(task === null ? { text: source } : { text: task[2] ?? \"\", checked: task[1]?.toLocaleLowerCase() === \"x\" });\n index += 1;\n }\n result.push({ kind, items, ...(start === undefined ? {} : { start }) });\n continue;\n }\n\n const paragraph: string[] = [line];\n index += 1;\n while (index < lines.length) {\n const next = lines[index] ?? \"\";\n if (next.trim() === \"\" || beginsBlock(lines, index)) break;\n paragraph.push(next);\n index += 1;\n }\n result.push({ kind: \"paragraph\", lines: paragraph });\n }\n return result;\n}\n\nfunction Heading({ block, blockKey }: { readonly block: Extract<MarkdownBlock, { readonly kind: \"heading\" }>; readonly blockKey: string }) {\n const children = inline(block.text, blockKey);\n switch (block.level) {\n case 1: return <h1>{children}</h1>;\n case 2: return <h2>{children}</h2>;\n case 3: return <h3>{children}</h3>;\n case 4: return <h4>{children}</h4>;\n case 5: return <h5>{children}</h5>;\n default: return <h6>{children}</h6>;\n }\n}\n\nexport function MarkdownPreview({ content, label }: { readonly content: string; readonly label: string }) {\n const parsed = parseMarkdownBlocks(content);\n if (parsed.length === 0) return <div className=\"oh-story-markdown-empty\">\u8FD9\u4E2A Markdown \u6587\u4EF6\u8FD8\u662F\u7A7A\u7684\u3002</div>;\n return <article className=\"oh-story-markdown\" aria-label={`${label} \u6E32\u67D3\u9884\u89C8`}>\n {parsed.map((block, index) => {\n const key = `block-${String(index)}`;\n if (block.kind === \"code\") return <pre key={key}><code data-language={block.language}>{block.lines.join(\"\\n\")}</code></pre>;\n if (block.kind === \"rule\") return <hr key={key} />;\n if (block.kind === \"quote\") return <blockquote key={key}>{block.lines.map((line, lineIndex) => <p key={`${key}-${String(lineIndex)}`}>{inline(line, `${key}-${String(lineIndex)}`)}</p>)}</blockquote>;\n if (block.kind === \"ul\" || block.kind === \"ol\") {\n const items = block.items.map((item, itemIndex) => <li key={`${key}-${String(itemIndex)}`} className={item.checked === undefined ? undefined : \"oh-story-task-item\"}>\n {item.checked === undefined ? null : <input type=\"checkbox\" checked={item.checked} readOnly disabled aria-label={item.checked ? \"\u5DF2\u5B8C\u6210\" : \"\u672A\u5B8C\u6210\"} />}\n {inline(item.text, `${key}-${String(itemIndex)}`)}\n </li>);\n return block.kind === \"ul\" ? <ul key={key}>{items}</ul> : <ol key={key} start={block.start}>{items}</ol>;\n }\n if (block.kind === \"table\") return <div className=\"oh-story-markdown-table\" key={key}>\n <table>\n <thead><tr>{block.headers.map((cell, cellIndex) => <th key={`${key}-h-${String(cellIndex)}`} style={{ textAlign: block.alignments[cellIndex] }}>{inline(cell, `${key}-h-${String(cellIndex)}`)}</th>)}</tr></thead>\n <tbody>{block.rows.map((row, rowIndex) => <tr key={`${key}-r-${String(rowIndex)}`}>{block.headers.map((_, cellIndex) => <td key={`${key}-r-${String(rowIndex)}-${String(cellIndex)}`} style={{ textAlign: block.alignments[cellIndex] }}>{inline(row[cellIndex] ?? \"\", `${key}-r-${String(rowIndex)}-${String(cellIndex)}`)}</td>)}</tr>)}</tbody>\n </table>\n </div>;\n if (block.kind === \"heading\") return <Heading key={key} block={block} blockKey={key} />;\n if (block.kind === \"paragraph\") return <p key={key}>{block.lines.map((line, lineIndex) => <span key={`${key}-${String(lineIndex)}`}>{lineIndex === 0 ? null : <br />}{inline(line, `${key}-${String(lineIndex)}`)}</span>)}</p>;\n return null;\n })}\n </article>;\n}\n", "export type DramaProductionSection = \"shots\" | \"assets\" | \"tasks\" | \"sequence\" | \"canvas\";\n\nexport type DramaAssetKind = \"character\" | \"scene\" | \"prop\" | \"state\" | \"unknown\";\nexport const PRODUCTION_PROTOCOL_VERSION = \"short-drama/v1\";\n\nexport interface DramaProductionDiagnostic {\n readonly severity: \"error\" | \"warning\";\n readonly code: string;\n readonly path: string;\n readonly offset: number;\n readonly line: number;\n readonly targetId?: string | undefined;\n readonly message: string;\n}\n\nexport interface DramaDocumentTarget {\n readonly path: string;\n readonly offset: number;\n readonly id: string;\n}\n\nexport interface DramaShot {\n readonly id: string;\n readonly title: string;\n readonly path: string;\n readonly offset: number;\n readonly source?: string | undefined;\n /** Screenplay scene IDs named by \u6765\u6E90, in document order; empty when the field names none. */\n readonly sceneIds: readonly string[];\n readonly durationSeconds?: number | undefined;\n readonly purpose?: string | undefined;\n readonly shotSpec?: string | undefined;\n readonly start?: string | undefined;\n readonly end?: string | undefined;\n readonly references: readonly string[];\n readonly keyframePrompt?: string | undefined;\n readonly motion?: DramaMotionPrompt | undefined;\n}\n\nexport interface DramaAsset {\n readonly id: string;\n readonly title: string;\n readonly kind: DramaAssetKind;\n readonly path: string;\n readonly offset: number;\n readonly purpose?: string | undefined;\n readonly reference?: string | undefined;\n readonly prompt?: string | undefined;\n readonly description?: string | undefined;\n}\n\nexport interface DramaMotionPrompt {\n readonly id: string;\n readonly title: string;\n readonly path: string;\n readonly offset: number;\n readonly shotId?: string | undefined;\n readonly durationSeconds?: number | undefined;\n readonly startFrame?: string | undefined;\n readonly end?: string | undefined;\n readonly prompt?: string | undefined;\n}\n\nexport interface DramaVisualAsset {\n readonly id: string;\n readonly title: string;\n readonly kind: DramaAssetKind;\n readonly path: string;\n readonly offset: number;\n readonly description: string;\n readonly stableId: boolean;\n readonly declaredId?: string | undefined;\n}\n\nexport interface DramaEpisodeProduction {\n readonly protocolVersion: typeof PRODUCTION_PROTOCOL_VERSION;\n readonly episodeDirectory: string;\n readonly shots: readonly DramaShot[];\n readonly assets: readonly DramaAsset[];\n readonly visualAssets: readonly DramaVisualAsset[];\n readonly motions: readonly DramaMotionPrompt[];\n readonly targets: ReadonlyMap<string, DramaDocumentTarget>;\n readonly documentPaths: readonly string[];\n readonly diagnostics: readonly DramaProductionDiagnostic[];\n}\n\ninterface MarkdownSection {\n readonly heading: string;\n readonly body: string;\n readonly offset: number;\n}\n\nconst CREATOR_DOCUMENT_NAMES = new Set([\"\u5267\u672C.md\", \"\u89C6\u89C9\u8BBE\u5B9A.md\", \"\u5206\u955C.md\", \"\u56FE\u7247\u63D0\u793A\u8BCD.md\", \"\u89C6\u9891\u63D0\u793A\u8BCD.md\"]);\n\nexport function episodeDirectoryForPath(path: string | undefined): string | undefined {\n if (path === undefined) return undefined;\n const match = /^(\u5267\u96C6\\/[^/]+)\\/[^/]+$/u.exec(path);\n return match?.[1];\n}\n\nexport function isCreatorDocumentPath(path: string): boolean {\n const directory = episodeDirectoryForPath(path);\n const name = path.split(\"/\").at(-1);\n return directory !== undefined && name !== undefined && CREATOR_DOCUMENT_NAMES.has(name);\n}\n\nexport function creatorDocumentPaths(files: readonly { readonly path: string }[], episodeDirectory: string): string[] {\n return files\n .map((file) => file.path)\n .filter((path) => path.startsWith(`${episodeDirectory}/`) && CREATOR_DOCUMENT_NAMES.has(path.slice(episodeDirectory.length + 1)))\n .sort((left, right) => creatorDocumentOrder(left) - creatorDocumentOrder(right) || left.localeCompare(right, \"zh-Hans-CN\"));\n}\n\nexport function parseEpisodeProduction(documents: Readonly<Record<string, string>>, episodeDirectory: string): DramaEpisodeProduction {\n const storyboardPath = `${episodeDirectory}/\u5206\u955C.md`;\n const imagePromptPath = `${episodeDirectory}/\u56FE\u7247\u63D0\u793A\u8BCD.md`;\n const videoPromptPath = `${episodeDirectory}/\u89C6\u9891\u63D0\u793A\u8BCD.md`;\n const visualPath = `${episodeDirectory}/\u89C6\u89C9\u8BBE\u5B9A.md`;\n const shots = parseStoryboard(storyboardPath, documents[storyboardPath] ?? \"\");\n const assets = parseImagePrompts(imagePromptPath, documents[imagePromptPath] ?? \"\");\n const motions = parseVideoPrompts(videoPromptPath, documents[videoPromptPath] ?? \"\");\n const visualAssets = parseVisualAssets(visualPath, documents[visualPath] ?? \"\");\n const motionByShot = new Map(motions.flatMap((motion) => motion.shotId === undefined ? [] : [[motion.shotId, motion] as const]));\n const linkedShots = shots.map((shot) => ({ ...shot, motion: motionByShot.get(shot.id) }));\n const targets = new Map<string, DramaDocumentTarget>();\n for (const item of [...linkedShots, ...assets, ...motions, ...visualAssets]) {\n targets.set(item.id, { path: item.path, offset: item.offset, id: item.id });\n }\n const screenplayPath = `${episodeDirectory}/\u5267\u672C.md`;\n for (const shot of linkedShots) {\n for (const id of sourceKeys(shot)) {\n const target = sectionTarget(screenplayPath, documents[screenplayPath] ?? \"\", id);\n if (target === undefined) continue;\n targets.set(id, target);\n }\n }\n const diagnostics = validateProductionProtocol({\n documents,\n episodeDirectory,\n shots: linkedShots,\n assets,\n visualAssets,\n motions\n });\n return {\n protocolVersion: PRODUCTION_PROTOCOL_VERSION,\n episodeDirectory,\n shots: linkedShots,\n assets,\n visualAssets,\n motions,\n targets,\n documentPaths: Object.keys(documents).filter((path) => path.startsWith(`${episodeDirectory}/`)),\n diagnostics\n };\n}\n\nexport function parseStoryboard(path: string, content: string): DramaShot[] {\n return levelTwoSections(content).flatMap((section) => {\n const match = /^(SHOT-[A-Z0-9-]+)\\s*(?:[\u00B7\uFF5C|]\\s*)?(.*)$/iu.exec(section.heading.trim());\n if (match === null || match[1] === undefined) return [];\n const fields = bulletFields(section.body);\n const id = match[1].toLocaleUpperCase();\n const source = firstField(fields, \"\u6765\u6E90\", \"\u573A\u6B21\");\n return [{\n id,\n title: match[2]?.trim() || id,\n path,\n offset: section.offset,\n source,\n sceneIds: sourceSceneIds(source),\n durationSeconds: seconds(firstField(fields, \"\u65F6\u957F\")),\n purpose: firstField(fields, \"\u76EE\u7684\", \"\u955C\u5934\u76EE\u7684\"),\n shotSpec: firstField(fields, \"\u666F\u522B/\u673A\u4F4D\", \"\u666F\u522B\", \"\u955C\u5934\u89C4\u683C\"),\n start: firstField(fields, \"\u8D77\u70B9\", \"\u8D77\u59CB\"),\n end: firstField(fields, \"\u7EC8\u70B9\", \"\u7ED3\u675F\"),\n references: splitReferences(firstField(fields, \"\u56FE\u7247\u63D0\u793A\u8BCD\u9879\", \"\u53C2\u8003\", \"\u5173\u8054\u8D44\u4EA7\")),\n keyframePrompt: quoteUnderHeading(section.body, \"\u51BB\u7ED3\u5173\u952E\u5E27\u63D0\u793A\u8BCD\")\n }];\n });\n}\n\nexport function parseImagePrompts(path: string, content: string): DramaAsset[] {\n return levelTwoSections(content).flatMap((section) => {\n const match = /^(IMG-[A-Z0-9-]+)\\s*(?:[\u00B7\uFF5C|]\\s*)?(.*)$/iu.exec(section.heading.trim());\n if (match === null || match[1] === undefined) return [];\n const fields = bulletFields(section.body);\n const id = match[1].toLocaleUpperCase();\n const title = match[2]?.trim() || id;\n return [{\n id,\n title,\n kind: inferAssetKind(`${id} ${title} ${firstField(fields, \"\u7528\u9014\") ?? \"\"}`),\n path,\n offset: section.offset,\n purpose: firstField(fields, \"\u7528\u9014\"),\n reference: firstField(fields, \"\u53C2\u8003\", \"\u53C2\u8003\u7EA6\u675F\"),\n prompt: quoteUnderHeading(section.body, \"\u53EF\u590D\u5236\u63D0\u793A\u8BCD\")\n }];\n });\n}\n\nexport function parseVideoPrompts(path: string, content: string): DramaMotionPrompt[] {\n return levelTwoSections(content).flatMap((section) => {\n const match = /^(MOTION-[A-Z0-9-]+)\\s*(?:[\u00B7\uFF5C|]\\s*)?(.*)$/iu.exec(section.heading.trim());\n if (match === null || match[1] === undefined) return [];\n const fields = bulletFields(section.body);\n const id = match[1].toLocaleUpperCase();\n const shotId = firstField(fields, \"\u5206\u955C\", \"\u955C\u5934\")?.match(/SHOT-[A-Z0-9-]+/iu)?.[0]?.toLocaleUpperCase();\n return [{\n id,\n title: match[2]?.trim() || id,\n path,\n offset: section.offset,\n shotId,\n durationSeconds: seconds(firstField(fields, \"\u65F6\u957F\")),\n startFrame: firstField(fields, \"\u8D77\u59CB\u5E27\", \"\u8D77\u70B9\"),\n end: firstField(fields, \"\u7EC8\u70B9\", \"\u7ED3\u675F\"),\n prompt: quoteUnderHeading(section.body, \"\u53EF\u590D\u5236\u63D0\u793A\u8BCD\")\n }];\n });\n}\n\nexport function parseVisualAssets(path: string, content: string): DramaVisualAsset[] {\n return levelTwoSections(content).flatMap((section) => {\n const match = /^(\u4EBA\u7269|\u89D2\u8272|\u9020\u578B|\u5730\u70B9|\u573A\u666F|\u9053\u5177|\u72B6\u6001)\\s*(?:[\u00B7\uFF5C|:]\\s*)?(.*)$/u.exec(section.heading.trim());\n if (match === null || match[1] === undefined) return [];\n const fields = bulletFields(section.body);\n const title = match[2]?.trim() || section.heading.trim();\n const declaredId = firstField(fields, \"ID\", \"\u8D44\u4EA7 ID\", \"\u8D44\u4EA7ID\")?.trim().toLocaleUpperCase();\n const stableId = declaredId !== undefined && /^VISUAL-[A-Z0-9-]+$/u.test(declaredId);\n const id = stableId ? declaredId : `VISUAL-${slug(`${match[1]}-${title}`)}`;\n return [{ id, title, kind: inferAssetKind(`${match[1]} ${title}`), path, offset: section.offset, description: section.body.trim(), stableId, declaredId }];\n });\n}\n\nfunction validateProductionProtocol(input: {\n readonly documents: Readonly<Record<string, string>>;\n readonly episodeDirectory: string;\n readonly shots: readonly DramaShot[];\n readonly assets: readonly DramaAsset[];\n readonly visualAssets: readonly DramaVisualAsset[];\n readonly motions: readonly DramaMotionPrompt[];\n}): DramaProductionDiagnostic[] {\n const diagnostics: DramaProductionDiagnostic[] = [];\n const add = (value: Omit<DramaProductionDiagnostic, \"line\">): void => {\n diagnostics.push({ ...value, line: lineAt(input.documents[value.path] ?? \"\", value.offset) });\n };\n const all = [...input.shots, ...input.assets, ...input.visualAssets, ...input.motions];\n const byId = new Map<string, typeof all>();\n for (const item of all) byId.set(item.id, [...(byId.get(item.id) ?? []), item]);\n for (const [id, items] of byId) {\n if (items.length < 2) continue;\n for (const item of items) add({ severity: \"error\", code: \"duplicate_id\", path: item.path, offset: item.offset, targetId: id, message: `${id} \u5728\u5F53\u524D\u96C6\u5185\u91CD\u590D\uFF0C\u540E\u51FA\u73B0\u7684\u6761\u76EE\u4F1A\u906E\u853D\u524D\u4E00\u6761\u3002` });\n }\n\n for (const visual of input.visualAssets) {\n if (visual.stableId) continue;\n add(visual.declaredId === undefined\n ? { severity: \"warning\", code: \"generated_visual_id\", path: visual.path, offset: visual.offset, targetId: visual.id, message: `${visual.title} \u7F3A\u5C11\u7A33\u5B9A\u7684 \u201C- ID\uFF1AVISUAL-*\u201D\uFF1B\u4FEE\u6539\u6807\u9898\u4F1A\u6539\u53D8\u753B\u5E03\u8282\u70B9\u8EAB\u4EFD\u3002` }\n : { severity: \"warning\", code: \"invalid_visual_id\", path: visual.path, offset: visual.offset, targetId: visual.id, message: `${visual.title} \u7684 \u201C- ID\uFF1A${visual.declaredId}\u201D \u4E0D\u662F\u53EF\u7528\u5F62\u5F0F\uFF0C\u5DF2\u56DE\u9000\u5230\u6807\u9898\u6D3E\u751F ID\uFF1B\u8BF7\u5199\u6210 VISUAL- \u52A0\u5927\u5199\u5B57\u6BCD\u3001\u6570\u5B57\u6216\u8FDE\u5B57\u7B26\u3002` });\n }\n\n const knownReferences = new Set([...input.assets, ...input.visualAssets, ...input.shots, ...input.motions].map((item) => item.id));\n const screenplayPath = `${input.episodeDirectory}/\u5267\u672C.md`;\n for (const shot of input.shots) {\n for (const reference of shot.references) {\n if (!knownReferences.has(reference)) add({ severity: \"warning\", code: \"unknown_reference\", path: shot.path, offset: shot.offset, targetId: shot.id, message: `${shot.id} \u5F15\u7528\u4E86\u672A\u89E3\u6790\u7684 ${reference}\u3002` });\n }\n for (const id of sourceKeys(shot)) {\n if (sectionTarget(screenplayPath, input.documents[screenplayPath] ?? \"\", id) === undefined) {\n add({ severity: \"warning\", code: \"unknown_source\", path: shot.path, offset: shot.offset, targetId: shot.id, message: `${shot.id} \u7684\u6765\u6E90 ${id} \u5728\u5267\u672C\u4E2D\u4E0D\u5B58\u5728\u3002` });\n }\n }\n }\n\n const shots = new Set(input.shots.map((shot) => shot.id));\n const motionsByShot = new Map<string, DramaMotionPrompt[]>();\n for (const motion of input.motions) {\n if (motion.shotId === undefined) {\n add({ severity: \"warning\", code: \"motion_without_shot\", path: motion.path, offset: motion.offset, targetId: motion.id, message: `${motion.id} \u6CA1\u6709\u53EF\u89E3\u6790\u7684 SHOT-* \u5206\u955C\u5B57\u6BB5\u3002` });\n continue;\n }\n if (!shots.has(motion.shotId)) add({ severity: \"error\", code: \"unknown_motion_shot\", path: motion.path, offset: motion.offset, targetId: motion.id, message: `${motion.id} \u6307\u5411\u4E0D\u5B58\u5728\u7684 ${motion.shotId}\u3002` });\n motionsByShot.set(motion.shotId, [...(motionsByShot.get(motion.shotId) ?? []), motion]);\n }\n for (const [shotId, motions] of motionsByShot) {\n if (motions.length < 2) continue;\n for (const motion of motions) add({ severity: \"error\", code: \"multiple_motions\", path: motion.path, offset: motion.offset, targetId: motion.id, message: `${shotId} \u540C\u65F6\u7ED1\u5B9A\u4E86\u591A\u4E2A MOTION\uFF0C\u753B\u5E03\u53EA\u80FD\u786E\u5B9A\u4E00\u4E2A\u3002` });\n }\n\n const parsedOffsets = new Set([...input.shots, ...input.assets, ...input.motions].map((item) => `${item.path}:${String(item.offset)}`));\n for (const [path, prefix] of [\n [`${input.episodeDirectory}/\u5206\u955C.md`, \"SHOT\"],\n [`${input.episodeDirectory}/\u56FE\u7247\u63D0\u793A\u8BCD.md`, \"IMG\"],\n [`${input.episodeDirectory}/\u89C6\u9891\u63D0\u793A\u8BCD.md`, \"MOTION\"]\n ] as const) {\n for (const section of levelTwoSections(input.documents[path] ?? \"\")) {\n if (section.heading.toLocaleUpperCase().startsWith(prefix) && !parsedOffsets.has(`${path}:${String(section.offset)}`)) {\n add({ severity: \"error\", code: \"malformed_heading\", path, offset: section.offset, message: `\u65E0\u6CD5\u89E3\u6790\u6807\u9898 \u201C${section.heading.trim()}\u201D\uFF0C\u9700\u8981\u7A33\u5B9A\u7684 ${prefix}-* ID\u3002` });\n }\n }\n }\n return diagnostics.sort((left, right) => left.path.localeCompare(right.path, \"zh-Hans-CN\") || left.offset - right.offset || left.code.localeCompare(right.code));\n}\n\nexport function productionCompleteness(shot: DramaShot): {\n readonly keyframe: boolean;\n readonly motion: boolean;\n readonly references: boolean;\n readonly complete: boolean;\n} {\n const keyframe = Boolean(shot.keyframePrompt?.trim());\n const motion = Boolean(shot.motion?.prompt?.trim());\n const references = shot.references.length > 0;\n return { keyframe, motion, references, complete: keyframe && motion };\n}\n\nfunction levelTwoSections(content: string): MarkdownSection[] {\n const matches = [...content.matchAll(/^##\\s+(.+)\\s*$/gmu)];\n return matches.map((match, index) => {\n const start = (match.index ?? 0) + match[0].length;\n const end = matches[index + 1]?.index ?? content.length;\n return { heading: match[1] ?? \"\", body: content.slice(start, end), offset: match.index ?? 0 };\n });\n}\n\nfunction bulletFields(body: string): Map<string, string> {\n const fields = new Map<string, string>();\n for (const match of body.matchAll(/^\\s*[-*]\\s+([^\uFF1A:\\n]+)[\uFF1A:]\\s*(.+?)\\s*$/gmu)) {\n const key = match[1]?.trim();\n const value = match[2]?.trim();\n if (key !== undefined && value !== undefined) fields.set(key, value);\n }\n return fields;\n}\n\nfunction firstField(fields: ReadonlyMap<string, string>, ...names: string[]): string | undefined {\n for (const name of names) {\n const value = fields.get(name);\n if (value !== undefined && value !== \"\") return value;\n }\n return undefined;\n}\n\nfunction quoteUnderHeading(body: string, heading: string): string | undefined {\n const escaped = heading.replace(/[.*+?^${}()|[\\]\\\\]/gu, \"\\\\$&\");\n const match = new RegExp(`^###\\\\s+${escaped}\\\\s*$([\\\\s\\\\S]*?)(?=^###\\\\s+|(?![\\\\s\\\\S]))`, \"imu\").exec(body);\n if (match?.[1] === undefined) return undefined;\n const lines = match[1].split(/\\r?\\n/u)\n .filter((line) => /^\\s*>/u.test(line))\n .map((line) => line.replace(/^\\s*>\\s?/u, \"\").trimEnd());\n const value = lines.join(\"\\n\").trim();\n return value === \"\" ? undefined : value;\n}\n\nfunction seconds(value: string | undefined): number | undefined {\n if (value === undefined) return undefined;\n const match = /([0-9]+(?:\\.[0-9]+)?)\\s*(?:s|\u79D2)/iu.exec(value);\n if (match?.[1] === undefined) return undefined;\n const parsed = Number(match[1]);\n return Number.isFinite(parsed) && parsed > 0 ? parsed : undefined;\n}\n\nfunction splitReferences(value: string | undefined): string[] {\n if (value === undefined) return [];\n const ids = value.match(/(?:IMG|SHOT|MOTION)-[A-Z0-9-]+/giu) ?? [];\n return [...new Set(ids.map((id) => id.toLocaleUpperCase()))];\n}\n\nfunction inferAssetKind(value: string): DramaAssetKind {\n if (/(\u4EBA\u7269|\u89D2\u8272|\u9020\u578B|character|portrait|sheet)/iu.test(value)) return \"character\";\n if (/(\u5730\u70B9|\u573A\u666F|\u73AF\u5883|scene|location|corridor|room)/iu.test(value)) return \"scene\";\n if (/(\u9053\u5177|\u7269\u4EF6|prop|object)/iu.test(value)) return \"prop\";\n if (/(\u72B6\u6001|state|look)/iu.test(value)) return \"state\";\n return \"unknown\";\n}\n\nfunction slug(value: string): string {\n return value.trim().toLocaleUpperCase().replace(/[^\\p{Letter}\\p{Number}]+/gu, \"-\").replace(/^-|-$/gu, \"\") || \"ITEM\";\n}\n\nfunction lineAt(content: string, offset: number): number {\n return content.slice(0, Math.max(0, offset)).split(/\\r?\\n/u).length;\n}\n\n// Drama Skills 0.6.5 (#100): \u6765\u6E90 starts with a screenplay scene ID and may\n// continue with a short quote or further IDs joined by \u3001. The ID shape is the\n// one creator_markdown_check.py uses; the checker additionally requires the\n// field to *start* with an ID, which the workbench leaves to it \u2014 here an ID\n// anywhere in the field still navigates.\nexport function sourceSceneIds(source: string | undefined): string[] {\n if (source === undefined) return [];\n return [...new Set([...source.matchAll(/(?:[A-Za-z0-9]+-)+SC[0-9]+/gu)].map((match) => match[0]))];\n}\n\n/** Scene IDs to resolve; a \u6765\u6E90 naming no ID falls back to matching the whole field. */\nfunction sourceKeys(shot: DramaShot): readonly string[] {\n if (shot.sceneIds.length > 0) return shot.sceneIds;\n return shot.source === undefined ? [] : [shot.source];\n}\n\nfunction sectionTarget(path: string, content: string, id: string): DramaDocumentTarget | undefined {\n const offset = content.search(new RegExp(`^##\\\\s+${id.replace(/[.*+?^${}()|[\\]\\\\]/gu, \"\\\\$&\")}(?:\\\\s|$)`, \"imu\"));\n return offset < 0 ? undefined : { path, offset, id };\n}\n\nfunction creatorDocumentOrder(path: string): number {\n const name = path.split(\"/\").at(-1);\n return [\"\u5267\u672C.md\", \"\u89C6\u89C9\u8BBE\u5B9A.md\", \"\u5206\u955C.md\", \"\u56FE\u7247\u63D0\u793A\u8BCD.md\", \"\u89C6\u9891\u63D0\u793A\u8BCD.md\"].indexOf(name ?? \"\");\n}\n", "import { useCallback, useEffect, useMemo, useRef, useState, type KeyboardEvent as ReactKeyboardEvent, type PointerEvent as ReactPointerEvent } from \"react\";\nimport { productionCompleteness, type DramaDocumentTarget, type DramaEpisodeProduction, type DramaProductionSection } from \"./drama-production.js\";\nimport { endpoint } from \"./workbench-ui.js\";\nimport { nativeBatchPrompt, nativeCompositionPrompt, nativeProductionPrompt } from \"./production-prompts.js\";\nimport { activeProductionJobId, createPendingJob, queuedItemForJob, reconcileProductionJobs, reconcileSequence, referencesForTarget, reorderSequence, sequenceIssues, selectedVersionForTarget, type CanvasPoint, type ProductionJob, type ProductionMediaVersion, type ProductionQueueEntry, type ProductionSequenceItem } from \"./production-runtime.js\";\n\ninterface Props {\n readonly sessionId: string;\n readonly production: DramaEpisodeProduction;\n readonly sessionRunning: boolean;\n readonly queue: readonly ProductionQueueEntry[];\n readonly section: DramaProductionSection;\n readonly selectedId: string | undefined;\n readonly jobs: readonly ProductionJob[];\n readonly versions: readonly ProductionMediaVersion[];\n readonly libraryVersions: readonly ProductionMediaVersion[];\n readonly selections: Readonly<Record<string, string>>;\n readonly manualReferences: Readonly<Record<string, readonly string[]>>;\n readonly sequence: readonly ProductionSequenceItem[];\n readonly canvas: Readonly<Record<string, CanvasPoint>>;\n readonly zoom: number;\n readonly onSectionChange: (section: DramaProductionSection) => void;\n readonly onSelect: (id: string | undefined) => void;\n readonly onNavigate: (target: DramaDocumentTarget) => void;\n readonly onJobsChange: (jobs: ProductionJob[]) => void;\n readonly onSelectionsChange: (selections: Record<string, string>) => void;\n readonly onManualReferencesChange: (references: Record<string, string[]>) => void;\n readonly onOpenMedia: (path: string) => void;\n readonly onSequenceChange: (sequence: ProductionSequenceItem[]) => void;\n readonly onCanvasChange: (canvas: Record<string, CanvasPoint>) => void;\n readonly onZoomChange: (zoom: number) => void;\n readonly onDispatchPrompt: (prompt: string) => Promise<void>;\n readonly onCancelTurn: () => Promise<void>;\n readonly onRemoveQueued: (itemId: string) => Promise<void>;\n readonly onRefresh: () => void;\n}\n\nconst SECTION_LABELS: Readonly<Record<DramaProductionSection, string>> = { shots: \"\u955C\u5934\", assets: \"\u7D20\u6750\", tasks: \"\u4EFB\u52A1\", sequence: \"\u6210\u7247\", canvas: \"\u753B\u5E03\" };\nconst SECTION_ORDER = Object.keys(SECTION_LABELS) as DramaProductionSection[];\nconst STATUS_LABELS: Readonly<Record<ProductionJob[\"status\"], string>> = { awaiting_confirmation: \"\u7B49\u5F85\u786E\u8BA4\", pending: \"\u5DF2\u63D0\u4EA4\", running: \"DSH \u6267\u884C\u4E2D\", dispatched_unknown: \"\u5F85\u6838\u5BF9\", succeeded: \"\u5DF2\u5B8C\u6210\", failed: \"\u5931\u8D25\", canceled: \"\u5DF2\u53D6\u6D88\" };\nconst ASSET_KIND_LABEL = { character: \"\u4EBA\u7269\", scene: \"\u573A\u666F\", prop: \"\u9053\u5177\", state: \"\u72B6\u6001\", unknown: \"\u8BBE\u5B9A\" } as const;\nconst JOB_KIND_LABEL = { image: \"\u56FE\u7247\", video: \"\u89C6\u9891\", composition: \"\u6210\u7247\" } as const;\n\n/** Mirror of the host `/oh-story/drama-preflight` summary: presence only, never values. */\ninterface DramaPreflight {\n readonly python: { readonly ok: boolean; readonly version?: string };\n readonly adapterConfig: { readonly path: string; readonly generated: boolean; readonly ok: boolean };\n readonly adapters: readonly { readonly name: string; readonly label: string; readonly modality: \"image\" | \"video\" | \"music\"; readonly configured: boolean; readonly missing: readonly string[] }[];\n}\n\nconst MODALITY_LABEL = { image: \"\u56FE\u7247\", video: \"\u89C6\u9891\", music: \"\u97F3\u4E50\" } as const;\n\n/**\n * DeepSeek writes the prompts; the pictures, videos and music come from provider\n * APIs that the produce Skill calls. Nothing in the conversation says so, and the\n * keys live in the host environment, so the \u751F\u4EA7 view states it up front.\n */\nfunction ProductionEnvironment({ sessionId }: { readonly sessionId: string }) {\n const [preflight, setPreflight] = useState<DramaPreflight | \"failed\">();\n const [attempt, setAttempt] = useState(0);\n // The summary is host-wide (the route ignores sessionId); the id only keeps\n // the URL shape shared with every other workbench endpoint.\n useEffect(() => {\n const controller = new AbortController();\n void fetch(endpoint(\"drama-preflight\", sessionId), { signal: controller.signal })\n .then(async (response) => {\n if (!response.ok) throw new Error(`HTTP ${String(response.status)}`);\n const summary = await response.json() as DramaPreflight;\n if (!controller.signal.aborted) setPreflight(summary);\n })\n .catch(() => { if (!controller.signal.aborted) setPreflight(\"failed\"); });\n return () => { controller.abort(); };\n }, [attempt, sessionId]);\n const unconfigured = typeof preflight === \"object\" ? preflight.adapters.filter((adapter) => !adapter.configured) : [];\n return <div className=\"oh-story-production-environment\" role=\"status\" aria-label=\"\u5A92\u4F53\u751F\u6210\u73AF\u5883\">\n <strong>\u751F\u6210\u73AF\u5883</strong>\n {preflight === undefined && <span data-pending>\u68C0\u67E5\u4E2D\u2026</span>}\n {preflight === \"failed\" && <button type=\"button\" onClick={() => { setPreflight(undefined); setAttempt((value) => value + 1); }}>\u73AF\u5883\u68C0\u67E5\u5931\u8D25 \u00B7 \u91CD\u8BD5</button>}\n {typeof preflight === \"object\" && <>\n <span data-ready={preflight.python.ok || undefined}>Python {preflight.python.version ?? \"\u672A\u627E\u5230\"}</span>\n {preflight.adapters.map((adapter) => <span key={adapter.name} data-ready={adapter.configured || undefined} title={adapter.configured ? `${adapter.name} \u5DF2\u914D\u7F6E` : `\u7F3A\u5C11\u73AF\u5883\u53D8\u91CF ${adapter.missing.join(\"\u3001\")}`}>{MODALITY_LABEL[adapter.modality]} {adapter.label}{adapter.configured ? \"\" : ` \u00B7 \u7F3A ${adapter.missing.join(\"\u3001\")}`}</span>)}\n <em>DeepSeek \u53EA\u8D1F\u8D23\u5199\u63D0\u793A\u8BCD\uFF1B\u56FE\u7247\u3001\u89C6\u9891\u3001\u97F3\u4E50\u7531\u4E0A\u9762\u7684\u4F9B\u5E94\u5546 API \u751F\u6210\uFF0CKey \u5728\u542F\u52A8 DSH \u524D\u5199\u5165\u5BBF\u4E3B\u673A\u73AF\u5883\u53D8\u91CF\u3002\n {unconfigured.length === preflight.adapters.length && \" \u5F53\u524D\u4E00\u4E2A\u90FD\u6CA1\u914D\u7F6E\uFF0C\u751F\u4EA7\u4EFB\u52A1\u4F1A\u505C\u5728 adapter \u4E4B\u524D\u3002\"}\n {\" \"}Adapter \u914D\u7F6E{preflight.adapterConfig.generated ? \"\u5DF2\u81EA\u52A8\u767B\u8BB0\" : \"\u4F7F\u7528\u81EA\u5B9A\u4E49\u6587\u4EF6\"}{preflight.adapterConfig.ok ? \"\" : \"\uFF08\u5199\u5165\u5931\u8D25\uFF09\"}\uFF1A<code>{preflight.adapterConfig.path}</code>\u3002\u8BE6\u89C1 README\u300C\u5A92\u4F53\u751F\u6210 API\u300D\u3002</em>\n </>}\n </div>;\n}\n\nfunction handleSectionKey(event: ReactKeyboardEvent<HTMLButtonElement>, current: DramaProductionSection, onChange: (section: DramaProductionSection) => void): void {\n const index = SECTION_ORDER.indexOf(current);\n const next = event.key === \"Home\" ? 0\n : event.key === \"End\" ? SECTION_ORDER.length - 1\n : event.key === \"ArrowRight\" ? (index + 1) % SECTION_ORDER.length\n : event.key === \"ArrowLeft\" ? (index - 1 + SECTION_ORDER.length) % SECTION_ORDER.length\n : undefined;\n if (next === undefined) return;\n event.preventDefault();\n onChange(SECTION_ORDER[next]!);\n event.currentTarget.parentElement?.querySelectorAll<HTMLButtonElement>(\"[role='tab']\")[next]?.focus();\n}\n\nexport function DramaProductionView(props: Props) {\n const [notice, setNotice] = useState<string>();\n const protocolErrors = props.production.diagnostics.filter((item) => item.severity === \"error\").length;\n const jobsRef = useRef(props.jobs);\n const commitJobs = useCallback((next: ProductionJob[]) => {\n jobsRef.current = next;\n props.onJobsChange(next);\n }, [props.onJobsChange]);\n useEffect(() => { jobsRef.current = props.jobs; }, [props.jobs]);\n\n useEffect(() => {\n const next = reconcileSequence(props.production.shots.map((shot) => shot.id), props.sequence, props.versions, props.selections);\n if (JSON.stringify(next) !== JSON.stringify(props.sequence)) props.onSequenceChange(next);\n }, [props.production.shots, props.selections, props.sequence, props.versions]);\n\n useEffect(() => {\n const next = reconcileProductionJobs(props.jobs, props.queue, props.sessionRunning, props.versions);\n if (JSON.stringify(next) !== JSON.stringify(props.jobs)) commitJobs(next);\n }, [commitJobs, props.jobs, props.queue, props.sessionRunning, props.versions]);\n\n const dispatchJob = async (job: ProductionJob, references: readonly ProductionMediaVersion[] = []) => {\n commitJobs([...jobsRef.current, { ...job, status: \"awaiting_confirmation\" }]);\n props.onSectionChange(\"tasks\");\n try {\n await props.onDispatchPrompt(nativeProductionPrompt(props.production, job, references));\n setNotice(`${job.targetId} \u6B63\u5728\u51C6\u5907\u5B8C\u6574\u9884\u68C0\uFF1B\u8BF7\u5728 Chat \u67E5\u770B\u5E76\u660E\u786E\u786E\u8BA4\u540E\u518D\u751F\u4EA7\u3002`);\n } catch (error) {\n commitJobs(jobsRef.current.map((item) => item.id === job.id ? { ...item, status: \"failed\", error: error instanceof Error ? error.message : String(error) } : item));\n }\n };\n\n const createJob = async (targetId: string, kind: \"image\" | \"video\", prompt: string) => {\n if (prompt.trim() === \"\") { setNotice(`${targetId} \u6CA1\u6709\u53EF\u6295\u4EA7\u63D0\u793A\u8BCD\u3002`); return; }\n const job = createPendingJob({ id: crypto.randomUUID(), targetId, kind, prompt });\n await dispatchJob(job, kind === \"video\" ? referencesForTarget(targetId, props.production, props.versions, props.selections, props.libraryVersions, props.manualReferences) : []);\n };\n\n const createBatch = async (kind: \"image\" | \"video\") => {\n const candidates = props.production.shots.flatMap((shot) => { const prompt = kind === \"image\" ? shot.keyframePrompt : shot.motion?.prompt; return prompt === undefined ? [] : [{ id: shot.id, prompt }]; });\n if (candidates.length === 0) { setNotice(kind === \"image\" ? \"\u6CA1\u6709\u53EF\u6295\u4EA7\u7684\u5173\u952E\u5E27\u63D0\u793A\u8BCD\u3002\" : \"\u6CA1\u6709\u53EF\u6295\u4EA7\u7684\u89C6\u9891\u63D0\u793A\u8BCD\u3002\"); return; }\n const job = createPendingJob({ id: crypto.randomUUID(), targetId: kind === \"image\" ? \"BATCH-KEYFRAMES\" : \"BATCH-VIDEOS\", kind, prompt: candidates.map((item) => `${item.id}\\n${item.prompt}`).join(\"\\n\\n\"), expectedOutputs: candidates.length });\n commitJobs([...jobsRef.current, { ...job, status: \"awaiting_confirmation\" }]); props.onSectionChange(\"tasks\");\n try { await props.onDispatchPrompt(nativeBatchPrompt(props.production, job, candidates)); setNotice(`${String(candidates.length)} \u4E2A\u955C\u5934\u6B63\u5728\u51C6\u5907\u540C\u4E00\u6279\u6B21\u9884\u68C0\uFF1B\u8BF7\u5728 Chat \u6838\u5BF9\u540E\u660E\u786E\u786E\u8BA4\u3002`); }\n catch (error) { commitJobs(jobsRef.current.map((item) => item.id === job.id ? { ...item, status: \"failed\", error: error instanceof Error ? error.message : String(error) } : item)); }\n };\n\n const dispatchComposition = async (job: ProductionJob) => {\n const versionById = new Map(props.versions.map((version) => [version.id, version]));\n const ordered = props.sequence.flatMap((item) => { const version = item.versionId === undefined ? undefined : versionById.get(item.versionId); return version === undefined ? [] : [version.path ?? version.url]; });\n commitJobs([...jobsRef.current, job]); props.onSectionChange(\"tasks\");\n try { await props.onDispatchPrompt(nativeCompositionPrompt(props.production, job, ordered)); setNotice(\"\u6210\u7247\u4EFB\u52A1\u5DF2\u8FDB\u5165 DSH \u539F\u751F\u961F\u5217\uFF1B\u6587\u4EF6\u3001FFmpeg \u548C\u5199\u5165\u7EE7\u7EED\u53D7 DSH \u6743\u9650\u4E0E\u5BA1\u6279\u63A7\u5236\u3002\"); }\n catch (error) { commitJobs(jobsRef.current.map((item) => item.id === job.id ? { ...item, status: \"failed\", error: error instanceof Error ? error.message : String(error) } : item)); }\n };\n\n const cancelJob = async (job: ProductionJob) => {\n try { await props.onCancelTurn(); commitJobs(jobsRef.current.map((item) => item.id === job.id ? { ...item, status: \"canceled\", progress: 0 } : item)); setNotice(\"\u5DF2\u8BF7\u6C42\u505C\u6B62\u5F53\u524D DSH Turn\uFF1BDSH Queue \u4E2D\u7684\u5176\u4ED6\u4EFB\u52A1\u4F1A\u4FDD\u7559\u3002\"); }\n catch (error) { setNotice(error instanceof Error ? error.message : String(error)); }\n };\n const removeQueuedJob = async (job: ProductionJob, itemId: string) => {\n try { await props.onRemoveQueued(itemId); commitJobs(jobsRef.current.map((item) => item.id === job.id ? { ...item, status: \"canceled\", progress: 0 } : item)); setNotice(`${job.targetId} \u5DF2\u4ECE DSH Queue \u79FB\u9664\u3002`); }\n catch (error) { setNotice(error instanceof Error ? error.message : String(error)); }\n };\n const composeSequence = () => { const issues = sequenceIssues(props.sequence, props.versions); if (issues.length > 0) { setNotice(issues[0]); return; } void dispatchComposition(createPendingJob({ id: crypto.randomUUID(), targetId: props.production.episodeDirectory, kind: \"composition\", prompt: \"\u6309\u6210\u7247\u987A\u5E8F\u5408\u6210\" })); };\n\n return <div className=\"oh-story-production\">\n <div className=\"oh-story-production-bar\"><div className=\"oh-story-production-tabs\" role=\"tablist\" aria-label=\"\u77ED\u5267\u751F\u4EA7\u89C6\u56FE\">{SECTION_ORDER.map((item) => <button type=\"button\" role=\"tab\" tabIndex={props.section === item ? 0 : -1} aria-selected={props.section === item} key={item} onKeyDown={(event) => { handleSectionKey(event, item, props.onSectionChange); }} onClick={() => { props.onSectionChange(item); }}>{SECTION_LABELS[item]}</button>)}</div><div className=\"oh-story-production-meta\"><span className=\"oh-story-production-summary\">{props.production.shots.length} \u955C \u00B7 {props.production.assets.length + props.production.visualAssets.length} \u7D20\u6750 \u00B7 {props.jobs.filter((job) => job.status === \"awaiting_confirmation\" || job.status === \"running\" || job.status === \"pending\").length} \u4EFB\u52A1</span><button type=\"button\" onClick={props.onRefresh}>\u5237\u65B0</button></div></div>\n <ProductionEnvironment sessionId={props.sessionId} />\n {notice !== undefined && <div className=\"oh-story-production-notice\" role=\"status\"><span>{notice}</span><button type=\"button\" aria-label=\"\u5173\u95ED\u63D0\u793A\" onClick={() => { setNotice(undefined); }}>\u00D7</button></div>}\n {props.production.diagnostics.length > 0 && <details className=\"oh-story-production-diagnostics\"><summary>{protocolErrors > 0 ? `${String(protocolErrors)} \u4E2A\u534F\u8BAE\u9519\u8BEF` : `${String(props.production.diagnostics.length)} \u4E2A\u683C\u5F0F\u63D0\u9192`}</summary><ul>{props.production.diagnostics.slice(0, 8).map((item) => <li data-severity={item.severity} key={`${item.path}:${String(item.offset)}:${item.code}`}><button type=\"button\" onClick={() => { props.onNavigate({ path: item.path, offset: item.offset, id: item.targetId ?? item.code }); }}>{item.path.split(\"/\").at(-1)}:{item.line}</button><span>{item.message}</span></li>)}</ul>{props.production.diagnostics.length > 8 && <p>\u53E6\u6709 {props.production.diagnostics.length - 8} \u9879\uFF0C\u8BF7\u6309\u6587\u6863\u4F4D\u7F6E\u4FEE\u590D\u3002</p>}</details>}\n {props.section === \"shots\" && <ShotBoard {...props} onCreateJob={createJob} onBatch={createBatch} />}\n {props.section === \"assets\" && <AssetBoard {...props} onCreateJob={createJob} />}\n {props.section === \"tasks\" && <TaskBoard jobs={props.jobs} queue={props.queue} sessionRunning={props.sessionRunning} onCancel={cancelJob} onRemoveQueued={removeQueuedJob} />}\n {props.section === \"sequence\" && <SequenceBoard {...props} onCompose={composeSequence} />}\n {props.section === \"canvas\" && <ProductionCanvas {...props} />}\n </div>;\n}\n\nfunction ShotBoard(props: Props & { readonly onCreateJob: (targetId: string, kind: \"image\" | \"video\", prompt: string) => Promise<void>; readonly onBatch: (kind: \"image\" | \"video\") => Promise<void> }) {\n const selectedRef = useScrollIntoView(props.selectedId);\n if (props.production.shots.length === 0) return <section className=\"oh-story-shot-board\"><MissingDocument document={`${props.production.episodeDirectory}/\u5206\u955C.md`} documentPaths={props.production.documentPaths} what=\"\u955C\u5934\" skill=\"/short-drama-storyboard\" onNavigate={props.onNavigate} /></section>;\n return <section className=\"oh-story-shot-board\"><div className=\"oh-story-production-actions\"><button type=\"button\" onClick={() => { void props.onBatch(\"image\"); }}>\u51C6\u5907\u6279\u91CF\u5173\u952E\u5E27</button><button type=\"button\" onClick={() => { void props.onBatch(\"video\"); }}>\u51C6\u5907\u6279\u91CF\u89C6\u9891</button></div><div className=\"oh-story-shot-grid\">{props.production.shots.map((shot) => {\n const completeness = productionCompleteness(shot); const versions = props.versions.filter((version) => version.targetId === shot.id); const selected = selectedVersionForTarget(shot.id, props.versions, props.selections, \"image\") ?? selectedVersionForTarget(shot.id, props.versions, props.selections, \"video\");\n return <article className=\"oh-story-shot-card\" role=\"button\" tabIndex={0} aria-pressed={props.selectedId === shot.id} aria-label={`\u9009\u4E2D\u955C\u5934 ${shot.id} ${shot.title}`} ref={props.selectedId === shot.id ? selectedRef : undefined} data-selected={props.selectedId === shot.id || undefined} key={shot.id} onKeyDown={(event) => { if (event.key === \"Enter\" || event.key === \" \") { event.preventDefault(); props.onSelect(shot.id); } }} onClick={() => { props.onSelect(shot.id); }}>\n {selected === undefined ? <div className=\"oh-story-shot-placeholder\"><strong>{shot.id.split(\"-\").at(-1)}</strong><span>\u7B49\u5F85\u5173\u952E\u5E27\u6210\u679C</span></div> : <MediaPreview version={selected} />}<header><button type=\"button\" onClick={(event) => { event.stopPropagation(); props.onNavigate({ path: shot.path, offset: shot.offset, id: shot.id }); }}>{shot.id}</button><span>{shot.durationSeconds === undefined ? \"\u2014\" : `${String(shot.durationSeconds)}s`}</span></header><h3>{shot.title}</h3>{shot.shotSpec !== undefined && <p>{shot.shotSpec}</p>}<dl><dt>\u8D77</dt><dd>{shot.start ?? \"\u672A\u586B\u5199\"}</dd><dt>\u7EC8</dt><dd>{shot.end ?? \"\u672A\u586B\u5199\"}</dd></dl>\n <div className=\"oh-story-shot-status\"><ReadinessBadge label=\"\u5173\u952E\u5E27\" ready={completeness.keyframe} /><ReadinessBadge label=\"\u8FD0\u52A8\" ready={completeness.motion} /><ReadinessBadge label=\"\u53C2\u8003\" ready={completeness.references} /><span>{versions.length} \u7248\u672C</span></div><div className=\"oh-story-reference-links\">{shot.sceneIds.length > 0 ? shot.sceneIds.map((sceneId) => <ReferenceButton key={sceneId} id={sceneId} production={props.production} onNavigate={props.onNavigate} />) : shot.source !== undefined && <ReferenceButton id={shot.source} production={props.production} onNavigate={props.onNavigate} />}{shot.references.map((id) => <ReferenceButton id={id} production={props.production} onNavigate={props.onNavigate} key={id} />)}</div>\n <div className=\"oh-story-card-actions\">{shot.keyframePrompt !== undefined && <button type=\"button\" onClick={(event) => { event.stopPropagation(); void props.onCreateJob(shot.id, \"image\", shot.keyframePrompt ?? \"\"); }}>\u51C6\u5907\u5173\u952E\u5E27</button>}{shot.motion?.prompt !== undefined && <button type=\"button\" onClick={(event) => { event.stopPropagation(); void props.onCreateJob(shot.id, \"video\", shot.motion?.prompt ?? \"\"); }}>\u51C6\u5907\u89C6\u9891</button>}</div>{versions.length > 1 && <VersionStrip targetId={shot.id} versions={versions} selections={props.selections} onSelectionsChange={props.onSelectionsChange} />}\n </article>;\n })}</div></section>;\n}\n\nfunction AssetBoard(props: Props & { readonly onCreateJob: (targetId: string, kind: \"image\" | \"video\", prompt: string) => Promise<void> }) {\n const [query, setQuery] = useState(\"\");\n const [kind, setKind] = useState<\"all\" | \"image\" | \"video\">(\"all\");\n const assets = [...props.production.assets, ...props.production.visualAssets.filter((visual) => !props.production.assets.some((asset) => asset.title === visual.title))];\n const needle = query.trim().toLocaleLowerCase();\n const library = props.libraryVersions.filter((version) => (kind === \"all\" || version.kind === kind) && (needle === \"\" || `${version.targetId} ${version.path ?? \"\"}`.toLocaleLowerCase().includes(needle)));\n const selectedRef = useScrollIntoView(props.selectedId);\n const referenceTarget = props.selectedId?.startsWith(\"SHOT-\") === true ? props.selectedId : undefined;\n const toggleReference = (versionId: string) => {\n if (referenceTarget === undefined) return;\n const current = props.manualReferences[referenceTarget] ?? [];\n const next = current.includes(versionId) ? current.filter((id) => id !== versionId) : [...current, versionId];\n const mutable = Object.fromEntries(Object.entries(props.manualReferences).map(([target, ids]) => [target, [...ids]]));\n props.onManualReferencesChange({ ...mutable, [referenceTarget]: next });\n };\n if (assets.length === 0 && props.libraryVersions.length === 0) return <section className=\"oh-story-assets\"><MissingDocument document={`${props.production.episodeDirectory}/\u56FE\u7247\u63D0\u793A\u8BCD.md`} documentPaths={props.production.documentPaths} what=\"\u7D20\u6750\" skill=\"/short-drama-image-prompts\" onNavigate={props.onNavigate} /></section>;\n return <section className=\"oh-story-assets\"><div className=\"oh-story-asset-grid\">{assets.map((asset) => { const prompt = \"prompt\" in asset ? asset.prompt : asset.description; const versions = props.versions.filter((version) => version.targetId === asset.id); const selected = selectedVersionForTarget(asset.id, props.versions, props.selections, \"image\"); return <article className=\"oh-story-asset-card\" ref={props.selectedId === asset.id ? selectedRef : undefined} data-selected={props.selectedId === asset.id || undefined} key={asset.id}>{selected === undefined ? <div className=\"oh-story-asset-placeholder\">{asset.kind === \"character\" ? \"\u4EBA\" : asset.kind === \"scene\" ? \"\u666F\" : asset.kind === \"prop\" ? \"\u7269\" : \"\u8BBE\"}</div> : <MediaPreview version={selected} />}<div><small>{ASSET_KIND_LABEL[asset.kind]}</small><h3>{asset.title}</h3><button type=\"button\" onClick={() => { props.onNavigate({ path: asset.path, offset: asset.offset, id: asset.id }); }}>{asset.id}</button></div>{prompt !== undefined && <p className=\"oh-story-asset-description\">{prompt}</p>}<div className=\"oh-story-card-actions\">{prompt !== undefined && <button type=\"button\" onClick={() => { void props.onCreateJob(asset.id, \"image\", prompt); }}>\u51C6\u5907\u7D20\u6750</button>}</div>{versions.length > 0 && <VersionStrip targetId={asset.id} versions={versions} selections={props.selections} onSelectionsChange={props.onSelectionsChange} />}</article>; })}</div><div className=\"oh-story-media-library\"><header><div><strong>\u9879\u76EE\u5A92\u4F53\u5E93</strong><span>{library.length}/{props.libraryVersions.length} \u9879 \u00B7 \u53EF\u8DE8\u96C6\u590D\u7528</span></div><div><input aria-label=\"\u641C\u7D22\u9879\u76EE\u5A92\u4F53\" value={query} placeholder=\"\u641C\u7D22 ID \u6216\u8DEF\u5F84\" onChange={(event) => { setQuery(event.target.value); }} /><select aria-label=\"\u7B5B\u9009\u5A92\u4F53\u7C7B\u578B\" value={kind} onChange={(event) => { setKind(event.target.value as typeof kind); }}><option value=\"all\">\u5168\u90E8</option><option value=\"image\">\u56FE\u7247</option><option value=\"video\">\u89C6\u9891</option></select></div></header>{referenceTarget === undefined && <p className=\"oh-story-projection-note\">\u5148\u5728\u955C\u5934\u9875\u9009\u4E2D\u4E00\u4E2A\u955C\u5934\uFF0C\u518D\u56DE\u5230\u8FD9\u91CC\u628A\u5DF2\u6709\u56FE\u7247\u8BBE\u4E3A\u8BE5\u955C\u5934\u7684\u989D\u5916\u53C2\u8003\u3002</p>}<div className=\"oh-story-media-library-grid\">{library.map((version) => { const selected = referenceTarget !== undefined && (props.manualReferences[referenceTarget] ?? []).includes(version.id); return <article key={version.id}><MediaPreview version={version} /><strong>{version.targetId}</strong><span title={version.path}>{version.path}</span><footer>{version.path !== undefined && <button type=\"button\" onClick={() => { props.onOpenMedia(version.path!); }}>\u6253\u5F00\u6587\u4EF6</button>}{referenceTarget !== undefined && version.kind === \"image\" && <button type=\"button\" aria-pressed={selected} aria-label={`${selected ? \"\u53D6\u6D88\" : \"\u8BBE\u4E3A\"} ${referenceTarget} \u53C2\u8003 ${version.targetId}`} onClick={() => { toggleReference(version.id); }}>{selected ? \"\u5DF2\u5F15\u7528\" : \"\u4F5C\u4E3A\u53C2\u8003\"}</button>}</footer></article>; })}</div></div></section>;\n}\n\nfunction TaskBoard({ jobs, queue, sessionRunning, onCancel, onRemoveQueued }: {\n readonly jobs: readonly ProductionJob[];\n readonly queue: readonly ProductionQueueEntry[];\n readonly sessionRunning: boolean;\n readonly onCancel: (job: ProductionJob) => Promise<void>;\n readonly onRemoveQueued: (job: ProductionJob, itemId: string) => Promise<void>;\n}) {\n const activeJobId = activeProductionJobId(jobs, queue, sessionRunning);\n return <section className=\"oh-story-task-board\">\n <div className=\"oh-story-projection-note\">\u56FE\u7247\u4E0E\u89C6\u9891\u5148\u9884\u68C0\u3001\u540E\u786E\u8BA4\u3002\u5185\u7F6E\u5951\u7EA6\u652F\u6301 GPT Image 2 / Seedance\uFF1B\u5B9E\u9645\u8D26\u53F7\u3001\u6A21\u578B\u4E0E\u53EF\u7528\u6027\u7531\u5F53\u524D DSH \u8FD0\u884C\u73AF\u5883\u51B3\u5B9A\u3002</div>\n {jobs.length === 0 ? <div className=\"oh-story-production-empty\">\u8FD8\u6CA1\u6709\u751F\u4EA7\u4EFB\u52A1\u3002\u53EF\u4ECE\u955C\u5934\u6216\u7D20\u6750\u9875\u63D0\u4EA4\u5355\u4E2A\u6216\u6279\u91CF\u4EFB\u52A1\u3002</div> : [...jobs].reverse().map((job) => {\n const queued = queuedItemForJob(job.id, queue);\n const displayStatus = queued === undefined ? STATUS_LABELS[job.status] : \"DSH Queue\";\n return <article key={job.id} data-job-id={job.id} data-status={job.status}><header><strong title={job.targetId}>{job.targetId}</strong><span>{JOB_KIND_LABEL[job.kind]}</span><span>{displayStatus}</span></header><div className=\"oh-story-task-progress\"><i style={{ width: `${String(job.progress)}%` }} /></div><details><summary>\u67E5\u770B\u6295\u4EA7\u63D0\u793A\u8BCD</summary><p>{job.prompt}</p></details>{job.expectedOutputs > 1 && <small>{job.completedOutputs}/{job.expectedOutputs} \u9879\u6210\u679C</small>}{job.error !== undefined && <div className=\"oh-story-error\">{job.error}</div>}{job.output !== undefined && <MediaPreview version={job.output} />}<footer>{queued !== undefined && (job.status === \"awaiting_confirmation\" || job.status === \"pending\" || job.status === \"running\") && <button type=\"button\" onClick={() => { void onRemoveQueued(job, queued.id); }}>\u4ECE DSH Queue \u79FB\u9664</button>}{activeJobId === job.id && <button type=\"button\" onClick={() => { void onCancel(job); }}>\u505C\u6B62\u5F53\u524D DSH Turn</button>}</footer></article>;\n })}\n </section>;\n}\n\nfunction SequenceBoard(props: Props & { readonly onCompose: () => void }) {\n const issues = sequenceIssues(props.sequence, props.versions); const versionById = new Map(props.versions.map((version) => [version.id, version])); const move = (index: number, delta: number) => { const source = props.sequence[index]; const target = props.sequence[index + delta]; if (source !== undefined && target !== undefined) props.onSequenceChange(reorderSequence(props.sequence, index, index + delta)); };\n return <section className=\"oh-story-sequence\"><div className=\"oh-story-sequence-summary\"><strong>{props.sequence.length} \u4E2A\u955C\u5934</strong><span>{props.sequence.length === 0 ? \"\u8FD8\u6CA1\u6709\u955C\u5934\" : issues.length === 0 ? \"\u5DF2\u53EF\u5408\u6210\" : `${String(issues.length)} \u4E2A\u963B\u585E\u9879`}</span><button type=\"button\" disabled={issues.length > 0 || props.sequence.length < 2} onClick={props.onCompose}>\u5408\u6210\u6210\u7247</button></div>{issues.length > 0 && <ul className=\"oh-story-sequence-issues\">{issues.slice(0, 3).map((issue) => <li key={issue}>{issue}</li>)}{issues.length > 3 && <li>\u53E6\u6709 {issues.length - 3} \u4E2A\u963B\u585E\u9879\uFF0C\u8BF7\u5728\u4E0B\u65B9\u955C\u5934\u884C\u8865\u9F50\u89C6\u9891\u3002</li>}</ul>}<ol>{props.sequence.map((item, index) => { const version = item.versionId === undefined ? undefined : versionById.get(item.versionId); return <li key={item.shotId}><span>{String(index + 1).padStart(2, \"0\")}</span>{version === undefined ? <div className=\"oh-story-sequence-missing\">\u7F3A\u5C11\u89C6\u9891</div> : <MediaPreview version={version} interactive={false} />}<strong>{item.shotId}</strong><div><button type=\"button\" aria-label={`\u4E0A\u79FB ${item.shotId}`} disabled={index === 0} onClick={() => { move(index, -1); }}>\u2191</button><button type=\"button\" aria-label={`\u4E0B\u79FB ${item.shotId}`} disabled={index === props.sequence.length - 1} onClick={() => { move(index, 1); }}>\u2193</button></div></li>; })}</ol></section>;\n}\n\nfunction ProductionCanvas(props: Props) {\n const nodes = useMemo(() => { const sourceAssets = [...props.production.assets, ...props.production.visualAssets]; const assets = sourceAssets.map((asset, index) => ({ id: asset.id, label: asset.title, type: \"asset\", initial: { x: 80, y: 80 + index * 150 } })); const shots = props.production.shots.map((shot, index) => ({ id: shot.id, label: shot.title, type: \"shot\", initial: { x: 640, y: 80 + index * 180 } })); return [...assets, ...shots]; }, [props.production.assets, props.production.shots, props.production.visualAssets]);\n const positions = Object.fromEntries(nodes.map((node) => [node.id, props.canvas[node.id] ?? node.initial]));\n const startDrag = (event: ReactPointerEvent<HTMLElement>, id: string) => { event.currentTarget.setPointerCapture(event.pointerId); const origin = positions[id] ?? { x: 0, y: 0 }; const start = { x: event.clientX, y: event.clientY }; const move = (moveEvent: PointerEvent) => { props.onCanvasChange({ ...props.canvas, [id]: { x: origin.x + (moveEvent.clientX - start.x) / props.zoom, y: origin.y + (moveEvent.clientY - start.y) / props.zoom } }); }; const end = () => { globalThis.removeEventListener(\"pointermove\", move); globalThis.removeEventListener(\"pointerup\", end); }; globalThis.addEventListener(\"pointermove\", move); globalThis.addEventListener(\"pointerup\", end); };\n const moveNode = (id: string, x: number, y: number) => { const origin = positions[id] ?? { x: 0, y: 0 }; props.onCanvasChange({ ...props.canvas, [id]: { x: origin.x + x, y: origin.y + y } }); };\n const connections = props.production.shots.flatMap((shot) => shot.references.map((reference) => [reference, shot.id] as const));\n if (nodes.length === 0) return <section className=\"oh-story-canvas-shell\" aria-label=\"\u77ED\u5267\u7D20\u6750\u4E0E\u955C\u5934\u5173\u7CFB\u753B\u5E03\"><MissingDocument document={`${props.production.episodeDirectory}/\u5206\u955C.md`} documentPaths={props.production.documentPaths} what=\"\u5173\u7CFB\" skill=\"/short-drama-storyboard\" onNavigate={props.onNavigate} /></section>;\n return <section className=\"oh-story-canvas-shell\" aria-label=\"\u77ED\u5267\u7D20\u6750\u4E0E\u955C\u5934\u5173\u7CFB\u753B\u5E03\"><div className=\"oh-story-projection-note\">\u6587\u6863\u5173\u7CFB \u00B7 \u5E03\u5C40\u4EC5\u4FDD\u5B58\u5728\u5F53\u524D DSH Session</div><div className=\"oh-story-canvas-controls\"><button type=\"button\" aria-label=\"\u7F29\u5C0F\u753B\u5E03\" onClick={() => { props.onZoomChange(Math.max(.5, props.zoom - .1)); }}>\u2212</button><span>{Math.round(props.zoom * 100)}%</span><button type=\"button\" aria-label=\"\u653E\u5927\u753B\u5E03\" onClick={() => { props.onZoomChange(Math.min(1.8, props.zoom + .1)); }}>\uFF0B</button><button type=\"button\" onClick={() => { props.onCanvasChange({}); props.onZoomChange(.65); }}>\u590D\u4F4D</button></div><div className=\"oh-story-canvas-viewport\"><div className=\"oh-story-canvas\" style={{ transform: `scale(${String(props.zoom)})` }}><svg aria-hidden=\"true\">{connections.map(([from, to]) => { const a = positions[from]; const b = positions[to]; if (a === undefined || b === undefined) return null; return <path key={`${from}:${to}`} data-active={to === props.selectedId || undefined} d={`M ${String(a.x + 180)} ${String(a.y + 50)} C ${String(a.x + 360)} ${String(a.y + 50)}, ${String(b.x - 180)} ${String(b.y + 50)}, ${String(b.x)} ${String(b.y + 50)}`} />; })}</svg>{nodes.map((node) => <article key={node.id} tabIndex={0} aria-label={`${node.type === \"asset\" ? \"\u7D20\u6750\" : \"\u955C\u5934\"} ${node.label}`} data-node-type={node.type} data-selected={node.id === props.selectedId || undefined} style={{ left: positions[node.id]?.x, top: positions[node.id]?.y }} onKeyDown={(event) => { const step = event.shiftKey ? 40 : 10; const delta: readonly [number, number] | undefined = event.key === \"ArrowLeft\" ? [-step, 0] : event.key === \"ArrowRight\" ? [step, 0] : event.key === \"ArrowUp\" ? [0, -step] : event.key === \"ArrowDown\" ? [0, step] : undefined; if (delta !== undefined) { event.preventDefault(); moveNode(node.id, delta[0], delta[1]); } }} onPointerDown={(event) => { startDrag(event, node.id); }} onDoubleClick={() => { const target = props.production.targets.get(node.id); if (target !== undefined) props.onNavigate(target); }}><small>{node.type === \"asset\" ? \"\u7D20\u6750\" : \"\u955C\u5934\"}</small><strong>{node.label}</strong><span>{node.id}</span></article>)}</div></div></section>;\n}\n\n/** Scroll the card an Agent focus_target selected into view; without it the tab switches but the card stays off-screen. */\nfunction useScrollIntoView(selectedId: string | undefined) {\n const ref = useRef<HTMLElement | null>(null);\n useEffect(() => { ref.current?.scrollIntoView({ block: \"nearest\" }); }, [selectedId]);\n return ref;\n}\n\nfunction ReadinessBadge({ label, ready }: { readonly label: string; readonly ready: boolean }) {\n return <span data-ready={ready} aria-label={`${label}${ready ? \"\u5DF2\u5907\" : \"\u5F85\u8865\"}`}><i aria-hidden=\"true\">{ready ? \"\u2713\" : \"\u2014\"}</i>{label}</span>;\n}\n\nfunction MissingDocument({ document, documentPaths, what, skill, onNavigate }: {\n readonly document: string;\n readonly documentPaths: readonly string[];\n readonly what: string;\n readonly skill: string;\n readonly onNavigate: (target: DramaDocumentTarget) => void;\n}) {\n const present = documentPaths.includes(document);\n return <div className=\"oh-story-production-empty\">\n <strong>\u8FD8\u6CA1\u6709\u53EF\u6295\u5F71\u7684{what}\u3002</strong>\n <p>{present\n ? `${document} \u5DF2\u5B58\u5728\uFF0C\u4F46\u6CA1\u6709\u89E3\u6790\u51FA\u6761\u76EE\u3002\u8BF7\u68C0\u67E5\u4E8C\u7EA7\u6807\u9898\u662F\u5426\u4E3A\u7A33\u5B9A\u7684 ID \u5F62\u5F0F\u3002`\n : `\u672C\u96C6\u8FD8\u6CA1\u6709 ${document}\u3002\u5728\u53F3\u4FA7 Chat \u7528 ${skill} \u5199\u597D\u8FD9\u4EFD\u6587\u6863\u540E\uFF0C\u8FD9\u91CC\u4F1A\u81EA\u52A8\u51FA\u73B0\u3002`}</p>\n {present && <button type=\"button\" onClick={() => { onNavigate({ path: document, offset: 0, id: document }); }}>\u6253\u5F00 {document.split(\"/\").at(-1)}</button>}\n </div>;\n}\n\nfunction ReferenceButton({ id, production, onNavigate }: { readonly id: string; readonly production: DramaEpisodeProduction; readonly onNavigate: (target: DramaDocumentTarget) => void }) { const target = production.targets.get(id); return <button type=\"button\" disabled={target === undefined} onClick={(event) => { event.stopPropagation(); if (target !== undefined) onNavigate(target); }}>{id}</button>; }\nfunction MediaPreview({ version, interactive = true }: { readonly version: ProductionMediaVersion; readonly interactive?: boolean }) { return version.kind === \"image\" ? <img className=\"oh-story-media-preview\" src={version.url} alt={version.targetId} loading=\"lazy\" /> : <video className=\"oh-story-media-preview\" src={version.url} controls={interactive} muted={!interactive} preload=\"metadata\" />; }\nfunction VersionStrip({ targetId, versions, selections, onSelectionsChange }: { readonly targetId: string; readonly versions: readonly ProductionMediaVersion[]; readonly selections: Readonly<Record<string, string>>; readonly onSelectionsChange: (value: Record<string, string>) => void }) { const selected = selectedVersionForTarget(targetId, versions, selections)?.id; return <div className=\"oh-story-version-strip\" aria-label={`${targetId} \u6210\u679C\u7248\u672C`}>{versions.map((version, index) => <button type=\"button\" aria-pressed={version.id === selected} aria-label={`\u9009\u62E9 ${targetId} \u7248\u672C ${String(index + 1)}`} data-selected={version.id === selected || undefined} key={version.id} onClick={(event) => { event.stopPropagation(); onSelectionsChange({ ...selections, [targetId]: version.id }); }}><MediaPreview version={version} interactive={false} /><span>V{String(index + 1)}</span></button>)}</div>; }\n", "import type { KeyboardEvent as ReactKeyboardEvent } from \"react\";\n\n/** Roving-focus keyboard contract shared by every workbench tablist. */\nexport function handleTabKey<T extends string>(\n event: ReactKeyboardEvent<HTMLButtonElement>,\n values: readonly T[],\n current: T,\n select: (value: T) => void\n): void {\n let index: number | undefined;\n if (event.key === \"Home\") index = 0;\n else if (event.key === \"End\") index = values.length - 1;\n else if (event.key === \"ArrowRight\") index = (values.indexOf(current) + 1) % values.length;\n else if (event.key === \"ArrowLeft\") index = (values.indexOf(current) - 1 + values.length) % values.length;\n if (index === undefined) return;\n event.preventDefault();\n const value = values[index];\n if (value === undefined) return;\n select(value);\n event.currentTarget.parentElement?.querySelectorAll<HTMLButtonElement>(\"[role='tab']\")[index]?.focus();\n}\n\nexport function endpoint(path: string, sessionId: string, file?: string): string {\n const url = new URL(`/oh-story/${path}`, globalThis.location.origin);\n url.searchParams.set(\"sessionId\", sessionId);\n if (file !== undefined) url.searchParams.set(\"path\", file);\n return url.toString();\n}\n", "import type { DramaEpisodeProduction } from \"./drama-production.js\";\nimport type { ProductionJob, ProductionMediaVersion } from \"./production-runtime.js\";\n\nconst authorityBoundary = \"\u53EA\u4F7F\u7528\u5F53\u524D DSH Preset \u53EF\u89C1\u7684\u5DE5\u5177\uFF1B\u6240\u6709\u6587\u4EF6\u3001\u7F51\u7EDC\u3001\u751F\u6210\u548C\u547D\u4EE4\u64CD\u4F5C\u7EE7\u7EED\u9075\u5B88 DSH \u6743\u9650\u4E0E\u5BA1\u6279\u3002\";\n\nexport function nativeProductionPrompt(\n production: DramaEpisodeProduction,\n job: ProductionJob,\n references: readonly ProductionMediaVersion[]\n): string {\n const referenceText = references.length === 0\n ? \"\u65E0\"\n : references.map((item) => `${item.targetId}: ${item.path ?? item.url}`).join(\"\\n\");\n return `/short-drama-produce\n\n\u53EA\u51C6\u5907\u5F53\u524D\u5355\u9879\u751F\u4EA7\u4EFB\u52A1\uFF0C\u4E0D\u8FD0\u884C Provider\u3002\n- \u4EFB\u52A1 ID\uFF1A${job.id}\n- \u4EFB\u52A1\u7C7B\u578B\uFF1A${job.kind === \"image\" ? \"\u56FE\u7247/\u5173\u952E\u5E27\" : \"\u955C\u5934\u89C6\u9891\"}\n- \u5EFA\u8BAE adapter \u5951\u7EA6\uFF1A${job.kind === \"image\" ? \"gpt-image-2\" : \"seedance\"}\uFF08\u5B9E\u9645\u914D\u7F6E\u4E0E\u6A21\u578B\u4EE5\u5F53\u524D DSH \u8FD0\u884C\u73AF\u5883\u4E3A\u51C6\uFF09\n- \u6295\u4EA7\u5BF9\u8C61\uFF1A${job.targetId}\n- \u521B\u4F5C\u6587\u6863\u76EE\u5F55\uFF1A${production.episodeDirectory}\n- \u53C2\u8003\u7D20\u6750\uFF1A\n${referenceText}\n- \u8F93\u51FA\u76EE\u5F55\uFF1A${production.episodeDirectory}/\u5236\u4F5C\u6210\u679C/${job.targetId}\n- \u8F93\u51FA\u6587\u4EF6\u540D\u5FC5\u987B\u540C\u65F6\u5305\u542B\u6295\u4EA7\u5BF9\u8C61 ID \u4E0E\u4EFB\u52A1 ID ${job.id}\uFF0C\u4EE5\u4FBF DSH \u5DE5\u4F5C\u53F0\u5173\u8054\u7248\u672C\u3002\n\n\u5F85\u9884\u68C0\u63D0\u793A\u8BCD\uFF1A\n${job.prompt}\n\n\u6309 short-drama-produce \u7684\u786C\u95F8\u95E8\u5EFA\u7ACB\u4E34\u65F6 job \u5E76\u6267\u884C prepare\uFF0C\u5728 Chat \u4E2D\u5B8C\u6574\u5C55\u793A adapter\u3001\u6A21\u578B/profile\u3001\u6570\u91CF\u3001\u53C2\u6570\u3001references\u3001outputs \u4E0E overwrite\u3002\u6B64\u6309\u94AE\u53EA\u8868\u8FBE\u201C\u51C6\u5907\u9884\u89C8\u201D\uFF0C\u4E0D\u6784\u6210\u770B\u5230\u9884\u89C8\u540E\u7684\u751F\u4EA7\u786E\u8BA4\uFF1B\u4E0D\u5F97 confirm \u6216 run\u3002\u7528\u6237\u5728\u540E\u7EED\u6D88\u606F\u660E\u786E\u786E\u8BA4\u8FD9\u4EFD\u9884\u89C8\u540E\uFF0C\u624D\u53EF\u8C03\u7528 oh_story_production track_job \u767B\u8BB0\u540C\u4E00\u4E2A\u4EFB\u52A1 ID\uFF0C\u5E76\u8FD0\u884C Provider\u3002${authorityBoundary}`;\n}\n\nexport function nativeBatchPrompt(\n production: DramaEpisodeProduction,\n job: ProductionJob,\n candidates: readonly { readonly id: string; readonly prompt: string }[]\n): string {\n return `/short-drama-produce\n\n\u53EA\u51C6\u5907\u5F53\u524D\u6279\u91CF\u751F\u4EA7\u4EFB\u52A1\uFF0C\u4E0D\u8FD0\u884C Provider\u3002\n- \u6279\u6B21\u4EFB\u52A1 ID\uFF1A${job.id}\n- \u4EFB\u52A1\u7C7B\u578B\uFF1A${job.kind === \"image\" ? \"\u6279\u91CF\u5173\u952E\u5E27\" : \"\u6279\u91CF\u955C\u5934\u89C6\u9891\"}\n- \u5EFA\u8BAE adapter \u5951\u7EA6\uFF1A${job.kind === \"image\" ? \"gpt-image-2\" : \"seedance\"}\uFF08\u5B9E\u9645\u914D\u7F6E\u4E0E\u6A21\u578B\u4EE5\u5F53\u524D DSH \u8FD0\u884C\u73AF\u5883\u4E3A\u51C6\uFF09\n- \u521B\u4F5C\u6587\u6863\u76EE\u5F55\uFF1A${production.episodeDirectory}\n- \u8F93\u51FA\u6839\u76EE\u5F55\uFF1A${production.episodeDirectory}/\u5236\u4F5C\u6210\u679C\n- \u6BCF\u4E2A\u8F93\u51FA\u6587\u4EF6\u540D\u5FC5\u987B\u5305\u542B\u5BF9\u5E94\u955C\u5934 ID \u4E0E\u6279\u6B21\u4EFB\u52A1 ID ${job.id}\u3002\n\n${candidates.map((item) => `## ${item.id}\\n${item.prompt}`).join(\"\\n\\n\")}\n\n\u628A\u6570\u91CF\u3001\u9010\u9879\u8F93\u51FA\u548C\u6210\u672C\u8FB9\u754C\u5B8C\u6574\u5C55\u793A\u7ED9\u521B\u4F5C\u8005\u3002\u6B64\u6309\u94AE\u53EA\u8868\u8FBE\u201C\u51C6\u5907\u9884\u89C8\u201D\uFF0C\u4E0D\u6784\u6210\u770B\u5230\u9884\u89C8\u540E\u7684\u751F\u4EA7\u786E\u8BA4\uFF1B\u4E0D\u5F97 confirm \u6216 run\u3002\u7528\u6237\u5728\u540E\u7EED\u6D88\u606F\u660E\u786E\u786E\u8BA4\u8FD9\u4EFD\u9884\u89C8\u540E\uFF0C\u624D\u53EF\u8C03\u7528 oh_story_production track_job \u767B\u8BB0\u540C\u4E00\u4E2A\u6279\u6B21\u4EFB\u52A1 ID\uFF0C\u5E76\u8FD0\u884C Provider\u3002${authorityBoundary}`;\n}\n\nexport function nativeCompositionPrompt(\n production: DramaEpisodeProduction,\n job: ProductionJob,\n orderedPaths: readonly string[]\n): string {\n return `/short-drama-produce\n\n\u6267\u884C\u521B\u4F5C\u8005\u5DF2\u660E\u786E\u786E\u8BA4\u7684\u6210\u7247\u5408\u6210\u4EFB\u52A1\u3002\n- \u4EFB\u52A1 ID\uFF1A${job.id}\n- \u5267\u96C6\uFF1A${production.episodeDirectory}\n- \u6309\u4EE5\u4E0B\u987A\u5E8F\u5408\u6210\uFF0C\u4E0D\u5F97\u81EA\u884C\u6362\u5E8F\uFF1A\n${orderedPaths.map((path, index) => `${String(index + 1)}. ${path}`).join(\"\\n\")}\n- \u8F93\u51FA\uFF1A${production.episodeDirectory}/\u5236\u4F5C\u6210\u679C/\u6210\u7247-${job.id}.mp4\n\n\u5148\u9A8C\u8BC1\u8F93\u5165\u5747\u5B58\u5728\u4E14\u53EF\u8BFB\uFF0C\u518D\u4F7F\u7528\u5F53\u524D DSH Preset \u53EF\u89C1\u7684\u5A92\u4F53/\u547D\u4EE4\u5DE5\u5177\u6267\u884C\uFF1B\u97F3\u89C6\u9891\u53C2\u6570\u4E0D\u517C\u5BB9\u65F6\u505A\u660E\u786E\u3001\u53EF\u5BA1\u8BA1\u7684\u6807\u51C6\u5316\u3002\u6240\u6709\u547D\u4EE4\u548C\u5199\u5165\u7EE7\u7EED\u9075\u5B88 DSH \u6743\u9650\u4E0E\u5BA1\u6279\uFF0C\u4E0D\u5F97\u4F2A\u9020\u6210\u529F\u3002`;\n}\n", "export type ProductionJobKind = \"image\" | \"video\" | \"composition\";\nexport type ProductionJobStatus = \"awaiting_confirmation\" | \"pending\" | \"running\" | \"dispatched_unknown\" | \"succeeded\" | \"failed\" | \"canceled\";\n\nexport interface ProductionMediaVersion {\n readonly id: string;\n readonly targetId: string;\n readonly kind: \"image\" | \"video\";\n readonly url: string;\n /** Workspace-relative path when the result is owned by the DSH FileSystem. */\n readonly path?: string | undefined;\n}\n\nexport interface ProductionJob {\n readonly id: string;\n readonly targetId: string;\n readonly kind: ProductionJobKind;\n readonly status: ProductionJobStatus;\n readonly progress: number;\n readonly prompt: string;\n readonly error?: string | undefined;\n readonly output?: ProductionMediaVersion | undefined;\n readonly expectedOutputs: number;\n readonly completedOutputs: number;\n}\n\nexport interface ProductionSequenceItem {\n readonly shotId: string;\n readonly versionId?: string | undefined;\n}\n\nexport interface CanvasPoint {\n readonly x: number;\n readonly y: number;\n}\n\nexport interface ProductionQueueEntry {\n readonly id: string;\n readonly preview: string;\n}\n\nexport function createPendingJob(input: {\n readonly id: string;\n readonly targetId: string;\n readonly kind: ProductionJobKind;\n readonly prompt: string;\n readonly expectedOutputs?: number | undefined;\n}): ProductionJob {\n return {\n id: input.id,\n targetId: input.targetId,\n kind: input.kind,\n status: \"pending\",\n progress: 0,\n prompt: input.prompt,\n expectedOutputs: Math.max(1, Math.floor(input.expectedOutputs ?? 1)),\n completedOutputs: 0\n };\n}\n\nexport function selectedVersionForTarget(\n targetId: string,\n versions: readonly ProductionMediaVersion[],\n selections: Readonly<Record<string, string>>,\n kind?: ProductionMediaVersion[\"kind\"]\n): ProductionMediaVersion | undefined {\n const candidates = versions.filter((version) => version.targetId === targetId && (kind === undefined || version.kind === kind));\n return candidates.find((version) => version.id === selections[targetId]) ?? candidates.at(-1);\n}\n\nexport function mediaTargetFromPath(path: string, knownTargets: readonly string[]): string | undefined {\n const upper = path.toLocaleUpperCase();\n const segments = upper.split(\"/\");\n const filename = segments.at(-1) ?? \"\";\n return [...knownTargets].sort((left, right) => right.length - left.length).find((target) => {\n const canonical = target.toLocaleUpperCase();\n return segments.includes(canonical)\n || filename === canonical\n || filename.startsWith(`${canonical}.`)\n || filename.startsWith(`${canonical}-`);\n });\n}\n\nexport function mediaVersionMatchesJob(version: ProductionMediaVersion, jobId: string): boolean {\n if (version.path === undefined || jobId.trim() === \"\") return false;\n const escaped = jobId.replace(/[.*+?^${}()|[\\]\\\\]/gu, \"\\\\$&\");\n const basename = version.path.split(\"/\").at(-1) ?? \"\";\n return new RegExp(`(?:^|[-_.])${escaped}(?:[-_.]|$)`, \"u\").test(basename);\n}\n\nexport function referencesForTarget(\n targetId: string,\n production: { readonly shots: readonly { readonly id: string; readonly references: readonly string[] }[] },\n versions: readonly ProductionMediaVersion[],\n selections: Readonly<Record<string, string>>,\n libraryVersions: readonly ProductionMediaVersion[] = versions,\n manualReferences: Readonly<Record<string, readonly string[]>> = {}\n): ProductionMediaVersion[] {\n const shot = production.shots.find((item) => item.id === targetId);\n if (shot === undefined) return [];\n const declared = shot.references.flatMap((id) => {\n const version = selectedVersionForTarget(id, versions, selections, \"image\");\n return version === undefined ? [] : [version];\n });\n const manual = (manualReferences[targetId] ?? []).flatMap((id) => {\n const version = libraryVersions.find((item) => item.id === id && item.kind === \"image\");\n return version === undefined ? [] : [version];\n });\n return [...new Map([...declared, ...manual].map((version) => [version.id, version])).values()];\n}\n\nexport function queuedItemForJob(jobId: string, queue: readonly ProductionQueueEntry[]): ProductionQueueEntry | undefined {\n if (jobId.trim() === \"\") return undefined;\n const escaped = jobId.replace(/[.*+?^${}()|[\\]\\\\]/gu, \"\\\\$&\");\n // The prompts label the id as \u300C\u4EFB\u52A1 ID\uFF1A<id>\u300D / \u300C\u6279\u6B21\u4EFB\u52A1 ID\uFF1A<id>\u300D. Anchor on that label so an\n // id merely quoted inside another job's output paths cannot mark this job as queued.\n const labelled = new RegExp(`\u4EFB\u52A1\\\\s*ID\\\\s*[\uFF1A:]\\\\s*${escaped}(?:[\\\\s.,;\u3001\u3002]|$)`, \"u\");\n return queue.find((item) => labelled.test(item.preview));\n}\n\nexport function activeProductionJobId(\n jobs: readonly ProductionJob[],\n queue: readonly ProductionQueueEntry[],\n sessionRunning: boolean\n): string | undefined {\n if (!sessionRunning) return undefined;\n return [...jobs].reverse().find((job) => (\n (job.status === \"awaiting_confirmation\" || job.status === \"pending\" || job.status === \"running\")\n && queuedItemForJob(job.id, queue) === undefined\n ))?.id;\n}\n\n/** Reconcile the lightweight Session projection against DSH Queue/Turn state and real workspace outputs. */\nexport function reconcileProductionJobs(\n jobs: readonly ProductionJob[],\n queue: readonly ProductionQueueEntry[],\n sessionRunning: boolean,\n versions: readonly ProductionMediaVersion[]\n): ProductionJob[] {\n const latestPending = [...jobs].reverse().find((job) => (\n job.status === \"pending\" && queuedItemForJob(job.id, queue) === undefined\n ));\n\n return jobs.map((job) => {\n const queued = queuedItemForJob(job.id, queue) !== undefined;\n const outputs = versions.filter((version) => mediaVersionMatchesJob(version, job.id));\n\n if (outputs.length >= job.expectedOutputs) {\n return {\n ...job,\n status: \"succeeded\",\n progress: 100,\n completedOutputs: outputs.length,\n output: outputs[0],\n error: undefined\n };\n }\n if (job.status === \"canceled\" || job.status === \"succeeded\" || (job.status === \"awaiting_confirmation\" && outputs.length === 0)) return job;\n if (job.status === \"running\" && queued) return { ...job, status: \"pending\", progress: 0 };\n if (job.status === \"pending\" && sessionRunning && !queued && job === latestPending) {\n return { ...job, status: \"running\", progress: Math.max(10, job.progress), error: undefined };\n }\n if (!sessionRunning && !queued && (job.status === \"running\" || job.status === \"dispatched_unknown\")) {\n return {\n ...job,\n status: \"dispatched_unknown\",\n progress: Math.round(outputs.length / job.expectedOutputs * 100),\n completedOutputs: outputs.length,\n error: outputs.length === 0\n ? \"DSH Turn \u5DF2\u7ED3\u675F\uFF0C\u5C1A\u672A\u53D1\u73B0\u5173\u8054\u6210\u679C\u3002\u4EFB\u52A1\u53EF\u80FD\u5DF2\u6D3E\u53D1\uFF0C\u8BF7\u5148\u5237\u65B0\u6210\u679C\uFF0C\u907F\u514D\u91CD\u590D\u8BA1\u8D39\u3002\"\n : `DSH Turn \u5DF2\u7ED3\u675F\uFF0C\u5DF2\u53D1\u73B0 ${String(outputs.length)}/${String(job.expectedOutputs)} \u9879\u6210\u679C\uFF1B\u8BF7\u5237\u65B0\u6838\u5BF9\u5269\u4F59\u8F93\u51FA\u3002`\n };\n }\n if (outputs.length > 0) {\n return {\n ...job,\n status: job.status === \"failed\" ? \"failed\" : \"running\",\n progress: Math.max(10, Math.round(outputs.length / job.expectedOutputs * 100)),\n completedOutputs: outputs.length,\n error: job.status === \"failed\" ? job.error : undefined\n };\n }\n return job;\n });\n}\n\nexport function reconcileSequence(\n shotIds: readonly string[],\n current: readonly ProductionSequenceItem[],\n versions: readonly ProductionMediaVersion[],\n selections: Readonly<Record<string, string>>\n): ProductionSequenceItem[] {\n const shotSet = new Set(shotIds);\n const preserved = current.filter((item) => shotSet.has(item.shotId));\n const present = new Set(preserved.map((item) => item.shotId));\n const appended = shotIds.filter((shotId) => !present.has(shotId)).map((shotId) => ({ shotId }));\n return [...preserved, ...appended].map((item) => ({\n shotId: item.shotId,\n versionId: selectedVersionForTarget(item.shotId, versions, selections, \"video\")?.id\n }));\n}\n\nexport function sequenceIssues(sequence: readonly ProductionSequenceItem[], versions: readonly ProductionMediaVersion[]): string[] {\n const versionById = new Map(versions.map((version) => [version.id, version]));\n const issues: string[] = [];\n for (const item of sequence) {\n const version = item.versionId === undefined ? undefined : versionById.get(item.versionId);\n if (version === undefined || version.kind !== \"video\") issues.push(`${item.shotId} \u7F3A\u5C11\u5DF2\u9009\u89C6\u9891\u7248\u672C`);\n else if (version.path === undefined) issues.push(`${item.shotId} \u7684\u89C6\u9891\u6CA1\u6709\u53EF\u4F9B DSH \u8BFB\u53D6\u7684\u5DE5\u4F5C\u533A\u8DEF\u5F84`);\n }\n return issues;\n}\n\nexport function reorderSequence(sequence: readonly ProductionSequenceItem[], source: number, target: number): ProductionSequenceItem[] {\n if (!Number.isInteger(source) || !Number.isInteger(target)) return [...sequence];\n if (source < 0 || target < 0 || source >= sequence.length || target >= sequence.length || source === target) return [...sequence];\n const next = [...sequence];\n const [item] = next.splice(source, 1);\n if (item !== undefined) next.splice(target, 0, item);\n return next;\n}\n", "export const OH_STORY_PRODUCTION_TOOL_NAME = \"oh_story_production\";\n\nexport const PRODUCTION_INTENT_ACTIONS = [\n \"open_section\",\n \"focus_target\",\n \"set_sequence\",\n \"track_job\"\n] as const;\n\nexport const PRODUCTION_INTENT_SECTIONS = [\"shots\", \"assets\", \"tasks\", \"sequence\", \"canvas\"] as const;\nexport const PRODUCTION_INTENT_JOB_KINDS = [\"image\", \"video\", \"composition\"] as const;\n\nexport type ProductionIntentAction = typeof PRODUCTION_INTENT_ACTIONS[number];\nexport type ProductionIntentSection = typeof PRODUCTION_INTENT_SECTIONS[number];\nexport type ProductionIntentJobKind = typeof PRODUCTION_INTENT_JOB_KINDS[number];\n\nexport interface ProductionIntentArgs {\n readonly action: ProductionIntentAction;\n readonly episode: string;\n readonly section?: ProductionIntentSection | undefined;\n readonly targetId?: string | undefined;\n readonly shotIds?: readonly string[] | undefined;\n readonly jobId?: string | undefined;\n readonly jobKind?: ProductionIntentJobKind | undefined;\n readonly expectedOutputs?: number | undefined;\n readonly prompt?: string | undefined;\n}\n\nfunction requiredText(value: string | undefined, field: string): string {\n const normalized = value?.trim();\n if (!normalized) throw new Error(`oh_story_production ${field} is required for this action.`);\n if (normalized.length > 512) throw new Error(`oh_story_production ${field} is too long.`);\n return normalized;\n}\n\n/** Validate the cross-runtime UI intent without reading or mutating workspace state. */\nexport function validateProductionIntent(args: ProductionIntentArgs): ProductionIntentArgs {\n const episode = args.episode.trim().replaceAll(\"\\\\\", \"/\").replace(/\\/$/u, \"\");\n if (!/^\u5267\u96C6\\/EP\\d{3,}$/u.test(episode)) {\n throw new Error(\"oh_story_production episode must use the creator path form \u5267\u96C6/EP001.\");\n }\n if (args.action === \"open_section\") {\n if (args.section === undefined) throw new Error(\"oh_story_production section is required for open_section.\");\n return { action: args.action, episode, section: args.section };\n }\n if (args.action === \"focus_target\") {\n return { action: args.action, episode, targetId: requiredText(args.targetId, \"targetId\"), section: args.section };\n }\n if (args.action === \"set_sequence\") {\n const shotIds = args.shotIds?.map((value) => value.trim()).filter((value) => value !== \"\") ?? [];\n if (shotIds.length === 0) throw new Error(\"oh_story_production shotIds must contain at least one shot for set_sequence.\");\n if (shotIds.length > 500 || new Set(shotIds).size !== shotIds.length || shotIds.some((value) => !/^SHOT-[A-Z0-9-]+$/u.test(value))) {\n throw new Error(\"oh_story_production shotIds must be unique canonical SHOT-* identifiers.\");\n }\n return { action: args.action, episode, shotIds };\n }\n // Leave expectedOutputs/prompt undefined when the caller omits them: track_job re-registers a job the\n // workbench already created, and defaulting here would silently reset a batch's count to 1.\n const expectedOutputs = args.expectedOutputs;\n if (expectedOutputs !== undefined && (!Number.isInteger(expectedOutputs) || expectedOutputs < 1 || expectedOutputs > 500)) {\n throw new Error(\"oh_story_production expectedOutputs must be an integer between 1 and 500.\");\n }\n if (args.jobKind === undefined) throw new Error(\"oh_story_production jobKind is required for track_job.\");\n const prompt = args.prompt?.trim();\n return {\n action: args.action,\n episode,\n jobId: requiredText(args.jobId, \"jobId\"),\n targetId: requiredText(args.targetId, \"targetId\"),\n jobKind: args.jobKind,\n expectedOutputs,\n prompt: prompt === \"\" ? undefined : prompt\n };\n}\n", "import type { ChatSnapshot } from \"@deepseek-ai/dsh-client-ui-chat/client\";\nimport type { ToolCallBlock } from \"@deepseek-ai/dsh-client-ui-conversation/client\";\nimport {\n OH_STORY_PRODUCTION_TOOL_NAME,\n validateProductionIntent,\n type ProductionIntentArgs\n} from \"../production-intent.js\";\n\nexport interface SettledProductionIntent {\n readonly callId: string;\n readonly intent: ProductionIntentArgs;\n}\n\nfunction parsedIntent(block: ToolCallBlock): SettledProductionIntent | undefined {\n if (!(\"kind\" in block) || block.isError || block.call?.name !== OH_STORY_PRODUCTION_TOOL_NAME) return undefined;\n try {\n const args = JSON.parse(block.call.argsRaw) as ProductionIntentArgs;\n return { callId: block.callId, intent: validateProductionIntent(args) };\n } catch {\n return undefined;\n }\n}\n\nfunction visit(block: ToolCallBlock, output: SettledProductionIntent[]): void {\n const direct = parsedIntent(block);\n if (direct !== undefined) output.push(direct);\n for (const child of block.subCalls) visit(child, output);\n}\n\n/** Replay durable successful Agent UI intents in official DSH Chat order. */\nexport function settledProductionIntents(chat: ChatSnapshot): SettledProductionIntent[] {\n const output: SettledProductionIntent[] = [];\n for (const key of chat.order) {\n const node = chat.nodes.get(key);\n if (node?.kind !== \"tool-call\") continue;\n const root = (node.data as { readonly root?: ToolCallBlock }).root;\n if (root !== undefined) visit(root, output);\n }\n return output;\n}\n", "import { useEffect, useId, useRef, useState } from \"react\";\nimport { workbenchLabel, type WorkbenchMode } from \"./file-activity.js\";\nimport { endpoint, handleTabKey } from \"./workbench-ui.js\";\n\nexport interface VideoPreviewAsset {\n readonly role: \"source\" | \"edited\" | \"final\";\n readonly label: string;\n readonly path: string;\n readonly bytes: number;\n readonly version: string;\n readonly mimeType: string;\n}\n\nexport interface VideoArtifactSummary {\n readonly label: string;\n readonly path: string;\n readonly version: string;\n readonly kind: \"plan\" | \"script\" | \"subtitle\" | \"quality\" | \"manifest\";\n}\n\nexport interface VideoProject {\n readonly id: string;\n readonly root: string;\n readonly title: string;\n readonly state: \"not-started\" | \"working\" | \"waiting\" | \"ready\";\n readonly stage: string;\n readonly stageLabel: string;\n readonly nextArtifact?: string | undefined;\n readonly previews: readonly VideoPreviewAsset[];\n readonly artifacts: readonly VideoArtifactSummary[];\n}\n\ninterface FilePayload { readonly content: string }\ninterface VideoPreflight {\n readonly python: { readonly ok: boolean; readonly version?: string };\n readonly ffmpeg: { readonly ok: boolean; readonly subtitles: boolean };\n readonly ffprobe: { readonly ok: boolean };\n readonly credentials: { readonly mimo: boolean; readonly fish: boolean; readonly ttsProvider: string };\n}\n\nfunction preferredPreview(project: VideoProject): VideoPreviewAsset | undefined {\n return project.previews.find((item) => item.role === \"final\")\n ?? project.previews.find((item) => item.role === \"edited\")\n ?? project.previews.find((item) => item.role === \"source\");\n}\n\nfunction readableBytes(bytes: number): string {\n if (bytes < 1_024 * 1_024) return `${(bytes / 1_024).toFixed(1)} KB`;\n if (bytes < 1_024 * 1_024 * 1_024) return `${(bytes / (1_024 * 1_024)).toFixed(1)} MB`;\n return `${(bytes / (1_024 * 1_024 * 1_024)).toFixed(2)} GB`;\n}\n\nfunction ActionIcon({ name }: { readonly name: \"reload\" | \"fullscreen\" | \"external\" }) {\n const paths = {\n reload: <><path d=\"M20 11a8 8 0 1 0-2.34 5.66\"/><path d=\"M20 4v7h-7\"/></>,\n fullscreen: <><path d=\"M8 3H3v5M16 3h5v5M8 21H3v-5M16 21h5v-5\"/></>,\n external: <><path d=\"M14 3h7v7M21 3l-9 9\"/><path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\"/></>\n };\n return <svg aria-hidden viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">{paths[name]}</svg>;\n}\n\nfunction preferredArtifact(project: VideoProject): VideoArtifactSummary | undefined {\n return project.artifacts.find((item) => item.path.endsWith(\"final_qc.json\"))\n ?? project.artifacts.find((item) => item.path.endsWith(\"assembly_qc.json\"))\n ?? project.artifacts.find((item) => item.kind === \"quality\")\n ?? project.artifacts.at(-1);\n}\n\nfunction artifactKindLabel(kind: VideoArtifactSummary[\"kind\"]): string {\n return { plan: \"\u65B9\u6848\", script: \"\u6587\u7A3F\", subtitle: \"\u5B57\u5E55\", quality: \"\u8D28\u68C0\", manifest: \"\u6E05\u5355\" }[kind];\n}\n\nfunction VideoPreview({ project, sessionId, running }: { readonly project: VideoProject; readonly sessionId: string; readonly running: boolean }) {\n const shellRef = useRef<HTMLDivElement>(null);\n const initial = preferredPreview(project);\n const [role, setRole] = useState<VideoPreviewAsset[\"role\"] | undefined>(initial?.role);\n const selected = project.previews.find((item) => item.role === role) ?? preferredPreview(project);\n const [loaded, setLoaded] = useState(initial);\n const [revision, setRevision] = useState(0);\n const [ready, setReady] = useState(false);\n const [error, setError] = useState(false);\n if (selected === undefined || loaded === undefined) return <div className=\"oh-video-preview-empty\">\n <span aria-hidden>\u25B6</span>\n <strong>\u8FD8\u6CA1\u6709\u53EF\u9884\u89C8\u7684\u89C6\u9891</strong>\n <p>\u628A\u539F\u7247\u5BFC\u5165 <code>video-recaps/&lt;\u9879\u76EE&gt;/sources/</code>\uFF0C\u7136\u540E\u5728\u53F3\u4FA7 Chat \u4F7F\u7528 <code>/video-recap</code>\u3002\u526A\u540E\u7247\u548C\u6700\u7EC8\u6210\u7247\u4F1A\u81EA\u52A8\u51FA\u73B0\u5728\u8FD9\u91CC\u3002</p>\n <div className=\"oh-video-prompt-example\"><span>\u63CF\u8FF0\u793A\u4F8B</span><q>\u628A\u8FD9\u6BB5\u89C6\u9891\u505A\u6210 3 \u5206\u949F\u4E2D\u6587\u89E3\u8BF4\uFF0C\u4FDD\u7559\u5173\u952E\u539F\u58F0\uFF0C\u5B57\u5E55\u70E7\u8FDB\u753B\u9762\u3002</q></div>\n </div>;\n const pending = selected.path !== loaded.path || selected.version !== loaded.version;\n const load = (asset: VideoPreviewAsset): void => {\n setRole(asset.role);\n setLoaded(asset);\n setReady(false);\n setError(false);\n setRevision((value) => value + 1);\n };\n const runtimeState = error ? \"\u89C6\u9891\u8F7D\u5165\u5931\u8D25 \u00B7 \u53EF\u91CD\u65B0\u8F7D\u5165\"\n : running ? \"Agent \u6B63\u5728\u66F4\u65B0\u9879\u76EE \u00B7 \u5F53\u524D\u64AD\u653E\u4FDD\u6301\u4E0D\u53D8\"\n : pending ? \"\u65B0\u7248\u672C\u5DF2\u5C31\u7EEA \u00B7 \u7531\u4F60\u51B3\u5B9A\u4F55\u65F6\u8F7D\u5165\"\n : ready ? `${loaded.label}\u5DF2\u8F7D\u5165 \u00B7 ${readableBytes(loaded.bytes)}` : \"\u6B63\u5728\u8BFB\u53D6\u89C6\u9891\u4FE1\u606F\u2026\";\n const mediaUrl = `${endpoint(\"media\", sessionId, loaded.path)}&version=${encodeURIComponent(loaded.version)}&reload=${String(revision)}`;\n return <div ref={shellRef} className=\"oh-video-preview-shell\" data-state={error ? \"error\" : running ? \"building\" : ready ? \"ready\" : \"loading\"}>\n <div className=\"oh-video-stagebar\">\n <div className=\"oh-video-version-tabs\" role=\"tablist\" aria-label=\"\u9884\u89C8\u7248\u672C\">\n {project.previews.map((asset) => <button\n type=\"button\"\n role=\"tab\"\n key={asset.role}\n aria-selected={asset.role === selected.role}\n tabIndex={asset.role === selected.role ? 0 : -1}\n onKeyDown={(event) => { handleTabKey(event, project.previews.map((item) => item.role), selected.role, (next) => {\n const asset = project.previews.find((item) => item.role === next);\n if (asset !== undefined) load(asset);\n }); }}\n onClick={() => { load(asset); }}\n >{asset.label}</button>)}\n </div>\n <span className=\"oh-video-runtime-state\" role=\"status\" aria-live=\"polite\"><i aria-hidden /><em>{runtimeState}</em></span>\n <div className=\"oh-video-preview-actions\">\n {pending && <button type=\"button\" onClick={() => { load(selected); }}>\u8F7D\u5165\u65B0\u7248\u672C</button>}\n <button type=\"button\" title=\"\u91CD\u65B0\u8F7D\u5165\" aria-label=\"\u91CD\u65B0\u8F7D\u5165\u89C6\u9891\" onClick={() => { load(loaded); }}><ActionIcon name=\"reload\" /></button>\n <button type=\"button\" title=\"\u5168\u5C4F\" aria-label=\"\u5168\u5C4F\u9884\u89C8\" onClick={() => { void shellRef.current?.requestFullscreen(); }}><ActionIcon name=\"fullscreen\" /></button>\n <a href={mediaUrl} target=\"_blank\" rel=\"noreferrer\" title=\"\u5728\u65B0\u7A97\u53E3\u6253\u5F00\" aria-label=\"\u5728\u65B0\u7A97\u53E3\u6253\u5F00\u89C6\u9891\"><ActionIcon name=\"external\" /></a>\n </div>\n </div>\n <div className=\"oh-video-player-stage\">\n <video\n key={`${loaded.path}:${loaded.version}:${String(revision)}`}\n src={mediaUrl}\n controls\n preload=\"metadata\"\n playsInline\n onLoadedMetadata={() => { setReady(true); setError(false); }}\n onError={() => { setError(true); setReady(false); }}\n />\n </div>\n </div>;\n}\n\nfunction VideoArtifacts({ project, sessionId }: { readonly project: VideoProject; readonly sessionId: string }) {\n const [selected, setSelected] = useState(preferredArtifact(project)?.path);\n const [content, setContent] = useState<string>();\n const [error, setError] = useState<string>();\n const [preflight, setPreflight] = useState<VideoPreflight | \"failed\">();\n useEffect(() => { setSelected(preferredArtifact(project)?.path); }, [project.id]);\n useEffect(() => {\n if (selected === undefined) { setContent(undefined); return; }\n const controller = new AbortController();\n setContent(undefined);\n setError(undefined);\n void fetch(endpoint(\"file\", sessionId, selected), { signal: controller.signal })\n .then(async (response) => {\n const payload = await response.json() as FilePayload & { readonly error?: string };\n if (!response.ok) throw new Error(payload.error ?? `HTTP ${String(response.status)}`);\n setContent(payload.content);\n })\n .catch((reason: unknown) => { if (!controller.signal.aborted) setError(reason instanceof Error ? reason.message : String(reason)); });\n return () => { controller.abort(); };\n }, [selected, sessionId]);\n const selectedArtifact = project.artifacts.find((item) => item.path === selected);\n return <div className=\"oh-video-artifacts\">\n <aside aria-label=\"\u89C6\u9891\u9879\u76EE\u4EA7\u7269\">\n <div className=\"oh-video-artifacts-heading\"><strong>\u9879\u76EE\u4EA7\u7269</strong><span>{project.artifacts.length}</span></div>\n <div className=\"oh-video-environment\">\n <strong>\u8FD0\u884C\u73AF\u5883</strong>\n {typeof preflight === \"object\" ? <>\n <span data-ready={preflight.python.ok || undefined}>Python {preflight.python.version ?? \"\u672A\u627E\u5230\"}</span>\n <span data-ready={(preflight.ffmpeg.ok && preflight.ffmpeg.subtitles) || undefined}>ffmpeg {preflight.ffmpeg.subtitles ? \"\u00B7 libass\" : \"\u00B7 \u7F3A\u5B57\u5E55\u6EE4\u955C\"}</span>\n <span data-ready={preflight.ffprobe.ok || undefined}>ffprobe {preflight.ffprobe.ok ? \"\u53EF\u7528\" : \"\u672A\u627E\u5230\"}</span>\n <span data-ready={preflight.credentials.mimo || undefined}>MiMo Key {preflight.credentials.mimo ? \"\u5DF2\u914D\u7F6E\" : \"\u672A\u914D\u7F6E\"}</span>\n {preflight.credentials.ttsProvider === \"fish\"\n && <span data-ready={preflight.credentials.fish || undefined}>Fish Key {preflight.credentials.fish ? \"\u5DF2\u914D\u7F6E\" : \"\u672A\u914D\u7F6E\"}</span>}\n <em>DSH Host \u8FDB\u7A0B\u73AF\u5883\uFF1BAgent \u6267\u884C\u4E16\u754C\u4EE5 <code>video-recap --doctor</code> \u4E3A\u51C6\u3002</em>\n </> : <button type=\"button\" onClick={() => {\n void fetch(endpoint(\"video-preflight\", sessionId)).then(async (response) => {\n if (!response.ok) throw new Error(`HTTP ${String(response.status)}`);\n setPreflight(await response.json() as VideoPreflight);\n }).catch(() => { setPreflight(\"failed\"); });\n }}>{preflight === \"failed\" ? \"\u73AF\u5883\u68C0\u67E5\u5931\u8D25 \u00B7 \u91CD\u8BD5\" : \"\u68C0\u67E5\u73AF\u5883\"}</button>}\n </div>\n <nav>\n {project.artifacts.length === 0 && <p>\u6D41\u6C34\u7EBF\u542F\u52A8\u540E\uFF0C\u5173\u952E\u4EA7\u7269\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002</p>}\n {project.artifacts.map((artifact) => <button\n type=\"button\"\n key={artifact.path}\n aria-current={artifact.path === selected ? \"page\" : undefined}\n onClick={() => { setSelected(artifact.path); }}\n ><span>{artifact.label}</span><small>{artifact.path.split(\"/\").at(-1)}</small></button>)}\n </nav>\n </aside>\n <section>\n {selectedArtifact !== undefined && <header className=\"oh-video-artifact-header\">\n <div><strong>{selectedArtifact.label}</strong><span>{selectedArtifact.path.split(\"/\").at(-1)}</span></div>\n <em>{artifactKindLabel(selectedArtifact.kind)}</em>\n </header>}\n <div className=\"oh-video-artifact-content\">{project.artifacts.length === 0 ? <div className=\"oh-video-artifacts-empty\">\u6545\u4E8B\u65B9\u6848\u3001\u89E3\u8BF4\u8BCD\u3001\u5B57\u5E55\u548C\u8D28\u68C0\u62A5\u544A\u4F1A\u6309\u4E0A\u6E38\u6D41\u6C34\u7EBF\u5199\u5165\u8FD9\u91CC\u3002</div>\n : error !== undefined ? <div className=\"oh-story-error\">{error}</div>\n : content === undefined ? <div className=\"oh-video-artifacts-empty\">\u6B63\u5728\u8F7D\u5165\u4EA7\u7269\u2026</div>\n : <pre>{content}</pre>}</div>\n </section>\n </div>;\n}\n\nexport function VideoStudio({\n sessionId,\n projects,\n running,\n projectId,\n tab,\n hidden,\n workbenches,\n paneId,\n labelledBy,\n onProject,\n onTab,\n onWorkbench,\n onCollapse\n}: {\n readonly sessionId: string;\n readonly projects: readonly VideoProject[];\n readonly running: boolean;\n readonly projectId: string | undefined;\n readonly tab: \"preview\" | \"artifacts\";\n readonly hidden: boolean;\n readonly workbenches: readonly WorkbenchMode[];\n readonly paneId: string;\n readonly labelledBy: string;\n readonly onProject: (id: string) => void;\n readonly onTab: (tab: \"preview\" | \"artifacts\") => void;\n readonly onWorkbench: (mode: WorkbenchMode) => void;\n readonly onCollapse: () => void;\n}) {\n const project = projects.find((item) => item.id === projectId) ?? projects[0];\n const tabsId = useId();\n useEffect(() => { if (project !== undefined && project.id !== projectId) onProject(project.id); }, [onProject, project, projectId]);\n const tabs = [\"preview\", \"artifacts\"] as const;\n return <main id={paneId} className=\"oh-video-studio\" role=\"tabpanel\" aria-labelledby={labelledBy} hidden={hidden}>\n <header className=\"oh-video-toolbar\">\n <div className=\"oh-workbench-cluster\">\n <div className=\"oh-video-mode-tabs\" role=\"tablist\" aria-label=\"\u521B\u4F5C\u5DE5\u4F5C\u53F0\">{workbenches.map((mode) => <button\n type=\"button\" role=\"tab\" key={mode} aria-selected={mode === \"video\"} tabIndex={mode === \"video\" ? 0 : -1}\n onKeyDown={(event) => { handleTabKey(event, workbenches, \"video\", onWorkbench); }} onClick={() => { onWorkbench(mode); }}\n >{workbenchLabel(mode)}</button>)}</div>\n <button className=\"oh-workbench-collapse\" type=\"button\" title=\"\u6536\u8D77\u521B\u4F5C\u5DE5\u4F5C\u53F0\" aria-label=\"\u6536\u8D77\u521B\u4F5C\u5DE5\u4F5C\u53F0\" onClick={onCollapse}>\u00D7</button>\n </div>\n <label className=\"oh-video-project\"><span>\u89C6\u9891\u9879\u76EE</span><select aria-label=\"\u89C6\u9891\u9879\u76EE\" value={project?.id ?? \"\"} disabled={project === undefined} onChange={(event) => { onProject(event.target.value); }}>\n {projects.map((item) => <option key={item.id} value={item.id}>{item.title}</option>)}\n </select></label>\n {project !== undefined && <span className=\"oh-video-stage\" data-state={project.state}><i aria-hidden />{project.stageLabel}</span>}\n <div className=\"oh-video-tabs\" role=\"tablist\" aria-label=\"\u89C6\u9891\u5DE5\u4F5C\u53F0\">{tabs.map((item) => <button\n type=\"button\" role=\"tab\" key={item} id={`${tabsId}-${item}-tab`} aria-controls={`${tabsId}-${item}-panel`}\n aria-selected={tab === item} tabIndex={tab === item ? 0 : -1}\n onKeyDown={(event) => { handleTabKey(event, tabs, tab, onTab); }} onClick={() => { onTab(item); }}\n >{item === \"preview\" ? \"\u9884\u89C8\" : \"\u4EA7\u7269\"}</button>)}</div>\n </header>\n {project === undefined ? <div className=\"oh-video-preview-empty\"><span aria-hidden>\u25B6</span><strong>\u8FD8\u6CA1\u6709\u89C6\u9891\u9879\u76EE</strong><p>\u5728\u53F3\u4FA7 Chat \u544A\u8BC9 Agent \u8981\u5904\u7406\u7684\u89C6\u9891\uFF1B\u9879\u76EE\u4F1A\u521B\u5EFA\u5728 <code>video-recaps/&lt;\u9879\u76EE&gt;/</code>\u3002</p></div> : <div className=\"oh-video-panels\">\n <div role=\"tabpanel\" id={`${tabsId}-preview-panel`} aria-labelledby={`${tabsId}-preview-tab`} hidden={tab !== \"preview\"}><VideoPreview key={project.id} project={project} sessionId={sessionId} running={running} /></div>\n <div role=\"tabpanel\" id={`${tabsId}-artifacts-panel`} aria-labelledby={`${tabsId}-artifacts-tab`} hidden={tab !== \"artifacts\"}><VideoArtifacts project={project} sessionId={sessionId} /></div>\n </div>}\n </main>;\n}\n", "/**\n * DSH is a general Harness: one installed plugin must not turn every Session\n * into a writing surface. The workbench claims the conversation layout only for\n * a workspace that actually holds creative work, and the creator can always\n * take the layout back.\n */\n\nexport type WorkbenchPreference = \"open\" | \"closed\";\n\nexport interface WorkbenchWorkspace {\n readonly files: readonly unknown[];\n readonly games: readonly { readonly source: \"workspace\" | \"example\" }[];\n readonly videos: readonly unknown[];\n}\n\nexport interface WorkbenchPreferenceStorage {\n getItem: (key: string) => string | null;\n setItem: (key: string, value: string) => void;\n}\n\n/** The bundled game example ships with the plugin, so it never marks a workspace as creative. */\nexport function hasCreativeProject(workspace: WorkbenchWorkspace | undefined): boolean {\n if (workspace === undefined) return false;\n return workspace.files.length > 0\n || workspace.videos.length > 0\n || workspace.games.some((game) => game.source === \"workspace\");\n}\n\n/** An explicit creator choice always wins over what the workspace happens to contain. */\nexport function resolveWorkbenchOpen(preference: WorkbenchPreference | undefined, creativeProject: boolean): boolean {\n return preference === undefined ? creativeProject : preference === \"open\";\n}\n\nexport function workbenchPreferenceKey(cwd: string): string {\n return `oh-story.workbench.${cwd}`;\n}\n\n/** The DSH Session Store is not persisted, so the choice is kept per workspace instead. */\nexport function readWorkbenchPreference(storage: WorkbenchPreferenceStorage | undefined, cwd: string | undefined): WorkbenchPreference | undefined {\n if (storage === undefined || cwd === undefined) return undefined;\n let value: string | null;\n try { value = storage.getItem(workbenchPreferenceKey(cwd)); }\n catch { return undefined; }\n return value === \"open\" || value === \"closed\" ? value : undefined;\n}\n\nexport function writeWorkbenchPreference(storage: WorkbenchPreferenceStorage | undefined, cwd: string | undefined, preference: WorkbenchPreference): void {\n if (storage === undefined || cwd === undefined) return;\n // Private windows and blocked site data refuse to persist; the Session still keeps the choice.\n try { storage.setItem(workbenchPreferenceKey(cwd), preference); }\n catch { /* the Session Store remains the in-session authority */ }\n}\n\n/** Reading the property itself throws when the browser blocks site data. */\nexport function workbenchPreferenceStorage(): WorkbenchPreferenceStorage | undefined {\n try { return globalThis.localStorage; }\n catch { return undefined; }\n}\n", ".oh-story-bridge-marker { display: none; }\n.oh-story-split-surface { display: contents; font-family: var(--dsw-font-family); }\n\n/* Collapsed, the plugin owns nothing but this control: DSH renders the\n conversation exactly as it does without the plugin installed. The launcher is\n fixed to the conversation column's own corner, which the bridge publishes,\n because the surrounding shell is not ours to place things in. */\n.oh-story-launcher {\n box-sizing: border-box;\n display: flex;\n position: fixed;\n z-index: 9;\n top: calc(var(--oh-story-seam-top, 0px) + 10px);\n right: calc(var(--oh-story-seam-right, 0px) + 14px);\n min-height: 28px;\n align-items: center;\n gap: 6px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 999px;\n color: var(--dsw-alias-label-secondary);\n background: var(--dsw-alias-bg-base);\n padding: 3px 11px;\n cursor: pointer;\n font-family: var(--dsw-font-family);\n font-size: 12px;\n line-height: 20px;\n}\n.oh-story-launcher b { font-weight: 500; }\n.oh-story-launcher:hover { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-interactive-bg-hover); }\n.oh-story-launcher:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: 2px; }\n\n/* DSH documents every [data-slot] wrapper as a stable addressable styling\n seam. The official Session body and composer stay mounted; this only turns\n their scroll host into a three-column writing surface. */\n[data-conversation-scroll]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"]) {\n --os-border: var(--dsw-alias-border-l2);\n --os-muted: var(--dsw-alias-label-secondary);\n display: grid;\n grid-template-columns: clamp(184px, 16%, 200px) minmax(240px, 1fr) clamp(408px, 40%, 520px);\n grid-template-rows: minmax(0, 1fr);\n min-height: 0;\n overflow-x: hidden;\n overflow-y: auto;\n position: relative;\n scrollbar-gutter: stable;\n scroll-padding-bottom: calc(max(var(--dsh-composer-height, 152px), var(--oh-story-composer-height, 0px)) + 16px);\n}\n\n/* Keep the final Chat flow above the overlapping official Composer. */\n[data-conversation-scroll]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"])\n > [data-slot=\"conversation.session\"] > :not(.oh-story-split-surface) {\n grid-column: 3;\n grid-row: 1;\n min-width: 0;\n min-height: 100%;\n border-left: 1px solid var(--os-border);\n}\n\n[data-conversation-scroll]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"])\n [data-chat-flow] {\n padding-bottom: calc(max(var(--dsh-composer-height, 152px), var(--oh-story-composer-height, 0px)) + 16px);\n}\n\n[data-conversation-scroll]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"])\n > [data-composer-seat] {\n grid-column: 3;\n grid-row: 1;\n align-self: start;\n min-width: 0;\n width: 100%;\n position: sticky;\n top: calc(var(--oh-story-scroll-height, 720px) - max(var(--dsh-composer-height, 152px), var(--oh-story-composer-height, 0px)));\n bottom: auto;\n}\n\n/* Game mode keeps the official Conversation on the right but merges the two\n creator columns into one playable Studio. */\n[data-conversation-scroll][data-oh-story-workbench=\"game\"]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"]) {\n --game-stage: #0d100e;\n --game-stage-raised: #161a17;\n --game-accent: var(--dsw-alias-state-business-primary);\n --game-warning: #f4bd55;\n --game-danger: #f06b63;\n grid-template-columns: minmax(0, 1fr) clamp(400px, 34%, 520px);\n overflow: hidden;\n}\n\n[data-conversation-scroll][data-oh-story-workbench=\"game\"]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"])\n > [data-slot=\"conversation.session\"] > :not(.oh-story-split-surface),\n[data-conversation-scroll][data-oh-story-workbench=\"game\"]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"])\n > [data-composer-seat] { grid-column: 2; }\n\n/* DSH 0.1.2 lays two 40px column-resize strips (z-index 8) over the whole\n conversation area. The workbench replaces that column geometry, so the strip\n no longer marks a real column seam here \u2014 it just swallows clicks on the\n right edge of the file tree. The creator panes take the clicks back. */\n.oh-story-tree,\n.oh-story-editor {\n box-sizing: border-box;\n grid-row: 1;\n position: sticky;\n z-index: 9;\n top: 0;\n align-self: start;\n min-width: 0;\n min-height: 0;\n height: 100%;\n color: inherit;\n background: var(--dsw-alias-bg-base);\n}\n\n.oh-game-studio {\n box-sizing: border-box;\n display: flex;\n grid-column: 1;\n grid-row: 1;\n position: sticky;\n z-index: 9;\n top: 0;\n min-width: 0;\n min-height: 0;\n height: 100%;\n align-self: start;\n overflow: hidden;\n flex-direction: column;\n border-right: 1px solid var(--os-border);\n color: var(--dsw-alias-label-primary);\n background: var(--dsw-alias-bg-base);\n}\n.oh-game-studio[hidden] { display: none; }\n\n.oh-game-toolbar {\n box-sizing: border-box;\n display: grid;\n min-height: 56px;\n flex: none;\n grid-template-columns: auto minmax(160px, 1fr) auto;\n align-items: center;\n gap: 9px;\n padding: 8px 12px;\n border-bottom: 1px solid var(--os-border);\n background: var(--dsw-alias-bg-base);\n}\n\n.oh-game-mode-tabs {\n display: flex;\n margin-right: 2px;\n padding-right: 9px;\n border-right: 1px solid var(--os-border);\n}\n.oh-game-mode-tabs button {\n min-width: 42px;\n min-height: 36px;\n border: 0;\n border-radius: 5px;\n color: var(--os-muted);\n background: transparent;\n padding: 4px 7px;\n cursor: pointer;\n white-space: nowrap;\n font: 11px/1 var(--dsw-font-family);\n}\n.oh-game-mode-tabs button:hover { color: var(--dsw-alias-label-primary); }\n.oh-game-mode-tabs button[aria-selected=\"true\"] { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-button-ghost-active-fill); font-weight: 500; }\n\n.oh-game-project { display: flex; min-width: 0; align-items: center; gap: 7px; color: var(--os-muted); font-size: 11px; }\n.oh-game-project > span { flex: none; }\n.oh-game-project select,\n.oh-game-design select {\n min-width: 0;\n border: 1px solid var(--os-border);\n border-radius: 8px;\n color: var(--dsw-alias-label-primary);\n background: var(--dsw-alias-bg-base);\n padding: 6px 28px 6px 9px;\n font: inherit;\n}\n.oh-game-project select { max-width: 360px; min-height: 36px; flex: 1; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }\n.oh-game-design select { min-height: 36px; }\n.oh-game-project select:focus-visible,\n.oh-game-design select:focus-visible,\n.oh-game-mode-tabs button:focus-visible,\n.oh-game-tabs button:focus-visible,\n.oh-game-preview-status button:focus-visible,\n.oh-game-mobile-switcher button:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: 1px; }\n\n.oh-game-tabs,\n.oh-game-mobile-switcher {\n display: flex;\n padding: 2px;\n border: 1px solid var(--os-border);\n border-radius: 9px;\n background: var(--dsw-alias-bg-base);\n}\n.oh-game-tabs button,\n.oh-game-mobile-switcher button {\n min-width: 56px;\n min-height: 36px;\n border: 0;\n border-radius: 6px;\n color: var(--os-muted);\n background: transparent;\n cursor: pointer;\n font: 12px/1 var(--dsw-font-family);\n}\n.oh-game-tabs button:hover,\n.oh-game-mobile-switcher button:hover { color: var(--dsw-alias-label-primary); }\n.oh-game-tabs button[aria-selected=\"true\"],\n.oh-game-mobile-switcher button[aria-selected=\"true\"] { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-button-ghost-active-fill); box-shadow: 0 1px 2px rgb(0 0 0 / 7%); font-weight: 600; }\n.oh-game-panels,\n.oh-game-panel {\n display: flex;\n min-width: 0;\n min-height: 0;\n flex: 1;\n overflow: hidden;\n flex-direction: column;\n}\n.oh-game-panel[hidden] { display: none; }\n\n.oh-game-preview-shell {\n display: grid;\n min-width: 0;\n min-height: 0;\n flex: 1;\n grid-template-rows: 40px minmax(0, 1fr);\n position: relative;\n overflow: hidden;\n border-top: 2px solid var(--game-accent);\n background-color: var(--game-stage);\n}\n.oh-game-preview-shell[data-state=\"building\"] { border-top-color: var(--game-warning); animation: oh-game-build-line 1.4s linear infinite; }\n.oh-game-preview-shell[data-state=\"error\"] { border-top-color: var(--game-danger); }\n.oh-game-preview-status {\n display: flex;\n min-width: 0;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n padding: 0 10px 0 12px;\n color: rgb(244 248 240 / 76%);\n background: var(--game-stage-raised);\n font-size: 11px;\n}\n.oh-game-runtime-state { display: inline-flex; overflow: hidden; min-width: 0; align-items: center; gap: 7px; text-overflow: ellipsis; white-space: nowrap; }\n.oh-game-runtime-state > i { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--dsw-alias-state-success-primary, #45b96f); }\n.oh-game-preview-shell[data-state=\"loading\"] .oh-game-runtime-state > i { background: rgb(255 255 255 / 42%); box-shadow: none; }\n.oh-game-preview-shell[data-state=\"building\"] .oh-game-runtime-state > i { background: var(--game-warning); }\n.oh-game-preview-shell[data-state=\"error\"] .oh-game-runtime-state > i { background: var(--game-danger); }\n.oh-game-preview-status > div { display: flex; flex: none; gap: 6px; }\n.oh-game-preview-status button {\n min-height: 36px;\n border: 1px solid rgb(255 255 255 / 14%);\n border-radius: 6px;\n color: rgb(255 255 255 / 84%);\n background: rgb(255 255 255 / 5%);\n padding: 3px 8px;\n cursor: pointer;\n font: inherit;\n}\n.oh-game-preview-status button:hover { background: rgb(255 255 255 / 11%); }\n.oh-game-reload { display: inline-flex; align-items: center; gap: 5px; }\n.oh-game-reload b { font: inherit; font-weight: 500; }\n.oh-game-preview-shell iframe { width: 100%; height: 100%; min-width: 0; min-height: 0; border: 0; background: var(--game-stage); }\n.oh-game-focus-hint {\n position: absolute;\n right: 10px;\n bottom: 10px;\n z-index: 2;\n padding: 4px 8px;\n border: 1px solid rgb(255 255 255 / 12%);\n border-radius: 6px;\n color: rgb(255 255 255 / 62%);\n background: rgb(8 10 9 / 82%);\n pointer-events: none;\n font-size: 10px;\n}\n.oh-game-focus-hint[data-focused] { color: var(--game-accent); }\n\n.oh-game-preview-empty,\n.oh-game-design-empty {\n display: grid;\n max-width: 560px;\n margin: auto;\n padding: 36px;\n place-items: center;\n gap: 8px;\n color: var(--os-muted);\n text-align: center;\n line-height: 1.65;\n}\n.oh-game-preview-empty { width: 100%; max-width: none; min-height: 0; flex: 1; box-sizing: border-box; align-content: center; color: rgb(244 248 240 / 70%); background: var(--game-stage); }\n.oh-game-preview-empty > span { color: var(--game-accent); font-size: 30px; }\n.oh-game-preview-empty strong,\n.oh-game-design-empty strong { color: inherit; font-size: 15px; }\n.oh-game-preview-empty p,\n.oh-game-design-empty p { margin: 0; }\n.oh-game-preview-empty code,\n.oh-game-design-empty code { font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }\n.oh-game-prompt-example { display: grid; max-width: 560px; gap: 4px; margin-top: 8px; padding: 10px 12px; border: 1px solid rgb(255 255 255 / 12%); border-radius: 8px; text-align: left; }\n.oh-game-prompt-example span { color: var(--game-accent); font-size: 10px; font-weight: 600; }\n.oh-game-prompt-example q { color: rgb(244 248 240 / 72%); quotes: none; font-size: 11px; }\n\n.oh-game-design { display: flex; min-height: 0; flex: 1; overflow: hidden; flex-direction: column; }\n.oh-game-design > label { display: flex; min-height: 42px; flex: none; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--os-border); color: var(--os-muted); font-size: 11px; }\n.oh-game-design select { max-width: min(560px, 75%); }\n.oh-game-source { box-sizing: border-box; min-height: 0; flex: 1; overflow: auto; margin: 0; padding: 18px 22px 48px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-markdown-code-block); white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }\n\n.oh-game-mobile-switcher { display: none; }\n\n@keyframes oh-game-build-line { 50% { border-top-color: var(--game-accent); } }\n\n.oh-story-tree {\n grid-column: 1;\n overflow: auto;\n padding: 14px 10px 24px;\n border-right: 1px solid var(--os-border);\n background: var(--dsw-specific-sidebar-fill);\n}\n\n.oh-story-editor {\n display: flex;\n grid-column: 2;\n overflow: hidden;\n flex-direction: column;\n}\n\n.oh-story-brand,\n.oh-story-editor header,\n.oh-story-role summary {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n}\n\n.oh-story-brand { min-height: 28px; gap: 8px; padding: 0 5px 8px 7px; font-size: 14px; font-weight: 500; white-space: nowrap; }\n.oh-story-brand-cluster { display: flex; min-width: 0; align-items: center; gap: 6px; }\n.oh-story-brand-cluster strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: inherit; }\n.oh-story-kind { flex: none; padding: 1px 6px; border-radius: 5px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-button-ghost-active-fill); font-size: 11px; line-height: 16px; font-weight: 500; }\n\n.oh-story-brand button,\n.oh-story-save,\n.oh-story-role button {\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 999px;\n color: var(--dsw-alias-label-secondary);\n background: var(--dsw-alias-bg-base);\n padding: 3px 9px;\n cursor: pointer;\n font: inherit;\n}\n\n.oh-story-brand button { display: grid; width: 28px; height: 28px; place-items: center; border: 0; padding: 0; background: transparent; font-size: 16px; }\n.oh-story-brand button:hover,\n.oh-story-save:hover:not(:disabled),\n.oh-story-role button:hover { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-interactive-bg-hover); }\n.oh-story-brand button:focus-visible,\n.oh-story-save:focus-visible,\n.oh-story-mode-tabs button:focus-visible,\n.oh-story-editor-tabs button:focus-visible,\n.oh-story-tree nav button:focus-visible,\n.oh-story-role button:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: -2px; }\n.oh-story-save:disabled { opacity: .48; cursor: default; }\n\n.oh-story-brand-actions { display: flex; flex: none; align-items: center; gap: 2px; }\n\n.oh-workbench-cluster { display: flex; min-width: 0; align-items: center; gap: 6px; }\n.oh-workbench-collapse {\n display: grid;\n width: 28px;\n height: 28px;\n flex: none;\n place-items: center;\n border: 0;\n border-radius: 5px;\n color: var(--os-muted);\n background: transparent;\n padding: 0;\n cursor: pointer;\n font: inherit;\n font-size: 16px;\n}\n.oh-workbench-collapse:hover { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-interactive-bg-hover); }\n.oh-workbench-collapse:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: -2px; }\n\n.oh-story-mode-tabs { display: flex; margin: 0 4px 8px; padding: 2px; border: 1px solid var(--os-border); border-radius: 7px; background: var(--dsw-alias-bg-layer-1); }\n\n.oh-story-mode-tabs button,\n.oh-story-editor-tabs button {\n position: relative;\n min-height: 24px;\n flex: 1;\n border: 0;\n color: var(--os-muted);\n background: transparent;\n border-radius: 5px;\n cursor: pointer;\n font: inherit;\n font-size: 11px;\n}\n\n.oh-story-mode-tabs button:hover,\n.oh-story-editor-tabs button:hover { color: var(--dsw-alias-label-primary); }\n.oh-story-mode-tabs button[aria-selected=\"true\"],\n.oh-story-editor-tabs button[aria-selected=\"true\"] { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-bg-base); box-shadow: 0 1px 2px rgb(0 0 0 / 8%); font-weight: 500; }\n\n.oh-story-file-group,\n.oh-story-file-folder { margin: 0; }\n.oh-story-file-group > summary,\n.oh-story-file-folder > summary {\n display: flex;\n align-items: center;\n gap: 5px;\n min-height: 26px;\n padding: 0 7px;\n border-radius: 6px;\n color: var(--os-muted);\n cursor: pointer;\n list-style: none;\n font-size: 11px;\n font-weight: 600;\n}\n.oh-story-file-folder > summary { padding-left: min(calc(7px + var(--oh-story-indent, 0px)), 49px); }\n.oh-story-file-group > summary { margin-top: 3px; }\n.oh-story-file-group > summary::-webkit-details-marker,\n.oh-story-file-folder > summary::-webkit-details-marker { display: none; }\n.oh-story-file-group > summary::before,\n.oh-story-file-folder > summary::before { width: 8px; content: \"\u203A\"; transform: rotate(0); transition: transform .12s ease; }\n.oh-story-file-group[open] > summary::before,\n.oh-story-file-folder[open] > summary::before { transform: rotate(90deg); }\n.oh-story-file-group > summary:hover,\n.oh-story-file-folder > summary:hover { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-interactive-bg-hover); }\n.oh-story-file-group > summary span,\n.oh-story-file-folder > summary span { margin-left: auto; color: var(--dsw-alias-label-secondary); font-weight: 400; }\n\n.oh-story-tree nav button {\n display: block;\n width: 100%;\n overflow: hidden;\n padding: 6px 8px 6px min(calc(14px + var(--oh-story-indent, 0px)), 56px);\n border: 0;\n border-radius: 6px;\n color: inherit;\n background: transparent;\n text-align: left;\n text-overflow: ellipsis;\n white-space: nowrap;\n cursor: pointer;\n font: inherit;\n font-size: 12px;\n}\n.oh-story-tree nav button:hover { background: var(--dsw-alias-interactive-bg-hover); }\n.oh-story-tree nav button[aria-current=\"page\"] { background: var(--dsw-alias-button-ghost-active-fill); color: var(--dsw-alias-label-primary); }\n.oh-story-tree nav button[data-agent-target] { box-shadow: inset 2px 0 var(--dsw-alias-state-business-primary); }\n\n.oh-story-editor > header {\n min-height: 44px;\n flex: none;\n padding: 0 14px;\n border-bottom: 1px solid var(--os-border);\n}\n\n.oh-story-editor-path {\n overflow: hidden;\n min-width: 0;\n flex: 1;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 12px;\n color: var(--os-muted);\n}\n.oh-story-editor-path > span { overflow: hidden; display: block; text-overflow: ellipsis; }\n.oh-story-editor-path > strong { display: none; overflow: hidden; text-overflow: ellipsis; font: inherit; }\n\n.oh-story-editor-actions { display: flex; flex: none; align-items: center; gap: 8px; }\n.oh-story-editor-tabs {\n display: flex;\n padding: 2px;\n border: 1px solid var(--os-border);\n border-radius: 7px;\n background: var(--dsw-alias-bg-layer-1);\n}\n.oh-story-editor-tabs button { min-height: 24px; padding: 0 9px; border-radius: 5px; font-size: 11px; }\n.oh-story-save { min-height: 28px; }\n\n.oh-story-editor textarea {\n box-sizing: border-box;\n width: 100%;\n min-height: 0;\n flex: 1;\n resize: none;\n border: 0;\n outline: 0;\n padding: clamp(20px, 6%, 48px) clamp(22px, 10%, 84px) 48px;\n color: var(--dsw-alias-label-primary);\n background: transparent;\n font: 16px/1.9 ui-serif, \"Songti SC\", \"STSong\", Georgia, serif;\n}\n.oh-story-editor textarea[data-format=\"structured\"] {\n tab-size: 2;\n font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;\n}\n\n.oh-story-markdown {\n box-sizing: border-box;\n width: 100%;\n min-height: 0;\n flex: 1;\n overflow: auto;\n padding: clamp(24px, 8%, 56px) clamp(24px, 10%, 92px) 64px;\n color: var(--dsw-alias-label-primary);\n font: 16px/1.85 ui-serif, \"Songti SC\", \"STSong\", Georgia, serif;\n overflow-wrap: anywhere;\n}\n.oh-story-markdown > :first-child { margin-top: 0; }\n.oh-story-markdown > :last-child { margin-bottom: 0; }\n.oh-story-markdown h1,\n.oh-story-markdown h2,\n.oh-story-markdown h3,\n.oh-story-markdown h4,\n.oh-story-markdown h5,\n.oh-story-markdown h6 { margin: 1.45em 0 .6em; font-family: var(--dsw-font-family); line-height: 1.35; letter-spacing: -.01em; }\n.oh-story-markdown h1 { font-size: 1.75em; }\n.oh-story-markdown h2 { padding-bottom: .35em; border-bottom: 1px solid var(--os-border); font-size: 1.35em; }\n.oh-story-markdown h3 { font-size: 1.15em; }\n.oh-story-markdown p { margin: .75em 0; }\n.oh-story-markdown ul,\n.oh-story-markdown ol { margin: .75em 0; padding-left: 1.6em; }\n.oh-story-markdown li { margin: .28em 0; }\n.oh-story-markdown .oh-story-task-item { list-style: none; margin-left: -1.35em; }\n.oh-story-task-item input { margin: 0 .55em 0 0; accent-color: var(--dsw-alias-state-business-primary); }\n.oh-story-markdown blockquote { margin: 1em 0; padding: .1em 1em; border-left: 3px solid var(--dsw-alias-state-business-primary); color: var(--dsw-alias-label-secondary); }\n/* DSH gives inline code its own alias; the block fill is a different surface. */\n.oh-story-markdown code { padding: .15em .4em; border-radius: 4px; background: var(--dsw-alias-markdown-inline-code); font: .86em/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }\n.oh-story-markdown pre { overflow: auto; margin: 1em 0; padding: 14px 16px; border: 1px solid var(--dsw-alias-border-l1); border-radius: 10px; background: var(--dsw-alias-markdown-code-block); }\n.oh-story-markdown pre code { padding: 0; background: transparent; }\n.oh-story-markdown a { color: var(--dsw-alias-state-business-primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }\n.oh-story-markdown del { color: var(--os-muted); }\n.oh-story-markdown-table { overflow-x: auto; margin: 1em 0; border: 1px solid var(--os-border); border-radius: 10px; }\n.oh-story-markdown table { width: 100%; border-collapse: collapse; font-family: ui-sans-serif, system-ui, \"PingFang SC\", sans-serif; font-size: 13px; line-height: 1.55; }\n.oh-story-markdown th,\n.oh-story-markdown td { min-width: 96px; padding: 9px 12px; border-right: 1px solid var(--os-border); border-bottom: 1px solid var(--os-border); vertical-align: top; }\n.oh-story-markdown th:last-child,\n.oh-story-markdown td:last-child { border-right: 0; }\n.oh-story-markdown tbody tr:last-child td { border-bottom: 0; }\n.oh-story-markdown th { background: var(--dsw-alias-bg-layer-1); font-weight: 600; }\n.oh-story-markdown hr { margin: 2em 0; border: 0; border-top: 1px solid var(--os-border); }\n.oh-story-markdown-empty { margin: auto; color: var(--os-muted); font-size: 13px; }\n\n.oh-story-jsonl {\n box-sizing: border-box;\n display: flex;\n width: 100%;\n min-height: 0;\n flex: 1;\n overflow: hidden;\n flex-direction: column;\n color: var(--dsw-alias-label-primary);\n background: var(--dsw-alias-bg-base);\n}\n.oh-story-jsonl-summary { display: flex; min-height: 42px; flex: none; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--os-border); font-size: 12px; }\n.oh-story-jsonl-summary strong { font-weight: 600; }\n.oh-story-jsonl-summary span { color: var(--os-muted); }\n.oh-story-jsonl-records { overflow: auto; padding: 14px 18px 36px; }\n.oh-story-jsonl details,\n.oh-story-jsonl-error { overflow: hidden; margin-bottom: 10px; border: 1px solid var(--os-border); border-radius: 10px; background: var(--dsw-alias-bg-layer-1); }\n.oh-story-jsonl summary { display: flex; min-height: 42px; align-items: center; gap: 9px; padding: 0 12px; cursor: pointer; list-style: none; font: 12px/1.4 var(--dsw-font-family); }\n.oh-story-jsonl summary::-webkit-details-marker { display: none; }\n.oh-story-jsonl summary::before { content: \"\u203A\"; color: var(--os-muted); font-size: 16px; transition: transform .12s ease; }\n.oh-story-jsonl details[open] summary::before { transform: rotate(90deg); }\n.oh-story-jsonl summary > span { flex: none; color: var(--os-muted); font-variant-numeric: tabular-nums; }\n.oh-story-jsonl summary > strong { overflow: hidden; min-width: 80px; flex: 1; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }\n.oh-story-jsonl summary > code,\n.oh-story-jsonl summary > em { flex: none; padding: 2px 6px; border-radius: 5px; background: var(--dsw-alias-button-ghost-active-fill); color: var(--dsw-alias-label-secondary); font: 11px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace; font-style: normal; }\n.oh-story-jsonl pre { overflow: auto; max-height: 520px; margin: 0; padding: 14px 16px; border-top: 1px solid var(--os-border); background: var(--dsw-alias-markdown-code-block); color: var(--dsw-alias-label-secondary); white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }\n.oh-story-jsonl-error { display: grid; gap: 5px; padding: 12px; border-color: var(--dsw-alias-state-error-primary); font-size: 12px; }\n.oh-story-jsonl-error > strong { color: var(--dsw-alias-state-error-primary); }\n.oh-story-jsonl-error > span { color: var(--os-muted); }\n.oh-story-jsonl-error pre { margin: 3px -12px -12px; }\n\n.oh-story-stream,\n.oh-story-conflict,\n.oh-story-warning {\n flex: none;\n padding: 7px 12px;\n border-bottom: 1px solid var(--os-border);\n font-size: 11px;\n line-height: 1.4;\n}\n\n.oh-story-stream { color: var(--dsw-alias-state-business-primary); background: var(--dsw-alias-button-ghost-active-fill); }\n.oh-story-stream[data-stage=\"streaming\"] { animation: oh-story-pulse 1.2s ease-in-out infinite alternate; }\n.oh-story-conflict { color: var(--dsw-alias-state-warn-label); background: var(--dsw-specific-tip); }\n.oh-story-conflict > div { display: flex; gap: 6px; margin-top: 6px; }\n.oh-story-conflict button,\n.oh-story-empty button {\n border: 1px solid var(--os-border);\n border-radius: 6px;\n color: inherit;\n background: var(--dsw-alias-bg-base);\n padding: 3px 8px;\n cursor: pointer;\n font: inherit;\n}\n.oh-story-warning { color: var(--dsw-alias-state-warn-label); background: var(--dsw-specific-tip); }\n\n@keyframes oh-story-pulse { to { opacity: .62; } }\n@media (prefers-reduced-motion: reduce) { .oh-story-stream[data-stage=\"streaming\"] { animation: none; } }\n\n.oh-story-empty { margin: auto; max-width: 480px; padding: 30px; color: var(--os-muted); line-height: 1.7; text-align: center; }\n.oh-story-error { margin: 8px; padding: 8px 10px; border-radius: 8px; color: var(--dsw-alias-state-error-primary); background: var(--dsw-specific-tip); font-size: 12px; }\n\n.oh-story-role { display: flex; flex-direction: column; margin: 0; overflow: hidden; }\n.oh-story-role summary { min-height: 24px; padding: 0; cursor: pointer; list-style: none; font-size: 14px; line-height: 24px; }\n.oh-story-role summary::-webkit-details-marker { display: none; }\n.oh-story-role summary span { color: var(--dsw-alias-state-business-primary); }\n.oh-story-role summary strong { margin-right: auto; color: var(--dsw-alias-label-secondary); font-weight: 500; }\n.oh-story-role summary em { color: var(--dsw-alias-label-caption); font-style: normal; font-size: 12px; }\n.oh-story-role[data-state=\"error\"] summary em { color: var(--dsw-alias-state-error-primary); }\n.oh-story-role pre { max-height: 260px; overflow: auto; margin: 4px 0 4px 4px; padding: 12px 16px; border: 1px solid var(--dsw-alias-border-l1); border-radius: 12px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-markdown-code-block); white-space: pre-wrap; font: var(--dsw-font-markdown-code-block-small); }\n.oh-story-role > button { align-self: flex-start; margin: 4px 0 2px 4px; font-size: 11px; }\n\n/* Short-drama production views are projections of the creator Markdown and\n DSH Session state. They intentionally use only DSH semantic tokens. */\n.oh-story-production { min-height: 0; flex: 1; overflow: auto; background: var(--dsw-alias-bg-base); font: 12px/1.5 var(--dsw-font-family); }\n.oh-story-production button,\n.oh-story-production select { border: 1px solid var(--os-border); border-radius: 6px; color: inherit; background: var(--dsw-alias-bg-base); padding: 4px 8px; cursor: pointer; font: inherit; }\n.oh-story-production button:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover); }\n.oh-story-production button:disabled { opacity: .45; cursor: default; }\n.oh-story-production button:focus-visible,\n.oh-story-canvas article:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: 2px; }\n.oh-story-production-bar,\n.oh-story-production-notice,\n.oh-story-production-actions,\n.oh-story-sequence-summary { display: flex; align-items: center; gap: 8px; }\n.oh-story-production-bar { position: sticky; z-index: 5; top: 0; justify-content: space-between; min-height: 44px; box-sizing: border-box; padding: 6px 12px; border-bottom: 1px solid var(--os-border); background: color-mix(in srgb, var(--dsw-alias-bg-base) 94%, transparent); backdrop-filter: blur(12px); }\n.oh-story-production-tabs { display: flex; align-self: stretch; gap: 16px; }\n.oh-story-production-tabs button { position: relative; border: 0; border-radius: 0; padding: 0; background: transparent; color: var(--os-muted); }\n.oh-story-production-tabs button[aria-selected=\"true\"] { color: var(--dsw-alias-label-primary); }\n.oh-story-production-tabs button[aria-selected=\"true\"]::after { position: absolute; right: 0; bottom: -6px; left: 0; height: 2px; border-radius: 2px; background: var(--dsw-alias-state-business-primary); content: \"\"; }\n.oh-story-production-meta { display: flex; align-items: center; gap: 8px; }\n.oh-story-production-meta > button { padding-block: 2px; color: var(--os-muted); }\n.oh-story-production-summary { color: var(--os-muted); white-space: nowrap; }\n.oh-story-production-notice { justify-content: space-between; margin: 8px 12px 0; padding: 7px 9px; border: 1px solid var(--os-border); border-radius: 7px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-bg-layer-1); }\n.oh-story-production-notice button { border: 0; background: transparent; }\n.oh-story-production-environment { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; gap: 5px 10px; margin: 8px 12px 0; padding: 7px 9px; border: 1px solid var(--os-border); border-radius: 7px; color: var(--os-muted); background: var(--dsw-alias-bg-layer-1); font-size: 10px; }\n/* Environment names such as MINIMAX_VIDEO_RESOLUTIONS and the temp-dir path are longer than the 500 px editor column; let them break rather than widen the view. */\n.oh-story-production-environment > * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }\n.oh-story-production-environment strong { color: var(--dsw-alias-label-secondary); font-size: 11px; }\n.oh-story-production-environment span::before { content: \"\u25CF\"; margin-right: 4px; color: var(--video-danger, #d9534f); }\n.oh-story-production-environment span[data-ready]::before { color: var(--dsw-alias-state-success-primary, #45b96f); }\n.oh-story-production-environment span[data-pending]::before { color: var(--os-muted); }\n.oh-story-production-environment em { flex-basis: 100%; font-style: normal; line-height: 1.5; }\n.oh-story-production-environment code { font-size: 10px; overflow-wrap: anywhere; }\n.oh-story-production-environment button { min-height: 24px; border: 1px solid var(--os-border); border-radius: 6px; padding: 0 8px; color: inherit; background: var(--dsw-alias-bg-base); cursor: pointer; font: inherit; }\n.oh-story-production-diagnostics { margin: 8px 12px 0; padding: 7px 9px; border: 1px solid var(--dsw-alias-state-warn-label); border-radius: 7px; background: var(--dsw-specific-tip); }\n.oh-story-production-diagnostics summary { color: var(--dsw-alias-state-warn-label); cursor: pointer; }\n.oh-story-production-diagnostics ul { display: grid; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; }\n.oh-story-production-diagnostics li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 6px; color: var(--dsw-alias-label-secondary); }\n.oh-story-production-diagnostics li[data-severity=\"error\"] { color: var(--dsw-alias-state-error-primary); }\n.oh-story-production-diagnostics li button { border: 0; padding: 0; color: inherit; background: transparent; text-align: left; }\n.oh-story-production-diagnostics p { margin: 6px 0 0; color: var(--os-muted); }\n.oh-story-production-actions { justify-content: flex-end; margin-bottom: 12px; }\n.oh-story-production-actions button:last-child,\n.oh-story-sequence-summary button { color: var(--dsw-alias-state-business-primary); border-color: var(--dsw-alias-state-business-primary); }\n.oh-story-shot-board { padding: 16px 12px; }\n.oh-story-shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: start; gap: 12px; }\n.oh-story-shot-card,\n.oh-story-asset-card,\n.oh-story-task-board > article { min-width: 0; overflow: hidden; border: 1px solid var(--os-border); border-radius: 10px; background: var(--dsw-alias-bg-layer-1); }\n.oh-story-shot-card { padding: 10px; cursor: default; transition: border-color .15s ease, background-color .15s ease; }\n.oh-story-shot-card:hover { border-color: var(--dsw-alias-border-l2); }\n.oh-story-shot-card { cursor: pointer; }\n.oh-story-shot-card:focus-visible,\n.oh-story-asset-card:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: 2px; }\n.oh-story-shot-card[data-selected],\n.oh-story-asset-card[data-selected] { border-color: var(--dsw-alias-state-business-primary); background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 4%, var(--dsw-alias-bg-layer-1)); }\n.oh-story-shot-card > header,\n.oh-story-task-board article > header { display: flex; min-height: 0; align-items: center; gap: 8px; padding: 0; border: 0; }\n.oh-story-shot-card > header > button { overflow: hidden; min-width: 0; flex: 1; border: 0; padding: 0; color: var(--dsw-alias-state-business-primary); background: transparent; text-align: left; text-overflow: ellipsis; white-space: nowrap; }\n.oh-story-shot-card > header > span { color: var(--os-muted); font-variant-numeric: tabular-nums; }\n.oh-story-shot-card h3,\n.oh-story-asset-card h3 { margin: 7px 0 4px; font-size: 13px; font-weight: 600; }\n.oh-story-shot-card > p,\n.oh-story-asset-card > p,\n.oh-story-task-board article > p { margin: 5px 0; color: var(--os-muted); }\n.oh-story-shot-placeholder { display: grid; height: 132px; place-content: center; gap: 3px; margin-bottom: 8px; border-radius: 7px; color: var(--os-muted); background: var(--dsw-alias-button-ghost-active-fill); text-align: center; }\n.oh-story-shot-placeholder strong { color: var(--dsw-alias-label-secondary); font-size: 22px; font-variant-numeric: tabular-nums; }\n.oh-story-shot-card dl { display: grid; grid-template-columns: 20px minmax(0, 1fr); margin: 7px 0; }\n.oh-story-shot-card dt { color: var(--dsw-alias-state-business-primary); }\n.oh-story-shot-card dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }\n.oh-story-shot-status,\n.oh-story-reference-links,\n.oh-story-card-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }\n.oh-story-shot-status span { padding: 1px 5px; border-radius: 5px; color: var(--os-muted); background: var(--dsw-alias-button-ghost-active-fill); }\n.oh-story-shot-status span[data-ready=\"true\"] { color: var(--dsw-alias-state-business-primary); }\n.oh-story-shot-status span > i { margin-right: 3px; font-style: normal; }\n.oh-story-reference-links button { max-width: 100%; overflow: hidden; padding: 1px 5px; border: 0; color: var(--dsw-alias-state-business-primary); background: transparent; text-overflow: ellipsis; }\n.oh-story-card-actions { padding-top: 8px; border-top: 1px solid var(--os-border); }\n.oh-story-card-actions button { flex: 1; padding-block: 4px; }\n.oh-story-card-actions button:last-child { color: var(--dsw-alias-state-business-primary); border-color: color-mix(in srgb, var(--dsw-alias-state-business-primary) 45%, var(--os-border)); }\n.oh-story-media-preview { display: block; width: 100%; height: 168px; border-radius: 7px; background: var(--dsw-alias-bg-base); object-fit: contain; }\n.oh-story-media-document { display: grid; min-height: 0; flex: 1; overflow: auto; place-items: center; padding: 24px; }\n.oh-story-media-document img,\n.oh-story-media-document video { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }\n.oh-story-media-document audio { width: min(520px, 100%); }\n.oh-story-version-strip { display: flex; gap: 5px; overflow-x: auto; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--os-border); }\n.oh-story-version-strip > button { position: relative; width: 64px; min-width: 64px; padding: 2px; }\n.oh-story-version-strip > button[data-selected] { border-color: var(--dsw-alias-state-business-primary); }\n.oh-story-version-strip .oh-story-media-preview { height: 72px; }\n.oh-story-version-strip span { position: absolute; right: 3px; bottom: 3px; padding: 0 3px; border-radius: 3px; background: var(--dsw-alias-bg-base); font-size: 10px; }\n.oh-story-asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; padding: 16px 12px; }\n.oh-story-asset-card { padding: 10px; }\n.oh-story-asset-card > div:nth-child(2) > button { overflow: hidden; max-width: 100%; border: 0; padding: 0; color: var(--dsw-alias-state-business-primary); background: transparent; text-overflow: ellipsis; }\n.oh-story-asset-card small { color: var(--os-muted); text-transform: uppercase; }\n.oh-story-asset-placeholder { display: grid; height: 112px; place-items: center; border-radius: 7px; color: var(--os-muted); background: var(--dsw-alias-button-ghost-active-fill); font-size: 28px; }\n.oh-story-asset-description { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; }\n.oh-story-media-library { margin: 0 12px 14px; padding-top: 12px; border-top: 1px solid var(--os-border); }\n.oh-story-media-library > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }\n.oh-story-media-library > header > div { display: flex; align-items: center; gap: 7px; }\n.oh-story-media-library > header span { color: var(--os-muted); }\n.oh-story-media-library input { width: 180px; box-sizing: border-box; border: 1px solid var(--os-border); border-radius: 6px; padding: 5px 8px; color: inherit; background: var(--dsw-alias-bg-base); font: inherit; }\n.oh-story-media-library > .oh-story-projection-note { margin-bottom: 10px; }\n.oh-story-media-library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }\n.oh-story-media-library-grid > article { display: flex; min-width: 0; flex-direction: column; gap: 5px; padding: 7px; border: 1px solid var(--os-border); border-radius: 8px; background: var(--dsw-alias-bg-layer-1); }\n.oh-story-media-library-grid .oh-story-media-preview { height: 116px; }\n.oh-story-media-library-grid > article > span { overflow: hidden; color: var(--os-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }\n.oh-story-media-library-grid footer { display: flex; gap: 4px; margin-top: auto; }\n.oh-story-media-library-grid footer button { min-width: 0; flex: 1; padding-inline: 4px; }\n.oh-story-media-library-grid footer button[aria-pressed=\"true\"] { color: var(--dsw-alias-state-business-primary); border-color: var(--dsw-alias-state-business-primary); }\n.oh-story-task-board { display: grid; gap: 10px; padding: 12px; }\n.oh-story-task-board > article { padding: 11px; }\n.oh-story-task-board > article[data-status=\"dispatched_unknown\"] { border-color: var(--dsw-alias-state-warn-label); }\n.oh-story-task-board > article[data-status=\"dispatched_unknown\"] .oh-story-error { color: var(--dsw-alias-state-warn-label); background: var(--dsw-specific-tip); }\n.oh-story-task-board article > header strong { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; }\n.oh-story-task-board article > header span { padding: 1px 5px; border-radius: 5px; color: var(--os-muted); background: var(--dsw-alias-button-ghost-active-fill); }\n.oh-story-task-progress { height: 3px; overflow: hidden; margin-top: 8px; border-radius: 3px; background: var(--os-border); }\n.oh-story-task-progress i { display: block; height: 100%; background: var(--dsw-alias-state-business-primary); transition: width .2s ease; }\n.oh-story-task-board details { margin-top: 8px; color: var(--os-muted); }\n.oh-story-task-board details summary { cursor: pointer; }\n.oh-story-task-board details p { max-height: 120px; overflow: auto; margin: 6px 0; padding: 8px; border-radius: 6px; background: var(--dsw-alias-bg-base); white-space: pre-wrap; }\n.oh-story-task-board footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; margin-top: 8px; }\n.oh-story-projection-note { padding: 7px 10px; border: 1px solid var(--os-border); border-radius: 7px; color: var(--os-muted); background: var(--dsw-alias-bg-layer-1); }\n.oh-story-task-board > .oh-story-projection-note { margin-bottom: 0; }\n.oh-story-production-empty { padding: 48px 20px; color: var(--os-muted); text-align: center; }\n.oh-story-production-empty strong { display: block; margin-bottom: 6px; color: var(--dsw-alias-text-1); font-size: 13px; }\n.oh-story-production-empty p { margin: 0 auto; max-width: 44em; line-height: 1.6; }\n.oh-story-production-empty button { margin-top: 12px; }\n.oh-story-sequence { padding: 12px; }\n.oh-story-sequence-summary { justify-content: space-between; margin-bottom: 10px; }\n.oh-story-sequence-summary span { margin-left: auto; color: var(--os-muted); }\n.oh-story-sequence-issues { margin: 0 0 10px; padding: 8px 8px 8px 28px; border-radius: 7px; color: var(--dsw-alias-state-warn-label); background: var(--dsw-specific-tip); }\n.oh-story-sequence-issues li + li { margin-top: 2px; }\n.oh-story-sequence ol { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }\n.oh-story-sequence > ol > li { display: grid; min-height: 70px; grid-template-columns: 28px 96px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px; border: 1px solid var(--os-border); border-radius: 8px; background: var(--dsw-alias-bg-layer-1); }\n.oh-story-sequence > ol > li > span { color: var(--os-muted); font-variant-numeric: tabular-nums; }\n.oh-story-sequence > ol > li .oh-story-media-preview,\n.oh-story-sequence-missing { width: 96px; height: 54px; }\n.oh-story-sequence-missing { display: grid; place-items: center; border-radius: 5px; color: var(--os-muted); background: var(--dsw-alias-button-ghost-active-fill); }\n.oh-story-sequence > ol > li > div:last-child { display: flex; gap: 3px; }\n.oh-story-canvas-shell { position: relative; display: flex; height: max(580px, calc(100% - 84px)); min-height: 580px; flex-direction: column; overflow: hidden; }\n.oh-story-canvas-shell > .oh-story-projection-note { z-index: 3; flex: none; margin: 8px 168px 8px 8px; }\n.oh-story-canvas-controls { position: absolute; z-index: 4; top: 8px; right: 8px; display: flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--os-border); border-radius: 8px; background: var(--dsw-alias-bg-base); }\n.oh-story-canvas-controls span { min-width: 44px; color: var(--os-muted); text-align: center; }\n.oh-story-canvas-viewport { width: 100%; min-height: 0; flex: 1; overflow: auto; background-color: var(--dsw-alias-bg-base); background-image: radial-gradient(var(--os-border) 1px, transparent 1px); background-size: 20px 20px; }\n.oh-story-canvas { position: relative; width: 1800px; height: 1800px; transform-origin: 0 0; }\n.oh-story-canvas svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }\n.oh-story-canvas path { fill: none; opacity: .35; stroke: var(--dsw-alias-border-l2); stroke-width: 1.5; }\n.oh-story-canvas path[data-active] { opacity: .8; stroke: var(--dsw-alias-state-business-primary); }\n.oh-story-canvas article { position: absolute; display: flex; width: 180px; min-height: 76px; box-sizing: border-box; flex-direction: column; gap: 4px; padding: 10px; border: 1px solid var(--os-border); border-radius: 8px; background: var(--dsw-alias-bg-layer-1); box-shadow: 0 4px 14px rgb(0 0 0 / 8%); cursor: grab; user-select: none; touch-action: none; }\n.oh-story-canvas article:active { cursor: grabbing; }\n.oh-story-canvas article[data-node-type=\"shot\"] { border-color: var(--dsw-alias-state-business-primary); }\n.oh-story-canvas article[data-selected] { box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-state-business-primary) 28%, transparent), 0 4px 14px rgb(0 0 0 / 8%); }\n.oh-story-canvas article small { color: var(--os-muted); text-transform: uppercase; }\n.oh-story-canvas article strong,\n.oh-story-canvas article span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.oh-story-canvas article span { color: var(--os-muted); font-size: 10px; }\n\n[data-conversation-scroll][data-oh-story-layout=\"medium\"]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"]) {\n grid-template-columns: clamp(104px, 18%, 184px) minmax(200px, 1fr) clamp(300px, 45%, 408px);\n}\n\n[data-conversation-scroll][data-oh-story-layout=\"compact\"]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"]) {\n grid-template-columns: clamp(80px, 16%, 104px) minmax(0, 1fr) clamp(228px, 48%, 300px);\n}\n\n[data-oh-story-layout=\"medium\"] .oh-story-file-folder > summary { padding-left: min(calc(7px + var(--oh-story-indent, 0px)), 35px); }\n[data-oh-story-layout=\"medium\"] .oh-story-tree nav button { padding-left: min(calc(14px + var(--oh-story-indent, 0px)), 42px); }\n[data-oh-story-layout=\"medium\"] .oh-story-editor textarea { padding-right: 28px; padding-left: 28px; }\n\n[data-oh-story-layout=\"compact\"] .oh-story-tree { padding-inline: 4px; }\n[data-oh-story-layout=\"compact\"] .oh-story-brand { gap: 4px; padding-inline: 2px; font-size: 11px; }\n[data-oh-story-layout=\"compact\"] .oh-story-brand-cluster { gap: 4px; }\n[data-oh-story-layout=\"compact\"] .oh-story-brand-cluster strong > span { display: none; }\n[data-oh-story-layout=\"compact\"] .oh-story-kind { padding-inline: 4px; font-size: 11px; }\n[data-oh-story-layout=\"compact\"] .oh-story-brand button { width: 24px; height: 24px; }\n[data-oh-story-layout=\"compact\"] .oh-story-mode-tabs { margin-inline: 0; }\n[data-oh-story-layout=\"compact\"] .oh-story-mode-tabs button { padding-inline: 3px; font-size: 11px; }\n[data-oh-story-layout=\"compact\"] .oh-story-file-folder > summary { padding-left: min(calc(5px + var(--oh-story-indent, 0px)), 19px); }\n[data-oh-story-layout=\"compact\"] .oh-story-tree nav button { padding-right: 4px; padding-left: min(calc(7px + var(--oh-story-indent, 0px)), 21px); }\n[data-oh-story-layout=\"compact\"] .oh-story-editor > header {\n display: grid;\n min-height: 68px;\n grid-template-columns: minmax(0, 1fr);\n grid-template-rows: 24px 36px;\n align-content: center;\n gap: 0;\n padding: 4px 3px;\n}\n[data-oh-story-layout=\"compact\"] .oh-story-editor-path > span { display: none; }\n[data-oh-story-layout=\"compact\"] .oh-story-editor-path > strong { display: block; font-size: 11px; line-height: 24px; }\n[data-oh-story-layout=\"compact\"] .oh-story-editor-actions { width: 100%; min-width: 0; justify-content: flex-end; gap: 4px; }\n[data-oh-story-layout=\"compact\"] .oh-story-editor-tabs { min-width: 0; flex: 1; }\n[data-oh-story-layout=\"compact\"] .oh-story-editor-tabs button { min-width: 0; padding-inline: 2px; white-space: nowrap; }\n[data-oh-story-layout=\"compact\"] .oh-story-save { flex: none; padding-inline: 4px; white-space: nowrap; font-size: 11px; }\n[data-oh-story-layout=\"compact\"] .oh-story-editor textarea { padding: 16px 12px 40px; }\n[data-oh-story-layout=\"compact\"] .oh-story-markdown { padding: 18px 12px 48px; }\n[data-oh-story-layout=\"compact\"] .oh-story-jsonl-summary { padding-inline: 10px; }\n[data-oh-story-layout=\"compact\"] .oh-story-jsonl-records { padding: 8px 7px 28px; }\n[data-oh-story-layout=\"compact\"] .oh-story-jsonl summary { gap: 6px; padding-inline: 7px; }\n[data-oh-story-layout=\"compact\"] .oh-story-jsonl summary > span { display: none; }\n[data-oh-story-layout=\"compact\"] .oh-story-jsonl summary > strong { min-width: 32px; }\n[data-oh-story-layout=\"compact\"] .oh-story-jsonl summary > code,\n[data-oh-story-layout=\"compact\"] .oh-story-jsonl summary > em { display: none; }\n\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"medium\"]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"]) {\n grid-template-columns: minmax(0, 1fr) clamp(360px, 42%, 440px);\n}\n[data-oh-story-workbench=\"game\"][data-oh-story-layout=\"medium\"] .oh-game-toolbar { grid-template-columns: auto minmax(140px, 1fr) auto; }\n\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"]) {\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n overflow: hidden;\n}\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"]\n > [data-slot=\"conversation.session\"] > :not(.oh-story-split-surface),\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"]\n > [data-composer-seat],\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-studio {\n grid-column: 1;\n}\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"][data-oh-studio-pane=\"studio\"]\n > [data-slot=\"conversation.session\"] > :not(.oh-story-split-surface),\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"][data-oh-studio-pane=\"studio\"]\n > [data-composer-seat],\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"][data-oh-studio-pane=\"chat\"] .oh-game-studio { display: none; }\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-mobile-switcher {\n display: flex;\n position: absolute;\n top: 8px;\n right: 8px;\n z-index: 20;\n border-color: var(--dsw-alias-border-l1);\n box-shadow: 0 4px 14px rgb(0 0 0 / 12%);\n}\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-mobile-switcher button { min-width: 52px; min-height: 32px; }\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-toolbar {\n min-height: 101px;\n grid-template-columns: auto minmax(0, 1fr) 112px;\n grid-template-rows: 44px 44px;\n align-content: center;\n gap: 5px;\n padding: 4px 8px;\n}\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-toolbar > .oh-workbench-cluster { grid-column: 1; grid-row: 1; width: fit-content; }\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-project > span { display: none; }\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-project { grid-column: 1 / -1; grid-row: 2; }\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-project select { max-width: none; width: 100%; min-height: 44px; }\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-tabs { grid-column: 2; grid-row: 1; width: fit-content; justify-self: end; }\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-mode-tabs button,\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-tabs button,\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-mobile-switcher button { min-height: 44px; }\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-preview-shell { grid-template-rows: 46px minmax(0, 1fr); }\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-preview-status button { min-height: 36px; }\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-reload b { display: none; }\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-preview-status { padding-left: 8px; }\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-preview-status > span { max-width: 40%; }\n.oh-game-runtime-state > em { display: block; overflow: hidden; min-width: 0; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }\n\n/* DSH may keep its navigation drawer open at a 500 px browser viewport,\n leaving the conversation center close to 212 px wide. The Studio publishes\n its measured width because a container style query cannot style the\n container itself. Row one stays clear for the \u5236\u4F5C / \u5BF9\u8BDD switch. */\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-studio[data-oh-game-narrow] .oh-game-toolbar {\n min-height: 193px;\n grid-template-columns: minmax(0, 1fr);\n grid-template-rows: repeat(4, 44px);\n align-content: center;\n padding: 4px 8px;\n}\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-studio[data-oh-game-narrow] .oh-game-toolbar > .oh-workbench-cluster {\n grid-column: 1;\n grid-row: 2;\n justify-self: start;\n}\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-studio[data-oh-game-narrow] .oh-game-tabs {\n grid-column: 1;\n grid-row: 3;\n justify-self: start;\n}\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-studio[data-oh-game-narrow] .oh-game-project {\n grid-column: 1;\n grid-row: 4;\n}\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-studio[data-oh-game-narrow] .oh-game-project select {\n width: 100%;\n max-width: none;\n min-height: 44px;\n}\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-studio[data-oh-game-narrow] .oh-game-preview-status {\n gap: 4px;\n padding-right: 6px;\n padding-left: 6px;\n}\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-studio[data-oh-game-narrow] .oh-game-preview-status > span { max-width: 36%; }\n\n@media (prefers-reduced-motion: reduce) {\n .oh-game-preview-shell[data-state=\"building\"] { animation: none; }\n}\n\n@media (prefers-contrast: more) {\n .oh-game-preview-status button,\n .oh-game-tabs,\n .oh-game-mode-tabs,\n .oh-game-mobile-switcher { border-width: 2px; }\n}\n[data-oh-story-layout=\"compact\"] .oh-story-production-summary { display: none; }\n[data-oh-story-layout=\"compact\"] .oh-story-production-bar { flex-wrap: wrap; padding-inline: 4px; }\n[data-oh-story-layout=\"compact\"] .oh-story-production-tabs { width: 100%; gap: 0; }\n[data-oh-story-layout=\"compact\"] .oh-story-production-tabs button { min-width: 0; flex: 1; padding-inline: 0; font-size: 11px; }\n[data-oh-story-layout=\"compact\"] .oh-story-production-meta { width: 100%; justify-content: flex-end; }\n[data-oh-story-layout=\"compact\"] .oh-story-shot-grid,\n[data-oh-story-layout=\"compact\"] .oh-story-asset-grid { grid-template-columns: minmax(0, 1fr); }\n[data-oh-story-layout=\"compact\"] .oh-story-media-library > header { align-items: stretch; flex-direction: column; }\n[data-oh-story-layout=\"compact\"] .oh-story-media-library > header > div:last-child { display: grid; grid-template-columns: minmax(0, 1fr) auto; }\n[data-oh-story-layout=\"compact\"] .oh-story-media-library input { width: 100%; }\n[data-oh-story-layout=\"compact\"] .oh-story-sequence { padding-inline: 6px; }\n[data-oh-story-layout=\"compact\"] .oh-story-sequence-summary { flex-wrap: wrap; }\n[data-oh-story-layout=\"compact\"] .oh-story-sequence-summary span { display: none; }\n[data-oh-story-layout=\"compact\"] .oh-story-sequence > ol > li { grid-template-columns: 24px 64px minmax(0, 1fr); gap: 5px; }\n[data-oh-story-layout=\"compact\"] .oh-story-sequence > ol > li .oh-story-media-preview,\n[data-oh-story-layout=\"compact\"] .oh-story-sequence-missing { width: 64px; height: 40px; }\n[data-oh-story-layout=\"compact\"] .oh-story-sequence > ol > li > div:last-child { grid-column: 2 / 4; justify-content: flex-end; }\n[data-oh-story-layout=\"compact\"] .oh-story-canvas-shell > .oh-story-projection-note { overflow: hidden; max-height: 48px; margin: 8px; }\n[data-oh-story-layout=\"compact\"] .oh-story-canvas-controls { position: static; flex: none; align-self: flex-end; margin: 0 8px 8px; }\n\n/* Video mode intentionally stays a preview surface: one player, a read-only artifact view,\n and the official DSH Conversation. It shares no nonlinear-editor or timeline runtime. */\n[data-conversation-scroll][data-oh-story-workbench=\"video\"]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"]) {\n --video-stage: #0b0d10;\n --video-stage-raised: #15181d;\n --video-accent: var(--dsw-alias-state-business-primary);\n --video-warning: #f4bd55;\n --video-danger: #f06b63;\n grid-template-columns: minmax(0, 1fr) clamp(400px, 34%, 520px);\n overflow: hidden;\n}\n[data-conversation-scroll][data-oh-story-workbench=\"video\"]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"])\n > [data-slot=\"conversation.session\"] > :not(.oh-story-split-surface),\n[data-conversation-scroll][data-oh-story-workbench=\"video\"]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"])\n > [data-composer-seat] { grid-column: 2; }\n\n.oh-video-studio {\n box-sizing: border-box;\n display: flex;\n grid-column: 1;\n grid-row: 1;\n position: sticky;\n top: 0;\n min-width: 0;\n min-height: 0;\n height: 100%;\n align-self: start;\n overflow: hidden;\n flex-direction: column;\n border-right: 1px solid var(--os-border);\n color: var(--dsw-alias-label-primary);\n background: var(--dsw-alias-bg-base);\n}\n.oh-video-studio[hidden] { display: none; }\n.oh-video-toolbar {\n box-sizing: border-box;\n display: grid;\n min-height: 100px;\n flex: none;\n grid-template-columns: minmax(0, 1fr) auto;\n grid-template-rows: 40px 40px;\n align-items: center;\n gap: 4px 12px;\n padding: 8px 12px 9px;\n border-bottom: 1px solid var(--os-border);\n background: var(--dsw-alias-bg-base);\n}\n.oh-video-mode-tabs { display: flex; width: fit-content; grid-column: 1; grid-row: 1; padding: 2px; border: 1px solid var(--os-border); border-radius: 9px; background: var(--dsw-alias-bg-layer-1); }\n.oh-video-mode-tabs button,\n.oh-video-tabs button,\n.oh-video-version-tabs button {\n min-height: 36px;\n border: 0;\n border-radius: 6px;\n padding: 4px 8px;\n color: var(--os-muted);\n background: transparent;\n cursor: pointer;\n white-space: nowrap;\n font: 12px/1 var(--dsw-font-family);\n}\n.oh-video-mode-tabs button { min-width: 48px; }\n.oh-video-mode-tabs button:hover,\n.oh-video-tabs button:hover,\n.oh-video-version-tabs button:hover { color: var(--dsw-alias-label-primary); }\n.oh-video-mode-tabs button[aria-selected=\"true\"],\n.oh-video-tabs button[aria-selected=\"true\"],\n.oh-video-version-tabs button[aria-selected=\"true\"] { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-bg-base); box-shadow: 0 1px 2px rgb(0 0 0 / 9%); font-weight: 600; }\n.oh-video-project { display: flex; min-width: 0; grid-column: 1; grid-row: 2; align-items: center; gap: 9px; color: var(--os-muted); font-size: 11px; }\n.oh-video-project > span { flex: none; }\n.oh-video-project select {\n width: min(100%, 440px);\n min-width: 0;\n min-height: 36px;\n border: 1px solid var(--os-border);\n border-radius: 8px;\n padding: 6px 28px 6px 9px;\n color: var(--dsw-alias-label-primary);\n background: var(--dsw-alias-bg-base);\n overflow: hidden;\n text-overflow: ellipsis;\n font: inherit;\n font-weight: 500;\n}\n.oh-video-stage { display: inline-flex; grid-column: 2; grid-row: 2; align-items: center; gap: 7px; border: 1px solid var(--os-border); border-radius: 999px; padding: 5px 9px; color: var(--os-muted); background: var(--dsw-alias-bg-layer-1); white-space: nowrap; font-size: 11px; }\n.oh-video-stage > i { width: 7px; height: 7px; border-radius: 50%; background: var(--video-warning); }\n.oh-video-stage[data-state=\"ready\"] > i { background: var(--dsw-alias-state-success-primary, #45b96f); }\n.oh-video-stage[data-state=\"not-started\"] > i { background: var(--os-muted); }\n.oh-video-tabs,\n.oh-video-version-tabs { display: flex; padding: 2px; border: 1px solid var(--os-border); border-radius: 9px; }\n.oh-video-tabs { grid-column: 2; grid-row: 1; }\n.oh-video-tabs button { min-width: 56px; }\n.oh-video-panels,\n.oh-video-panels > [role=\"tabpanel\"] { display: flex; min-width: 0; min-height: 0; flex: 1; overflow: hidden; flex-direction: column; }\n.oh-video-panels > [hidden] { display: none; }\n\n.oh-video-preview-shell { display: grid; min-width: 0; min-height: 0; flex: 1; grid-template-rows: 48px minmax(0, 1fr); overflow: hidden; border-top: 2px solid var(--video-accent); background: var(--video-stage); }\n.oh-video-preview-shell[data-state=\"building\"] { border-top-color: var(--video-warning); }\n.oh-video-preview-shell[data-state=\"error\"] { border-top-color: var(--video-danger); }\n.oh-video-stagebar { display: grid; min-width: 0; grid-template-columns: auto minmax(80px, 1fr) auto; align-items: center; gap: 10px; padding: 0 10px; color: rgb(244 248 255 / 74%); background: var(--video-stage-raised); font-size: 11px; }\n.oh-video-version-tabs { border-color: rgb(255 255 255 / 13%); }\n.oh-video-version-tabs button[aria-selected=\"true\"] { color: #fff; background: rgb(255 255 255 / 12%); }\n.oh-video-runtime-state { display: flex; min-width: 0; align-items: center; justify-content: center; gap: 7px; overflow: hidden; }\n.oh-video-runtime-state > i { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--dsw-alias-state-success-primary, #45b96f); }\n.oh-video-preview-shell[data-state=\"building\"] .oh-video-runtime-state > i { background: var(--video-warning); }\n.oh-video-preview-shell[data-state=\"error\"] .oh-video-runtime-state > i { background: var(--video-danger); }\n.oh-video-runtime-state > em { overflow: hidden; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }\n.oh-video-preview-actions { display: flex; gap: 5px; }\n.oh-video-preview-actions button,\n.oh-video-preview-actions a { display: grid; min-width: 34px; min-height: 34px; box-sizing: border-box; place-items: center; border: 1px solid rgb(255 255 255 / 14%); border-radius: 6px; padding: 3px 8px; color: rgb(255 255 255 / 84%); background: rgb(255 255 255 / 5%); cursor: pointer; text-decoration: none; font: inherit; }\n.oh-video-preview-actions svg { width: 16px; height: 16px; }\n.oh-video-preview-actions button:hover,\n.oh-video-preview-actions a:hover { background: rgb(255 255 255 / 11%); }\n.oh-video-player-stage { display: grid; min-width: 0; min-height: 0; place-items: center; overflow: hidden; padding: 14px; background: radial-gradient(circle at 50% 40%, #1b2027, var(--video-stage) 62%); }\n.oh-video-player-stage video { display: block; width: min(100%, 1200px); height: auto; max-width: 100%; max-height: 100%; border-radius: 4px; object-fit: contain; background: #000; box-shadow: 0 16px 50px rgb(0 0 0 / 32%); }\n.oh-video-preview-shell:fullscreen { width: 100vw; height: 100vh; }\n\n.oh-video-preview-empty,\n.oh-video-artifacts-empty { display: grid; max-width: 620px; margin: auto; place-items: center; gap: 9px; padding: 36px; color: var(--os-muted); text-align: center; line-height: 1.65; }\n.oh-video-preview-empty { width: 100%; max-width: none; min-height: 0; box-sizing: border-box; flex: 1; align-content: center; color: rgb(244 248 255 / 70%); background: var(--video-stage); }\n.oh-video-preview-empty > span { color: var(--video-accent); font-size: 32px; }\n.oh-video-preview-empty strong { color: rgb(255 255 255 / 92%); }\n.oh-video-preview-empty p { max-width: 560px; margin: 0; }\n.oh-video-preview-empty code { color: rgb(255 255 255 / 88%); }\n.oh-video-prompt-example { max-width: 560px; margin-top: 10px; padding: 12px 14px; border: 1px solid rgb(255 255 255 / 11%); border-radius: 9px; background: rgb(255 255 255 / 4%); text-align: left; }\n.oh-video-prompt-example span { display: block; margin-bottom: 4px; color: var(--video-accent); font-size: 10px; font-weight: 600; }\n.oh-video-prompt-example q { quotes: none; }\n\n.oh-video-artifacts { display: grid; min-width: 0; min-height: 0; flex: 1; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); overflow: hidden; }\n.oh-video-artifacts > aside { display: flex; min-height: 0; flex-direction: column; overflow: hidden; padding: 8px; border-right: 1px solid var(--os-border); background: var(--dsw-alias-bg-layer-1); }\n.oh-video-artifacts-heading { display: flex; min-height: 30px; flex: none; align-items: center; justify-content: space-between; padding: 0 7px; }\n.oh-video-artifacts-heading strong { font-size: 11px; }\n.oh-video-artifacts-heading span { min-width: 20px; border-radius: 999px; padding: 1px 5px; color: var(--os-muted); background: var(--dsw-alias-button-ghost-active-fill); text-align: center; font-size: 10px; }\n.oh-video-artifacts > aside nav { min-height: 0; flex: 1; overflow: auto; }\n.oh-video-artifacts > aside nav button { display: flex; width: 100%; min-width: 0; position: relative; flex-direction: column; align-items: flex-start; gap: 3px; border: 0; border-radius: 7px; padding: 9px; color: inherit; background: transparent; cursor: pointer; text-align: left; }\n.oh-video-artifacts > aside nav button:hover,\n.oh-video-artifacts > aside nav button[aria-current=\"page\"] { background: var(--dsw-alias-button-ghost-active-fill); }\n.oh-video-artifacts > aside nav button[aria-current=\"page\"]::before { content: \"\"; width: 2px; position: absolute; inset-block: 8px; left: 2px; border-radius: 2px; background: var(--video-accent); }\n.oh-video-artifacts > aside nav small { width: 100%; overflow: hidden; color: var(--os-muted); text-overflow: ellipsis; white-space: nowrap; }\n.oh-video-artifacts > aside nav > p { margin: 10px 4px; color: var(--os-muted); font-size: 11px; line-height: 1.5; }\n.oh-video-environment { display: grid; gap: 5px; margin-bottom: 8px; padding: 8px; border: 1px solid var(--os-border); border-radius: 8px; background: var(--dsw-alias-bg-layer-1); }\n.oh-video-environment strong { font-size: 11px; }\n.oh-video-environment span { color: var(--os-muted); font-size: 10px; }\n.oh-video-environment em { color: var(--os-muted); font-size: 10px; font-style: normal; line-height: 1.5; }\n.oh-video-environment code { font-size: 10px; }\n.oh-video-environment span::before { content: \"\u25CF\"; margin-right: 5px; color: var(--video-danger); }\n.oh-video-environment span[data-ready]::before { color: var(--dsw-alias-state-success-primary, #45b96f); }\n.oh-video-environment button { min-height: 30px; border: 1px solid var(--os-border); border-radius: 6px; color: inherit; background: var(--dsw-alias-bg-base); cursor: pointer; font: inherit; }\n.oh-video-artifacts > section { display: flex; min-width: 0; min-height: 0; overflow: hidden; flex-direction: column; }\n.oh-video-artifact-header { display: flex; min-height: 54px; box-sizing: border-box; flex: none; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--os-border); }\n.oh-video-artifact-header > div { display: flex; min-width: 0; flex-direction: column; gap: 3px; }\n.oh-video-artifact-header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }\n.oh-video-artifact-header span { overflow: hidden; color: var(--os-muted); text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }\n.oh-video-artifact-header em { flex: none; border: 1px solid var(--os-border); border-radius: 999px; padding: 3px 7px; color: var(--os-muted); background: var(--dsw-alias-bg-layer-1); font-size: 10px; font-style: normal; }\n.oh-video-artifact-content { min-width: 0; min-height: 0; flex: 1; overflow: auto; }\n.oh-video-artifact-content pre { min-width: 0; min-height: 100%; box-sizing: border-box; margin: 0; padding: 20px; color: inherit; background: var(--dsw-alias-bg-base); white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.65 var(--dsw-font-family-mono, ui-monospace, monospace); }\n\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"medium\"]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"]) { grid-template-columns: minmax(0, 1fr) clamp(360px, 42%, 440px); }\n[data-oh-story-workbench=\"video\"][data-oh-story-layout=\"medium\"] .oh-video-project select { width: 100%; }\n\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"]) { display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"]\n > [data-slot=\"conversation.session\"] > :not(.oh-story-split-surface),\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"]\n > [data-composer-seat],\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-studio { grid-column: 1; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"][data-oh-studio-pane=\"studio\"]\n > [data-slot=\"conversation.session\"] > :not(.oh-story-split-surface),\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"][data-oh-studio-pane=\"studio\"]\n > [data-composer-seat],\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"][data-oh-studio-pane=\"chat\"] .oh-video-studio { display: none; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-game-mobile-switcher { display: flex; position: absolute; top: 8px; right: 8px; z-index: 20; border-color: var(--dsw-alias-border-l1); box-shadow: 0 4px 14px rgb(0 0 0 / 12%); }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-toolbar { min-height: 142px; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 44px 44px 38px; align-content: center; gap: 2px 6px; padding: 4px 8px; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-toolbar > .oh-workbench-cluster { grid-column: 1 / -1; grid-row: 1; width: fit-content; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-tabs { grid-column: 2; grid-row: 2; justify-self: end; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-project { grid-column: 1; grid-row: 2; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-project > span { display: none; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-stage { grid-column: 1 / -1; grid-row: 3; justify-self: start; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-stagebar { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 42px 38px; gap: 2px 6px; padding: 3px 7px; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-preview-shell { grid-template-rows: 86px minmax(0, 1fr); }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-version-tabs { grid-column: 1; grid-row: 1; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-runtime-state { grid-column: 1; grid-row: 2; justify-content: flex-start; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-preview-actions { grid-column: 2; grid-row: 1 / 3; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-preview-actions button:first-child { max-width: 70px; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-artifacts { grid-template-columns: minmax(105px, 35%) minmax(0, 1fr); }\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,8BAA4B,0CAQ5BA,gBAA8G,kBAC9G,mBAA6B;;;ACkB7B,IAAM,mBAA4D;AAAA,EAChE,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO;AACT;AAEO,SAAS,eAAe,MAA6B;AAC1D,SAAO,iBAAiB,IAAI;AAC9B;AAMA,IAAM,oBAAoB,oBAAI,IAAI,CAAC,gBAAM,gBAAM,gBAAM,gBAAM,gBAAM,0BAAM,CAAC,GAClE,oBAAoB,oBAAI,IAAI,CAAC,gBAAM,4BAAQ,sBAAO,gBAAM,gBAAM,kCAAS,cAAI,CAAC,GAC5E,iBAAiB,oBACjB,kBAAkB,gBAClB,qBAAqB,wDACrB,iBAAiB,oBAAI,IAAI,CAAC,SAAS,QAAQ,sBAAsB,QAAQ,YAAY,eAAe,CAAC;AAGpG,SAAS,mBAAmB,UAAiE;AAClG,WAAW,cAAc,SAAS,UAAU,WAAW,GAAG;AACxD,QAAM,OAAO,SAAS,MAAM,IAAI,UAAU;AAC1C,QAAI,SAAS;AACb,eAAW,QAAQ,KAAK,MAAM,WAAW,GAAG;AAC1C,YAAM,YAA2C,KAAK,KAAK,IAAI,gBAAgB;AAC/E,YAAI,WAAW,WAAW,UAAW,QAAO;AAAA,MAC9C;AAAA,EACF;AACA,SAAO;AACT;AAEA,SAAS,aAAa,WAAuC;AAC3D,UAAQ,WAAW;AAAA,IACjB,KAAK;AAAM,aAAO;AAAA,IAClB,KAAK;AAAM,aAAO;AAAA,IAClB,KAAK;AAAK,aAAO;AAAA,IACjB,KAAK;AAAK,aAAO;AAAA,I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Y,UAAa,iBAAiB,SACrC;AAAA,UACL,sBAAsB,MAAM,QAAQ,OAAO,IAAI,MAAM,sDAAc,CAAC;AAAA,UACpE,kBAAkB,MAAM,QAAQ,OAAO,IAAI,MAAM,sDAAc,CAAC;AAAA,UAChE,wBAAwB,MAAM,QAAQ,OAAO,IAAI,MAAM,sDAAc,CAAC;AAAA,QACxE,IAEK;AAAA,UACL,sBAAsB,CAAC,WAAmB,aAAa,KAAK,MAAM;AAAA,UAClE,kBAAkB,MAAM,aAAa,OAAO;AAAA,UAC5C,wBAAwB,CAAC,WAAmB,aAAa,YAAY,QAAuD,EAAE,MAAM,SAAS,CAAC;AAAA,QAChJ;AAAA,MACF;AAAA,IACF,GAAG,mBAAmB;AACtB,WAAO,CAAC,aAAa,gBAAgB;AAAA,EACvC,CAAC,GACD,QAAQ,MAAM,OAAO,sBAAsB,MAAM,QAAQ,MAAM,SAAS;AAAA,IACtE,MAAM;AAAA,IACN,KAAK;AAAA,EACP,GAAG,YAAY,CAAC,GAChB,QAAQ,MAAM,OAAO,sBAAsB,MAAM,QAAQ,MAAM,SAAS;AAAA,IACtE,MAAM;AAAA,IACN,KAAK;AAAA,EACP,GAAG,kBAAkB,CAAC;AACxB;AAEA,IAAO,gBAAQ,EAAE,MAAM,QAAQ,MAAM;",
4
+ "sourcesContent": ["import type { Context as ClientContext } from \"@deepseek-ai/cordis\";\nimport type { ISessions } from \"@deepseek-ai/dsh-api-session-controller/client\";\nimport { defineStore } from \"@deepseek-ai/dsh-client-store\";\nimport type { IConversation, PartialAssistant, RunningToolCall } from \"@deepseek-ai/dsh-client-ui-conversation/client\";\nimport type {} from \"@deepseek-ai/dsh-client-ui-chat/client\";\nimport type {} from \"@deepseek-ai/dsh-client-ui-layout/client\";\nimport type {} from \"@deepseek-ai/dsh-client-ui-renderer/client\";\nimport type {} from \"@deepseek-ai/dsh-client-ui-session/client\";\nimport type { PropsRenderSlots, PropsRuntime, PropsStore } from \"@deepseek-ai/dsh-client-ui-slots\";\nimport type { ToolCallViewProps } from \"@deepseek-ai/dsh-client-ui-tool/client\";\nimport { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport {\n creativeRelativePath,\n fileMutations,\n latestSettledMutation,\n mutatingCallIds,\n preferredWorkbenchFile,\n previewMutation,\n streamingAssistant,\n workbenchLabel,\n workbenchModeForPath,\n type WorkbenchMode\n} from \"./file-activity.js\";\nimport { buildFileTree, type FileTreeNode } from \"./file-tree.js\";\nimport { JsonlPreview } from \"./jsonl-preview.js\";\nimport { MarkdownPreview } from \"./markdown-preview.js\";\nimport {\n creatorDocumentPaths,\n episodeDirectoryForPath,\n isCreatorDocumentPath,\n parseEpisodeProduction,\n type DramaDocumentTarget,\n type DramaProductionSection\n} from \"./drama-production.js\";\nimport { DramaProductionView } from \"./drama-production-view.js\";\nimport { createPendingJob, type\n CanvasPoint,\n mediaTargetFromPath,\n type ProductionJob,\n type ProductionMediaVersion,\n type ProductionQueueEntry,\n type ProductionSequenceItem\n} from \"./production-runtime.js\";\nimport { settledProductionIntents, type SettledProductionIntent } from \"./production-intents.js\";\nimport { OH_STORY_PRODUCTION_TOOL_NAME } from \"../production-intent.js\";\nimport { VideoStudio, type VideoProject } from \"./video-studio.js\";\nimport {\n hasCreativeProject,\n readWorkbenchPreference,\n resolveWorkbenchOpen,\n workbenchPreferenceStorage,\n writeWorkbenchPreference,\n type WorkbenchPreference\n} from \"./workbench-presence.js\";\nimport { endpoint, handleTabKey } from \"./workbench-ui.js\";\nimport styles from \"./plugin.css?inline\";\n\nexport const name = \"oh-story\";\nexport const inject = [\"slots\", \"sessions\", \"conversation\"];\n\ndeclare module \"@deepseek-ai/dsh-client-ui-slots\" {\n interface SlotMap {\n \"oh-story.workspace\": { kind: \"single\"; scope: \"session\" };\n }\n}\n\ninterface WorkspaceFile {\n readonly path: string;\n readonly bytes: number;\n readonly version: string;\n readonly kind: \"text\" | \"media\";\n readonly mimeType?: string | undefined;\n}\ninterface WorkspacePayload {\n readonly cwd: string;\n readonly files: readonly WorkspaceFile[];\n readonly games: readonly GameProject[];\n readonly videos: readonly VideoProject[];\n readonly shortDrama: Record<string, unknown> | null;\n readonly metadataErrors: readonly string[];\n readonly mode: \"dsh-session\";\n}\ninterface GameProject {\n readonly id: string;\n readonly root: string;\n readonly title: string;\n readonly source: \"workspace\" | \"example\";\n readonly previewReady: boolean;\n readonly previewUrl?: string | undefined;\n readonly previewVersion: string;\n}\ninterface FilePayload {\n readonly path: string;\n readonly content: string;\n readonly bytes: number;\n readonly version: string;\n}\ninterface FileBuffer {\n readonly content: string;\n readonly saved: string;\n readonly source: \"disk\" | \"human\" | \"agent\";\n readonly version: string;\n readonly saving?: boolean | undefined;\n readonly error?: string | undefined;\n readonly missing?: boolean | undefined;\n readonly conflict?: {\n readonly message: string;\n readonly theirs?: string | undefined;\n readonly theirsVersion?: string | undefined;\n } | undefined;\n}\n\ninterface WorkbenchMemory {\n buffers: Record<string, FileBuffer>;\n workbenchPreference: WorkbenchPreference | undefined;\n editorMode: \"preview\" | \"source\" | \"production\";\n expanded: Record<string, boolean>;\n selected: string | undefined;\n workbench: WorkbenchMode;\n gameTab: \"preview\" | \"design\";\n gameProjectId: string | undefined;\n gamePane: \"studio\" | \"chat\";\n videoTab: \"preview\" | \"artifacts\";\n videoProjectId: string | undefined;\n videoPane: \"studio\" | \"chat\";\n productionSection: DramaProductionSection;\n productionSelectedIds: Record<string, string | undefined>;\n productionJobs: Record<string, ProductionJob[]>;\n productionSelections: Record<string, Record<string, string>>;\n productionReferences: Record<string, Record<string, string[]>>;\n productionSequence: Record<string, ProductionSequenceItem[]>;\n productionCanvas: Record<string, Record<string, CanvasPoint>>;\n productionZoom: Record<string, number>;\n productionIntentCalls: Record<string, boolean>;\n}\n\ntype Update<T> = T | ((current: T) => T);\n\nfunction applyUpdate<T>(current: T, update: Update<T>): T {\n return typeof update === \"function\" ? (update as (value: T) => T)(current) : update;\n}\n\nfunction createWorkbenchStore() {\n return defineStore({\n init: (): WorkbenchMemory => ({\n buffers: {},\n workbenchPreference: undefined,\n editorMode: \"preview\",\n expanded: {},\n selected: undefined,\n workbench: \"story\",\n gameTab: \"preview\",\n gameProjectId: undefined,\n gamePane: \"studio\",\n videoTab: \"preview\",\n videoProjectId: undefined,\n videoPane: \"studio\",\n productionSection: \"shots\",\n productionSelectedIds: {},\n productionJobs: {},\n productionSelections: {},\n productionReferences: {},\n productionSequence: {},\n productionCanvas: {},\n productionZoom: {},\n productionIntentCalls: {}\n }),\n actions: {\n setBuffers: (draft, update: Update<Record<string, FileBuffer>>) => {\n draft.buffers = applyUpdate(draft.buffers, update);\n },\n setWorkbenchPreference: (draft, update: Update<WorkbenchPreference | undefined>) => {\n draft.workbenchPreference = applyUpdate(draft.workbenchPreference, update);\n },\n setEditorMode: (draft, update: Update<WorkbenchMemory[\"editorMode\"]>) => {\n draft.editorMode = applyUpdate(draft.editorMode, update);\n },\n setExpanded: (draft, update: Update<Record<string, boolean>>) => {\n draft.expanded = applyUpdate(draft.expanded, update);\n },\n setSelected: (draft, update: Update<string | undefined>) => {\n draft.selected = applyUpdate(draft.selected, update);\n },\n setWorkbench: (draft, update: Update<WorkbenchMode>) => {\n draft.workbench = applyUpdate(draft.workbench, update);\n },\n setGameTab: (draft, update: Update<WorkbenchMemory[\"gameTab\"]>) => {\n draft.gameTab = applyUpdate(draft.gameTab, update);\n },\n setGameProjectId: (draft, update: Update<string | undefined>) => {\n draft.gameProjectId = applyUpdate(draft.gameProjectId, update);\n },\n setGamePane: (draft, update: Update<WorkbenchMemory[\"gamePane\"]>) => {\n draft.gamePane = applyUpdate(draft.gamePane, update);\n },\n setVideoTab: (draft, update: Update<WorkbenchMemory[\"videoTab\"]>) => {\n draft.videoTab = applyUpdate(draft.videoTab, update);\n },\n setVideoProjectId: (draft, update: Update<string | undefined>) => {\n draft.videoProjectId = applyUpdate(draft.videoProjectId, update);\n },\n setVideoPane: (draft, update: Update<WorkbenchMemory[\"videoPane\"]>) => {\n draft.videoPane = applyUpdate(draft.videoPane, update);\n },\n setProductionSection: (draft, update: Update<DramaProductionSection>) => {\n draft.productionSection = applyUpdate(draft.productionSection, update);\n },\n setProductionSelectedIds: (draft, update: Update<Record<string, string | undefined>>) => {\n draft.productionSelectedIds = applyUpdate(draft.productionSelectedIds, update);\n },\n setProductionJobs: (draft, update: Update<Record<string, ProductionJob[]>>) => {\n draft.productionJobs = applyUpdate(draft.productionJobs, update);\n },\n setProductionSelections: (draft, update: Update<Record<string, Record<string, string>>>) => {\n draft.productionSelections = applyUpdate(draft.productionSelections, update);\n },\n setProductionReferences: (draft, update: Update<Record<string, Record<string, string[]>>>) => {\n draft.productionReferences = applyUpdate(draft.productionReferences, update);\n },\n setProductionSequence: (draft, update: Update<Record<string, ProductionSequenceItem[]>>) => {\n draft.productionSequence = applyUpdate(draft.productionSequence, update);\n },\n setProductionCanvas: (draft, update: Update<Record<string, Record<string, CanvasPoint>>>) => {\n draft.productionCanvas = applyUpdate(draft.productionCanvas, update);\n },\n setProductionZoom: (draft, update: Update<Record<string, number>>) => {\n draft.productionZoom = applyUpdate(draft.productionZoom, update);\n },\n setProductionIntentCalls: (draft, update: Update<Record<string, boolean>>) => {\n draft.productionIntentCalls = applyUpdate(draft.productionIntentCalls, update);\n }\n }\n });\n}\n\nclass WorkspaceRequestError extends Error {\n constructor(readonly status: number, message: string) { super(message); }\n}\n\nconst GROUP_ORDER: Readonly<Record<WorkbenchMode, readonly string[]>> = {\n story: [\"\u6B63\u6587\", \"\u5927\u7EB2\", \"\u8BBE\u5B9A\", \"\u8FFD\u8E2A\", \"\u5BF9\u6807\", \"\u53C2\u8003\u8D44\u6599\"],\n drama: [\"\u9879\u76EE\", \"\u8F93\u5165\", \"\u9879\u76EE\u5F00\u53D1\", \"\u8BBE\u5B9A\u96C6\", \"\u5267\u96C6\", \"\u5BA1\u67E5\", \"\u521B\u4F5C\u8005\u51B3\u7B56\", \"\u4EA4\u4ED8\"],\n game: [\"game-adaptations\"],\n video: [\"video-recaps\"]\n};\n\nconst WORKBENCH_MODES = [\"story\", \"drama\", \"game\", \"video\"] as const;\nconst EDITOR_MODES = [\"preview\", \"source\", \"production\"] as const;\n\nfunction groupForPath(path: string): string {\n return path === \"short-drama.json\" ? \"\u9879\u76EE\" : path.split(\"/\", 1)[0] ?? \"\u5176\u4ED6\";\n}\n\nasync function json<T>(response: Response): Promise<T> {\n const value = await response.json() as T & { readonly error?: string };\n if (!response.ok) throw new WorkspaceRequestError(response.status, value.error ?? `HTTP ${String(response.status)}`);\n return value;\n}\n\nfunction FileTreeNodes({\n nodes,\n depth,\n expanded,\n selected,\n activityPath,\n onToggle,\n onSelect\n}: {\n readonly nodes: readonly FileTreeNode[];\n readonly depth: number;\n readonly expanded: Readonly<Record<string, boolean>>;\n readonly selected: string | undefined;\n readonly activityPath: string | undefined;\n readonly onToggle: (path: string, open: boolean) => void;\n readonly onSelect: (path: string) => void;\n}) {\n return <>{nodes.map((node) => {\n if (node.kind === \"file\") return <button\n type=\"button\"\n key={node.path}\n style={{ \"--oh-story-indent\": `${String(depth * 14)}px` } as CSSProperties}\n title={node.path}\n aria-label={node.path}\n data-file-path={node.path}\n data-agent-target={node.path === activityPath || undefined}\n aria-current={node.path === selected ? \"page\" : undefined}\n onClick={() => { onSelect(node.path); }}\n >{node.name}</button>;\n const open = selected?.startsWith(`${node.path}/`) === true || expanded[node.path] === true;\n return <details className=\"oh-story-file-folder\" key={node.path} open={open} onToggle={(event) => { onToggle(node.path, event.currentTarget.open); }}>\n <summary style={{ \"--oh-story-indent\": `${String(depth * 14)}px` } as CSSProperties} title={node.path}>{node.name}<span>{node.fileCount}</span></summary>\n <FileTreeNodes\n nodes={node.children}\n depth={depth + 1}\n expanded={expanded}\n selected={selected}\n activityPath={activityPath}\n onToggle={onToggle}\n onSelect={onSelect}\n />\n </details>;\n })}</>;\n}\n\nfunction useWorkspace(sessionId: string): {\n readonly workspace: WorkspacePayload | undefined;\n readonly error: string | undefined;\n readonly loading: boolean;\n readonly reload: () => void;\n} {\n const [version, setVersion] = useState(0);\n const [workspace, setWorkspace] = useState<WorkspacePayload>();\n const [error, setError] = useState<string>();\n const [loading, setLoading] = useState(true);\n const reload = useCallback(() => {\n setLoading(true);\n setVersion((value) => value + 1);\n }, []);\n useEffect(() => {\n const controller = new AbortController();\n setError(undefined);\n void fetch(endpoint(\"workspace\", sessionId), { signal: controller.signal })\n .then((response) => json<WorkspacePayload>(response))\n .then(setWorkspace)\n .catch((reason: unknown) => {\n if (!controller.signal.aborted) setError(reason instanceof Error ? reason.message : String(reason));\n })\n .finally(() => { if (!controller.signal.aborted) setLoading(false); });\n return () => { controller.abort(); };\n }, [sessionId, version]);\n return { workspace, error, loading, reload };\n}\n\nfunction isolatedPreviewUrl(path: string, version: string, revision: number): { readonly href: string; readonly isolated: boolean } {\n const url = new URL(path, globalThis.location.origin);\n if (url.hostname === \"127.0.0.1\") url.hostname = \"localhost\";\n else if (url.hostname === \"localhost\") url.hostname = \"127.0.0.1\";\n url.searchParams.set(\"build\", version);\n url.searchParams.set(\"reload\", String(revision));\n return { href: url.toString(), isolated: url.origin !== globalThis.location.origin };\n}\n\n/**\n * An iframe fires `load`, not `error`, when a navigation commits an HTTP error response, so the\n * frame's own events cannot tell a working preview from the route's JSON error body. Probe the\n * same URL out of band and report a non-OK or non-HTML answer as a real failure.\n */\nfunction PreviewProbe({ href, onFailed }: { readonly href: string; readonly onFailed: () => void }) {\n // Hold the callback in a ref so an inline arrow from the caller cannot re-trigger the probe.\n const failedRef = useRef(onFailed);\n useEffect(() => { failedRef.current = onFailed; }, [onFailed]);\n useEffect(() => {\n const controller = new AbortController();\n void fetch(href, { signal: controller.signal })\n .then((response) => {\n if (controller.signal.aborted) return;\n const type = response.headers.get(\"content-type\") ?? \"\";\n if (!response.ok || !type.includes(\"text/html\")) failedRef.current();\n })\n .catch(() => { if (!controller.signal.aborted) failedRef.current(); });\n return () => { controller.abort(); };\n }, [href]);\n return null;\n}\n\nfunction GamePreview({ project, building }: { readonly project: GameProject; readonly building: boolean }) {\n const shellRef = useRef<HTMLDivElement>(null);\n const fullscreenButtonRef = useRef<HTMLButtonElement>(null);\n const restoreFullscreenFocus = useRef(false);\n const [focused, setFocused] = useState(false);\n const [loaded, setLoaded] = useState(false);\n const [loadError, setLoadError] = useState(false);\n const [revision, setRevision] = useState(0);\n const [loadedVersion, setLoadedVersion] = useState(project.previewVersion);\n useEffect(() => {\n const document = shellRef.current?.ownerDocument;\n if (document === undefined) return;\n const restore = (): void => {\n if (document.fullscreenElement !== null || !restoreFullscreenFocus.current) return;\n restoreFullscreenFocus.current = false;\n fullscreenButtonRef.current?.focus();\n };\n document.addEventListener(\"fullscreenchange\", restore);\n return () => { document.removeEventListener(\"fullscreenchange\", restore); };\n }, []);\n if (!project.previewReady || project.previewUrl === undefined) return <div className=\"oh-game-preview-empty\">\n <span aria-hidden>\u25EB</span>\n <strong>\u8FD8\u6CA1\u6709\u53EF\u8BD5\u73A9\u7248\u672C</strong>\n <p>\u5728\u53F3\u4FA7 Chat \u4F7F\u7528 <code>/novel-to-game quick</code>\uFF0C\u4EA7\u7269\u5199\u5165 <code>game-adaptations/&lt;project&gt;/build/app/</code> \u540E\u4F1A\u81EA\u52A8\u51FA\u73B0\u5728\u8FD9\u91CC\u3002</p>\n <div className=\"oh-game-prompt-example\"><span>\u63CF\u8FF0\u793A\u4F8B</span><q>\u628A\u300A\u4F5C\u54C1\u540D\u300B\u6539\u7F16\u6210\u7F51\u9875\u4E92\u52A8\u6E38\u620F\uFF0C\u76EE\u6807\u73A9\u5BB6\u662F\u2026\u2026\uFF0C\u6838\u5FC3\u73A9\u6CD5\u662F\u2026\u2026\uFF0C\u5E0C\u671B\u6574\u4F53\u98CE\u683C\u2026\u2026</q></div>\n </div>;\n const preview = isolatedPreviewUrl(project.previewUrl, loadedVersion, revision);\n const pending = project.previewVersion !== loadedVersion;\n /** Accept the newer build the creator just chose. */\n const reload = (): void => {\n setLoaded(false);\n setLoadError(false);\n setLoadedVersion(project.previewVersion);\n setRevision((value) => value + 1);\n };\n /** Re-run the build the creator already accepted; never silently adopt a newer one. */\n const refresh = (): void => {\n setLoaded(false);\n setLoadError(false);\n setRevision((value) => value + 1);\n };\n const runtimeState = loadError ? \"\u9884\u89C8\u8F7D\u5165\u5931\u8D25 \u00B7 \u53EF\u91CD\u65B0\u8F7D\u5165\"\n : building ? \"Agent \u6B63\u5728\u66F4\u65B0\u6E38\u620F\u6587\u4EF6 \u00B7 \u5F53\u524D\u9884\u89C8\u4FDD\u6301\u4E0D\u53D8\"\n : pending ? \"\u65B0\u7248\u672C\u5DF2\u5C31\u7EEA \u00B7 \u7531\u4F60\u51B3\u5B9A\u4F55\u65F6\u8F7D\u5165\"\n : loaded ? (preview.isolated ? \"\u9884\u89C8\u5DF2\u8F7D\u5165\" : \"\u9884\u89C8\u5DF2\u8F7D\u5165 \u00B7 \u5F53\u524D\u90E8\u7F72\u65E0\u6CD5\u9694\u79BB\u6765\u6E90\uFF0C\u5B58\u6863\u529F\u80FD\u4E0D\u53EF\u7528\")\n : \"\u6B63\u5728\u8F7D\u5165\u9884\u89C8\u2026\";\n const fullscreen = (): void => {\n const shell = shellRef.current;\n if (shell === null) return;\n restoreFullscreenFocus.current = true;\n void shell.requestFullscreen().catch(() => { restoreFullscreenFocus.current = false; });\n };\n return <div ref={shellRef} className=\"oh-game-preview-shell\" data-state={loadError ? \"error\" : building ? \"building\" : loaded ? \"ready\" : \"loading\"}>\n <div className=\"oh-game-preview-status\">\n <span className=\"oh-game-runtime-state\" role=\"status\" aria-live=\"polite\" title={runtimeState}><i aria-hidden /><em>{runtimeState}</em></span>\n <div>\n {pending && !building && <button type=\"button\" onClick={reload}>\u8F7D\u5165\u65B0\u7248\u672C</button>}\n <button className=\"oh-game-reload\" type=\"button\" onClick={refresh} aria-label=\"\u91CD\u65B0\u8F7D\u5165\u6E38\u620F\"><span aria-hidden>\u21BB</span><b>\u5237\u65B0</b></button>\n <button ref={fullscreenButtonRef} type=\"button\" onClick={fullscreen}>\u5168\u5C4F\u8BD5\u73A9</button>\n </div>\n </div>\n <PreviewProbe href={preview.href} onFailed={() => { setLoaded(false); setLoadError(true); }} />\n <iframe\n key={`${project.id}:${loadedVersion}:${String(revision)}`}\n src={preview.href}\n title={`\u300A${project.title}\u300B\u53EF\u8BD5\u73A9\u9884\u89C8`}\n sandbox={preview.isolated\n ? \"allow-scripts allow-same-origin allow-forms allow-modals allow-downloads\"\n : \"allow-scripts allow-forms allow-modals allow-downloads\"}\n allow=\"autoplay; fullscreen; gamepad\"\n allowFullScreen\n referrerPolicy=\"no-referrer\"\n onLoad={() => { setLoadError(false); setLoaded(true); }}\n onError={() => { setLoaded(false); setLoadError(true); }}\n onFocus={() => { setFocused(true); }}\n onBlur={() => { setFocused(false); }}\n />\n <div className=\"oh-game-focus-hint\" data-focused={focused || undefined}>{focused ? \"\u6E38\u620F\u6B63\u5728\u63A5\u6536\u952E\u9F20\u8F93\u5165\" : \"\u70B9\u51FB\u753B\u9762\u8FDB\u5165\u8BD5\u73A9\"}</div>\n </div>;\n}\n\nfunction GameDesign({\n project,\n files,\n selected,\n sessionId,\n onSelect\n}: {\n readonly project: GameProject;\n readonly files: readonly WorkspaceFile[];\n readonly selected: string | undefined;\n readonly sessionId: string;\n readonly onSelect: (path: string) => void;\n}) {\n const documents = useMemo(() => files.filter((file) => file.path.startsWith(`${project.root}/`) && (\n /\\.(?:md|txt|json|jsonl|html|css|[cm]?js|tsx?|jsx)$/iu.test(file.path)\n )), [files, project.root]);\n const preferred = selected !== undefined && documents.some((file) => file.path === selected)\n ? selected\n : documents.find((file) => file.path === `${project.root}/PRODUCT_BRIEF.md`)?.path ?? documents[0]?.path;\n const [path, setPath] = useState(preferred);\n const [content, setContent] = useState<string>();\n const [error, setError] = useState<string>();\n useEffect(() => { setPath(preferred); }, [preferred, project.id]);\n useEffect(() => {\n if (path === undefined || project.source === \"example\") { setContent(undefined); return; }\n const controller = new AbortController();\n setContent(undefined);\n setError(undefined);\n void fetch(endpoint(\"file\", sessionId, path), { signal: controller.signal })\n .then((response) => json<FilePayload>(response))\n .then((file) => { setContent(file.content); })\n .catch((reason: unknown) => { if (!controller.signal.aborted) setError(reason instanceof Error ? reason.message : String(reason)); });\n return () => { controller.abort(); };\n }, [path, project.source, sessionId]);\n if (project.source === \"example\") return <div className=\"oh-game-design-empty\">\n <strong>\u5185\u7F6E\u5B8C\u6574\u793A\u4F8B</strong>\n <p>\u300A\u91D1\u74F6\u6885 \u00B7 \u98CE\u6708\u603B\u8D26\u300B\u7684\u5B8C\u6574\u53EF\u73A9\u6784\u5EFA\u4E0E QA \u6821\u9A8C\u7ED3\u679C\u968F\u63D2\u4EF6\u6253\u5305\uFF0C\u53EF\u76F4\u63A5\u5728\u5DE6\u4FA7\u8BD5\u73A9\u3002\u4E0A\u6E38\u7684\u4EA7\u54C1\u7B80\u62A5\u3001\u5206\u6790\u3001\u6982\u5FF5\u3001\u8BBE\u8BA1\u4E0E\u6E90\u5C0F\u8BF4\u4E0D\u968F\u5305\u5206\u53D1\uFF0C\u53EF\u5728 novel-to-game \u4ED3\u5E93\u67E5\u770B\u5B8C\u6574\u521B\u4F5C\u8FC7\u7A0B\u3002</p>\n <code>novel-to-game/examples/jin-ping-mei</code>\n </div>;\n if (documents.length === 0 || path === undefined) return <div className=\"oh-game-design-empty\">\u5F53\u524D\u9879\u76EE\u8FD8\u6CA1\u6709\u53EF\u68C0\u67E5\u7684\u8BBE\u8BA1\u6216\u6E90\u6587\u4EF6\u3002</div>;\n const markdown = path.toLocaleLowerCase().endsWith(\".md\");\n return <div className=\"oh-game-design\">\n <label>\u9879\u76EE\u6587\u4EF6<select value={path} onChange={(event) => {\n setPath(event.target.value);\n onSelect(event.target.value);\n }}>{documents.map((file) => <option value={file.path} key={file.path}>{file.path.slice(project.root.length + 1)}</option>)}</select></label>\n {error !== undefined ? <div className=\"oh-story-error\">{error}</div>\n : content === undefined ? <div className=\"oh-game-design-empty\">\u6B63\u5728\u8F7D\u5165\u6587\u4EF6\u2026</div>\n : markdown ? <MarkdownPreview content={content} label={path} />\n : <pre className=\"oh-game-source\" aria-label={`${path} \u6E90\u7801`}>{content}</pre>}\n </div>;\n}\n\nfunction GameStudio({\n sessionId,\n workspace,\n building,\n selected,\n gameTab,\n gameProjectId,\n hidden,\n onGameTab,\n onGameProject,\n workbenches,\n paneId,\n labelledBy,\n onWorkbench,\n onCollapse,\n onSelect\n}: {\n readonly sessionId: string;\n readonly workspace: WorkspacePayload;\n readonly building: boolean;\n readonly selected: string | undefined;\n readonly gameTab: WorkbenchMemory[\"gameTab\"];\n readonly gameProjectId: string | undefined;\n readonly hidden: boolean;\n readonly onGameTab: (tab: WorkbenchMemory[\"gameTab\"]) => void;\n readonly onGameProject: (id: string) => void;\n readonly workbenches: readonly WorkbenchMode[];\n readonly paneId: string;\n readonly labelledBy: string;\n readonly onWorkbench: (mode: WorkbenchMode) => void;\n readonly onCollapse: () => void;\n readonly onSelect: (path: string) => void;\n}) {\n const project = workspace.games.find((value) => value.id === gameProjectId) ?? workspace.games[0];\n const studioRef = useRef<HTMLElement>(null);\n const tabsId = useId();\n useLayoutEffect(() => {\n const studio = studioRef.current;\n if (studio === null) return;\n const publishWidth = () => {\n studio.toggleAttribute(\"data-oh-game-narrow\", studio.clientWidth <= 300);\n };\n publishWidth();\n const observer = new ResizeObserver(publishWidth);\n observer.observe(studio);\n return () => { observer.disconnect(); };\n }, []);\n useEffect(() => {\n if (project !== undefined && project.id !== gameProjectId) onGameProject(project.id);\n }, [gameProjectId, onGameProject, project]);\n if (project === undefined) return <main ref={studioRef} id={paneId} className=\"oh-game-studio\" role=\"tabpanel\" aria-labelledby={labelledBy} hidden={hidden}><div className=\"oh-game-design-empty\">\u6E38\u620F\u80FD\u529B\u6B63\u5728\u8F7D\u5165\u2026</div></main>;\n const tabs = [\"preview\", \"design\"] as const;\n return <main ref={studioRef} id={paneId} className=\"oh-game-studio\" data-source={project.source} role=\"tabpanel\" aria-labelledby={labelledBy} hidden={hidden}>\n <header className=\"oh-game-toolbar\">\n <div className=\"oh-workbench-cluster\">\n {workbenches.length > 1 && <div className=\"oh-game-mode-tabs\" role=\"tablist\" aria-label=\"\u521B\u4F5C\u5DE5\u4F5C\u53F0\">\n {workbenches.map((mode) => <button\n type=\"button\"\n role=\"tab\"\n key={mode}\n aria-selected={mode === \"game\"}\n tabIndex={mode === \"game\" ? 0 : -1}\n onKeyDown={(event) => { handleTabKey(event, workbenches, \"game\", onWorkbench); }}\n onClick={() => { onWorkbench(mode); }}\n >{workbenchLabel(mode)}</button>)}\n </div>}\n <button className=\"oh-workbench-collapse\" type=\"button\" title=\"\u6536\u8D77\u521B\u4F5C\u5DE5\u4F5C\u53F0\" aria-label=\"\u6536\u8D77\u521B\u4F5C\u5DE5\u4F5C\u53F0\" onClick={onCollapse}>\u00D7</button>\n </div>\n <label className=\"oh-game-project\" title=\"\u5207\u6362\u9879\u76EE\u5C06\u91CD\u65B0\u8F7D\u5165\u8BD5\u73A9\"><span>\u6E38\u620F\u9879\u76EE</span><select aria-label=\"\u6E38\u620F\u9879\u76EE\uFF1B\u5207\u6362\u5C06\u91CD\u65B0\u8F7D\u5165\u8BD5\u73A9\" value={project.id} onChange={(event) => { onGameProject(event.target.value); }}>\n {workspace.games.some((item) => item.source === \"workspace\") && <optgroup label=\"\u6211\u7684\u9879\u76EE\">{workspace.games.filter((item) => item.source === \"workspace\").map((item) => <option value={item.id} key={item.id}>{`\u6211\u7684\u9879\u76EE \u00B7 ${item.title}`}</option>)}</optgroup>}\n {workspace.games.some((item) => item.source === \"example\") && <optgroup label=\"\u5185\u7F6E\u793A\u4F8B\">{workspace.games.filter((item) => item.source === \"example\").map((item) => <option value={item.id} key={item.id}>{`\u5185\u7F6E\u793A\u4F8B \u00B7 ${item.title}`}</option>)}</optgroup>}\n </select></label>\n <div className=\"oh-game-tabs\" role=\"tablist\" aria-label=\"\u6E38\u620F\u5DE5\u4F5C\u53F0\">\n {tabs.map((tab) => <button\n key={tab}\n type=\"button\"\n role=\"tab\"\n tabIndex={gameTab === tab ? 0 : -1}\n aria-selected={gameTab === tab}\n id={`${tabsId}-${tab}-tab`}\n aria-controls={`${tabsId}-${tab}-panel`}\n onKeyDown={(event) => { handleTabKey(event, tabs, gameTab, onGameTab); }}\n onClick={() => { onGameTab(tab); }}\n >{tab === \"preview\" ? \"\u8BD5\u73A9\" : project.source === \"example\" ? \"\u8BF4\u660E\" : \"\u9879\u76EE\u6587\u4EF6\"}</button>)}\n </div>\n </header>\n <div className=\"oh-game-panels\">\n <div className=\"oh-game-panel\" role=\"tabpanel\" id={`${tabsId}-preview-panel`} aria-labelledby={`${tabsId}-preview-tab`} hidden={gameTab !== \"preview\"}>\n <GamePreview key={`${project.id}:${String(project.previewReady)}`} project={project} building={building} />\n </div>\n <div className=\"oh-game-panel\" role=\"tabpanel\" id={`${tabsId}-design-panel`} aria-labelledby={`${tabsId}-design-tab`} hidden={gameTab !== \"design\"}>\n <GameDesign project={project} files={workspace.files} selected={selected} sessionId={sessionId} onSelect={onSelect} />\n </div>\n </div>\n </main>;\n}\n\nfunction CreativeWorkbench({\n sessionId,\n runningCalls,\n partial,\n settledMutation,\n sessionRunning,\n productionQueue,\n productionIntents,\n sendProductionPrompt,\n cancelProduction,\n removeQueuedProduction,\n workspace,\n error,\n workspaceLoading,\n reload,\n open,\n creativeProject,\n useStore,\n actions\n}: {\n readonly sessionId: string;\n readonly runningCalls: readonly RunningToolCall[];\n readonly partial: PartialAssistant | null;\n readonly settledMutation: string | undefined;\n readonly sessionRunning: boolean;\n readonly productionQueue: readonly ProductionQueueEntry[];\n readonly productionIntents: readonly SettledProductionIntent[];\n readonly workspace: WorkspacePayload | undefined;\n readonly error: string | undefined;\n readonly workspaceLoading: boolean;\n readonly reload: () => void;\n readonly open: boolean;\n readonly creativeProject: boolean;\n} & Pick<WorkbenchSlotProps, \"useStore\" | \"actions\" | \"sendProductionPrompt\" | \"cancelProduction\" | \"removeQueuedProduction\">) {\n const activities = useMemo(\n () => fileMutations(runningCalls, partial),\n [partial, runningCalls]\n );\n const normalizedActivities = useMemo(() => activities.flatMap((activity) => {\n const path = creativeRelativePath(activity.path, workspace?.cwd);\n return path === undefined ? [] : [{ activity, path }];\n }), [activities, workspace?.cwd]);\n const primaryActivity = normalizedActivities.at(-1);\n const activityPaths = useMemo(() => new Set(normalizedActivities.map((value) => value.path)), [normalizedActivities]);\n const activity = primaryActivity?.activity;\n const activityPath = primaryActivity?.path;\n const workbench = useStore((memory) => memory.workbench);\n const setWorkbench = actions.setWorkbench;\n const gameTab = useStore((memory) => memory.gameTab);\n const setGameTab = actions.setGameTab;\n const gameProjectId = useStore((memory) => memory.gameProjectId);\n const setGameProjectId = actions.setGameProjectId;\n const gamePane = useStore((memory) => memory.gamePane);\n const setGamePane = actions.setGamePane;\n const videoTab = useStore((memory) => memory.videoTab);\n const setVideoTab = actions.setVideoTab;\n const videoProjectId = useStore((memory) => memory.videoProjectId);\n const setVideoProjectId = actions.setVideoProjectId;\n const videoPane = useStore((memory) => memory.videoPane);\n const setVideoPane = actions.setVideoPane;\n const selected = useStore((memory) => memory.selected);\n const setSelected = actions.setSelected;\n const buffers = useStore((memory) => memory.buffers);\n const setBuffers = actions.setBuffers;\n const buffersRef = useRef<Record<string, FileBuffer>>({});\n const expanded = useStore((memory) => memory.expanded);\n const setExpanded = actions.setExpanded;\n const productionSection = useStore((memory) => memory.productionSection);\n const setProductionSection = actions.setProductionSection;\n const productionSelectedIds = useStore((memory) => memory.productionSelectedIds);\n const productionJobsByEpisode = useStore((memory) => memory.productionJobs);\n const productionSelectionsByEpisode = useStore((memory) => memory.productionSelections);\n const productionReferencesByEpisode = useStore((memory) => memory.productionReferences);\n const productionSequenceByEpisode = useStore((memory) => memory.productionSequence);\n const productionCanvasByEpisode = useStore((memory) => memory.productionCanvas);\n const productionZoomByEpisode = useStore((memory) => memory.productionZoom);\n const productionIntentCalls = useStore((memory) => memory.productionIntentCalls);\n const surfaceRef = useRef<HTMLDivElement>(null);\n const setWorkbenchPreference = actions.setWorkbenchPreference;\n const applyWorkbenchPreference = useCallback((preference: WorkbenchPreference): void => {\n setWorkbenchPreference(preference);\n writeWorkbenchPreference(workbenchPreferenceStorage(), workspace?.cwd, preference);\n }, [setWorkbenchPreference, workspace?.cwd]);\n const compactTabsId = useId();\n const compactStudioId = `${compactTabsId}-studio-panel`;\n const compactVideoStudioId = `${compactTabsId}-video-studio-panel`;\n const compactChatId = `${compactTabsId}-chat-panel`;\n const navRef = useRef<HTMLElement>(null);\n const activityBases = useRef(new Map<string, { readonly path: string; readonly base: string }>());\n const previousSignals = useRef<ReadonlySet<string>>(new Set());\n const previousSettledMutation = useRef(settledMutation);\n const saveLocks = useRef(new Set<string>());\n const buffer = selected === undefined ? undefined : buffers[selected];\n const selectedFile = workspace?.files.find((file) => file.path === selected);\n const selectedMedia = selectedFile?.kind === \"media\";\n const dirty = buffer?.source === \"human\" && buffer.content !== buffer.saved;\n const saving = buffer?.saving === true;\n const fileError = buffer?.error;\n const conflict = buffer?.conflict;\n const selectedLower = selected?.toLocaleLowerCase();\n const markdown = selectedLower?.endsWith(\".md\") === true;\n const jsonl = selectedLower?.endsWith(\".jsonl\") === true;\n const structured = jsonl || selectedLower?.endsWith(\".json\") === true;\n const previewable = markdown || jsonl;\n const episodeDirectory = episodeDirectoryForPath(selected);\n const productionAvailable = selected !== undefined && isCreatorDocumentPath(selected) && episodeDirectory !== undefined;\n const editorModes = productionAvailable ? EDITOR_MODES : EDITOR_MODES.filter((mode) => mode !== \"production\");\n const episodeDocumentPaths = useMemo(\n () => episodeDirectory === undefined ? [] : creatorDocumentPaths(workspace?.files.filter((file) => file.kind === \"text\") ?? [], episodeDirectory),\n [episodeDirectory, workspace?.files]\n );\n const episodeDocuments = useMemo(() => Object.fromEntries(episodeDocumentPaths.flatMap((path) => {\n const current = buffers[path];\n return current === undefined || current.missing === true ? [] : [[path, current.content] as const];\n })), [buffers, episodeDocumentPaths]);\n const episodeProduction = useMemo(\n () => episodeDirectory === undefined ? undefined : parseEpisodeProduction(episodeDocuments, episodeDirectory),\n [episodeDirectory, episodeDocuments]\n );\n const productionLibrary = useMemo(() => (workspace?.files ?? []).flatMap((file): ProductionMediaVersion[] => {\n if (file.kind !== \"media\" || file.mimeType?.startsWith(\"audio/\") === true) return [];\n if (!file.path.startsWith(\"\u5267\u96C6/\") && !file.path.startsWith(\"\u4EA4\u4ED8/\")) return [];\n const targetId = file.path.toLocaleUpperCase().match(/(?:SHOT|IMG|MOTION|VISUAL)-[A-Z0-9-]+/u)?.[0] ?? file.path.split(\"/\").at(-2) ?? \"PROJECT-MEDIA\";\n return [{\n id: `workspace:${file.path}:${file.version}`,\n targetId,\n kind: file.mimeType?.startsWith(\"image/\") === true ? \"image\" : \"video\",\n url: endpoint(\"media\", sessionId, file.path),\n path: file.path\n }];\n }), [sessionId, workspace?.files]);\n const productionVersions = useMemo(() => {\n if (episodeProduction === undefined) return [];\n const episodeName = episodeProduction.episodeDirectory.split(\"/\").at(-1) ?? \"\";\n const knownTargets = [\n ...episodeProduction.shots.map((shot) => shot.id),\n ...episodeProduction.assets.map((asset) => asset.id),\n ...episodeProduction.visualAssets.map((asset) => asset.id),\n ...episodeProduction.motions.map((motion) => motion.id)\n ].sort((left, right) => right.length - left.length);\n const motionTargets = new Map(episodeProduction.motions.flatMap((motion) => motion.shotId === undefined ? [] : [[motion.id, motion.shotId] as const]));\n const fromWorkspace = productionLibrary.flatMap((version) => {\n if (version.path === undefined || (!version.path.startsWith(`${episodeProduction.episodeDirectory}/`) && !version.path.startsWith(`\u4EA4\u4ED8/${episodeName}/`))) return [];\n const matched = mediaTargetFromPath(version.path, knownTargets);\n const composition = /(?:^|\\/)\u6210\u7247-[^/]+\\.mp4$/iu.test(version.path);\n if (matched === undefined && !composition) return [];\n const targetId = matched === undefined ? episodeProduction.episodeDirectory : motionTargets.get(matched) ?? matched;\n return [{ ...version, targetId }];\n });\n const byId = new Map<string, ProductionMediaVersion>();\n for (const version of fromWorkspace) byId.set(version.id, version);\n return [...byId.values()];\n }, [episodeProduction, productionLibrary]);\n const productionSelectedId = episodeDirectory === undefined ? undefined : productionSelectedIds[episodeDirectory];\n const productionJobs = episodeDirectory === undefined ? [] : productionJobsByEpisode[episodeDirectory] ?? [];\n const productionSelections = episodeDirectory === undefined ? {} : productionSelectionsByEpisode[episodeDirectory] ?? {};\n const productionReferences = episodeDirectory === undefined ? {} : productionReferencesByEpisode[episodeDirectory] ?? {};\n const productionSequence = episodeDirectory === undefined ? [] : productionSequenceByEpisode[episodeDirectory] ?? [];\n const productionCanvas = episodeDirectory === undefined ? {} : productionCanvasByEpisode[episodeDirectory] ?? {};\n const productionZoom = episodeDirectory === undefined ? .65 : productionZoomByEpisode[episodeDirectory] ?? .65;\n const setProductionSelectedId = useCallback((selectedId: string | undefined) => {\n if (episodeDirectory !== undefined) actions.setProductionSelectedIds((current) => ({ ...current, [episodeDirectory]: selectedId }));\n }, [actions, episodeDirectory]);\n const setProductionJobs = useCallback((jobs: ProductionJob[]) => {\n if (episodeDirectory !== undefined) actions.setProductionJobs((current) => ({ ...current, [episodeDirectory]: jobs }));\n }, [actions, episodeDirectory]);\n const setProductionSelections = useCallback((selections: Record<string, string>) => {\n if (episodeDirectory !== undefined) actions.setProductionSelections((current) => ({ ...current, [episodeDirectory]: selections }));\n }, [actions, episodeDirectory]);\n const setProductionReferences = useCallback((references: Record<string, string[]>) => {\n if (episodeDirectory !== undefined) actions.setProductionReferences((current) => ({ ...current, [episodeDirectory]: references }));\n }, [actions, episodeDirectory]);\n const setProductionSequence = useCallback((sequence: ProductionSequenceItem[]) => {\n if (episodeDirectory !== undefined) actions.setProductionSequence((current) => ({ ...current, [episodeDirectory]: sequence }));\n }, [actions, episodeDirectory]);\n const setProductionCanvas = useCallback((canvas: Record<string, CanvasPoint>) => {\n if (episodeDirectory !== undefined) actions.setProductionCanvas((current) => ({ ...current, [episodeDirectory]: canvas }));\n }, [actions, episodeDirectory]);\n const setProductionZoom = useCallback((zoom: number) => {\n if (episodeDirectory !== undefined) actions.setProductionZoom((current) => ({ ...current, [episodeDirectory]: zoom }));\n }, [actions, episodeDirectory]);\n const editorMode = useStore((memory) => memory.editorMode);\n const setEditorMode = actions.setEditorMode;\n const modeSelection = useRef(selected);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const editorPositions = useRef(new Map<string, { readonly scrollTop: number; readonly selectionStart: number; readonly selectionEnd: number }>());\n const editorReady = buffer !== undefined && buffer.missing !== true;\n const workspaceKind = workbench === \"game\" || workbench === \"video\" ? undefined : workbench;\n const gameBuilding = normalizedActivities.some(({ path }) => path.startsWith(\"game-adaptations/\"));\n const videoBuilding = normalizedActivities.some(({ path }) => path.startsWith(\"video-recaps/\"));\n\n useEffect(() => { buffersRef.current = buffers; }, [buffers]);\n\n const rememberEditorPosition = useCallback((): void => {\n const element = textareaRef.current;\n if (element === null || selected === undefined || element.getAttribute(\"aria-label\") !== selected) return;\n editorPositions.current.set(selected, {\n scrollTop: element.scrollTop,\n selectionStart: element.selectionStart,\n selectionEnd: element.selectionEnd\n });\n }, [selected]);\n\n useLayoutEffect(() => {\n if (editorMode !== \"source\" || selected === undefined || !editorReady) return;\n const element = textareaRef.current;\n const position = editorPositions.current.get(selected);\n if (element === null || position === undefined) return;\n const end = Math.min(position.selectionEnd, element.value.length);\n element.setSelectionRange(Math.min(position.selectionStart, end), end);\n element.scrollTop = position.scrollTop;\n }, [editorMode, editorReady, selected]);\n\n useEffect(() => {\n const warn = (event: BeforeUnloadEvent): void => {\n if (!Object.values(buffersRef.current).some((value) => value.source === \"human\" && value.content !== value.saved)) return;\n event.preventDefault();\n };\n globalThis.addEventListener(\"beforeunload\", warn);\n return () => { globalThis.removeEventListener(\"beforeunload\", warn); };\n }, []);\n\n const expandPath = useCallback((path: string): void => {\n const segments = path.split(\"/\");\n const ancestors = [groupForPath(path)];\n for (let index = 1; index < segments.length - 1; index += 1) ancestors.push(segments.slice(0, index + 1).join(\"/\"));\n setExpanded((current) => {\n const next = { ...current };\n for (const ancestor of ancestors) next[ancestor] = true;\n return next;\n });\n }, []);\n\n const revealPath = useCallback((path: string): void => {\n rememberEditorPosition();\n const nextWorkbench = workbenchModeForPath(path) ?? \"story\";\n setWorkbench(nextWorkbench);\n if (nextWorkbench === \"game\" && !path.includes(\"/build/app/\")) setGameTab(\"design\");\n setSelected(path);\n expandPath(path);\n }, [expandPath, rememberEditorPosition]);\n\n useEffect(() => {\n if (workspace === undefined) return;\n const pending = productionIntents.filter(({ callId }) => productionIntentCalls[callId] !== true);\n if (pending.length === 0) return;\n for (const { intent } of pending) {\n if (intent.action === \"open_section\" || intent.action === \"focus_target\") {\n const documentPath = [\"\u5206\u955C.md\", \"\u56FE\u7247\u63D0\u793A\u8BCD.md\", \"\u89C6\u89C9\u8BBE\u5B9A.md\", \"\u5267\u672C.md\", \"\u89C6\u9891\u63D0\u793A\u8BCD.md\"]\n .map((name) => `${intent.episode}/${name}`)\n .find((path) => workspace.files.some((file) => file.path === path));\n if (documentPath !== undefined) {\n setWorkbench(\"drama\");\n setSelected(documentPath);\n expandPath(documentPath);\n globalThis.setTimeout(() => { setEditorMode(\"production\"); }, 0);\n }\n }\n if (intent.action === \"open_section\") setProductionSection(intent.section ?? \"shots\");\n else if (intent.action === \"focus_target\") {\n actions.setProductionSelectedIds((current) => ({ ...current, [intent.episode]: intent.targetId }));\n setProductionSection(intent.section ?? (intent.targetId?.startsWith(\"SHOT-\") === true ? \"shots\" : \"assets\"));\n } else if (intent.action === \"set_sequence\") {\n actions.setProductionSequence((current) => ({\n ...current,\n [intent.episode]: (intent.shotIds ?? []).map((shotId) => ({ shotId }))\n }));\n } else if (intent.action === \"track_job\" && intent.jobId !== undefined && intent.targetId !== undefined && intent.jobKind !== undefined) {\n const { jobId, targetId, jobKind } = intent;\n actions.setProductionJobs((current) => {\n const jobs = current[intent.episode] ?? [];\n if (jobs.some((job) => job.id === jobId)) {\n return {\n ...current,\n [intent.episode]: jobs.map((job) => job.id === jobId ? {\n ...job,\n targetId,\n kind: jobKind,\n status: \"running\",\n progress: Math.max(10, job.progress),\n prompt: intent.prompt ?? job.prompt,\n expectedOutputs: intent.expectedOutputs ?? job.expectedOutputs,\n error: undefined\n } : job)\n };\n }\n return {\n ...current,\n [intent.episode]: [...jobs, {\n ...createPendingJob({\n id: jobId,\n targetId,\n kind: jobKind,\n prompt: intent.prompt ?? \"\",\n expectedOutputs: intent.expectedOutputs\n }),\n status: \"running\",\n progress: 10\n }]\n };\n });\n }\n }\n actions.setProductionIntentCalls((current) => ({\n ...current,\n ...Object.fromEntries(pending.map(({ callId }) => [callId, true]))\n }));\n }, [actions, expandPath, productionIntentCalls, productionIntents, setEditorMode, setProductionSection, setSelected, setWorkbench, workspace]);\n\n // Latch first entry into the game workbench: before that the Studio must not mount, or every\n // session downloads and runs the bundled example in a display:none iframe. Once mounted it\n // stays mounted so the running game survives later navigation.\n const openedGame = useRef(false);\n if (workbench === \"game\") openedGame.current = true;\n const gameStudioMounted = openedGame.current;\n const openedVideo = useRef(false);\n if (workbench === \"video\") openedVideo.current = true;\n const videoStudioMounted = openedVideo.current;\n\n const followAgentPath = useCallback((path: string): void => {\n expandPath(path);\n const current = selected === undefined ? undefined : buffersRef.current[selected];\n const preserveFocusedDraft = path !== selected\n && current?.source === \"human\"\n && current.content !== current.saved\n && surfaceRef.current?.ownerDocument.activeElement === textareaRef.current;\n if (preserveFocusedDraft) return;\n // The editor textarea is not mounted in the Game Studio, so the draft guard above can never\n // fire there. Never preempt a running game: agent writes may expand the tree, not navigate.\n if ((workbench === \"game\" && gameTab === \"preview\") || (workbench === \"video\" && videoTab === \"preview\")) return;\n revealPath(path);\n }, [expandPath, gameTab, revealPath, selected, videoTab, workbench]);\n\n useEffect(() => {\n if (activityPath !== undefined && activityPath === selected && !selectedMedia) setEditorMode(\"source\");\n }, [activityPath, selected, selectedMedia]);\n\n useEffect(() => {\n if (modeSelection.current === selected) return;\n modeSelection.current = selected;\n setEditorMode(selected !== undefined && activityPaths.has(selected) ? \"source\" : selectedMedia || previewable ? \"preview\" : \"source\");\n }, [activityPaths, previewable, selected, selectedMedia]);\n\n useEffect(() => {\n if (workspaceLoading) return;\n if (activityPath !== undefined) return;\n if (selected !== undefined && (\n (workspace?.files.some((file) => file.path === selected) ?? false)\n || buffers[selected] !== undefined\n ) && workbenchModeForPath(selected) === workbench) return;\n setSelected(workspace === undefined ? undefined : preferredWorkbenchFile(workspace.files, workbench));\n }, [activityPath, buffers, selected, workbench, workspace, workspaceLoading]);\n\n useEffect(() => {\n if (workspace === undefined || workspaceLoading) return;\n const paths = new Set(workspace.files.map((file) => file.path));\n setBuffers((current) => {\n let changed = false;\n const next = { ...current };\n for (const [path, value] of Object.entries(current)) {\n if (paths.has(path) || activityPaths.has(path)) continue;\n if (value.source === \"human\" && value.content !== value.saved) {\n if (value.missing !== true) {\n next[path] = { ...value, missing: true, error: \"\u6587\u4EF6\u5DF2\u4ECE workspace \u79FB\u9664\u3002\u672C\u5730\u8349\u7A3F\u4ECD\u4FDD\u7559\uFF0C\u53EF\u590D\u5236\u540E\u653E\u5F03\u8349\u7A3F\u3002\" };\n changed = true;\n }\n } else {\n delete next[path];\n changed = true;\n }\n }\n return changed ? next : current;\n });\n }, [activityPaths, workspace, workspaceLoading]);\n\n useEffect(() => {\n if (selected === undefined || selectedMedia || activityPaths.has(selected)) return;\n if (!(workspace?.files.some((file) => file.path === selected) ?? false)) return;\n const controller = new AbortController();\n setBuffers((current) => {\n const existing = current[selected];\n return existing === undefined ? current : { ...current, [selected]: { ...existing, error: undefined } };\n });\n void fetch(endpoint(\"file\", sessionId, selected), { signal: controller.signal })\n .then((response) => json<FilePayload>(response))\n .then((file) => {\n setBuffers((current) => {\n const existing = current[file.path];\n if (existing?.source === \"human\" && existing.content !== existing.saved) {\n if (existing.version === file.version) return { ...current, [file.path]: { ...existing, missing: false, error: undefined } };\n return {\n ...current,\n [file.path]: {\n ...existing,\n missing: false,\n error: undefined,\n conflict: {\n message: `${file.path} \u5DF2\u5728\u78C1\u76D8\u4E0A\u66F4\u65B0\uFF1B\u4F60\u7684\u672C\u5730\u8349\u7A3F\u6CA1\u6709\u88AB\u8986\u76D6\u3002`,\n theirs: file.content,\n theirsVersion: file.version\n }\n }\n };\n }\n return {\n ...current,\n [file.path]: { content: file.content, saved: file.content, source: \"disk\", version: file.version }\n };\n });\n })\n .catch((reason: unknown) => {\n if (controller.signal.aborted) return;\n setBuffers((current) => {\n const existing = current[selected];\n return existing === undefined ? current : {\n ...current,\n [selected]: { ...existing, error: reason instanceof Error ? reason.message : String(reason) }\n };\n });\n });\n return () => { controller.abort(); };\n }, [activityPaths, selected, selectedMedia, sessionId, workspace?.files]);\n\n useEffect(() => {\n if (!productionAvailable) return;\n const missing = episodeDocumentPaths.filter((path) => buffersRef.current[path] === undefined && !activityPaths.has(path));\n if (missing.length === 0) return;\n const controller = new AbortController();\n void Promise.all(missing.map((path) => fetch(endpoint(\"file\", sessionId, path), { signal: controller.signal }).then((response) => json<FilePayload>(response))))\n .then((files) => {\n setBuffers((current) => {\n const next = { ...current };\n for (const file of files) {\n const existing = next[file.path];\n if (existing?.source === \"human\" && existing.content !== existing.saved) continue;\n next[file.path] = { content: file.content, saved: file.content, source: \"disk\", version: file.version };\n }\n return next;\n });\n })\n .catch((reason: unknown) => {\n if (!controller.signal.aborted) {\n setBuffers((current) => {\n const next = { ...current };\n for (const path of missing) {\n const existing = next[path];\n if (existing !== undefined) next[path] = { ...existing, error: reason instanceof Error ? reason.message : String(reason) };\n }\n return next;\n });\n }\n });\n return () => { controller.abort(); };\n }, [activityPaths, episodeDocumentPaths, productionAvailable, sessionId]);\n\n useEffect(() => {\n if (normalizedActivities.length === 0) return;\n for (const { path } of normalizedActivities) expandPath(path);\n if (activityPath !== undefined) followAgentPath(activityPath);\n setBuffers((current) => {\n let next = current;\n for (const { activity: currentActivity, path } of normalizedActivities) {\n const existing = next[path];\n if (existing?.source === \"human\" && existing.content !== existing.saved) {\n next = {\n ...next,\n [path]: {\n ...existing,\n conflict: { message: `${path} \u6B63\u7531 Agent \u4FEE\u6539\uFF1B\u4F60\u7684\u672C\u5730\u8349\u7A3F\u5DF2\u9501\u5B9A\uFF0C\u4E0D\u4F1A\u88AB\u8986\u76D6\u3002` }\n }\n };\n continue;\n }\n let basis = activityBases.current.get(currentActivity.callId);\n if (basis === undefined || basis.path !== path) {\n basis = { path, base: existing?.content ?? \"\" };\n activityBases.current.set(currentActivity.callId, basis);\n }\n const preview = previewMutation(currentActivity, basis.base);\n if (preview === undefined || (existing?.source === \"agent\" && existing.content === preview)) continue;\n next = {\n ...next,\n [path]: {\n content: preview,\n saved: existing?.saved ?? \"\",\n source: \"agent\",\n version: existing?.version ?? \"\"\n }\n };\n }\n return next;\n });\n }, [activityPath, expandPath, followAgentPath, normalizedActivities]);\n\n useEffect(() => {\n const signals = new Set(mutatingCallIds(runningCalls));\n for (const { activity: currentActivity } of normalizedActivities) signals.add(currentActivity.callId.split(\":\", 1)[0] ?? currentActivity.callId);\n const settled = [...previousSignals.current].some((callId) => !signals.has(callId));\n for (const callId of activityBases.current.keys()) {\n if (!signals.has(callId.split(\":\", 1)[0] ?? callId)) activityBases.current.delete(callId);\n }\n previousSignals.current = signals;\n if (!settled) return;\n reload();\n }, [normalizedActivities, reload, runningCalls]);\n\n useEffect(() => {\n if (settledMutation === undefined || settledMutation === previousSettledMutation.current) return;\n // The signal carries an absolute path, so creativeRelativePath cannot resolve it until the\n // workspace (and its cwd) has loaded. Consuming the signal first would burn it: the effect\n // re-runs when cwd arrives, but the guard above then short-circuits and the agent's file is\n // never selected. Wait for cwd instead of dropping the follow.\n if (workspace?.cwd === undefined) return;\n previousSettledMutation.current = settledMutation;\n const path = creativeRelativePath(settledMutation.slice(settledMutation.indexOf(\"\\0\") + 1), workspace.cwd);\n if (path !== undefined) followAgentPath(path);\n reload();\n }, [followAgentPath, reload, settledMutation, workspace?.cwd]);\n\n useEffect(() => {\n if (selected === undefined) return;\n for (const button of navRef.current?.querySelectorAll<HTMLButtonElement>(\"button[data-file-path]\") ?? []) {\n if (button.dataset.filePath === selected) {\n button.scrollIntoView({ block: \"nearest\" });\n break;\n }\n }\n }, [selected]);\n\n useEffect(() => {\n if (!open || normalizedActivities.length > 0 || workspace === undefined) return;\n const sessionSurface = surfaceRef.current?.parentElement;\n if (sessionSurface === undefined || sessionSurface === null) return;\n const knownPaths = new Set(workspace.files.map((file) => file.path));\n const followOfficialFileLink = (event: MouseEvent): void => {\n const origin = event.target;\n if (!(origin instanceof Element)) return;\n const control = origin.closest<HTMLElement>(\"button, a\");\n if (control === null || control.closest(\".oh-story-split-surface\") !== null) return;\n const candidates = [control.title, control.getAttribute(\"aria-label\"), control.textContent];\n for (const candidate of candidates) {\n const path = creativeRelativePath(candidate?.trim().replace(/^(?:Open|\u6253\u5F00)\\s+/u, \"\"), workspace.cwd);\n if (path === undefined || !knownPaths.has(path)) continue;\n event.preventDefault();\n event.stopPropagation();\n revealPath(path);\n break;\n }\n };\n sessionSurface.addEventListener(\"click\", followOfficialFileLink, true);\n return () => { sessionSurface.removeEventListener(\"click\", followOfficialFileLink, true); };\n }, [normalizedActivities.length, open, revealPath, workspace]);\n\n useEffect(() => {\n if (workbench !== \"game\" && workbench !== \"video\") return;\n const surface = surfaceRef.current;\n const sessionSurface = surface?.parentElement;\n const chat = Array.from(sessionSurface?.children ?? []).find((child) => child !== surface && child instanceof HTMLElement);\n if (!(chat instanceof HTMLElement)) return;\n const previous = {\n id: chat.id,\n role: chat.getAttribute(\"role\"),\n labelledBy: chat.getAttribute(\"aria-labelledby\")\n };\n chat.id = compactChatId;\n chat.setAttribute(\"role\", \"tabpanel\");\n chat.setAttribute(\"aria-labelledby\", `${compactTabsId}-chat-tab`);\n return () => {\n chat.id = previous.id;\n if (previous.role === null) chat.removeAttribute(\"role\");\n else chat.setAttribute(\"role\", previous.role);\n if (previous.labelledBy === null) chat.removeAttribute(\"aria-labelledby\");\n else chat.setAttribute(\"aria-labelledby\", previous.labelledBy);\n };\n }, [compactChatId, compactTabsId, workbench]);\n\n const savePath = useCallback(async (path: string) => {\n if (saveLocks.current.has(path)) return;\n const submitted = buffersRef.current[path];\n if (submitted === undefined || submitted.missing === true || submitted.content === submitted.saved) return;\n saveLocks.current.add(path);\n setBuffers((current) => {\n const existing = current[path];\n return existing === undefined ? current : { ...current, [path]: { ...existing, saving: true, error: undefined } };\n });\n try {\n const file = await json<FilePayload>(await fetch(endpoint(\"file\", sessionId, path), {\n method: \"PUT\",\n headers: { \"content-type\": \"application/json\" },\n body: JSON.stringify({ content: submitted.content, baseVersion: submitted.version })\n }));\n setBuffers((current) => {\n const latest = current[path];\n if (latest === undefined) return current;\n const unchanged = latest.content === submitted.content;\n return {\n ...current,\n [path]: {\n content: unchanged ? file.content : latest.content,\n saved: file.content,\n source: unchanged ? \"disk\" : \"human\",\n version: file.version,\n saving: false\n }\n };\n });\n reload();\n } catch (reason) {\n if (reason instanceof WorkspaceRequestError && reason.status === 412) {\n try {\n const theirs = await json<FilePayload>(await fetch(endpoint(\"file\", sessionId, path)));\n setBuffers((current) => {\n const latest = current[path];\n if (latest === undefined) return current;\n return {\n ...current,\n [path]: {\n ...latest,\n saving: false,\n conflict: {\n message: `${path} \u5DF2\u5728\u78C1\u76D8\u4E0A\u66F4\u65B0\uFF1B\u8BF7\u9009\u62E9\u4FDD\u7559\u54EA\u4E00\u7248\u3002`,\n theirs: theirs.content,\n theirsVersion: theirs.version\n }\n }\n };\n });\n } catch (refreshError) {\n setBuffers((current) => {\n const existing = current[path];\n return existing === undefined ? current : {\n ...current,\n [path]: { ...existing, saving: false, error: refreshError instanceof Error ? refreshError.message : String(refreshError) }\n };\n });\n }\n } else {\n setBuffers((current) => {\n const existing = current[path];\n return existing === undefined ? current : {\n ...current,\n [path]: { ...existing, saving: false, error: reason instanceof Error ? reason.message : String(reason) }\n };\n });\n }\n } finally {\n saveLocks.current.delete(path);\n }\n }, [reload, sessionId]);\n\n useEffect(() => {\n if (!open) return;\n const saveShortcut = (event: KeyboardEvent): void => {\n if (!(event.metaKey || event.ctrlKey) || event.key.toLocaleLowerCase() !== \"s\") return;\n event.preventDefault();\n if (selected !== undefined) void savePath(selected);\n };\n globalThis.addEventListener(\"keydown\", saveShortcut);\n return () => { globalThis.removeEventListener(\"keydown\", saveShortcut); };\n }, [open, savePath, selected]);\n\n const groups = useMemo(() => {\n const value = new Map<string, WorkspaceFile[]>();\n const all = [...(workspace?.files ?? [])].filter((file) => workbenchModeForPath(file.path) === workbench);\n if (activityPath !== undefined && !all.some((file) => file.path === activityPath)) all.push({ path: activityPath, bytes: 0, version: \"\", kind: \"text\" });\n all.sort((left, right) => left.path.localeCompare(right.path, \"zh-Hans-CN\"));\n for (const file of all) {\n const directory = groupForPath(file.path);\n const files = value.get(directory) ?? [];\n files.push(file);\n value.set(directory, files);\n }\n const order = GROUP_ORDER[workbench];\n return [...value.entries()].sort(([left], [right]) => {\n const leftIndex = order.indexOf(left);\n const rightIndex = order.indexOf(right);\n return (leftIndex < 0 ? order.length : leftIndex) - (rightIndex < 0 ? order.length : rightIndex)\n || left.localeCompare(right, \"zh-Hans-CN\");\n });\n }, [activityPath, workbench, workspace]);\n\n const selectWorkbench = (next: WorkbenchMode): void => {\n setWorkbench(next);\n if (next === \"game\" || next === \"video\") {\n if (next === \"game\") setGameTab(\"preview\");\n else setVideoTab(\"preview\");\n setSelected(undefined);\n return;\n }\n const target = workspace === undefined ? undefined : preferredWorkbenchFile(workspace.files, next);\n if (target === undefined) setSelected(undefined);\n else revealPath(target);\n };\n const selectEditorMode = (next: WorkbenchMemory[\"editorMode\"]): void => {\n if (next === \"preview\") rememberEditorPosition();\n setEditorMode(next);\n };\n const navigateProductionTarget = (target: DramaDocumentTarget): void => {\n const content = buffersRef.current[target.path]?.content ?? \"\";\n const before = content.slice(0, target.offset);\n const approximateScrollTop = Math.max(0, before.split(/\\r?\\n/u).length * 28 - 96);\n editorPositions.current.set(target.path, { scrollTop: approximateScrollTop, selectionStart: target.offset, selectionEnd: target.offset });\n modeSelection.current = target.path;\n revealPath(target.path);\n setEditorMode(\"source\");\n };\n const selectedLabel = selected ?? `\u5728\u5F53\u524D DSH workspace \u4E2D\u9009\u62E9${workbenchLabel(workbench)}\u6587\u4EF6`;\n const selectedBasename = selected?.split(\"/\").at(-1) ?? selectedLabel;\n const selectedGroup = selected === undefined ? undefined : groupForPath(selected);\n const toggleGroup = (key: string, open: boolean): void => {\n setExpanded((current) => ({ ...current, [key]: open }));\n };\n const resolveConflict = (keepLocal: boolean): void => {\n if (selected === undefined || conflict?.theirs === undefined || conflict.theirsVersion === undefined) return;\n const theirs = conflict.theirs;\n const theirsVersion = conflict.theirsVersion;\n setBuffers((current) => {\n const existing = current[selected];\n if (existing === undefined) return current;\n return {\n ...current,\n [selected]: keepLocal\n ? { ...existing, saved: theirs, version: theirsVersion, source: \"human\", conflict: undefined }\n : { content: theirs, saved: theirs, source: \"disk\", version: theirsVersion }\n };\n });\n };\n\n if (!open) {\n // Without creative work there is nothing to reveal, so the plugin leaves the\n // official conversation exactly as DSH renders it. A failed workspace request\n // still offers the way in, because that error is only readable inside the workbench.\n if (!creativeProject && error === undefined) return null;\n return <div ref={surfaceRef} className=\"oh-story-split-surface\" data-open=\"false\">\n <style>{styles}</style>\n <button className=\"oh-story-launcher\" type=\"button\" title={error ?? \"\u6253\u5F00\u521B\u4F5C\u5DE5\u4F5C\u53F0\"} aria-label=\"\u6253\u5F00\u521B\u4F5C\u5DE5\u4F5C\u53F0\" onClick={() => { applyWorkbenchPreference(\"open\"); }}>\n <span aria-hidden>\u2726</span><b>\u521B\u4F5C\u5DE5\u4F5C\u53F0</b>\n </button>\n </div>;\n }\n\n return <div ref={surfaceRef} className=\"oh-story-split-surface\" data-open=\"true\" data-workbench={workbench}>\n <style>{styles}</style>\n {(workbench === \"game\" || workbench === \"video\") && <div className=\"oh-game-mobile-switcher\" role=\"tablist\" aria-label={workbench === \"game\" ? \"\u7A84\u5C4F\u6E38\u620F\u5DE5\u4F5C\u53F0\" : \"\u7A84\u5C4F\u89C6\u9891\u5DE5\u4F5C\u53F0\"}>\n {([\"studio\", \"chat\"] as const).map((pane) => <button\n type=\"button\"\n role=\"tab\"\n key={pane}\n id={`${compactTabsId}-${pane}-tab`}\n aria-controls={pane === \"chat\" ? compactChatId : workbench === \"game\" ? compactStudioId : compactVideoStudioId}\n aria-selected={(workbench === \"game\" ? gamePane : videoPane) === pane}\n tabIndex={(workbench === \"game\" ? gamePane : videoPane) === pane ? 0 : -1}\n onKeyDown={(event) => { handleTabKey(event, [\"studio\", \"chat\"] as const, workbench === \"game\" ? gamePane : videoPane, workbench === \"game\" ? setGamePane : setVideoPane); }}\n onClick={() => { if (workbench === \"game\") setGamePane(pane); else setVideoPane(pane); }}\n >{pane === \"studio\" ? \"\u5236\u4F5C\" : \"\u5BF9\u8BDD\"}</button>)}\n </div>}\n {workbench === \"game\" && workspace === undefined && <main id={compactStudioId} className=\"oh-game-studio\" role=\"tabpanel\" aria-labelledby={`${compactTabsId}-studio-tab`}><div className=\"oh-game-design-empty\">{error ?? \"\u6B63\u5728\u8FDE\u63A5\u6E38\u620F\u5DE5\u4F5C\u53F0\u2026\"}</div></main>}\n {workspace !== undefined && gameStudioMounted && <GameStudio\n sessionId={sessionId}\n workspace={workspace}\n building={gameBuilding}\n selected={selected}\n gameTab={gameTab}\n gameProjectId={gameProjectId}\n hidden={workbench !== \"game\"}\n onGameTab={setGameTab}\n onGameProject={setGameProjectId}\n workbenches={WORKBENCH_MODES}\n paneId={compactStudioId}\n labelledBy={`${compactTabsId}-studio-tab`}\n onWorkbench={selectWorkbench}\n onCollapse={() => { applyWorkbenchPreference(\"closed\"); }}\n onSelect={revealPath}\n />}\n {workbench === \"video\" && workspace === undefined && <main id={compactVideoStudioId} className=\"oh-video-studio\" role=\"tabpanel\" aria-labelledby={`${compactTabsId}-studio-tab`}><div className=\"oh-video-preview-empty\">{error ?? \"\u6B63\u5728\u8FDE\u63A5\u89C6\u9891\u5DE5\u4F5C\u53F0\u2026\"}</div></main>}\n {workspace !== undefined && videoStudioMounted && <VideoStudio\n sessionId={sessionId}\n projects={workspace.videos}\n running={videoBuilding}\n projectId={videoProjectId}\n tab={videoTab}\n hidden={workbench !== \"video\"}\n workbenches={WORKBENCH_MODES}\n paneId={compactVideoStudioId}\n labelledBy={`${compactTabsId}-studio-tab`}\n onProject={setVideoProjectId}\n onTab={setVideoTab}\n onWorkbench={selectWorkbench}\n onCollapse={() => { applyWorkbenchPreference(\"closed\"); }}\n />}\n {workbench !== \"game\" && workbench !== \"video\" && <>\n <aside className=\"oh-story-tree\">\n <div className=\"oh-story-brand\">\n <span className=\"oh-story-brand-cluster\"><strong>\u2726 <span>Oh Story</span></strong>{workspaceKind !== undefined && <span className=\"oh-story-kind\">{workspaceKind === \"story\" ? \"\u5C0F\u8BF4\" : \"\u77ED\u5267\"}</span>}</span>\n <span className=\"oh-story-brand-actions\">\n <button type=\"button\" onClick={reload} title=\"\u5237\u65B0\" aria-label=\"\u5237\u65B0\u9879\u76EE\u6587\u4EF6\">\u21BB</button>\n <button type=\"button\" onClick={() => { applyWorkbenchPreference(\"closed\"); }} title=\"\u6536\u8D77\u521B\u4F5C\u5DE5\u4F5C\u53F0\" aria-label=\"\u6536\u8D77\u521B\u4F5C\u5DE5\u4F5C\u53F0\">\u00D7</button>\n </span>\n </div>\n {workspace !== undefined && <div className=\"oh-story-mode-tabs\" role=\"tablist\" aria-label=\"\u521B\u4F5C\u5DE5\u4F5C\u53F0\">\n {WORKBENCH_MODES.map((mode) => <button\n type=\"button\"\n role=\"tab\"\n key={mode}\n tabIndex={workbench === mode ? 0 : -1}\n aria-selected={workbench === mode}\n onKeyDown={(event) => { handleTabKey(event, WORKBENCH_MODES, workbench, selectWorkbench); }}\n onClick={() => { selectWorkbench(mode); }}\n >{workbenchLabel(mode)}</button>)}\n </div>}\n {error !== undefined && <div className=\"oh-story-error\">{error}</div>}\n {workspace?.metadataErrors.map((message) => <div className=\"oh-story-warning\" key={message}>{message}</div>)}\n <nav ref={navRef} aria-label={workbench === \"story\" ? \"\u5C0F\u8BF4\u9879\u76EE\u6587\u4EF6\" : \"\u77ED\u5267\u9879\u76EE\u6587\u4EF6\"}>\n {groups.map(([directory, files]) => {\n const groupOpen = selectedGroup === directory || expanded[directory] === true;\n return <details className=\"oh-story-file-group\" key={directory} open={groupOpen} onToggle={(event) => { toggleGroup(directory, event.currentTarget.open); }}>\n <summary>{directory}<span>{files.length}</span></summary>\n <FileTreeNodes\n nodes={buildFileTree(files, directory)}\n depth={1}\n expanded={expanded}\n selected={selected}\n activityPath={activityPath}\n onToggle={toggleGroup}\n onSelect={revealPath}\n />\n </details>;\n })}\n </nav>\n </aside>\n <main className=\"oh-story-editor\">\n <header>\n <span className=\"oh-story-editor-path\" title={selected}><span>{selectedLabel}</span><strong>{selectedBasename}</strong></span>\n <div className=\"oh-story-editor-actions\">\n {(previewable || productionAvailable) && !selectedMedia && <div className=\"oh-story-editor-tabs\" role=\"tablist\" aria-label={productionAvailable ? \"\u77ED\u5267\u6587\u6863\u67E5\u770B\u65B9\u5F0F\" : markdown ? \"Markdown \u67E5\u770B\u65B9\u5F0F\" : \"JSONL \u67E5\u770B\u65B9\u5F0F\"}>\n {editorModes.map((mode) => <button\n type=\"button\"\n role=\"tab\"\n key={mode}\n tabIndex={editorMode === mode ? 0 : -1}\n aria-selected={editorMode === mode}\n onKeyDown={(event) => { handleTabKey(event, editorModes, editorMode, selectEditorMode); }}\n onClick={() => { selectEditorMode(mode); }}\n >{mode === \"preview\" ? \"\u9884\u89C8\" : mode === \"source\" ? \"\u6E90\u7801\" : \"\u751F\u4EA7\"}</button>)}\n </div>}\n {(dirty || saving) && selected !== undefined && <button className=\"oh-story-save\" type=\"button\" disabled={saving || buffer?.missing === true} onClick={() => { void savePath(selected); }}>\n {saving ? \"\u4FDD\u5B58\u4E2D\u2026\" : \"\u4FDD\u5B58\"}\n </button>}\n </div>\n </header>\n {activity !== undefined && activityPath !== undefined && activityPath === selected && <div className=\"oh-story-stream\" data-stage={activity.stage} role=\"status\" aria-live=\"polite\">\u25CF {activity.stage === \"running\" ? \"Agent \u6B63\u5728\u5E94\u7528\u4FEE\u6539\" : \"Agent \u6B63\u5728\u751F\u6210\u6587\u4EF6\u5185\u5BB9\"}</div>}\n {conflict !== undefined && <div className=\"oh-story-conflict\" role=\"alert\">\n <span>{conflict.message}</span>\n {conflict.theirs !== undefined && conflict.theirsVersion !== undefined && selected !== undefined && <div>\n <button type=\"button\" onClick={() => { resolveConflict(false); }}>\u8F7D\u5165\u78C1\u76D8\u7248\u672C</button>\n <button type=\"button\" onClick={() => { resolveConflict(true); }}>\u4FDD\u7559\u672C\u5730\u8349\u7A3F</button>\n </div>}\n </div>}\n {fileError !== undefined && <div className=\"oh-story-error\">{fileError}</div>}\n {selected === undefined\n ? <div className=\"oh-story-empty\">{workbench === \"story\"\n ? <>\u5F53\u524D workspace \u8FD8\u6CA1\u6709\u5C0F\u8BF4\u6587\u4EF6\u3002\u53EF\u5728\u53F3\u4FA7 Chat \u4E2D\u8FD0\u884C <code>/story-setup</code>\u3002</>\n : <>\u5F53\u524D workspace \u8FD8\u6CA1\u6709\u77ED\u5267\u9879\u76EE\u3002\u53EF\u5728\u53F3\u4FA7 Chat \u4E2D\u8FD0\u884C <code>/short-drama</code>\u3002</>}</div>\n : selectedMedia && selectedFile !== undefined\n ? <div className=\"oh-story-media-document\">{selectedFile.mimeType?.startsWith(\"image/\") === true\n ? <img src={endpoint(\"media\", sessionId, selectedFile.path)} alt={selectedFile.path} />\n : selectedFile.mimeType?.startsWith(\"audio/\") === true\n ? <audio src={endpoint(\"media\", sessionId, selectedFile.path)} controls />\n : <video src={endpoint(\"media\", sessionId, selectedFile.path)} controls preload=\"metadata\" />}</div>\n : buffer === undefined\n ? <div className=\"oh-story-empty\">\u6B63\u5728\u52A0\u8F7D {selected}\u2026</div>\n : buffer.missing === true\n ? <div className=\"oh-story-empty\">\u6587\u4EF6\u5DF2\u4ECE workspace \u79FB\u9664\uFF0C\u672C\u5730\u8349\u7A3F\u4ECD\u4FDD\u7559\u3002\u8BF7\u5148\u590D\u5236\u9700\u8981\u7684\u5185\u5BB9\uFF0C\u518D\u653E\u5F03\u8349\u7A3F\u3002<button type=\"button\" onClick={() => {\n setBuffers((current) => {\n const next = { ...current };\n delete next[selected];\n return next;\n });\n setSelected(workspace === undefined ? undefined : preferredWorkbenchFile(workspace.files, workbench));\n }}>\u653E\u5F03\u672C\u5730\u8349\u7A3F</button></div>\n : editorMode === \"production\" && productionAvailable && episodeProduction !== undefined\n ? <DramaProductionView\n sessionId={sessionId}\n production={episodeProduction}\n sessionRunning={sessionRunning}\n queue={productionQueue}\n section={productionSection}\n selectedId={productionSelectedId}\n jobs={productionJobs}\n versions={productionVersions}\n libraryVersions={productionLibrary}\n selections={productionSelections}\n manualReferences={productionReferences}\n sequence={productionSequence}\n canvas={productionCanvas}\n zoom={productionZoom}\n onSectionChange={setProductionSection}\n onSelect={setProductionSelectedId}\n onNavigate={navigateProductionTarget}\n onJobsChange={setProductionJobs}\n onSelectionsChange={setProductionSelections}\n onManualReferencesChange={setProductionReferences}\n onOpenMedia={(path) => { revealPath(path); }}\n onSequenceChange={setProductionSequence}\n onCanvasChange={setProductionCanvas}\n onZoomChange={setProductionZoom}\n onDispatchPrompt={sendProductionPrompt}\n onCancelTurn={cancelProduction}\n onRemoveQueued={removeQueuedProduction}\n onRefresh={reload}\n />\n : previewable && editorMode === \"preview\"\n ? markdown\n ? <MarkdownPreview content={buffer.content} label={selected} />\n : <JsonlPreview content={buffer.content} label={selected} />\n : <textarea\n ref={textareaRef}\n value={buffer.content}\n data-format={structured ? \"structured\" : \"prose\"}\n onBlur={rememberEditorPosition}\n onScroll={rememberEditorPosition}\n onSelect={rememberEditorPosition}\n onChange={(event) => {\n const content = event.target.value;\n setBuffers((current) => ({\n ...current,\n [selected]: {\n content,\n saved: current[selected]?.saved ?? \"\",\n source: \"human\",\n version: current[selected]?.version ?? \"\",\n conflict: current[selected]?.conflict,\n saving: current[selected]?.saving\n }\n }));\n }}\n spellCheck={!structured}\n aria-label={selected}\n />}\n </main>\n </>}\n </div>;\n}\n\ninterface ProductionConversationFace {\n readonly sendProductionPrompt: (prompt: string) => Promise<void>;\n readonly cancelProduction: () => Promise<void>;\n readonly removeQueuedProduction: (itemId: string) => Promise<void>;\n}\n\ntype WorkbenchSlotProps = PropsRuntime<\"oh-story.workspace\"> & PropsStore<ReturnType<typeof createWorkbenchStore>> & ProductionConversationFace;\n\n/** Mount beside the official conversation without replacing Chat or Composer. */\nfunction CreativeSplitBridge({ sessionId, useSession, useChat, useStore, actions, sendProductionPrompt, cancelProduction, removeQueuedProduction }: WorkbenchSlotProps) {\n const marker = useRef<HTMLSpanElement>(null);\n const [target, setTarget] = useState<HTMLElement>();\n const runningCalls = useChat((snapshot) => snapshot.legacy.runningCalls);\n const partial = useChat((snapshot) => streamingAssistant(snapshot.timeline));\n const settledMutation = useChat((snapshot) => latestSettledMutation(snapshot));\n const workbench = useStore((memory) => memory.workbench);\n const gamePane = useStore((memory) => memory.gamePane);\n const videoPane = useStore((memory) => memory.videoPane);\n const sessionRunning = useSession((snapshot) => snapshot.running);\n const productionQueue = useSession((snapshot) => snapshot.queue.map((item) => ({ id: item.id, preview: item.preview })));\n const chat = useChat((snapshot) => snapshot);\n const productionIntents = useMemo(() => settledProductionIntents(chat), [chat]);\n const { workspace, error, loading: workspaceLoading, reload } = useWorkspace(sessionId);\n const chosenPreference = useStore((memory) => memory.workbenchPreference);\n const creativeProject = hasCreativeProject(workspace);\n // The Session Store holds this Session's choice; localStorage carries the workspace's\n // last choice across restarts. Reading it here keeps the decision in the same render\n // that learns the workspace, so a collapsed workbench never flashes the layout open.\n const storedPreference = useMemo(\n () => readWorkbenchPreference(workbenchPreferenceStorage(), workspace?.cwd),\n [workspace?.cwd]\n );\n const preference = chosenPreference ?? storedPreference;\n const open = resolveWorkbenchOpen(preference, creativeProject);\n useLayoutEffect(() => {\n const document = marker.current?.ownerDocument;\n if (document === undefined) return;\n const locate = (): void => {\n const anchor = document.querySelector<HTMLElement>(\"[data-conversation-scroll] > [data-slot='conversation.session']\");\n setTarget((current) => current === anchor ? current : anchor ?? undefined);\n };\n locate();\n const observer = new MutationObserver(locate);\n observer.observe(document.body, { childList: true, subtree: true });\n return () => { observer.disconnect(); };\n }, [sessionId]);\n useLayoutEffect(() => {\n const scroller = target?.parentElement;\n if (scroller === undefined || scroller === null) return;\n if (!open) {\n // A collapsed workbench returns the conversation to DSH untouched, so the only\n // measurement left is where that column sits: the launcher floats over its corner.\n const publishSeam = (): void => {\n const box = scroller.getBoundingClientRect();\n scroller.style.setProperty(\"--oh-story-seam-top\", `${String(box.top)}px`);\n scroller.style.setProperty(\"--oh-story-seam-right\", `${String(scroller.ownerDocument.documentElement.clientWidth - box.right)}px`);\n };\n publishSeam();\n const seams = new ResizeObserver(publishSeam);\n seams.observe(scroller);\n const view = scroller.ownerDocument.defaultView;\n view?.addEventListener(\"resize\", publishSeam);\n return () => {\n seams.disconnect();\n view?.removeEventListener(\"resize\", publishSeam);\n scroller.style.removeProperty(\"--oh-story-seam-top\");\n scroller.style.removeProperty(\"--oh-story-seam-right\");\n };\n }\n const composerSeat = (): HTMLElement | null => scroller.querySelector(\":scope > [data-composer-seat]\");\n // The seat overlaps the Chat column here, so a reader parked at the tail has\n // to be carried across every layout pass; losing the tail does not merely\n // scroll it out of sight, it leaves the last lines behind the Composer.\n // Being parked cannot be read inside the pass \u2014 a reflow moves the tail\n // before the observer runs \u2014 and it cannot be read from scroll events alone\n // either: the Chat settles over several frames after a resize and every one\n // of those frames scrolls without the reader asking. So only a scroll the\n // reader actually drove releases the tail; reaching the bottom always\n // reclaims it.\n const parkedAtTail = (): boolean => scroller.scrollHeight - scroller.scrollTop - scroller.clientHeight <= 8;\n let parked = parkedAtTail();\n let drivenAt = 0;\n const markDriven = (event: Event): void => {\n if (event.target instanceof Node && composerSeat()?.contains(event.target) === true) return;\n // A button click (for example switching the editor preview) is not a\n // scrollbar drag. Its subsequent reflow must not release the Chat tail.\n if (event.type === \"pointerdown\" && event.target !== scroller) return;\n drivenAt = performance.now();\n };\n const trackParked = (): void => {\n if (parkedAtTail()) parked = true;\n else if (performance.now() - drivenAt < 400) parked = false;\n };\n const publishLayout = (): void => {\n scroller.style.setProperty(\"--oh-story-scroll-height\", `${String(scroller.clientHeight)}px`);\n // DSH 0.1.2 grows the seat with the streaming Todo panel while\n // --dsh-composer-height keeps reporting the bare input height. Publish the\n // measurement beside it rather than over it: the CSS takes the larger, so\n // writing the variable DSH also owns can never turn into a resize duel.\n scroller.style.setProperty(\"--oh-story-composer-height\", `${String(composerSeat()?.getBoundingClientRect().height ?? 0)}px`);\n scroller.dataset.ohStoryWorkbench = workbench;\n const studioPane = workbench === \"video\" ? videoPane : gamePane;\n scroller.dataset.ohStudioPane = studioPane;\n const compactAt = workbench === \"game\" || workbench === \"video\" ? 720 : 620;\n const mediumAt = workbench === \"game\" || workbench === \"video\" ? 960 : 900;\n const layout = scroller.clientWidth < compactAt ? \"compact\" : scroller.clientWidth < mediumAt ? \"medium\" : \"wide\";\n if (scroller.dataset.ohStoryLayout !== layout) scroller.dataset.ohStoryLayout = layout;\n if (parked) scroller.scrollTop = scroller.scrollHeight - scroller.clientHeight;\n };\n const observer = new ResizeObserver(publishLayout);\n const observed = new WeakSet<Element>();\n // The official seat and Chat flow mount and remount independently of this\n // bridge. The flow is observed because a resized Chat keeps re-wrapping for\n // several frames afterwards: pinning once against the height the first frame\n // reports leaves the reader behind the Composer again once it settles.\n let flowObserved = false;\n const observePanes = (): void => {\n const flow = scroller.querySelector(\"[data-chat-flow]\");\n flowObserved = flow !== null;\n for (const pane of [composerSeat(), flow]) {\n if (pane === null || observed.has(pane)) continue;\n observed.add(pane);\n observer.observe(pane);\n }\n };\n publishLayout();\n scroller.addEventListener(\"scroll\", trackParked, { passive: true });\n for (const driven of [\"wheel\", \"touchmove\", \"pointerdown\", \"keydown\"]) {\n scroller.addEventListener(driven, markDriven, { passive: true });\n }\n observer.observe(scroller);\n observePanes();\n const seats = new MutationObserver(() => { observePanes(); publishLayout(); });\n seats.observe(scroller, { childList: true });\n // The flow mounts below the seat's level, and streaming mutates it token by\n // token: watch the subtree only until it has been found once.\n const panes = new MutationObserver(() => { if (!flowObserved) observePanes(); });\n panes.observe(scroller, { childList: true, subtree: true });\n return () => {\n panes.disconnect();\n scroller.removeEventListener(\"scroll\", trackParked);\n for (const driven of [\"wheel\", \"touchmove\", \"pointerdown\", \"keydown\"]) {\n scroller.removeEventListener(driven, markDriven);\n }\n observer.disconnect();\n seats.disconnect();\n scroller.style.removeProperty(\"--oh-story-scroll-height\");\n scroller.style.removeProperty(\"--oh-story-composer-height\");\n delete scroller.dataset.ohStoryLayout;\n delete scroller.dataset.ohStoryWorkbench;\n delete scroller.dataset.ohStudioPane;\n };\n }, [gamePane, open, target, videoPane, workbench]);\n return <>\n <span ref={marker} className=\"oh-story-bridge-marker\" aria-hidden />\n {target === undefined ? null : createPortal(<CreativeWorkbench\n sessionId={sessionId}\n runningCalls={runningCalls}\n partial={partial}\n settledMutation={settledMutation}\n sessionRunning={sessionRunning}\n productionQueue={productionQueue}\n productionIntents={productionIntents}\n workspace={workspace}\n error={error}\n workspaceLoading={workspaceLoading}\n reload={reload}\n open={open}\n creativeProject={creativeProject}\n sendProductionPrompt={sendProductionPrompt}\n cancelProduction={cancelProduction}\n removeQueuedProduction={removeQueuedProduction}\n useStore={useStore}\n actions={actions}\n />, target)}\n </>;\n}\n\ntype WorkbenchSeatProps = PropsRuntime<\"shell.overlay\"> & PropsRenderSlots<\"oh-story.workspace\">;\n\n/** The session-scoped workbench cannot mount on a fresh DSH home page. */\nfunction WorkbenchWelcome() {\n const marker = useRef<HTMLSpanElement>(null);\n const [target, setTarget] = useState<HTMLElement>();\n useLayoutEffect(() => {\n const document = marker.current?.ownerDocument;\n if (document === undefined) return;\n const locate = (): void => {\n const anchor = document.querySelector<HTMLElement>(\"[data-conversation-scroll]\");\n setTarget((current) => current === anchor ? current : anchor ?? undefined);\n };\n locate();\n const observer = new MutationObserver(locate);\n observer.observe(document.body, { childList: true, subtree: true });\n return () => { observer.disconnect(); };\n }, []);\n return <>\n <style>{styles}</style>\n <span ref={marker} className=\"oh-story-bridge-marker\" aria-hidden />\n {target === undefined ? null : createPortal(<section className=\"oh-story-welcome\" aria-label=\"Oh Story \u4F7F\u7528\u5F15\u5BFC\">\n <h2>Oh Story \u5DF2\u52A0\u8F7D</h2>\n <p>\u4F5C\u54C1\u76EE\u5F55\u4E2D\u6709\u521B\u4F5C\u6587\u4EF6\u65F6\uFF0C\u5C0F\u8BF4\u3001\u77ED\u5267\u3001\u6E38\u620F\u3001\u89C6\u9891\u5DE5\u4F5C\u53F0\u4F1A\u81EA\u52A8\u663E\u793A\u3002</p>\n <ol>\n <li>\u70B9\u51FB\u5DE6\u4FA7\u300C\u6DFB\u52A0\u5DE5\u4F5C\u533A / Add workspace\u300D\u7684 \uFF0B\uFF0C\u9009\u62E9\u5B58\u653E\u4F5C\u54C1\u7684\u6587\u4EF6\u5939\u3002</li>\n <li>\u5728\u4E0B\u65B9\u300C\u9009\u62E9\u5DE5\u4F5C\u533A / Choose workspace\u300D\u4E2D\u9009\u4E2D\u8BE5\u76EE\u5F55\uFF0C\u6216\u6253\u5F00\u5DF2\u6709\u4F1A\u8BDD\u3002</li>\n <li>\u7A7A\u76EE\u5F55\u5148\u5728 Chat \u4E2D\u5F00\u59CB\u521B\u4F5C\uFF0C\u751F\u6210\u7B2C\u4E00\u4E2A\u521B\u4F5C\u6587\u4EF6\u540E\uFF0C\u5DE5\u4F5C\u53F0\u4F1A\u81EA\u52A8\u51FA\u73B0\u3002</li>\n </ol>\n <p>\u67E5\u770B\u5DF2\u6709\u4F5C\u54C1\u65E0\u9700 API Key\u3002\u5F00\u59CB AI \u521B\u4F5C\u524D\uFF0C\u5728\u300C\u8BBE\u7F6E \u2192 \u6A21\u578B\u300D\u914D\u7F6E\u6A21\u578B\uFF0C\u518D\u8F93\u5165 <code>/story</code>\u3001<code>/short-drama</code>\u3001<code>/novel-to-game quick</code> \u6216 <code>/video-recap</code>\u3002</p>\n </section>, target)}\n </>;\n}\n\nfunction WorkbenchSeat({ SessionProvider, renderSlot }: WorkbenchSeatProps) {\n return <SessionProvider empty={() => <WorkbenchWelcome />}>{renderSlot(\"oh-story.workspace\", {})}</SessionProvider>;\n}\n\nfunction argsOf(block: ToolCallViewProps[\"block\"]): Record<string, unknown> {\n const raw = (\"kind\" in block ? block.call?.argsRaw : block.argsRaw) ?? \"{}\";\n try {\n const value = JSON.parse(raw) as unknown;\n return typeof value === \"object\" && value !== null && !Array.isArray(value) ? value as Record<string, unknown> : {};\n } catch { return {}; }\n}\n\nfunction resultOf(block: ToolCallViewProps[\"block\"]): string | undefined {\n if (!(\"kind\" in block)) return undefined;\n return block.content.map((item) => item.type === \"text\" ? item.text : JSON.stringify(item, null, 2)).join(\"\\n\");\n}\n\nfunction RoleToolView({ block, inspect }: ToolCallViewProps) {\n const args = argsOf(block);\n const role = typeof args.role === \"string\" ? args.role : \"story-role\";\n const output = resultOf(block);\n const state = !(\"kind\" in block) ? \"running\" : block.isError ? \"error\" : \"done\";\n return <details className=\"oh-story-role\" data-state={state}>\n <style>{styles}</style>\n <summary><span>\u2726 Role</span><strong>{role}</strong><em>{state === \"running\" ? \"\u8FD0\u884C\u4E2D\" : state === \"error\" ? \"\u5931\u8D25\" : \"\u5B8C\u6210\"}</em></summary>\n {output !== undefined && <pre>{output}</pre>}\n {inspect !== undefined && <button type=\"button\" onClick={inspect}>\u5728\u8F68\u8FF9\u4E2D\u68C0\u67E5</button>}\n </details>;\n}\n\nfunction ProductionToolView({ block, inspect }: ToolCallViewProps) {\n const args = argsOf(block);\n const action = typeof args.action === \"string\" ? args.action : \"production\";\n const episode = typeof args.episode === \"string\" ? args.episode : \"\u77ED\u5267\";\n const state = !(\"kind\" in block) ? \"running\" : block.isError ? \"error\" : \"done\";\n return <details className=\"oh-story-role\" data-state={state}>\n <style>{styles}</style>\n <summary><span>\u25A6 \u751F\u4EA7</span><strong>{episode} \u00B7 {action}</strong><em>{state === \"running\" ? \"\u6267\u884C\u4E2D\" : state === \"error\" ? \"\u5931\u8D25\" : \"\u5DF2\u5E94\u7528\"}</em></summary>\n {resultOf(block) !== undefined && <pre>{resultOf(block)}</pre>}\n {inspect !== undefined && <button type=\"button\" onClick={inspect}>\u5728\u8F68\u8FF9\u4E2D\u68C0\u67E5</button>}\n </details>;\n}\n\n/** Register only official DSH surfaces; the split bridge never replaces Chat. */\nexport function apply(context: ClientContext): void {\n context.slots.inject(\"shell.overlay\", () => {\n const disposeSeat = context.slots.register({\n name: \"shell.overlay\",\n id: \"oh-story-workspace\",\n order: -100,\n children: { \"oh-story.workspace\": { kind: \"single\", scope: \"session\" } }\n }, WorkbenchSeat);\n const disposeWorkbench = context.slots.register({\n name: \"oh-story.workspace\",\n store: createWorkbenchStore,\n inject: (sessionId) => {\n const binding = (context.sessions as unknown as ISessions).binding(sessionId);\n const conversation = binding?.ctx.get(\"conversation\");\n if (binding === undefined || conversation === undefined) {\n return {\n sendProductionPrompt: () => Promise.reject(new Error(\"DSH \u4F1A\u8BDD\u5F53\u524D\u4E0D\u53EF\u7528\u3002\")),\n cancelProduction: () => Promise.reject(new Error(\"DSH \u4F1A\u8BDD\u5F53\u524D\u4E0D\u53EF\u7528\u3002\")),\n removeQueuedProduction: () => Promise.reject(new Error(\"DSH \u4F1A\u8BDD\u5F53\u524D\u4E0D\u53EF\u7528\u3002\"))\n };\n }\n return {\n sendProductionPrompt: (prompt: string) => conversation.send(prompt),\n cancelProduction: () => conversation.cancel(),\n removeQueuedProduction: (itemId: string) => conversation.updateQueue(itemId as Parameters<IConversation[\"updateQueue\"]>[0], { kind: \"remove\" })\n };\n }\n }, CreativeSplitBridge);\n return [disposeSeat, disposeWorkbench];\n });\n context.slots.inject(\"tool.call.toolview\", () => context.slots.register({\n name: \"tool.call.toolview\",\n key: \"oh_story_role\"\n }, RoleToolView));\n context.slots.inject(\"tool.call.toolview\", () => context.slots.register({\n name: \"tool.call.toolview\",\n key: OH_STORY_PRODUCTION_TOOL_NAME\n }, ProductionToolView));\n}\n\nexport default { name, inject, apply };\n", "import type { AssistantChatData, ChatSnapshot } from \"@deepseek-ai/dsh-client-ui-chat/client\";\nimport type {\n ConversationTimelineSnapshot,\n PartialAssistant,\n RunningToolCall,\n ToolCallBlock\n} from \"@deepseek-ai/dsh-client-ui-conversation/client\";\n\nexport type MutationToolName = \"write\" | \"edit\" | \"str_replace_editor\";\n\nexport interface FileMutationActivity {\n readonly callId: string;\n readonly name: MutationToolName;\n readonly argsRaw: string;\n readonly stage: \"streaming\" | \"running\";\n readonly path: string | undefined;\n readonly operation: \"replace-file\" | \"replace-text\" | \"insert-text\" | undefined;\n readonly oldText: string | undefined;\n readonly newText: string | undefined;\n readonly replaceAll: boolean;\n}\n\ninterface JsonStringPrefix {\n readonly value: string;\n readonly complete: boolean;\n}\n\nexport type WorkbenchMode = \"story\" | \"drama\" | \"game\" | \"video\";\n\nconst WORKBENCH_LABELS: Readonly<Record<WorkbenchMode, string>> = {\n story: \"\u5C0F\u8BF4\",\n drama: \"\u77ED\u5267\",\n game: \"\u6E38\u620F\",\n video: \"\u89C6\u9891\"\n};\n\nexport function workbenchLabel(mode: WorkbenchMode): string {\n return WORKBENCH_LABELS[mode];\n}\n\nexport interface WorkspaceFilePath {\n readonly path: string;\n}\n\nconst STORY_DIRECTORIES = new Set([\"\u6B63\u6587\", \"\u5927\u7EB2\", \"\u8BBE\u5B9A\", \"\u8FFD\u8E2A\", \"\u5BF9\u6807\", \"\u53C2\u8003\u8D44\u6599\"]);\nconst DRAMA_DIRECTORIES = new Set([\"\u8F93\u5165\", \"\u9879\u76EE\u5F00\u53D1\", \"\u8BBE\u5B9A\u96C6\", \"\u5267\u96C6\", \"\u4EA4\u4ED8\", \"\u521B\u4F5C\u8005\u51B3\u7B56\", \"\u5BA1\u67E5\"]);\nconst GAME_DIRECTORY = \"game-adaptations\";\nconst VIDEO_DIRECTORY = \"video-recaps\";\nconst EDITABLE_EXTENSION = /\\.(?:md|txt|json|jsonl|html|css|[cm]?js|tsx?|jsx)$/iu;\nconst MUTATING_CALLS = new Set([\"write\", \"edit\", \"str_replace_editor\", \"bash\", \"run_code\", \"oh_story_role\"]);\n\n/** Read the latest running Assistant step, including tool-only steps hidden from the Chat list. */\nexport function streamingAssistant(timeline: ConversationTimelineSnapshot): PartialAssistant | null {\n for (const turnNumber of timeline.turnOrder.toReversed()) {\n const turn = timeline.turns.get(turnNumber);\n if (turn === undefined) continue;\n for (const step of turn.steps.toReversed()) {\n const assistant: AssistantChatData | undefined = step.data.get(\"assistant-step\");\n if (assistant?.status === \"running\") return assistant;\n }\n }\n return null;\n}\n\nfunction decodeEscape(character: string): string | undefined {\n switch (character) {\n case \"\\\"\": return \"\\\"\";\n case \"\\\\\": return \"\\\\\";\n case \"/\": return \"/\";\n case \"b\": return \"\\b\";\n case \"f\": return \"\\f\";\n case \"n\": return \"\\n\";\n case \"r\": return \"\\r\";\n case \"t\": return \"\\t\";\n default: return undefined;\n }\n}\n\n/** Read a JSON string even while the model is still streaming its closing quote. */\nexport function jsonStringPrefix(raw: string, key: string): JsonStringPrefix | undefined {\n const match = new RegExp(`\"${key.replace(/[.*+?^${}()|[\\]\\\\]/gu, \"\\\\$&\")}\"\\\\s*:\\\\s*\"`, \"u\").exec(raw);\n if (match === null) return undefined;\n let value = \"\";\n for (let index = match.index + match[0].length; index < raw.length; index += 1) {\n const character = raw[index] ?? \"\";\n if (character === \"\\\"\") return { value, complete: true };\n if (character !== \"\\\\\") { value += character; continue; }\n const escape = raw[index + 1];\n if (escape === undefined) return { value, complete: false };\n if (escape === \"u\") {\n const hex = raw.slice(index + 2, index + 6);\n if (!/^[\\da-f]{4}$/iu.test(hex)) return { value, complete: false };\n value += String.fromCharCode(Number.parseInt(hex, 16));\n index += 5;\n continue;\n }\n const decoded = decodeEscape(escape);\n if (decoded === undefined) return { value, complete: false };\n value += decoded;\n index += 1;\n }\n return { value, complete: false };\n}\n\nfunction completedString(raw: string, key: string): string | undefined {\n const value = jsonStringPrefix(raw, key);\n return value?.complete === true ? value.value : undefined;\n}\n\nfunction parsedArgs(raw: string): Record<string, unknown> | undefined {\n try {\n const value = JSON.parse(raw) as unknown;\n return typeof value === \"object\" && value !== null && !Array.isArray(value) ? value as Record<string, unknown> : undefined;\n } catch { return undefined; }\n}\n\nfunction mutationFromArgs(name: string, callId: string, argsRaw: string, stage: FileMutationActivity[\"stage\"]): FileMutationActivity | undefined {\n const complete = parsedArgs(argsRaw);\n if (name === \"write\") {\n return {\n callId, name, argsRaw, stage,\n path: jsonStringPrefix(argsRaw, \"file_path\")?.value,\n operation: \"replace-file\",\n oldText: undefined,\n newText: jsonStringPrefix(argsRaw, \"content\")?.value,\n replaceAll: false\n };\n }\n if (name === \"edit\") {\n return {\n callId, name, argsRaw, stage,\n path: jsonStringPrefix(argsRaw, \"file_path\")?.value,\n operation: \"replace-text\",\n oldText: completedString(argsRaw, \"old_string\"),\n newText: jsonStringPrefix(argsRaw, \"new_string\")?.value,\n replaceAll: complete?.replace_all === true\n };\n }\n if (name !== \"str_replace_editor\") return undefined;\n const command = completedString(argsRaw, \"command\");\n if (command === \"view\") return undefined;\n const path = jsonStringPrefix(argsRaw, \"path\")?.value;\n if (command === \"create\") {\n return {\n callId, name, argsRaw, stage, path,\n operation: \"replace-file\",\n oldText: undefined,\n newText: jsonStringPrefix(argsRaw, \"file_text\")?.value,\n replaceAll: false\n };\n }\n if (command === \"str_replace\") {\n return {\n callId, name, argsRaw, stage, path,\n operation: \"replace-text\",\n oldText: completedString(argsRaw, \"old_str\"),\n newText: jsonStringPrefix(argsRaw, \"new_str\")?.value ?? (complete !== undefined ? \"\" : undefined),\n replaceAll: complete?.replace_all === true\n };\n }\n if (command === \"insert\") {\n return {\n callId, name, argsRaw, stage, path,\n operation: \"insert-text\",\n oldText: undefined,\n newText: jsonStringPrefix(argsRaw, \"new_str\")?.value,\n replaceAll: false\n };\n }\n return { callId, name, argsRaw, stage, path, operation: undefined, oldText: undefined, newText: undefined, replaceAll: false };\n}\n\nfunction visitRunning(blocks: readonly ToolCallBlock[], visit: (call: RunningToolCall) => void): void {\n for (const block of blocks) {\n if (!(\"kind\" in block)) visit(block);\n visitRunning(block.subCalls, visit);\n }\n}\n\n/** Return every active file mutation in official DSH dispatch order, including nested Code Mode calls. */\nexport function fileMutations(\n runningCalls: readonly RunningToolCall[],\n partial: PartialAssistant | null = null\n): FileMutationActivity[] {\n const values: FileMutationActivity[] = [];\n visitRunning(runningCalls, (call) => {\n const mutation = mutationFromArgs(call.name, call.callId, call.argsRaw, \"running\");\n if (mutation !== undefined) values.push(mutation);\n });\n for (const block of partial?.blocks ?? []) {\n if (block.kind !== \"tool-call\") continue;\n const value = mutationFromArgs(block.name, block.callId, block.argsRaw, \"streaming\");\n if (value !== undefined && !values.some((candidate) => candidate.callId === value.callId)) values.push(value);\n }\n return values;\n}\n\n/** Running calls whose settlement may have changed creative files. */\nexport function mutatingCallIds(runningCalls: readonly RunningToolCall[]): ReadonlySet<string> {\n const ids = new Set<string>();\n visitRunning(runningCalls, (call) => { if (MUTATING_CALLS.has(call.name)) ids.add(call.callId); });\n return ids;\n}\n\nfunction settledMutationSignals(block: ToolCallBlock): string[] {\n const nested = block.subCalls.flatMap(settledMutationSignals);\n if (!(\"kind\" in block) || block.isError) return nested;\n if (block.call === null) return nested;\n const mutation = mutationFromArgs(block.call.name, block.callId, block.call.argsRaw, \"running\");\n return mutation?.path === undefined ? nested : [`${block.callId}\\0${mutation.path}`, ...nested];\n}\n\n/** Latest durable successful mutation, used when a fast call skips the live render window. */\nexport function latestSettledMutation(chat: ChatSnapshot): string | undefined {\n for (const key of chat.order.toReversed()) {\n const node = chat.nodes.get(key);\n if (node?.kind !== \"tool-call\") continue;\n const root = (node.data as { readonly root?: ToolCallBlock }).root;\n const signal = root === undefined ? undefined : settledMutationSignals(root).at(-1);\n if (signal !== undefined) return signal;\n }\n return undefined;\n}\n\n/** Convert a DSH tool path to the creative-relative path accepted by the narrow route. */\nexport function creativeRelativePath(path: string | undefined, cwd: string | undefined): string | undefined {\n if (path === undefined || path === \"\") return undefined;\n const normalized = path.replaceAll(\"\\\\\", \"/\");\n const root = cwd?.replaceAll(\"\\\\\", \"/\").replace(/\\/$/u, \"\");\n const insideRoot = root !== undefined && normalized.startsWith(`${root}/`);\n if ((normalized.startsWith(\"/\") || /^[a-z]:\\//iu.test(normalized) || normalized.startsWith(\"file:\")) && !insideRoot) return undefined;\n const relative = insideRoot ? normalized.slice(root.length + 1) : normalized.replace(/^\\.\\//u, \"\");\n const [directory] = relative.split(\"/\", 1);\n const creative = directory !== undefined && (STORY_DIRECTORIES.has(directory) || DRAMA_DIRECTORIES.has(directory) || directory === GAME_DIRECTORY || directory === VIDEO_DIRECTORY);\n if ((!creative && relative !== \"short-drama.json\") || !EDITABLE_EXTENSION.test(relative)) return undefined;\n if (relative.split(\"/\").some((part) => part === \"..\" || part === \".\" || part === \"\")) return undefined;\n return relative;\n}\n\nexport function workbenchModeForPath(path: string | undefined): WorkbenchMode | undefined {\n if (path === \"short-drama.json\") return \"drama\";\n const directory = path?.split(\"/\", 1)[0];\n if (directory !== undefined && STORY_DIRECTORIES.has(directory)) return \"story\";\n if (directory !== undefined && DRAMA_DIRECTORIES.has(directory)) return \"drama\";\n if (directory === GAME_DIRECTORY) return \"game\";\n if (directory === VIDEO_DIRECTORY) return \"video\";\n return undefined;\n}\n\n/** Choose the first useful document when a creative workbench opens. */\nexport function preferredWorkbenchFile(\n files: readonly WorkspaceFilePath[],\n mode: WorkbenchMode\n): string | undefined {\n const matching = files.filter((file) => workbenchModeForPath(file.path) === mode);\n const preferences = mode === \"story\"\n ? [/^\u6B63\u6587\\/.*\\.md$/u, /^\u5927\u7EB2\\/.*\\.md$/u, /\\.md$/u]\n : mode === \"drama\" ? [\n /^\u5267\u96C6\\/EP0*1\\/\u5267\u672C\\.md$/u,\n /^\u5267\u96C6\\/.*\\/\u5267\u672C\\.md$/u,\n /^\u5267\u96C6\\/EP0*1\\/screenplay\\.md$/iu,\n /^\u5267\u96C6\\/.*\\/screenplay\\.md$/iu,\n /^\u9879\u76EE\u5F00\u53D1\\/creative-brief\\.md$/u,\n /^\u8F93\u5165\\/.*\\.md$/u,\n /\\.md$/u,\n /^short-drama\\.json$/u\n ] : mode === \"game\" ? [\n /^game-adaptations\\/[^/]+\\/PRODUCT_BRIEF\\.md$/u,\n /^game-adaptations\\/[^/]+\\/design\\/GAME_DESIGN\\.md$/u,\n /^game-adaptations\\/[^/]+\\/qa\\/verification\\.json$/u,\n /^game-adaptations\\/[^/]+\\/build\\/app\\/index\\.html$/u,\n /\\.md$/u\n ] : [\n /^video-recaps\\/[^/]+\\/work\\/recap_story_plan\\.json$/u,\n /^video-recaps\\/[^/]+\\/work\\/narration\\.json$/u,\n /^video-recaps\\/[^/]+\\/work\\/assembly_manifest\\.json$/u\n ];\n for (const pattern of preferences) {\n const match = matching.find((file) => pattern.test(file.path));\n if (match !== undefined) return match.path;\n }\n return matching[0]?.path;\n}\n\n/** Project one streamed mutation over its immediate predecessor. */\nexport function previewMutation(activity: FileMutationActivity, base: string): string | undefined {\n if (activity.operation === \"replace-file\") return activity.newText;\n if (activity.operation === \"replace-text\") {\n if (activity.oldText === undefined || activity.newText === undefined || activity.oldText === \"\") return undefined;\n if (activity.replaceAll) return base.includes(activity.oldText) ? base.split(activity.oldText).join(activity.newText) : undefined;\n const at = base.indexOf(activity.oldText);\n return at < 0 ? undefined : `${base.slice(0, at)}${activity.newText}${base.slice(at + activity.oldText.length)}`;\n }\n if (activity.operation === \"insert-text\") {\n if (activity.newText === undefined) return undefined;\n const rawLine = /\"insert_line\"\\s*:\\s*(\\d+)/u.exec(activity.argsRaw)?.[1];\n if (rawLine === undefined) return undefined;\n const line = Number.parseInt(rawLine, 10);\n const parts = base.split(\"\\n\");\n const at = Math.max(0, Math.min(parts.length, line));\n parts.splice(at, 0, activity.newText);\n return parts.join(\"\\n\");\n }\n return undefined;\n}\n", "export interface FileTreeInput {\n readonly path: string;\n readonly bytes: number;\n}\n\nexport interface FileTreeFile {\n readonly kind: \"file\";\n readonly name: string;\n readonly path: string;\n readonly bytes: number;\n}\n\nexport interface FileTreeDirectory {\n readonly kind: \"directory\";\n readonly name: string;\n readonly path: string;\n readonly fileCount: number;\n readonly children: readonly FileTreeNode[];\n}\n\nexport type FileTreeNode = FileTreeFile | FileTreeDirectory;\n\ninterface MutableDirectory {\n readonly name: string;\n readonly path: string;\n readonly directories: Map<string, MutableDirectory>;\n readonly files: FileTreeFile[];\n}\n\nfunction directory(name: string, path: string): MutableDirectory {\n return { name, path, directories: new Map(), files: [] };\n}\n\nfunction compareNames(left: { readonly name: string }, right: { readonly name: string }): number {\n return left.name.localeCompare(right.name, \"zh-Hans-CN\", { numeric: true });\n}\n\nfunction freezeDirectory(value: MutableDirectory): FileTreeDirectory {\n const directories = [...value.directories.values()].map(freezeDirectory).sort(compareNames);\n const files = [...value.files].sort(compareNames);\n return {\n kind: \"directory\",\n name: value.name,\n path: value.path,\n fileCount: files.length + directories.reduce((sum, child) => sum + child.fileCount, 0),\n children: [...directories, ...files]\n };\n}\n\nexport function buildFileTree(files: readonly FileTreeInput[], group: string): readonly FileTreeNode[] {\n const root = directory(group, group);\n for (const file of files) {\n const relative = file.path.startsWith(`${group}/`) ? file.path.slice(group.length + 1) : file.path;\n const segments = relative.split(\"/\").filter((segment) => segment !== \"\");\n const name = segments.pop();\n if (name === undefined) continue;\n let parent = root;\n for (const segment of segments) {\n const path = `${parent.path}/${segment}`;\n const child = parent.directories.get(segment) ?? directory(segment, path);\n parent.directories.set(segment, child);\n parent = child;\n }\n parent.files.push({ kind: \"file\", name, path: file.path, bytes: file.bytes });\n }\n return freezeDirectory(root).children;\n}\n", "const TITLE_KEYS = [\n \"display_name\", \"title\", \"name\", \"shot_id\", \"scene_id\", \"episode_id\", \"character_id\",\n \"location_id\", \"view_id\", \"prop_id\", \"state_id\", \"decision_id\", \"occurrence_id\", \"record_id\", \"id\"\n] as const;\n\nexport interface JsonlRecord {\n readonly line: number;\n readonly raw: string;\n readonly value?: unknown;\n readonly title: string;\n readonly type?: string;\n readonly status?: string;\n readonly error?: string;\n}\n\nfunction objectRecord(value: unknown): Record<string, unknown> | undefined {\n return typeof value === \"object\" && value !== null && !Array.isArray(value) ? value as Record<string, unknown> : undefined;\n}\n\nfunction stringField(record: Record<string, unknown>, keys: readonly string[]): string | undefined {\n for (const key of keys) {\n const value = record[key];\n if (typeof value === \"string\" && value.trim() !== \"\") return value;\n }\n return undefined;\n}\n\nfunction metadata(value: unknown, line: number): Pick<JsonlRecord, \"title\" | \"type\" | \"status\"> {\n const record = objectRecord(value);\n if (record === undefined) return { title: typeof value === \"string\" ? value : JSON.stringify(value) ?? `\u7B2C ${String(line)} \u884C` };\n const type = stringField(record, [\"record_type\", \"type\", \"kind\"]);\n const acceptance = objectRecord(record.creator_acceptance);\n const status = stringField(record, [\"status\"]) ?? (acceptance === undefined ? undefined : stringField(acceptance, [\"status\"]));\n return {\n title: stringField(record, TITLE_KEYS) ?? `\u8BB0\u5F55 ${String(line)}`,\n ...(type === undefined ? {} : { type }),\n ...(status === undefined ? {} : { status })\n };\n}\n\nexport function parseJsonl(content: string): JsonlRecord[] {\n const records: JsonlRecord[] = [];\n const lines = content.replaceAll(\"\\r\\n\", \"\\n\").split(\"\\n\");\n for (const [index, raw] of lines.entries()) {\n if (raw.trim() === \"\") continue;\n try {\n const value = JSON.parse(raw) as unknown;\n records.push({ line: index + 1, raw, value, ...metadata(value, index + 1) });\n } catch (error) {\n records.push({\n line: index + 1,\n raw,\n title: `\u7B2C ${String(index + 1)} \u884C\u683C\u5F0F\u9519\u8BEF`,\n error: error instanceof Error ? error.message : String(error)\n });\n }\n }\n return records;\n}\n\nconst PREVIEW_LIMIT = 200;\n\nexport function JsonlPreview({ content, label }: { readonly content: string; readonly label: string }) {\n const records = parseJsonl(content);\n if (records.length === 0) return <div className=\"oh-story-markdown-empty\">\u8FD9\u4E2A JSONL \u6587\u4EF6\u8FD8\u662F\u7A7A\u7684\u3002</div>;\n const valid = records.filter((record) => record.error === undefined).length;\n const errors = records.length - valid;\n const visible = records.slice(0, PREVIEW_LIMIT);\n return <section className=\"oh-story-jsonl\" aria-label={`${label} \u7ED3\u6784\u5316\u9884\u89C8`}>\n <header className=\"oh-story-jsonl-summary\">\n <strong>{errors === 0 ? `${String(valid)} \u6761\u8BB0\u5F55` : `${String(valid)} \u6761\u6709\u6548\u8BB0\u5F55`}</strong>\n {errors > 0 && <span>{String(errors)} \u6761\u683C\u5F0F\u9519\u8BEF</span>}\n {records.length > PREVIEW_LIMIT && <span>\u4EC5\u663E\u793A\u524D {String(PREVIEW_LIMIT)} \u6761</span>}\n </header>\n <div className=\"oh-story-jsonl-records\">\n {visible.map((record) => record.error === undefined\n ? <details key={record.line} open={records.length <= 2}>\n <summary>\n <span>\u7B2C {String(record.line)} \u884C</span>\n <strong>{record.title}</strong>\n {record.type !== undefined && <code>{record.type}</code>}\n {record.status !== undefined && <em>{record.status}</em>}\n </summary>\n <pre><code>{JSON.stringify(record.value, null, 2)}</code></pre>\n </details>\n : <div className=\"oh-story-jsonl-error\" key={record.line} role=\"alert\">\n <strong>{record.title}</strong>\n <span>{record.error}</span>\n <pre>{record.raw}</pre>\n </div>)}\n </div>\n </section>;\n}\n", "import type { ReactNode } from \"react\";\n\nconst INLINE = /(`[^`\\n]+`|\\*\\*[^*\\n]+\\*\\*|~~[^~\\n]+~~|\\[[^\\]\\n]+\\]\\(https?:\\/\\/[^)\\s]+\\)|\\*[^*\\n]+\\*)/gu;\n\nfunction inline(source: string, key: string): ReactNode[] {\n const nodes: ReactNode[] = [];\n let cursor = 0;\n for (const match of source.matchAll(INLINE)) {\n const token = match[0];\n const index = match.index;\n if (index > cursor) nodes.push(source.slice(cursor, index));\n if (token.startsWith(\"`\")) nodes.push(<code key={`${key}-${String(index)}`}>{token.slice(1, -1)}</code>);\n else if (token.startsWith(\"**\")) nodes.push(<strong key={`${key}-${String(index)}`}>{token.slice(2, -2)}</strong>);\n else if (token.startsWith(\"~~\")) nodes.push(<del key={`${key}-${String(index)}`}>{token.slice(2, -2)}</del>);\n else if (token.startsWith(\"*\")) nodes.push(<em key={`${key}-${String(index)}`}>{token.slice(1, -1)}</em>);\n else {\n const link = /^\\[([^\\]]+)\\]\\((https?:\\/\\/[^)\\s]+)\\)$/u.exec(token);\n nodes.push(link === null ? token : <a key={`${key}-${String(index)}`} href={link[2]} target=\"_blank\" rel=\"noreferrer\">{link[1]}</a>);\n }\n cursor = index + token.length;\n }\n if (cursor < source.length) nodes.push(source.slice(cursor));\n return nodes;\n}\n\ntype Alignment = \"left\" | \"center\" | \"right\" | undefined;\ninterface ListItem { readonly text: string; readonly checked?: boolean }\n\nexport type MarkdownBlock =\n | { readonly kind: \"code\"; readonly lines: readonly string[]; readonly language?: string }\n | { readonly kind: \"heading\"; readonly text: string; readonly level: number }\n | { readonly kind: \"quote\"; readonly lines: readonly string[] }\n | { readonly kind: \"ul\" | \"ol\"; readonly items: readonly ListItem[]; readonly start?: number }\n | { readonly kind: \"table\"; readonly headers: readonly string[]; readonly rows: readonly (readonly string[])[]; readonly alignments: readonly Alignment[] }\n | { readonly kind: \"rule\" }\n | { readonly kind: \"paragraph\"; readonly lines: readonly string[] };\n\nfunction splitTableRow(line: string): string[] {\n let source = line.trim();\n if (source.startsWith(\"|\")) source = source.slice(1);\n if (source.endsWith(\"|\")) source = source.slice(0, -1);\n const cells: string[] = [];\n let cell = \"\";\n for (let index = 0; index < source.length; index += 1) {\n const character = source[index] ?? \"\";\n if (character === \"\\\\\" && source[index + 1] === \"|\") {\n cell += \"|\";\n index += 1;\n } else if (character === \"|\") {\n cells.push(cell.trim());\n cell = \"\";\n } else cell += character;\n }\n cells.push(cell.trim());\n return cells;\n}\n\nfunction tableAlignments(line: string): Alignment[] | undefined {\n const cells = splitTableRow(line);\n if (cells.length === 0 || !cells.every((cell) => /^:?-{3,}:?$/u.test(cell))) return undefined;\n return cells.map((cell) => {\n if (cell.startsWith(\":\") && cell.endsWith(\":\")) return \"center\";\n if (cell.endsWith(\":\")) return \"right\";\n if (cell.startsWith(\":\")) return \"left\";\n return undefined;\n });\n}\n\nfunction beginsBlock(lines: readonly string[], index: number): boolean {\n const line = lines[index] ?? \"\";\n return /^(`{3,}|~{3,})\\s*[\\w-]*\\s*$/u.test(line)\n || /^#{1,6}\\s+/u.test(line)\n || /^(?:-{3,}|\\*{3,}|_{3,})\\s*$/u.test(line)\n || /^>\\s?/u.test(line)\n || /^[-*+]\\s+/u.test(line)\n || /^\\d+[.)]\\s+/u.test(line)\n || (line.includes(\"|\") && tableAlignments(lines[index + 1] ?? \"\") !== undefined);\n}\n\nexport function parseMarkdownBlocks(markdown: string): MarkdownBlock[] {\n const lines = markdown.replaceAll(\"\\r\\n\", \"\\n\").split(\"\\n\");\n const result: MarkdownBlock[] = [];\n for (let index = 0; index < lines.length;) {\n const line = lines[index] ?? \"\";\n if (line.trim() === \"\") { index += 1; continue; }\n\n const fence = /^(`{3,}|~{3,})\\s*([\\w-]*)\\s*$/u.exec(line);\n if (fence !== null) {\n const marker = fence[1] ?? \"```\";\n const markerCharacter = marker[0] ?? \"`\";\n const closing = new RegExp(`^${markerCharacter}{${String(marker.length)},}\\\\s*$`, \"u\");\n const code: string[] = [];\n index += 1;\n while (index < lines.length && !closing.test(lines[index] ?? \"\")) { code.push(lines[index] ?? \"\"); index += 1; }\n if (index < lines.length) index += 1;\n result.push({ kind: \"code\", lines: code, ...(fence[2] === undefined || fence[2] === \"\" ? {} : { language: fence[2] }) });\n continue;\n }\n\n const heading = /^(#{1,6})\\s+(.+)$/u.exec(line);\n if (heading !== null) {\n result.push({ kind: \"heading\", text: heading[2] ?? \"\", level: heading[1]?.length ?? 1 });\n index += 1;\n continue;\n }\n if (/^(?:-{3,}|\\*{3,}|_{3,})\\s*$/u.test(line)) { result.push({ kind: \"rule\" }); index += 1; continue; }\n\n const alignments = line.includes(\"|\") ? tableAlignments(lines[index + 1] ?? \"\") : undefined;\n if (alignments !== undefined) {\n const headers = splitTableRow(line);\n const rows: string[][] = [];\n index += 2;\n while (index < lines.length && (lines[index] ?? \"\").includes(\"|\") && (lines[index] ?? \"\").trim() !== \"\") {\n rows.push(splitTableRow(lines[index] ?? \"\"));\n index += 1;\n }\n result.push({ kind: \"table\", headers, rows, alignments });\n continue;\n }\n\n if (/^>\\s?/u.test(line)) {\n const quote: string[] = [];\n while (index < lines.length && /^>\\s?/u.test(lines[index] ?? \"\")) {\n quote.push((lines[index] ?? \"\").replace(/^>\\s?/u, \"\"));\n index += 1;\n }\n result.push({ kind: \"quote\", lines: quote });\n continue;\n }\n\n const unordered = /^[-*+]\\s+(.+)$/u.exec(line);\n const ordered = /^(\\d+)[.)]\\s+(.+)$/u.exec(line);\n if (unordered !== null || ordered !== null) {\n const kind = unordered !== null ? \"ul\" : \"ol\";\n const items: ListItem[] = [];\n const pattern = kind === \"ul\" ? /^[-*+]\\s+(.+)$/u : /^\\d+[.)]\\s+(.+)$/u;\n const start = ordered === null ? undefined : Number(ordered[1]);\n while (index < lines.length) {\n const item = pattern.exec(lines[index] ?? \"\");\n if (item === null) break;\n const source = item[1] ?? \"\";\n const task = /^\\[([ xX])\\]\\s+(.+)$/u.exec(source);\n items.push(task === null ? { text: source } : { text: task[2] ?? \"\", checked: task[1]?.toLocaleLowerCase() === \"x\" });\n index += 1;\n }\n result.push({ kind, items, ...(start === undefined ? {} : { start }) });\n continue;\n }\n\n const paragraph: string[] = [line];\n index += 1;\n while (index < lines.length) {\n const next = lines[index] ?? \"\";\n if (next.trim() === \"\" || beginsBlock(lines, index)) break;\n paragraph.push(next);\n index += 1;\n }\n result.push({ kind: \"paragraph\", lines: paragraph });\n }\n return result;\n}\n\nfunction Heading({ block, blockKey }: { readonly block: Extract<MarkdownBlock, { readonly kind: \"heading\" }>; readonly blockKey: string }) {\n const children = inline(block.text, blockKey);\n switch (block.level) {\n case 1: return <h1>{children}</h1>;\n case 2: return <h2>{children}</h2>;\n case 3: return <h3>{children}</h3>;\n case 4: return <h4>{children}</h4>;\n case 5: return <h5>{children}</h5>;\n default: return <h6>{children}</h6>;\n }\n}\n\nexport function MarkdownPreview({ content, label }: { readonly content: string; readonly label: string }) {\n const parsed = parseMarkdownBlocks(content);\n if (parsed.length === 0) return <div className=\"oh-story-markdown-empty\">\u8FD9\u4E2A Markdown \u6587\u4EF6\u8FD8\u662F\u7A7A\u7684\u3002</div>;\n return <article className=\"oh-story-markdown\" aria-label={`${label} \u6E32\u67D3\u9884\u89C8`}>\n {parsed.map((block, index) => {\n const key = `block-${String(index)}`;\n if (block.kind === \"code\") return <pre key={key}><code data-language={block.language}>{block.lines.join(\"\\n\")}</code></pre>;\n if (block.kind === \"rule\") return <hr key={key} />;\n if (block.kind === \"quote\") return <blockquote key={key}>{block.lines.map((line, lineIndex) => <p key={`${key}-${String(lineIndex)}`}>{inline(line, `${key}-${String(lineIndex)}`)}</p>)}</blockquote>;\n if (block.kind === \"ul\" || block.kind === \"ol\") {\n const items = block.items.map((item, itemIndex) => <li key={`${key}-${String(itemIndex)}`} className={item.checked === undefined ? undefined : \"oh-story-task-item\"}>\n {item.checked === undefined ? null : <input type=\"checkbox\" checked={item.checked} readOnly disabled aria-label={item.checked ? \"\u5DF2\u5B8C\u6210\" : \"\u672A\u5B8C\u6210\"} />}\n {inline(item.text, `${key}-${String(itemIndex)}`)}\n </li>);\n return block.kind === \"ul\" ? <ul key={key}>{items}</ul> : <ol key={key} start={block.start}>{items}</ol>;\n }\n if (block.kind === \"table\") return <div className=\"oh-story-markdown-table\" key={key}>\n <table>\n <thead><tr>{block.headers.map((cell, cellIndex) => <th key={`${key}-h-${String(cellIndex)}`} style={{ textAlign: block.alignments[cellIndex] }}>{inline(cell, `${key}-h-${String(cellIndex)}`)}</th>)}</tr></thead>\n <tbody>{block.rows.map((row, rowIndex) => <tr key={`${key}-r-${String(rowIndex)}`}>{block.headers.map((_, cellIndex) => <td key={`${key}-r-${String(rowIndex)}-${String(cellIndex)}`} style={{ textAlign: block.alignments[cellIndex] }}>{inline(row[cellIndex] ?? \"\", `${key}-r-${String(rowIndex)}-${String(cellIndex)}`)}</td>)}</tr>)}</tbody>\n </table>\n </div>;\n if (block.kind === \"heading\") return <Heading key={key} block={block} blockKey={key} />;\n if (block.kind === \"paragraph\") return <p key={key}>{block.lines.map((line, lineIndex) => <span key={`${key}-${String(lineIndex)}`}>{lineIndex === 0 ? null : <br />}{inline(line, `${key}-${String(lineIndex)}`)}</span>)}</p>;\n return null;\n })}\n </article>;\n}\n", "export type DramaProductionSection = \"shots\" | \"assets\" | \"tasks\" | \"sequence\" | \"canvas\";\n\nexport type DramaAssetKind = \"character\" | \"scene\" | \"prop\" | \"state\" | \"unknown\";\nexport const PRODUCTION_PROTOCOL_VERSION = \"short-drama/v1\";\n\nexport interface DramaProductionDiagnostic {\n readonly severity: \"error\" | \"warning\";\n readonly code: string;\n readonly path: string;\n readonly offset: number;\n readonly line: number;\n readonly targetId?: string | undefined;\n readonly message: string;\n}\n\nexport interface DramaDocumentTarget {\n readonly path: string;\n readonly offset: number;\n readonly id: string;\n}\n\nexport interface DramaShot {\n readonly id: string;\n readonly title: string;\n readonly path: string;\n readonly offset: number;\n readonly source?: string | undefined;\n /** Screenplay scene IDs named by \u6765\u6E90, in document order; empty when the field names none. */\n readonly sceneIds: readonly string[];\n readonly durationSeconds?: number | undefined;\n readonly purpose?: string | undefined;\n readonly shotSpec?: string | undefined;\n readonly start?: string | undefined;\n readonly end?: string | undefined;\n readonly references: readonly string[];\n readonly keyframePrompt?: string | undefined;\n readonly motion?: DramaMotionPrompt | undefined;\n}\n\nexport interface DramaAsset {\n readonly id: string;\n readonly title: string;\n readonly kind: DramaAssetKind;\n readonly path: string;\n readonly offset: number;\n readonly purpose?: string | undefined;\n readonly reference?: string | undefined;\n readonly prompt?: string | undefined;\n readonly description?: string | undefined;\n}\n\nexport interface DramaMotionPrompt {\n readonly id: string;\n readonly title: string;\n readonly path: string;\n readonly offset: number;\n readonly shotId?: string | undefined;\n readonly durationSeconds?: number | undefined;\n readonly startFrame?: string | undefined;\n readonly end?: string | undefined;\n readonly prompt?: string | undefined;\n}\n\nexport interface DramaVisualAsset {\n readonly id: string;\n readonly title: string;\n readonly kind: DramaAssetKind;\n readonly path: string;\n readonly offset: number;\n readonly description: string;\n readonly stableId: boolean;\n readonly declaredId?: string | undefined;\n}\n\nexport interface DramaEpisodeProduction {\n readonly protocolVersion: typeof PRODUCTION_PROTOCOL_VERSION;\n readonly episodeDirectory: string;\n readonly shots: readonly DramaShot[];\n readonly assets: readonly DramaAsset[];\n readonly visualAssets: readonly DramaVisualAsset[];\n readonly motions: readonly DramaMotionPrompt[];\n readonly targets: ReadonlyMap<string, DramaDocumentTarget>;\n readonly documentPaths: readonly string[];\n readonly diagnostics: readonly DramaProductionDiagnostic[];\n}\n\ninterface MarkdownSection {\n readonly heading: string;\n readonly body: string;\n readonly offset: number;\n}\n\nconst CREATOR_DOCUMENT_NAMES = new Set([\"\u5267\u672C.md\", \"\u89C6\u89C9\u8BBE\u5B9A.md\", \"\u5206\u955C.md\", \"\u56FE\u7247\u63D0\u793A\u8BCD.md\", \"\u89C6\u9891\u63D0\u793A\u8BCD.md\"]);\n\nexport function episodeDirectoryForPath(path: string | undefined): string | undefined {\n if (path === undefined) return undefined;\n const match = /^(\u5267\u96C6\\/[^/]+)\\/[^/]+$/u.exec(path);\n return match?.[1];\n}\n\nexport function isCreatorDocumentPath(path: string): boolean {\n const directory = episodeDirectoryForPath(path);\n const name = path.split(\"/\").at(-1);\n return directory !== undefined && name !== undefined && CREATOR_DOCUMENT_NAMES.has(name);\n}\n\nexport function creatorDocumentPaths(files: readonly { readonly path: string }[], episodeDirectory: string): string[] {\n return files\n .map((file) => file.path)\n .filter((path) => path.startsWith(`${episodeDirectory}/`) && CREATOR_DOCUMENT_NAMES.has(path.slice(episodeDirectory.length + 1)))\n .sort((left, right) => creatorDocumentOrder(left) - creatorDocumentOrder(right) || left.localeCompare(right, \"zh-Hans-CN\"));\n}\n\nexport function parseEpisodeProduction(documents: Readonly<Record<string, string>>, episodeDirectory: string): DramaEpisodeProduction {\n const storyboardPath = `${episodeDirectory}/\u5206\u955C.md`;\n const imagePromptPath = `${episodeDirectory}/\u56FE\u7247\u63D0\u793A\u8BCD.md`;\n const videoPromptPath = `${episodeDirectory}/\u89C6\u9891\u63D0\u793A\u8BCD.md`;\n const visualPath = `${episodeDirectory}/\u89C6\u89C9\u8BBE\u5B9A.md`;\n const shots = parseStoryboard(storyboardPath, documents[storyboardPath] ?? \"\");\n const assets = parseImagePrompts(imagePromptPath, documents[imagePromptPath] ?? \"\");\n const motions = parseVideoPrompts(videoPromptPath, documents[videoPromptPath] ?? \"\");\n const visualAssets = parseVisualAssets(visualPath, documents[visualPath] ?? \"\");\n const motionByShot = new Map(motions.flatMap((motion) => motion.shotId === undefined ? [] : [[motion.shotId, motion] as const]));\n const linkedShots = shots.map((shot) => ({ ...shot, motion: motionByShot.get(shot.id) }));\n const targets = new Map<string, DramaDocumentTarget>();\n for (const item of [...linkedShots, ...assets, ...motions, ...visualAssets]) {\n targets.set(item.id, { path: item.path, offset: item.offset, id: item.id });\n }\n const screenplayPath = `${episodeDirectory}/\u5267\u672C.md`;\n for (const shot of linkedShots) {\n for (const id of sourceKeys(shot)) {\n const target = sectionTarget(screenplayPath, documents[screenplayPath] ?? \"\", id);\n if (target === undefined) continue;\n targets.set(id, target);\n }\n }\n const diagnostics = validateProductionProtocol({\n documents,\n episodeDirectory,\n shots: linkedShots,\n assets,\n visualAssets,\n motions\n });\n return {\n protocolVersion: PRODUCTION_PROTOCOL_VERSION,\n episodeDirectory,\n shots: linkedShots,\n assets,\n visualAssets,\n motions,\n targets,\n documentPaths: Object.keys(documents).filter((path) => path.startsWith(`${episodeDirectory}/`)),\n diagnostics\n };\n}\n\nexport function parseStoryboard(path: string, content: string): DramaShot[] {\n return levelTwoSections(content).flatMap((section) => {\n const match = /^(SHOT-[A-Z0-9-]+)\\s*(?:[\u00B7\uFF5C|]\\s*)?(.*)$/iu.exec(section.heading.trim());\n if (match === null || match[1] === undefined) return [];\n const fields = bulletFields(section.body);\n const id = match[1].toLocaleUpperCase();\n const source = firstField(fields, \"\u6765\u6E90\", \"\u573A\u6B21\");\n return [{\n id,\n title: match[2]?.trim() || id,\n path,\n offset: section.offset,\n source,\n sceneIds: sourceSceneIds(source),\n durationSeconds: seconds(firstField(fields, \"\u65F6\u957F\")),\n purpose: firstField(fields, \"\u76EE\u7684\", \"\u955C\u5934\u76EE\u7684\"),\n shotSpec: firstField(fields, \"\u666F\u522B/\u673A\u4F4D\", \"\u666F\u522B\", \"\u955C\u5934\u89C4\u683C\"),\n start: firstField(fields, \"\u8D77\u70B9\", \"\u8D77\u59CB\"),\n end: firstField(fields, \"\u7EC8\u70B9\", \"\u7ED3\u675F\"),\n references: splitReferences(firstField(fields, \"\u56FE\u7247\u63D0\u793A\u8BCD\u9879\", \"\u53C2\u8003\", \"\u5173\u8054\u8D44\u4EA7\")),\n keyframePrompt: quoteUnderHeading(section.body, \"\u51BB\u7ED3\u5173\u952E\u5E27\u63D0\u793A\u8BCD\")\n }];\n });\n}\n\nexport function parseImagePrompts(path: string, content: string): DramaAsset[] {\n return levelTwoSections(content).flatMap((section) => {\n const match = /^(IMG-[A-Z0-9-]+)\\s*(?:[\u00B7\uFF5C|]\\s*)?(.*)$/iu.exec(section.heading.trim());\n if (match === null || match[1] === undefined) return [];\n const fields = bulletFields(section.body);\n const id = match[1].toLocaleUpperCase();\n const title = match[2]?.trim() || id;\n return [{\n id,\n title,\n kind: inferAssetKind(`${id} ${title} ${firstField(fields, \"\u7528\u9014\") ?? \"\"}`),\n path,\n offset: section.offset,\n purpose: firstField(fields, \"\u7528\u9014\"),\n reference: firstField(fields, \"\u53C2\u8003\", \"\u53C2\u8003\u7EA6\u675F\"),\n prompt: quoteUnderHeading(section.body, \"\u53EF\u590D\u5236\u63D0\u793A\u8BCD\")\n }];\n });\n}\n\nexport function parseVideoPrompts(path: string, content: string): DramaMotionPrompt[] {\n return levelTwoSections(content).flatMap((section) => {\n const match = /^(MOTION-[A-Z0-9-]+)\\s*(?:[\u00B7\uFF5C|]\\s*)?(.*)$/iu.exec(section.heading.trim());\n if (match === null || match[1] === undefined) return [];\n const fields = bulletFields(section.body);\n const id = match[1].toLocaleUpperCase();\n const shotId = firstField(fields, \"\u5206\u955C\", \"\u955C\u5934\")?.match(/SHOT-[A-Z0-9-]+/iu)?.[0]?.toLocaleUpperCase();\n return [{\n id,\n title: match[2]?.trim() || id,\n path,\n offset: section.offset,\n shotId,\n durationSeconds: seconds(firstField(fields, \"\u65F6\u957F\")),\n startFrame: firstField(fields, \"\u8D77\u59CB\u5E27\", \"\u8D77\u70B9\"),\n end: firstField(fields, \"\u7EC8\u70B9\", \"\u7ED3\u675F\"),\n prompt: quoteUnderHeading(section.body, \"\u53EF\u590D\u5236\u63D0\u793A\u8BCD\")\n }];\n });\n}\n\nexport function parseVisualAssets(path: string, content: string): DramaVisualAsset[] {\n return levelTwoSections(content).flatMap((section) => {\n const match = /^(\u4EBA\u7269|\u89D2\u8272|\u9020\u578B|\u5730\u70B9|\u573A\u666F|\u9053\u5177|\u72B6\u6001)\\s*(?:[\u00B7\uFF5C|:]\\s*)?(.*)$/u.exec(section.heading.trim());\n if (match === null || match[1] === undefined) return [];\n const fields = bulletFields(section.body);\n const title = match[2]?.trim() || section.heading.trim();\n const declaredId = firstField(fields, \"ID\", \"\u8D44\u4EA7 ID\", \"\u8D44\u4EA7ID\")?.trim().toLocaleUpperCase();\n const stableId = declaredId !== undefined && /^VISUAL-[A-Z0-9-]+$/u.test(declaredId);\n const id = stableId ? declaredId : `VISUAL-${slug(`${match[1]}-${title}`)}`;\n return [{ id, title, kind: inferAssetKind(`${match[1]} ${title}`), path, offset: section.offset, description: section.body.trim(), stableId, declaredId }];\n });\n}\n\nfunction validateProductionProtocol(input: {\n readonly documents: Readonly<Record<string, string>>;\n readonly episodeDirectory: string;\n readonly shots: readonly DramaShot[];\n readonly assets: readonly DramaAsset[];\n readonly visualAssets: readonly DramaVisualAsset[];\n readonly motions: readonly DramaMotionPrompt[];\n}): DramaProductionDiagnostic[] {\n const diagnostics: DramaProductionDiagnostic[] = [];\n const add = (value: Omit<DramaProductionDiagnostic, \"line\">): void => {\n diagnostics.push({ ...value, line: lineAt(input.documents[value.path] ?? \"\", value.offset) });\n };\n const all = [...input.shots, ...input.assets, ...input.visualAssets, ...input.motions];\n const byId = new Map<string, typeof all>();\n for (const item of all) byId.set(item.id, [...(byId.get(item.id) ?? []), item]);\n for (const [id, items] of byId) {\n if (items.length < 2) continue;\n for (const item of items) add({ severity: \"error\", code: \"duplicate_id\", path: item.path, offset: item.offset, targetId: id, message: `${id} \u5728\u5F53\u524D\u96C6\u5185\u91CD\u590D\uFF0C\u540E\u51FA\u73B0\u7684\u6761\u76EE\u4F1A\u906E\u853D\u524D\u4E00\u6761\u3002` });\n }\n\n for (const visual of input.visualAssets) {\n if (visual.stableId) continue;\n add(visual.declaredId === undefined\n ? { severity: \"warning\", code: \"generated_visual_id\", path: visual.path, offset: visual.offset, targetId: visual.id, message: `${visual.title} \u7F3A\u5C11\u7A33\u5B9A\u7684 \u201C- ID\uFF1AVISUAL-*\u201D\uFF1B\u4FEE\u6539\u6807\u9898\u4F1A\u6539\u53D8\u753B\u5E03\u8282\u70B9\u8EAB\u4EFD\u3002` }\n : { severity: \"warning\", code: \"invalid_visual_id\", path: visual.path, offset: visual.offset, targetId: visual.id, message: `${visual.title} \u7684 \u201C- ID\uFF1A${visual.declaredId}\u201D \u4E0D\u662F\u53EF\u7528\u5F62\u5F0F\uFF0C\u5DF2\u56DE\u9000\u5230\u6807\u9898\u6D3E\u751F ID\uFF1B\u8BF7\u5199\u6210 VISUAL- \u52A0\u5927\u5199\u5B57\u6BCD\u3001\u6570\u5B57\u6216\u8FDE\u5B57\u7B26\u3002` });\n }\n\n const knownReferences = new Set([...input.assets, ...input.visualAssets, ...input.shots, ...input.motions].map((item) => item.id));\n const screenplayPath = `${input.episodeDirectory}/\u5267\u672C.md`;\n for (const shot of input.shots) {\n for (const reference of shot.references) {\n if (!knownReferences.has(reference)) add({ severity: \"warning\", code: \"unknown_reference\", path: shot.path, offset: shot.offset, targetId: shot.id, message: `${shot.id} \u5F15\u7528\u4E86\u672A\u89E3\u6790\u7684 ${reference}\u3002` });\n }\n for (const id of sourceKeys(shot)) {\n if (sectionTarget(screenplayPath, input.documents[screenplayPath] ?? \"\", id) === undefined) {\n add({ severity: \"warning\", code: \"unknown_source\", path: shot.path, offset: shot.offset, targetId: shot.id, message: `${shot.id} \u7684\u6765\u6E90 ${id} \u5728\u5267\u672C\u4E2D\u4E0D\u5B58\u5728\u3002` });\n }\n }\n }\n\n const shots = new Set(input.shots.map((shot) => shot.id));\n const motionsByShot = new Map<string, DramaMotionPrompt[]>();\n for (const motion of input.motions) {\n if (motion.shotId === undefined) {\n add({ severity: \"warning\", code: \"motion_without_shot\", path: motion.path, offset: motion.offset, targetId: motion.id, message: `${motion.id} \u6CA1\u6709\u53EF\u89E3\u6790\u7684 SHOT-* \u5206\u955C\u5B57\u6BB5\u3002` });\n continue;\n }\n if (!shots.has(motion.shotId)) add({ severity: \"error\", code: \"unknown_motion_shot\", path: motion.path, offset: motion.offset, targetId: motion.id, message: `${motion.id} \u6307\u5411\u4E0D\u5B58\u5728\u7684 ${motion.shotId}\u3002` });\n motionsByShot.set(motion.shotId, [...(motionsByShot.get(motion.shotId) ?? []), motion]);\n }\n for (const [shotId, motions] of motionsByShot) {\n if (motions.length < 2) continue;\n for (const motion of motions) add({ severity: \"error\", code: \"multiple_motions\", path: motion.path, offset: motion.offset, targetId: motion.id, message: `${shotId} \u540C\u65F6\u7ED1\u5B9A\u4E86\u591A\u4E2A MOTION\uFF0C\u753B\u5E03\u53EA\u80FD\u786E\u5B9A\u4E00\u4E2A\u3002` });\n }\n\n const parsedOffsets = new Set([...input.shots, ...input.assets, ...input.motions].map((item) => `${item.path}:${String(item.offset)}`));\n for (const [path, prefix] of [\n [`${input.episodeDirectory}/\u5206\u955C.md`, \"SHOT\"],\n [`${input.episodeDirectory}/\u56FE\u7247\u63D0\u793A\u8BCD.md`, \"IMG\"],\n [`${input.episodeDirectory}/\u89C6\u9891\u63D0\u793A\u8BCD.md`, \"MOTION\"]\n ] as const) {\n for (const section of levelTwoSections(input.documents[path] ?? \"\")) {\n if (section.heading.toLocaleUpperCase().startsWith(prefix) && !parsedOffsets.has(`${path}:${String(section.offset)}`)) {\n add({ severity: \"error\", code: \"malformed_heading\", path, offset: section.offset, message: `\u65E0\u6CD5\u89E3\u6790\u6807\u9898 \u201C${section.heading.trim()}\u201D\uFF0C\u9700\u8981\u7A33\u5B9A\u7684 ${prefix}-* ID\u3002` });\n }\n }\n }\n return diagnostics.sort((left, right) => left.path.localeCompare(right.path, \"zh-Hans-CN\") || left.offset - right.offset || left.code.localeCompare(right.code));\n}\n\nexport function productionCompleteness(shot: DramaShot): {\n readonly keyframe: boolean;\n readonly motion: boolean;\n readonly references: boolean;\n readonly complete: boolean;\n} {\n const keyframe = Boolean(shot.keyframePrompt?.trim());\n const motion = Boolean(shot.motion?.prompt?.trim());\n const references = shot.references.length > 0;\n return { keyframe, motion, references, complete: keyframe && motion };\n}\n\nfunction levelTwoSections(content: string): MarkdownSection[] {\n const matches = [...content.matchAll(/^##\\s+(.+)\\s*$/gmu)];\n return matches.map((match, index) => {\n const start = (match.index ?? 0) + match[0].length;\n const end = matches[index + 1]?.index ?? content.length;\n return { heading: match[1] ?? \"\", body: content.slice(start, end), offset: match.index ?? 0 };\n });\n}\n\nfunction bulletFields(body: string): Map<string, string> {\n const fields = new Map<string, string>();\n for (const match of body.matchAll(/^\\s*[-*]\\s+([^\uFF1A:\\n]+)[\uFF1A:]\\s*(.+?)\\s*$/gmu)) {\n const key = match[1]?.trim();\n const value = match[2]?.trim();\n if (key !== undefined && value !== undefined) fields.set(key, value);\n }\n return fields;\n}\n\nfunction firstField(fields: ReadonlyMap<string, string>, ...names: string[]): string | undefined {\n for (const name of names) {\n const value = fields.get(name);\n if (value !== undefined && value !== \"\") return value;\n }\n return undefined;\n}\n\nfunction quoteUnderHeading(body: string, heading: string): string | undefined {\n const escaped = heading.replace(/[.*+?^${}()|[\\]\\\\]/gu, \"\\\\$&\");\n const match = new RegExp(`^###\\\\s+${escaped}\\\\s*$([\\\\s\\\\S]*?)(?=^###\\\\s+|(?![\\\\s\\\\S]))`, \"imu\").exec(body);\n if (match?.[1] === undefined) return undefined;\n const lines = match[1].split(/\\r?\\n/u)\n .filter((line) => /^\\s*>/u.test(line))\n .map((line) => line.replace(/^\\s*>\\s?/u, \"\").trimEnd());\n const value = lines.join(\"\\n\").trim();\n return value === \"\" ? undefined : value;\n}\n\nfunction seconds(value: string | undefined): number | undefined {\n if (value === undefined) return undefined;\n const match = /([0-9]+(?:\\.[0-9]+)?)\\s*(?:s|\u79D2)/iu.exec(value);\n if (match?.[1] === undefined) return undefined;\n const parsed = Number(match[1]);\n return Number.isFinite(parsed) && parsed > 0 ? parsed : undefined;\n}\n\nfunction splitReferences(value: string | undefined): string[] {\n if (value === undefined) return [];\n const ids = value.match(/(?:IMG|SHOT|MOTION)-[A-Z0-9-]+/giu) ?? [];\n return [...new Set(ids.map((id) => id.toLocaleUpperCase()))];\n}\n\nfunction inferAssetKind(value: string): DramaAssetKind {\n if (/(\u4EBA\u7269|\u89D2\u8272|\u9020\u578B|character|portrait|sheet)/iu.test(value)) return \"character\";\n if (/(\u5730\u70B9|\u573A\u666F|\u73AF\u5883|scene|location|corridor|room)/iu.test(value)) return \"scene\";\n if (/(\u9053\u5177|\u7269\u4EF6|prop|object)/iu.test(value)) return \"prop\";\n if (/(\u72B6\u6001|state|look)/iu.test(value)) return \"state\";\n return \"unknown\";\n}\n\nfunction slug(value: string): string {\n return value.trim().toLocaleUpperCase().replace(/[^\\p{Letter}\\p{Number}]+/gu, \"-\").replace(/^-|-$/gu, \"\") || \"ITEM\";\n}\n\nfunction lineAt(content: string, offset: number): number {\n return content.slice(0, Math.max(0, offset)).split(/\\r?\\n/u).length;\n}\n\n// Drama Skills 0.6.5 (#100): \u6765\u6E90 starts with a screenplay scene ID and may\n// continue with a short quote or further IDs joined by \u3001. The ID shape is the\n// one creator_markdown_check.py uses; the checker additionally requires the\n// field to *start* with an ID, which the workbench leaves to it \u2014 here an ID\n// anywhere in the field still navigates.\nexport function sourceSceneIds(source: string | undefined): string[] {\n if (source === undefined) return [];\n return [...new Set([...source.matchAll(/(?:[A-Za-z0-9]+-)+SC[0-9]+/gu)].map((match) => match[0]))];\n}\n\n/** Scene IDs to resolve; a \u6765\u6E90 naming no ID falls back to matching the whole field. */\nfunction sourceKeys(shot: DramaShot): readonly string[] {\n if (shot.sceneIds.length > 0) return shot.sceneIds;\n return shot.source === undefined ? [] : [shot.source];\n}\n\nfunction sectionTarget(path: string, content: string, id: string): DramaDocumentTarget | undefined {\n const offset = content.search(new RegExp(`^##\\\\s+${id.replace(/[.*+?^${}()|[\\]\\\\]/gu, \"\\\\$&\")}(?:\\\\s|$)`, \"imu\"));\n return offset < 0 ? undefined : { path, offset, id };\n}\n\nfunction creatorDocumentOrder(path: string): number {\n const name = path.split(\"/\").at(-1);\n return [\"\u5267\u672C.md\", \"\u89C6\u89C9\u8BBE\u5B9A.md\", \"\u5206\u955C.md\", \"\u56FE\u7247\u63D0\u793A\u8BCD.md\", \"\u89C6\u9891\u63D0\u793A\u8BCD.md\"].indexOf(name ?? \"\");\n}\n", "import { useCallback, useEffect, useMemo, useRef, useState, type KeyboardEvent as ReactKeyboardEvent, type PointerEvent as ReactPointerEvent } from \"react\";\nimport { productionCompleteness, type DramaDocumentTarget, type DramaEpisodeProduction, type DramaProductionSection } from \"./drama-production.js\";\nimport { endpoint } from \"./workbench-ui.js\";\nimport { nativeBatchPrompt, nativeCompositionPrompt, nativeProductionPrompt } from \"./production-prompts.js\";\nimport { activeProductionJobId, createPendingJob, queuedItemForJob, reconcileProductionJobs, reconcileSequence, referencesForTarget, reorderSequence, sequenceIssues, selectedVersionForTarget, type CanvasPoint, type ProductionJob, type ProductionMediaVersion, type ProductionQueueEntry, type ProductionSequenceItem } from \"./production-runtime.js\";\n\ninterface Props {\n readonly sessionId: string;\n readonly production: DramaEpisodeProduction;\n readonly sessionRunning: boolean;\n readonly queue: readonly ProductionQueueEntry[];\n readonly section: DramaProductionSection;\n readonly selectedId: string | undefined;\n readonly jobs: readonly ProductionJob[];\n readonly versions: readonly ProductionMediaVersion[];\n readonly libraryVersions: readonly ProductionMediaVersion[];\n readonly selections: Readonly<Record<string, string>>;\n readonly manualReferences: Readonly<Record<string, readonly string[]>>;\n readonly sequence: readonly ProductionSequenceItem[];\n readonly canvas: Readonly<Record<string, CanvasPoint>>;\n readonly zoom: number;\n readonly onSectionChange: (section: DramaProductionSection) => void;\n readonly onSelect: (id: string | undefined) => void;\n readonly onNavigate: (target: DramaDocumentTarget) => void;\n readonly onJobsChange: (jobs: ProductionJob[]) => void;\n readonly onSelectionsChange: (selections: Record<string, string>) => void;\n readonly onManualReferencesChange: (references: Record<string, string[]>) => void;\n readonly onOpenMedia: (path: string) => void;\n readonly onSequenceChange: (sequence: ProductionSequenceItem[]) => void;\n readonly onCanvasChange: (canvas: Record<string, CanvasPoint>) => void;\n readonly onZoomChange: (zoom: number) => void;\n readonly onDispatchPrompt: (prompt: string) => Promise<void>;\n readonly onCancelTurn: () => Promise<void>;\n readonly onRemoveQueued: (itemId: string) => Promise<void>;\n readonly onRefresh: () => void;\n}\n\nconst SECTION_LABELS: Readonly<Record<DramaProductionSection, string>> = { shots: \"\u955C\u5934\", assets: \"\u7D20\u6750\", tasks: \"\u4EFB\u52A1\", sequence: \"\u6210\u7247\", canvas: \"\u753B\u5E03\" };\nconst SECTION_ORDER = Object.keys(SECTION_LABELS) as DramaProductionSection[];\nconst STATUS_LABELS: Readonly<Record<ProductionJob[\"status\"], string>> = { awaiting_confirmation: \"\u7B49\u5F85\u786E\u8BA4\", pending: \"\u5DF2\u63D0\u4EA4\", running: \"DSH \u6267\u884C\u4E2D\", dispatched_unknown: \"\u5F85\u6838\u5BF9\", succeeded: \"\u5DF2\u5B8C\u6210\", failed: \"\u5931\u8D25\", canceled: \"\u5DF2\u53D6\u6D88\" };\nconst ASSET_KIND_LABEL = { character: \"\u4EBA\u7269\", scene: \"\u573A\u666F\", prop: \"\u9053\u5177\", state: \"\u72B6\u6001\", unknown: \"\u8BBE\u5B9A\" } as const;\nconst JOB_KIND_LABEL = { image: \"\u56FE\u7247\", video: \"\u89C6\u9891\", composition: \"\u6210\u7247\" } as const;\n\n/** Mirror of the host `/oh-story/drama-preflight` summary: presence only, never values. */\ninterface DramaPreflight {\n readonly python: { readonly ok: boolean; readonly version?: string };\n readonly adapterConfig: { readonly path: string; readonly generated: boolean; readonly ok: boolean };\n readonly adapters: readonly { readonly name: string; readonly label: string; readonly modality: \"image\" | \"video\" | \"music\"; readonly configured: boolean; readonly missing: readonly string[] }[];\n}\n\nconst MODALITY_LABEL = { image: \"\u56FE\u7247\", video: \"\u89C6\u9891\", music: \"\u97F3\u4E50\" } as const;\n\n/**\n * DeepSeek writes the prompts; the pictures, videos and music come from provider\n * APIs that the produce Skill calls. Nothing in the conversation says so, and the\n * keys live in the host environment, so the \u751F\u4EA7 view states it up front.\n */\nfunction ProductionEnvironment({ sessionId }: { readonly sessionId: string }) {\n const [preflight, setPreflight] = useState<DramaPreflight | \"failed\">();\n const [attempt, setAttempt] = useState(0);\n // The summary is host-wide (the route ignores sessionId); the id only keeps\n // the URL shape shared with every other workbench endpoint.\n useEffect(() => {\n const controller = new AbortController();\n void fetch(endpoint(\"drama-preflight\", sessionId), { signal: controller.signal })\n .then(async (response) => {\n if (!response.ok) throw new Error(`HTTP ${String(response.status)}`);\n const summary = await response.json() as DramaPreflight;\n if (!controller.signal.aborted) setPreflight(summary);\n })\n .catch(() => { if (!controller.signal.aborted) setPreflight(\"failed\"); });\n return () => { controller.abort(); };\n }, [attempt, sessionId]);\n const unconfigured = typeof preflight === \"object\" ? preflight.adapters.filter((adapter) => !adapter.configured) : [];\n return <div className=\"oh-story-production-environment\" role=\"status\" aria-label=\"\u5A92\u4F53\u751F\u6210\u73AF\u5883\">\n <strong>\u751F\u6210\u73AF\u5883</strong>\n {preflight === undefined && <span data-pending>\u68C0\u67E5\u4E2D\u2026</span>}\n {preflight === \"failed\" && <button type=\"button\" onClick={() => { setPreflight(undefined); setAttempt((value) => value + 1); }}>\u73AF\u5883\u68C0\u67E5\u5931\u8D25 \u00B7 \u91CD\u8BD5</button>}\n {typeof preflight === \"object\" && <>\n <span data-ready={preflight.python.ok || undefined}>Python {preflight.python.version ?? \"\u672A\u627E\u5230\"}</span>\n {preflight.adapters.map((adapter) => <span key={adapter.name} data-ready={adapter.configured || undefined} title={adapter.configured ? `${adapter.name} \u5DF2\u914D\u7F6E` : `\u7F3A\u5C11\u73AF\u5883\u53D8\u91CF ${adapter.missing.join(\"\u3001\")}`}>{MODALITY_LABEL[adapter.modality]} {adapter.label}{adapter.configured ? \"\" : ` \u00B7 \u7F3A ${adapter.missing.join(\"\u3001\")}`}</span>)}\n <em>DeepSeek \u53EA\u8D1F\u8D23\u5199\u63D0\u793A\u8BCD\uFF1B\u56FE\u7247\u3001\u89C6\u9891\u3001\u97F3\u4E50\u7531\u4E0A\u9762\u7684\u4F9B\u5E94\u5546 API \u751F\u6210\uFF0CKey \u5728\u542F\u52A8 DSH \u524D\u5199\u5165\u5BBF\u4E3B\u673A\u73AF\u5883\u53D8\u91CF\u3002\n {unconfigured.length === preflight.adapters.length && \" \u5F53\u524D\u4E00\u4E2A\u90FD\u6CA1\u914D\u7F6E\uFF0C\u751F\u4EA7\u4EFB\u52A1\u4F1A\u505C\u5728 adapter \u4E4B\u524D\u3002\"}\n {\" \"}Adapter \u914D\u7F6E{preflight.adapterConfig.generated ? \"\u5DF2\u81EA\u52A8\u767B\u8BB0\" : \"\u4F7F\u7528\u81EA\u5B9A\u4E49\u6587\u4EF6\"}{preflight.adapterConfig.ok ? \"\" : \"\uFF08\u5199\u5165\u5931\u8D25\uFF09\"}\uFF1A<code>{preflight.adapterConfig.path}</code>\u3002\u8BE6\u89C1 README\u300C\u5A92\u4F53\u751F\u6210 API\u300D\u3002</em>\n </>}\n </div>;\n}\n\nfunction handleSectionKey(event: ReactKeyboardEvent<HTMLButtonElement>, current: DramaProductionSection, onChange: (section: DramaProductionSection) => void): void {\n const index = SECTION_ORDER.indexOf(current);\n const next = event.key === \"Home\" ? 0\n : event.key === \"End\" ? SECTION_ORDER.length - 1\n : event.key === \"ArrowRight\" ? (index + 1) % SECTION_ORDER.length\n : event.key === \"ArrowLeft\" ? (index - 1 + SECTION_ORDER.length) % SECTION_ORDER.length\n : undefined;\n if (next === undefined) return;\n event.preventDefault();\n onChange(SECTION_ORDER[next]!);\n event.currentTarget.parentElement?.querySelectorAll<HTMLButtonElement>(\"[role='tab']\")[next]?.focus();\n}\n\nexport function DramaProductionView(props: Props) {\n const [notice, setNotice] = useState<string>();\n const protocolErrors = props.production.diagnostics.filter((item) => item.severity === \"error\").length;\n const jobsRef = useRef(props.jobs);\n const commitJobs = useCallback((next: ProductionJob[]) => {\n jobsRef.current = next;\n props.onJobsChange(next);\n }, [props.onJobsChange]);\n useEffect(() => { jobsRef.current = props.jobs; }, [props.jobs]);\n\n useEffect(() => {\n const next = reconcileSequence(props.production.shots.map((shot) => shot.id), props.sequence, props.versions, props.selections);\n if (JSON.stringify(next) !== JSON.stringify(props.sequence)) props.onSequenceChange(next);\n }, [props.production.shots, props.selections, props.sequence, props.versions]);\n\n useEffect(() => {\n const next = reconcileProductionJobs(props.jobs, props.queue, props.sessionRunning, props.versions);\n if (JSON.stringify(next) !== JSON.stringify(props.jobs)) commitJobs(next);\n }, [commitJobs, props.jobs, props.queue, props.sessionRunning, props.versions]);\n\n const dispatchJob = async (job: ProductionJob, references: readonly ProductionMediaVersion[] = []) => {\n commitJobs([...jobsRef.current, { ...job, status: \"awaiting_confirmation\" }]);\n props.onSectionChange(\"tasks\");\n try {\n await props.onDispatchPrompt(nativeProductionPrompt(props.production, job, references));\n setNotice(`${job.targetId} \u6B63\u5728\u51C6\u5907\u5B8C\u6574\u9884\u68C0\uFF1B\u8BF7\u5728 Chat \u67E5\u770B\u5E76\u660E\u786E\u786E\u8BA4\u540E\u518D\u751F\u4EA7\u3002`);\n } catch (error) {\n commitJobs(jobsRef.current.map((item) => item.id === job.id ? { ...item, status: \"failed\", error: error instanceof Error ? error.message : String(error) } : item));\n }\n };\n\n const createJob = async (targetId: string, kind: \"image\" | \"video\", prompt: string) => {\n if (prompt.trim() === \"\") { setNotice(`${targetId} \u6CA1\u6709\u53EF\u6295\u4EA7\u63D0\u793A\u8BCD\u3002`); return; }\n const job = createPendingJob({ id: crypto.randomUUID(), targetId, kind, prompt });\n await dispatchJob(job, kind === \"video\" ? referencesForTarget(targetId, props.production, props.versions, props.selections, props.libraryVersions, props.manualReferences) : []);\n };\n\n const createBatch = async (kind: \"image\" | \"video\") => {\n const candidates = props.production.shots.flatMap((shot) => { const prompt = kind === \"image\" ? shot.keyframePrompt : shot.motion?.prompt; return prompt === undefined ? [] : [{ id: shot.id, prompt }]; });\n if (candidates.length === 0) { setNotice(kind === \"image\" ? \"\u6CA1\u6709\u53EF\u6295\u4EA7\u7684\u5173\u952E\u5E27\u63D0\u793A\u8BCD\u3002\" : \"\u6CA1\u6709\u53EF\u6295\u4EA7\u7684\u89C6\u9891\u63D0\u793A\u8BCD\u3002\"); return; }\n const job = createPendingJob({ id: crypto.randomUUID(), targetId: kind === \"image\" ? \"BATCH-KEYFRAMES\" : \"BATCH-VIDEOS\", kind, prompt: candidates.map((item) => `${item.id}\\n${item.prompt}`).join(\"\\n\\n\"), expectedOutputs: candidates.length });\n commitJobs([...jobsRef.current, { ...job, status: \"awaiting_confirmation\" }]); props.onSectionChange(\"tasks\");\n try { await props.onDispatchPrompt(nativeBatchPrompt(props.production, job, candidates)); setNotice(`${String(candidates.length)} \u4E2A\u955C\u5934\u6B63\u5728\u51C6\u5907\u540C\u4E00\u6279\u6B21\u9884\u68C0\uFF1B\u8BF7\u5728 Chat \u6838\u5BF9\u540E\u660E\u786E\u786E\u8BA4\u3002`); }\n catch (error) { commitJobs(jobsRef.current.map((item) => item.id === job.id ? { ...item, status: \"failed\", error: error instanceof Error ? error.message : String(error) } : item)); }\n };\n\n const dispatchComposition = async (job: ProductionJob) => {\n const versionById = new Map(props.versions.map((version) => [version.id, version]));\n const ordered = props.sequence.flatMap((item) => { const version = item.versionId === undefined ? undefined : versionById.get(item.versionId); return version === undefined ? [] : [version.path ?? version.url]; });\n commitJobs([...jobsRef.current, job]); props.onSectionChange(\"tasks\");\n try { await props.onDispatchPrompt(nativeCompositionPrompt(props.production, job, ordered)); setNotice(\"\u6210\u7247\u4EFB\u52A1\u5DF2\u8FDB\u5165 DSH \u539F\u751F\u961F\u5217\uFF1B\u6587\u4EF6\u3001FFmpeg \u548C\u5199\u5165\u7EE7\u7EED\u53D7 DSH \u6743\u9650\u4E0E\u5BA1\u6279\u63A7\u5236\u3002\"); }\n catch (error) { commitJobs(jobsRef.current.map((item) => item.id === job.id ? { ...item, status: \"failed\", error: error instanceof Error ? error.message : String(error) } : item)); }\n };\n\n const cancelJob = async (job: ProductionJob) => {\n try { await props.onCancelTurn(); commitJobs(jobsRef.current.map((item) => item.id === job.id ? { ...item, status: \"canceled\", progress: 0 } : item)); setNotice(\"\u5DF2\u8BF7\u6C42\u505C\u6B62\u5F53\u524D DSH Turn\uFF1BDSH Queue \u4E2D\u7684\u5176\u4ED6\u4EFB\u52A1\u4F1A\u4FDD\u7559\u3002\"); }\n catch (error) { setNotice(error instanceof Error ? error.message : String(error)); }\n };\n const removeQueuedJob = async (job: ProductionJob, itemId: string) => {\n try { await props.onRemoveQueued(itemId); commitJobs(jobsRef.current.map((item) => item.id === job.id ? { ...item, status: \"canceled\", progress: 0 } : item)); setNotice(`${job.targetId} \u5DF2\u4ECE DSH Queue \u79FB\u9664\u3002`); }\n catch (error) { setNotice(error instanceof Error ? error.message : String(error)); }\n };\n const composeSequence = () => { const issues = sequenceIssues(props.sequence, props.versions); if (issues.length > 0) { setNotice(issues[0]); return; } void dispatchComposition(createPendingJob({ id: crypto.randomUUID(), targetId: props.production.episodeDirectory, kind: \"composition\", prompt: \"\u6309\u6210\u7247\u987A\u5E8F\u5408\u6210\" })); };\n\n return <div className=\"oh-story-production\">\n <div className=\"oh-story-production-bar\"><div className=\"oh-story-production-tabs\" role=\"tablist\" aria-label=\"\u77ED\u5267\u751F\u4EA7\u89C6\u56FE\">{SECTION_ORDER.map((item) => <button type=\"button\" role=\"tab\" tabIndex={props.section === item ? 0 : -1} aria-selected={props.section === item} key={item} onKeyDown={(event) => { handleSectionKey(event, item, props.onSectionChange); }} onClick={() => { props.onSectionChange(item); }}>{SECTION_LABELS[item]}</button>)}</div><div className=\"oh-story-production-meta\"><span className=\"oh-story-production-summary\">{props.production.shots.length} \u955C \u00B7 {props.production.assets.length + props.production.visualAssets.length} \u7D20\u6750 \u00B7 {props.jobs.filter((job) => job.status === \"awaiting_confirmation\" || job.status === \"running\" || job.status === \"pending\").length} \u4EFB\u52A1</span><button type=\"button\" onClick={props.onRefresh}>\u5237\u65B0</button></div></div>\n <ProductionEnvironment sessionId={props.sessionId} />\n {notice !== undefined && <div className=\"oh-story-production-notice\" role=\"status\"><span>{notice}</span><button type=\"button\" aria-label=\"\u5173\u95ED\u63D0\u793A\" onClick={() => { setNotice(undefined); }}>\u00D7</button></div>}\n {props.production.diagnostics.length > 0 && <details className=\"oh-story-production-diagnostics\"><summary>{protocolErrors > 0 ? `${String(protocolErrors)} \u4E2A\u534F\u8BAE\u9519\u8BEF` : `${String(props.production.diagnostics.length)} \u4E2A\u683C\u5F0F\u63D0\u9192`}</summary><ul>{props.production.diagnostics.slice(0, 8).map((item) => <li data-severity={item.severity} key={`${item.path}:${String(item.offset)}:${item.code}`}><button type=\"button\" onClick={() => { props.onNavigate({ path: item.path, offset: item.offset, id: item.targetId ?? item.code }); }}>{item.path.split(\"/\").at(-1)}:{item.line}</button><span>{item.message}</span></li>)}</ul>{props.production.diagnostics.length > 8 && <p>\u53E6\u6709 {props.production.diagnostics.length - 8} \u9879\uFF0C\u8BF7\u6309\u6587\u6863\u4F4D\u7F6E\u4FEE\u590D\u3002</p>}</details>}\n {props.section === \"shots\" && <ShotBoard {...props} onCreateJob={createJob} onBatch={createBatch} />}\n {props.section === \"assets\" && <AssetBoard {...props} onCreateJob={createJob} />}\n {props.section === \"tasks\" && <TaskBoard jobs={props.jobs} queue={props.queue} sessionRunning={props.sessionRunning} onCancel={cancelJob} onRemoveQueued={removeQueuedJob} />}\n {props.section === \"sequence\" && <SequenceBoard {...props} onCompose={composeSequence} />}\n {props.section === \"canvas\" && <ProductionCanvas {...props} />}\n </div>;\n}\n\nfunction ShotBoard(props: Props & { readonly onCreateJob: (targetId: string, kind: \"image\" | \"video\", prompt: string) => Promise<void>; readonly onBatch: (kind: \"image\" | \"video\") => Promise<void> }) {\n const selectedRef = useScrollIntoView(props.selectedId);\n if (props.production.shots.length === 0) return <section className=\"oh-story-shot-board\"><MissingDocument document={`${props.production.episodeDirectory}/\u5206\u955C.md`} documentPaths={props.production.documentPaths} what=\"\u955C\u5934\" skill=\"/short-drama-storyboard\" onNavigate={props.onNavigate} /></section>;\n return <section className=\"oh-story-shot-board\"><div className=\"oh-story-production-actions\"><button type=\"button\" onClick={() => { void props.onBatch(\"image\"); }}>\u51C6\u5907\u6279\u91CF\u5173\u952E\u5E27</button><button type=\"button\" onClick={() => { void props.onBatch(\"video\"); }}>\u51C6\u5907\u6279\u91CF\u89C6\u9891</button></div><div className=\"oh-story-shot-grid\">{props.production.shots.map((shot) => {\n const completeness = productionCompleteness(shot); const versions = props.versions.filter((version) => version.targetId === shot.id); const selected = selectedVersionForTarget(shot.id, props.versions, props.selections, \"image\") ?? selectedVersionForTarget(shot.id, props.versions, props.selections, \"video\");\n return <article className=\"oh-story-shot-card\" role=\"button\" tabIndex={0} aria-pressed={props.selectedId === shot.id} aria-label={`\u9009\u4E2D\u955C\u5934 ${shot.id} ${shot.title}`} ref={props.selectedId === shot.id ? selectedRef : undefined} data-selected={props.selectedId === shot.id || undefined} key={shot.id} onKeyDown={(event) => { if (event.key === \"Enter\" || event.key === \" \") { event.preventDefault(); props.onSelect(shot.id); } }} onClick={() => { props.onSelect(shot.id); }}>\n {selected === undefined ? <div className=\"oh-story-shot-placeholder\"><strong>{shot.id.split(\"-\").at(-1)}</strong><span>\u7B49\u5F85\u5173\u952E\u5E27\u6210\u679C</span></div> : <MediaPreview version={selected} />}<header><button type=\"button\" onClick={(event) => { event.stopPropagation(); props.onNavigate({ path: shot.path, offset: shot.offset, id: shot.id }); }}>{shot.id}</button><span>{shot.durationSeconds === undefined ? \"\u2014\" : `${String(shot.durationSeconds)}s`}</span></header><h3>{shot.title}</h3>{shot.shotSpec !== undefined && <p>{shot.shotSpec}</p>}<dl><dt>\u8D77</dt><dd>{shot.start ?? \"\u672A\u586B\u5199\"}</dd><dt>\u7EC8</dt><dd>{shot.end ?? \"\u672A\u586B\u5199\"}</dd></dl>\n <div className=\"oh-story-shot-status\"><ReadinessBadge label=\"\u5173\u952E\u5E27\" ready={completeness.keyframe} /><ReadinessBadge label=\"\u8FD0\u52A8\" ready={completeness.motion} /><ReadinessBadge label=\"\u53C2\u8003\" ready={completeness.references} /><span>{versions.length} \u7248\u672C</span></div><div className=\"oh-story-reference-links\">{shot.sceneIds.length > 0 ? shot.sceneIds.map((sceneId) => <ReferenceButton key={sceneId} id={sceneId} production={props.production} onNavigate={props.onNavigate} />) : shot.source !== undefined && <ReferenceButton id={shot.source} production={props.production} onNavigate={props.onNavigate} />}{shot.references.map((id) => <ReferenceButton id={id} production={props.production} onNavigate={props.onNavigate} key={id} />)}</div>\n <div className=\"oh-story-card-actions\">{shot.keyframePrompt !== undefined && <button type=\"button\" onClick={(event) => { event.stopPropagation(); void props.onCreateJob(shot.id, \"image\", shot.keyframePrompt ?? \"\"); }}>\u51C6\u5907\u5173\u952E\u5E27</button>}{shot.motion?.prompt !== undefined && <button type=\"button\" onClick={(event) => { event.stopPropagation(); void props.onCreateJob(shot.id, \"video\", shot.motion?.prompt ?? \"\"); }}>\u51C6\u5907\u89C6\u9891</button>}</div>{versions.length > 1 && <VersionStrip targetId={shot.id} versions={versions} selections={props.selections} onSelectionsChange={props.onSelectionsChange} />}\n </article>;\n })}</div></section>;\n}\n\nfunction AssetBoard(props: Props & { readonly onCreateJob: (targetId: string, kind: \"image\" | \"video\", prompt: string) => Promise<void> }) {\n const [query, setQuery] = useState(\"\");\n const [kind, setKind] = useState<\"all\" | \"image\" | \"video\">(\"all\");\n const assets = [...props.production.assets, ...props.production.visualAssets.filter((visual) => !props.production.assets.some((asset) => asset.title === visual.title))];\n const needle = query.trim().toLocaleLowerCase();\n const library = props.libraryVersions.filter((version) => (kind === \"all\" || version.kind === kind) && (needle === \"\" || `${version.targetId} ${version.path ?? \"\"}`.toLocaleLowerCase().includes(needle)));\n const selectedRef = useScrollIntoView(props.selectedId);\n const referenceTarget = props.selectedId?.startsWith(\"SHOT-\") === true ? props.selectedId : undefined;\n const toggleReference = (versionId: string) => {\n if (referenceTarget === undefined) return;\n const current = props.manualReferences[referenceTarget] ?? [];\n const next = current.includes(versionId) ? current.filter((id) => id !== versionId) : [...current, versionId];\n const mutable = Object.fromEntries(Object.entries(props.manualReferences).map(([target, ids]) => [target, [...ids]]));\n props.onManualReferencesChange({ ...mutable, [referenceTarget]: next });\n };\n if (assets.length === 0 && props.libraryVersions.length === 0) return <section className=\"oh-story-assets\"><MissingDocument document={`${props.production.episodeDirectory}/\u56FE\u7247\u63D0\u793A\u8BCD.md`} documentPaths={props.production.documentPaths} what=\"\u7D20\u6750\" skill=\"/short-drama-image-prompts\" onNavigate={props.onNavigate} /></section>;\n return <section className=\"oh-story-assets\"><div className=\"oh-story-asset-grid\">{assets.map((asset) => { const prompt = \"prompt\" in asset ? asset.prompt : asset.description; const versions = props.versions.filter((version) => version.targetId === asset.id); const selected = selectedVersionForTarget(asset.id, props.versions, props.selections, \"image\"); return <article className=\"oh-story-asset-card\" ref={props.selectedId === asset.id ? selectedRef : undefined} data-selected={props.selectedId === asset.id || undefined} key={asset.id}>{selected === undefined ? <div className=\"oh-story-asset-placeholder\">{asset.kind === \"character\" ? \"\u4EBA\" : asset.kind === \"scene\" ? \"\u666F\" : asset.kind === \"prop\" ? \"\u7269\" : \"\u8BBE\"}</div> : <MediaPreview version={selected} />}<div><small>{ASSET_KIND_LABEL[asset.kind]}</small><h3>{asset.title}</h3><button type=\"button\" onClick={() => { props.onNavigate({ path: asset.path, offset: asset.offset, id: asset.id }); }}>{asset.id}</button></div>{prompt !== undefined && <p className=\"oh-story-asset-description\">{prompt}</p>}<div className=\"oh-story-card-actions\">{prompt !== undefined && <button type=\"button\" onClick={() => { void props.onCreateJob(asset.id, \"image\", prompt); }}>\u51C6\u5907\u7D20\u6750</button>}</div>{versions.length > 0 && <VersionStrip targetId={asset.id} versions={versions} selections={props.selections} onSelectionsChange={props.onSelectionsChange} />}</article>; })}</div><div className=\"oh-story-media-library\"><header><div><strong>\u9879\u76EE\u5A92\u4F53\u5E93</strong><span>{library.length}/{props.libraryVersions.length} \u9879 \u00B7 \u53EF\u8DE8\u96C6\u590D\u7528</span></div><div><input aria-label=\"\u641C\u7D22\u9879\u76EE\u5A92\u4F53\" value={query} placeholder=\"\u641C\u7D22 ID \u6216\u8DEF\u5F84\" onChange={(event) => { setQuery(event.target.value); }} /><select aria-label=\"\u7B5B\u9009\u5A92\u4F53\u7C7B\u578B\" value={kind} onChange={(event) => { setKind(event.target.value as typeof kind); }}><option value=\"all\">\u5168\u90E8</option><option value=\"image\">\u56FE\u7247</option><option value=\"video\">\u89C6\u9891</option></select></div></header>{referenceTarget === undefined && <p className=\"oh-story-projection-note\">\u5148\u5728\u955C\u5934\u9875\u9009\u4E2D\u4E00\u4E2A\u955C\u5934\uFF0C\u518D\u56DE\u5230\u8FD9\u91CC\u628A\u5DF2\u6709\u56FE\u7247\u8BBE\u4E3A\u8BE5\u955C\u5934\u7684\u989D\u5916\u53C2\u8003\u3002</p>}<div className=\"oh-story-media-library-grid\">{library.map((version) => { const selected = referenceTarget !== undefined && (props.manualReferences[referenceTarget] ?? []).includes(version.id); return <article key={version.id}><MediaPreview version={version} /><strong>{version.targetId}</strong><span title={version.path}>{version.path}</span><footer>{version.path !== undefined && <button type=\"button\" onClick={() => { props.onOpenMedia(version.path!); }}>\u6253\u5F00\u6587\u4EF6</button>}{referenceTarget !== undefined && version.kind === \"image\" && <button type=\"button\" aria-pressed={selected} aria-label={`${selected ? \"\u53D6\u6D88\" : \"\u8BBE\u4E3A\"} ${referenceTarget} \u53C2\u8003 ${version.targetId}`} onClick={() => { toggleReference(version.id); }}>{selected ? \"\u5DF2\u5F15\u7528\" : \"\u4F5C\u4E3A\u53C2\u8003\"}</button>}</footer></article>; })}</div></div></section>;\n}\n\nfunction TaskBoard({ jobs, queue, sessionRunning, onCancel, onRemoveQueued }: {\n readonly jobs: readonly ProductionJob[];\n readonly queue: readonly ProductionQueueEntry[];\n readonly sessionRunning: boolean;\n readonly onCancel: (job: ProductionJob) => Promise<void>;\n readonly onRemoveQueued: (job: ProductionJob, itemId: string) => Promise<void>;\n}) {\n const activeJobId = activeProductionJobId(jobs, queue, sessionRunning);\n return <section className=\"oh-story-task-board\">\n <div className=\"oh-story-projection-note\">\u56FE\u7247\u4E0E\u89C6\u9891\u5148\u9884\u68C0\u3001\u540E\u786E\u8BA4\u3002\u5185\u7F6E\u5951\u7EA6\u652F\u6301 GPT Image 2 / Seedance\uFF1B\u5B9E\u9645\u8D26\u53F7\u3001\u6A21\u578B\u4E0E\u53EF\u7528\u6027\u7531\u5F53\u524D DSH \u8FD0\u884C\u73AF\u5883\u51B3\u5B9A\u3002</div>\n {jobs.length === 0 ? <div className=\"oh-story-production-empty\">\u8FD8\u6CA1\u6709\u751F\u4EA7\u4EFB\u52A1\u3002\u53EF\u4ECE\u955C\u5934\u6216\u7D20\u6750\u9875\u63D0\u4EA4\u5355\u4E2A\u6216\u6279\u91CF\u4EFB\u52A1\u3002</div> : [...jobs].reverse().map((job) => {\n const queued = queuedItemForJob(job.id, queue);\n const displayStatus = queued === undefined ? STATUS_LABELS[job.status] : \"DSH Queue\";\n return <article key={job.id} data-job-id={job.id} data-status={job.status}><header><strong title={job.targetId}>{job.targetId}</strong><span>{JOB_KIND_LABEL[job.kind]}</span><span>{displayStatus}</span></header><div className=\"oh-story-task-progress\"><i style={{ width: `${String(job.progress)}%` }} /></div><details><summary>\u67E5\u770B\u6295\u4EA7\u63D0\u793A\u8BCD</summary><p>{job.prompt}</p></details>{job.expectedOutputs > 1 && <small>{job.completedOutputs}/{job.expectedOutputs} \u9879\u6210\u679C</small>}{job.error !== undefined && <div className=\"oh-story-error\">{job.error}</div>}{job.output !== undefined && <MediaPreview version={job.output} />}<footer>{queued !== undefined && (job.status === \"awaiting_confirmation\" || job.status === \"pending\" || job.status === \"running\") && <button type=\"button\" onClick={() => { void onRemoveQueued(job, queued.id); }}>\u4ECE DSH Queue \u79FB\u9664</button>}{activeJobId === job.id && <button type=\"button\" onClick={() => { void onCancel(job); }}>\u505C\u6B62\u5F53\u524D DSH Turn</button>}</footer></article>;\n })}\n </section>;\n}\n\nfunction SequenceBoard(props: Props & { readonly onCompose: () => void }) {\n const issues = sequenceIssues(props.sequence, props.versions); const versionById = new Map(props.versions.map((version) => [version.id, version])); const move = (index: number, delta: number) => { const source = props.sequence[index]; const target = props.sequence[index + delta]; if (source !== undefined && target !== undefined) props.onSequenceChange(reorderSequence(props.sequence, index, index + delta)); };\n return <section className=\"oh-story-sequence\"><div className=\"oh-story-sequence-summary\"><strong>{props.sequence.length} \u4E2A\u955C\u5934</strong><span>{props.sequence.length === 0 ? \"\u8FD8\u6CA1\u6709\u955C\u5934\" : issues.length === 0 ? \"\u5DF2\u53EF\u5408\u6210\" : `${String(issues.length)} \u4E2A\u963B\u585E\u9879`}</span><button type=\"button\" disabled={issues.length > 0 || props.sequence.length < 2} onClick={props.onCompose}>\u5408\u6210\u6210\u7247</button></div>{issues.length > 0 && <ul className=\"oh-story-sequence-issues\">{issues.slice(0, 3).map((issue) => <li key={issue}>{issue}</li>)}{issues.length > 3 && <li>\u53E6\u6709 {issues.length - 3} \u4E2A\u963B\u585E\u9879\uFF0C\u8BF7\u5728\u4E0B\u65B9\u955C\u5934\u884C\u8865\u9F50\u89C6\u9891\u3002</li>}</ul>}<ol>{props.sequence.map((item, index) => { const version = item.versionId === undefined ? undefined : versionById.get(item.versionId); return <li key={item.shotId}><span>{String(index + 1).padStart(2, \"0\")}</span>{version === undefined ? <div className=\"oh-story-sequence-missing\">\u7F3A\u5C11\u89C6\u9891</div> : <MediaPreview version={version} interactive={false} />}<strong>{item.shotId}</strong><div><button type=\"button\" aria-label={`\u4E0A\u79FB ${item.shotId}`} disabled={index === 0} onClick={() => { move(index, -1); }}>\u2191</button><button type=\"button\" aria-label={`\u4E0B\u79FB ${item.shotId}`} disabled={index === props.sequence.length - 1} onClick={() => { move(index, 1); }}>\u2193</button></div></li>; })}</ol></section>;\n}\n\nfunction ProductionCanvas(props: Props) {\n const nodes = useMemo(() => { const sourceAssets = [...props.production.assets, ...props.production.visualAssets]; const assets = sourceAssets.map((asset, index) => ({ id: asset.id, label: asset.title, type: \"asset\", initial: { x: 80, y: 80 + index * 150 } })); const shots = props.production.shots.map((shot, index) => ({ id: shot.id, label: shot.title, type: \"shot\", initial: { x: 640, y: 80 + index * 180 } })); return [...assets, ...shots]; }, [props.production.assets, props.production.shots, props.production.visualAssets]);\n const positions = Object.fromEntries(nodes.map((node) => [node.id, props.canvas[node.id] ?? node.initial]));\n const startDrag = (event: ReactPointerEvent<HTMLElement>, id: string) => { event.currentTarget.setPointerCapture(event.pointerId); const origin = positions[id] ?? { x: 0, y: 0 }; const start = { x: event.clientX, y: event.clientY }; const move = (moveEvent: PointerEvent) => { props.onCanvasChange({ ...props.canvas, [id]: { x: origin.x + (moveEvent.clientX - start.x) / props.zoom, y: origin.y + (moveEvent.clientY - start.y) / props.zoom } }); }; const end = () => { globalThis.removeEventListener(\"pointermove\", move); globalThis.removeEventListener(\"pointerup\", end); }; globalThis.addEventListener(\"pointermove\", move); globalThis.addEventListener(\"pointerup\", end); };\n const moveNode = (id: string, x: number, y: number) => { const origin = positions[id] ?? { x: 0, y: 0 }; props.onCanvasChange({ ...props.canvas, [id]: { x: origin.x + x, y: origin.y + y } }); };\n const connections = props.production.shots.flatMap((shot) => shot.references.map((reference) => [reference, shot.id] as const));\n if (nodes.length === 0) return <section className=\"oh-story-canvas-shell\" aria-label=\"\u77ED\u5267\u7D20\u6750\u4E0E\u955C\u5934\u5173\u7CFB\u753B\u5E03\"><MissingDocument document={`${props.production.episodeDirectory}/\u5206\u955C.md`} documentPaths={props.production.documentPaths} what=\"\u5173\u7CFB\" skill=\"/short-drama-storyboard\" onNavigate={props.onNavigate} /></section>;\n return <section className=\"oh-story-canvas-shell\" aria-label=\"\u77ED\u5267\u7D20\u6750\u4E0E\u955C\u5934\u5173\u7CFB\u753B\u5E03\"><div className=\"oh-story-projection-note\">\u6587\u6863\u5173\u7CFB \u00B7 \u5E03\u5C40\u4EC5\u4FDD\u5B58\u5728\u5F53\u524D DSH Session</div><div className=\"oh-story-canvas-controls\"><button type=\"button\" aria-label=\"\u7F29\u5C0F\u753B\u5E03\" onClick={() => { props.onZoomChange(Math.max(.5, props.zoom - .1)); }}>\u2212</button><span>{Math.round(props.zoom * 100)}%</span><button type=\"button\" aria-label=\"\u653E\u5927\u753B\u5E03\" onClick={() => { props.onZoomChange(Math.min(1.8, props.zoom + .1)); }}>\uFF0B</button><button type=\"button\" onClick={() => { props.onCanvasChange({}); props.onZoomChange(.65); }}>\u590D\u4F4D</button></div><div className=\"oh-story-canvas-viewport\"><div className=\"oh-story-canvas\" style={{ transform: `scale(${String(props.zoom)})` }}><svg aria-hidden=\"true\">{connections.map(([from, to]) => { const a = positions[from]; const b = positions[to]; if (a === undefined || b === undefined) return null; return <path key={`${from}:${to}`} data-active={to === props.selectedId || undefined} d={`M ${String(a.x + 180)} ${String(a.y + 50)} C ${String(a.x + 360)} ${String(a.y + 50)}, ${String(b.x - 180)} ${String(b.y + 50)}, ${String(b.x)} ${String(b.y + 50)}`} />; })}</svg>{nodes.map((node) => <article key={node.id} tabIndex={0} aria-label={`${node.type === \"asset\" ? \"\u7D20\u6750\" : \"\u955C\u5934\"} ${node.label}`} data-node-type={node.type} data-selected={node.id === props.selectedId || undefined} style={{ left: positions[node.id]?.x, top: positions[node.id]?.y }} onKeyDown={(event) => { const step = event.shiftKey ? 40 : 10; const delta: readonly [number, number] | undefined = event.key === \"ArrowLeft\" ? [-step, 0] : event.key === \"ArrowRight\" ? [step, 0] : event.key === \"ArrowUp\" ? [0, -step] : event.key === \"ArrowDown\" ? [0, step] : undefined; if (delta !== undefined) { event.preventDefault(); moveNode(node.id, delta[0], delta[1]); } }} onPointerDown={(event) => { startDrag(event, node.id); }} onDoubleClick={() => { const target = props.production.targets.get(node.id); if (target !== undefined) props.onNavigate(target); }}><small>{node.type === \"asset\" ? \"\u7D20\u6750\" : \"\u955C\u5934\"}</small><strong>{node.label}</strong><span>{node.id}</span></article>)}</div></div></section>;\n}\n\n/** Scroll the card an Agent focus_target selected into view; without it the tab switches but the card stays off-screen. */\nfunction useScrollIntoView(selectedId: string | undefined) {\n const ref = useRef<HTMLElement | null>(null);\n useEffect(() => { ref.current?.scrollIntoView({ block: \"nearest\" }); }, [selectedId]);\n return ref;\n}\n\nfunction ReadinessBadge({ label, ready }: { readonly label: string; readonly ready: boolean }) {\n return <span data-ready={ready} aria-label={`${label}${ready ? \"\u5DF2\u5907\" : \"\u5F85\u8865\"}`}><i aria-hidden=\"true\">{ready ? \"\u2713\" : \"\u2014\"}</i>{label}</span>;\n}\n\nfunction MissingDocument({ document, documentPaths, what, skill, onNavigate }: {\n readonly document: string;\n readonly documentPaths: readonly string[];\n readonly what: string;\n readonly skill: string;\n readonly onNavigate: (target: DramaDocumentTarget) => void;\n}) {\n const present = documentPaths.includes(document);\n return <div className=\"oh-story-production-empty\">\n <strong>\u8FD8\u6CA1\u6709\u53EF\u6295\u5F71\u7684{what}\u3002</strong>\n <p>{present\n ? `${document} \u5DF2\u5B58\u5728\uFF0C\u4F46\u6CA1\u6709\u89E3\u6790\u51FA\u6761\u76EE\u3002\u8BF7\u68C0\u67E5\u4E8C\u7EA7\u6807\u9898\u662F\u5426\u4E3A\u7A33\u5B9A\u7684 ID \u5F62\u5F0F\u3002`\n : `\u672C\u96C6\u8FD8\u6CA1\u6709 ${document}\u3002\u5728\u53F3\u4FA7 Chat \u7528 ${skill} \u5199\u597D\u8FD9\u4EFD\u6587\u6863\u540E\uFF0C\u8FD9\u91CC\u4F1A\u81EA\u52A8\u51FA\u73B0\u3002`}</p>\n {present && <button type=\"button\" onClick={() => { onNavigate({ path: document, offset: 0, id: document }); }}>\u6253\u5F00 {document.split(\"/\").at(-1)}</button>}\n </div>;\n}\n\nfunction ReferenceButton({ id, production, onNavigate }: { readonly id: string; readonly production: DramaEpisodeProduction; readonly onNavigate: (target: DramaDocumentTarget) => void }) { const target = production.targets.get(id); return <button type=\"button\" disabled={target === undefined} onClick={(event) => { event.stopPropagation(); if (target !== undefined) onNavigate(target); }}>{id}</button>; }\nfunction MediaPreview({ version, interactive = true }: { readonly version: ProductionMediaVersion; readonly interactive?: boolean }) { return version.kind === \"image\" ? <img className=\"oh-story-media-preview\" src={version.url} alt={version.targetId} loading=\"lazy\" /> : <video className=\"oh-story-media-preview\" src={version.url} controls={interactive} muted={!interactive} preload=\"metadata\" />; }\nfunction VersionStrip({ targetId, versions, selections, onSelectionsChange }: { readonly targetId: string; readonly versions: readonly ProductionMediaVersion[]; readonly selections: Readonly<Record<string, string>>; readonly onSelectionsChange: (value: Record<string, string>) => void }) { const selected = selectedVersionForTarget(targetId, versions, selections)?.id; return <div className=\"oh-story-version-strip\" aria-label={`${targetId} \u6210\u679C\u7248\u672C`}>{versions.map((version, index) => <button type=\"button\" aria-pressed={version.id === selected} aria-label={`\u9009\u62E9 ${targetId} \u7248\u672C ${String(index + 1)}`} data-selected={version.id === selected || undefined} key={version.id} onClick={(event) => { event.stopPropagation(); onSelectionsChange({ ...selections, [targetId]: version.id }); }}><MediaPreview version={version} interactive={false} /><span>V{String(index + 1)}</span></button>)}</div>; }\n", "import type { KeyboardEvent as ReactKeyboardEvent } from \"react\";\n\n/** Roving-focus keyboard contract shared by every workbench tablist. */\nexport function handleTabKey<T extends string>(\n event: ReactKeyboardEvent<HTMLButtonElement>,\n values: readonly T[],\n current: T,\n select: (value: T) => void\n): void {\n let index: number | undefined;\n if (event.key === \"Home\") index = 0;\n else if (event.key === \"End\") index = values.length - 1;\n else if (event.key === \"ArrowRight\") index = (values.indexOf(current) + 1) % values.length;\n else if (event.key === \"ArrowLeft\") index = (values.indexOf(current) - 1 + values.length) % values.length;\n if (index === undefined) return;\n event.preventDefault();\n const value = values[index];\n if (value === undefined) return;\n select(value);\n event.currentTarget.parentElement?.querySelectorAll<HTMLButtonElement>(\"[role='tab']\")[index]?.focus();\n}\n\nexport function endpoint(path: string, sessionId: string, file?: string): string {\n const url = new URL(`/oh-story/${path}`, globalThis.location.origin);\n url.searchParams.set(\"sessionId\", sessionId);\n if (file !== undefined) url.searchParams.set(\"path\", file);\n return url.toString();\n}\n", "import type { DramaEpisodeProduction } from \"./drama-production.js\";\nimport type { ProductionJob, ProductionMediaVersion } from \"./production-runtime.js\";\n\nconst authorityBoundary = \"\u53EA\u4F7F\u7528\u5F53\u524D DSH Preset \u53EF\u89C1\u7684\u5DE5\u5177\uFF1B\u6240\u6709\u6587\u4EF6\u3001\u7F51\u7EDC\u3001\u751F\u6210\u548C\u547D\u4EE4\u64CD\u4F5C\u7EE7\u7EED\u9075\u5B88 DSH \u6743\u9650\u4E0E\u5BA1\u6279\u3002\";\n\nexport function nativeProductionPrompt(\n production: DramaEpisodeProduction,\n job: ProductionJob,\n references: readonly ProductionMediaVersion[]\n): string {\n const referenceText = references.length === 0\n ? \"\u65E0\"\n : references.map((item) => `${item.targetId}: ${item.path ?? item.url}`).join(\"\\n\");\n return `/short-drama-produce\n\n\u53EA\u51C6\u5907\u5F53\u524D\u5355\u9879\u751F\u4EA7\u4EFB\u52A1\uFF0C\u4E0D\u8FD0\u884C Provider\u3002\n- \u4EFB\u52A1 ID\uFF1A${job.id}\n- \u4EFB\u52A1\u7C7B\u578B\uFF1A${job.kind === \"image\" ? \"\u56FE\u7247/\u5173\u952E\u5E27\" : \"\u955C\u5934\u89C6\u9891\"}\n- \u5EFA\u8BAE adapter \u5951\u7EA6\uFF1A${job.kind === \"image\" ? \"gpt-image-2\" : \"seedance\"}\uFF08\u5B9E\u9645\u914D\u7F6E\u4E0E\u6A21\u578B\u4EE5\u5F53\u524D DSH \u8FD0\u884C\u73AF\u5883\u4E3A\u51C6\uFF09\n- \u6295\u4EA7\u5BF9\u8C61\uFF1A${job.targetId}\n- \u521B\u4F5C\u6587\u6863\u76EE\u5F55\uFF1A${production.episodeDirectory}\n- \u53C2\u8003\u7D20\u6750\uFF1A\n${referenceText}\n- \u8F93\u51FA\u76EE\u5F55\uFF1A${production.episodeDirectory}/\u5236\u4F5C\u6210\u679C/${job.targetId}\n- \u8F93\u51FA\u6587\u4EF6\u540D\u5FC5\u987B\u540C\u65F6\u5305\u542B\u6295\u4EA7\u5BF9\u8C61 ID \u4E0E\u4EFB\u52A1 ID ${job.id}\uFF0C\u4EE5\u4FBF DSH \u5DE5\u4F5C\u53F0\u5173\u8054\u7248\u672C\u3002\n\n\u5F85\u9884\u68C0\u63D0\u793A\u8BCD\uFF1A\n${job.prompt}\n\n\u6309 short-drama-produce \u7684\u786C\u95F8\u95E8\u5EFA\u7ACB\u4E34\u65F6 job \u5E76\u6267\u884C prepare\uFF0C\u5728 Chat \u4E2D\u5B8C\u6574\u5C55\u793A adapter\u3001\u6A21\u578B/profile\u3001\u6570\u91CF\u3001\u53C2\u6570\u3001references\u3001outputs \u4E0E overwrite\u3002\u6B64\u6309\u94AE\u53EA\u8868\u8FBE\u201C\u51C6\u5907\u9884\u89C8\u201D\uFF0C\u4E0D\u6784\u6210\u770B\u5230\u9884\u89C8\u540E\u7684\u751F\u4EA7\u786E\u8BA4\uFF1B\u4E0D\u5F97 confirm \u6216 run\u3002\u7528\u6237\u5728\u540E\u7EED\u6D88\u606F\u660E\u786E\u786E\u8BA4\u8FD9\u4EFD\u9884\u89C8\u540E\uFF0C\u624D\u53EF\u8C03\u7528 oh_story_production track_job \u767B\u8BB0\u540C\u4E00\u4E2A\u4EFB\u52A1 ID\uFF0C\u5E76\u8FD0\u884C Provider\u3002${authorityBoundary}`;\n}\n\nexport function nativeBatchPrompt(\n production: DramaEpisodeProduction,\n job: ProductionJob,\n candidates: readonly { readonly id: string; readonly prompt: string }[]\n): string {\n return `/short-drama-produce\n\n\u53EA\u51C6\u5907\u5F53\u524D\u6279\u91CF\u751F\u4EA7\u4EFB\u52A1\uFF0C\u4E0D\u8FD0\u884C Provider\u3002\n- \u6279\u6B21\u4EFB\u52A1 ID\uFF1A${job.id}\n- \u4EFB\u52A1\u7C7B\u578B\uFF1A${job.kind === \"image\" ? \"\u6279\u91CF\u5173\u952E\u5E27\" : \"\u6279\u91CF\u955C\u5934\u89C6\u9891\"}\n- \u5EFA\u8BAE adapter \u5951\u7EA6\uFF1A${job.kind === \"image\" ? \"gpt-image-2\" : \"seedance\"}\uFF08\u5B9E\u9645\u914D\u7F6E\u4E0E\u6A21\u578B\u4EE5\u5F53\u524D DSH \u8FD0\u884C\u73AF\u5883\u4E3A\u51C6\uFF09\n- \u521B\u4F5C\u6587\u6863\u76EE\u5F55\uFF1A${production.episodeDirectory}\n- \u8F93\u51FA\u6839\u76EE\u5F55\uFF1A${production.episodeDirectory}/\u5236\u4F5C\u6210\u679C\n- \u6BCF\u4E2A\u8F93\u51FA\u6587\u4EF6\u540D\u5FC5\u987B\u5305\u542B\u5BF9\u5E94\u955C\u5934 ID \u4E0E\u6279\u6B21\u4EFB\u52A1 ID ${job.id}\u3002\n\n${candidates.map((item) => `## ${item.id}\\n${item.prompt}`).join(\"\\n\\n\")}\n\n\u628A\u6570\u91CF\u3001\u9010\u9879\u8F93\u51FA\u548C\u6210\u672C\u8FB9\u754C\u5B8C\u6574\u5C55\u793A\u7ED9\u521B\u4F5C\u8005\u3002\u6B64\u6309\u94AE\u53EA\u8868\u8FBE\u201C\u51C6\u5907\u9884\u89C8\u201D\uFF0C\u4E0D\u6784\u6210\u770B\u5230\u9884\u89C8\u540E\u7684\u751F\u4EA7\u786E\u8BA4\uFF1B\u4E0D\u5F97 confirm \u6216 run\u3002\u7528\u6237\u5728\u540E\u7EED\u6D88\u606F\u660E\u786E\u786E\u8BA4\u8FD9\u4EFD\u9884\u89C8\u540E\uFF0C\u624D\u53EF\u8C03\u7528 oh_story_production track_job \u767B\u8BB0\u540C\u4E00\u4E2A\u6279\u6B21\u4EFB\u52A1 ID\uFF0C\u5E76\u8FD0\u884C Provider\u3002${authorityBoundary}`;\n}\n\nexport function nativeCompositionPrompt(\n production: DramaEpisodeProduction,\n job: ProductionJob,\n orderedPaths: readonly string[]\n): string {\n return `/short-drama-produce\n\n\u6267\u884C\u521B\u4F5C\u8005\u5DF2\u660E\u786E\u786E\u8BA4\u7684\u6210\u7247\u5408\u6210\u4EFB\u52A1\u3002\n- \u4EFB\u52A1 ID\uFF1A${job.id}\n- \u5267\u96C6\uFF1A${production.episodeDirectory}\n- \u6309\u4EE5\u4E0B\u987A\u5E8F\u5408\u6210\uFF0C\u4E0D\u5F97\u81EA\u884C\u6362\u5E8F\uFF1A\n${orderedPaths.map((path, index) => `${String(index + 1)}. ${path}`).join(\"\\n\")}\n- \u8F93\u51FA\uFF1A${production.episodeDirectory}/\u5236\u4F5C\u6210\u679C/\u6210\u7247-${job.id}.mp4\n\n\u5148\u9A8C\u8BC1\u8F93\u5165\u5747\u5B58\u5728\u4E14\u53EF\u8BFB\uFF0C\u518D\u4F7F\u7528\u5F53\u524D DSH Preset \u53EF\u89C1\u7684\u5A92\u4F53/\u547D\u4EE4\u5DE5\u5177\u6267\u884C\uFF1B\u97F3\u89C6\u9891\u53C2\u6570\u4E0D\u517C\u5BB9\u65F6\u505A\u660E\u786E\u3001\u53EF\u5BA1\u8BA1\u7684\u6807\u51C6\u5316\u3002\u6240\u6709\u547D\u4EE4\u548C\u5199\u5165\u7EE7\u7EED\u9075\u5B88 DSH \u6743\u9650\u4E0E\u5BA1\u6279\uFF0C\u4E0D\u5F97\u4F2A\u9020\u6210\u529F\u3002`;\n}\n", "export type ProductionJobKind = \"image\" | \"video\" | \"composition\";\nexport type ProductionJobStatus = \"awaiting_confirmation\" | \"pending\" | \"running\" | \"dispatched_unknown\" | \"succeeded\" | \"failed\" | \"canceled\";\n\nexport interface ProductionMediaVersion {\n readonly id: string;\n readonly targetId: string;\n readonly kind: \"image\" | \"video\";\n readonly url: string;\n /** Workspace-relative path when the result is owned by the DSH FileSystem. */\n readonly path?: string | undefined;\n}\n\nexport interface ProductionJob {\n readonly id: string;\n readonly targetId: string;\n readonly kind: ProductionJobKind;\n readonly status: ProductionJobStatus;\n readonly progress: number;\n readonly prompt: string;\n readonly error?: string | undefined;\n readonly output?: ProductionMediaVersion | undefined;\n readonly expectedOutputs: number;\n readonly completedOutputs: number;\n}\n\nexport interface ProductionSequenceItem {\n readonly shotId: string;\n readonly versionId?: string | undefined;\n}\n\nexport interface CanvasPoint {\n readonly x: number;\n readonly y: number;\n}\n\nexport interface ProductionQueueEntry {\n readonly id: string;\n readonly preview: string;\n}\n\nexport function createPendingJob(input: {\n readonly id: string;\n readonly targetId: string;\n readonly kind: ProductionJobKind;\n readonly prompt: string;\n readonly expectedOutputs?: number | undefined;\n}): ProductionJob {\n return {\n id: input.id,\n targetId: input.targetId,\n kind: input.kind,\n status: \"pending\",\n progress: 0,\n prompt: input.prompt,\n expectedOutputs: Math.max(1, Math.floor(input.expectedOutputs ?? 1)),\n completedOutputs: 0\n };\n}\n\nexport function selectedVersionForTarget(\n targetId: string,\n versions: readonly ProductionMediaVersion[],\n selections: Readonly<Record<string, string>>,\n kind?: ProductionMediaVersion[\"kind\"]\n): ProductionMediaVersion | undefined {\n const candidates = versions.filter((version) => version.targetId === targetId && (kind === undefined || version.kind === kind));\n return candidates.find((version) => version.id === selections[targetId]) ?? candidates.at(-1);\n}\n\nexport function mediaTargetFromPath(path: string, knownTargets: readonly string[]): string | undefined {\n const upper = path.toLocaleUpperCase();\n const segments = upper.split(\"/\");\n const filename = segments.at(-1) ?? \"\";\n return [...knownTargets].sort((left, right) => right.length - left.length).find((target) => {\n const canonical = target.toLocaleUpperCase();\n return segments.includes(canonical)\n || filename === canonical\n || filename.startsWith(`${canonical}.`)\n || filename.startsWith(`${canonical}-`);\n });\n}\n\nexport function mediaVersionMatchesJob(version: ProductionMediaVersion, jobId: string): boolean {\n if (version.path === undefined || jobId.trim() === \"\") return false;\n const escaped = jobId.replace(/[.*+?^${}()|[\\]\\\\]/gu, \"\\\\$&\");\n const basename = version.path.split(\"/\").at(-1) ?? \"\";\n return new RegExp(`(?:^|[-_.])${escaped}(?:[-_.]|$)`, \"u\").test(basename);\n}\n\nexport function referencesForTarget(\n targetId: string,\n production: { readonly shots: readonly { readonly id: string; readonly references: readonly string[] }[] },\n versions: readonly ProductionMediaVersion[],\n selections: Readonly<Record<string, string>>,\n libraryVersions: readonly ProductionMediaVersion[] = versions,\n manualReferences: Readonly<Record<string, readonly string[]>> = {}\n): ProductionMediaVersion[] {\n const shot = production.shots.find((item) => item.id === targetId);\n if (shot === undefined) return [];\n const declared = shot.references.flatMap((id) => {\n const version = selectedVersionForTarget(id, versions, selections, \"image\");\n return version === undefined ? [] : [version];\n });\n const manual = (manualReferences[targetId] ?? []).flatMap((id) => {\n const version = libraryVersions.find((item) => item.id === id && item.kind === \"image\");\n return version === undefined ? [] : [version];\n });\n return [...new Map([...declared, ...manual].map((version) => [version.id, version])).values()];\n}\n\nexport function queuedItemForJob(jobId: string, queue: readonly ProductionQueueEntry[]): ProductionQueueEntry | undefined {\n if (jobId.trim() === \"\") return undefined;\n const escaped = jobId.replace(/[.*+?^${}()|[\\]\\\\]/gu, \"\\\\$&\");\n // The prompts label the id as \u300C\u4EFB\u52A1 ID\uFF1A<id>\u300D / \u300C\u6279\u6B21\u4EFB\u52A1 ID\uFF1A<id>\u300D. Anchor on that label so an\n // id merely quoted inside another job's output paths cannot mark this job as queued.\n const labelled = new RegExp(`\u4EFB\u52A1\\\\s*ID\\\\s*[\uFF1A:]\\\\s*${escaped}(?:[\\\\s.,;\u3001\u3002]|$)`, \"u\");\n return queue.find((item) => labelled.test(item.preview));\n}\n\nexport function activeProductionJobId(\n jobs: readonly ProductionJob[],\n queue: readonly ProductionQueueEntry[],\n sessionRunning: boolean\n): string | undefined {\n if (!sessionRunning) return undefined;\n return [...jobs].reverse().find((job) => (\n (job.status === \"awaiting_confirmation\" || job.status === \"pending\" || job.status === \"running\")\n && queuedItemForJob(job.id, queue) === undefined\n ))?.id;\n}\n\n/** Reconcile the lightweight Session projection against DSH Queue/Turn state and real workspace outputs. */\nexport function reconcileProductionJobs(\n jobs: readonly ProductionJob[],\n queue: readonly ProductionQueueEntry[],\n sessionRunning: boolean,\n versions: readonly ProductionMediaVersion[]\n): ProductionJob[] {\n const latestPending = [...jobs].reverse().find((job) => (\n job.status === \"pending\" && queuedItemForJob(job.id, queue) === undefined\n ));\n\n return jobs.map((job) => {\n const queued = queuedItemForJob(job.id, queue) !== undefined;\n const outputs = versions.filter((version) => mediaVersionMatchesJob(version, job.id));\n\n if (outputs.length >= job.expectedOutputs) {\n return {\n ...job,\n status: \"succeeded\",\n progress: 100,\n completedOutputs: outputs.length,\n output: outputs[0],\n error: undefined\n };\n }\n if (job.status === \"canceled\" || job.status === \"succeeded\" || (job.status === \"awaiting_confirmation\" && outputs.length === 0)) return job;\n if (job.status === \"running\" && queued) return { ...job, status: \"pending\", progress: 0 };\n if (job.status === \"pending\" && sessionRunning && !queued && job === latestPending) {\n return { ...job, status: \"running\", progress: Math.max(10, job.progress), error: undefined };\n }\n if (!sessionRunning && !queued && (job.status === \"running\" || job.status === \"dispatched_unknown\")) {\n return {\n ...job,\n status: \"dispatched_unknown\",\n progress: Math.round(outputs.length / job.expectedOutputs * 100),\n completedOutputs: outputs.length,\n error: outputs.length === 0\n ? \"DSH Turn \u5DF2\u7ED3\u675F\uFF0C\u5C1A\u672A\u53D1\u73B0\u5173\u8054\u6210\u679C\u3002\u4EFB\u52A1\u53EF\u80FD\u5DF2\u6D3E\u53D1\uFF0C\u8BF7\u5148\u5237\u65B0\u6210\u679C\uFF0C\u907F\u514D\u91CD\u590D\u8BA1\u8D39\u3002\"\n : `DSH Turn \u5DF2\u7ED3\u675F\uFF0C\u5DF2\u53D1\u73B0 ${String(outputs.length)}/${String(job.expectedOutputs)} \u9879\u6210\u679C\uFF1B\u8BF7\u5237\u65B0\u6838\u5BF9\u5269\u4F59\u8F93\u51FA\u3002`\n };\n }\n if (outputs.length > 0) {\n return {\n ...job,\n status: job.status === \"failed\" ? \"failed\" : \"running\",\n progress: Math.max(10, Math.round(outputs.length / job.expectedOutputs * 100)),\n completedOutputs: outputs.length,\n error: job.status === \"failed\" ? job.error : undefined\n };\n }\n return job;\n });\n}\n\nexport function reconcileSequence(\n shotIds: readonly string[],\n current: readonly ProductionSequenceItem[],\n versions: readonly ProductionMediaVersion[],\n selections: Readonly<Record<string, string>>\n): ProductionSequenceItem[] {\n const shotSet = new Set(shotIds);\n const preserved = current.filter((item) => shotSet.has(item.shotId));\n const present = new Set(preserved.map((item) => item.shotId));\n const appended = shotIds.filter((shotId) => !present.has(shotId)).map((shotId) => ({ shotId }));\n return [...preserved, ...appended].map((item) => ({\n shotId: item.shotId,\n versionId: selectedVersionForTarget(item.shotId, versions, selections, \"video\")?.id\n }));\n}\n\nexport function sequenceIssues(sequence: readonly ProductionSequenceItem[], versions: readonly ProductionMediaVersion[]): string[] {\n const versionById = new Map(versions.map((version) => [version.id, version]));\n const issues: string[] = [];\n for (const item of sequence) {\n const version = item.versionId === undefined ? undefined : versionById.get(item.versionId);\n if (version === undefined || version.kind !== \"video\") issues.push(`${item.shotId} \u7F3A\u5C11\u5DF2\u9009\u89C6\u9891\u7248\u672C`);\n else if (version.path === undefined) issues.push(`${item.shotId} \u7684\u89C6\u9891\u6CA1\u6709\u53EF\u4F9B DSH \u8BFB\u53D6\u7684\u5DE5\u4F5C\u533A\u8DEF\u5F84`);\n }\n return issues;\n}\n\nexport function reorderSequence(sequence: readonly ProductionSequenceItem[], source: number, target: number): ProductionSequenceItem[] {\n if (!Number.isInteger(source) || !Number.isInteger(target)) return [...sequence];\n if (source < 0 || target < 0 || source >= sequence.length || target >= sequence.length || source === target) return [...sequence];\n const next = [...sequence];\n const [item] = next.splice(source, 1);\n if (item !== undefined) next.splice(target, 0, item);\n return next;\n}\n", "export const OH_STORY_PRODUCTION_TOOL_NAME = \"oh_story_production\";\n\nexport const PRODUCTION_INTENT_ACTIONS = [\n \"open_section\",\n \"focus_target\",\n \"set_sequence\",\n \"track_job\"\n] as const;\n\nexport const PRODUCTION_INTENT_SECTIONS = [\"shots\", \"assets\", \"tasks\", \"sequence\", \"canvas\"] as const;\nexport const PRODUCTION_INTENT_JOB_KINDS = [\"image\", \"video\", \"composition\"] as const;\n\nexport type ProductionIntentAction = typeof PRODUCTION_INTENT_ACTIONS[number];\nexport type ProductionIntentSection = typeof PRODUCTION_INTENT_SECTIONS[number];\nexport type ProductionIntentJobKind = typeof PRODUCTION_INTENT_JOB_KINDS[number];\n\nexport interface ProductionIntentArgs {\n readonly action: ProductionIntentAction;\n readonly episode: string;\n readonly section?: ProductionIntentSection | undefined;\n readonly targetId?: string | undefined;\n readonly shotIds?: readonly string[] | undefined;\n readonly jobId?: string | undefined;\n readonly jobKind?: ProductionIntentJobKind | undefined;\n readonly expectedOutputs?: number | undefined;\n readonly prompt?: string | undefined;\n}\n\nfunction requiredText(value: string | undefined, field: string): string {\n const normalized = value?.trim();\n if (!normalized) throw new Error(`oh_story_production ${field} is required for this action.`);\n if (normalized.length > 512) throw new Error(`oh_story_production ${field} is too long.`);\n return normalized;\n}\n\n/** Validate the cross-runtime UI intent without reading or mutating workspace state. */\nexport function validateProductionIntent(args: ProductionIntentArgs): ProductionIntentArgs {\n const episode = args.episode.trim().replaceAll(\"\\\\\", \"/\").replace(/\\/$/u, \"\");\n if (!/^\u5267\u96C6\\/EP\\d{3,}$/u.test(episode)) {\n throw new Error(\"oh_story_production episode must use the creator path form \u5267\u96C6/EP001.\");\n }\n if (args.action === \"open_section\") {\n if (args.section === undefined) throw new Error(\"oh_story_production section is required for open_section.\");\n return { action: args.action, episode, section: args.section };\n }\n if (args.action === \"focus_target\") {\n return { action: args.action, episode, targetId: requiredText(args.targetId, \"targetId\"), section: args.section };\n }\n if (args.action === \"set_sequence\") {\n const shotIds = args.shotIds?.map((value) => value.trim()).filter((value) => value !== \"\") ?? [];\n if (shotIds.length === 0) throw new Error(\"oh_story_production shotIds must contain at least one shot for set_sequence.\");\n if (shotIds.length > 500 || new Set(shotIds).size !== shotIds.length || shotIds.some((value) => !/^SHOT-[A-Z0-9-]+$/u.test(value))) {\n throw new Error(\"oh_story_production shotIds must be unique canonical SHOT-* identifiers.\");\n }\n return { action: args.action, episode, shotIds };\n }\n // Leave expectedOutputs/prompt undefined when the caller omits them: track_job re-registers a job the\n // workbench already created, and defaulting here would silently reset a batch's count to 1.\n const expectedOutputs = args.expectedOutputs;\n if (expectedOutputs !== undefined && (!Number.isInteger(expectedOutputs) || expectedOutputs < 1 || expectedOutputs > 500)) {\n throw new Error(\"oh_story_production expectedOutputs must be an integer between 1 and 500.\");\n }\n if (args.jobKind === undefined) throw new Error(\"oh_story_production jobKind is required for track_job.\");\n const prompt = args.prompt?.trim();\n return {\n action: args.action,\n episode,\n jobId: requiredText(args.jobId, \"jobId\"),\n targetId: requiredText(args.targetId, \"targetId\"),\n jobKind: args.jobKind,\n expectedOutputs,\n prompt: prompt === \"\" ? undefined : prompt\n };\n}\n", "import type { ChatSnapshot } from \"@deepseek-ai/dsh-client-ui-chat/client\";\nimport type { ToolCallBlock } from \"@deepseek-ai/dsh-client-ui-conversation/client\";\nimport {\n OH_STORY_PRODUCTION_TOOL_NAME,\n validateProductionIntent,\n type ProductionIntentArgs\n} from \"../production-intent.js\";\n\nexport interface SettledProductionIntent {\n readonly callId: string;\n readonly intent: ProductionIntentArgs;\n}\n\nfunction parsedIntent(block: ToolCallBlock): SettledProductionIntent | undefined {\n if (!(\"kind\" in block) || block.isError || block.call?.name !== OH_STORY_PRODUCTION_TOOL_NAME) return undefined;\n try {\n const args = JSON.parse(block.call.argsRaw) as ProductionIntentArgs;\n return { callId: block.callId, intent: validateProductionIntent(args) };\n } catch {\n return undefined;\n }\n}\n\nfunction visit(block: ToolCallBlock, output: SettledProductionIntent[]): void {\n const direct = parsedIntent(block);\n if (direct !== undefined) output.push(direct);\n for (const child of block.subCalls) visit(child, output);\n}\n\n/** Replay durable successful Agent UI intents in official DSH Chat order. */\nexport function settledProductionIntents(chat: ChatSnapshot): SettledProductionIntent[] {\n const output: SettledProductionIntent[] = [];\n for (const key of chat.order) {\n const node = chat.nodes.get(key);\n if (node?.kind !== \"tool-call\") continue;\n const root = (node.data as { readonly root?: ToolCallBlock }).root;\n if (root !== undefined) visit(root, output);\n }\n return output;\n}\n", "import { useEffect, useId, useRef, useState } from \"react\";\nimport { workbenchLabel, type WorkbenchMode } from \"./file-activity.js\";\nimport { endpoint, handleTabKey } from \"./workbench-ui.js\";\n\nexport interface VideoPreviewAsset {\n readonly role: \"source\" | \"edited\" | \"final\";\n readonly label: string;\n readonly path: string;\n readonly bytes: number;\n readonly version: string;\n readonly mimeType: string;\n}\n\nexport interface VideoArtifactSummary {\n readonly label: string;\n readonly path: string;\n readonly version: string;\n readonly kind: \"plan\" | \"script\" | \"subtitle\" | \"quality\" | \"manifest\";\n}\n\nexport interface VideoProject {\n readonly id: string;\n readonly root: string;\n readonly title: string;\n readonly state: \"not-started\" | \"working\" | \"waiting\" | \"ready\";\n readonly stage: string;\n readonly stageLabel: string;\n readonly nextArtifact?: string | undefined;\n readonly previews: readonly VideoPreviewAsset[];\n readonly artifacts: readonly VideoArtifactSummary[];\n}\n\ninterface FilePayload { readonly content: string }\ninterface VideoPreflight {\n readonly python: { readonly ok: boolean; readonly version?: string };\n readonly ffmpeg: { readonly ok: boolean; readonly subtitles: boolean };\n readonly ffprobe: { readonly ok: boolean };\n readonly credentials: { readonly mimo: boolean; readonly fish: boolean; readonly ttsProvider: string };\n}\n\nfunction preferredPreview(project: VideoProject): VideoPreviewAsset | undefined {\n return project.previews.find((item) => item.role === \"final\")\n ?? project.previews.find((item) => item.role === \"edited\")\n ?? project.previews.find((item) => item.role === \"source\");\n}\n\nfunction readableBytes(bytes: number): string {\n if (bytes < 1_024 * 1_024) return `${(bytes / 1_024).toFixed(1)} KB`;\n if (bytes < 1_024 * 1_024 * 1_024) return `${(bytes / (1_024 * 1_024)).toFixed(1)} MB`;\n return `${(bytes / (1_024 * 1_024 * 1_024)).toFixed(2)} GB`;\n}\n\nfunction ActionIcon({ name }: { readonly name: \"reload\" | \"fullscreen\" | \"external\" }) {\n const paths = {\n reload: <><path d=\"M20 11a8 8 0 1 0-2.34 5.66\"/><path d=\"M20 4v7h-7\"/></>,\n fullscreen: <><path d=\"M8 3H3v5M16 3h5v5M8 21H3v-5M16 21h5v-5\"/></>,\n external: <><path d=\"M14 3h7v7M21 3l-9 9\"/><path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\"/></>\n };\n return <svg aria-hidden viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">{paths[name]}</svg>;\n}\n\nfunction preferredArtifact(project: VideoProject): VideoArtifactSummary | undefined {\n return project.artifacts.find((item) => item.path.endsWith(\"final_qc.json\"))\n ?? project.artifacts.find((item) => item.path.endsWith(\"assembly_qc.json\"))\n ?? project.artifacts.find((item) => item.kind === \"quality\")\n ?? project.artifacts.at(-1);\n}\n\nfunction artifactKindLabel(kind: VideoArtifactSummary[\"kind\"]): string {\n return { plan: \"\u65B9\u6848\", script: \"\u6587\u7A3F\", subtitle: \"\u5B57\u5E55\", quality: \"\u8D28\u68C0\", manifest: \"\u6E05\u5355\" }[kind];\n}\n\nfunction VideoPreview({ project, sessionId, running }: { readonly project: VideoProject; readonly sessionId: string; readonly running: boolean }) {\n const shellRef = useRef<HTMLDivElement>(null);\n const initial = preferredPreview(project);\n const [role, setRole] = useState<VideoPreviewAsset[\"role\"] | undefined>(initial?.role);\n const selected = project.previews.find((item) => item.role === role) ?? preferredPreview(project);\n const [loaded, setLoaded] = useState(initial);\n const [revision, setRevision] = useState(0);\n const [ready, setReady] = useState(false);\n const [error, setError] = useState(false);\n if (selected === undefined || loaded === undefined) return <div className=\"oh-video-preview-empty\">\n <span aria-hidden>\u25B6</span>\n <strong>\u8FD8\u6CA1\u6709\u53EF\u9884\u89C8\u7684\u89C6\u9891</strong>\n <p>\u628A\u539F\u7247\u5BFC\u5165 <code>video-recaps/&lt;\u9879\u76EE&gt;/sources/</code>\uFF0C\u7136\u540E\u5728\u53F3\u4FA7 Chat \u4F7F\u7528 <code>/video-recap</code>\u3002\u526A\u540E\u7247\u548C\u6700\u7EC8\u6210\u7247\u4F1A\u81EA\u52A8\u51FA\u73B0\u5728\u8FD9\u91CC\u3002</p>\n <div className=\"oh-video-prompt-example\"><span>\u63CF\u8FF0\u793A\u4F8B</span><q>\u628A\u8FD9\u6BB5\u89C6\u9891\u505A\u6210 3 \u5206\u949F\u4E2D\u6587\u89E3\u8BF4\uFF0C\u4FDD\u7559\u5173\u952E\u539F\u58F0\uFF0C\u5B57\u5E55\u70E7\u8FDB\u753B\u9762\u3002</q></div>\n </div>;\n const pending = selected.path !== loaded.path || selected.version !== loaded.version;\n const load = (asset: VideoPreviewAsset): void => {\n setRole(asset.role);\n setLoaded(asset);\n setReady(false);\n setError(false);\n setRevision((value) => value + 1);\n };\n const runtimeState = error ? \"\u89C6\u9891\u8F7D\u5165\u5931\u8D25 \u00B7 \u53EF\u91CD\u65B0\u8F7D\u5165\"\n : running ? \"Agent \u6B63\u5728\u66F4\u65B0\u9879\u76EE \u00B7 \u5F53\u524D\u64AD\u653E\u4FDD\u6301\u4E0D\u53D8\"\n : pending ? \"\u65B0\u7248\u672C\u5DF2\u5C31\u7EEA \u00B7 \u7531\u4F60\u51B3\u5B9A\u4F55\u65F6\u8F7D\u5165\"\n : ready ? `${loaded.label}\u5DF2\u8F7D\u5165 \u00B7 ${readableBytes(loaded.bytes)}` : \"\u6B63\u5728\u8BFB\u53D6\u89C6\u9891\u4FE1\u606F\u2026\";\n const mediaUrl = `${endpoint(\"media\", sessionId, loaded.path)}&version=${encodeURIComponent(loaded.version)}&reload=${String(revision)}`;\n return <div ref={shellRef} className=\"oh-video-preview-shell\" data-state={error ? \"error\" : running ? \"building\" : ready ? \"ready\" : \"loading\"}>\n <div className=\"oh-video-stagebar\">\n <div className=\"oh-video-version-tabs\" role=\"tablist\" aria-label=\"\u9884\u89C8\u7248\u672C\">\n {project.previews.map((asset) => <button\n type=\"button\"\n role=\"tab\"\n key={asset.role}\n aria-selected={asset.role === selected.role}\n tabIndex={asset.role === selected.role ? 0 : -1}\n onKeyDown={(event) => { handleTabKey(event, project.previews.map((item) => item.role), selected.role, (next) => {\n const asset = project.previews.find((item) => item.role === next);\n if (asset !== undefined) load(asset);\n }); }}\n onClick={() => { load(asset); }}\n >{asset.label}</button>)}\n </div>\n <span className=\"oh-video-runtime-state\" role=\"status\" aria-live=\"polite\"><i aria-hidden /><em>{runtimeState}</em></span>\n <div className=\"oh-video-preview-actions\">\n {pending && <button type=\"button\" onClick={() => { load(selected); }}>\u8F7D\u5165\u65B0\u7248\u672C</button>}\n <button type=\"button\" title=\"\u91CD\u65B0\u8F7D\u5165\" aria-label=\"\u91CD\u65B0\u8F7D\u5165\u89C6\u9891\" onClick={() => { load(loaded); }}><ActionIcon name=\"reload\" /></button>\n <button type=\"button\" title=\"\u5168\u5C4F\" aria-label=\"\u5168\u5C4F\u9884\u89C8\" onClick={() => { void shellRef.current?.requestFullscreen(); }}><ActionIcon name=\"fullscreen\" /></button>\n <a href={mediaUrl} target=\"_blank\" rel=\"noreferrer\" title=\"\u5728\u65B0\u7A97\u53E3\u6253\u5F00\" aria-label=\"\u5728\u65B0\u7A97\u53E3\u6253\u5F00\u89C6\u9891\"><ActionIcon name=\"external\" /></a>\n </div>\n </div>\n <div className=\"oh-video-player-stage\">\n <video\n key={`${loaded.path}:${loaded.version}:${String(revision)}`}\n src={mediaUrl}\n controls\n preload=\"metadata\"\n playsInline\n onLoadedMetadata={() => { setReady(true); setError(false); }}\n onError={() => { setError(true); setReady(false); }}\n />\n </div>\n </div>;\n}\n\nfunction VideoArtifacts({ project, sessionId }: { readonly project: VideoProject; readonly sessionId: string }) {\n const [selected, setSelected] = useState(preferredArtifact(project)?.path);\n const [content, setContent] = useState<string>();\n const [error, setError] = useState<string>();\n const [preflight, setPreflight] = useState<VideoPreflight | \"failed\">();\n useEffect(() => { setSelected(preferredArtifact(project)?.path); }, [project.id]);\n useEffect(() => {\n if (selected === undefined) { setContent(undefined); return; }\n const controller = new AbortController();\n setContent(undefined);\n setError(undefined);\n void fetch(endpoint(\"file\", sessionId, selected), { signal: controller.signal })\n .then(async (response) => {\n const payload = await response.json() as FilePayload & { readonly error?: string };\n if (!response.ok) throw new Error(payload.error ?? `HTTP ${String(response.status)}`);\n setContent(payload.content);\n })\n .catch((reason: unknown) => { if (!controller.signal.aborted) setError(reason instanceof Error ? reason.message : String(reason)); });\n return () => { controller.abort(); };\n }, [selected, sessionId]);\n const selectedArtifact = project.artifacts.find((item) => item.path === selected);\n return <div className=\"oh-video-artifacts\">\n <aside aria-label=\"\u89C6\u9891\u9879\u76EE\u4EA7\u7269\">\n <div className=\"oh-video-artifacts-heading\"><strong>\u9879\u76EE\u4EA7\u7269</strong><span>{project.artifacts.length}</span></div>\n <div className=\"oh-video-environment\">\n <strong>\u8FD0\u884C\u73AF\u5883</strong>\n {typeof preflight === \"object\" ? <>\n <span data-ready={preflight.python.ok || undefined}>Python {preflight.python.version ?? \"\u672A\u627E\u5230\"}</span>\n <span data-ready={(preflight.ffmpeg.ok && preflight.ffmpeg.subtitles) || undefined}>ffmpeg {preflight.ffmpeg.subtitles ? \"\u00B7 libass\" : \"\u00B7 \u7F3A\u5B57\u5E55\u6EE4\u955C\"}</span>\n <span data-ready={preflight.ffprobe.ok || undefined}>ffprobe {preflight.ffprobe.ok ? \"\u53EF\u7528\" : \"\u672A\u627E\u5230\"}</span>\n <span data-ready={preflight.credentials.mimo || undefined}>MiMo Key {preflight.credentials.mimo ? \"\u5DF2\u914D\u7F6E\" : \"\u672A\u914D\u7F6E\"}</span>\n {preflight.credentials.ttsProvider === \"fish\"\n && <span data-ready={preflight.credentials.fish || undefined}>Fish Key {preflight.credentials.fish ? \"\u5DF2\u914D\u7F6E\" : \"\u672A\u914D\u7F6E\"}</span>}\n <em>DSH Host \u8FDB\u7A0B\u73AF\u5883\uFF1BAgent \u6267\u884C\u4E16\u754C\u4EE5 <code>video-recap --doctor</code> \u4E3A\u51C6\u3002</em>\n </> : <button type=\"button\" onClick={() => {\n void fetch(endpoint(\"video-preflight\", sessionId)).then(async (response) => {\n if (!response.ok) throw new Error(`HTTP ${String(response.status)}`);\n setPreflight(await response.json() as VideoPreflight);\n }).catch(() => { setPreflight(\"failed\"); });\n }}>{preflight === \"failed\" ? \"\u73AF\u5883\u68C0\u67E5\u5931\u8D25 \u00B7 \u91CD\u8BD5\" : \"\u68C0\u67E5\u73AF\u5883\"}</button>}\n </div>\n <nav>\n {project.artifacts.length === 0 && <p>\u6D41\u6C34\u7EBF\u542F\u52A8\u540E\uFF0C\u5173\u952E\u4EA7\u7269\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002</p>}\n {project.artifacts.map((artifact) => <button\n type=\"button\"\n key={artifact.path}\n aria-current={artifact.path === selected ? \"page\" : undefined}\n onClick={() => { setSelected(artifact.path); }}\n ><span>{artifact.label}</span><small>{artifact.path.split(\"/\").at(-1)}</small></button>)}\n </nav>\n </aside>\n <section>\n {selectedArtifact !== undefined && <header className=\"oh-video-artifact-header\">\n <div><strong>{selectedArtifact.label}</strong><span>{selectedArtifact.path.split(\"/\").at(-1)}</span></div>\n <em>{artifactKindLabel(selectedArtifact.kind)}</em>\n </header>}\n <div className=\"oh-video-artifact-content\">{project.artifacts.length === 0 ? <div className=\"oh-video-artifacts-empty\">\u6545\u4E8B\u65B9\u6848\u3001\u89E3\u8BF4\u8BCD\u3001\u5B57\u5E55\u548C\u8D28\u68C0\u62A5\u544A\u4F1A\u6309\u4E0A\u6E38\u6D41\u6C34\u7EBF\u5199\u5165\u8FD9\u91CC\u3002</div>\n : error !== undefined ? <div className=\"oh-story-error\">{error}</div>\n : content === undefined ? <div className=\"oh-video-artifacts-empty\">\u6B63\u5728\u8F7D\u5165\u4EA7\u7269\u2026</div>\n : <pre>{content}</pre>}</div>\n </section>\n </div>;\n}\n\nexport function VideoStudio({\n sessionId,\n projects,\n running,\n projectId,\n tab,\n hidden,\n workbenches,\n paneId,\n labelledBy,\n onProject,\n onTab,\n onWorkbench,\n onCollapse\n}: {\n readonly sessionId: string;\n readonly projects: readonly VideoProject[];\n readonly running: boolean;\n readonly projectId: string | undefined;\n readonly tab: \"preview\" | \"artifacts\";\n readonly hidden: boolean;\n readonly workbenches: readonly WorkbenchMode[];\n readonly paneId: string;\n readonly labelledBy: string;\n readonly onProject: (id: string) => void;\n readonly onTab: (tab: \"preview\" | \"artifacts\") => void;\n readonly onWorkbench: (mode: WorkbenchMode) => void;\n readonly onCollapse: () => void;\n}) {\n const project = projects.find((item) => item.id === projectId) ?? projects[0];\n const tabsId = useId();\n useEffect(() => { if (project !== undefined && project.id !== projectId) onProject(project.id); }, [onProject, project, projectId]);\n const tabs = [\"preview\", \"artifacts\"] as const;\n return <main id={paneId} className=\"oh-video-studio\" role=\"tabpanel\" aria-labelledby={labelledBy} hidden={hidden}>\n <header className=\"oh-video-toolbar\">\n <div className=\"oh-workbench-cluster\">\n <div className=\"oh-video-mode-tabs\" role=\"tablist\" aria-label=\"\u521B\u4F5C\u5DE5\u4F5C\u53F0\">{workbenches.map((mode) => <button\n type=\"button\" role=\"tab\" key={mode} aria-selected={mode === \"video\"} tabIndex={mode === \"video\" ? 0 : -1}\n onKeyDown={(event) => { handleTabKey(event, workbenches, \"video\", onWorkbench); }} onClick={() => { onWorkbench(mode); }}\n >{workbenchLabel(mode)}</button>)}</div>\n <button className=\"oh-workbench-collapse\" type=\"button\" title=\"\u6536\u8D77\u521B\u4F5C\u5DE5\u4F5C\u53F0\" aria-label=\"\u6536\u8D77\u521B\u4F5C\u5DE5\u4F5C\u53F0\" onClick={onCollapse}>\u00D7</button>\n </div>\n <label className=\"oh-video-project\"><span>\u89C6\u9891\u9879\u76EE</span><select aria-label=\"\u89C6\u9891\u9879\u76EE\" value={project?.id ?? \"\"} disabled={project === undefined} onChange={(event) => { onProject(event.target.value); }}>\n {projects.map((item) => <option key={item.id} value={item.id}>{item.title}</option>)}\n </select></label>\n {project !== undefined && <span className=\"oh-video-stage\" data-state={project.state}><i aria-hidden />{project.stageLabel}</span>}\n <div className=\"oh-video-tabs\" role=\"tablist\" aria-label=\"\u89C6\u9891\u5DE5\u4F5C\u53F0\">{tabs.map((item) => <button\n type=\"button\" role=\"tab\" key={item} id={`${tabsId}-${item}-tab`} aria-controls={`${tabsId}-${item}-panel`}\n aria-selected={tab === item} tabIndex={tab === item ? 0 : -1}\n onKeyDown={(event) => { handleTabKey(event, tabs, tab, onTab); }} onClick={() => { onTab(item); }}\n >{item === \"preview\" ? \"\u9884\u89C8\" : \"\u4EA7\u7269\"}</button>)}</div>\n </header>\n {project === undefined ? <div className=\"oh-video-preview-empty\"><span aria-hidden>\u25B6</span><strong>\u8FD8\u6CA1\u6709\u89C6\u9891\u9879\u76EE</strong><p>\u5728\u53F3\u4FA7 Chat \u544A\u8BC9 Agent \u8981\u5904\u7406\u7684\u89C6\u9891\uFF1B\u9879\u76EE\u4F1A\u521B\u5EFA\u5728 <code>video-recaps/&lt;\u9879\u76EE&gt;/</code>\u3002</p></div> : <div className=\"oh-video-panels\">\n <div role=\"tabpanel\" id={`${tabsId}-preview-panel`} aria-labelledby={`${tabsId}-preview-tab`} hidden={tab !== \"preview\"}><VideoPreview key={project.id} project={project} sessionId={sessionId} running={running} /></div>\n <div role=\"tabpanel\" id={`${tabsId}-artifacts-panel`} aria-labelledby={`${tabsId}-artifacts-tab`} hidden={tab !== \"artifacts\"}><VideoArtifacts project={project} sessionId={sessionId} /></div>\n </div>}\n </main>;\n}\n", "/**\n * DSH is a general Harness: one installed plugin must not turn every Session\n * into a writing surface. The workbench claims the conversation layout only for\n * a workspace that actually holds creative work, and the creator can always\n * take the layout back.\n */\n\nexport type WorkbenchPreference = \"open\" | \"closed\";\n\nexport interface WorkbenchWorkspace {\n readonly files: readonly unknown[];\n readonly games: readonly { readonly source: \"workspace\" | \"example\" }[];\n readonly videos: readonly unknown[];\n}\n\nexport interface WorkbenchPreferenceStorage {\n getItem: (key: string) => string | null;\n setItem: (key: string, value: string) => void;\n}\n\n/** The bundled game example ships with the plugin, so it never marks a workspace as creative. */\nexport function hasCreativeProject(workspace: WorkbenchWorkspace | undefined): boolean {\n if (workspace === undefined) return false;\n return workspace.files.length > 0\n || workspace.videos.length > 0\n || workspace.games.some((game) => game.source === \"workspace\");\n}\n\n/** An explicit creator choice always wins over what the workspace happens to contain. */\nexport function resolveWorkbenchOpen(preference: WorkbenchPreference | undefined, creativeProject: boolean): boolean {\n return preference === undefined ? creativeProject : preference === \"open\";\n}\n\nexport function workbenchPreferenceKey(cwd: string): string {\n return `oh-story.workbench.${cwd}`;\n}\n\n/** The DSH Session Store is not persisted, so the choice is kept per workspace instead. */\nexport function readWorkbenchPreference(storage: WorkbenchPreferenceStorage | undefined, cwd: string | undefined): WorkbenchPreference | undefined {\n if (storage === undefined || cwd === undefined) return undefined;\n let value: string | null;\n try { value = storage.getItem(workbenchPreferenceKey(cwd)); }\n catch { return undefined; }\n return value === \"open\" || value === \"closed\" ? value : undefined;\n}\n\nexport function writeWorkbenchPreference(storage: WorkbenchPreferenceStorage | undefined, cwd: string | undefined, preference: WorkbenchPreference): void {\n if (storage === undefined || cwd === undefined) return;\n // Private windows and blocked site data refuse to persist; the Session still keeps the choice.\n try { storage.setItem(workbenchPreferenceKey(cwd), preference); }\n catch { /* the Session Store remains the in-session authority */ }\n}\n\n/** Reading the property itself throws when the browser blocks site data. */\nexport function workbenchPreferenceStorage(): WorkbenchPreferenceStorage | undefined {\n try { return globalThis.localStorage; }\n catch { return undefined; }\n}\n", ".oh-story-bridge-marker { display: none; }\n.oh-story-welcome {\n box-sizing: border-box;\n order: -1;\n flex-shrink: 0;\n width: min(640px, calc(100% - 32px));\n margin: 24px auto;\n padding: 20px 24px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 12px;\n color: var(--dsw-alias-label-primary);\n background: var(--dsw-alias-bg-base);\n font: 14px/1.7 var(--dsw-font-family);\n overflow-wrap: anywhere;\n}\n.oh-story-welcome h2 { margin: 0 0 8px; font-size: 20px; }\n.oh-story-welcome p { margin: 8px 0 0; }\n.oh-story-welcome ol { margin: 12px 0; padding-left: 24px; }\n.oh-story-split-surface { display: contents; font-family: var(--dsw-font-family); }\n\n/* Collapsed, the plugin owns nothing but this control: DSH renders the\n conversation exactly as it does without the plugin installed. The launcher is\n fixed to the conversation column's own corner, which the bridge publishes,\n because the surrounding shell is not ours to place things in. */\n.oh-story-launcher {\n box-sizing: border-box;\n display: flex;\n position: fixed;\n z-index: 9;\n top: calc(var(--oh-story-seam-top, 0px) + 10px);\n right: calc(var(--oh-story-seam-right, 0px) + 14px);\n min-height: 28px;\n align-items: center;\n gap: 6px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 999px;\n color: var(--dsw-alias-label-secondary);\n background: var(--dsw-alias-bg-base);\n padding: 3px 11px;\n cursor: pointer;\n font-family: var(--dsw-font-family);\n font-size: 12px;\n line-height: 20px;\n}\n.oh-story-launcher b { font-weight: 500; }\n.oh-story-launcher:hover { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-interactive-bg-hover); }\n.oh-story-launcher:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: 2px; }\n\n/* DSH documents every [data-slot] wrapper as a stable addressable styling\n seam. The official Session body and composer stay mounted; this only turns\n their scroll host into a three-column writing surface. */\n[data-conversation-scroll]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"]) {\n --os-border: var(--dsw-alias-border-l2);\n --os-muted: var(--dsw-alias-label-secondary);\n display: grid;\n grid-template-columns: clamp(184px, 16%, 200px) minmax(240px, 1fr) clamp(408px, 40%, 520px);\n grid-template-rows: minmax(0, 1fr);\n min-height: 0;\n overflow-x: hidden;\n overflow-y: auto;\n position: relative;\n scrollbar-gutter: stable;\n scroll-padding-bottom: calc(max(var(--dsh-composer-height, 152px), var(--oh-story-composer-height, 0px)) + 16px);\n}\n\n/* Keep the final Chat flow above the overlapping official Composer. */\n[data-conversation-scroll]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"])\n > [data-slot=\"conversation.session\"] > :not(.oh-story-split-surface) {\n grid-column: 3;\n grid-row: 1;\n min-width: 0;\n min-height: 100%;\n border-left: 1px solid var(--os-border);\n}\n\n[data-conversation-scroll]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"])\n [data-chat-flow] {\n padding-bottom: calc(max(var(--dsh-composer-height, 152px), var(--oh-story-composer-height, 0px)) + 16px);\n}\n\n[data-conversation-scroll]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"])\n > [data-composer-seat] {\n grid-column: 3;\n grid-row: 1;\n align-self: start;\n min-width: 0;\n width: 100%;\n position: sticky;\n top: calc(var(--oh-story-scroll-height, 720px) - max(var(--dsh-composer-height, 152px), var(--oh-story-composer-height, 0px)));\n bottom: auto;\n}\n\n/* Game mode keeps the official Conversation on the right but merges the two\n creator columns into one playable Studio. */\n[data-conversation-scroll][data-oh-story-workbench=\"game\"]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"]) {\n --game-stage: #0d100e;\n --game-stage-raised: #161a17;\n --game-accent: var(--dsw-alias-state-business-primary);\n --game-warning: #f4bd55;\n --game-danger: #f06b63;\n grid-template-columns: minmax(0, 1fr) clamp(400px, 34%, 520px);\n overflow: hidden;\n}\n\n[data-conversation-scroll][data-oh-story-workbench=\"game\"]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"])\n > [data-slot=\"conversation.session\"] > :not(.oh-story-split-surface),\n[data-conversation-scroll][data-oh-story-workbench=\"game\"]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"])\n > [data-composer-seat] { grid-column: 2; }\n\n/* DSH 0.1.2 lays two 40px column-resize strips (z-index 8) over the whole\n conversation area. The workbench replaces that column geometry, so the strip\n no longer marks a real column seam here \u2014 it just swallows clicks on the\n right edge of the file tree. The creator panes take the clicks back. */\n.oh-story-tree,\n.oh-story-editor {\n box-sizing: border-box;\n grid-row: 1;\n position: sticky;\n z-index: 9;\n top: 0;\n align-self: start;\n min-width: 0;\n min-height: 0;\n height: 100%;\n color: inherit;\n background: var(--dsw-alias-bg-base);\n}\n\n.oh-game-studio {\n box-sizing: border-box;\n display: flex;\n grid-column: 1;\n grid-row: 1;\n position: sticky;\n z-index: 9;\n top: 0;\n min-width: 0;\n min-height: 0;\n height: 100%;\n align-self: start;\n overflow: hidden;\n flex-direction: column;\n border-right: 1px solid var(--os-border);\n color: var(--dsw-alias-label-primary);\n background: var(--dsw-alias-bg-base);\n}\n.oh-game-studio[hidden] { display: none; }\n\n.oh-game-toolbar {\n box-sizing: border-box;\n display: grid;\n min-height: 56px;\n flex: none;\n grid-template-columns: auto minmax(160px, 1fr) auto;\n align-items: center;\n gap: 9px;\n padding: 8px 12px;\n border-bottom: 1px solid var(--os-border);\n background: var(--dsw-alias-bg-base);\n}\n\n.oh-game-mode-tabs {\n display: flex;\n margin-right: 2px;\n padding-right: 9px;\n border-right: 1px solid var(--os-border);\n}\n.oh-game-mode-tabs button {\n min-width: 42px;\n min-height: 36px;\n border: 0;\n border-radius: 5px;\n color: var(--os-muted);\n background: transparent;\n padding: 4px 7px;\n cursor: pointer;\n white-space: nowrap;\n font: 11px/1 var(--dsw-font-family);\n}\n.oh-game-mode-tabs button:hover { color: var(--dsw-alias-label-primary); }\n.oh-game-mode-tabs button[aria-selected=\"true\"] { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-button-ghost-active-fill); font-weight: 500; }\n\n.oh-game-project { display: flex; min-width: 0; align-items: center; gap: 7px; color: var(--os-muted); font-size: 11px; }\n.oh-game-project > span { flex: none; }\n.oh-game-project select,\n.oh-game-design select {\n min-width: 0;\n border: 1px solid var(--os-border);\n border-radius: 8px;\n color: var(--dsw-alias-label-primary);\n background: var(--dsw-alias-bg-base);\n padding: 6px 28px 6px 9px;\n font: inherit;\n}\n.oh-game-project select { max-width: 360px; min-height: 36px; flex: 1; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }\n.oh-game-design select { min-height: 36px; }\n.oh-game-project select:focus-visible,\n.oh-game-design select:focus-visible,\n.oh-game-mode-tabs button:focus-visible,\n.oh-game-tabs button:focus-visible,\n.oh-game-preview-status button:focus-visible,\n.oh-game-mobile-switcher button:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: 1px; }\n\n.oh-game-tabs,\n.oh-game-mobile-switcher {\n display: flex;\n padding: 2px;\n border: 1px solid var(--os-border);\n border-radius: 9px;\n background: var(--dsw-alias-bg-base);\n}\n.oh-game-tabs button,\n.oh-game-mobile-switcher button {\n min-width: 56px;\n min-height: 36px;\n border: 0;\n border-radius: 6px;\n color: var(--os-muted);\n background: transparent;\n cursor: pointer;\n font: 12px/1 var(--dsw-font-family);\n}\n.oh-game-tabs button:hover,\n.oh-game-mobile-switcher button:hover { color: var(--dsw-alias-label-primary); }\n.oh-game-tabs button[aria-selected=\"true\"],\n.oh-game-mobile-switcher button[aria-selected=\"true\"] { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-button-ghost-active-fill); box-shadow: 0 1px 2px rgb(0 0 0 / 7%); font-weight: 600; }\n.oh-game-panels,\n.oh-game-panel {\n display: flex;\n min-width: 0;\n min-height: 0;\n flex: 1;\n overflow: hidden;\n flex-direction: column;\n}\n.oh-game-panel[hidden] { display: none; }\n\n.oh-game-preview-shell {\n display: grid;\n min-width: 0;\n min-height: 0;\n flex: 1;\n grid-template-rows: 40px minmax(0, 1fr);\n position: relative;\n overflow: hidden;\n border-top: 2px solid var(--game-accent);\n background-color: var(--game-stage);\n}\n.oh-game-preview-shell[data-state=\"building\"] { border-top-color: var(--game-warning); animation: oh-game-build-line 1.4s linear infinite; }\n.oh-game-preview-shell[data-state=\"error\"] { border-top-color: var(--game-danger); }\n.oh-game-preview-status {\n display: flex;\n min-width: 0;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n padding: 0 10px 0 12px;\n color: rgb(244 248 240 / 76%);\n background: var(--game-stage-raised);\n font-size: 11px;\n}\n.oh-game-runtime-state { display: inline-flex; overflow: hidden; min-width: 0; align-items: center; gap: 7px; text-overflow: ellipsis; white-space: nowrap; }\n.oh-game-runtime-state > i { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--dsw-alias-state-success-primary, #45b96f); }\n.oh-game-preview-shell[data-state=\"loading\"] .oh-game-runtime-state > i { background: rgb(255 255 255 / 42%); box-shadow: none; }\n.oh-game-preview-shell[data-state=\"building\"] .oh-game-runtime-state > i { background: var(--game-warning); }\n.oh-game-preview-shell[data-state=\"error\"] .oh-game-runtime-state > i { background: var(--game-danger); }\n.oh-game-preview-status > div { display: flex; flex: none; gap: 6px; }\n.oh-game-preview-status button {\n min-height: 36px;\n border: 1px solid rgb(255 255 255 / 14%);\n border-radius: 6px;\n color: rgb(255 255 255 / 84%);\n background: rgb(255 255 255 / 5%);\n padding: 3px 8px;\n cursor: pointer;\n font: inherit;\n}\n.oh-game-preview-status button:hover { background: rgb(255 255 255 / 11%); }\n.oh-game-reload { display: inline-flex; align-items: center; gap: 5px; }\n.oh-game-reload b { font: inherit; font-weight: 500; }\n.oh-game-preview-shell iframe { width: 100%; height: 100%; min-width: 0; min-height: 0; border: 0; background: var(--game-stage); }\n.oh-game-focus-hint {\n position: absolute;\n right: 10px;\n bottom: 10px;\n z-index: 2;\n padding: 4px 8px;\n border: 1px solid rgb(255 255 255 / 12%);\n border-radius: 6px;\n color: rgb(255 255 255 / 62%);\n background: rgb(8 10 9 / 82%);\n pointer-events: none;\n font-size: 10px;\n}\n.oh-game-focus-hint[data-focused] { color: var(--game-accent); }\n\n.oh-game-preview-empty,\n.oh-game-design-empty {\n display: grid;\n max-width: 560px;\n margin: auto;\n padding: 36px;\n place-items: center;\n gap: 8px;\n color: var(--os-muted);\n text-align: center;\n line-height: 1.65;\n}\n.oh-game-preview-empty { width: 100%; max-width: none; min-height: 0; flex: 1; box-sizing: border-box; align-content: center; color: rgb(244 248 240 / 70%); background: var(--game-stage); }\n.oh-game-preview-empty > span { color: var(--game-accent); font-size: 30px; }\n.oh-game-preview-empty strong,\n.oh-game-design-empty strong { color: inherit; font-size: 15px; }\n.oh-game-preview-empty p,\n.oh-game-design-empty p { margin: 0; }\n.oh-game-preview-empty code,\n.oh-game-design-empty code { font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }\n.oh-game-prompt-example { display: grid; max-width: 560px; gap: 4px; margin-top: 8px; padding: 10px 12px; border: 1px solid rgb(255 255 255 / 12%); border-radius: 8px; text-align: left; }\n.oh-game-prompt-example span { color: var(--game-accent); font-size: 10px; font-weight: 600; }\n.oh-game-prompt-example q { color: rgb(244 248 240 / 72%); quotes: none; font-size: 11px; }\n\n.oh-game-design { display: flex; min-height: 0; flex: 1; overflow: hidden; flex-direction: column; }\n.oh-game-design > label { display: flex; min-height: 42px; flex: none; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--os-border); color: var(--os-muted); font-size: 11px; }\n.oh-game-design select { max-width: min(560px, 75%); }\n.oh-game-source { box-sizing: border-box; min-height: 0; flex: 1; overflow: auto; margin: 0; padding: 18px 22px 48px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-markdown-code-block); white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }\n\n.oh-game-mobile-switcher { display: none; }\n\n@keyframes oh-game-build-line { 50% { border-top-color: var(--game-accent); } }\n\n.oh-story-tree {\n grid-column: 1;\n overflow: auto;\n padding: 14px 10px 24px;\n border-right: 1px solid var(--os-border);\n background: var(--dsw-specific-sidebar-fill);\n}\n\n.oh-story-editor {\n display: flex;\n grid-column: 2;\n overflow: hidden;\n flex-direction: column;\n}\n\n.oh-story-brand,\n.oh-story-editor header,\n.oh-story-role summary {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n}\n\n.oh-story-brand { min-height: 28px; gap: 8px; padding: 0 5px 8px 7px; font-size: 14px; font-weight: 500; white-space: nowrap; }\n.oh-story-brand-cluster { display: flex; min-width: 0; align-items: center; gap: 6px; }\n.oh-story-brand-cluster strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: inherit; }\n.oh-story-kind { flex: none; padding: 1px 6px; border-radius: 5px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-button-ghost-active-fill); font-size: 11px; line-height: 16px; font-weight: 500; }\n\n.oh-story-brand button,\n.oh-story-save,\n.oh-story-role button {\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 999px;\n color: var(--dsw-alias-label-secondary);\n background: var(--dsw-alias-bg-base);\n padding: 3px 9px;\n cursor: pointer;\n font: inherit;\n}\n\n.oh-story-brand button { display: grid; width: 28px; height: 28px; place-items: center; border: 0; padding: 0; background: transparent; font-size: 16px; }\n.oh-story-brand button:hover,\n.oh-story-save:hover:not(:disabled),\n.oh-story-role button:hover { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-interactive-bg-hover); }\n.oh-story-brand button:focus-visible,\n.oh-story-save:focus-visible,\n.oh-story-mode-tabs button:focus-visible,\n.oh-story-editor-tabs button:focus-visible,\n.oh-story-tree nav button:focus-visible,\n.oh-story-role button:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: -2px; }\n.oh-story-save:disabled { opacity: .48; cursor: default; }\n\n.oh-story-brand-actions { display: flex; flex: none; align-items: center; gap: 2px; }\n\n.oh-workbench-cluster { display: flex; min-width: 0; align-items: center; gap: 6px; }\n.oh-workbench-collapse {\n display: grid;\n width: 28px;\n height: 28px;\n flex: none;\n place-items: center;\n border: 0;\n border-radius: 5px;\n color: var(--os-muted);\n background: transparent;\n padding: 0;\n cursor: pointer;\n font: inherit;\n font-size: 16px;\n}\n.oh-workbench-collapse:hover { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-interactive-bg-hover); }\n.oh-workbench-collapse:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: -2px; }\n\n.oh-story-mode-tabs { display: flex; margin: 0 4px 8px; padding: 2px; border: 1px solid var(--os-border); border-radius: 7px; background: var(--dsw-alias-bg-layer-1); }\n\n.oh-story-mode-tabs button,\n.oh-story-editor-tabs button {\n position: relative;\n min-height: 24px;\n flex: 1;\n border: 0;\n color: var(--os-muted);\n background: transparent;\n border-radius: 5px;\n cursor: pointer;\n font: inherit;\n font-size: 11px;\n}\n\n.oh-story-mode-tabs button:hover,\n.oh-story-editor-tabs button:hover { color: var(--dsw-alias-label-primary); }\n.oh-story-mode-tabs button[aria-selected=\"true\"],\n.oh-story-editor-tabs button[aria-selected=\"true\"] { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-bg-base); box-shadow: 0 1px 2px rgb(0 0 0 / 8%); font-weight: 500; }\n\n.oh-story-file-group,\n.oh-story-file-folder { margin: 0; }\n.oh-story-file-group > summary,\n.oh-story-file-folder > summary {\n display: flex;\n align-items: center;\n gap: 5px;\n min-height: 26px;\n padding: 0 7px;\n border-radius: 6px;\n color: var(--os-muted);\n cursor: pointer;\n list-style: none;\n font-size: 11px;\n font-weight: 600;\n}\n.oh-story-file-folder > summary { padding-left: min(calc(7px + var(--oh-story-indent, 0px)), 49px); }\n.oh-story-file-group > summary { margin-top: 3px; }\n.oh-story-file-group > summary::-webkit-details-marker,\n.oh-story-file-folder > summary::-webkit-details-marker { display: none; }\n.oh-story-file-group > summary::before,\n.oh-story-file-folder > summary::before { width: 8px; content: \"\u203A\"; transform: rotate(0); transition: transform .12s ease; }\n.oh-story-file-group[open] > summary::before,\n.oh-story-file-folder[open] > summary::before { transform: rotate(90deg); }\n.oh-story-file-group > summary:hover,\n.oh-story-file-folder > summary:hover { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-interactive-bg-hover); }\n.oh-story-file-group > summary span,\n.oh-story-file-folder > summary span { margin-left: auto; color: var(--dsw-alias-label-secondary); font-weight: 400; }\n\n.oh-story-tree nav button {\n display: block;\n width: 100%;\n overflow: hidden;\n padding: 6px 8px 6px min(calc(14px + var(--oh-story-indent, 0px)), 56px);\n border: 0;\n border-radius: 6px;\n color: inherit;\n background: transparent;\n text-align: left;\n text-overflow: ellipsis;\n white-space: nowrap;\n cursor: pointer;\n font: inherit;\n font-size: 12px;\n}\n.oh-story-tree nav button:hover { background: var(--dsw-alias-interactive-bg-hover); }\n.oh-story-tree nav button[aria-current=\"page\"] { background: var(--dsw-alias-button-ghost-active-fill); color: var(--dsw-alias-label-primary); }\n.oh-story-tree nav button[data-agent-target] { box-shadow: inset 2px 0 var(--dsw-alias-state-business-primary); }\n\n.oh-story-editor > header {\n min-height: 44px;\n flex: none;\n padding: 0 14px;\n border-bottom: 1px solid var(--os-border);\n}\n\n.oh-story-editor-path {\n overflow: hidden;\n min-width: 0;\n flex: 1;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 12px;\n color: var(--os-muted);\n}\n.oh-story-editor-path > span { overflow: hidden; display: block; text-overflow: ellipsis; }\n.oh-story-editor-path > strong { display: none; overflow: hidden; text-overflow: ellipsis; font: inherit; }\n\n.oh-story-editor-actions { display: flex; flex: none; align-items: center; gap: 8px; }\n.oh-story-editor-tabs {\n display: flex;\n padding: 2px;\n border: 1px solid var(--os-border);\n border-radius: 7px;\n background: var(--dsw-alias-bg-layer-1);\n}\n.oh-story-editor-tabs button { min-height: 24px; padding: 0 9px; border-radius: 5px; font-size: 11px; }\n.oh-story-save { min-height: 28px; }\n\n.oh-story-editor textarea {\n box-sizing: border-box;\n width: 100%;\n min-height: 0;\n flex: 1;\n resize: none;\n border: 0;\n outline: 0;\n padding: clamp(20px, 6%, 48px) clamp(22px, 10%, 84px) 48px;\n color: var(--dsw-alias-label-primary);\n background: transparent;\n font: 16px/1.9 ui-serif, \"Songti SC\", \"STSong\", Georgia, serif;\n}\n.oh-story-editor textarea[data-format=\"structured\"] {\n tab-size: 2;\n font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;\n}\n\n.oh-story-markdown {\n box-sizing: border-box;\n width: 100%;\n min-height: 0;\n flex: 1;\n overflow: auto;\n padding: clamp(24px, 8%, 56px) clamp(24px, 10%, 92px) 64px;\n color: var(--dsw-alias-label-primary);\n font: 16px/1.85 ui-serif, \"Songti SC\", \"STSong\", Georgia, serif;\n overflow-wrap: anywhere;\n}\n.oh-story-markdown > :first-child { margin-top: 0; }\n.oh-story-markdown > :last-child { margin-bottom: 0; }\n.oh-story-markdown h1,\n.oh-story-markdown h2,\n.oh-story-markdown h3,\n.oh-story-markdown h4,\n.oh-story-markdown h5,\n.oh-story-markdown h6 { margin: 1.45em 0 .6em; font-family: var(--dsw-font-family); line-height: 1.35; letter-spacing: -.01em; }\n.oh-story-markdown h1 { font-size: 1.75em; }\n.oh-story-markdown h2 { padding-bottom: .35em; border-bottom: 1px solid var(--os-border); font-size: 1.35em; }\n.oh-story-markdown h3 { font-size: 1.15em; }\n.oh-story-markdown p { margin: .75em 0; }\n.oh-story-markdown ul,\n.oh-story-markdown ol { margin: .75em 0; padding-left: 1.6em; }\n.oh-story-markdown li { margin: .28em 0; }\n.oh-story-markdown .oh-story-task-item { list-style: none; margin-left: -1.35em; }\n.oh-story-task-item input { margin: 0 .55em 0 0; accent-color: var(--dsw-alias-state-business-primary); }\n.oh-story-markdown blockquote { margin: 1em 0; padding: .1em 1em; border-left: 3px solid var(--dsw-alias-state-business-primary); color: var(--dsw-alias-label-secondary); }\n/* DSH gives inline code its own alias; the block fill is a different surface. */\n.oh-story-markdown code { padding: .15em .4em; border-radius: 4px; background: var(--dsw-alias-markdown-inline-code); font: .86em/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }\n.oh-story-markdown pre { overflow: auto; margin: 1em 0; padding: 14px 16px; border: 1px solid var(--dsw-alias-border-l1); border-radius: 10px; background: var(--dsw-alias-markdown-code-block); }\n.oh-story-markdown pre code { padding: 0; background: transparent; }\n.oh-story-markdown a { color: var(--dsw-alias-state-business-primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }\n.oh-story-markdown del { color: var(--os-muted); }\n.oh-story-markdown-table { overflow-x: auto; margin: 1em 0; border: 1px solid var(--os-border); border-radius: 10px; }\n.oh-story-markdown table { width: 100%; border-collapse: collapse; font-family: ui-sans-serif, system-ui, \"PingFang SC\", sans-serif; font-size: 13px; line-height: 1.55; }\n.oh-story-markdown th,\n.oh-story-markdown td { min-width: 96px; padding: 9px 12px; border-right: 1px solid var(--os-border); border-bottom: 1px solid var(--os-border); vertical-align: top; }\n.oh-story-markdown th:last-child,\n.oh-story-markdown td:last-child { border-right: 0; }\n.oh-story-markdown tbody tr:last-child td { border-bottom: 0; }\n.oh-story-markdown th { background: var(--dsw-alias-bg-layer-1); font-weight: 600; }\n.oh-story-markdown hr { margin: 2em 0; border: 0; border-top: 1px solid var(--os-border); }\n.oh-story-markdown-empty { margin: auto; color: var(--os-muted); font-size: 13px; }\n\n.oh-story-jsonl {\n box-sizing: border-box;\n display: flex;\n width: 100%;\n min-height: 0;\n flex: 1;\n overflow: hidden;\n flex-direction: column;\n color: var(--dsw-alias-label-primary);\n background: var(--dsw-alias-bg-base);\n}\n.oh-story-jsonl-summary { display: flex; min-height: 42px; flex: none; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--os-border); font-size: 12px; }\n.oh-story-jsonl-summary strong { font-weight: 600; }\n.oh-story-jsonl-summary span { color: var(--os-muted); }\n.oh-story-jsonl-records { overflow: auto; padding: 14px 18px 36px; }\n.oh-story-jsonl details,\n.oh-story-jsonl-error { overflow: hidden; margin-bottom: 10px; border: 1px solid var(--os-border); border-radius: 10px; background: var(--dsw-alias-bg-layer-1); }\n.oh-story-jsonl summary { display: flex; min-height: 42px; align-items: center; gap: 9px; padding: 0 12px; cursor: pointer; list-style: none; font: 12px/1.4 var(--dsw-font-family); }\n.oh-story-jsonl summary::-webkit-details-marker { display: none; }\n.oh-story-jsonl summary::before { content: \"\u203A\"; color: var(--os-muted); font-size: 16px; transition: transform .12s ease; }\n.oh-story-jsonl details[open] summary::before { transform: rotate(90deg); }\n.oh-story-jsonl summary > span { flex: none; color: var(--os-muted); font-variant-numeric: tabular-nums; }\n.oh-story-jsonl summary > strong { overflow: hidden; min-width: 80px; flex: 1; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }\n.oh-story-jsonl summary > code,\n.oh-story-jsonl summary > em { flex: none; padding: 2px 6px; border-radius: 5px; background: var(--dsw-alias-button-ghost-active-fill); color: var(--dsw-alias-label-secondary); font: 11px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace; font-style: normal; }\n.oh-story-jsonl pre { overflow: auto; max-height: 520px; margin: 0; padding: 14px 16px; border-top: 1px solid var(--os-border); background: var(--dsw-alias-markdown-code-block); color: var(--dsw-alias-label-secondary); white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }\n.oh-story-jsonl-error { display: grid; gap: 5px; padding: 12px; border-color: var(--dsw-alias-state-error-primary); font-size: 12px; }\n.oh-story-jsonl-error > strong { color: var(--dsw-alias-state-error-primary); }\n.oh-story-jsonl-error > span { color: var(--os-muted); }\n.oh-story-jsonl-error pre { margin: 3px -12px -12px; }\n\n.oh-story-stream,\n.oh-story-conflict,\n.oh-story-warning {\n flex: none;\n padding: 7px 12px;\n border-bottom: 1px solid var(--os-border);\n font-size: 11px;\n line-height: 1.4;\n}\n\n.oh-story-stream { color: var(--dsw-alias-state-business-primary); background: var(--dsw-alias-button-ghost-active-fill); }\n.oh-story-stream[data-stage=\"streaming\"] { animation: oh-story-pulse 1.2s ease-in-out infinite alternate; }\n.oh-story-conflict { color: var(--dsw-alias-state-warn-label); background: var(--dsw-specific-tip); }\n.oh-story-conflict > div { display: flex; gap: 6px; margin-top: 6px; }\n.oh-story-conflict button,\n.oh-story-empty button {\n border: 1px solid var(--os-border);\n border-radius: 6px;\n color: inherit;\n background: var(--dsw-alias-bg-base);\n padding: 3px 8px;\n cursor: pointer;\n font: inherit;\n}\n.oh-story-warning { color: var(--dsw-alias-state-warn-label); background: var(--dsw-specific-tip); }\n\n@keyframes oh-story-pulse { to { opacity: .62; } }\n@media (prefers-reduced-motion: reduce) { .oh-story-stream[data-stage=\"streaming\"] { animation: none; } }\n\n.oh-story-empty { margin: auto; max-width: 480px; padding: 30px; color: var(--os-muted); line-height: 1.7; text-align: center; }\n.oh-story-error { margin: 8px; padding: 8px 10px; border-radius: 8px; color: var(--dsw-alias-state-error-primary); background: var(--dsw-specific-tip); font-size: 12px; }\n\n.oh-story-role { display: flex; flex-direction: column; margin: 0; overflow: hidden; }\n.oh-story-role summary { min-height: 24px; padding: 0; cursor: pointer; list-style: none; font-size: 14px; line-height: 24px; }\n.oh-story-role summary::-webkit-details-marker { display: none; }\n.oh-story-role summary span { color: var(--dsw-alias-state-business-primary); }\n.oh-story-role summary strong { margin-right: auto; color: var(--dsw-alias-label-secondary); font-weight: 500; }\n.oh-story-role summary em { color: var(--dsw-alias-label-caption); font-style: normal; font-size: 12px; }\n.oh-story-role[data-state=\"error\"] summary em { color: var(--dsw-alias-state-error-primary); }\n.oh-story-role pre { max-height: 260px; overflow: auto; margin: 4px 0 4px 4px; padding: 12px 16px; border: 1px solid var(--dsw-alias-border-l1); border-radius: 12px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-markdown-code-block); white-space: pre-wrap; font: var(--dsw-font-markdown-code-block-small); }\n.oh-story-role > button { align-self: flex-start; margin: 4px 0 2px 4px; font-size: 11px; }\n\n/* Short-drama production views are projections of the creator Markdown and\n DSH Session state. They intentionally use only DSH semantic tokens. */\n.oh-story-production { min-height: 0; flex: 1; overflow: auto; background: var(--dsw-alias-bg-base); font: 12px/1.5 var(--dsw-font-family); }\n.oh-story-production button,\n.oh-story-production select { border: 1px solid var(--os-border); border-radius: 6px; color: inherit; background: var(--dsw-alias-bg-base); padding: 4px 8px; cursor: pointer; font: inherit; }\n.oh-story-production button:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover); }\n.oh-story-production button:disabled { opacity: .45; cursor: default; }\n.oh-story-production button:focus-visible,\n.oh-story-canvas article:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: 2px; }\n.oh-story-production-bar,\n.oh-story-production-notice,\n.oh-story-production-actions,\n.oh-story-sequence-summary { display: flex; align-items: center; gap: 8px; }\n.oh-story-production-bar { position: sticky; z-index: 5; top: 0; justify-content: space-between; min-height: 44px; box-sizing: border-box; padding: 6px 12px; border-bottom: 1px solid var(--os-border); background: color-mix(in srgb, var(--dsw-alias-bg-base) 94%, transparent); backdrop-filter: blur(12px); }\n.oh-story-production-tabs { display: flex; align-self: stretch; gap: 16px; }\n.oh-story-production-tabs button { position: relative; border: 0; border-radius: 0; padding: 0; background: transparent; color: var(--os-muted); }\n.oh-story-production-tabs button[aria-selected=\"true\"] { color: var(--dsw-alias-label-primary); }\n.oh-story-production-tabs button[aria-selected=\"true\"]::after { position: absolute; right: 0; bottom: -6px; left: 0; height: 2px; border-radius: 2px; background: var(--dsw-alias-state-business-primary); content: \"\"; }\n.oh-story-production-meta { display: flex; align-items: center; gap: 8px; }\n.oh-story-production-meta > button { padding-block: 2px; color: var(--os-muted); }\n.oh-story-production-summary { color: var(--os-muted); white-space: nowrap; }\n.oh-story-production-notice { justify-content: space-between; margin: 8px 12px 0; padding: 7px 9px; border: 1px solid var(--os-border); border-radius: 7px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-bg-layer-1); }\n.oh-story-production-notice button { border: 0; background: transparent; }\n.oh-story-production-environment { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; gap: 5px 10px; margin: 8px 12px 0; padding: 7px 9px; border: 1px solid var(--os-border); border-radius: 7px; color: var(--os-muted); background: var(--dsw-alias-bg-layer-1); font-size: 10px; }\n/* Environment names such as MINIMAX_VIDEO_RESOLUTIONS and the temp-dir path are longer than the 500 px editor column; let them break rather than widen the view. */\n.oh-story-production-environment > * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }\n.oh-story-production-environment strong { color: var(--dsw-alias-label-secondary); font-size: 11px; }\n.oh-story-production-environment span::before { content: \"\u25CF\"; margin-right: 4px; color: var(--video-danger, #d9534f); }\n.oh-story-production-environment span[data-ready]::before { color: var(--dsw-alias-state-success-primary, #45b96f); }\n.oh-story-production-environment span[data-pending]::before { color: var(--os-muted); }\n.oh-story-production-environment em { flex-basis: 100%; font-style: normal; line-height: 1.5; }\n.oh-story-production-environment code { font-size: 10px; overflow-wrap: anywhere; }\n.oh-story-production-environment button { min-height: 24px; border: 1px solid var(--os-border); border-radius: 6px; padding: 0 8px; color: inherit; background: var(--dsw-alias-bg-base); cursor: pointer; font: inherit; }\n.oh-story-production-diagnostics { margin: 8px 12px 0; padding: 7px 9px; border: 1px solid var(--dsw-alias-state-warn-label); border-radius: 7px; background: var(--dsw-specific-tip); }\n.oh-story-production-diagnostics summary { color: var(--dsw-alias-state-warn-label); cursor: pointer; }\n.oh-story-production-diagnostics ul { display: grid; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; }\n.oh-story-production-diagnostics li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 6px; color: var(--dsw-alias-label-secondary); }\n.oh-story-production-diagnostics li[data-severity=\"error\"] { color: var(--dsw-alias-state-error-primary); }\n.oh-story-production-diagnostics li button { border: 0; padding: 0; color: inherit; background: transparent; text-align: left; }\n.oh-story-production-diagnostics p { margin: 6px 0 0; color: var(--os-muted); }\n.oh-story-production-actions { justify-content: flex-end; margin-bottom: 12px; }\n.oh-story-production-actions button:last-child,\n.oh-story-sequence-summary button { color: var(--dsw-alias-state-business-primary); border-color: var(--dsw-alias-state-business-primary); }\n.oh-story-shot-board { padding: 16px 12px; }\n.oh-story-shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: start; gap: 12px; }\n.oh-story-shot-card,\n.oh-story-asset-card,\n.oh-story-task-board > article { min-width: 0; overflow: hidden; border: 1px solid var(--os-border); border-radius: 10px; background: var(--dsw-alias-bg-layer-1); }\n.oh-story-shot-card { padding: 10px; cursor: default; transition: border-color .15s ease, background-color .15s ease; }\n.oh-story-shot-card:hover { border-color: var(--dsw-alias-border-l2); }\n.oh-story-shot-card { cursor: pointer; }\n.oh-story-shot-card:focus-visible,\n.oh-story-asset-card:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: 2px; }\n.oh-story-shot-card[data-selected],\n.oh-story-asset-card[data-selected] { border-color: var(--dsw-alias-state-business-primary); background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 4%, var(--dsw-alias-bg-layer-1)); }\n.oh-story-shot-card > header,\n.oh-story-task-board article > header { display: flex; min-height: 0; align-items: center; gap: 8px; padding: 0; border: 0; }\n.oh-story-shot-card > header > button { overflow: hidden; min-width: 0; flex: 1; border: 0; padding: 0; color: var(--dsw-alias-state-business-primary); background: transparent; text-align: left; text-overflow: ellipsis; white-space: nowrap; }\n.oh-story-shot-card > header > span { color: var(--os-muted); font-variant-numeric: tabular-nums; }\n.oh-story-shot-card h3,\n.oh-story-asset-card h3 { margin: 7px 0 4px; font-size: 13px; font-weight: 600; }\n.oh-story-shot-card > p,\n.oh-story-asset-card > p,\n.oh-story-task-board article > p { margin: 5px 0; color: var(--os-muted); }\n.oh-story-shot-placeholder { display: grid; height: 132px; place-content: center; gap: 3px; margin-bottom: 8px; border-radius: 7px; color: var(--os-muted); background: var(--dsw-alias-button-ghost-active-fill); text-align: center; }\n.oh-story-shot-placeholder strong { color: var(--dsw-alias-label-secondary); font-size: 22px; font-variant-numeric: tabular-nums; }\n.oh-story-shot-card dl { display: grid; grid-template-columns: 20px minmax(0, 1fr); margin: 7px 0; }\n.oh-story-shot-card dt { color: var(--dsw-alias-state-business-primary); }\n.oh-story-shot-card dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }\n.oh-story-shot-status,\n.oh-story-reference-links,\n.oh-story-card-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }\n.oh-story-shot-status span { padding: 1px 5px; border-radius: 5px; color: var(--os-muted); background: var(--dsw-alias-button-ghost-active-fill); }\n.oh-story-shot-status span[data-ready=\"true\"] { color: var(--dsw-alias-state-business-primary); }\n.oh-story-shot-status span > i { margin-right: 3px; font-style: normal; }\n.oh-story-reference-links button { max-width: 100%; overflow: hidden; padding: 1px 5px; border: 0; color: var(--dsw-alias-state-business-primary); background: transparent; text-overflow: ellipsis; }\n.oh-story-card-actions { padding-top: 8px; border-top: 1px solid var(--os-border); }\n.oh-story-card-actions button { flex: 1; padding-block: 4px; }\n.oh-story-card-actions button:last-child { color: var(--dsw-alias-state-business-primary); border-color: color-mix(in srgb, var(--dsw-alias-state-business-primary) 45%, var(--os-border)); }\n.oh-story-media-preview { display: block; width: 100%; height: 168px; border-radius: 7px; background: var(--dsw-alias-bg-base); object-fit: contain; }\n.oh-story-media-document { display: grid; min-height: 0; flex: 1; overflow: auto; place-items: center; padding: 24px; }\n.oh-story-media-document img,\n.oh-story-media-document video { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }\n.oh-story-media-document audio { width: min(520px, 100%); }\n.oh-story-version-strip { display: flex; gap: 5px; overflow-x: auto; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--os-border); }\n.oh-story-version-strip > button { position: relative; width: 64px; min-width: 64px; padding: 2px; }\n.oh-story-version-strip > button[data-selected] { border-color: var(--dsw-alias-state-business-primary); }\n.oh-story-version-strip .oh-story-media-preview { height: 72px; }\n.oh-story-version-strip span { position: absolute; right: 3px; bottom: 3px; padding: 0 3px; border-radius: 3px; background: var(--dsw-alias-bg-base); font-size: 10px; }\n.oh-story-asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; padding: 16px 12px; }\n.oh-story-asset-card { padding: 10px; }\n.oh-story-asset-card > div:nth-child(2) > button { overflow: hidden; max-width: 100%; border: 0; padding: 0; color: var(--dsw-alias-state-business-primary); background: transparent; text-overflow: ellipsis; }\n.oh-story-asset-card small { color: var(--os-muted); text-transform: uppercase; }\n.oh-story-asset-placeholder { display: grid; height: 112px; place-items: center; border-radius: 7px; color: var(--os-muted); background: var(--dsw-alias-button-ghost-active-fill); font-size: 28px; }\n.oh-story-asset-description { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; }\n.oh-story-media-library { margin: 0 12px 14px; padding-top: 12px; border-top: 1px solid var(--os-border); }\n.oh-story-media-library > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }\n.oh-story-media-library > header > div { display: flex; align-items: center; gap: 7px; }\n.oh-story-media-library > header span { color: var(--os-muted); }\n.oh-story-media-library input { width: 180px; box-sizing: border-box; border: 1px solid var(--os-border); border-radius: 6px; padding: 5px 8px; color: inherit; background: var(--dsw-alias-bg-base); font: inherit; }\n.oh-story-media-library > .oh-story-projection-note { margin-bottom: 10px; }\n.oh-story-media-library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }\n.oh-story-media-library-grid > article { display: flex; min-width: 0; flex-direction: column; gap: 5px; padding: 7px; border: 1px solid var(--os-border); border-radius: 8px; background: var(--dsw-alias-bg-layer-1); }\n.oh-story-media-library-grid .oh-story-media-preview { height: 116px; }\n.oh-story-media-library-grid > article > span { overflow: hidden; color: var(--os-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }\n.oh-story-media-library-grid footer { display: flex; gap: 4px; margin-top: auto; }\n.oh-story-media-library-grid footer button { min-width: 0; flex: 1; padding-inline: 4px; }\n.oh-story-media-library-grid footer button[aria-pressed=\"true\"] { color: var(--dsw-alias-state-business-primary); border-color: var(--dsw-alias-state-business-primary); }\n.oh-story-task-board { display: grid; gap: 10px; padding: 12px; }\n.oh-story-task-board > article { padding: 11px; }\n.oh-story-task-board > article[data-status=\"dispatched_unknown\"] { border-color: var(--dsw-alias-state-warn-label); }\n.oh-story-task-board > article[data-status=\"dispatched_unknown\"] .oh-story-error { color: var(--dsw-alias-state-warn-label); background: var(--dsw-specific-tip); }\n.oh-story-task-board article > header strong { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; }\n.oh-story-task-board article > header span { padding: 1px 5px; border-radius: 5px; color: var(--os-muted); background: var(--dsw-alias-button-ghost-active-fill); }\n.oh-story-task-progress { height: 3px; overflow: hidden; margin-top: 8px; border-radius: 3px; background: var(--os-border); }\n.oh-story-task-progress i { display: block; height: 100%; background: var(--dsw-alias-state-business-primary); transition: width .2s ease; }\n.oh-story-task-board details { margin-top: 8px; color: var(--os-muted); }\n.oh-story-task-board details summary { cursor: pointer; }\n.oh-story-task-board details p { max-height: 120px; overflow: auto; margin: 6px 0; padding: 8px; border-radius: 6px; background: var(--dsw-alias-bg-base); white-space: pre-wrap; }\n.oh-story-task-board footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; margin-top: 8px; }\n.oh-story-projection-note { padding: 7px 10px; border: 1px solid var(--os-border); border-radius: 7px; color: var(--os-muted); background: var(--dsw-alias-bg-layer-1); }\n.oh-story-task-board > .oh-story-projection-note { margin-bottom: 0; }\n.oh-story-production-empty { padding: 48px 20px; color: var(--os-muted); text-align: center; }\n.oh-story-production-empty strong { display: block; margin-bottom: 6px; color: var(--dsw-alias-text-1); font-size: 13px; }\n.oh-story-production-empty p { margin: 0 auto; max-width: 44em; line-height: 1.6; }\n.oh-story-production-empty button { margin-top: 12px; }\n.oh-story-sequence { padding: 12px; }\n.oh-story-sequence-summary { justify-content: space-between; margin-bottom: 10px; }\n.oh-story-sequence-summary span { margin-left: auto; color: var(--os-muted); }\n.oh-story-sequence-issues { margin: 0 0 10px; padding: 8px 8px 8px 28px; border-radius: 7px; color: var(--dsw-alias-state-warn-label); background: var(--dsw-specific-tip); }\n.oh-story-sequence-issues li + li { margin-top: 2px; }\n.oh-story-sequence ol { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }\n.oh-story-sequence > ol > li { display: grid; min-height: 70px; grid-template-columns: 28px 96px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px; border: 1px solid var(--os-border); border-radius: 8px; background: var(--dsw-alias-bg-layer-1); }\n.oh-story-sequence > ol > li > span { color: var(--os-muted); font-variant-numeric: tabular-nums; }\n.oh-story-sequence > ol > li .oh-story-media-preview,\n.oh-story-sequence-missing { width: 96px; height: 54px; }\n.oh-story-sequence-missing { display: grid; place-items: center; border-radius: 5px; color: var(--os-muted); background: var(--dsw-alias-button-ghost-active-fill); }\n.oh-story-sequence > ol > li > div:last-child { display: flex; gap: 3px; }\n.oh-story-canvas-shell { position: relative; display: flex; height: max(580px, calc(100% - 84px)); min-height: 580px; flex-direction: column; overflow: hidden; }\n.oh-story-canvas-shell > .oh-story-projection-note { z-index: 3; flex: none; margin: 8px 168px 8px 8px; }\n.oh-story-canvas-controls { position: absolute; z-index: 4; top: 8px; right: 8px; display: flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--os-border); border-radius: 8px; background: var(--dsw-alias-bg-base); }\n.oh-story-canvas-controls span { min-width: 44px; color: var(--os-muted); text-align: center; }\n.oh-story-canvas-viewport { width: 100%; min-height: 0; flex: 1; overflow: auto; background-color: var(--dsw-alias-bg-base); background-image: radial-gradient(var(--os-border) 1px, transparent 1px); background-size: 20px 20px; }\n.oh-story-canvas { position: relative; width: 1800px; height: 1800px; transform-origin: 0 0; }\n.oh-story-canvas svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }\n.oh-story-canvas path { fill: none; opacity: .35; stroke: var(--dsw-alias-border-l2); stroke-width: 1.5; }\n.oh-story-canvas path[data-active] { opacity: .8; stroke: var(--dsw-alias-state-business-primary); }\n.oh-story-canvas article { position: absolute; display: flex; width: 180px; min-height: 76px; box-sizing: border-box; flex-direction: column; gap: 4px; padding: 10px; border: 1px solid var(--os-border); border-radius: 8px; background: var(--dsw-alias-bg-layer-1); box-shadow: 0 4px 14px rgb(0 0 0 / 8%); cursor: grab; user-select: none; touch-action: none; }\n.oh-story-canvas article:active { cursor: grabbing; }\n.oh-story-canvas article[data-node-type=\"shot\"] { border-color: var(--dsw-alias-state-business-primary); }\n.oh-story-canvas article[data-selected] { box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-state-business-primary) 28%, transparent), 0 4px 14px rgb(0 0 0 / 8%); }\n.oh-story-canvas article small { color: var(--os-muted); text-transform: uppercase; }\n.oh-story-canvas article strong,\n.oh-story-canvas article span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.oh-story-canvas article span { color: var(--os-muted); font-size: 10px; }\n\n[data-conversation-scroll][data-oh-story-layout=\"medium\"]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"]) {\n grid-template-columns: clamp(104px, 18%, 184px) minmax(200px, 1fr) clamp(300px, 45%, 408px);\n}\n\n[data-conversation-scroll][data-oh-story-layout=\"compact\"]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"]) {\n grid-template-columns: clamp(80px, 16%, 104px) minmax(0, 1fr) clamp(228px, 48%, 300px);\n}\n\n[data-oh-story-layout=\"medium\"] .oh-story-file-folder > summary { padding-left: min(calc(7px + var(--oh-story-indent, 0px)), 35px); }\n[data-oh-story-layout=\"medium\"] .oh-story-tree nav button { padding-left: min(calc(14px + var(--oh-story-indent, 0px)), 42px); }\n[data-oh-story-layout=\"medium\"] .oh-story-editor textarea { padding-right: 28px; padding-left: 28px; }\n\n[data-oh-story-layout=\"compact\"] .oh-story-tree { padding-inline: 4px; }\n[data-oh-story-layout=\"compact\"] .oh-story-brand { gap: 4px; padding-inline: 2px; font-size: 11px; }\n[data-oh-story-layout=\"compact\"] .oh-story-brand-cluster { gap: 4px; }\n[data-oh-story-layout=\"compact\"] .oh-story-brand-cluster strong > span { display: none; }\n[data-oh-story-layout=\"compact\"] .oh-story-kind { padding-inline: 4px; font-size: 11px; }\n[data-oh-story-layout=\"compact\"] .oh-story-brand button { width: 24px; height: 24px; }\n[data-oh-story-layout=\"compact\"] .oh-story-mode-tabs { margin-inline: 0; }\n[data-oh-story-layout=\"compact\"] .oh-story-mode-tabs button { padding-inline: 3px; font-size: 11px; }\n[data-oh-story-layout=\"compact\"] .oh-story-file-folder > summary { padding-left: min(calc(5px + var(--oh-story-indent, 0px)), 19px); }\n[data-oh-story-layout=\"compact\"] .oh-story-tree nav button { padding-right: 4px; padding-left: min(calc(7px + var(--oh-story-indent, 0px)), 21px); }\n[data-oh-story-layout=\"compact\"] .oh-story-editor > header {\n display: grid;\n min-height: 68px;\n grid-template-columns: minmax(0, 1fr);\n grid-template-rows: 24px 36px;\n align-content: center;\n gap: 0;\n padding: 4px 3px;\n}\n[data-oh-story-layout=\"compact\"] .oh-story-editor-path > span { display: none; }\n[data-oh-story-layout=\"compact\"] .oh-story-editor-path > strong { display: block; font-size: 11px; line-height: 24px; }\n[data-oh-story-layout=\"compact\"] .oh-story-editor-actions { width: 100%; min-width: 0; justify-content: flex-end; gap: 4px; }\n[data-oh-story-layout=\"compact\"] .oh-story-editor-tabs { min-width: 0; flex: 1; }\n[data-oh-story-layout=\"compact\"] .oh-story-editor-tabs button { min-width: 0; padding-inline: 2px; white-space: nowrap; }\n[data-oh-story-layout=\"compact\"] .oh-story-save { flex: none; padding-inline: 4px; white-space: nowrap; font-size: 11px; }\n[data-oh-story-layout=\"compact\"] .oh-story-editor textarea { padding: 16px 12px 40px; }\n[data-oh-story-layout=\"compact\"] .oh-story-markdown { padding: 18px 12px 48px; }\n[data-oh-story-layout=\"compact\"] .oh-story-jsonl-summary { padding-inline: 10px; }\n[data-oh-story-layout=\"compact\"] .oh-story-jsonl-records { padding: 8px 7px 28px; }\n[data-oh-story-layout=\"compact\"] .oh-story-jsonl summary { gap: 6px; padding-inline: 7px; }\n[data-oh-story-layout=\"compact\"] .oh-story-jsonl summary > span { display: none; }\n[data-oh-story-layout=\"compact\"] .oh-story-jsonl summary > strong { min-width: 32px; }\n[data-oh-story-layout=\"compact\"] .oh-story-jsonl summary > code,\n[data-oh-story-layout=\"compact\"] .oh-story-jsonl summary > em { display: none; }\n\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"medium\"]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"]) {\n grid-template-columns: minmax(0, 1fr) clamp(360px, 42%, 440px);\n}\n[data-oh-story-workbench=\"game\"][data-oh-story-layout=\"medium\"] .oh-game-toolbar { grid-template-columns: auto minmax(140px, 1fr) auto; }\n\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"]) {\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n overflow: hidden;\n}\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"]\n > [data-slot=\"conversation.session\"] > :not(.oh-story-split-surface),\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"]\n > [data-composer-seat],\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-studio {\n grid-column: 1;\n}\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"][data-oh-studio-pane=\"studio\"]\n > [data-slot=\"conversation.session\"] > :not(.oh-story-split-surface),\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"][data-oh-studio-pane=\"studio\"]\n > [data-composer-seat],\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"][data-oh-studio-pane=\"chat\"] .oh-game-studio { display: none; }\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-mobile-switcher {\n display: flex;\n position: absolute;\n top: 8px;\n right: 8px;\n z-index: 20;\n border-color: var(--dsw-alias-border-l1);\n box-shadow: 0 4px 14px rgb(0 0 0 / 12%);\n}\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-mobile-switcher button { min-width: 52px; min-height: 32px; }\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-toolbar {\n min-height: 101px;\n grid-template-columns: auto minmax(0, 1fr) 112px;\n grid-template-rows: 44px 44px;\n align-content: center;\n gap: 5px;\n padding: 4px 8px;\n}\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-toolbar > .oh-workbench-cluster { grid-column: 1; grid-row: 1; width: fit-content; }\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-project > span { display: none; }\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-project { grid-column: 1 / -1; grid-row: 2; }\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-project select { max-width: none; width: 100%; min-height: 44px; }\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-tabs { grid-column: 2; grid-row: 1; width: fit-content; justify-self: end; }\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-mode-tabs button,\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-tabs button,\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-mobile-switcher button { min-height: 44px; }\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-preview-shell { grid-template-rows: 46px minmax(0, 1fr); }\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-preview-status button { min-height: 36px; }\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-reload b { display: none; }\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-preview-status { padding-left: 8px; }\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-preview-status > span { max-width: 40%; }\n.oh-game-runtime-state > em { display: block; overflow: hidden; min-width: 0; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }\n\n/* DSH may keep its navigation drawer open at a 500 px browser viewport,\n leaving the conversation center close to 212 px wide. The Studio publishes\n its measured width because a container style query cannot style the\n container itself. Row one stays clear for the \u5236\u4F5C / \u5BF9\u8BDD switch. */\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-studio[data-oh-game-narrow] .oh-game-toolbar {\n min-height: 193px;\n grid-template-columns: minmax(0, 1fr);\n grid-template-rows: repeat(4, 44px);\n align-content: center;\n padding: 4px 8px;\n}\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-studio[data-oh-game-narrow] .oh-game-toolbar > .oh-workbench-cluster {\n grid-column: 1;\n grid-row: 2;\n justify-self: start;\n}\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-studio[data-oh-game-narrow] .oh-game-tabs {\n grid-column: 1;\n grid-row: 3;\n justify-self: start;\n}\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-studio[data-oh-game-narrow] .oh-game-project {\n grid-column: 1;\n grid-row: 4;\n}\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-studio[data-oh-game-narrow] .oh-game-project select {\n width: 100%;\n max-width: none;\n min-height: 44px;\n}\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-studio[data-oh-game-narrow] .oh-game-preview-status {\n gap: 4px;\n padding-right: 6px;\n padding-left: 6px;\n}\n[data-conversation-scroll][data-oh-story-workbench=\"game\"][data-oh-story-layout=\"compact\"] .oh-game-studio[data-oh-game-narrow] .oh-game-preview-status > span { max-width: 36%; }\n\n@media (prefers-reduced-motion: reduce) {\n .oh-game-preview-shell[data-state=\"building\"] { animation: none; }\n}\n\n@media (prefers-contrast: more) {\n .oh-game-preview-status button,\n .oh-game-tabs,\n .oh-game-mode-tabs,\n .oh-game-mobile-switcher { border-width: 2px; }\n}\n[data-oh-story-layout=\"compact\"] .oh-story-production-summary { display: none; }\n[data-oh-story-layout=\"compact\"] .oh-story-production-bar { flex-wrap: wrap; padding-inline: 4px; }\n[data-oh-story-layout=\"compact\"] .oh-story-production-tabs { width: 100%; gap: 0; }\n[data-oh-story-layout=\"compact\"] .oh-story-production-tabs button { min-width: 0; flex: 1; padding-inline: 0; font-size: 11px; }\n[data-oh-story-layout=\"compact\"] .oh-story-production-meta { width: 100%; justify-content: flex-end; }\n[data-oh-story-layout=\"compact\"] .oh-story-shot-grid,\n[data-oh-story-layout=\"compact\"] .oh-story-asset-grid { grid-template-columns: minmax(0, 1fr); }\n[data-oh-story-layout=\"compact\"] .oh-story-media-library > header { align-items: stretch; flex-direction: column; }\n[data-oh-story-layout=\"compact\"] .oh-story-media-library > header > div:last-child { display: grid; grid-template-columns: minmax(0, 1fr) auto; }\n[data-oh-story-layout=\"compact\"] .oh-story-media-library input { width: 100%; }\n[data-oh-story-layout=\"compact\"] .oh-story-sequence { padding-inline: 6px; }\n[data-oh-story-layout=\"compact\"] .oh-story-sequence-summary { flex-wrap: wrap; }\n[data-oh-story-layout=\"compact\"] .oh-story-sequence-summary span { display: none; }\n[data-oh-story-layout=\"compact\"] .oh-story-sequence > ol > li { grid-template-columns: 24px 64px minmax(0, 1fr); gap: 5px; }\n[data-oh-story-layout=\"compact\"] .oh-story-sequence > ol > li .oh-story-media-preview,\n[data-oh-story-layout=\"compact\"] .oh-story-sequence-missing { width: 64px; height: 40px; }\n[data-oh-story-layout=\"compact\"] .oh-story-sequence > ol > li > div:last-child { grid-column: 2 / 4; justify-content: flex-end; }\n[data-oh-story-layout=\"compact\"] .oh-story-canvas-shell > .oh-story-projection-note { overflow: hidden; max-height: 48px; margin: 8px; }\n[data-oh-story-layout=\"compact\"] .oh-story-canvas-controls { position: static; flex: none; align-self: flex-end; margin: 0 8px 8px; }\n\n/* Video mode intentionally stays a preview surface: one player, a read-only artifact view,\n and the official DSH Conversation. It shares no nonlinear-editor or timeline runtime. */\n[data-conversation-scroll][data-oh-story-workbench=\"video\"]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"]) {\n --video-stage: #0b0d10;\n --video-stage-raised: #15181d;\n --video-accent: var(--dsw-alias-state-business-primary);\n --video-warning: #f4bd55;\n --video-danger: #f06b63;\n grid-template-columns: minmax(0, 1fr) clamp(400px, 34%, 520px);\n overflow: hidden;\n}\n[data-conversation-scroll][data-oh-story-workbench=\"video\"]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"])\n > [data-slot=\"conversation.session\"] > :not(.oh-story-split-surface),\n[data-conversation-scroll][data-oh-story-workbench=\"video\"]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"])\n > [data-composer-seat] { grid-column: 2; }\n\n.oh-video-studio {\n box-sizing: border-box;\n display: flex;\n grid-column: 1;\n grid-row: 1;\n position: sticky;\n top: 0;\n min-width: 0;\n min-height: 0;\n height: 100%;\n align-self: start;\n overflow: hidden;\n flex-direction: column;\n border-right: 1px solid var(--os-border);\n color: var(--dsw-alias-label-primary);\n background: var(--dsw-alias-bg-base);\n}\n.oh-video-studio[hidden] { display: none; }\n.oh-video-toolbar {\n box-sizing: border-box;\n display: grid;\n min-height: 100px;\n flex: none;\n grid-template-columns: minmax(0, 1fr) auto;\n grid-template-rows: 40px 40px;\n align-items: center;\n gap: 4px 12px;\n padding: 8px 12px 9px;\n border-bottom: 1px solid var(--os-border);\n background: var(--dsw-alias-bg-base);\n}\n.oh-video-mode-tabs { display: flex; width: fit-content; grid-column: 1; grid-row: 1; padding: 2px; border: 1px solid var(--os-border); border-radius: 9px; background: var(--dsw-alias-bg-layer-1); }\n.oh-video-mode-tabs button,\n.oh-video-tabs button,\n.oh-video-version-tabs button {\n min-height: 36px;\n border: 0;\n border-radius: 6px;\n padding: 4px 8px;\n color: var(--os-muted);\n background: transparent;\n cursor: pointer;\n white-space: nowrap;\n font: 12px/1 var(--dsw-font-family);\n}\n.oh-video-mode-tabs button { min-width: 48px; }\n.oh-video-mode-tabs button:hover,\n.oh-video-tabs button:hover,\n.oh-video-version-tabs button:hover { color: var(--dsw-alias-label-primary); }\n.oh-video-mode-tabs button[aria-selected=\"true\"],\n.oh-video-tabs button[aria-selected=\"true\"],\n.oh-video-version-tabs button[aria-selected=\"true\"] { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-bg-base); box-shadow: 0 1px 2px rgb(0 0 0 / 9%); font-weight: 600; }\n.oh-video-project { display: flex; min-width: 0; grid-column: 1; grid-row: 2; align-items: center; gap: 9px; color: var(--os-muted); font-size: 11px; }\n.oh-video-project > span { flex: none; }\n.oh-video-project select {\n width: min(100%, 440px);\n min-width: 0;\n min-height: 36px;\n border: 1px solid var(--os-border);\n border-radius: 8px;\n padding: 6px 28px 6px 9px;\n color: var(--dsw-alias-label-primary);\n background: var(--dsw-alias-bg-base);\n overflow: hidden;\n text-overflow: ellipsis;\n font: inherit;\n font-weight: 500;\n}\n.oh-video-stage { display: inline-flex; grid-column: 2; grid-row: 2; align-items: center; gap: 7px; border: 1px solid var(--os-border); border-radius: 999px; padding: 5px 9px; color: var(--os-muted); background: var(--dsw-alias-bg-layer-1); white-space: nowrap; font-size: 11px; }\n.oh-video-stage > i { width: 7px; height: 7px; border-radius: 50%; background: var(--video-warning); }\n.oh-video-stage[data-state=\"ready\"] > i { background: var(--dsw-alias-state-success-primary, #45b96f); }\n.oh-video-stage[data-state=\"not-started\"] > i { background: var(--os-muted); }\n.oh-video-tabs,\n.oh-video-version-tabs { display: flex; padding: 2px; border: 1px solid var(--os-border); border-radius: 9px; }\n.oh-video-tabs { grid-column: 2; grid-row: 1; }\n.oh-video-tabs button { min-width: 56px; }\n.oh-video-panels,\n.oh-video-panels > [role=\"tabpanel\"] { display: flex; min-width: 0; min-height: 0; flex: 1; overflow: hidden; flex-direction: column; }\n.oh-video-panels > [hidden] { display: none; }\n\n.oh-video-preview-shell { display: grid; min-width: 0; min-height: 0; flex: 1; grid-template-rows: 48px minmax(0, 1fr); overflow: hidden; border-top: 2px solid var(--video-accent); background: var(--video-stage); }\n.oh-video-preview-shell[data-state=\"building\"] { border-top-color: var(--video-warning); }\n.oh-video-preview-shell[data-state=\"error\"] { border-top-color: var(--video-danger); }\n.oh-video-stagebar { display: grid; min-width: 0; grid-template-columns: auto minmax(80px, 1fr) auto; align-items: center; gap: 10px; padding: 0 10px; color: rgb(244 248 255 / 74%); background: var(--video-stage-raised); font-size: 11px; }\n.oh-video-version-tabs { border-color: rgb(255 255 255 / 13%); }\n.oh-video-version-tabs button[aria-selected=\"true\"] { color: #fff; background: rgb(255 255 255 / 12%); }\n.oh-video-runtime-state { display: flex; min-width: 0; align-items: center; justify-content: center; gap: 7px; overflow: hidden; }\n.oh-video-runtime-state > i { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--dsw-alias-state-success-primary, #45b96f); }\n.oh-video-preview-shell[data-state=\"building\"] .oh-video-runtime-state > i { background: var(--video-warning); }\n.oh-video-preview-shell[data-state=\"error\"] .oh-video-runtime-state > i { background: var(--video-danger); }\n.oh-video-runtime-state > em { overflow: hidden; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }\n.oh-video-preview-actions { display: flex; gap: 5px; }\n.oh-video-preview-actions button,\n.oh-video-preview-actions a { display: grid; min-width: 34px; min-height: 34px; box-sizing: border-box; place-items: center; border: 1px solid rgb(255 255 255 / 14%); border-radius: 6px; padding: 3px 8px; color: rgb(255 255 255 / 84%); background: rgb(255 255 255 / 5%); cursor: pointer; text-decoration: none; font: inherit; }\n.oh-video-preview-actions svg { width: 16px; height: 16px; }\n.oh-video-preview-actions button:hover,\n.oh-video-preview-actions a:hover { background: rgb(255 255 255 / 11%); }\n.oh-video-player-stage { display: grid; min-width: 0; min-height: 0; place-items: center; overflow: hidden; padding: 14px; background: radial-gradient(circle at 50% 40%, #1b2027, var(--video-stage) 62%); }\n.oh-video-player-stage video { display: block; width: min(100%, 1200px); height: auto; max-width: 100%; max-height: 100%; border-radius: 4px; object-fit: contain; background: #000; box-shadow: 0 16px 50px rgb(0 0 0 / 32%); }\n.oh-video-preview-shell:fullscreen { width: 100vw; height: 100vh; }\n\n.oh-video-preview-empty,\n.oh-video-artifacts-empty { display: grid; max-width: 620px; margin: auto; place-items: center; gap: 9px; padding: 36px; color: var(--os-muted); text-align: center; line-height: 1.65; }\n.oh-video-preview-empty { width: 100%; max-width: none; min-height: 0; box-sizing: border-box; flex: 1; align-content: center; color: rgb(244 248 255 / 70%); background: var(--video-stage); }\n.oh-video-preview-empty > span { color: var(--video-accent); font-size: 32px; }\n.oh-video-preview-empty strong { color: rgb(255 255 255 / 92%); }\n.oh-video-preview-empty p { max-width: 560px; margin: 0; }\n.oh-video-preview-empty code { color: rgb(255 255 255 / 88%); }\n.oh-video-prompt-example { max-width: 560px; margin-top: 10px; padding: 12px 14px; border: 1px solid rgb(255 255 255 / 11%); border-radius: 9px; background: rgb(255 255 255 / 4%); text-align: left; }\n.oh-video-prompt-example span { display: block; margin-bottom: 4px; color: var(--video-accent); font-size: 10px; font-weight: 600; }\n.oh-video-prompt-example q { quotes: none; }\n\n.oh-video-artifacts { display: grid; min-width: 0; min-height: 0; flex: 1; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); overflow: hidden; }\n.oh-video-artifacts > aside { display: flex; min-height: 0; flex-direction: column; overflow: hidden; padding: 8px; border-right: 1px solid var(--os-border); background: var(--dsw-alias-bg-layer-1); }\n.oh-video-artifacts-heading { display: flex; min-height: 30px; flex: none; align-items: center; justify-content: space-between; padding: 0 7px; }\n.oh-video-artifacts-heading strong { font-size: 11px; }\n.oh-video-artifacts-heading span { min-width: 20px; border-radius: 999px; padding: 1px 5px; color: var(--os-muted); background: var(--dsw-alias-button-ghost-active-fill); text-align: center; font-size: 10px; }\n.oh-video-artifacts > aside nav { min-height: 0; flex: 1; overflow: auto; }\n.oh-video-artifacts > aside nav button { display: flex; width: 100%; min-width: 0; position: relative; flex-direction: column; align-items: flex-start; gap: 3px; border: 0; border-radius: 7px; padding: 9px; color: inherit; background: transparent; cursor: pointer; text-align: left; }\n.oh-video-artifacts > aside nav button:hover,\n.oh-video-artifacts > aside nav button[aria-current=\"page\"] { background: var(--dsw-alias-button-ghost-active-fill); }\n.oh-video-artifacts > aside nav button[aria-current=\"page\"]::before { content: \"\"; width: 2px; position: absolute; inset-block: 8px; left: 2px; border-radius: 2px; background: var(--video-accent); }\n.oh-video-artifacts > aside nav small { width: 100%; overflow: hidden; color: var(--os-muted); text-overflow: ellipsis; white-space: nowrap; }\n.oh-video-artifacts > aside nav > p { margin: 10px 4px; color: var(--os-muted); font-size: 11px; line-height: 1.5; }\n.oh-video-environment { display: grid; gap: 5px; margin-bottom: 8px; padding: 8px; border: 1px solid var(--os-border); border-radius: 8px; background: var(--dsw-alias-bg-layer-1); }\n.oh-video-environment strong { font-size: 11px; }\n.oh-video-environment span { color: var(--os-muted); font-size: 10px; }\n.oh-video-environment em { color: var(--os-muted); font-size: 10px; font-style: normal; line-height: 1.5; }\n.oh-video-environment code { font-size: 10px; }\n.oh-video-environment span::before { content: \"\u25CF\"; margin-right: 5px; color: var(--video-danger); }\n.oh-video-environment span[data-ready]::before { color: var(--dsw-alias-state-success-primary, #45b96f); }\n.oh-video-environment button { min-height: 30px; border: 1px solid var(--os-border); border-radius: 6px; color: inherit; background: var(--dsw-alias-bg-base); cursor: pointer; font: inherit; }\n.oh-video-artifacts > section { display: flex; min-width: 0; min-height: 0; overflow: hidden; flex-direction: column; }\n.oh-video-artifact-header { display: flex; min-height: 54px; box-sizing: border-box; flex: none; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--os-border); }\n.oh-video-artifact-header > div { display: flex; min-width: 0; flex-direction: column; gap: 3px; }\n.oh-video-artifact-header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }\n.oh-video-artifact-header span { overflow: hidden; color: var(--os-muted); text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }\n.oh-video-artifact-header em { flex: none; border: 1px solid var(--os-border); border-radius: 999px; padding: 3px 7px; color: var(--os-muted); background: var(--dsw-alias-bg-layer-1); font-size: 10px; font-style: normal; }\n.oh-video-artifact-content { min-width: 0; min-height: 0; flex: 1; overflow: auto; }\n.oh-video-artifact-content pre { min-width: 0; min-height: 100%; box-sizing: border-box; margin: 0; padding: 20px; color: inherit; background: var(--dsw-alias-bg-base); white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.65 var(--dsw-font-family-mono, ui-monospace, monospace); }\n\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"medium\"]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"]) { grid-template-columns: minmax(0, 1fr) clamp(360px, 42%, 440px); }\n[data-oh-story-workbench=\"video\"][data-oh-story-layout=\"medium\"] .oh-video-project select { width: 100%; }\n\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"]:has(> [data-slot=\"conversation.session\"] > .oh-story-split-surface[data-open=\"true\"]) { display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"]\n > [data-slot=\"conversation.session\"] > :not(.oh-story-split-surface),\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"]\n > [data-composer-seat],\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-studio { grid-column: 1; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"][data-oh-studio-pane=\"studio\"]\n > [data-slot=\"conversation.session\"] > :not(.oh-story-split-surface),\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"][data-oh-studio-pane=\"studio\"]\n > [data-composer-seat],\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"][data-oh-studio-pane=\"chat\"] .oh-video-studio { display: none; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-game-mobile-switcher { display: flex; position: absolute; top: 8px; right: 8px; z-index: 20; border-color: var(--dsw-alias-border-l1); box-shadow: 0 4px 14px rgb(0 0 0 / 12%); }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-toolbar { min-height: 142px; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 44px 44px 38px; align-content: center; gap: 2px 6px; padding: 4px 8px; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-toolbar > .oh-workbench-cluster { grid-column: 1 / -1; grid-row: 1; width: fit-content; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-tabs { grid-column: 2; grid-row: 2; justify-self: end; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-project { grid-column: 1; grid-row: 2; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-project > span { display: none; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-stage { grid-column: 1 / -1; grid-row: 3; justify-self: start; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-stagebar { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 42px 38px; gap: 2px 6px; padding: 3px 7px; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-preview-shell { grid-template-rows: 86px minmax(0, 1fr); }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-version-tabs { grid-column: 1; grid-row: 1; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-runtime-state { grid-column: 1; grid-row: 2; justify-content: flex-start; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-preview-actions { grid-column: 2; grid-row: 1 / 3; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-preview-actions button:first-child { max-width: 70px; }\n[data-conversation-scroll][data-oh-story-workbench=\"video\"][data-oh-story-layout=\"compact\"] .oh-video-artifacts { grid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AAM,QAAQ,OAAO,IAAI,MAAM,sDAAc,CAAC;AAAA,UACpE,kBAAkB,MAAM,QAAQ,OAAO,IAAI,MAAM,sDAAc,CAAC;AAAA,UAChE,wBAAwB,MAAM,QAAQ,OAAO,IAAI,MAAM,sDAAc,CAAC;AAAA,QACxE,IAEK;AAAA,UACL,sBAAsB,CAAC,WAAmB,aAAa,KAAK,MAAM;AAAA,UAClE,kBAAkB,MAAM,aAAa,OAAO;AAAA,UAC5C,wBAAwB,CAAC,WAAmB,aAAa,YAAY,QAAuD,EAAE,MAAM,SAAS,CAAC;AAAA,QAChJ;AAAA,MACF;AAAA,IACF,GAAG,mBAAmB;AACtB,WAAO,CAAC,aAAa,gBAAgB;AAAA,EACvC,CAAC,GACD,QAAQ,MAAM,OAAO,sBAAsB,MAAM,QAAQ,MAAM,SAAS;AAAA,IACtE,MAAM;AAAA,IACN,KAAK;AAAA,EACP,GAAG,YAAY,CAAC,GAChB,QAAQ,MAAM,OAAO,sBAAsB,MAAM,QAAQ,MAAM,SAAS;AAAA,IACtE,MAAM;AAAA,IACN,KAAK;AAAA,EACP,GAAG,kBAAkB,CAAC;AACxB;AAEA,IAAO,gBAAQ,EAAE,MAAM,QAAQ,MAAM;",
6
6
  "names": ["import_react", "name", "visit", "directory", "name", "import_jsx_runtime", "directory", "name", "import_jsx_runtime", "import_react", "import_jsx_runtime", "name", "asset", "import_jsx_runtime", "activity", "name", "directory", "open"]
7
7
  }