@oh-story/dsh 0.1.13 → 0.1.14

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 CHANGED
@@ -24,7 +24,7 @@ __export(index_exports, {
24
24
  name: () => name
25
25
  });
26
26
  module.exports = __toCommonJS(index_exports);
27
- var import_dsh_client_store = require("@deepseek-ai/dsh-client-store"), import_react3 = require("react"), import_react_dom = require("react-dom");
27
+ var import_dsh_client_store = require("@deepseek-ai/dsh-client-store"), import_react4 = require("react"), import_react_dom = require("react-dom");
28
28
 
29
29
  // src/client/file-activity.ts
30
30
  var WORKBENCH_LABELS = {
@@ -810,7 +810,7 @@ function creatorDocumentOrder(path) {
810
810
  }
811
811
 
812
812
  // src/client/drama-production-view.tsx
813
- var import_react = require("react");
813
+ var import_react2 = require("react");
814
814
 
815
815
  // src/client/workbench-ui.ts
816
816
  function handleTabKey(event, values, current, select) {
@@ -825,6 +825,230 @@ function endpoint(path, sessionId, file) {
825
825
  return url.searchParams.set("sessionId", sessionId), file !== void 0 && url.searchParams.set("path", file), url.toString();
826
826
  }
827
827
 
828
+ // src/client/production-canvas.tsx
829
+ var import_react = require("react");
830
+
831
+ // src/client/canvas-viewport.ts
832
+ var DEFAULT_CANVAS_VIEWPORT = { x: 0, y: 0, zoom: 0.65 }, FIT_PADDING = 40;
833
+ function clampZoom(zoom) {
834
+ return Math.min(3, Math.max(0.1, zoom));
835
+ }
836
+ function zoomAt(viewport, factor, anchor) {
837
+ let zoom = clampZoom(viewport.zoom * factor), scale = zoom / viewport.zoom;
838
+ return { x: anchor.x - (anchor.x - viewport.x) * scale, y: anchor.y - (anchor.y - viewport.y) * scale, zoom };
839
+ }
840
+ function wheelZoomFactor(deltaY, deltaMode) {
841
+ let pixels = deltaMode === 1 ? deltaY * 16 : deltaMode === 2 ? deltaY * 800 : deltaY;
842
+ return Math.exp(-pixels * 1e-3);
843
+ }
844
+ function centerOn(viewport, node, size) {
845
+ return {
846
+ x: size.width / 2 - (node.x + 180 / 2) * viewport.zoom,
847
+ y: size.height / 2 - (node.y + 76 / 2) * viewport.zoom,
848
+ zoom: viewport.zoom
849
+ };
850
+ }
851
+ function nodeVisible(viewport, node, size) {
852
+ let left = node.x * viewport.zoom + viewport.x, top = node.y * viewport.zoom + viewport.y;
853
+ return left >= 0 && top >= 0 && left + 180 * viewport.zoom <= size.width && top + 76 * viewport.zoom <= size.height;
854
+ }
855
+ function fitNodes(nodes, size, fallback = DEFAULT_CANVAS_VIEWPORT) {
856
+ if (nodes.length === 0 || size.width <= 0 || size.height <= 0) return fallback;
857
+ let left = Math.min(...nodes.map((node) => node.x)), top = Math.min(...nodes.map((node) => node.y)), right = Math.max(...nodes.map((node) => node.x + 180)), bottom = Math.max(...nodes.map((node) => node.y + 76)), widthZoom = (size.width - FIT_PADDING * 2) / Math.max(1, right - left), heightZoom = (size.height - FIT_PADDING * 2) / Math.max(1, bottom - top), zoom = clampZoom(Math.min(1, Math.max(Math.min(widthZoom, heightZoom), Math.min(widthZoom, 0.4)))), fitsHeight = (bottom - top) * zoom <= size.height - FIT_PADDING * 2;
858
+ return {
859
+ x: (size.width - (right - left) * zoom) / 2 - left * zoom,
860
+ y: fitsHeight ? (size.height - (bottom - top) * zoom) / 2 - top * zoom : FIT_PADDING - top * zoom,
861
+ zoom
862
+ };
863
+ }
864
+
865
+ // src/client/production-canvas.tsx
866
+ var import_jsx_runtime3 = require("react/jsx-runtime"), CLICK_SLOP = 4, BUTTON_ZOOM_STEP = 1.2, WHEEL_COMMIT_DELAY = 160;
867
+ function canvasNodes(production) {
868
+ let assets = [...production.assets, ...production.visualAssets].map((asset, index) => ({ id: asset.id, label: asset.title, type: "asset", initial: { x: 80, y: 80 + index * 150 } })), shots = production.shots.map((shot, index) => ({ id: shot.id, label: shot.title, type: "shot", initial: { x: 640, y: 80 + index * 180 } }));
869
+ return [...assets, ...shots];
870
+ }
871
+ function ProductionCanvas(props) {
872
+ let nodes = (0, import_react.useMemo)(() => canvasNodes(props.production), [props.production]), viewportRef = (0, import_react.useRef)(null), [size, setSize] = (0, import_react.useState)({ width: 0, height: 0 }), [liveViewport, setLiveViewport] = (0, import_react.useState)(), [liveNode, setLiveNode] = (0, import_react.useState)(), [panning, setPanning] = (0, import_react.useState)(!1), wheelCommit = (0, import_react.useRef)(void 0), selectedHere = (0, import_react.useRef)(void 0), followed = (0, import_react.useRef)(void 0), positions = Object.fromEntries(nodes.map((node) => [node.id, props.canvas[node.id] ?? node.initial]));
873
+ liveNode !== void 0 && (positions[liveNode.id] = liveNode.point);
874
+ let committedViewport = props.viewport ?? (size.width > 0 ? fitNodes(Object.values(positions), size) : DEFAULT_CANVAS_VIEWPORT), viewport = liveViewport ?? committedViewport, latest = (0, import_react.useRef)({ viewport, committedViewport, props, nodes, size });
875
+ latest.current = { viewport, committedViewport, props, nodes, size }, (0, import_react.useLayoutEffect)(() => {
876
+ let element = viewportRef.current;
877
+ if (element === null) return;
878
+ let measure = () => {
879
+ setSize({ width: element.clientWidth, height: element.clientHeight });
880
+ };
881
+ measure();
882
+ let observer = new ResizeObserver(measure);
883
+ return observer.observe(element), () => {
884
+ observer.disconnect();
885
+ };
886
+ }, []), (0, import_react.useEffect)(() => {
887
+ let element = viewportRef.current;
888
+ if (element === null) return;
889
+ let onWheel = (event) => {
890
+ event.preventDefault();
891
+ let bounds = element.getBoundingClientRect(), next = zoomAt(latest.current.viewport, wheelZoomFactor(event.deltaY, event.deltaMode), { x: event.clientX - bounds.left, y: event.clientY - bounds.top });
892
+ setLiveViewport(next), clearTimeout(wheelCommit.current), wheelCommit.current = setTimeout(() => {
893
+ wheelCommit.current = void 0, latest.current.props.onViewportChange(next), setLiveViewport(void 0);
894
+ }, WHEEL_COMMIT_DELAY);
895
+ };
896
+ return element.addEventListener("wheel", onWheel, { passive: !1 }), () => {
897
+ element.removeEventListener("wheel", onWheel), clearTimeout(wheelCommit.current);
898
+ };
899
+ }, []);
900
+ let measured = size.width > 0;
901
+ (0, import_react.useEffect)(() => {
902
+ let { committedViewport: initial, props: currentProps } = latest.current;
903
+ measured && currentProps.viewport === void 0 && currentProps.onViewportChange(initial);
904
+ }, [measured]), (0, import_react.useEffect)(() => {
905
+ let { viewport: current, props: currentProps, nodes: currentNodes, size: currentSize } = latest.current, id = currentProps.selectedId;
906
+ if (!measured || id === followed.current || (followed.current = id, id === void 0)) return;
907
+ if (id === selectedHere.current) {
908
+ selectedHere.current = void 0;
909
+ return;
910
+ }
911
+ let node = currentNodes.find((candidate) => candidate.id === id);
912
+ if (node === void 0) return;
913
+ let point = currentProps.canvas[id] ?? node.initial;
914
+ nodeVisible(current, point, currentSize) || currentProps.onViewportChange(centerOn(current, point, currentSize));
915
+ }, [measured, props.selectedId]);
916
+ let flushWheel = () => {
917
+ wheelCommit.current !== void 0 && (clearTimeout(wheelCommit.current), wheelCommit.current = void 0, props.onViewportChange(viewport), setLiveViewport(void 0));
918
+ }, commitViewport = (next) => {
919
+ clearTimeout(wheelCommit.current), wheelCommit.current = void 0, setLiveViewport(void 0), props.onViewportChange(next);
920
+ }, zoomAtCenter = (factor) => {
921
+ commitViewport(zoomAt(viewport, factor, { x: size.width / 2, y: size.height / 2 }));
922
+ }, startPan = (event) => {
923
+ if (event.target instanceof Element && event.target.closest("article") !== null || event.button !== 0 && event.button !== 1) return;
924
+ event.preventDefault(), flushWheel();
925
+ let element = event.currentTarget;
926
+ element.setPointerCapture(event.pointerId), element.focus({ preventScroll: !0 });
927
+ let origin = viewport, start = { x: event.clientX, y: event.clientY }, moved = !1, next = origin;
928
+ setPanning(!0);
929
+ let move = (moveEvent) => {
930
+ let dx = moveEvent.clientX - start.x, dy = moveEvent.clientY - start.y;
931
+ !moved && Math.hypot(dx, dy) < CLICK_SLOP || (moved = !0, next = { ...origin, x: origin.x + dx, y: origin.y + dy }, setLiveViewport(next));
932
+ }, end = () => {
933
+ element.removeEventListener("pointermove", move), element.removeEventListener("pointerup", end), element.removeEventListener("pointercancel", end), setPanning(!1), moved ? commitViewport(next) : (selectedHere.current = void 0, props.onSelect(void 0));
934
+ };
935
+ element.addEventListener("pointermove", move), element.addEventListener("pointerup", end), element.addEventListener("pointercancel", end);
936
+ }, startDrag = (event, id) => {
937
+ if (event.button !== 0) return;
938
+ event.stopPropagation();
939
+ let element = event.currentTarget;
940
+ element.setPointerCapture(event.pointerId);
941
+ let origin = positions[id] ?? { x: 0, y: 0 }, start = { x: event.clientX, y: event.clientY }, zoom = viewport.zoom, moved = !1, next = origin, move = (moveEvent) => {
942
+ let dx = moveEvent.clientX - start.x, dy = moveEvent.clientY - start.y;
943
+ !moved && Math.hypot(dx, dy) < CLICK_SLOP || (moved = !0, next = { x: origin.x + dx / zoom, y: origin.y + dy / zoom }, setLiveNode({ id, point: next }));
944
+ }, end = () => {
945
+ element.removeEventListener("pointermove", move), element.removeEventListener("pointerup", end), element.removeEventListener("pointercancel", end), setLiveNode(void 0), moved ? props.onCanvasChange({ ...props.canvas, [id]: next }) : (id !== props.selectedId && (selectedHere.current = id), props.onSelect(id));
946
+ };
947
+ element.addEventListener("pointermove", move), element.addEventListener("pointerup", end), element.addEventListener("pointercancel", end);
948
+ }, navigate = (id) => {
949
+ let target = props.production.targets.get(id);
950
+ target !== void 0 && props.onNavigate(target);
951
+ }, onNodeKeyDown = (event, id) => {
952
+ if (event.key === "Enter" || event.key === " ") {
953
+ event.preventDefault(), navigate(id);
954
+ return;
955
+ }
956
+ let step = event.shiftKey ? 40 : 10, delta = arrowDelta(event.key, step);
957
+ if (delta === void 0) return;
958
+ event.preventDefault(), event.stopPropagation();
959
+ let origin = positions[id] ?? { x: 0, y: 0 }, point = { x: origin.x + delta.x, y: origin.y + delta.y };
960
+ props.onCanvasChange({ ...props.canvas, [id]: point }), size.width > 0 && !nodeVisible(viewport, point, size) && commitViewport(centerOn(viewport, point, size));
961
+ }, onViewportKeyDown = (event) => {
962
+ if (event.target !== event.currentTarget) return;
963
+ let delta = arrowDelta(event.key, event.shiftKey ? 240 : 60);
964
+ delta !== void 0 ? (event.preventDefault(), commitViewport({ ...viewport, x: viewport.x - delta.x, y: viewport.y - delta.y })) : event.key === "+" || event.key === "=" ? (event.preventDefault(), zoomAtCenter(BUTTON_ZOOM_STEP)) : event.key === "-" || event.key === "_" ? (event.preventDefault(), zoomAtCenter(1 / BUTTON_ZOOM_STEP)) : event.key === "0" && (event.preventDefault(), commitViewport(fitNodes(Object.values(positions), size)));
965
+ }, connections = props.production.shots.flatMap((shot) => shot.references.map((reference) => [reference, shot.id])), gridSize = 20 * viewport.zoom;
966
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("section", { className: "oh-story-canvas-shell", "aria-label": "\u77ED\u5267\u7D20\u6750\u4E0E\u955C\u5934\u5173\u7CFB\u753B\u5E03", children: [
967
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-canvas-toolbar", children: [
968
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-canvas-help", id: "oh-story-canvas-help", children: "\u62D6\u52A8\u7A7A\u767D\u5904\u5E73\u79FB \xB7 \u6EDA\u8F6E\u7F29\u653E \xB7 \u65B9\u5411\u952E\u79FB\u52A8\u8282\u70B9 \xB7 Enter \u6253\u5F00\u539F\u6587 \xB7 \u5E03\u5C40\u53EA\u5728\u672C\u9875\u4FDD\u7559" }),
969
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-canvas-controls", children: [
970
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", "aria-label": "\u7F29\u5C0F\u753B\u5E03", onClick: () => {
971
+ zoomAtCenter(1 / BUTTON_ZOOM_STEP);
972
+ }, children: "\u2212" }),
973
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { "aria-live": "polite", children: [
974
+ Math.round(viewport.zoom * 100),
975
+ "%"
976
+ ] }),
977
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", "aria-label": "\u653E\u5927\u753B\u5E03", onClick: () => {
978
+ zoomAtCenter(BUTTON_ZOOM_STEP);
979
+ }, children: "\uFF0B" }),
980
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: () => {
981
+ commitViewport(fitNodes(Object.values(positions), size));
982
+ }, children: "\u9002\u5E94" }),
983
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: () => {
984
+ props.onCanvasChange({}), commitViewport(fitNodes(nodes.map((node) => node.initial), size));
985
+ }, children: "\u590D\u4F4D" })
986
+ ] })
987
+ ] }),
988
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
989
+ "div",
990
+ {
991
+ ref: viewportRef,
992
+ className: "oh-story-canvas-viewport",
993
+ role: "application",
994
+ "aria-roledescription": "\u65E0\u9650\u753B\u5E03",
995
+ "aria-label": "\u753B\u5E03\u89C6\u91CE",
996
+ "aria-describedby": "oh-story-canvas-help",
997
+ tabIndex: 0,
998
+ "data-panning": panning || void 0,
999
+ style: { backgroundPosition: `${String(viewport.x)}px ${String(viewport.y)}px`, backgroundSize: `${String(gridSize)}px ${String(gridSize)}px` },
1000
+ onPointerDown: startPan,
1001
+ onKeyDown: onViewportKeyDown,
1002
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-canvas", style: { transform: `translate(${String(viewport.x)}px, ${String(viewport.y)}px) scale(${String(viewport.zoom)})` }, children: [
1003
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { "aria-hidden": "true", children: connections.map(([from, to]) => {
1004
+ let a = positions[from], b = positions[to];
1005
+ if (a === void 0 || b === void 0) return null;
1006
+ let y1 = a.y + 76 / 2, y2 = b.y + 76 / 2, x1 = a.x + 180, bend = Math.max(60, Math.abs(b.x - x1) / 2);
1007
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { "data-active": to === props.selectedId || from === props.selectedId || void 0, d: `M ${String(x1)} ${String(y1)} C ${String(x1 + bend)} ${String(y1)}, ${String(b.x - bend)} ${String(y2)}, ${String(b.x)} ${String(y2)}` }, `${from}:${to}`);
1008
+ }) }),
1009
+ nodes.map((node) => {
1010
+ let references = connections.filter(([from, to]) => from === node.id || to === node.id).length;
1011
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
1012
+ "article",
1013
+ {
1014
+ tabIndex: 0,
1015
+ role: "button",
1016
+ "aria-label": `${node.type === "asset" ? "\u7D20\u6750" : "\u955C\u5934"} ${node.label}\uFF0C${String(references)} \u6761\u5173\u7CFB`,
1017
+ "aria-pressed": node.id === props.selectedId,
1018
+ "data-node-type": node.type,
1019
+ "data-selected": node.id === props.selectedId || void 0,
1020
+ "data-dragging": liveNode?.id === node.id || void 0,
1021
+ style: { left: positions[node.id]?.x, top: positions[node.id]?.y },
1022
+ onKeyDown: (event) => {
1023
+ onNodeKeyDown(event, node.id);
1024
+ },
1025
+ onPointerDown: (event) => {
1026
+ startDrag(event, node.id);
1027
+ },
1028
+ onDoubleClick: () => {
1029
+ navigate(node.id);
1030
+ },
1031
+ children: [
1032
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("small", { children: node.type === "asset" ? "\u7D20\u6750" : "\u955C\u5934" }),
1033
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: node.label }),
1034
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: node.id })
1035
+ ]
1036
+ },
1037
+ node.id
1038
+ );
1039
+ })
1040
+ ] })
1041
+ }
1042
+ )
1043
+ ] });
1044
+ }
1045
+ function arrowDelta(key, step) {
1046
+ if (key === "ArrowLeft") return { x: -step, y: 0 };
1047
+ if (key === "ArrowRight") return { x: step, y: 0 };
1048
+ if (key === "ArrowUp") return { x: 0, y: -step };
1049
+ if (key === "ArrowDown") return { x: 0, y: step };
1050
+ }
1051
+
828
1052
  // src/client/production-prompts.ts
829
1053
  var 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", referenceRules = "\u53C2\u8003\u8F93\u5165\u4EE5\u6765\u6E90\u6761\u76EE\u81EA\u5DF1\u7684\u58F0\u660E\u4E3A\u51C6\uFF08IMG-* \u7684\u300C\u53C2\u8003\u300D\uFF0CSHOT-*\uFF0FMOTION-* \u7684\u300C\u8F93\u5165\u53C2\u8003\u56FE\u300D\uFF0C\u4EE5\u53CA MOTION-* \u72EC\u7ACB\u7684\u300C\u53C2\u8003\u97F3\u9891\u300D\uFF09\uFF1Areference_bindings \u5FC5\u987B\u4E0E\u8BE5\u6761\u76EE\u9010\u69FD\u4E00\u81F4\uFF0C\u5DE5\u4F5C\u53F0\u5217\u51FA\u7684\u8865\u5145\u53C2\u8003\u53EA\u4F5C\u6838\u5BF9\uFF0C\u6761\u76EE\u91CC\u6CA1\u6709\u58F0\u660E\u7684\u4E0D\u8981\u76F4\u63A5\u52A0\u8FDB job\uFF0C\u786E\u9700\u4F7F\u7528\u65F6\u5148\u8BF7\u62E5\u6709\u8BE5\u6761\u76EE\u7684\u9636\u6BB5\u4FEE\u8BA2\u6587\u6863\u3002\u8D77\u59CB\u5E27\u4E0E\u7ED3\u675F\u5E27\u7684\u89D2\u8272\u53EA\u53D6\u81EA\u6765\u6E90\u6761\u76EE\u81EA\u5DF1\u300C\u8F93\u5165\u53C2\u8003\u56FE\u300D\u5404\u69FD\u4F4D\u8BB0\u5F55\u7684\u7528\u9014\uFF08\u8D77\u59CB\u5E27\uFF0F\u7ED3\u675F\u5E27\uFF09\uFF1ASHOT-* \u770B\u300A\u5206\u955C.md\u300B\uFF0CMOTION-* \u770B\u300A\u89C6\u9891\u63D0\u793A\u8BCD.md\u300B\uFF1B\u518D\u7531\u76EE\u6807\u6A21\u578B\u65B9\u8A00\u7FFB\u6210 adapter \u7684 role\uFF0C\u4E0D\u6309\u6587\u4EF6\u540D\u6216\u5DE5\u4F5C\u53F0\u6E05\u5355\u63A8\u65AD\u3002\u76EE\u6807\u65B9\u8A00\u7528 first_frame\uFF0Flast_frame \u4F4D\u7F6E\u627F\u63A5\u8FD9\u7EC4\u8F93\u5165\u65F6\uFF0C\u7ED3\u675F\u5E27\u53EA\u8FDB last_frame\uFF0C\u7EDD\u4E0D\u964D\u7EA7\u6210\u666E\u901A\u53C2\u8003\u56FE\uFF1B\u65B9\u8A00\u8981\u6C42\u6574\u7EC4\u8D70\u591A\u69FD\u53C2\u8003\u65F6\uFF08\u5982 MiniMax H3 \u7684 full-reference\uFF1A\u9996\u5C3E\u5E27\u8F93\u5165\u4E0E\u53C2\u8003\u8F93\u5165\u4E92\u65A5\uFF0C\u8D77\u59CB\u5E27\u3001\u7ED3\u675F\u5E27\u90FD\u968F\u6574\u7EC4\u4EE5 reference_image \u9001\u5165\uFF09\uFF0C\u6309\u65B9\u8A00\u7FFB\u8BD1\uFF0C\u5E76\u5728\u9884\u89C8\u91CC\u5199\u660E\u7ED3\u675F\u5E27\u5C06\u4F5C\u4E3A\u53C2\u8003\u56FE\u9001\u5165\uFF0C\u6216\u5148\u8BF7\u5206\u955C owner \u53D6\u820D\u3002MOTION-* \u7684\u300C\u53C2\u8003\u97F3\u9891\u300D\u4E0D\u6DF7\u5165\u300C\u8F93\u5165\u53C2\u8003\u56FE\u300D\uFF1A\u5B83\u6392\u5728\u56FE\u7247 binding \u4E4B\u540E\uFF0Crole \u56FA\u5B9A\u4E3A reference_audio\uFF0Ccharacter \u9010\u5B57\u7167\u6284\u8BE5\u884C\u300C\u89D2\u8272\u300D\uFF0C\u97F3\u9891\u987A\u5E8F\u4ECD\u72EC\u7ACB\u4ECE 1 \u7F16\u53F7\uFF1Badapter profile \u672A\u663E\u5F0F\u58F0\u660E\u652F\u6301 reference_audio \u65F6\u5FC5\u987B\u5728\u63D0\u4EA4\u524D\u5931\u8D25\uFF0C\u4E0D\u80FD\u9759\u9ED8\u4E22\u5F03\u6216\u628A\u97F3\u9891\u5F53\u56FE\u7247\u3002", shotStartFrameNote = "\u5206\u955C.md \u7684 SHOT-* \u53EA\u4EA7\u51FA\u8D77\u59CB\u5E27\uFF1B\u8981\u4EA7\u51FA\u7ED3\u675F\u5E27\uFF0C\u5148\u7531\u56FE\u7247\u63D0\u793A\u8BCD\u9636\u6BB5\u5EFA\u7ACB\u72EC\u7ACB\u7684 IMG-* \u6761\u76EE\u518D\u6295\u4EA7\u3002";
830
1054
  function referenceParagraph(kind) {
@@ -1042,7 +1266,7 @@ function reorderSequence(sequence, source, target) {
1042
1266
  }
1043
1267
 
1044
1268
  // src/client/drama-production-view.tsx
1045
- var import_jsx_runtime3 = require("react/jsx-runtime"), SECTION_LABELS = { shots: "\u955C\u5934", assets: "\u7D20\u6750", tasks: "\u4EFB\u52A1", sequence: "\u6210\u7247", canvas: "\u753B\u5E03" }, SECTION_ORDER = Object.keys(SECTION_LABELS), STATUS_LABELS = { 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" }, ASSET_KIND_LABEL = { character: "\u4EBA\u7269", scene: "\u573A\u666F", prop: "\u9053\u5177", state: "\u72B6\u6001", unknown: "\u8BBE\u5B9A" }, JOB_KIND_LABEL = { image: "\u56FE\u7247", video: "\u89C6\u9891", composition: "\u6210\u7247" }, ASSEMBLED_CUT_PATH = "\u5236\u4F5C\u6210\u679C/\u6210\u7247/\u6210\u7247.mp4";
1269
+ var import_jsx_runtime4 = require("react/jsx-runtime"), SECTION_LABELS = { shots: "\u955C\u5934", assets: "\u7D20\u6750", tasks: "\u4EFB\u52A1", sequence: "\u6210\u7247", canvas: "\u753B\u5E03" }, SECTION_ORDER = Object.keys(SECTION_LABELS), STATUS_LABELS = { 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" }, ASSET_KIND_LABEL = { character: "\u4EBA\u7269", scene: "\u573A\u666F", prop: "\u9053\u5177", state: "\u72B6\u6001", unknown: "\u8BBE\u5B9A" }, JOB_KIND_LABEL = { image: "\u56FE\u7247", video: "\u89C6\u9891", composition: "\u6210\u7247" }, ASSEMBLED_CUT_PATH = "\u5236\u4F5C\u6210\u679C/\u6210\u7247/\u6210\u7247.mp4";
1046
1270
  function compositionSources(production, sequence, versions) {
1047
1271
  let versionById = new Map(versions.map((version) => [version.id, version])), shotById = new Map(production.shots.map((shot) => [shot.id, shot]));
1048
1272
  return sequence.flatMap((item) => {
@@ -1053,9 +1277,9 @@ function compositionSources(production, sequence, versions) {
1053
1277
  });
1054
1278
  }
1055
1279
  var MODALITY_LABEL = { image: "\u56FE\u7247", video: "\u89C6\u9891", tts: "\u8BED\u97F3", music: "\u97F3\u4E50" };
1056
- function ProductionEnvironment({ sessionId }) {
1057
- let [preflight, setPreflight] = (0, import_react.useState)(), [attempt, setAttempt] = (0, import_react.useState)(0);
1058
- (0, import_react.useEffect)(() => {
1280
+ function ProductionStatus({ sessionId, diagnostics, onNavigate }) {
1281
+ let [preflight, setPreflight] = (0, import_react2.useState)(), [attempt, setAttempt] = (0, import_react2.useState)(0), [open, setOpen] = (0, import_react2.useState)(), [copied, setCopied] = (0, import_react2.useState)(!1);
1282
+ (0, import_react2.useEffect)(() => {
1059
1283
  let controller = new AbortController();
1060
1284
  return fetch(endpoint("drama-preflight", sessionId), { signal: controller.signal }).then(async (response) => {
1061
1285
  if (!response.ok) throw new Error(`HTTP ${String(response.status)}`);
@@ -1067,34 +1291,89 @@ function ProductionEnvironment({ sessionId }) {
1067
1291
  controller.abort();
1068
1292
  };
1069
1293
  }, [attempt, sessionId]);
1070
- let unconfigured = typeof preflight == "object" ? preflight.adapters.filter((adapter) => !adapter.configured) : [];
1071
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-production-environment", role: "status", "aria-label": "\u5A92\u4F53\u751F\u6210\u73AF\u5883", children: [
1072
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: "\u751F\u6210\u73AF\u5883" }),
1073
- preflight === void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { "data-pending": !0, children: "\u68C0\u67E5\u4E2D\u2026" }),
1074
- preflight === "failed" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: () => {
1075
- setPreflight(void 0), setAttempt((value) => value + 1);
1076
- }, children: "\u73AF\u5883\u68C0\u67E5\u5931\u8D25 \xB7 \u91CD\u8BD5" }),
1077
- typeof preflight == "object" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
1078
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { "data-ready": preflight.python.ok || void 0, children: [
1079
- "Python ",
1080
- preflight.python.version ?? "\u672A\u627E\u5230"
1294
+ let toggle = (panel) => {
1295
+ setOpen((current) => current === panel ? void 0 : panel);
1296
+ }, configured = typeof preflight == "object" ? preflight.adapters.filter((adapter) => adapter.configured).length : 0, total = typeof preflight == "object" ? preflight.adapters.length : 0, environmentTone = typeof preflight != "object" ? "neutral" : !preflight.python.ok || !preflight.adapterConfig.ok ? "error" : configured === total ? "ready" : configured > 0 ? "partial" : "idle", protocolErrors = diagnostics.filter((item) => item.severity === "error").length, adapterFile = typeof preflight == "object" ? preflight.adapterConfig.path.split(/[\\/]/u).at(-1) : void 0;
1297
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-production-status", children: [
1298
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-status-pills", children: [
1299
+ preflight === "failed" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("button", { type: "button", className: "oh-story-status-pill", "data-tone": "error", onClick: () => {
1300
+ setPreflight(void 0), setAttempt((value) => value + 1);
1301
+ }, children: [
1302
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { "aria-hidden": "true" }),
1303
+ "\u73AF\u5883\u68C0\u67E5\u5931\u8D25",
1304
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("em", { children: "\u91CD\u8BD5" })
1305
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("button", { type: "button", className: "oh-story-status-pill", "data-tone": environmentTone, "aria-expanded": open === "environment", "aria-controls": "oh-story-production-environment", "aria-label": "\u5A92\u4F53\u751F\u6210\u73AF\u5883", onClick: () => {
1306
+ toggle("environment");
1307
+ }, children: [
1308
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { "aria-hidden": "true" }),
1309
+ "\u751F\u6210\u73AF\u5883",
1310
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("em", { children: typeof preflight != "object" ? "\u68C0\u67E5\u4E2D\u2026" : preflight.python.ok ? `${String(configured)}/${String(total)} \u4F9B\u5E94\u5546\u5DF2\u914D\u7F6E` : "\u9700\u8981 Python 3.10+" }),
1311
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("b", { "aria-hidden": "true" })
1081
1312
  ] }),
1082
- preflight.adapters.map((adapter) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { "data-ready": adapter.configured || void 0, title: adapter.configured ? `${adapter.name} \u5DF2\u914D\u7F6E` : `\u7F3A\u5C11\u73AF\u5883\u53D8\u91CF ${adapter.missing.join("\u3001")}`, children: [
1083
- MODALITY_LABEL[adapter.modality],
1084
- " ",
1085
- adapter.label,
1086
- adapter.configured ? "" : ` \xB7 \u7F3A ${adapter.missing.join("\u3001")}`
1087
- ] }, adapter.name)),
1088
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("em", { children: [
1089
- "DeepSeek \u53EA\u8D1F\u8D23\u5199\u63D0\u793A\u8BCD\uFF1B\u56FE\u7247\u3001\u89C6\u9891\u3001\u8BED\u97F3\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",
1090
- 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",
1091
- " ",
1092
- "Adapter \u914D\u7F6E",
1093
- preflight.adapterConfig.generated ? "\u5DF2\u81EA\u52A8\u767B\u8BB0" : "\u4F7F\u7528\u81EA\u5B9A\u4E49\u6587\u4EF6",
1094
- preflight.adapterConfig.ok ? "" : "\uFF08\u5199\u5165\u5931\u8D25\uFF09",
1095
- "\uFF1A",
1096
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("code", { children: preflight.adapterConfig.path }),
1313
+ diagnostics.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("button", { type: "button", className: "oh-story-status-pill", "data-tone": protocolErrors > 0 ? "error" : "warning", "aria-expanded": open === "diagnostics", "aria-controls": "oh-story-production-diagnostics", onClick: () => {
1314
+ toggle("diagnostics");
1315
+ }, children: [
1316
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { "aria-hidden": "true" }),
1317
+ protocolErrors > 0 ? `${String(protocolErrors)} \u4E2A\u534F\u8BAE\u9519\u8BEF` : `${String(diagnostics.length)} \u4E2A\u683C\u5F0F\u63D0\u9192`,
1318
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("b", { "aria-hidden": "true" })
1319
+ ] })
1320
+ ] }),
1321
+ open === "environment" && typeof preflight == "object" && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { className: "oh-story-status-panel", id: "oh-story-production-environment", "aria-label": "\u5A92\u4F53\u751F\u6210\u73AF\u5883\u8BE6\u60C5", children: [
1322
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("ul", { className: "oh-story-provider-list", children: [
1323
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("li", { "data-ready": preflight.python.ok || void 0, "data-error": !preflight.python.ok || void 0, children: [
1324
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { "aria-hidden": "true" }),
1325
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u8FD0\u884C" }),
1326
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: "Python" }),
1327
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("small", { children: preflight.python.ok ? preflight.python.version : `${preflight.python.version ?? "\u672A\u627E\u5230"} \xB7 Skill \u811A\u672C\u9700\u8981 3.10+` })
1328
+ ] }),
1329
+ preflight.adapters.map((adapter) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("li", { "data-ready": adapter.configured || void 0, children: [
1330
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { "aria-hidden": "true" }),
1331
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: MODALITY_LABEL[adapter.modality] }),
1332
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: adapter.label }),
1333
+ adapter.configured ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("small", { children: "\u5DF2\u914D\u7F6E" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("small", { children: [
1334
+ "\u7F3A ",
1335
+ adapter.missing.map((name2) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { children: name2 }, name2))
1336
+ ] })
1337
+ ] }, adapter.name))
1338
+ ] }),
1339
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { children: [
1340
+ "DeepSeek \u53EA\u8D1F\u8D23\u5199\u63D0\u793A\u8BCD\uFF0C\u56FE\u7247\u3001\u89C6\u9891\u3001\u8BED\u97F3\u3001\u97F3\u4E50\u7531\u8FD9\u4E9B\u4F9B\u5E94\u5546 API \u751F\u6210\u3002Key \u5199\u5728\u542F\u52A8 DSH \u4E4B\u524D\u7684\u5BBF\u4E3B\u673A\u73AF\u5883\u53D8\u91CF\u91CC",
1341
+ configured === 0 ? "\uFF1B\u73B0\u5728\u4E00\u4E2A\u90FD\u6CA1\u914D\u7F6E\uFF0C\u751F\u4EA7\u4EFB\u52A1\u4F1A\u5728\u8C03\u7528\u4F9B\u5E94\u5546\u4E4B\u524D\u505C\u4E0B" : "",
1097
1342
  "\u3002\u8BE6\u89C1 README\u300C\u5A92\u4F53\u751F\u6210 API\u300D\u3002"
1343
+ ] }),
1344
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("footer", { children: [
1345
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
1346
+ "Adapter \u914D\u7F6E",
1347
+ preflight.adapterConfig.generated ? "\uFF08\u81EA\u52A8\u767B\u8BB0\uFF09" : "\uFF08\u81EA\u5B9A\u4E49\uFF09",
1348
+ preflight.adapterConfig.ok ? "" : " \xB7 \u5199\u5165\u5931\u8D25"
1349
+ ] }),
1350
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { title: preflight.adapterConfig.path, children: adapterFile }),
1351
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => {
1352
+ navigator.clipboard.writeText(preflight.adapterConfig.path).then(() => {
1353
+ setCopied(!0), setTimeout(() => {
1354
+ setCopied(!1);
1355
+ }, 1500);
1356
+ });
1357
+ }, children: copied ? "\u5DF2\u590D\u5236" : "\u590D\u5236\u8DEF\u5F84" })
1358
+ ] })
1359
+ ] }),
1360
+ open === "diagnostics" && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { className: "oh-story-status-panel oh-story-production-diagnostics", id: "oh-story-production-diagnostics", "aria-label": "\u6587\u6863\u683C\u5F0F\u63D0\u9192", children: [
1361
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { children: diagnostics.slice(0, 8).map((item) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("li", { "data-severity": item.severity, children: [
1362
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("button", { type: "button", onClick: () => {
1363
+ onNavigate({ path: item.path, offset: item.offset, id: item.targetId ?? item.code });
1364
+ }, children: [
1365
+ item.path.split("/").at(-1),
1366
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
1367
+ ":",
1368
+ item.line
1369
+ ] })
1370
+ ] }),
1371
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: item.message })
1372
+ ] }, `${item.path}:${String(item.offset)}:${item.code}`)) }),
1373
+ diagnostics.length > 8 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { children: [
1374
+ "\u53E6\u6709 ",
1375
+ diagnostics.length - 8,
1376
+ " \u9879\uFF0C\u8BF7\u6309\u6587\u6863\u4F4D\u7F6E\u4FEE\u590D\u3002"
1098
1377
  ] })
1099
1378
  ] })
1100
1379
  ] });
@@ -1104,15 +1383,15 @@ function handleSectionKey(event, current, onChange) {
1104
1383
  next !== void 0 && (event.preventDefault(), onChange(SECTION_ORDER[next]), event.currentTarget.parentElement?.querySelectorAll("[role='tab']")[next]?.focus());
1105
1384
  }
1106
1385
  function DramaProductionView(props) {
1107
- let [notice, setNotice] = (0, import_react.useState)(), protocolErrors = props.production.diagnostics.filter((item) => item.severity === "error").length, jobsRef = (0, import_react.useRef)(props.jobs), commitJobs = (0, import_react.useCallback)((next) => {
1386
+ let [notice, setNotice] = (0, import_react2.useState)(), jobsRef = (0, import_react2.useRef)(props.jobs), commitJobs = (0, import_react2.useCallback)((next) => {
1108
1387
  jobsRef.current = next, props.onJobsChange(next);
1109
1388
  }, [props.onJobsChange]);
1110
- (0, import_react.useEffect)(() => {
1389
+ (0, import_react2.useEffect)(() => {
1111
1390
  jobsRef.current = props.jobs;
1112
- }, [props.jobs]), (0, import_react.useEffect)(() => {
1391
+ }, [props.jobs]), (0, import_react2.useEffect)(() => {
1113
1392
  let next = reconcileSequence(props.production.shots.map((shot) => shot.id), props.sequence, props.versions, props.selections, props.production.episodeDirectory);
1114
1393
  JSON.stringify(next) !== JSON.stringify(props.sequence) && props.onSequenceChange(next);
1115
- }, [props.production.shots, props.selections, props.sequence, props.versions]), (0, import_react.useEffect)(() => {
1394
+ }, [props.production.shots, props.selections, props.sequence, props.versions]), (0, import_react2.useEffect)(() => {
1116
1395
  let next = reconcileProductionJobs(props.jobs, props.queue, props.sessionRunning, props.versions);
1117
1396
  JSON.stringify(next) !== JSON.stringify(props.jobs) && commitJobs(next);
1118
1397
  }, [commitJobs, props.jobs, props.queue, props.sessionRunning, props.versions]);
@@ -1185,15 +1464,15 @@ ${item.prompt}`).join(`
1185
1464
  supersededOutputIds: props.libraryVersions.flatMap((version) => version.path === outputPath ? [version.id] : [])
1186
1465
  }));
1187
1466
  };
1188
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-production", children: [
1189
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-production-bar", children: [
1190
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-production-tabs", role: "tablist", "aria-label": "\u77ED\u5267\u751F\u4EA7\u89C6\u56FE", children: SECTION_ORDER.map((item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", role: "tab", tabIndex: props.section === item ? 0 : -1, "aria-selected": props.section === item, onKeyDown: (event) => {
1467
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-production", children: [
1468
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-production-bar", children: [
1469
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-story-production-tabs", role: "tablist", "aria-label": "\u77ED\u5267\u751F\u4EA7\u89C6\u56FE", children: SECTION_ORDER.map((item) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", role: "tab", tabIndex: props.section === item ? 0 : -1, "aria-selected": props.section === item, onKeyDown: (event) => {
1191
1470
  handleSectionKey(event, item, props.onSectionChange);
1192
1471
  }, onClick: () => {
1193
1472
  props.onSectionChange(item);
1194
1473
  }, children: SECTION_LABELS[item] }, item)) }),
1195
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-production-meta", children: [
1196
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "oh-story-production-summary", children: [
1474
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-production-meta", children: [
1475
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "oh-story-production-summary", children: [
1197
1476
  props.production.shots.length,
1198
1477
  " \u955C \xB7 ",
1199
1478
  props.production.assets.length + props.production.visualAssets.length,
@@ -1201,167 +1480,151 @@ ${item.prompt}`).join(`
1201
1480
  props.jobs.filter((job) => job.status === "awaiting_confirmation" || job.status === "running" || job.status === "pending").length,
1202
1481
  " \u4EFB\u52A1"
1203
1482
  ] }),
1204
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: props.onRefresh, children: "\u5237\u65B0" })
1483
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: props.onRefresh, children: "\u5237\u65B0" })
1205
1484
  ] })
1206
1485
  ] }),
1207
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ProductionEnvironment, { sessionId: props.sessionId }),
1208
- notice !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-production-notice", role: "status", children: [
1209
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: notice }),
1210
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", "aria-label": "\u5173\u95ED\u63D0\u793A", onClick: () => {
1486
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ProductionStatus, { sessionId: props.sessionId, diagnostics: props.production.diagnostics, onNavigate: props.onNavigate }),
1487
+ notice !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-production-notice", role: "status", children: [
1488
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: notice }),
1489
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", "aria-label": "\u5173\u95ED\u63D0\u793A", onClick: () => {
1211
1490
  setNotice(void 0);
1212
1491
  }, children: "\xD7" })
1213
1492
  ] }),
1214
- props.production.diagnostics.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("details", { className: "oh-story-production-diagnostics", children: [
1215
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("summary", { children: protocolErrors > 0 ? `${String(protocolErrors)} \u4E2A\u534F\u8BAE\u9519\u8BEF` : `${String(props.production.diagnostics.length)} \u4E2A\u683C\u5F0F\u63D0\u9192` }),
1216
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("ul", { children: props.production.diagnostics.slice(0, 8).map((item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("li", { "data-severity": item.severity, children: [
1217
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("button", { type: "button", onClick: () => {
1218
- props.onNavigate({ path: item.path, offset: item.offset, id: item.targetId ?? item.code });
1219
- }, children: [
1220
- item.path.split("/").at(-1),
1221
- ":",
1222
- item.line
1223
- ] }),
1224
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: item.message })
1225
- ] }, `${item.path}:${String(item.offset)}:${item.code}`)) }),
1226
- props.production.diagnostics.length > 8 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { children: [
1227
- "\u53E6\u6709 ",
1228
- props.production.diagnostics.length - 8,
1229
- " \u9879\uFF0C\u8BF7\u6309\u6587\u6863\u4F4D\u7F6E\u4FEE\u590D\u3002"
1230
- ] })
1231
- ] }),
1232
- props.section === "shots" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ShotBoard, { ...props, onCreateJob: createJob, onBatch: createBatch }),
1233
- props.section === "assets" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(AssetBoard, { ...props, onCreateJob: createJob }),
1234
- props.section === "tasks" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TaskBoard, { jobs: props.jobs, queue: props.queue, sessionRunning: props.sessionRunning, onCancel: cancelJob, onRemoveQueued: removeQueuedJob }),
1235
- props.section === "sequence" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SequenceBoard, { ...props, episodeDirectory: props.production.episodeDirectory, onCompose: composeSequence }),
1236
- props.section === "canvas" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ProductionCanvas, { ...props })
1493
+ props.section === "shots" && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ShotBoard, { ...props, onCreateJob: createJob, onBatch: createBatch }),
1494
+ props.section === "assets" && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(AssetBoard, { ...props, onCreateJob: createJob }),
1495
+ props.section === "tasks" && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TaskBoard, { jobs: props.jobs, queue: props.queue, sessionRunning: props.sessionRunning, onCancel: cancelJob, onRemoveQueued: removeQueuedJob }),
1496
+ props.section === "sequence" && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SequenceBoard, { ...props, episodeDirectory: props.production.episodeDirectory, onCompose: composeSequence }),
1497
+ props.section === "canvas" && (props.production.shots.length + props.production.assets.length + props.production.visualAssets.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("section", { className: "oh-story-canvas-shell", "aria-label": "\u77ED\u5267\u7D20\u6750\u4E0E\u955C\u5934\u5173\u7CFB\u753B\u5E03", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(MissingDocument, { document: `${props.production.episodeDirectory}/\u5206\u955C.md`, documentPaths: props.production.documentPaths, what: "\u5173\u7CFB", skill: "/short-drama-storyboard", onNavigate: props.onNavigate }) }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ProductionCanvas, { production: props.production, selectedId: props.selectedId, canvas: props.canvas, viewport: props.viewport, onSelect: props.onSelect, onNavigate: props.onNavigate, onCanvasChange: props.onCanvasChange, onViewportChange: props.onViewportChange }))
1237
1498
  ] });
1238
1499
  }
1239
1500
  function ShotBoard(props) {
1240
1501
  let selectedRef = useScrollIntoView(props.selectedId);
1241
- return props.production.shots.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("section", { className: "oh-story-shot-board", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MissingDocument, { document: `${props.production.episodeDirectory}/\u5206\u955C.md`, documentPaths: props.production.documentPaths, what: "\u955C\u5934", skill: "/short-drama-storyboard", onNavigate: props.onNavigate }) }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("section", { className: "oh-story-shot-board", children: [
1242
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-production-actions", children: [
1243
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: () => {
1502
+ return props.production.shots.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("section", { className: "oh-story-shot-board", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(MissingDocument, { document: `${props.production.episodeDirectory}/\u5206\u955C.md`, documentPaths: props.production.documentPaths, what: "\u955C\u5934", skill: "/short-drama-storyboard", onNavigate: props.onNavigate }) }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { className: "oh-story-shot-board", children: [
1503
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-production-actions", children: [
1504
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => {
1244
1505
  props.onBatch("image");
1245
1506
  }, children: "\u51C6\u5907\u6279\u91CF\u5173\u952E\u5E27" }),
1246
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: () => {
1507
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => {
1247
1508
  props.onBatch("video");
1248
1509
  }, children: "\u51C6\u5907\u6279\u91CF\u89C6\u9891" })
1249
1510
  ] }),
1250
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-shot-grid", children: props.production.shots.map((shot) => {
1511
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-story-shot-grid", children: props.production.shots.map((shot) => {
1251
1512
  let completeness = productionCompleteness(shot), versions = props.versions.filter((version) => version.targetId === shot.id), selected = selectedVersionForTarget(shot.id, props.versions, props.selections, "image") ?? selectedVersionForTarget(shot.id, props.versions, props.selections, "video");
1252
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("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 : void 0, "data-selected": props.selectedId === shot.id || void 0, onKeyDown: (event) => {
1513
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("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 : void 0, "data-selected": props.selectedId === shot.id || void 0, onKeyDown: (event) => {
1253
1514
  (event.key === "Enter" || event.key === " ") && (event.preventDefault(), props.onSelect(shot.id));
1254
1515
  }, onClick: () => {
1255
1516
  props.onSelect(shot.id);
1256
1517
  }, children: [
1257
- selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-shot-placeholder", children: [
1258
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: shot.id.split("-").at(-1) }),
1259
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u7B49\u5F85\u5173\u952E\u5E27\u6210\u679C" })
1260
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MediaPreview, { version: selected }),
1261
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("header", { children: [
1262
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: (event) => {
1518
+ selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-shot-placeholder", children: [
1519
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: shot.id.split("-").at(-1) }),
1520
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u5F85\u751F\u6210\u5173\u952E\u5E27" })
1521
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(MediaPreview, { version: selected }),
1522
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { children: [
1523
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: (event) => {
1263
1524
  event.stopPropagation(), props.onNavigate({ path: shot.path, offset: shot.offset, id: shot.id });
1264
1525
  }, children: shot.id }),
1265
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: shot.durationSeconds === void 0 ? "\u2014" : `${String(shot.durationSeconds)}s` })
1526
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: shot.durationSeconds === void 0 ? "\u2014" : `${String(shot.durationSeconds)}s` })
1266
1527
  ] }),
1267
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h3", { children: shot.title }),
1268
- shot.shotSpec !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: shot.shotSpec }),
1269
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("dl", { children: [
1270
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("dt", { children: "\u8D77" }),
1271
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("dd", { children: shot.start ?? "\u672A\u586B\u5199" }),
1272
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("dt", { children: "\u7EC8" }),
1273
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("dd", { children: shot.end ?? "\u672A\u586B\u5199" })
1528
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h3", { children: shot.title }),
1529
+ shot.shotSpec !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: shot.shotSpec }),
1530
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("dl", { children: [
1531
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dt", { children: "\u8D77" }),
1532
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dd", { children: shot.start ?? "\u672A\u586B\u5199" }),
1533
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dt", { children: "\u7EC8" }),
1534
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dd", { children: shot.end ?? "\u672A\u586B\u5199" })
1274
1535
  ] }),
1275
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-shot-status", children: [
1276
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReadinessBadge, { label: "\u5173\u952E\u5E27", ready: completeness.keyframe }),
1277
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReadinessBadge, { label: "\u8FD0\u52A8", ready: completeness.motion }),
1278
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReadinessBadge, { label: "\u53C2\u8003", ready: completeness.references }),
1279
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { children: [
1536
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-shot-status", children: [
1537
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ReadinessBadge, { label: "\u5173\u952E\u5E27", ready: completeness.keyframe }),
1538
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ReadinessBadge, { label: "\u8FD0\u52A8", ready: completeness.motion }),
1539
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ReadinessBadge, { label: "\u53C2\u8003", ready: completeness.references }),
1540
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
1280
1541
  versions.length,
1281
1542
  " \u7248\u672C"
1282
1543
  ] })
1283
1544
  ] }),
1284
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-reference-links", children: [
1285
- shot.sceneIds.length > 0 ? shot.sceneIds.map((sceneId) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReferenceButton, { id: sceneId, production: props.production, onNavigate: props.onNavigate }, sceneId)) : shot.source !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReferenceButton, { id: shot.source, production: props.production, onNavigate: props.onNavigate }),
1286
- shot.references.map((id) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReferenceButton, { id, production: props.production, onNavigate: props.onNavigate }, id))
1545
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-reference-links", children: [
1546
+ shot.sceneIds.length > 0 ? shot.sceneIds.map((sceneId) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ReferenceButton, { id: sceneId, production: props.production, onNavigate: props.onNavigate }, sceneId)) : shot.source !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ReferenceButton, { id: shot.source, production: props.production, onNavigate: props.onNavigate }),
1547
+ shot.references.map((id) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ReferenceButton, { id, production: props.production, onNavigate: props.onNavigate }, id))
1287
1548
  ] }),
1288
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-card-actions", children: [
1289
- shot.keyframePrompt !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: (event) => {
1549
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-card-actions", children: [
1550
+ shot.keyframePrompt !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: (event) => {
1290
1551
  event.stopPropagation(), props.onCreateJob(shot.id, "image", shot.keyframePrompt ?? "");
1291
1552
  }, children: "\u51C6\u5907\u5173\u952E\u5E27" }),
1292
- shot.motion?.prompt !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: (event) => {
1553
+ shot.motion?.prompt !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: (event) => {
1293
1554
  event.stopPropagation(), props.onCreateJob(shot.id, "video", shot.motion?.prompt ?? "");
1294
1555
  }, children: "\u51C6\u5907\u89C6\u9891" })
1295
1556
  ] }),
1296
- versions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(VersionStrip, { targetId: shot.id, versions, selections: props.selections, onSelectionsChange: props.onSelectionsChange })
1557
+ versions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(VersionStrip, { targetId: shot.id, versions, selections: props.selections, onSelectionsChange: props.onSelectionsChange })
1297
1558
  ] }, shot.id);
1298
1559
  }) })
1299
1560
  ] });
1300
1561
  }
1301
1562
  function AssetBoard(props) {
1302
- let [query, setQuery] = (0, import_react.useState)(""), [kind, setKind] = (0, import_react.useState)("all"), assets = [...props.production.assets, ...props.production.visualAssets.filter((visual) => !props.production.assets.some((asset) => asset.title === visual.title))], needle = query.trim().toLocaleLowerCase(), library = props.libraryVersions.filter((version) => (kind === "all" || version.kind === kind) && (needle === "" || `${version.targetId} ${version.path ?? ""}`.toLocaleLowerCase().includes(needle))), selectedRef = useScrollIntoView(props.selectedId), referenceTarget = props.selectedId?.startsWith("SHOT-") === !0 ? props.selectedId : void 0, toggleReference = (versionId) => {
1563
+ let [query, setQuery] = (0, import_react2.useState)(""), [kind, setKind] = (0, import_react2.useState)("all"), assets = [...props.production.assets, ...props.production.visualAssets.filter((visual) => !props.production.assets.some((asset) => asset.title === visual.title))], needle = query.trim().toLocaleLowerCase(), library = props.libraryVersions.filter((version) => (kind === "all" || version.kind === kind) && (needle === "" || `${version.targetId} ${version.path ?? ""}`.toLocaleLowerCase().includes(needle))), selectedRef = useScrollIntoView(props.selectedId), referenceTarget = props.selectedId?.startsWith("SHOT-") === !0 ? props.selectedId : void 0, toggleReference = (versionId) => {
1303
1564
  if (referenceTarget === void 0) return;
1304
1565
  let current = props.manualReferences[referenceTarget] ?? [], next = current.includes(versionId) ? current.filter((id) => id !== versionId) : [...current, versionId], mutable = Object.fromEntries(Object.entries(props.manualReferences).map(([target, ids]) => [target, [...ids]]));
1305
1566
  props.onManualReferencesChange({ ...mutable, [referenceTarget]: next });
1306
1567
  };
1307
- return assets.length === 0 && props.libraryVersions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("section", { className: "oh-story-assets", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(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 }) }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("section", { className: "oh-story-assets", children: [
1308
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-asset-grid", children: assets.map((asset) => {
1568
+ return assets.length === 0 && props.libraryVersions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("section", { className: "oh-story-assets", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(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 }) }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { className: "oh-story-assets", children: [
1569
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-story-asset-grid", children: assets.map((asset) => {
1309
1570
  let prompt = "prompt" in asset ? asset.prompt : asset.description, versions = props.versions.filter((version) => version.targetId === asset.id), selected = selectedVersionForTarget(asset.id, props.versions, props.selections, "image");
1310
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("article", { className: "oh-story-asset-card", ref: props.selectedId === asset.id ? selectedRef : void 0, "data-selected": props.selectedId === asset.id || void 0, children: [
1311
- selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-asset-placeholder", children: asset.kind === "character" ? "\u4EBA" : asset.kind === "scene" ? "\u666F" : asset.kind === "prop" ? "\u7269" : "\u8BBE" }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MediaPreview, { version: selected }),
1312
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
1313
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("small", { children: ASSET_KIND_LABEL[asset.kind] }),
1314
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h3", { children: asset.title }),
1315
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: () => {
1571
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("article", { className: "oh-story-asset-card", ref: props.selectedId === asset.id ? selectedRef : void 0, "data-selected": props.selectedId === asset.id || void 0, children: [
1572
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-asset-media", "data-kind": asset.kind, children: [
1573
+ selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-story-asset-placeholder", "aria-hidden": "true", children: asset.kind === "character" ? "\u4EBA" : asset.kind === "scene" ? "\u666F" : asset.kind === "prop" ? "\u7269" : "\u8BBE" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(MediaPreview, { version: selected }),
1574
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("small", { children: ASSET_KIND_LABEL[asset.kind] })
1575
+ ] }),
1576
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-asset-head", children: [
1577
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h3", { children: asset.title }),
1578
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => {
1316
1579
  props.onNavigate({ path: asset.path, offset: asset.offset, id: asset.id });
1317
1580
  }, children: asset.id })
1318
1581
  ] }),
1319
- prompt !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "oh-story-asset-description", children: prompt }),
1320
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-card-actions", children: prompt !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: () => {
1582
+ prompt !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "oh-story-asset-description", children: prompt }),
1583
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-story-card-actions", children: prompt !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => {
1321
1584
  props.onCreateJob(asset.id, "image", prompt);
1322
1585
  }, children: "\u51C6\u5907\u7D20\u6750" }) }),
1323
- versions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(VersionStrip, { targetId: asset.id, versions, selections: props.selections, onSelectionsChange: props.onSelectionsChange })
1586
+ versions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(VersionStrip, { targetId: asset.id, versions, selections: props.selections, onSelectionsChange: props.onSelectionsChange })
1324
1587
  ] }, asset.id);
1325
1588
  }) }),
1326
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-media-library", children: [
1327
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("header", { children: [
1328
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
1329
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: "\u9879\u76EE\u5A92\u4F53\u5E93" }),
1330
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { children: [
1589
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-media-library", children: [
1590
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { children: [
1591
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
1592
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: "\u9879\u76EE\u5A92\u4F53\u5E93" }),
1593
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
1331
1594
  library.length,
1332
1595
  "/",
1333
1596
  props.libraryVersions.length,
1334
1597
  " \u9879 \xB7 \u53EF\u8DE8\u96C6\u590D\u7528"
1335
1598
  ] })
1336
1599
  ] }),
1337
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
1338
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("input", { "aria-label": "\u641C\u7D22\u9879\u76EE\u5A92\u4F53", value: query, placeholder: "\u641C\u7D22 ID \u6216\u8DEF\u5F84", onChange: (event) => {
1600
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
1601
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("input", { "aria-label": "\u641C\u7D22\u9879\u76EE\u5A92\u4F53", value: query, placeholder: "\u641C\u7D22 ID \u6216\u8DEF\u5F84", onChange: (event) => {
1339
1602
  setQuery(event.target.value);
1340
1603
  } }),
1341
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("select", { "aria-label": "\u7B5B\u9009\u5A92\u4F53\u7C7B\u578B", value: kind, onChange: (event) => {
1604
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { "aria-label": "\u7B5B\u9009\u5A92\u4F53\u7C7B\u578B", value: kind, onChange: (event) => {
1342
1605
  setKind(event.target.value);
1343
1606
  }, children: [
1344
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "all", children: "\u5168\u90E8" }),
1345
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "image", children: "\u56FE\u7247" }),
1346
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "video", children: "\u89C6\u9891" })
1607
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "all", children: "\u5168\u90E8" }),
1608
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "image", children: "\u56FE\u7247" }),
1609
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "video", children: "\u89C6\u9891" })
1347
1610
  ] })
1348
1611
  ] })
1349
1612
  ] }),
1350
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { className: "oh-story-projection-note", children: [
1613
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: "oh-story-projection-note", children: [
1351
1614
  referenceTarget === void 0 ? "\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\u8865\u5145\u53C2\u8003\u3002" : `\u53EF\u628A\u4E0B\u9762\u7684\u56FE\u7247\u8BBE\u4E3A ${referenceTarget} \u7684\u8865\u5145\u53C2\u8003\u3002`,
1352
1615
  "\u8865\u5145\u53C2\u8003\u53EA\u63D0\u793A Agent \u6838\u5BF9\uFF1B\u5199\u8FDB\u6765\u6E90\u6761\u76EE\u7684\u300C\u8F93\u5165\u53C2\u8003\u56FE\u300D\u540E\u624D\u4F1A\u9001\u8FDB\u751F\u4EA7\u3002"
1353
1616
  ] }),
1354
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-media-library-grid", children: library.map((version) => {
1617
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-story-media-library-grid", children: library.map((version) => {
1355
1618
  let selected = referenceTarget !== void 0 && (props.manualReferences[referenceTarget] ?? []).includes(version.id);
1356
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("article", { children: [
1357
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MediaPreview, { version }),
1358
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: version.targetId }),
1359
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { title: version.path, children: version.path }),
1360
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("footer", { children: [
1361
- version.path !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: () => {
1619
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("article", { children: [
1620
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(MediaPreview, { version }),
1621
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: version.targetId }),
1622
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { title: version.path, children: version.path }),
1623
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("footer", { children: [
1624
+ version.path !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => {
1362
1625
  props.onOpenMedia(version.path);
1363
1626
  }, children: "\u6253\u5F00\u6587\u4EF6" }),
1364
- referenceTarget !== void 0 && version.kind === "image" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", "aria-pressed": selected, "aria-label": `${selected ? "\u53D6\u6D88" : "\u8BBE\u4E3A"} ${referenceTarget} \u53C2\u8003 ${version.targetId}`, title: "\u63D0\u793A Agent \u6838\u5BF9\uFF1B\u5199\u8FDB\u300C\u8F93\u5165\u53C2\u8003\u56FE\u300D\u540E\u624D\u4F1A\u9001\u8FDB\u751F\u4EA7", onClick: () => {
1627
+ referenceTarget !== void 0 && version.kind === "image" && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", "aria-pressed": selected, "aria-label": `${selected ? "\u53D6\u6D88" : "\u8BBE\u4E3A"} ${referenceTarget} \u53C2\u8003 ${version.targetId}`, title: "\u63D0\u793A Agent \u6838\u5BF9\uFF1B\u5199\u8FDB\u300C\u8F93\u5165\u53C2\u8003\u56FE\u300D\u540E\u624D\u4F1A\u9001\u8FDB\u751F\u4EA7", onClick: () => {
1365
1628
  toggleReference(version.id);
1366
1629
  }, children: selected ? "\u5DF2\u8BBE\u8865\u5145\u53C2\u8003" : "\u8BBE\u4E3A\u8865\u5145\u53C2\u8003" })
1367
1630
  ] })
@@ -1372,34 +1635,37 @@ function AssetBoard(props) {
1372
1635
  }
1373
1636
  function TaskBoard({ jobs, queue, sessionRunning, onCancel, onRemoveQueued }) {
1374
1637
  let activeJobId = activeProductionJobId(jobs, queue, sessionRunning);
1375
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("section", { className: "oh-story-task-board", children: [
1376
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-projection-note", children: "\u56FE\u7247\u3001\u89C6\u9891\u3001\u8BED\u97F3\u3001\u97F3\u4E50\u90FD\u5148\u9884\u68C0\u3001\u540E\u786E\u8BA4\u3002\u8FD9\u91CC\u8DDF\u8E2A\u56FE\u7247\u3001\u89C6\u9891\u4E0E\u6210\u7247\u4EFB\u52A1\uFF1B\u8BED\u97F3\u548C\u97F3\u4E50\u5728 Chat \u91CC\u5B8C\u6210\uFF0C\u7ED3\u679C\u76F4\u63A5\u843D\u5728\u5236\u4F5C\u6210\u679C\u76EE\u5F55\u3002\u4F9B\u5E94\u5546\u89C1\u4E0A\u65B9\u300C\u751F\u6210\u73AF\u5883\u300D\uFF0C\u5B9E\u9645\u8D26\u53F7\u3001\u6A21\u578B\u4E0E\u53EF\u7528\u6027\u7531\u5F53\u524D DSH \u8FD0\u884C\u73AF\u5883\u51B3\u5B9A\u3002" }),
1377
- jobs.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-production-empty", children: "\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" }) : [...jobs].reverse().map((job) => {
1638
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { className: "oh-story-task-board", children: [
1639
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "oh-story-board-hint", children: "\u8FD9\u91CC\u8DDF\u8E2A\u56FE\u7247\u3001\u89C6\u9891\u4E0E\u6210\u7247\u4EFB\u52A1\uFF0C\u6BCF\u9879\u90FD\u5148\u9884\u68C0\u3001\u518D\u7531\u4F60\u5728 Chat \u786E\u8BA4\u3002\u8BED\u97F3\u548C\u97F3\u4E50\u5728 Chat \u91CC\u5B8C\u6210\uFF0C\u7ED3\u679C\u76F4\u63A5\u5199\u8FDB\u5236\u4F5C\u6210\u679C\u76EE\u5F55\u3002" }),
1640
+ jobs.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-production-empty", children: [
1641
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: "\u8FD8\u6CA1\u6709\u751F\u4EA7\u4EFB\u52A1" }),
1642
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: "\u5728\u300C\u955C\u5934\u300D\u6216\u300C\u7D20\u6750\u300D\u9875\u51C6\u5907\u5173\u952E\u5E27\u3001\u89C6\u9891\u6216\u7D20\u6750\uFF0C\u786E\u8BA4\u540E\u7684\u4EFB\u52A1\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002" })
1643
+ ] }) : [...jobs].reverse().map((job) => {
1378
1644
  let queued = queuedItemForJob(job.id, queue), displayStatus = queued === void 0 ? STATUS_LABELS[job.status] : "DSH Queue";
1379
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("article", { "data-job-id": job.id, "data-status": job.status, children: [
1380
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("header", { children: [
1381
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { title: job.targetId, children: job.targetId }),
1382
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: JOB_KIND_LABEL[job.kind] }),
1383
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: displayStatus })
1645
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("article", { "data-job-id": job.id, "data-status": job.status, children: [
1646
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { children: [
1647
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { title: job.targetId, children: job.targetId }),
1648
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: JOB_KIND_LABEL[job.kind] }),
1649
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: displayStatus })
1384
1650
  ] }),
1385
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-task-progress", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { style: { width: `${String(job.progress)}%` } }) }),
1386
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("details", { children: [
1387
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("summary", { children: "\u67E5\u770B\u6295\u4EA7\u63D0\u793A\u8BCD" }),
1388
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: job.prompt })
1651
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-story-task-progress", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { style: { width: `${String(job.progress)}%` } }) }),
1652
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("details", { children: [
1653
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("summary", { children: "\u67E5\u770B\u6295\u4EA7\u63D0\u793A\u8BCD" }),
1654
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: job.prompt })
1389
1655
  ] }),
1390
- job.expectedOutputs > 1 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("small", { children: [
1656
+ job.expectedOutputs > 1 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("small", { children: [
1391
1657
  job.completedOutputs,
1392
1658
  "/",
1393
1659
  job.expectedOutputs,
1394
1660
  " \u9879\u6210\u679C"
1395
1661
  ] }),
1396
- job.error !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-error", children: job.error }),
1397
- job.output !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MediaPreview, { version: job.output }),
1398
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("footer", { children: [
1399
- queued !== void 0 && (job.status === "awaiting_confirmation" || job.status === "pending" || job.status === "running") && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: () => {
1662
+ job.error !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-story-error", children: job.error }),
1663
+ job.output !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(MediaPreview, { version: job.output }),
1664
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("footer", { children: [
1665
+ queued !== void 0 && (job.status === "awaiting_confirmation" || job.status === "pending" || job.status === "running") && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => {
1400
1666
  onRemoveQueued(job, queued.id);
1401
1667
  }, children: "\u4ECE DSH Queue \u79FB\u9664" }),
1402
- activeJobId === job.id && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: () => {
1668
+ activeJobId === job.id && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => {
1403
1669
  onCancel(job);
1404
1670
  }, children: "\u505C\u6B62\u5F53\u524D DSH Turn" })
1405
1671
  ] })
@@ -1414,47 +1680,49 @@ function SequenceBoard(props) {
1414
1680
  }, chooseSource = (shotId, sourceVersionId) => {
1415
1681
  props.onSequenceChange(props.sequence.map((item) => item.shotId !== shotId ? item : sourceVersionId === "" ? { shotId: item.shotId, versionId: item.versionId } : { ...item, sourceVersionId, versionId: sourceVersionId }));
1416
1682
  };
1417
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("section", { className: "oh-story-sequence", children: [
1418
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-sequence-summary", children: [
1419
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("strong", { children: [
1683
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { className: "oh-story-sequence", children: [
1684
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-sequence-summary", children: [
1685
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("strong", { children: [
1420
1686
  props.sequence.length,
1421
1687
  " \u4E2A\u955C\u5934"
1422
1688
  ] }),
1423
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: props.sequence.length === 0 ? "\u8FD8\u6CA1\u6709\u955C\u5934" : composing ? "\u6210\u7247\u4EFB\u52A1\u8FDB\u884C\u4E2D" : issues.length === 0 ? "\u5DF2\u53EF\u5408\u6210" : `${String(issues.length)} \u4E2A\u963B\u585E\u9879` }),
1424
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", disabled: composing || issues.length > 0 || props.sequence.length < 2, onClick: props.onCompose, children: "\u5408\u6210\u6210\u7247" })
1689
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: props.sequence.length === 0 ? "\u8FD8\u6CA1\u6709\u955C\u5934" : composing ? "\u6210\u7247\u4EFB\u52A1\u8FDB\u884C\u4E2D" : issues.length === 0 ? "\u5DF2\u53EF\u5408\u6210" : `${String(issues.length)} \u4E2A\u963B\u585E\u9879` }),
1690
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", disabled: composing || issues.length > 0 || props.sequence.length < 2, onClick: props.onCompose, children: "\u5408\u6210\u6210\u7247" })
1425
1691
  ] }),
1426
- issues.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("ul", { className: "oh-story-sequence-issues", children: [
1427
- issues.slice(0, 3).map((issue) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("li", { children: issue }, issue)),
1428
- issues.length > 3 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("li", { children: [
1692
+ issues.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("ul", { className: "oh-story-sequence-issues", children: [
1693
+ issues.slice(0, 3).map((issue) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { children: issue }, issue)),
1694
+ issues.length > 3 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("li", { children: [
1429
1695
  "\u53E6\u6709 ",
1430
1696
  issues.length - 3,
1431
1697
  " \u4E2A\u963B\u585E\u9879\uFF0C\u8BF7\u5728\u4E0B\u65B9\u955C\u5934\u884C\u8865\u9F50\u7D20\u6750\u3002"
1432
1698
  ] })
1433
1699
  ] }),
1434
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("ol", { children: props.sequence.map((item, index) => {
1700
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ol", { children: props.sequence.map((item, index) => {
1435
1701
  let version = item.versionId === void 0 ? void 0 : versionById.get(item.versionId), choices = scopedVersions.filter((candidate) => candidate.path !== void 0 && sequenceSourceEligible(item.shotId, candidate)), explicitMissing = item.sourceVersionId !== void 0 && !choices.some((choice) => choice.id === item.sourceVersionId);
1436
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("li", { children: [
1437
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: String(index + 1).padStart(2, "0") }),
1438
- version === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-sequence-missing", children: "\u7F3A\u5C11\u7D20\u6750" }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MediaPreview, { version, interactive: !1 }),
1439
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: item.shotId }),
1440
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
1441
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("select", { "aria-label": `\u9009\u62E9 ${item.shotId} \u6210\u7247\u7D20\u6750`, value: item.sourceVersionId ?? "", onChange: (event) => {
1702
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("li", { children: [
1703
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: String(index + 1).padStart(2, "0") }),
1704
+ version === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-story-sequence-missing", children: "\u7F3A\u5C11\u7D20\u6750" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(MediaPreview, { version, interactive: !1 }),
1705
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-sequence-main", children: [
1706
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { title: item.shotId, children: item.shotId }),
1707
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { "aria-label": `\u9009\u62E9 ${item.shotId} \u6210\u7247\u7D20\u6750`, value: item.sourceVersionId ?? "", onChange: (event) => {
1442
1708
  chooseSource(item.shotId, event.target.value);
1443
1709
  }, children: [
1444
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "", children: "\u81EA\u52A8\uFF08\u89C6\u9891\u4F18\u5148\uFF09" }),
1445
- explicitMissing && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: item.sourceVersionId, disabled: !0, children: "\u5DF2\u9009\u7D20\u6750\u4E0D\u53EF\u7528" }),
1446
- choices.map((choice) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("option", { value: choice.id, children: [
1710
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "", children: "\u81EA\u52A8\uFF08\u89C6\u9891\u4F18\u5148\uFF09" }),
1711
+ explicitMissing && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: item.sourceVersionId, disabled: !0, children: "\u5DF2\u9009\u7D20\u6750\u4E0D\u53EF\u7528" }),
1712
+ choices.map((choice) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("option", { value: choice.id, children: [
1447
1713
  choice.targetId,
1448
1714
  " \xB7 ",
1449
1715
  choice.kind === "video" ? "\u89C6\u9891" : "\u9759\u5E27",
1450
1716
  " \xB7 ",
1451
1717
  choice.path?.split("/").at(-1)
1452
1718
  ] }, choice.id))
1453
- ] }),
1454
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", "aria-label": `\u4E0A\u79FB ${item.shotId}`, disabled: index === 0, onClick: () => {
1719
+ ] })
1720
+ ] }),
1721
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-sequence-move", children: [
1722
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", "aria-label": `\u4E0A\u79FB ${item.shotId}`, disabled: index === 0, onClick: () => {
1455
1723
  move(index, -1);
1456
1724
  }, children: "\u2191" }),
1457
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", "aria-label": `\u4E0B\u79FB ${item.shotId}`, disabled: index === props.sequence.length - 1, onClick: () => {
1725
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", "aria-label": `\u4E0B\u79FB ${item.shotId}`, disabled: index === props.sequence.length - 1, onClick: () => {
1458
1726
  move(index, 1);
1459
1727
  }, children: "\u2193" })
1460
1728
  ] })
@@ -1462,82 +1730,28 @@ function SequenceBoard(props) {
1462
1730
  }) })
1463
1731
  ] });
1464
1732
  }
1465
- function ProductionCanvas(props) {
1466
- let nodes = (0, import_react.useMemo)(() => {
1467
- let assets = [...props.production.assets, ...props.production.visualAssets].map((asset, index) => ({ id: asset.id, label: asset.title, type: "asset", initial: { x: 80, y: 80 + index * 150 } })), shots = props.production.shots.map((shot, index) => ({ id: shot.id, label: shot.title, type: "shot", initial: { x: 640, y: 80 + index * 180 } }));
1468
- return [...assets, ...shots];
1469
- }, [props.production.assets, props.production.shots, props.production.visualAssets]), positions = Object.fromEntries(nodes.map((node) => [node.id, props.canvas[node.id] ?? node.initial])), startDrag = (event, id) => {
1470
- event.currentTarget.setPointerCapture(event.pointerId);
1471
- let origin = positions[id] ?? { x: 0, y: 0 }, start = { x: event.clientX, y: event.clientY }, move = (moveEvent) => {
1472
- props.onCanvasChange({ ...props.canvas, [id]: { x: origin.x + (moveEvent.clientX - start.x) / props.zoom, y: origin.y + (moveEvent.clientY - start.y) / props.zoom } });
1473
- }, end = () => {
1474
- globalThis.removeEventListener("pointermove", move), globalThis.removeEventListener("pointerup", end);
1475
- };
1476
- globalThis.addEventListener("pointermove", move), globalThis.addEventListener("pointerup", end);
1477
- }, moveNode = (id, x, y) => {
1478
- let origin = positions[id] ?? { x: 0, y: 0 };
1479
- props.onCanvasChange({ ...props.canvas, [id]: { x: origin.x + x, y: origin.y + y } });
1480
- }, connections = props.production.shots.flatMap((shot) => shot.references.map((reference) => [reference, shot.id]));
1481
- return nodes.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("section", { className: "oh-story-canvas-shell", "aria-label": "\u77ED\u5267\u7D20\u6750\u4E0E\u955C\u5934\u5173\u7CFB\u753B\u5E03", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MissingDocument, { document: `${props.production.episodeDirectory}/\u5206\u955C.md`, documentPaths: props.production.documentPaths, what: "\u5173\u7CFB", skill: "/short-drama-storyboard", onNavigate: props.onNavigate }) }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("section", { className: "oh-story-canvas-shell", "aria-label": "\u77ED\u5267\u7D20\u6750\u4E0E\u955C\u5934\u5173\u7CFB\u753B\u5E03", children: [
1482
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-projection-note", children: "\u6587\u6863\u5173\u7CFB \xB7 \u5E03\u5C40\u4EC5\u4FDD\u5B58\u5728\u5F53\u524D DSH Session" }),
1483
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-canvas-controls", children: [
1484
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", "aria-label": "\u7F29\u5C0F\u753B\u5E03", onClick: () => {
1485
- props.onZoomChange(Math.max(0.5, props.zoom - 0.1));
1486
- }, children: "\u2212" }),
1487
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { children: [
1488
- Math.round(props.zoom * 100),
1489
- "%"
1490
- ] }),
1491
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", "aria-label": "\u653E\u5927\u753B\u5E03", onClick: () => {
1492
- props.onZoomChange(Math.min(1.8, props.zoom + 0.1));
1493
- }, children: "\uFF0B" }),
1494
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: () => {
1495
- props.onCanvasChange({}), props.onZoomChange(0.65);
1496
- }, children: "\u590D\u4F4D" })
1497
- ] }),
1498
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-canvas-viewport", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-canvas", style: { transform: `scale(${String(props.zoom)})` }, children: [
1499
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { "aria-hidden": "true", children: connections.map(([from, to]) => {
1500
- let a = positions[from], b = positions[to];
1501
- return a === void 0 || b === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { "data-active": to === props.selectedId || void 0, 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)}` }, `${from}:${to}`);
1502
- }) }),
1503
- nodes.map((node) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("article", { tabIndex: 0, "aria-label": `${node.type === "asset" ? "\u7D20\u6750" : "\u955C\u5934"} ${node.label}`, "data-node-type": node.type, "data-selected": node.id === props.selectedId || void 0, style: { left: positions[node.id]?.x, top: positions[node.id]?.y }, onKeyDown: (event) => {
1504
- let step = event.shiftKey ? 40 : 10, delta = event.key === "ArrowLeft" ? [-step, 0] : event.key === "ArrowRight" ? [step, 0] : event.key === "ArrowUp" ? [0, -step] : event.key === "ArrowDown" ? [0, step] : void 0;
1505
- delta !== void 0 && (event.preventDefault(), moveNode(node.id, delta[0], delta[1]));
1506
- }, onPointerDown: (event) => {
1507
- startDrag(event, node.id);
1508
- }, onDoubleClick: () => {
1509
- let target = props.production.targets.get(node.id);
1510
- target !== void 0 && props.onNavigate(target);
1511
- }, children: [
1512
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("small", { children: node.type === "asset" ? "\u7D20\u6750" : "\u955C\u5934" }),
1513
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: node.label }),
1514
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: node.id })
1515
- ] }, node.id))
1516
- ] }) })
1517
- ] });
1518
- }
1519
1733
  function useScrollIntoView(selectedId) {
1520
- let ref = (0, import_react.useRef)(null);
1521
- return (0, import_react.useEffect)(() => {
1734
+ let ref = (0, import_react2.useRef)(null);
1735
+ return (0, import_react2.useEffect)(() => {
1522
1736
  ref.current?.scrollIntoView({ block: "nearest" });
1523
1737
  }, [selectedId]), ref;
1524
1738
  }
1525
1739
  function ReadinessBadge({ label, ready }) {
1526
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { "data-ready": ready, "aria-label": `${label}${ready ? "\u5DF2\u5907" : "\u5F85\u8865"}`, children: [
1527
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { "aria-hidden": "true", children: ready ? "\u2713" : "\u2014" }),
1740
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { "data-ready": ready, "aria-label": `${label}${ready ? "\u5DF2\u5907" : "\u5F85\u8865"}`, children: [
1741
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { "aria-hidden": "true", children: ready ? "\u2713" : "\u2014" }),
1528
1742
  label
1529
1743
  ] });
1530
1744
  }
1531
1745
  function MissingDocument({ document, documentPaths, what, skill, onNavigate }) {
1532
1746
  let present = documentPaths.includes(document);
1533
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-production-empty", children: [
1534
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("strong", { children: [
1747
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-production-empty", children: [
1748
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("strong", { children: [
1535
1749
  "\u8FD8\u6CA1\u6709\u53EF\u6295\u5F71\u7684",
1536
1750
  what,
1537
1751
  "\u3002"
1538
1752
  ] }),
1539
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: present ? `${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` : `\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` }),
1540
- present && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("button", { type: "button", onClick: () => {
1753
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: present ? `${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` : `\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` }),
1754
+ present && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("button", { type: "button", onClick: () => {
1541
1755
  onNavigate({ path: document, offset: 0, id: document });
1542
1756
  }, children: [
1543
1757
  "\u6253\u5F00 ",
@@ -1547,20 +1761,20 @@ function MissingDocument({ document, documentPaths, what, skill, onNavigate }) {
1547
1761
  }
1548
1762
  function ReferenceButton({ id, production, onNavigate }) {
1549
1763
  let target = production.targets.get(id);
1550
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", disabled: target === void 0, onClick: (event) => {
1764
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", disabled: target === void 0, onClick: (event) => {
1551
1765
  event.stopPropagation(), target !== void 0 && onNavigate(target);
1552
1766
  }, children: id });
1553
1767
  }
1554
1768
  function MediaPreview({ version, interactive = !0 }) {
1555
- return version.kind === "image" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("img", { className: "oh-story-media-preview", src: version.url, alt: version.targetId, loading: "lazy" }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("video", { className: "oh-story-media-preview", src: version.url, controls: interactive, muted: !interactive, preload: "metadata" });
1769
+ return version.kind === "image" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("img", { className: "oh-story-media-preview", src: version.url, alt: version.targetId, loading: "lazy" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("video", { className: "oh-story-media-preview", src: version.url, controls: interactive, muted: !interactive, preload: "metadata" });
1556
1770
  }
1557
1771
  function VersionStrip({ targetId, versions, selections, onSelectionsChange }) {
1558
1772
  let selected = selectedVersionForTarget(targetId, versions, selections)?.id;
1559
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-version-strip", "aria-label": `${targetId} \u6210\u679C\u7248\u672C`, children: versions.map((version, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("button", { type: "button", "aria-pressed": version.id === selected, "aria-label": `\u9009\u62E9 ${targetId} \u7248\u672C ${String(index + 1)}`, "data-selected": version.id === selected || void 0, onClick: (event) => {
1773
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-story-version-strip", "aria-label": `${targetId} \u6210\u679C\u7248\u672C`, children: versions.map((version, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("button", { type: "button", "aria-pressed": version.id === selected, "aria-label": `\u9009\u62E9 ${targetId} \u7248\u672C ${String(index + 1)}`, "data-selected": version.id === selected || void 0, onClick: (event) => {
1560
1774
  event.stopPropagation(), onSelectionsChange({ ...selections, [targetId]: version.id });
1561
1775
  }, children: [
1562
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MediaPreview, { version, interactive: !1 }),
1563
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { children: [
1776
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(MediaPreview, { version, interactive: !1 }),
1777
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
1564
1778
  "V",
1565
1779
  String(index + 1)
1566
1780
  ] })
@@ -1635,8 +1849,8 @@ function settledProductionIntents(chat) {
1635
1849
  }
1636
1850
 
1637
1851
  // src/client/video-studio.tsx
1638
- var import_react2 = require("react");
1639
- var import_jsx_runtime4 = require("react/jsx-runtime");
1852
+ var import_react3 = require("react");
1853
+ var import_jsx_runtime5 = require("react/jsx-runtime");
1640
1854
  function preferredPreview(project) {
1641
1855
  return project.previews.find((item) => item.role === "final") ?? project.previews.find((item) => item.role === "edited") ?? project.previews.find((item) => item.role === "source");
1642
1856
  }
@@ -1644,15 +1858,15 @@ function readableBytes(bytes) {
1644
1858
  return bytes < 1024 * 1024 ? `${(bytes / 1024).toFixed(1)} KB` : bytes < 1024 * 1024 * 1024 ? `${(bytes / (1024 * 1024)).toFixed(1)} MB` : `${(bytes / (1024 * 1024 * 1024)).toFixed(2)} GB`;
1645
1859
  }
1646
1860
  function ActionIcon({ name: name2 }) {
1647
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { "aria-hidden": !0, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", children: {
1648
- reload: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
1649
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M20 11a8 8 0 1 0-2.34 5.66" }),
1650
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M20 4v7h-7" })
1861
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { "aria-hidden": !0, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", children: {
1862
+ reload: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
1863
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M20 11a8 8 0 1 0-2.34 5.66" }),
1864
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M20 4v7h-7" })
1651
1865
  ] }),
1652
- fullscreen: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M8 3H3v5M16 3h5v5M8 21H3v-5M16 21h5v-5" }) }),
1653
- external: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
1654
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M14 3h7v7M21 3l-9 9" }),
1655
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" })
1866
+ fullscreen: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M8 3H3v5M16 3h5v5M8 21H3v-5M16 21h5v-5" }) }),
1867
+ external: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
1868
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M14 3h7v7M21 3l-9 9" }),
1869
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" })
1656
1870
  ] })
1657
1871
  }[name2] });
1658
1872
  }
@@ -1663,28 +1877,28 @@ function artifactKindLabel(kind) {
1663
1877
  return { plan: "\u65B9\u6848", script: "\u6587\u7A3F", subtitle: "\u5B57\u5E55", quality: "\u8D28\u68C0", manifest: "\u6E05\u5355" }[kind];
1664
1878
  }
1665
1879
  function VideoPreview({ project, sessionId, running }) {
1666
- let shellRef = (0, import_react2.useRef)(null), initial = preferredPreview(project), [role, setRole] = (0, import_react2.useState)(initial?.role), selected = project.previews.find((item) => item.role === role) ?? preferredPreview(project), [loaded, setLoaded] = (0, import_react2.useState)(initial), [revision, setRevision] = (0, import_react2.useState)(0), [ready, setReady] = (0, import_react2.useState)(!1), [error, setError] = (0, import_react2.useState)(!1);
1667
- if (selected === void 0 || loaded === void 0) return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-video-preview-empty", children: [
1668
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { "aria-hidden": !0, children: "\u25B6" }),
1669
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: "\u8FD8\u6CA1\u6709\u53EF\u9884\u89C8\u7684\u89C6\u9891" }),
1670
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { children: [
1880
+ let shellRef = (0, import_react3.useRef)(null), initial = preferredPreview(project), [role, setRole] = (0, import_react3.useState)(initial?.role), selected = project.previews.find((item) => item.role === role) ?? preferredPreview(project), [loaded, setLoaded] = (0, import_react3.useState)(initial), [revision, setRevision] = (0, import_react3.useState)(0), [ready, setReady] = (0, import_react3.useState)(!1), [error, setError] = (0, import_react3.useState)(!1);
1881
+ if (selected === void 0 || loaded === void 0) return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-video-preview-empty", children: [
1882
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "aria-hidden": !0, children: "\u25B6" }),
1883
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "\u8FD8\u6CA1\u6709\u53EF\u9884\u89C8\u7684\u89C6\u9891" }),
1884
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { children: [
1671
1885
  "\u628A\u539F\u7247\u5BFC\u5165 ",
1672
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { children: "video-recaps/<\u9879\u76EE>/sources/" }),
1886
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "video-recaps/<\u9879\u76EE>/sources/" }),
1673
1887
  "\uFF0C\u7136\u540E\u5728\u53F3\u4FA7 Chat \u4F7F\u7528 ",
1674
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { children: "/video-recap" }),
1888
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "/video-recap" }),
1675
1889
  "\u3002\u526A\u540E\u7247\u548C\u6700\u7EC8\u6210\u7247\u4F1A\u81EA\u52A8\u51FA\u73B0\u5728\u8FD9\u91CC\u3002"
1676
1890
  ] }),
1677
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-video-prompt-example", children: [
1678
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u63CF\u8FF0\u793A\u4F8B" }),
1679
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("q", { children: "\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" })
1891
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-video-prompt-example", children: [
1892
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u63CF\u8FF0\u793A\u4F8B" }),
1893
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("q", { children: "\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" })
1680
1894
  ] })
1681
1895
  ] });
1682
1896
  let pending = selected.path !== loaded.path || selected.version !== loaded.version, load = (asset) => {
1683
1897
  setRole(asset.role), setLoaded(asset), setReady(!1), setError(!1), setRevision((value) => value + 1);
1684
1898
  }, runtimeState = error ? "\u89C6\u9891\u8F7D\u5165\u5931\u8D25 \xB7 \u53EF\u91CD\u65B0\u8F7D\u5165" : running ? "Agent \u6B63\u5728\u66F4\u65B0\u9879\u76EE \xB7 \u5F53\u524D\u64AD\u653E\u4FDD\u6301\u4E0D\u53D8" : pending ? "\u65B0\u7248\u672C\u5DF2\u5C31\u7EEA \xB7 \u7531\u4F60\u51B3\u5B9A\u4F55\u65F6\u8F7D\u5165" : ready ? `${loaded.label}\u5DF2\u8F7D\u5165 \xB7 ${readableBytes(loaded.bytes)}` : "\u6B63\u5728\u8BFB\u53D6\u89C6\u9891\u4FE1\u606F\u2026", mediaUrl = `${endpoint("media", sessionId, loaded.path)}&version=${encodeURIComponent(loaded.version)}&reload=${String(revision)}`;
1685
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { ref: shellRef, className: "oh-video-preview-shell", "data-state": error ? "error" : running ? "building" : ready ? "ready" : "loading", children: [
1686
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-video-stagebar", children: [
1687
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-video-version-tabs", role: "tablist", "aria-label": "\u9884\u89C8\u7248\u672C", children: project.previews.map((asset) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1899
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { ref: shellRef, className: "oh-video-preview-shell", "data-state": error ? "error" : running ? "building" : ready ? "ready" : "loading", children: [
1900
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-video-stagebar", children: [
1901
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-video-version-tabs", role: "tablist", "aria-label": "\u9884\u89C8\u7248\u672C", children: project.previews.map((asset) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1688
1902
  "button",
1689
1903
  {
1690
1904
  type: "button",
@@ -1704,24 +1918,24 @@ function VideoPreview({ project, sessionId, running }) {
1704
1918
  },
1705
1919
  asset.role
1706
1920
  )) }),
1707
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "oh-video-runtime-state", role: "status", "aria-live": "polite", children: [
1708
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { "aria-hidden": !0 }),
1709
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("em", { children: runtimeState })
1921
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "oh-video-runtime-state", role: "status", "aria-live": "polite", children: [
1922
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("i", { "aria-hidden": !0 }),
1923
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("em", { children: runtimeState })
1710
1924
  ] }),
1711
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-video-preview-actions", children: [
1712
- pending && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => {
1925
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-video-preview-actions", children: [
1926
+ pending && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", onClick: () => {
1713
1927
  load(selected);
1714
1928
  }, children: "\u8F7D\u5165\u65B0\u7248\u672C" }),
1715
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", title: "\u91CD\u65B0\u8F7D\u5165", "aria-label": "\u91CD\u65B0\u8F7D\u5165\u89C6\u9891", onClick: () => {
1929
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", title: "\u91CD\u65B0\u8F7D\u5165", "aria-label": "\u91CD\u65B0\u8F7D\u5165\u89C6\u9891", onClick: () => {
1716
1930
  load(loaded);
1717
- }, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ActionIcon, { name: "reload" }) }),
1718
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", title: "\u5168\u5C4F", "aria-label": "\u5168\u5C4F\u9884\u89C8", onClick: () => {
1931
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ActionIcon, { name: "reload" }) }),
1932
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", title: "\u5168\u5C4F", "aria-label": "\u5168\u5C4F\u9884\u89C8", onClick: () => {
1719
1933
  shellRef.current?.requestFullscreen();
1720
- }, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ActionIcon, { name: "fullscreen" }) }),
1721
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("a", { href: mediaUrl, target: "_blank", rel: "noreferrer", title: "\u5728\u65B0\u7A97\u53E3\u6253\u5F00", "aria-label": "\u5728\u65B0\u7A97\u53E3\u6253\u5F00\u89C6\u9891", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ActionIcon, { name: "external" }) })
1934
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ActionIcon, { name: "fullscreen" }) }),
1935
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("a", { href: mediaUrl, target: "_blank", rel: "noreferrer", title: "\u5728\u65B0\u7A97\u53E3\u6253\u5F00", "aria-label": "\u5728\u65B0\u7A97\u53E3\u6253\u5F00\u89C6\u9891", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ActionIcon, { name: "external" }) })
1722
1936
  ] })
1723
1937
  ] }),
1724
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-video-player-stage", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1938
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-video-player-stage", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1725
1939
  "video",
1726
1940
  {
1727
1941
  src: mediaUrl,
@@ -1740,10 +1954,10 @@ function VideoPreview({ project, sessionId, running }) {
1740
1954
  ] });
1741
1955
  }
1742
1956
  function VideoArtifacts({ project, sessionId }) {
1743
- let [selected, setSelected] = (0, import_react2.useState)(preferredArtifact(project)?.path), [content, setContent] = (0, import_react2.useState)(), [error, setError] = (0, import_react2.useState)(), [preflight, setPreflight] = (0, import_react2.useState)();
1744
- (0, import_react2.useEffect)(() => {
1957
+ let [selected, setSelected] = (0, import_react3.useState)(preferredArtifact(project)?.path), [content, setContent] = (0, import_react3.useState)(), [error, setError] = (0, import_react3.useState)(), [preflight, setPreflight] = (0, import_react3.useState)();
1958
+ (0, import_react3.useEffect)(() => {
1745
1959
  setSelected(preferredArtifact(project)?.path);
1746
- }, [project.id]), (0, import_react2.useEffect)(() => {
1960
+ }, [project.id]), (0, import_react3.useEffect)(() => {
1747
1961
  if (selected === void 0) {
1748
1962
  setContent(void 0);
1749
1963
  return;
@@ -1760,45 +1974,45 @@ function VideoArtifacts({ project, sessionId }) {
1760
1974
  };
1761
1975
  }, [selected, sessionId]);
1762
1976
  let selectedArtifact = project.artifacts.find((item) => item.path === selected);
1763
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-video-artifacts", children: [
1764
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("aside", { "aria-label": "\u89C6\u9891\u9879\u76EE\u4EA7\u7269", children: [
1765
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-video-artifacts-heading", children: [
1766
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: "\u9879\u76EE\u4EA7\u7269" }),
1767
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: project.artifacts.length })
1977
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-video-artifacts", children: [
1978
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("aside", { "aria-label": "\u89C6\u9891\u9879\u76EE\u4EA7\u7269", children: [
1979
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-video-artifacts-heading", children: [
1980
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "\u9879\u76EE\u4EA7\u7269" }),
1981
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: project.artifacts.length })
1768
1982
  ] }),
1769
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-video-environment", children: [
1770
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: "\u8FD0\u884C\u73AF\u5883" }),
1771
- typeof preflight == "object" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
1772
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { "data-ready": preflight.python.ok || void 0, children: [
1983
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-video-environment", children: [
1984
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "\u8FD0\u884C\u73AF\u5883" }),
1985
+ typeof preflight == "object" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
1986
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { "data-ready": preflight.python.ok || void 0, children: [
1773
1987
  "Python ",
1774
1988
  preflight.python.version ?? "\u672A\u627E\u5230"
1775
1989
  ] }),
1776
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { "data-ready": preflight.ffmpeg.ok && preflight.ffmpeg.subtitles || void 0, children: [
1990
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { "data-ready": preflight.ffmpeg.ok && preflight.ffmpeg.subtitles || void 0, children: [
1777
1991
  "ffmpeg ",
1778
1992
  preflight.ffmpeg.subtitles ? "\xB7 libass" : "\xB7 \u7F3A\u5B57\u5E55\u6EE4\u955C"
1779
1993
  ] }),
1780
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { "data-ready": preflight.ffprobe.ok || void 0, children: [
1994
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { "data-ready": preflight.ffprobe.ok || void 0, children: [
1781
1995
  "ffprobe ",
1782
1996
  preflight.ffprobe.ok ? "\u53EF\u7528" : "\u672A\u627E\u5230"
1783
1997
  ] }),
1784
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { "data-ready": preflight.credentials.mimo || void 0, children: [
1998
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { "data-ready": preflight.credentials.mimo || void 0, children: [
1785
1999
  "MiMo Key ",
1786
2000
  preflight.credentials.mimo ? "\u5DF2\u914D\u7F6E" : "\u672A\u914D\u7F6E"
1787
2001
  ] }),
1788
- (preflight.credentials.ttsProvider === "fish-audio" || preflight.credentials.ttsProvider === "auto" && !preflight.credentials.mimo) && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { "data-ready": preflight.credentials.fish || void 0, children: [
2002
+ (preflight.credentials.ttsProvider === "fish-audio" || preflight.credentials.ttsProvider === "auto" && !preflight.credentials.mimo) && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { "data-ready": preflight.credentials.fish || void 0, children: [
1789
2003
  "Fish Key ",
1790
2004
  preflight.credentials.fish ? "\u5DF2\u914D\u7F6E" : "\u672A\u914D\u7F6E"
1791
2005
  ] }),
1792
- preflight.credentials.ttsProvider === "index-tts" && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { "data-ready": preflight.credentials.indexTts || void 0, children: [
2006
+ preflight.credentials.ttsProvider === "index-tts" && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { "data-ready": preflight.credentials.indexTts || void 0, children: [
1793
2007
  "IndexTTS ",
1794
2008
  preflight.credentials.indexTts ? "\u5DF2\u914D\u7F6E" : "\u7F3A INDEX_TTS_ENDPOINT / INDEX_TTS_VOICE"
1795
2009
  ] }),
1796
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("em", { children: [
2010
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("em", { children: [
1797
2011
  "DSH Host \u8FDB\u7A0B\u73AF\u5883\uFF1BAgent \u6267\u884C\u4E16\u754C\u4EE5 ",
1798
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { children: "video-recap --doctor" }),
2012
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "video-recap --doctor" }),
1799
2013
  " \u4E3A\u51C6\u3002"
1800
2014
  ] })
1801
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => {
2015
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", onClick: () => {
1802
2016
  fetch(endpoint("video-preflight", sessionId)).then(async (response) => {
1803
2017
  if (!response.ok) throw new Error(`HTTP ${String(response.status)}`);
1804
2018
  setPreflight(await response.json());
@@ -1807,9 +2021,9 @@ function VideoArtifacts({ project, sessionId }) {
1807
2021
  });
1808
2022
  }, children: preflight === "failed" ? "\u73AF\u5883\u68C0\u67E5\u5931\u8D25 \xB7 \u91CD\u8BD5" : "\u68C0\u67E5\u73AF\u5883" })
1809
2023
  ] }),
1810
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("nav", { children: [
1811
- project.artifacts.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: "\u6D41\u6C34\u7EBF\u542F\u52A8\u540E\uFF0C\u5173\u952E\u4EA7\u7269\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002" }),
1812
- project.artifacts.map((artifact) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
2024
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("nav", { children: [
2025
+ project.artifacts.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: "\u6D41\u6C34\u7EBF\u542F\u52A8\u540E\uFF0C\u5173\u952E\u4EA7\u7269\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002" }),
2026
+ project.artifacts.map((artifact) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1813
2027
  "button",
1814
2028
  {
1815
2029
  type: "button",
@@ -1818,23 +2032,23 @@ function VideoArtifacts({ project, sessionId }) {
1818
2032
  setSelected(artifact.path);
1819
2033
  },
1820
2034
  children: [
1821
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: artifact.label }),
1822
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("small", { children: artifact.path.split("/").at(-1) })
2035
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: artifact.label }),
2036
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("small", { children: artifact.path.split("/").at(-1) })
1823
2037
  ]
1824
2038
  },
1825
2039
  artifact.path
1826
2040
  ))
1827
2041
  ] })
1828
2042
  ] }),
1829
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { children: [
1830
- selectedArtifact !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { className: "oh-video-artifact-header", children: [
1831
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
1832
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: selectedArtifact.label }),
1833
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: selectedArtifact.path.split("/").at(-1) })
2043
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("section", { children: [
2044
+ selectedArtifact !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("header", { className: "oh-video-artifact-header", children: [
2045
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
2046
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: selectedArtifact.label }),
2047
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: selectedArtifact.path.split("/").at(-1) })
1834
2048
  ] }),
1835
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("em", { children: artifactKindLabel(selectedArtifact.kind) })
2049
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("em", { children: artifactKindLabel(selectedArtifact.kind) })
1836
2050
  ] }),
1837
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-video-artifact-content", children: project.artifacts.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-video-artifacts-empty", children: "\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" }) : error !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-story-error", children: error }) : content === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-video-artifacts-empty", children: "\u6B63\u5728\u8F7D\u5165\u4EA7\u7269\u2026" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("pre", { children: content }) })
2051
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-video-artifact-content", children: project.artifacts.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-video-artifacts-empty", children: "\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" }) : error !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-story-error", children: error }) : content === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-video-artifacts-empty", children: "\u6B63\u5728\u8F7D\u5165\u4EA7\u7269\u2026" }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("pre", { children: content }) })
1838
2052
  ] })
1839
2053
  ] });
1840
2054
  }
@@ -1853,15 +2067,15 @@ function VideoStudio({
1853
2067
  onWorkbench,
1854
2068
  onCollapse
1855
2069
  }) {
1856
- let project = projects.find((item) => item.id === projectId) ?? projects[0], tabsId = (0, import_react2.useId)();
1857
- (0, import_react2.useEffect)(() => {
2070
+ let project = projects.find((item) => item.id === projectId) ?? projects[0], tabsId = (0, import_react3.useId)();
2071
+ (0, import_react3.useEffect)(() => {
1858
2072
  project !== void 0 && project.id !== projectId && onProject(project.id);
1859
2073
  }, [onProject, project, projectId]);
1860
2074
  let tabs = ["preview", "artifacts"];
1861
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("main", { id: paneId, className: "oh-video-studio", role: "tabpanel", "aria-labelledby": labelledBy, hidden, children: [
1862
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { className: "oh-video-toolbar", children: [
1863
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-workbench-cluster", children: [
1864
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-video-mode-tabs", role: "tablist", "aria-label": "\u521B\u4F5C\u5DE5\u4F5C\u53F0", children: workbenches.map((mode) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2075
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("main", { id: paneId, className: "oh-video-studio", role: "tabpanel", "aria-labelledby": labelledBy, hidden, children: [
2076
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("header", { className: "oh-video-toolbar", children: [
2077
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-workbench-cluster", children: [
2078
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-video-mode-tabs", role: "tablist", "aria-label": "\u521B\u4F5C\u5DE5\u4F5C\u53F0", children: workbenches.map((mode) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1865
2079
  "button",
1866
2080
  {
1867
2081
  type: "button",
@@ -1878,19 +2092,19 @@ function VideoStudio({
1878
2092
  },
1879
2093
  mode
1880
2094
  )) }),
1881
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("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, children: "\xD7" })
2095
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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, children: "\xD7" })
1882
2096
  ] }),
1883
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "oh-video-project", children: [
1884
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u89C6\u9891\u9879\u76EE" }),
1885
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("select", { "aria-label": "\u89C6\u9891\u9879\u76EE", value: project?.id ?? "", disabled: project === void 0, onChange: (event) => {
2097
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { className: "oh-video-project", children: [
2098
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u89C6\u9891\u9879\u76EE" }),
2099
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("select", { "aria-label": "\u89C6\u9891\u9879\u76EE", value: project?.id ?? "", disabled: project === void 0, onChange: (event) => {
1886
2100
  onProject(event.target.value);
1887
- }, children: projects.map((item) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: item.id, children: item.title }, item.id)) })
2101
+ }, children: projects.map((item) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: item.id, children: item.title }, item.id)) })
1888
2102
  ] }),
1889
- project !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "oh-video-stage", "data-state": project.state, children: [
1890
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { "aria-hidden": !0 }),
2103
+ project !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "oh-video-stage", "data-state": project.state, children: [
2104
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("i", { "aria-hidden": !0 }),
1891
2105
  project.stageLabel
1892
2106
  ] }),
1893
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-video-tabs", role: "tablist", "aria-label": "\u89C6\u9891\u5DE5\u4F5C\u53F0", children: tabs.map((item) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2107
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-video-tabs", role: "tablist", "aria-label": "\u89C6\u9891\u5DE5\u4F5C\u53F0", children: tabs.map((item) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1894
2108
  "button",
1895
2109
  {
1896
2110
  type: "button",
@@ -1910,17 +2124,17 @@ function VideoStudio({
1910
2124
  item
1911
2125
  )) })
1912
2126
  ] }),
1913
- project === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-video-preview-empty", children: [
1914
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { "aria-hidden": !0, children: "\u25B6" }),
1915
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: "\u8FD8\u6CA1\u6709\u89C6\u9891\u9879\u76EE" }),
1916
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { children: [
2127
+ project === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-video-preview-empty", children: [
2128
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "aria-hidden": !0, children: "\u25B6" }),
2129
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "\u8FD8\u6CA1\u6709\u89C6\u9891\u9879\u76EE" }),
2130
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { children: [
1917
2131
  "\u5728\u53F3\u4FA7 Chat \u544A\u8BC9 Agent \u8981\u5904\u7406\u7684\u89C6\u9891\uFF1B\u9879\u76EE\u4F1A\u521B\u5EFA\u5728 ",
1918
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { children: "video-recaps/<\u9879\u76EE>/" }),
2132
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "video-recaps/<\u9879\u76EE>/" }),
1919
2133
  "\u3002"
1920
2134
  ] })
1921
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-video-panels", children: [
1922
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { role: "tabpanel", id: `${tabsId}-preview-panel`, "aria-labelledby": `${tabsId}-preview-tab`, hidden: tab !== "preview", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(VideoPreview, { project, sessionId, running }, project.id) }),
1923
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { role: "tabpanel", id: `${tabsId}-artifacts-panel`, "aria-labelledby": `${tabsId}-artifacts-tab`, hidden: tab !== "artifacts", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(VideoArtifacts, { project, sessionId }) })
2135
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-video-panels", children: [
2136
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { role: "tabpanel", id: `${tabsId}-preview-panel`, "aria-labelledby": `${tabsId}-preview-tab`, hidden: tab !== "preview", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(VideoPreview, { project, sessionId, running }, project.id) }),
2137
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { role: "tabpanel", id: `${tabsId}-artifacts-panel`, "aria-labelledby": `${tabsId}-artifacts-tab`, hidden: tab !== "artifacts", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(VideoArtifacts, { project, sessionId }) })
1924
2138
  ] })
1925
2139
  ] });
1926
2140
  }
@@ -2625,62 +2839,14 @@ var plugin_default = `.oh-story-bridge-marker { display: none; }
2625
2839
  .oh-story-production-summary { color: var(--os-muted); white-space: nowrap; }
2626
2840
  .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); }
2627
2841
  .oh-story-production-notice button { border: 0; background: transparent; }
2628
- .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; }
2629
- /* 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. */
2630
- .oh-story-production-environment > * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
2631
- .oh-story-production-environment strong { color: var(--dsw-alias-label-secondary); font-size: 11px; }
2632
- .oh-story-production-environment span::before { content: "\u25CF"; margin-right: 4px; color: var(--video-danger, #d9534f); }
2633
- .oh-story-production-environment span[data-ready]::before { color: var(--dsw-alias-state-success-primary, #45b96f); }
2634
- .oh-story-production-environment span[data-pending]::before { color: var(--os-muted); }
2635
- .oh-story-production-environment em { flex-basis: 100%; font-style: normal; line-height: 1.5; }
2636
- .oh-story-production-environment code { font-size: 10px; overflow-wrap: anywhere; }
2637
- .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; }
2638
- .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); }
2639
- .oh-story-production-diagnostics summary { color: var(--dsw-alias-state-warn-label); cursor: pointer; }
2640
- .oh-story-production-diagnostics ul { display: grid; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; }
2641
- .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); }
2642
- .oh-story-production-diagnostics li[data-severity="error"] { color: var(--dsw-alias-state-error-primary); }
2643
- .oh-story-production-diagnostics li button { border: 0; padding: 0; color: inherit; background: transparent; text-align: left; }
2644
- .oh-story-production-diagnostics p { margin: 6px 0 0; color: var(--os-muted); }
2645
- .oh-story-production-actions { justify-content: flex-end; margin-bottom: 12px; }
2646
- .oh-story-production-actions button:last-child,
2647
- .oh-story-sequence-summary button { color: var(--dsw-alias-state-business-primary); border-color: var(--dsw-alias-state-business-primary); }
2648
- .oh-story-shot-board { padding: 16px 12px; }
2649
2842
  .oh-story-shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: start; gap: 12px; }
2650
2843
  .oh-story-shot-card,
2651
2844
  .oh-story-asset-card,
2652
2845
  .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); }
2653
- .oh-story-shot-card { padding: 10px; cursor: default; transition: border-color .15s ease, background-color .15s ease; }
2654
- .oh-story-shot-card:hover { border-color: var(--dsw-alias-border-l2); }
2655
- .oh-story-shot-card { cursor: pointer; }
2656
2846
  .oh-story-shot-card:focus-visible,
2657
2847
  .oh-story-asset-card:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: 2px; }
2658
2848
  .oh-story-shot-card[data-selected],
2659
2849
  .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)); }
2660
- .oh-story-shot-card > header,
2661
- .oh-story-task-board article > header { display: flex; min-height: 0; align-items: center; gap: 8px; padding: 0; border: 0; }
2662
- .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; }
2663
- .oh-story-shot-card > header > span { color: var(--os-muted); font-variant-numeric: tabular-nums; }
2664
- .oh-story-shot-card h3,
2665
- .oh-story-asset-card h3 { margin: 7px 0 4px; font-size: 13px; font-weight: 600; }
2666
- .oh-story-shot-card > p,
2667
- .oh-story-asset-card > p,
2668
- .oh-story-task-board article > p { margin: 5px 0; color: var(--os-muted); }
2669
- .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; }
2670
- .oh-story-shot-placeholder strong { color: var(--dsw-alias-label-secondary); font-size: 22px; font-variant-numeric: tabular-nums; }
2671
- .oh-story-shot-card dl { display: grid; grid-template-columns: 20px minmax(0, 1fr); margin: 7px 0; }
2672
- .oh-story-shot-card dt { color: var(--dsw-alias-state-business-primary); }
2673
- .oh-story-shot-card dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
2674
- .oh-story-shot-status,
2675
- .oh-story-reference-links,
2676
- .oh-story-card-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
2677
- .oh-story-shot-status span { padding: 1px 5px; border-radius: 5px; color: var(--os-muted); background: var(--dsw-alias-button-ghost-active-fill); }
2678
- .oh-story-shot-status span[data-ready="true"] { color: var(--dsw-alias-state-business-primary); }
2679
- .oh-story-shot-status span > i { margin-right: 3px; font-style: normal; }
2680
- .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; }
2681
- .oh-story-card-actions { padding-top: 8px; border-top: 1px solid var(--os-border); }
2682
- .oh-story-card-actions button { flex: 1; padding-block: 4px; }
2683
- .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)); }
2684
2850
  .oh-story-media-preview { display: block; width: 100%; height: 168px; border-radius: 7px; background: var(--dsw-alias-bg-base); object-fit: contain; }
2685
2851
  .oh-story-media-document { display: grid; min-height: 0; flex: 1; overflow: auto; place-items: center; padding: 24px; }
2686
2852
  .oh-story-media-document img,
@@ -2691,12 +2857,6 @@ var plugin_default = `.oh-story-bridge-marker { display: none; }
2691
2857
  .oh-story-version-strip > button[data-selected] { border-color: var(--dsw-alias-state-business-primary); }
2692
2858
  .oh-story-version-strip .oh-story-media-preview { height: 72px; }
2693
2859
  .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; }
2694
- .oh-story-asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; padding: 16px 12px; }
2695
- .oh-story-asset-card { padding: 10px; }
2696
- .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; }
2697
- .oh-story-asset-card small { color: var(--os-muted); text-transform: uppercase; }
2698
- .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; }
2699
- .oh-story-asset-description { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; }
2700
2860
  .oh-story-media-library { margin: 0 12px 14px; padding-top: 12px; border-top: 1px solid var(--os-border); }
2701
2861
  .oh-story-media-library > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
2702
2862
  .oh-story-media-library > header > div { display: flex; align-items: center; gap: 7px; }
@@ -2723,36 +2883,170 @@ var plugin_default = `.oh-story-bridge-marker { display: none; }
2723
2883
  .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; }
2724
2884
  .oh-story-task-board footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; margin-top: 8px; }
2725
2885
  .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); }
2726
- .oh-story-task-board > .oh-story-projection-note { margin-bottom: 0; }
2727
- .oh-story-production-empty { padding: 48px 20px; color: var(--os-muted); text-align: center; }
2728
- .oh-story-production-empty strong { display: block; margin-bottom: 6px; color: var(--dsw-alias-text-1); font-size: 13px; }
2729
- .oh-story-production-empty p { margin: 0 auto; max-width: 44em; line-height: 1.6; }
2886
+ /* Shared rhythm for every production tab: 12px gutters, 10\u201312px radii, mono for IDs,
2887
+ one primary action per surface, status as quiet dots rather than red walls. */
2888
+ .oh-story-production { --os-mono: 10.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; --os-accent: var(--dsw-alias-state-business-primary); --os-accent-soft: color-mix(in srgb, var(--dsw-alias-state-business-primary) 9%, transparent); }
2889
+ .oh-story-production-tabs button:hover:not(:disabled) { color: var(--dsw-alias-label-primary); background: transparent; }
2890
+
2891
+ /* Status row: one pill per concern; the detail opens underneath on demand. */
2892
+ .oh-story-production-status { margin: 10px 12px 0; }
2893
+ .oh-story-status-pills { display: flex; flex-wrap: wrap; gap: 6px; }
2894
+ .oh-story-production .oh-story-status-pill { display: inline-flex; min-height: 26px; align-items: center; gap: 6px; padding: 0 10px 0 9px; border-radius: 999px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-bg-layer-1); white-space: nowrap; }
2895
+ .oh-story-production .oh-story-status-pill[aria-expanded="true"] { border-color: var(--dsw-alias-border-l2); color: var(--dsw-alias-label-primary); }
2896
+ .oh-story-status-pill > i { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--os-muted); }
2897
+ .oh-story-status-pill[data-tone="ready"] > i { background: var(--dsw-alias-state-success-primary); }
2898
+ .oh-story-status-pill[data-tone="partial"] > i,
2899
+ .oh-story-status-pill[data-tone="warning"] > i { background: var(--dsw-alias-state-warn-label); }
2900
+ .oh-story-status-pill[data-tone="error"] > i { background: var(--dsw-alias-state-error-primary); }
2901
+ .oh-story-status-pill[data-tone="idle"] > i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--os-muted); }
2902
+ .oh-story-status-pill em { overflow: hidden; min-width: 0; color: var(--os-muted); font-style: normal; text-overflow: ellipsis; }
2903
+ .oh-story-production .oh-story-status-pill { max-width: 100%; overflow: hidden; }
2904
+ .oh-story-status-pill > b { width: 4px; height: 4px; margin-left: 1px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; opacity: .5; transform: translateY(-1px) rotate(45deg); transition: transform .15s ease; }
2905
+ .oh-story-status-pill[aria-expanded="true"] > b { transform: translateY(1px) rotate(-135deg); }
2906
+ .oh-story-status-panel { margin-top: 8px; padding: 8px 12px 10px; border: 1px solid var(--os-border); border-radius: 10px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-bg-layer-1); }
2907
+ .oh-story-provider-list { display: grid; margin: 0; padding: 0; list-style: none; }
2908
+ .oh-story-provider-list li { display: grid; grid-template-columns: 6px 30px minmax(84px, max-content) minmax(0, 1fr); align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--os-border); }
2909
+ .oh-story-provider-list li:last-child { border-bottom: 0; }
2910
+ .oh-story-provider-list i { width: 6px; height: 6px; align-self: start; margin-top: 6px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--os-muted); }
2911
+ .oh-story-provider-list li[data-ready] i { background: var(--dsw-alias-state-success-primary); box-shadow: none; }
2912
+ .oh-story-provider-list span { color: var(--os-muted); font-size: 11px; }
2913
+ .oh-story-provider-list strong { color: var(--dsw-alias-label-primary); font-weight: 500; white-space: nowrap; }
2914
+ .oh-story-provider-list small { display: flex; min-width: 0; flex-wrap: wrap; align-items: baseline; gap: 4px; color: var(--os-muted); font-size: 11px; }
2915
+ .oh-story-provider-list li[data-ready] small { color: var(--dsw-alias-state-success-primary); }
2916
+ .oh-story-provider-list li[data-error] i { background: var(--dsw-alias-state-error-primary); box-shadow: none; }
2917
+ .oh-story-provider-list li[data-error] small { color: var(--dsw-alias-state-error-primary); }
2918
+ .oh-story-shot-card > .oh-story-media-preview,
2919
+ .oh-story-asset-media > .oh-story-media-preview { background: var(--dsw-alias-button-ghost-active-fill); }
2920
+ .oh-story-status-panel code { max-width: 100%; overflow: hidden; padding: 0 5px; border-radius: 4px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-button-ghost-active-fill); font: var(--os-mono); text-overflow: ellipsis; white-space: nowrap; }
2921
+ .oh-story-status-panel > p { margin: 8px 0 0; color: var(--os-muted); line-height: 1.6; }
2922
+ .oh-story-status-panel > footer { display: flex; min-width: 0; align-items: center; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--os-border); color: var(--os-muted); font-size: 11px; }
2923
+ .oh-story-status-panel > footer > span { flex: none; }
2924
+ .oh-story-status-panel > footer code { min-width: 0; flex: 1; }
2925
+ .oh-story-status-panel > footer button { flex: none; padding: 1px 8px; }
2926
+ .oh-story-production-diagnostics ul { display: grid; margin: 0; padding: 0; list-style: none; }
2927
+ .oh-story-production-diagnostics li { display: grid; grid-template-columns: minmax(92px, max-content) minmax(0, 1fr); align-items: baseline; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--os-border); }
2928
+ .oh-story-production-diagnostics li:last-child { border-bottom: 0; }
2929
+ .oh-story-production .oh-story-production-diagnostics li button { border: 0; padding: 0; color: var(--os-accent); background: transparent; font: var(--os-mono); text-align: left; white-space: nowrap; }
2930
+ .oh-story-production-diagnostics li button span { color: var(--os-muted); }
2931
+ .oh-story-production-diagnostics li[data-severity="error"] > span { color: var(--dsw-alias-state-error-primary); }
2932
+ .oh-story-production-diagnostics p { margin: 6px 0 0; color: var(--os-muted); }
2933
+
2934
+ /* Shot board */
2935
+ .oh-story-shot-board { padding: 12px; }
2936
+ .oh-story-production-actions { justify-content: flex-end; gap: 6px; margin-bottom: 10px; }
2937
+ .oh-story-production .oh-story-production-actions button:last-child { border-color: color-mix(in srgb, var(--os-accent) 40%, var(--os-border)); color: var(--os-accent); background: var(--os-accent-soft); }
2938
+ .oh-story-shot-card { padding: 8px 8px 10px; border-radius: 12px; cursor: pointer; transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease; }
2939
+ .oh-story-shot-card:hover { border-color: var(--dsw-alias-border-l2); box-shadow: 0 2px 10px rgb(0 0 0 / 5%); }
2940
+ .oh-story-shot-card > .oh-story-media-preview,
2941
+ .oh-story-shot-placeholder { height: 156px; border-radius: 8px; }
2942
+ .oh-story-shot-placeholder { display: grid; box-sizing: border-box; place-content: center; gap: 2px; border: 1px dashed var(--os-border); color: var(--os-muted); background: repeating-linear-gradient(135deg, transparent 0 9px, color-mix(in srgb, var(--os-border) 35%, transparent) 9px 10px); text-align: center; }
2943
+ .oh-story-shot-placeholder strong { color: var(--dsw-alias-label-secondary); font: 600 20px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }
2944
+ .oh-story-shot-placeholder span { font-size: 11px; }
2945
+ .oh-story-shot-card > header,
2946
+ .oh-story-task-board article > header { display: flex; min-height: 0; align-items: center; gap: 8px; padding: 0; border: 0; }
2947
+ .oh-story-shot-card > header { margin: 9px 2px 0; }
2948
+ .oh-story-production .oh-story-shot-card > header > button { overflow: hidden; min-width: 0; flex: 1; border: 0; padding: 0; color: var(--os-muted); background: transparent; font: var(--os-mono); text-align: left; text-overflow: ellipsis; white-space: nowrap; }
2949
+ .oh-story-production .oh-story-shot-card > header > button:hover { color: var(--os-accent); background: transparent; }
2950
+ .oh-story-shot-card > header > span { padding: 0 6px; border-radius: 999px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-button-ghost-active-fill); font: var(--os-mono); }
2951
+ .oh-story-shot-card h3,
2952
+ .oh-story-asset-card h3 { margin: 4px 2px 2px; color: var(--dsw-alias-label-primary); font-size: 13.5px; font-weight: 600; line-height: 1.4; }
2953
+ .oh-story-shot-card > p,
2954
+ .oh-story-task-board article > p { margin: 0 2px; color: var(--os-muted); }
2955
+ .oh-story-shot-card dl { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 4px 6px; margin: 8px 2px; }
2956
+ .oh-story-shot-card dt { width: 16px; height: 16px; margin-top: 1px; border-radius: 4px; color: var(--os-accent); background: var(--os-accent-soft); font-size: 10px; line-height: 16px; text-align: center; }
2957
+ .oh-story-shot-card dd { min-width: 0; margin: 0; color: var(--dsw-alias-label-secondary); overflow-wrap: anywhere; }
2958
+ .oh-story-shot-status,
2959
+ .oh-story-reference-links { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 2px 0; }
2960
+ .oh-story-shot-status span { display: inline-flex; align-items: center; gap: 3px; padding: 0 7px; border-radius: 999px; color: var(--os-muted); background: var(--dsw-alias-button-ghost-active-fill); font-size: 11px; line-height: 20px; }
2961
+ .oh-story-shot-status span[data-ready="true"] { color: var(--dsw-alias-state-success-primary); background: color-mix(in srgb, var(--dsw-alias-state-success-primary) 10%, transparent); }
2962
+ .oh-story-shot-status span > i { font-size: 10px; font-style: normal; }
2963
+ .oh-story-shot-status > span:last-child:not([data-ready]) { margin-left: auto; padding: 0; background: transparent; font-variant-numeric: tabular-nums; }
2964
+ .oh-story-production .oh-story-reference-links button { max-width: 100%; overflow: hidden; padding: 0 6px; border-color: var(--os-border); border-radius: 5px; color: var(--dsw-alias-label-secondary); background: transparent; font: var(--os-mono); line-height: 18px; text-overflow: ellipsis; white-space: nowrap; }
2965
+ .oh-story-production .oh-story-reference-links button:hover:not(:disabled) { border-color: var(--os-accent); color: var(--os-accent); background: var(--os-accent-soft); }
2966
+ .oh-story-card-actions { display: flex; gap: 6px; margin: 10px 2px 0; padding-top: 10px; border-top: 1px solid var(--os-border); }
2967
+ .oh-story-card-actions button { min-width: 0; flex: 1; padding-block: 5px; }
2968
+ .oh-story-production .oh-story-card-actions button:last-child { border-color: color-mix(in srgb, var(--os-accent) 40%, var(--os-border)); color: var(--os-accent); background: var(--os-accent-soft); }
2969
+
2970
+ /* Asset board */
2971
+ .oh-story-asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding: 12px; }
2972
+ .oh-story-asset-card { display: flex; flex-direction: column; padding: 8px 8px 10px; border-radius: 12px; }
2973
+ .oh-story-asset-media { position: relative; }
2974
+ .oh-story-asset-media > .oh-story-media-preview,
2975
+ .oh-story-asset-placeholder { height: 136px; border-radius: 8px; }
2976
+ .oh-story-asset-placeholder { display: grid; place-items: center; color: color-mix(in srgb, var(--os-accent) 55%, var(--os-muted)); background: linear-gradient(160deg, var(--os-accent-soft), var(--dsw-alias-button-ghost-active-fill)); font-size: 34px; font-weight: 300; }
2977
+ .oh-story-asset-media[data-kind="scene"] .oh-story-asset-placeholder { color: color-mix(in srgb, var(--dsw-alias-state-success-primary) 60%, var(--os-muted)); background: linear-gradient(160deg, color-mix(in srgb, var(--dsw-alias-state-success-primary) 9%, transparent), var(--dsw-alias-button-ghost-active-fill)); }
2978
+ .oh-story-asset-media[data-kind="prop"] .oh-story-asset-placeholder { color: color-mix(in srgb, var(--dsw-alias-state-warn-label) 65%, var(--os-muted)); background: linear-gradient(160deg, color-mix(in srgb, var(--dsw-alias-state-warn-label) 9%, transparent), var(--dsw-alias-button-ghost-active-fill)); }
2979
+ .oh-story-asset-media > small { position: absolute; top: 8px; left: 8px; padding: 0 8px; border: 1px solid var(--os-border); border-radius: 999px; color: var(--dsw-alias-label-secondary); background: color-mix(in srgb, var(--dsw-alias-bg-base) 86%, transparent); backdrop-filter: blur(6px); font-size: 10.5px; line-height: 18px; }
2980
+ .oh-story-asset-head { display: flex; min-width: 0; flex-direction: column; margin-top: 9px; }
2981
+ .oh-story-asset-head h3 { margin-top: 0; }
2982
+ .oh-story-production .oh-story-asset-head > button { overflow: hidden; max-width: 100%; align-self: flex-start; margin-left: 2px; border: 0; padding: 0; color: var(--os-muted); background: transparent; font: var(--os-mono); text-overflow: ellipsis; white-space: nowrap; }
2983
+ .oh-story-production .oh-story-asset-head > button:hover { color: var(--os-accent); background: transparent; }
2984
+ .oh-story-asset-description { display: -webkit-box; overflow: hidden; margin: 6px 2px 0; color: var(--os-muted); font-size: 11.5px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; }
2985
+ .oh-story-asset-card > .oh-story-card-actions { margin-top: auto; }
2986
+ .oh-story-asset-card > .oh-story-asset-description + .oh-story-card-actions { margin-top: 10px; }
2987
+
2988
+ /* Task board */
2989
+ .oh-story-board-hint { margin: 0; color: var(--os-muted); font-size: 11.5px; line-height: 1.6; }
2990
+ .oh-story-production-empty { margin: 4px 0; padding: 36px 20px; border: 1px dashed var(--os-border); border-radius: 12px; color: var(--os-muted); text-align: center; }
2991
+ .oh-story-production-empty strong { display: block; margin-bottom: 4px; color: var(--dsw-alias-label-primary); font-size: 13px; font-weight: 600; }
2992
+ .oh-story-production-empty p { max-width: 36em; margin: 0 auto; line-height: 1.6; }
2730
2993
  .oh-story-production-empty button { margin-top: 12px; }
2994
+ .oh-story-shot-board > .oh-story-production-empty,
2995
+ .oh-story-assets > .oh-story-production-empty,
2996
+ .oh-story-canvas-shell > .oh-story-production-empty { margin: 12px; }
2997
+
2998
+ /* Final-cut sequence */
2731
2999
  .oh-story-sequence { padding: 12px; }
2732
- .oh-story-sequence-summary { justify-content: space-between; margin-bottom: 10px; }
3000
+ .oh-story-sequence-summary { flex-wrap: wrap; margin-bottom: 10px; }
3001
+ .oh-story-sequence-summary strong { color: var(--dsw-alias-label-primary); font-size: 13px; }
2733
3002
  .oh-story-sequence-summary span { margin-left: auto; color: var(--os-muted); }
2734
- .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); }
2735
- .oh-story-sequence-issues li + li { margin-top: 2px; }
3003
+ .oh-story-production .oh-story-sequence-summary button { border-color: transparent; color: #fff; background: var(--os-accent); }
3004
+ .oh-story-production .oh-story-sequence-summary button:hover:not(:disabled) { background: color-mix(in srgb, var(--os-accent) 88%, #000); }
3005
+ .oh-story-sequence-issues { margin: 0 0 10px; padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--dsw-alias-state-warn-label) 35%, var(--os-border)); border-radius: 10px; color: var(--dsw-alias-label-secondary); background: var(--dsw-specific-tip); list-style: none; }
3006
+ .oh-story-sequence-issues li { position: relative; padding-left: 14px; line-height: 1.7; }
3007
+ .oh-story-sequence-issues li::before { position: absolute; top: .72em; left: 2px; width: 5px; height: 5px; border-radius: 50%; background: var(--dsw-alias-state-warn-label); content: ""; }
2736
3008
  .oh-story-sequence ol { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
2737
- .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); }
2738
- .oh-story-sequence > ol > li > span { color: var(--os-muted); font-variant-numeric: tabular-nums; }
3009
+ .oh-story-sequence > ol > li { display: grid; min-height: 60px; grid-template-columns: 22px 64px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--os-border); border-radius: 10px; background: var(--dsw-alias-bg-layer-1); }
3010
+ .oh-story-sequence > ol > li > span { color: var(--os-muted); font: var(--os-mono); text-align: right; }
2739
3011
  .oh-story-sequence > ol > li .oh-story-media-preview,
2740
- .oh-story-sequence-missing { width: 96px; height: 54px; }
2741
- .oh-story-sequence-missing { display: grid; place-items: center; border-radius: 5px; color: var(--os-muted); background: var(--dsw-alias-button-ghost-active-fill); }
2742
- .oh-story-sequence > ol > li > strong { overflow: hidden; text-overflow: ellipsis; }
2743
- .oh-story-sequence > ol > li > div:last-child { display: grid; width: clamp(160px, 25vw, 260px); min-width: 0; grid-template-columns: minmax(0, 1fr) auto auto; gap: 3px; }
2744
- .oh-story-sequence > ol > li select { width: 100%; min-width: 0; }
2745
- .oh-story-canvas-shell { position: relative; display: flex; height: max(580px, calc(100% - 84px)); min-height: 580px; flex-direction: column; overflow: hidden; }
2746
- .oh-story-canvas-shell > .oh-story-projection-note { z-index: 3; flex: none; margin: 8px 168px 8px 8px; }
2747
- .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); }
2748
- .oh-story-canvas-controls span { min-width: 44px; color: var(--os-muted); text-align: center; }
2749
- .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; }
2750
- .oh-story-canvas { position: relative; width: 1800px; height: 1800px; transform-origin: 0 0; }
2751
- .oh-story-canvas svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
2752
- .oh-story-canvas path { fill: none; opacity: .35; stroke: var(--dsw-alias-border-l2); stroke-width: 1.5; }
2753
- .oh-story-canvas path[data-active] { opacity: .8; stroke: var(--dsw-alias-state-business-primary); }
3012
+ .oh-story-sequence-missing { width: 64px; height: 48px; border-radius: 6px; }
3013
+ .oh-story-sequence > ol > li .oh-story-media-preview { object-fit: cover; }
3014
+ .oh-story-sequence-missing { display: grid; box-sizing: border-box; place-items: center; border: 1px dashed color-mix(in srgb, var(--dsw-alias-state-warn-label) 50%, var(--os-border)); color: var(--dsw-alias-state-warn-label); font-size: 10.5px; }
3015
+ .oh-story-sequence-main { display: grid; min-width: 0; gap: 4px; }
3016
+ .oh-story-sequence-main strong { overflow: hidden; color: var(--dsw-alias-label-primary); font: 500 11.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
3017
+ .oh-story-sequence-main select { width: 100%; min-width: 0; padding-block: 3px; }
3018
+ .oh-story-sequence-move { display: grid; gap: 3px; }
3019
+ .oh-story-production .oh-story-sequence-move button { width: 26px; height: 22px; padding: 0; line-height: 1; }
3020
+ /* Project media library: same card language as the asset board. */
3021
+ .oh-story-media-library { margin: 4px 12px 16px; padding-top: 14px; }
3022
+ .oh-story-media-library > header strong { color: var(--dsw-alias-label-primary); font-size: 13px; }
3023
+ .oh-story-media-library > .oh-story-projection-note { padding: 0; border: 0; background: transparent; font-size: 11.5px; line-height: 1.6; }
3024
+ .oh-story-media-library-grid > article { gap: 4px; padding: 8px; border-radius: 12px; }
3025
+ .oh-story-media-library-grid .oh-story-media-preview { border-radius: 8px; background: var(--dsw-alias-button-ghost-active-fill); }
3026
+ .oh-story-media-library-grid > article > strong { margin-top: 4px; overflow: hidden; color: var(--dsw-alias-label-primary); font: 500 11.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
3027
+ .oh-story-media-library-grid > article > span { font: var(--os-mono); font-size: 10px; }
3028
+ .oh-story-media-library-grid footer { margin-top: 6px; }
3029
+ .oh-story-production:has(> .oh-story-canvas-shell) { display: flex; flex-direction: column; }
3030
+ .oh-story-production:has(> .oh-story-canvas-shell) > :not(.oh-story-canvas-shell) { flex: none; }
3031
+ .oh-story-canvas-shell { position: relative; display: flex; min-height: 420px; flex: 1 0 420px; flex-direction: column; overflow: hidden; }
3032
+ .oh-story-canvas-toolbar { display: flex; flex: none; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--os-border); }
3033
+ .oh-story-canvas-help { overflow: hidden; min-width: 0; flex: 1; color: var(--os-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
3034
+ .oh-story-canvas-controls { display: flex; flex: none; align-items: center; overflow: hidden; border: 1px solid var(--os-border); border-radius: 8px; background: var(--dsw-alias-bg-layer-1); }
3035
+ .oh-story-production .oh-story-canvas-controls button { min-width: 28px; height: 26px; border: 0; border-radius: 0; padding: 0 8px; background: transparent; }
3036
+ .oh-story-production .oh-story-canvas-controls button + button,
3037
+ .oh-story-production .oh-story-canvas-controls span + button { border-left: 1px solid var(--os-border); }
3038
+ .oh-story-canvas-controls span { min-width: 44px; border-left: 1px solid var(--os-border); color: var(--dsw-alias-label-secondary); font: var(--os-mono); line-height: 26px; text-align: center; font-variant-numeric: tabular-nums; }
3039
+ .oh-story-canvas-viewport { position: relative; width: 100%; min-height: 0; flex: 1; overflow: hidden; cursor: grab; touch-action: none; overscroll-behavior: contain; background-color: var(--dsw-alias-bg-base); background-image: radial-gradient(var(--os-border) 1px, transparent 1px); background-size: 20px 20px; }
3040
+ .oh-story-canvas-viewport[data-panning] { cursor: grabbing; }
3041
+ .oh-story-canvas-viewport:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: -2px; }
3042
+ .oh-story-canvas { position: absolute; top: 0; left: 0; width: 0; height: 0; overflow: visible; transform-origin: 0 0; }
3043
+ .oh-story-canvas svg { position: absolute; top: 0; left: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
3044
+ .oh-story-canvas path { fill: none; opacity: .6; stroke: var(--dsw-alias-border-l2); stroke-width: 1.5; }
3045
+ .oh-story-canvas path[data-active] { opacity: .9; stroke-width: 2.5; stroke: var(--dsw-alias-state-business-primary); }
2754
3046
  .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; }
2755
- .oh-story-canvas article:active { cursor: grabbing; }
3047
+ .oh-story-canvas article:active,
3048
+ .oh-story-canvas article[data-dragging] { z-index: 2; cursor: grabbing; }
3049
+ .oh-story-canvas article[data-selected] { z-index: 1; }
2756
3050
  .oh-story-canvas article[data-node-type="shot"] { border-color: var(--dsw-alias-state-business-primary); }
2757
3051
  .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%); }
2758
3052
  .oh-story-canvas article small { color: var(--os-muted); text-transform: uppercase; }
@@ -2919,17 +3213,24 @@ var plugin_default = `.oh-story-bridge-marker { display: none; }
2919
3213
  [data-oh-story-layout="compact"] .oh-story-media-library > header { align-items: stretch; flex-direction: column; }
2920
3214
  [data-oh-story-layout="compact"] .oh-story-media-library > header > div:last-child { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
2921
3215
  [data-oh-story-layout="compact"] .oh-story-media-library input { width: 100%; }
3216
+ [data-oh-story-layout="compact"] .oh-story-canvas-toolbar { flex-wrap: wrap; }
3217
+ [data-oh-story-layout="compact"] .oh-story-canvas-help { flex-basis: 100%; white-space: normal; }
3218
+ [data-oh-story-layout="compact"] .oh-story-canvas-controls { max-width: 100%; flex-wrap: wrap; }
3219
+ [data-oh-story-layout="compact"] .oh-story-production .oh-story-canvas-controls button { flex: 1; }
2922
3220
  [data-oh-story-layout="compact"] .oh-story-sequence { padding-inline: 6px; }
2923
- [data-oh-story-layout="compact"] .oh-story-sequence-summary { flex-wrap: wrap; }
2924
3221
  [data-oh-story-layout="compact"] .oh-story-sequence-summary span { display: none; }
2925
- [data-oh-story-layout="compact"] .oh-story-sequence > ol > li { grid-template-columns: 24px 64px minmax(0, 1fr); gap: 5px; }
3222
+ [data-oh-story-layout="compact"] .oh-story-sequence > ol > li { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 6px; padding: 6px; }
3223
+ [data-oh-story-layout="compact"] .oh-story-sequence > ol > li > span { display: none; }
2926
3224
  [data-oh-story-layout="compact"] .oh-story-sequence > ol > li .oh-story-media-preview,
2927
- [data-oh-story-layout="compact"] .oh-story-sequence-missing { width: 64px; height: 40px; }
2928
- [data-oh-story-layout="compact"] .oh-story-sequence > ol > li > div:last-child { grid-column: 1 / -1; width: auto; }
2929
- [data-oh-story-layout="compact"] .oh-story-sequence > ol > li select { grid-column: 1 / -1; }
2930
- [data-oh-story-layout="compact"] .oh-story-sequence > ol > li button:first-of-type { grid-column: 2; }
2931
- [data-oh-story-layout="compact"] .oh-story-canvas-shell > .oh-story-projection-note { overflow: hidden; max-height: 48px; margin: 8px; }
2932
- [data-oh-story-layout="compact"] .oh-story-canvas-controls { position: static; flex: none; align-self: flex-end; margin: 0 8px 8px; }
3225
+ [data-oh-story-layout="compact"] .oh-story-sequence-missing { width: 44px; height: 44px; }
3226
+ [data-oh-story-layout="compact"] .oh-story-sequence-main { display: contents; }
3227
+ [data-oh-story-layout="compact"] .oh-story-sequence-main select { grid-column: 1 / -1; grid-row: 2; }
3228
+ [data-oh-story-layout="compact"] .oh-story-sequence-move { grid-row: 1; grid-column: 3; }
3229
+ [data-oh-story-layout="compact"] .oh-story-provider-list li { grid-template-columns: 6px minmax(0, 1fr); }
3230
+ [data-oh-story-layout="compact"] .oh-story-provider-list li > span { display: none; }
3231
+ [data-oh-story-layout="compact"] .oh-story-provider-list li > small { grid-column: 2; }
3232
+ [data-oh-story-layout="compact"] .oh-story-production-diagnostics li { grid-template-columns: minmax(0, 1fr); gap: 0; }
3233
+ [data-oh-story-layout="compact"] .oh-story-status-panel > footer { flex-wrap: wrap; }
2933
3234
 
2934
3235
  /* Video mode intentionally stays a preview surface: one player, a read-only artifact view,
2935
3236
  and the official DSH Conversation. It shares no nonlinear-editor or timeline runtime. */
@@ -3119,7 +3420,7 @@ var plugin_default = `.oh-story-bridge-marker { display: none; }
3119
3420
  `;
3120
3421
 
3121
3422
  // src/client/index.tsx
3122
- var import_jsx_runtime5 = require("react/jsx-runtime"), name = "oh-story", inject = ["slots", "sessions", "conversation"];
3423
+ var import_jsx_runtime6 = require("react/jsx-runtime"), name = "oh-story", inject = ["slots", "sessions", "conversation"];
3123
3424
  function applyUpdate(current, update) {
3124
3425
  return typeof update == "function" ? update(current) : update;
3125
3426
  }
@@ -3146,7 +3447,7 @@ function createWorkbenchStore() {
3146
3447
  productionReferences: {},
3147
3448
  productionSequence: {},
3148
3449
  productionCanvas: {},
3149
- productionZoom: {},
3450
+ productionViewport: {},
3150
3451
  productionIntentCalls: {},
3151
3452
  settledMutation: void 0,
3152
3453
  hydrated: !1
@@ -3215,8 +3516,8 @@ function createWorkbenchStore() {
3215
3516
  setProductionCanvas: (draft, update) => {
3216
3517
  draft.productionCanvas = applyUpdate(draft.productionCanvas, update);
3217
3518
  },
3218
- setProductionZoom: (draft, update) => {
3219
- draft.productionZoom = applyUpdate(draft.productionZoom, update);
3519
+ setProductionViewport: (draft, update) => {
3520
+ draft.productionViewport = applyUpdate(draft.productionViewport, update);
3220
3521
  },
3221
3522
  setProductionIntentCalls: (draft, update) => {
3222
3523
  draft.productionIntentCalls = applyUpdate(draft.productionIntentCalls, update);
@@ -3253,8 +3554,8 @@ function FileTreeNodes({
3253
3554
  onToggle,
3254
3555
  onSelect
3255
3556
  }) {
3256
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: nodes.map((node) => {
3257
- if (node.kind === "file") return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
3557
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: nodes.map((node) => {
3558
+ if (node.kind === "file") return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3258
3559
  "button",
3259
3560
  {
3260
3561
  type: "button",
@@ -3272,14 +3573,14 @@ function FileTreeNodes({
3272
3573
  node.path
3273
3574
  );
3274
3575
  let open = selected?.startsWith(`${node.path}/`) === !0 || expanded[node.path] === !0;
3275
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("details", { className: "oh-story-file-folder", open, onToggle: (event) => {
3576
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("details", { className: "oh-story-file-folder", open, onToggle: (event) => {
3276
3577
  onToggle(node.path, event.currentTarget.open);
3277
3578
  }, children: [
3278
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("summary", { style: { "--oh-story-indent": `${String(depth * 14)}px` }, title: node.path, children: [
3579
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("summary", { style: { "--oh-story-indent": `${String(depth * 14)}px` }, title: node.path, children: [
3279
3580
  node.name,
3280
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: node.fileCount })
3581
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: node.fileCount })
3281
3582
  ] }),
3282
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
3583
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3283
3584
  FileTreeNodes,
3284
3585
  {
3285
3586
  nodes: node.children,
@@ -3295,10 +3596,10 @@ function FileTreeNodes({
3295
3596
  }) });
3296
3597
  }
3297
3598
  function useWorkspace(sessionId) {
3298
- let [version, setVersion] = (0, import_react3.useState)(0), [workspace, setWorkspace] = (0, import_react3.useState)(), [error, setError] = (0, import_react3.useState)(), [loading, setLoading] = (0, import_react3.useState)(!0), reload = (0, import_react3.useCallback)(() => {
3599
+ let [version, setVersion] = (0, import_react4.useState)(0), [workspace, setWorkspace] = (0, import_react4.useState)(), [error, setError] = (0, import_react4.useState)(), [loading, setLoading] = (0, import_react4.useState)(!0), reload = (0, import_react4.useCallback)(() => {
3299
3600
  setLoading(!0), setVersion((value) => value + 1);
3300
3601
  }, []);
3301
- return (0, import_react3.useEffect)(() => {
3602
+ return (0, import_react4.useEffect)(() => {
3302
3603
  let controller = new AbortController();
3303
3604
  return setError(void 0), fetch(endpoint("workspace", sessionId), { signal: controller.signal }).then((response) => json(response)).then(setWorkspace).catch((reason) => {
3304
3605
  controller.signal.aborted || setError(reason instanceof Error ? reason.message : String(reason));
@@ -3314,10 +3615,10 @@ function isolatedPreviewUrl(path, version, revision) {
3314
3615
  return url.hostname === "127.0.0.1" ? url.hostname = "localhost" : url.hostname === "localhost" && (url.hostname = "127.0.0.1"), url.searchParams.set("build", version), url.searchParams.set("reload", String(revision)), { href: url.toString(), isolated: url.origin !== globalThis.location.origin };
3315
3616
  }
3316
3617
  function PreviewProbe({ href, onFailed }) {
3317
- let failedRef = (0, import_react3.useRef)(onFailed);
3318
- return (0, import_react3.useEffect)(() => {
3618
+ let failedRef = (0, import_react4.useRef)(onFailed);
3619
+ return (0, import_react4.useEffect)(() => {
3319
3620
  failedRef.current = onFailed;
3320
- }, [onFailed]), (0, import_react3.useEffect)(() => {
3621
+ }, [onFailed]), (0, import_react4.useEffect)(() => {
3321
3622
  let controller = new AbortController();
3322
3623
  return fetch(href, { signal: controller.signal }).then((response) => {
3323
3624
  if (controller.signal.aborted) return;
@@ -3331,8 +3632,8 @@ function PreviewProbe({ href, onFailed }) {
3331
3632
  }, [href]), null;
3332
3633
  }
3333
3634
  function GamePreview({ project, building }) {
3334
- let shellRef = (0, import_react3.useRef)(null), fullscreenButtonRef = (0, import_react3.useRef)(null), restoreFullscreenFocus = (0, import_react3.useRef)(!1), [focused, setFocused] = (0, import_react3.useState)(!1), [loaded, setLoaded] = (0, import_react3.useState)(!1), [loadError, setLoadError] = (0, import_react3.useState)(!1), [revision, setRevision] = (0, import_react3.useState)(0), [loadedVersion, setLoadedVersion] = (0, import_react3.useState)(project.previewVersion);
3335
- if ((0, import_react3.useEffect)(() => {
3635
+ let shellRef = (0, import_react4.useRef)(null), fullscreenButtonRef = (0, import_react4.useRef)(null), restoreFullscreenFocus = (0, import_react4.useRef)(!1), [focused, setFocused] = (0, import_react4.useState)(!1), [loaded, setLoaded] = (0, import_react4.useState)(!1), [loadError, setLoadError] = (0, import_react4.useState)(!1), [revision, setRevision] = (0, import_react4.useState)(0), [loadedVersion, setLoadedVersion] = (0, import_react4.useState)(project.previewVersion);
3636
+ if ((0, import_react4.useEffect)(() => {
3336
3637
  let document = shellRef.current?.ownerDocument;
3337
3638
  if (document === void 0) return;
3338
3639
  let restore = () => {
@@ -3341,19 +3642,19 @@ function GamePreview({ project, building }) {
3341
3642
  return document.addEventListener("fullscreenchange", restore), () => {
3342
3643
  document.removeEventListener("fullscreenchange", restore);
3343
3644
  };
3344
- }, []), !project.previewReady || project.previewUrl === void 0) return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-game-preview-empty", children: [
3345
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "aria-hidden": !0, children: "\u25EB" }),
3346
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "\u8FD8\u6CA1\u6709\u53EF\u8BD5\u73A9\u7248\u672C" }),
3347
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { children: [
3645
+ }, []), !project.previewReady || project.previewUrl === void 0) return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-game-preview-empty", children: [
3646
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { "aria-hidden": !0, children: "\u25EB" }),
3647
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("strong", { children: "\u8FD8\u6CA1\u6709\u53EF\u8BD5\u73A9\u7248\u672C" }),
3648
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("p", { children: [
3348
3649
  "\u5728\u53F3\u4FA7 Chat \u4F7F\u7528 ",
3349
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "/novel-to-game quick" }),
3650
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("code", { children: "/novel-to-game quick" }),
3350
3651
  "\uFF0C\u4EA7\u7269\u5199\u5165 ",
3351
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "game-adaptations/<project>/build/app/" }),
3652
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("code", { children: "game-adaptations/<project>/build/app/" }),
3352
3653
  " \u540E\u4F1A\u81EA\u52A8\u51FA\u73B0\u5728\u8FD9\u91CC\u3002"
3353
3654
  ] }),
3354
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-game-prompt-example", children: [
3355
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u63CF\u8FF0\u793A\u4F8B" }),
3356
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("q", { children: "\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" })
3655
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-game-prompt-example", children: [
3656
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u63CF\u8FF0\u793A\u4F8B" }),
3657
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("q", { children: "\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" })
3357
3658
  ] })
3358
3659
  ] });
3359
3660
  let preview = isolatedPreviewUrl(project.previewUrl, loadedVersion, revision), pending = project.previewVersion !== loadedVersion, reload = () => {
@@ -3361,19 +3662,19 @@ function GamePreview({ project, building }) {
3361
3662
  }, refresh = () => {
3362
3663
  setLoaded(!1), setLoadError(!1), setRevision((value) => value + 1);
3363
3664
  }, runtimeState = loadError ? "\u9884\u89C8\u8F7D\u5165\u5931\u8D25 \xB7 \u53EF\u91CD\u65B0\u8F7D\u5165" : building ? "Agent \u6B63\u5728\u66F4\u65B0\u6E38\u620F\u6587\u4EF6 \xB7 \u5F53\u524D\u9884\u89C8\u4FDD\u6301\u4E0D\u53D8" : pending ? "\u65B0\u7248\u672C\u5DF2\u5C31\u7EEA \xB7 \u7531\u4F60\u51B3\u5B9A\u4F55\u65F6\u8F7D\u5165" : loaded ? preview.isolated ? "\u9884\u89C8\u5DF2\u8F7D\u5165" : "\u9884\u89C8\u5DF2\u8F7D\u5165 \xB7 \u5F53\u524D\u90E8\u7F72\u65E0\u6CD5\u9694\u79BB\u6765\u6E90\uFF0C\u5B58\u6863\u529F\u80FD\u4E0D\u53EF\u7528" : "\u6B63\u5728\u8F7D\u5165\u9884\u89C8\u2026";
3364
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { ref: shellRef, className: "oh-game-preview-shell", "data-state": loadError ? "error" : building ? "building" : loaded ? "ready" : "loading", children: [
3365
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-game-preview-status", children: [
3366
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "oh-game-runtime-state", role: "status", "aria-live": "polite", title: runtimeState, children: [
3367
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("i", { "aria-hidden": !0 }),
3368
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("em", { children: runtimeState })
3665
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { ref: shellRef, className: "oh-game-preview-shell", "data-state": loadError ? "error" : building ? "building" : loaded ? "ready" : "loading", children: [
3666
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-game-preview-status", children: [
3667
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "oh-game-runtime-state", role: "status", "aria-live": "polite", title: runtimeState, children: [
3668
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("i", { "aria-hidden": !0 }),
3669
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("em", { children: runtimeState })
3369
3670
  ] }),
3370
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
3371
- pending && !building && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", onClick: reload, children: "\u8F7D\u5165\u65B0\u7248\u672C" }),
3372
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("button", { className: "oh-game-reload", type: "button", onClick: refresh, "aria-label": "\u91CD\u65B0\u8F7D\u5165\u6E38\u620F", children: [
3373
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "aria-hidden": !0, children: "\u21BB" }),
3374
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("b", { children: "\u5237\u65B0" })
3671
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
3672
+ pending && !building && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", onClick: reload, children: "\u8F7D\u5165\u65B0\u7248\u672C" }),
3673
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { className: "oh-game-reload", type: "button", onClick: refresh, "aria-label": "\u91CD\u65B0\u8F7D\u5165\u6E38\u620F", children: [
3674
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { "aria-hidden": !0, children: "\u21BB" }),
3675
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: "\u5237\u65B0" })
3375
3676
  ] }),
3376
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { ref: fullscreenButtonRef, type: "button", onClick: () => {
3677
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { ref: fullscreenButtonRef, type: "button", onClick: () => {
3377
3678
  let shell = shellRef.current;
3378
3679
  shell !== null && (restoreFullscreenFocus.current = !0, shell.requestFullscreen().catch(() => {
3379
3680
  restoreFullscreenFocus.current = !1;
@@ -3381,10 +3682,10 @@ function GamePreview({ project, building }) {
3381
3682
  }, children: "\u5168\u5C4F\u8BD5\u73A9" })
3382
3683
  ] })
3383
3684
  ] }),
3384
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PreviewProbe, { href: preview.href, onFailed: () => {
3685
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PreviewProbe, { href: preview.href, onFailed: () => {
3385
3686
  setLoaded(!1), setLoadError(!0);
3386
3687
  } }),
3387
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
3688
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3388
3689
  "iframe",
3389
3690
  {
3390
3691
  src: preview.href,
@@ -3408,7 +3709,7 @@ function GamePreview({ project, building }) {
3408
3709
  },
3409
3710
  `${project.id}:${loadedVersion}:${String(revision)}`
3410
3711
  ),
3411
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-game-focus-hint", "data-focused": focused || void 0, children: focused ? "\u6E38\u620F\u6B63\u5728\u63A5\u6536\u952E\u9F20\u8F93\u5165" : "\u70B9\u51FB\u753B\u9762\u8FDB\u5165\u8BD5\u73A9" })
3712
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-game-focus-hint", "data-focused": focused || void 0, children: focused ? "\u6E38\u620F\u6B63\u5728\u63A5\u6536\u952E\u9F20\u8F93\u5165" : "\u70B9\u51FB\u753B\u9762\u8FDB\u5165\u8BD5\u73A9" })
3412
3713
  ] });
3413
3714
  }
3414
3715
  function GameDesign({
@@ -3418,10 +3719,10 @@ function GameDesign({
3418
3719
  sessionId,
3419
3720
  onSelect
3420
3721
  }) {
3421
- let documents = (0, import_react3.useMemo)(() => files.filter((file) => file.path.startsWith(`${project.root}/`) && /\.(?:md|txt|json|jsonl|html|css|[cm]?js|tsx?|jsx)$/iu.test(file.path)), [files, project.root]), preferred = selected !== void 0 && documents.some((file) => file.path === selected) ? selected : documents.find((file) => file.path === `${project.root}/PRODUCT_BRIEF.md`)?.path ?? documents[0]?.path, [path, setPath] = (0, import_react3.useState)(preferred), [content, setContent] = (0, import_react3.useState)(), [error, setError] = (0, import_react3.useState)();
3422
- if ((0, import_react3.useEffect)(() => {
3722
+ let documents = (0, import_react4.useMemo)(() => files.filter((file) => file.path.startsWith(`${project.root}/`) && /\.(?:md|txt|json|jsonl|html|css|[cm]?js|tsx?|jsx)$/iu.test(file.path)), [files, project.root]), preferred = selected !== void 0 && documents.some((file) => file.path === selected) ? selected : documents.find((file) => file.path === `${project.root}/PRODUCT_BRIEF.md`)?.path ?? documents[0]?.path, [path, setPath] = (0, import_react4.useState)(preferred), [content, setContent] = (0, import_react4.useState)(), [error, setError] = (0, import_react4.useState)();
3723
+ if ((0, import_react4.useEffect)(() => {
3423
3724
  setPath(preferred);
3424
- }, [preferred, project.id]), (0, import_react3.useEffect)(() => {
3725
+ }, [preferred, project.id]), (0, import_react4.useEffect)(() => {
3425
3726
  if (path === void 0 || project.source === "example") {
3426
3727
  setContent(void 0);
3427
3728
  return;
@@ -3434,21 +3735,21 @@ function GameDesign({
3434
3735
  }), () => {
3435
3736
  controller.abort();
3436
3737
  };
3437
- }, [path, project.source, sessionId]), project.source === "example") return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-game-design-empty", children: [
3438
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "\u5185\u7F6E\u5B8C\u6574\u793A\u4F8B" }),
3439
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: "\u300A\u91D1\u74F6\u6885 \xB7 \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" }),
3440
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "novel-to-game/examples/jin-ping-mei" })
3738
+ }, [path, project.source, sessionId]), project.source === "example") return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-game-design-empty", children: [
3739
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("strong", { children: "\u5185\u7F6E\u5B8C\u6574\u793A\u4F8B" }),
3740
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: "\u300A\u91D1\u74F6\u6885 \xB7 \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" }),
3741
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("code", { children: "novel-to-game/examples/jin-ping-mei" })
3441
3742
  ] });
3442
- if (documents.length === 0 || path === void 0) return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-game-design-empty", children: "\u5F53\u524D\u9879\u76EE\u8FD8\u6CA1\u6709\u53EF\u68C0\u67E5\u7684\u8BBE\u8BA1\u6216\u6E90\u6587\u4EF6\u3002" });
3743
+ if (documents.length === 0 || path === void 0) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-game-design-empty", children: "\u5F53\u524D\u9879\u76EE\u8FD8\u6CA1\u6709\u53EF\u68C0\u67E5\u7684\u8BBE\u8BA1\u6216\u6E90\u6587\u4EF6\u3002" });
3443
3744
  let markdown = path.toLocaleLowerCase().endsWith(".md");
3444
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-game-design", children: [
3445
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { children: [
3745
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-game-design", children: [
3746
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { children: [
3446
3747
  "\u9879\u76EE\u6587\u4EF6",
3447
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("select", { value: path, onChange: (event) => {
3748
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("select", { value: path, onChange: (event) => {
3448
3749
  setPath(event.target.value), onSelect(event.target.value);
3449
- }, children: documents.map((file) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: file.path, children: file.path.slice(project.root.length + 1) }, file.path)) })
3750
+ }, children: documents.map((file) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: file.path, children: file.path.slice(project.root.length + 1) }, file.path)) })
3450
3751
  ] }),
3451
- error !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-story-error", children: error }) : content === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-game-design-empty", children: "\u6B63\u5728\u8F7D\u5165\u6587\u4EF6\u2026" }) : markdown ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(MarkdownPreview, { content, label: path }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("pre", { className: "oh-game-source", "aria-label": `${path} \u6E90\u7801`, children: content })
3752
+ error !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-story-error", children: error }) : content === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-game-design-empty", children: "\u6B63\u5728\u8F7D\u5165\u6587\u4EF6\u2026" }) : markdown ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MarkdownPreview, { content, label: path }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("pre", { className: "oh-game-source", "aria-label": `${path} \u6E90\u7801`, children: content })
3452
3753
  ] });
3453
3754
  }
3454
3755
  function GameStudio({
@@ -3468,8 +3769,8 @@ function GameStudio({
3468
3769
  onCollapse,
3469
3770
  onSelect
3470
3771
  }) {
3471
- let project = workspace.games.find((value) => value.id === gameProjectId) ?? workspace.games[0], studioRef = (0, import_react3.useRef)(null), tabsId = (0, import_react3.useId)();
3472
- if ((0, import_react3.useLayoutEffect)(() => {
3772
+ let project = workspace.games.find((value) => value.id === gameProjectId) ?? workspace.games[0], studioRef = (0, import_react4.useRef)(null), tabsId = (0, import_react4.useId)();
3773
+ if ((0, import_react4.useLayoutEffect)(() => {
3473
3774
  let studio = studioRef.current;
3474
3775
  if (studio === null) return;
3475
3776
  let publishWidth = () => {
@@ -3480,14 +3781,14 @@ function GameStudio({
3480
3781
  return observer.observe(studio), () => {
3481
3782
  observer.disconnect();
3482
3783
  };
3483
- }, []), (0, import_react3.useEffect)(() => {
3784
+ }, []), (0, import_react4.useEffect)(() => {
3484
3785
  project !== void 0 && project.id !== gameProjectId && onGameProject(project.id);
3485
- }, [gameProjectId, onGameProject, project]), project === void 0) return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("main", { ref: studioRef, id: paneId, className: "oh-game-studio", role: "tabpanel", "aria-labelledby": labelledBy, hidden, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-game-design-empty", children: "\u6E38\u620F\u80FD\u529B\u6B63\u5728\u8F7D\u5165\u2026" }) });
3786
+ }, [gameProjectId, onGameProject, project]), project === void 0) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("main", { ref: studioRef, id: paneId, className: "oh-game-studio", role: "tabpanel", "aria-labelledby": labelledBy, hidden, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-game-design-empty", children: "\u6E38\u620F\u80FD\u529B\u6B63\u5728\u8F7D\u5165\u2026" }) });
3486
3787
  let tabs = ["preview", "design"];
3487
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("main", { ref: studioRef, id: paneId, className: "oh-game-studio", "data-source": project.source, role: "tabpanel", "aria-labelledby": labelledBy, hidden, children: [
3488
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("header", { className: "oh-game-toolbar", children: [
3489
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-workbench-cluster", children: [
3490
- workbenches.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-game-mode-tabs", role: "tablist", "aria-label": "\u521B\u4F5C\u5DE5\u4F5C\u53F0", children: workbenches.map((mode) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
3788
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("main", { ref: studioRef, id: paneId, className: "oh-game-studio", "data-source": project.source, role: "tabpanel", "aria-labelledby": labelledBy, hidden, children: [
3789
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("header", { className: "oh-game-toolbar", children: [
3790
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-workbench-cluster", children: [
3791
+ workbenches.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-game-mode-tabs", role: "tablist", "aria-label": "\u521B\u4F5C\u5DE5\u4F5C\u53F0", children: workbenches.map((mode) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3491
3792
  "button",
3492
3793
  {
3493
3794
  type: "button",
@@ -3504,18 +3805,18 @@ function GameStudio({
3504
3805
  },
3505
3806
  mode
3506
3807
  )) }),
3507
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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, children: "\xD7" })
3808
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("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, children: "\xD7" })
3508
3809
  ] }),
3509
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { className: "oh-game-project", title: "\u5207\u6362\u9879\u76EE\u5C06\u91CD\u65B0\u8F7D\u5165\u8BD5\u73A9", children: [
3510
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u6E38\u620F\u9879\u76EE" }),
3511
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("select", { "aria-label": "\u6E38\u620F\u9879\u76EE\uFF1B\u5207\u6362\u5C06\u91CD\u65B0\u8F7D\u5165\u8BD5\u73A9", value: project.id, onChange: (event) => {
3810
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { className: "oh-game-project", title: "\u5207\u6362\u9879\u76EE\u5C06\u91CD\u65B0\u8F7D\u5165\u8BD5\u73A9", children: [
3811
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u6E38\u620F\u9879\u76EE" }),
3812
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("select", { "aria-label": "\u6E38\u620F\u9879\u76EE\uFF1B\u5207\u6362\u5C06\u91CD\u65B0\u8F7D\u5165\u8BD5\u73A9", value: project.id, onChange: (event) => {
3512
3813
  onGameProject(event.target.value);
3513
3814
  }, children: [
3514
- workspace.games.some((item) => item.source === "workspace") && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("optgroup", { label: "\u6211\u7684\u9879\u76EE", children: workspace.games.filter((item) => item.source === "workspace").map((item) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: item.id, children: `\u6211\u7684\u9879\u76EE \xB7 ${item.title}` }, item.id)) }),
3515
- workspace.games.some((item) => item.source === "example") && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("optgroup", { label: "\u5185\u7F6E\u793A\u4F8B", children: workspace.games.filter((item) => item.source === "example").map((item) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: item.id, children: `\u5185\u7F6E\u793A\u4F8B \xB7 ${item.title}` }, item.id)) })
3815
+ workspace.games.some((item) => item.source === "workspace") && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("optgroup", { label: "\u6211\u7684\u9879\u76EE", children: workspace.games.filter((item) => item.source === "workspace").map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: item.id, children: `\u6211\u7684\u9879\u76EE \xB7 ${item.title}` }, item.id)) }),
3816
+ workspace.games.some((item) => item.source === "example") && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("optgroup", { label: "\u5185\u7F6E\u793A\u4F8B", children: workspace.games.filter((item) => item.source === "example").map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: item.id, children: `\u5185\u7F6E\u793A\u4F8B \xB7 ${item.title}` }, item.id)) })
3516
3817
  ] })
3517
3818
  ] }),
3518
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-game-tabs", role: "tablist", "aria-label": "\u6E38\u620F\u5DE5\u4F5C\u53F0", children: tabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
3819
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-game-tabs", role: "tablist", "aria-label": "\u6E38\u620F\u5DE5\u4F5C\u53F0", children: tabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3519
3820
  "button",
3520
3821
  {
3521
3822
  type: "button",
@@ -3535,9 +3836,9 @@ function GameStudio({
3535
3836
  tab
3536
3837
  )) })
3537
3838
  ] }),
3538
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-game-panels", children: [
3539
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-game-panel", role: "tabpanel", id: `${tabsId}-preview-panel`, "aria-labelledby": `${tabsId}-preview-tab`, hidden: gameTab !== "preview", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GamePreview, { project, building }, `${project.id}:${String(project.previewReady)}`) }),
3540
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-game-panel", role: "tabpanel", id: `${tabsId}-design-panel`, "aria-labelledby": `${tabsId}-design-tab`, hidden: gameTab !== "design", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GameDesign, { project, files: workspace.files, selected, sessionId, onSelect }) })
3839
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-game-panels", children: [
3840
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-game-panel", role: "tabpanel", id: `${tabsId}-preview-panel`, "aria-labelledby": `${tabsId}-preview-tab`, hidden: gameTab !== "preview", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(GamePreview, { project, building }, `${project.id}:${String(project.previewReady)}`) }),
3841
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-game-panel", role: "tabpanel", id: `${tabsId}-design-panel`, "aria-labelledby": `${tabsId}-design-tab`, hidden: gameTab !== "design", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(GameDesign, { project, files: workspace.files, selected, sessionId, onSelect }) })
3541
3842
  ] })
3542
3843
  ] });
3543
3844
  }
@@ -3565,26 +3866,26 @@ function CreativeWorkbench({
3565
3866
  useStore,
3566
3867
  actions
3567
3868
  }) {
3568
- let activities = (0, import_react3.useMemo)(
3869
+ let activities = (0, import_react4.useMemo)(
3569
3870
  () => fileMutations(runningCalls, partial, undispatched),
3570
3871
  [partial, runningCalls, undispatched]
3571
- ), normalizedActivities = (0, import_react3.useMemo)(() => activities.flatMap((activity2) => {
3872
+ ), normalizedActivities = (0, import_react4.useMemo)(() => activities.flatMap((activity2) => {
3572
3873
  let path = creativeRelativePath(activity2.path, workspace?.cwd);
3573
3874
  return path === void 0 ? [] : [{ activity: activity2, path }];
3574
- }), [activities, workspace?.cwd]), primaryActivity = normalizedActivities.at(-1), activityPaths = (0, import_react3.useMemo)(() => new Set(normalizedActivities.map((value) => value.path)), [normalizedActivities]), settledPath = settledMutation === void 0 ? void 0 : creativeRelativePath(settledMutation.slice(settledMutation.indexOf("\0") + 1), workspace?.cwd), activity = primaryActivity?.activity, activityPath = primaryActivity?.path, workbench = useStore((memory) => memory.workbench), setWorkbench = actions.setWorkbench, gameTab = useStore((memory) => memory.gameTab), setGameTab = actions.setGameTab, gameProjectId = useStore((memory) => memory.gameProjectId), setGameProjectId = actions.setGameProjectId, gamePane = useStore((memory) => memory.gamePane), setGamePane = actions.setGamePane, videoTab = useStore((memory) => memory.videoTab), setVideoTab = actions.setVideoTab, videoProjectId = useStore((memory) => memory.videoProjectId), setVideoProjectId = actions.setVideoProjectId, videoPane = useStore((memory) => memory.videoPane), setVideoPane = actions.setVideoPane, selected = useStore((memory) => memory.selected), setSelected = actions.setSelected, buffers = useStore((memory) => memory.buffers), setBuffers = actions.setBuffers, buffersRef = (0, import_react3.useRef)({}), expanded = useStore((memory) => memory.expanded), setExpanded = actions.setExpanded, productionSection = useStore((memory) => memory.productionSection), setProductionSection = actions.setProductionSection, productionSelectedIds = useStore((memory) => memory.productionSelectedIds), productionJobsByEpisode = useStore((memory) => memory.productionJobs), productionSelectionsByEpisode = useStore((memory) => memory.productionSelections), productionReferencesByEpisode = useStore((memory) => memory.productionReferences), productionSequenceByEpisode = useStore((memory) => memory.productionSequence), productionCanvasByEpisode = useStore((memory) => memory.productionCanvas), productionZoomByEpisode = useStore((memory) => memory.productionZoom), productionIntentCalls = useStore((memory) => memory.productionIntentCalls), surfaceRef = (0, import_react3.useRef)(null), setWorkbenchPreference = actions.setWorkbenchPreference, applyWorkbenchPreference = (0, import_react3.useCallback)((preference) => {
3875
+ }), [activities, workspace?.cwd]), primaryActivity = normalizedActivities.at(-1), activityPaths = (0, import_react4.useMemo)(() => new Set(normalizedActivities.map((value) => value.path)), [normalizedActivities]), settledPath = settledMutation === void 0 ? void 0 : creativeRelativePath(settledMutation.slice(settledMutation.indexOf("\0") + 1), workspace?.cwd), activity = primaryActivity?.activity, activityPath = primaryActivity?.path, workbench = useStore((memory) => memory.workbench), setWorkbench = actions.setWorkbench, gameTab = useStore((memory) => memory.gameTab), setGameTab = actions.setGameTab, gameProjectId = useStore((memory) => memory.gameProjectId), setGameProjectId = actions.setGameProjectId, gamePane = useStore((memory) => memory.gamePane), setGamePane = actions.setGamePane, videoTab = useStore((memory) => memory.videoTab), setVideoTab = actions.setVideoTab, videoProjectId = useStore((memory) => memory.videoProjectId), setVideoProjectId = actions.setVideoProjectId, videoPane = useStore((memory) => memory.videoPane), setVideoPane = actions.setVideoPane, selected = useStore((memory) => memory.selected), setSelected = actions.setSelected, buffers = useStore((memory) => memory.buffers), setBuffers = actions.setBuffers, buffersRef = (0, import_react4.useRef)({}), expanded = useStore((memory) => memory.expanded), setExpanded = actions.setExpanded, productionSection = useStore((memory) => memory.productionSection), setProductionSection = actions.setProductionSection, productionSelectedIds = useStore((memory) => memory.productionSelectedIds), productionJobsByEpisode = useStore((memory) => memory.productionJobs), productionSelectionsByEpisode = useStore((memory) => memory.productionSelections), productionReferencesByEpisode = useStore((memory) => memory.productionReferences), productionSequenceByEpisode = useStore((memory) => memory.productionSequence), productionCanvasByEpisode = useStore((memory) => memory.productionCanvas), productionViewportByEpisode = useStore((memory) => memory.productionViewport), productionIntentCalls = useStore((memory) => memory.productionIntentCalls), surfaceRef = (0, import_react4.useRef)(null), setWorkbenchPreference = actions.setWorkbenchPreference, applyWorkbenchPreference = (0, import_react4.useCallback)((preference) => {
3575
3876
  setWorkbenchPreference(preference), writeWorkbenchPreference(workbenchPreferenceStorage(), workspace?.cwd, preference);
3576
- }, [setWorkbenchPreference, workspace?.cwd]), compactTabsId = (0, import_react3.useId)(), compactStudioId = `${compactTabsId}-studio-panel`, compactVideoStudioId = `${compactTabsId}-video-studio-panel`, compactChatId = `${compactTabsId}-chat-panel`, navRef = (0, import_react3.useRef)(null), activityBases = (0, import_react3.useRef)(/* @__PURE__ */ new Map()), previousSignals = (0, import_react3.useRef)(/* @__PURE__ */ new Set()), consumedSettledMutation = useStore((memory) => memory.settledMutation), liveTurns = (0, import_react3.useRef)(/* @__PURE__ */ new Set());
3877
+ }, [setWorkbenchPreference, workspace?.cwd]), compactTabsId = (0, import_react4.useId)(), compactStudioId = `${compactTabsId}-studio-panel`, compactVideoStudioId = `${compactTabsId}-video-studio-panel`, compactChatId = `${compactTabsId}-chat-panel`, navRef = (0, import_react4.useRef)(null), activityBases = (0, import_react4.useRef)(/* @__PURE__ */ new Map()), previousSignals = (0, import_react4.useRef)(/* @__PURE__ */ new Set()), consumedSettledMutation = useStore((memory) => memory.settledMutation), liveTurns = (0, import_react4.useRef)(/* @__PURE__ */ new Set());
3577
3878
  liveTurn !== void 0 && liveTurns.current.add(liveTurn);
3578
- let saveLocks = (0, import_react3.useRef)(/* @__PURE__ */ new Set()), buffer = selected === void 0 ? void 0 : buffers[selected], selectedFile = workspace?.files.find((file) => file.path === selected), selectedMedia = selectedFile?.kind === "media", dirty = buffer?.source === "human" && buffer.content !== buffer.saved, saving = buffer?.saving === !0, fileError = buffer?.error, conflict = buffer?.conflict, selectedLower = selected?.toLocaleLowerCase(), markdown = selectedLower?.endsWith(".md") === !0, jsonl = selectedLower?.endsWith(".jsonl") === !0, structured = jsonl || selectedLower?.endsWith(".json") === !0, previewable = markdown || jsonl, episodeDirectory = episodeDirectoryForPath(selected), productionAvailable = selected !== void 0 && isCreatorDocumentPath(selected) && episodeDirectory !== void 0, editorModes = productionAvailable ? EDITOR_MODES : EDITOR_MODES.filter((mode) => mode !== "production"), episodeDocumentPaths = (0, import_react3.useMemo)(
3879
+ let saveLocks = (0, import_react4.useRef)(/* @__PURE__ */ new Set()), buffer = selected === void 0 ? void 0 : buffers[selected], selectedFile = workspace?.files.find((file) => file.path === selected), selectedMedia = selectedFile?.kind === "media", dirty = buffer?.source === "human" && buffer.content !== buffer.saved, saving = buffer?.saving === !0, fileError = buffer?.error, conflict = buffer?.conflict, selectedLower = selected?.toLocaleLowerCase(), markdown = selectedLower?.endsWith(".md") === !0, jsonl = selectedLower?.endsWith(".jsonl") === !0, structured = jsonl || selectedLower?.endsWith(".json") === !0, previewable = markdown || jsonl, episodeDirectory = episodeDirectoryForPath(selected), productionAvailable = selected !== void 0 && isCreatorDocumentPath(selected) && episodeDirectory !== void 0, editorModes = productionAvailable ? EDITOR_MODES : EDITOR_MODES.filter((mode) => mode !== "production"), episodeDocumentPaths = (0, import_react4.useMemo)(
3579
3880
  () => episodeDirectory === void 0 ? [] : creatorDocumentPaths(workspace?.files.filter((file) => file.kind === "text") ?? [], episodeDirectory),
3580
3881
  [episodeDirectory, workspace?.files]
3581
- ), episodeDocuments = (0, import_react3.useMemo)(() => Object.fromEntries(episodeDocumentPaths.flatMap((path) => {
3882
+ ), episodeDocuments = (0, import_react4.useMemo)(() => Object.fromEntries(episodeDocumentPaths.flatMap((path) => {
3582
3883
  let current = buffers[path];
3583
3884
  return current === void 0 || current.missing === !0 ? [] : [[path, current.content]];
3584
- })), [buffers, episodeDocumentPaths]), episodeProduction = (0, import_react3.useMemo)(
3885
+ })), [buffers, episodeDocumentPaths]), episodeProduction = (0, import_react4.useMemo)(
3585
3886
  () => episodeDirectory === void 0 ? void 0 : parseEpisodeProduction(episodeDocuments, episodeDirectory),
3586
3887
  [episodeDirectory, episodeDocuments]
3587
- ), productionLibrary = (0, import_react3.useMemo)(() => (workspace?.files ?? []).flatMap((file) => {
3888
+ ), productionLibrary = (0, import_react4.useMemo)(() => (workspace?.files ?? []).flatMap((file) => {
3588
3889
  if (file.kind !== "media" || file.mimeType?.startsWith("audio/") === !0) return [];
3589
3890
  if (!file.path.startsWith("\u5267\u96C6/") && !file.path.startsWith("\u4EA4\u4ED8/")) return [];
3590
3891
  let targetId = file.path.toLocaleUpperCase().match(/(?:SHOT|IMG|MOTION|VISUAL)-[A-Z0-9-]+/u)?.[0] ?? file.path.split("/").at(-2) ?? "PROJECT-MEDIA";
@@ -3595,7 +3896,7 @@ function CreativeWorkbench({
3595
3896
  url: endpoint("media", sessionId, file.path),
3596
3897
  path: file.path
3597
3898
  }];
3598
- }), [sessionId, workspace?.files]), productionVersions = (0, import_react3.useMemo)(() => {
3899
+ }), [sessionId, workspace?.files]), productionVersions = (0, import_react4.useMemo)(() => {
3599
3900
  if (episodeProduction === void 0) return [];
3600
3901
  let episodeName = episodeProduction.episodeDirectory.split("/").at(-1) ?? "", knownTargets = [
3601
3902
  ...episodeProduction.shots.map((shot) => shot.id),
@@ -3611,25 +3912,25 @@ function CreativeWorkbench({
3611
3912
  }), byId = /* @__PURE__ */ new Map();
3612
3913
  for (let version of fromWorkspace) byId.set(version.id, version);
3613
3914
  return [...byId.values()];
3614
- }, [episodeProduction, productionLibrary]), productionSelectedId = episodeDirectory === void 0 ? void 0 : productionSelectedIds[episodeDirectory], productionJobs = episodeDirectory === void 0 ? [] : productionJobsByEpisode[episodeDirectory] ?? [], productionSelections = episodeDirectory === void 0 ? {} : productionSelectionsByEpisode[episodeDirectory] ?? {}, productionReferences = episodeDirectory === void 0 ? {} : productionReferencesByEpisode[episodeDirectory] ?? {}, productionSequence = episodeDirectory === void 0 ? [] : productionSequenceByEpisode[episodeDirectory] ?? [], productionCanvas = episodeDirectory === void 0 ? {} : productionCanvasByEpisode[episodeDirectory] ?? {}, productionZoom = episodeDirectory === void 0 ? 0.65 : productionZoomByEpisode[episodeDirectory] ?? 0.65, setProductionSelectedId = (0, import_react3.useCallback)((selectedId) => {
3915
+ }, [episodeProduction, productionLibrary]), productionSelectedId = episodeDirectory === void 0 ? void 0 : productionSelectedIds[episodeDirectory], productionJobs = episodeDirectory === void 0 ? [] : productionJobsByEpisode[episodeDirectory] ?? [], productionSelections = episodeDirectory === void 0 ? {} : productionSelectionsByEpisode[episodeDirectory] ?? {}, productionReferences = episodeDirectory === void 0 ? {} : productionReferencesByEpisode[episodeDirectory] ?? {}, productionSequence = episodeDirectory === void 0 ? [] : productionSequenceByEpisode[episodeDirectory] ?? [], productionCanvas = episodeDirectory === void 0 ? {} : productionCanvasByEpisode[episodeDirectory] ?? {}, productionViewport = episodeDirectory === void 0 ? void 0 : productionViewportByEpisode[episodeDirectory], setProductionSelectedId = (0, import_react4.useCallback)((selectedId) => {
3615
3916
  episodeDirectory !== void 0 && actions.setProductionSelectedIds((current) => ({ ...current, [episodeDirectory]: selectedId }));
3616
- }, [actions, episodeDirectory]), setProductionJobs = (0, import_react3.useCallback)((jobs) => {
3917
+ }, [actions, episodeDirectory]), setProductionJobs = (0, import_react4.useCallback)((jobs) => {
3617
3918
  episodeDirectory !== void 0 && actions.setProductionJobs((current) => ({ ...current, [episodeDirectory]: jobs }));
3618
- }, [actions, episodeDirectory]), setProductionSelections = (0, import_react3.useCallback)((selections) => {
3919
+ }, [actions, episodeDirectory]), setProductionSelections = (0, import_react4.useCallback)((selections) => {
3619
3920
  episodeDirectory !== void 0 && actions.setProductionSelections((current) => ({ ...current, [episodeDirectory]: selections }));
3620
- }, [actions, episodeDirectory]), setProductionReferences = (0, import_react3.useCallback)((references) => {
3921
+ }, [actions, episodeDirectory]), setProductionReferences = (0, import_react4.useCallback)((references) => {
3621
3922
  episodeDirectory !== void 0 && actions.setProductionReferences((current) => ({ ...current, [episodeDirectory]: references }));
3622
- }, [actions, episodeDirectory]), setProductionSequence = (0, import_react3.useCallback)((sequence) => {
3923
+ }, [actions, episodeDirectory]), setProductionSequence = (0, import_react4.useCallback)((sequence) => {
3623
3924
  episodeDirectory !== void 0 && actions.setProductionSequence((current) => ({ ...current, [episodeDirectory]: sequence }));
3624
- }, [actions, episodeDirectory]), setProductionCanvas = (0, import_react3.useCallback)((canvas) => {
3925
+ }, [actions, episodeDirectory]), setProductionCanvas = (0, import_react4.useCallback)((canvas) => {
3625
3926
  episodeDirectory !== void 0 && actions.setProductionCanvas((current) => ({ ...current, [episodeDirectory]: canvas }));
3626
- }, [actions, episodeDirectory]), setProductionZoom = (0, import_react3.useCallback)((zoom) => {
3627
- episodeDirectory !== void 0 && actions.setProductionZoom((current) => ({ ...current, [episodeDirectory]: zoom }));
3628
- }, [actions, episodeDirectory]), editorMode = useStore((memory) => memory.editorMode), setEditorMode = actions.setEditorMode, modeSelection = (0, import_react3.useRef)(selected), textareaRef = (0, import_react3.useRef)(null), editorPositions = (0, import_react3.useRef)(/* @__PURE__ */ new Map()), editorReady = buffer !== void 0 && buffer.missing !== !0, workspaceKind = workbench === "game" || workbench === "video" ? void 0 : workbench, gameBuilding = normalizedActivities.some(({ path }) => path.startsWith("game-adaptations/")), videoBuilding = normalizedActivities.some(({ path }) => path.startsWith("video-recaps/"));
3629
- (0, import_react3.useEffect)(() => {
3927
+ }, [actions, episodeDirectory]), setProductionViewport = (0, import_react4.useCallback)((viewport) => {
3928
+ episodeDirectory !== void 0 && actions.setProductionViewport((current) => ({ ...current, [episodeDirectory]: viewport }));
3929
+ }, [actions, episodeDirectory]), editorMode = useStore((memory) => memory.editorMode), setEditorMode = actions.setEditorMode, modeSelection = (0, import_react4.useRef)(selected), textareaRef = (0, import_react4.useRef)(null), editorPositions = (0, import_react4.useRef)(/* @__PURE__ */ new Map()), editorReady = buffer !== void 0 && buffer.missing !== !0, workspaceKind = workbench === "game" || workbench === "video" ? void 0 : workbench, gameBuilding = normalizedActivities.some(({ path }) => path.startsWith("game-adaptations/")), videoBuilding = normalizedActivities.some(({ path }) => path.startsWith("video-recaps/"));
3930
+ (0, import_react4.useEffect)(() => {
3630
3931
  buffersRef.current = buffers;
3631
3932
  }, [buffers]);
3632
- let rememberEditorPosition = (0, import_react3.useCallback)(() => {
3933
+ let rememberEditorPosition = (0, import_react4.useCallback)(() => {
3633
3934
  let element = textareaRef.current;
3634
3935
  element === null || selected === void 0 || element.getAttribute("aria-label") !== selected || editorPositions.current.set(selected, {
3635
3936
  scrollTop: element.scrollTop,
@@ -3637,13 +3938,13 @@ function CreativeWorkbench({
3637
3938
  selectionEnd: element.selectionEnd
3638
3939
  });
3639
3940
  }, [selected]);
3640
- (0, import_react3.useLayoutEffect)(() => {
3941
+ (0, import_react4.useLayoutEffect)(() => {
3641
3942
  if (editorMode !== "source" || selected === void 0 || !editorReady) return;
3642
3943
  let element = textareaRef.current, position = editorPositions.current.get(selected);
3643
3944
  if (element === null || position === void 0) return;
3644
3945
  let end = Math.min(position.selectionEnd, element.value.length);
3645
3946
  element.setSelectionRange(Math.min(position.selectionStart, end), end), element.scrollTop = position.scrollTop;
3646
- }, [editorMode, editorReady, selected]), (0, import_react3.useEffect)(() => {
3947
+ }, [editorMode, editorReady, selected]), (0, import_react4.useEffect)(() => {
3647
3948
  let warn = (event) => {
3648
3949
  Object.values(buffersRef.current).some((value) => value.source === "human" && value.content !== value.saved) && event.preventDefault();
3649
3950
  };
@@ -3651,7 +3952,7 @@ function CreativeWorkbench({
3651
3952
  globalThis.removeEventListener("beforeunload", warn);
3652
3953
  };
3653
3954
  }, []);
3654
- let expandPath = (0, import_react3.useCallback)((path) => {
3955
+ let expandPath = (0, import_react4.useCallback)((path) => {
3655
3956
  let segments = path.split("/"), ancestors = [groupForPath(path)];
3656
3957
  for (let index = 1; index < segments.length - 1; index += 1) ancestors.push(segments.slice(0, index + 1).join("/"));
3657
3958
  setExpanded((current) => {
@@ -3659,12 +3960,12 @@ function CreativeWorkbench({
3659
3960
  for (let ancestor of ancestors) next[ancestor] = !0;
3660
3961
  return next;
3661
3962
  });
3662
- }, []), revealPath = (0, import_react3.useCallback)((path) => {
3963
+ }, []), revealPath = (0, import_react4.useCallback)((path) => {
3663
3964
  rememberEditorPosition();
3664
3965
  let nextWorkbench = workbenchModeForPath(path) ?? "story";
3665
3966
  setWorkbench(nextWorkbench), nextWorkbench === "game" && !path.includes("/build/app/") && setGameTab("design"), setSelected(path), expandPath(path);
3666
3967
  }, [expandPath, rememberEditorPosition]);
3667
- (0, import_react3.useEffect)(() => {
3968
+ (0, import_react4.useEffect)(() => {
3668
3969
  if (workspace === void 0) return;
3669
3970
  let pending = productionIntents.filter(({ callId }) => productionIntentCalls[callId] !== !0);
3670
3971
  if (pending.length !== 0) {
@@ -3722,22 +4023,22 @@ function CreativeWorkbench({
3722
4023
  }));
3723
4024
  }
3724
4025
  }, [actions, expandPath, productionIntentCalls, productionIntents, setEditorMode, setProductionSection, setSelected, setWorkbench, workspace]);
3725
- let openedGame = (0, import_react3.useRef)(!1);
4026
+ let openedGame = (0, import_react4.useRef)(!1);
3726
4027
  workbench === "game" && (openedGame.current = !0);
3727
- let gameStudioMounted = openedGame.current, openedVideo = (0, import_react3.useRef)(!1);
4028
+ let gameStudioMounted = openedGame.current, openedVideo = (0, import_react4.useRef)(!1);
3728
4029
  workbench === "video" && (openedVideo.current = !0);
3729
- let videoStudioMounted = openedVideo.current, followAgentPath = (0, import_react3.useCallback)((path) => {
4030
+ let videoStudioMounted = openedVideo.current, followAgentPath = (0, import_react4.useCallback)((path) => {
3730
4031
  expandPath(path);
3731
4032
  let current = selected === void 0 ? void 0 : buffersRef.current[selected];
3732
4033
  path !== selected && current?.source === "human" && current.content !== current.saved && surfaceRef.current?.ownerDocument.activeElement === textareaRef.current || workbench === "game" && gameTab === "preview" || workbench === "video" && videoTab === "preview" || revealPath(path);
3733
4034
  }, [expandPath, gameTab, revealPath, selected, videoTab, workbench]);
3734
- (0, import_react3.useEffect)(() => {
4035
+ (0, import_react4.useEffect)(() => {
3735
4036
  activityPath !== void 0 && activityPath === selected && !selectedMedia && setEditorMode("source");
3736
- }, [activityPath, selected, selectedMedia]), (0, import_react3.useEffect)(() => {
4037
+ }, [activityPath, selected, selectedMedia]), (0, import_react4.useEffect)(() => {
3737
4038
  modeSelection.current !== selected && (modeSelection.current = selected, setEditorMode(selected !== void 0 && activityPaths.has(selected) ? "source" : selectedMedia || previewable ? "preview" : "source"));
3738
- }, [activityPaths, previewable, selected, selectedMedia]), (0, import_react3.useEffect)(() => {
4039
+ }, [activityPaths, previewable, selected, selectedMedia]), (0, import_react4.useEffect)(() => {
3739
4040
  workspaceLoading || activityPath === void 0 && (selected !== void 0 && ((workspace?.files.some((file) => file.path === selected) ?? !1) || buffers[selected] !== void 0) && workbenchModeForPath(selected) === workbench || setSelected(workspace === void 0 ? void 0 : preferredWorkbenchFile(workspace.files, workbench)));
3740
- }, [activityPath, buffers, selected, workbench, workspace, workspaceLoading]), (0, import_react3.useEffect)(() => {
4041
+ }, [activityPath, buffers, selected, workbench, workspace, workspaceLoading]), (0, import_react4.useEffect)(() => {
3741
4042
  if (workspace === void 0 || workspaceLoading) return;
3742
4043
  let paths = new Set(workspace.files.map((file) => file.path));
3743
4044
  setBuffers((current) => {
@@ -3746,7 +4047,7 @@ function CreativeWorkbench({
3746
4047
  paths.has(path) || activityPaths.has(path) || value.source === "agent" && sessionRunning && path === settledPath || (value.source === "human" && value.content !== value.saved ? value.missing !== !0 && (next[path] = { ...value, missing: !0, 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" }, changed = !0) : (delete next[path], changed = !0));
3747
4048
  return changed ? next : current;
3748
4049
  });
3749
- }, [activityPaths, sessionRunning, settledPath, workspace, workspaceLoading]), (0, import_react3.useEffect)(() => {
4050
+ }, [activityPaths, sessionRunning, settledPath, workspace, workspaceLoading]), (0, import_react4.useEffect)(() => {
3750
4051
  if (selected === void 0 || selectedMedia || activityPaths.has(selected) || !(workspace?.files.some((file) => file.path === selected) ?? !1)) return;
3751
4052
  let controller = new AbortController();
3752
4053
  return setBuffers((current) => {
@@ -3783,7 +4084,7 @@ function CreativeWorkbench({
3783
4084
  }), () => {
3784
4085
  controller.abort();
3785
4086
  };
3786
- }, [activityPaths, selected, selectedMedia, sessionId, workspace?.files]), (0, import_react3.useEffect)(() => {
4087
+ }, [activityPaths, selected, selectedMedia, sessionId, workspace?.files]), (0, import_react4.useEffect)(() => {
3787
4088
  if (!productionAvailable) return;
3788
4089
  let missing = episodeDocumentPaths.filter((path) => buffersRef.current[path] === void 0 && !activityPaths.has(path));
3789
4090
  if (missing.length === 0) return;
@@ -3809,7 +4110,7 @@ function CreativeWorkbench({
3809
4110
  }), () => {
3810
4111
  controller.abort();
3811
4112
  };
3812
- }, [activityPaths, episodeDocumentPaths, productionAvailable, sessionId]), (0, import_react3.useEffect)(() => {
4113
+ }, [activityPaths, episodeDocumentPaths, productionAvailable, sessionId]), (0, import_react4.useEffect)(() => {
3813
4114
  if (normalizedActivities.length !== 0) {
3814
4115
  for (let { path } of normalizedActivities) expandPath(path);
3815
4116
  activityPath !== void 0 && followAgentPath(activityPath), setBuffers((current) => {
@@ -3842,14 +4143,14 @@ function CreativeWorkbench({
3842
4143
  return next;
3843
4144
  });
3844
4145
  }
3845
- }, [activityPath, expandPath, followAgentPath, normalizedActivities]), (0, import_react3.useEffect)(() => {
4146
+ }, [activityPath, expandPath, followAgentPath, normalizedActivities]), (0, import_react4.useEffect)(() => {
3846
4147
  let signals = new Set(mutatingCallIds(runningCalls));
3847
4148
  for (let { activity: currentActivity } of normalizedActivities) signals.add(currentActivity.callId.split(":", 1)[0] ?? currentActivity.callId);
3848
4149
  let settled = [...previousSignals.current].some((callId) => !signals.has(callId));
3849
4150
  for (let callId of activityBases.current.keys())
3850
4151
  signals.has(callId.split(":", 1)[0] ?? callId) || activityBases.current.delete(callId);
3851
4152
  previousSignals.current = signals, settled && reload();
3852
- }, [normalizedActivities, reload, runningCalls]), (0, import_react3.useEffect)(() => {
4153
+ }, [normalizedActivities, reload, runningCalls]), (0, import_react4.useEffect)(() => {
3853
4154
  if (settledMutation === void 0 || settledMutation === consumedSettledMutation) return;
3854
4155
  if (settledMutationTurn === void 0 || !liveTurns.current.has(settledMutationTurn)) {
3855
4156
  actions.setSettledMutation(settledMutation);
@@ -3859,7 +4160,7 @@ function CreativeWorkbench({
3859
4160
  actions.setSettledMutation(settledMutation);
3860
4161
  let path = creativeRelativePath(settledMutation.slice(settledMutation.indexOf("\0") + 1), workspace.cwd);
3861
4162
  path !== void 0 && followAgentPath(path), reload();
3862
- }, [actions, consumedSettledMutation, followAgentPath, reload, settledMutation, settledMutationTurn, workspace?.cwd]), (0, import_react3.useEffect)(() => {
4163
+ }, [actions, consumedSettledMutation, followAgentPath, reload, settledMutation, settledMutationTurn, workspace?.cwd]), (0, import_react4.useEffect)(() => {
3863
4164
  if (selected !== void 0) {
3864
4165
  for (let button of navRef.current?.querySelectorAll("button[data-file-path]") ?? [])
3865
4166
  if (button.dataset.filePath === selected) {
@@ -3867,7 +4168,7 @@ function CreativeWorkbench({
3867
4168
  break;
3868
4169
  }
3869
4170
  }
3870
- }, [selected]), (0, import_react3.useEffect)(() => {
4171
+ }, [selected]), (0, import_react4.useEffect)(() => {
3871
4172
  if (!open || normalizedActivities.length > 0 || workspace === void 0) return;
3872
4173
  let sessionSurface = surfaceRef.current?.parentElement;
3873
4174
  if (sessionSurface == null) return;
@@ -3888,7 +4189,7 @@ function CreativeWorkbench({
3888
4189
  return sessionSurface.addEventListener("click", followOfficialFileLink, !0), () => {
3889
4190
  sessionSurface.removeEventListener("click", followOfficialFileLink, !0);
3890
4191
  };
3891
- }, [normalizedActivities.length, open, revealPath, workspace]), (0, import_react3.useEffect)(() => {
4192
+ }, [normalizedActivities.length, open, revealPath, workspace]), (0, import_react4.useEffect)(() => {
3892
4193
  if (workbench !== "game" && workbench !== "video") return;
3893
4194
  let surface = surfaceRef.current, sessionSurface = surface?.parentElement, chat = Array.from(sessionSurface?.children ?? []).find((child) => child !== surface && child instanceof HTMLElement);
3894
4195
  if (!(chat instanceof HTMLElement)) return;
@@ -3901,7 +4202,7 @@ function CreativeWorkbench({
3901
4202
  chat.id = previous.id, previous.role === null ? chat.removeAttribute("role") : chat.setAttribute("role", previous.role), previous.labelledBy === null ? chat.removeAttribute("aria-labelledby") : chat.setAttribute("aria-labelledby", previous.labelledBy);
3902
4203
  };
3903
4204
  }, [compactChatId, compactTabsId, workbench]);
3904
- let savePath = (0, import_react3.useCallback)(async (path) => {
4205
+ let savePath = (0, import_react4.useCallback)(async (path) => {
3905
4206
  if (saveLocks.current.has(path)) return;
3906
4207
  let submitted = buffersRef.current[path];
3907
4208
  if (!(submitted === void 0 || submitted.missing === !0 || submitted.content === submitted.saved)) {
@@ -3971,7 +4272,7 @@ function CreativeWorkbench({
3971
4272
  }
3972
4273
  }
3973
4274
  }, [reload, sessionId]);
3974
- (0, import_react3.useEffect)(() => {
4275
+ (0, import_react4.useEffect)(() => {
3975
4276
  if (!open) return;
3976
4277
  let saveShortcut = (event) => {
3977
4278
  !(event.metaKey || event.ctrlKey) || event.key.toLocaleLowerCase() !== "s" || (event.preventDefault(), selected !== void 0 && savePath(selected));
@@ -3980,7 +4281,7 @@ function CreativeWorkbench({
3980
4281
  globalThis.removeEventListener("keydown", saveShortcut);
3981
4282
  };
3982
4283
  }, [open, savePath, selected]);
3983
- let groups = (0, import_react3.useMemo)(() => {
4284
+ let groups = (0, import_react4.useMemo)(() => {
3984
4285
  let value = /* @__PURE__ */ new Map(), all = [...workspace?.files ?? []].filter((file) => workbenchModeForPath(file.path) === workbench);
3985
4286
  activityPath !== void 0 && !all.some((file) => file.path === activityPath) && all.push({ path: activityPath, bytes: 0, version: "", kind: "text" }), all.sort((left, right) => left.path.localeCompare(right.path, "zh-Hans-CN"));
3986
4287
  for (let file of all) {
@@ -4017,9 +4318,9 @@ function CreativeWorkbench({
4017
4318
  };
4018
4319
  });
4019
4320
  };
4020
- return open ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { ref: surfaceRef, className: "oh-story-split-surface", "data-open": "true", "data-workbench": workbench, children: [
4021
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("style", { children: plugin_default }),
4022
- (workbench === "game" || workbench === "video") && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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", children: ["studio", "chat"].map((pane) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4321
+ return open ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { ref: surfaceRef, className: "oh-story-split-surface", "data-open": "true", "data-workbench": workbench, children: [
4322
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("style", { children: plugin_default }),
4323
+ (workbench === "game" || workbench === "video") && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("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", children: ["studio", "chat"].map((pane) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4023
4324
  "button",
4024
4325
  {
4025
4326
  type: "button",
@@ -4038,8 +4339,8 @@ function CreativeWorkbench({
4038
4339
  },
4039
4340
  pane
4040
4341
  )) }),
4041
- workbench === "game" && workspace === void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("main", { id: compactStudioId, className: "oh-game-studio", role: "tabpanel", "aria-labelledby": `${compactTabsId}-studio-tab`, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-game-design-empty", children: error ?? "\u6B63\u5728\u8FDE\u63A5\u6E38\u620F\u5DE5\u4F5C\u53F0\u2026" }) }),
4042
- workspace !== void 0 && gameStudioMounted && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4342
+ workbench === "game" && workspace === void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("main", { id: compactStudioId, className: "oh-game-studio", role: "tabpanel", "aria-labelledby": `${compactTabsId}-studio-tab`, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-game-design-empty", children: error ?? "\u6B63\u5728\u8FDE\u63A5\u6E38\u620F\u5DE5\u4F5C\u53F0\u2026" }) }),
4343
+ workspace !== void 0 && gameStudioMounted && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4043
4344
  GameStudio,
4044
4345
  {
4045
4346
  sessionId,
@@ -4061,8 +4362,8 @@ function CreativeWorkbench({
4061
4362
  onSelect: revealPath
4062
4363
  }
4063
4364
  ),
4064
- workbench === "video" && workspace === void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("main", { id: compactVideoStudioId, className: "oh-video-studio", role: "tabpanel", "aria-labelledby": `${compactTabsId}-studio-tab`, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-video-preview-empty", children: error ?? "\u6B63\u5728\u8FDE\u63A5\u89C6\u9891\u5DE5\u4F5C\u53F0\u2026" }) }),
4065
- workspace !== void 0 && videoStudioMounted && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4365
+ workbench === "video" && workspace === void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("main", { id: compactVideoStudioId, className: "oh-video-studio", role: "tabpanel", "aria-labelledby": `${compactTabsId}-studio-tab`, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-video-preview-empty", children: error ?? "\u6B63\u5728\u8FDE\u63A5\u89C6\u9891\u5DE5\u4F5C\u53F0\u2026" }) }),
4366
+ workspace !== void 0 && videoStudioMounted && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4066
4367
  VideoStudio,
4067
4368
  {
4068
4369
  sessionId,
@@ -4082,24 +4383,24 @@ function CreativeWorkbench({
4082
4383
  }
4083
4384
  }
4084
4385
  ),
4085
- workbench !== "game" && workbench !== "video" && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
4086
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("aside", { className: "oh-story-tree", children: [
4087
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-story-brand", children: [
4088
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "oh-story-brand-cluster", children: [
4089
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("strong", { children: [
4386
+ workbench !== "game" && workbench !== "video" && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
4387
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("aside", { className: "oh-story-tree", children: [
4388
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-story-brand", children: [
4389
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "oh-story-brand-cluster", children: [
4390
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("strong", { children: [
4090
4391
  "\u2726 ",
4091
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "Oh Story" })
4392
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "Oh Story" })
4092
4393
  ] }),
4093
- workspaceKind !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "oh-story-kind", children: workspaceKind === "story" ? "\u5C0F\u8BF4" : "\u77ED\u5267" })
4394
+ workspaceKind !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "oh-story-kind", children: workspaceKind === "story" ? "\u5C0F\u8BF4" : "\u77ED\u5267" })
4094
4395
  ] }),
4095
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "oh-story-brand-actions", children: [
4096
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", onClick: reload, title: "\u5237\u65B0", "aria-label": "\u5237\u65B0\u9879\u76EE\u6587\u4EF6", children: "\u21BB" }),
4097
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", onClick: () => {
4396
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "oh-story-brand-actions", children: [
4397
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", onClick: reload, title: "\u5237\u65B0", "aria-label": "\u5237\u65B0\u9879\u76EE\u6587\u4EF6", children: "\u21BB" }),
4398
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", onClick: () => {
4098
4399
  applyWorkbenchPreference("closed");
4099
4400
  }, title: "\u6536\u8D77\u521B\u4F5C\u5DE5\u4F5C\u53F0", "aria-label": "\u6536\u8D77\u521B\u4F5C\u5DE5\u4F5C\u53F0", children: "\xD7" })
4100
4401
  ] })
4101
4402
  ] }),
4102
- workspace !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-story-mode-tabs", role: "tablist", "aria-label": "\u521B\u4F5C\u5DE5\u4F5C\u53F0", children: WORKBENCH_MODES.map((mode) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4403
+ workspace !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-story-mode-tabs", role: "tablist", "aria-label": "\u521B\u4F5C\u5DE5\u4F5C\u53F0", children: WORKBENCH_MODES.map((mode) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4103
4404
  "button",
4104
4405
  {
4105
4406
  type: "button",
@@ -4116,18 +4417,18 @@ function CreativeWorkbench({
4116
4417
  },
4117
4418
  mode
4118
4419
  )) }),
4119
- error !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-story-error", children: error }),
4120
- workspace?.metadataErrors.map((message) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-story-warning", children: message }, message)),
4121
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("nav", { ref: navRef, "aria-label": workbench === "story" ? "\u5C0F\u8BF4\u9879\u76EE\u6587\u4EF6" : "\u77ED\u5267\u9879\u76EE\u6587\u4EF6", children: groups.map(([directory2, files]) => {
4420
+ error !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-story-error", children: error }),
4421
+ workspace?.metadataErrors.map((message) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-story-warning", children: message }, message)),
4422
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("nav", { ref: navRef, "aria-label": workbench === "story" ? "\u5C0F\u8BF4\u9879\u76EE\u6587\u4EF6" : "\u77ED\u5267\u9879\u76EE\u6587\u4EF6", children: groups.map(([directory2, files]) => {
4122
4423
  let groupOpen = selectedGroup === directory2 || expanded[directory2] === !0;
4123
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("details", { className: "oh-story-file-group", open: groupOpen, onToggle: (event) => {
4424
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("details", { className: "oh-story-file-group", open: groupOpen, onToggle: (event) => {
4124
4425
  toggleGroup(directory2, event.currentTarget.open);
4125
4426
  }, children: [
4126
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("summary", { children: [
4427
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("summary", { children: [
4127
4428
  directory2,
4128
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: files.length })
4429
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: files.length })
4129
4430
  ] }),
4130
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4431
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4131
4432
  FileTreeNodes,
4132
4433
  {
4133
4434
  nodes: buildFileTree(files, directory2),
@@ -4142,14 +4443,14 @@ function CreativeWorkbench({
4142
4443
  ] }, directory2);
4143
4444
  }) })
4144
4445
  ] }),
4145
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("main", { className: "oh-story-editor", children: [
4146
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("header", { children: [
4147
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "oh-story-editor-path", title: selected, children: [
4148
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: selectedLabel }),
4149
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: selectedBasename })
4446
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("main", { className: "oh-story-editor", children: [
4447
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("header", { children: [
4448
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "oh-story-editor-path", title: selected, children: [
4449
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: selectedLabel }),
4450
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("strong", { children: selectedBasename })
4150
4451
  ] }),
4151
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-story-editor-actions", children: [
4152
- (previewable || productionAvailable) && !selectedMedia && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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", children: editorModes.map((mode) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4452
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-story-editor-actions", children: [
4453
+ (previewable || productionAvailable) && !selectedMedia && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("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", children: editorModes.map((mode) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4153
4454
  "button",
4154
4455
  {
4155
4456
  type: "button",
@@ -4166,48 +4467,48 @@ function CreativeWorkbench({
4166
4467
  },
4167
4468
  mode
4168
4469
  )) }),
4169
- (dirty || saving) && selected !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { className: "oh-story-save", type: "button", disabled: saving || buffer?.missing === !0, onClick: () => {
4470
+ (dirty || saving) && selected !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { className: "oh-story-save", type: "button", disabled: saving || buffer?.missing === !0, onClick: () => {
4170
4471
  savePath(selected);
4171
4472
  }, children: saving ? "\u4FDD\u5B58\u4E2D\u2026" : "\u4FDD\u5B58" })
4172
4473
  ] })
4173
4474
  ] }),
4174
- activity !== void 0 && activityPath !== void 0 && activityPath === selected && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-story-stream", "data-stage": activity.stage, role: "status", "aria-live": "polite", children: [
4475
+ activity !== void 0 && activityPath !== void 0 && activityPath === selected && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-story-stream", "data-stage": activity.stage, role: "status", "aria-live": "polite", children: [
4175
4476
  "\u25CF ",
4176
4477
  activity.stage === "running" ? "Agent \u6B63\u5728\u5E94\u7528\u4FEE\u6539" : "Agent \u6B63\u5728\u751F\u6210\u6587\u4EF6\u5185\u5BB9"
4177
4478
  ] }),
4178
- conflict !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-story-conflict", role: "alert", children: [
4179
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: conflict.message }),
4180
- conflict.theirs !== void 0 && conflict.theirsVersion !== void 0 && selected !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
4181
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", onClick: () => {
4479
+ conflict !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-story-conflict", role: "alert", children: [
4480
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: conflict.message }),
4481
+ conflict.theirs !== void 0 && conflict.theirsVersion !== void 0 && selected !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
4482
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", onClick: () => {
4182
4483
  resolveConflict(!1);
4183
4484
  }, children: "\u8F7D\u5165\u78C1\u76D8\u7248\u672C" }),
4184
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", onClick: () => {
4485
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", onClick: () => {
4185
4486
  resolveConflict(!0);
4186
4487
  }, children: "\u4FDD\u7559\u672C\u5730\u8349\u7A3F" })
4187
4488
  ] })
4188
4489
  ] }),
4189
- fileError !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-story-error", children: fileError }),
4190
- selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-story-empty", children: workbench === "story" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
4490
+ fileError !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-story-error", children: fileError }),
4491
+ selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-story-empty", children: workbench === "story" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
4191
4492
  "\u5F53\u524D workspace \u8FD8\u6CA1\u6709\u5C0F\u8BF4\u6587\u4EF6\u3002\u53EF\u5728\u53F3\u4FA7 Chat \u4E2D\u8FD0\u884C ",
4192
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "/story-setup" }),
4493
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("code", { children: "/story-setup" }),
4193
4494
  "\u3002"
4194
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
4495
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
4195
4496
  "\u5F53\u524D workspace \u8FD8\u6CA1\u6709\u77ED\u5267\u9879\u76EE\u3002\u53EF\u5728\u53F3\u4FA7 Chat \u4E2D\u8FD0\u884C ",
4196
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "/short-drama" }),
4497
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("code", { children: "/short-drama" }),
4197
4498
  "\u3002"
4198
- ] }) }) : selectedMedia && selectedFile !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-story-media-document", children: selectedFile.mimeType?.startsWith("image/") === !0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("img", { src: endpoint("media", sessionId, selectedFile.path), alt: selectedFile.path }) : selectedFile.mimeType?.startsWith("audio/") === !0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("audio", { src: endpoint("media", sessionId, selectedFile.path), controls: !0 }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("video", { src: endpoint("media", sessionId, selectedFile.path), controls: !0, preload: "metadata" }) }) : buffer === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-story-empty", children: [
4499
+ ] }) }) : selectedMedia && selectedFile !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-story-media-document", children: selectedFile.mimeType?.startsWith("image/") === !0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("img", { src: endpoint("media", sessionId, selectedFile.path), alt: selectedFile.path }) : selectedFile.mimeType?.startsWith("audio/") === !0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("audio", { src: endpoint("media", sessionId, selectedFile.path), controls: !0 }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("video", { src: endpoint("media", sessionId, selectedFile.path), controls: !0, preload: "metadata" }) }) : buffer === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-story-empty", children: [
4199
4500
  "\u6B63\u5728\u52A0\u8F7D ",
4200
4501
  selected,
4201
4502
  "\u2026"
4202
- ] }) : buffer.missing === !0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-story-empty", children: [
4503
+ ] }) : buffer.missing === !0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-story-empty", children: [
4203
4504
  "\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",
4204
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", onClick: () => {
4505
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", onClick: () => {
4205
4506
  setBuffers((current) => {
4206
4507
  let next = { ...current };
4207
4508
  return delete next[selected], next;
4208
4509
  }), setSelected(workspace === void 0 ? void 0 : preferredWorkbenchFile(workspace.files, workbench));
4209
4510
  }, children: "\u653E\u5F03\u672C\u5730\u8349\u7A3F" })
4210
- ] }) : editorMode === "production" && productionAvailable && episodeProduction !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4511
+ ] }) : editorMode === "production" && productionAvailable && episodeProduction !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4211
4512
  DramaProductionView,
4212
4513
  {
4213
4514
  sessionId,
@@ -4223,7 +4524,7 @@ function CreativeWorkbench({
4223
4524
  manualReferences: productionReferences,
4224
4525
  sequence: productionSequence,
4225
4526
  canvas: productionCanvas,
4226
- zoom: productionZoom,
4527
+ viewport: productionViewport,
4227
4528
  onSectionChange: setProductionSection,
4228
4529
  onSelect: setProductionSelectedId,
4229
4530
  onNavigate: navigateProductionTarget,
@@ -4235,13 +4536,13 @@ function CreativeWorkbench({
4235
4536
  },
4236
4537
  onSequenceChange: setProductionSequence,
4237
4538
  onCanvasChange: setProductionCanvas,
4238
- onZoomChange: setProductionZoom,
4539
+ onViewportChange: setProductionViewport,
4239
4540
  onDispatchPrompt: sendProductionPrompt,
4240
4541
  onCancelTurn: cancelProduction,
4241
4542
  onRemoveQueued: removeQueuedProduction,
4242
4543
  onRefresh: reload
4243
4544
  }
4244
- ) : previewable && editorMode === "preview" ? markdown ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(MarkdownPreview, { content: buffer.content, label: selected }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(JsonlPreview, { content: buffer.content, label: selected }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4545
+ ) : previewable && editorMode === "preview" ? markdown ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MarkdownPreview, { content: buffer.content, label: selected }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(JsonlPreview, { content: buffer.content, label: selected }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4245
4546
  "textarea",
4246
4547
  {
4247
4548
  ref: textareaRef,
@@ -4270,43 +4571,43 @@ function CreativeWorkbench({
4270
4571
  )
4271
4572
  ] })
4272
4573
  ] })
4273
- ] }) : !creativeProject && error === void 0 ? welcome ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(WelcomeGuide, {}) : null : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { ref: surfaceRef, className: "oh-story-split-surface", "data-open": "false", children: [
4274
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("style", { children: plugin_default }),
4275
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("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: () => {
4574
+ ] }) : !creativeProject && error === void 0 ? welcome ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(WelcomeGuide, {}) : null : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { ref: surfaceRef, className: "oh-story-split-surface", "data-open": "false", children: [
4575
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("style", { children: plugin_default }),
4576
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("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: () => {
4276
4577
  applyWorkbenchPreference("open");
4277
4578
  }, children: [
4278
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "aria-hidden": !0, children: "\u2726" }),
4279
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("b", { children: "\u521B\u4F5C\u5DE5\u4F5C\u53F0" })
4579
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { "aria-hidden": !0, children: "\u2726" }),
4580
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: "\u521B\u4F5C\u5DE5\u4F5C\u53F0" })
4280
4581
  ] })
4281
4582
  ] });
4282
4583
  }
4283
4584
  function CreativeSplitBridge(props) {
4284
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SessionWorkbenchMemory, { ...props }, props.sessionId);
4585
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SessionWorkbenchMemory, { ...props }, props.sessionId);
4285
4586
  }
4286
4587
  function SessionWorkbenchMemory(props) {
4287
4588
  let { sessionId, useStore, actions } = props, hydrated = useStore((state) => state.hydrated);
4288
- return (0, import_react3.useLayoutEffect)(() => {
4589
+ return (0, import_react4.useLayoutEffect)(() => {
4289
4590
  hydrated || actions.restore(workbenchMemoryBySession.get(sessionId));
4290
- }, [actions, hydrated, sessionId]), hydrated ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
4291
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(WorkbenchMemoryMirror, { sessionId, useStore }),
4292
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SessionWorkbenchBridge, { ...props })
4591
+ }, [actions, hydrated, sessionId]), hydrated ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
4592
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(WorkbenchMemoryMirror, { sessionId, useStore }),
4593
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SessionWorkbenchBridge, { ...props })
4293
4594
  ] }) : null;
4294
4595
  }
4295
4596
  function WorkbenchMemoryMirror({ sessionId, useStore }) {
4296
4597
  let memory = useStore((state) => state);
4297
- return (0, import_react3.useEffect)(() => {
4598
+ return (0, import_react4.useEffect)(() => {
4298
4599
  workbenchMemoryBySession.set(sessionId, memory);
4299
4600
  }, [memory, sessionId]), null;
4300
4601
  }
4301
4602
  function SessionWorkbenchBridge({ sessionId, useSession, useSessions, useProjection, useChat, useStore, actions, sendProductionPrompt, cancelProduction, removeQueuedProduction }) {
4302
- let marker = (0, import_react3.useRef)(null), [target, setTarget] = (0, import_react3.useState)(), runningCalls = useChat((snapshot) => snapshot.legacy.runningCalls), partial = useChat((snapshot) => streamingAssistant(snapshot.timeline)), undispatched = useChat((snapshot) => undispatchedCalls(snapshot), sameUndispatchedCalls), settledMutation = useChat((snapshot) => latestSettledMutation(snapshot)), settledMutationTurn = useChat((snapshot) => latestSettledMutationTurn(snapshot)), liveTurn = useChat((snapshot) => openTurn(snapshot)), workbench = useStore((memory) => memory.workbench), gamePane = useStore((memory) => memory.gamePane), videoPane = useStore((memory) => memory.videoPane), sessionRunning = useSession((snapshot) => snapshot.running), inboxRows = useProjection("inbox", (inbox) => inbox?.["next-turn"]), pendingSubmissions = useSession((snapshot) => snapshot.pendingSubmissions), productionQueue = (0, import_react3.useMemo)(() => productionQueueFromInbox(
4603
+ let marker = (0, import_react4.useRef)(null), [target, setTarget] = (0, import_react4.useState)(), runningCalls = useChat((snapshot) => snapshot.legacy.runningCalls), partial = useChat((snapshot) => streamingAssistant(snapshot.timeline)), undispatched = useChat((snapshot) => undispatchedCalls(snapshot), sameUndispatchedCalls), settledMutation = useChat((snapshot) => latestSettledMutation(snapshot)), settledMutationTurn = useChat((snapshot) => latestSettledMutationTurn(snapshot)), liveTurn = useChat((snapshot) => openTurn(snapshot)), workbench = useStore((memory) => memory.workbench), gamePane = useStore((memory) => memory.gamePane), videoPane = useStore((memory) => memory.videoPane), sessionRunning = useSession((snapshot) => snapshot.running), inboxRows = useProjection("inbox", (inbox) => inbox?.["next-turn"]), pendingSubmissions = useSession((snapshot) => snapshot.pendingSubmissions), productionQueue = (0, import_react4.useMemo)(() => productionQueueFromInbox(
4303
4604
  inboxRows,
4304
4605
  new Set(pendingSubmissions.filter((item) => item.placement === "transcript").map((item) => item.requestId))
4305
- ), [inboxRows, pendingSubmissions]), chat = useChat((snapshot) => snapshot), productionIntents = (0, import_react3.useMemo)(() => settledProductionIntents(chat), [chat]), { workspace, error, loading: workspaceLoading, reload } = useWorkspace(sessionId), chosenPreference = useStore((memory) => memory.workbenchPreference), creativeProject = hasCreativeProject(workspace), welcome = useSessions((state) => state.byId[sessionId]?.blank === !0) && workspace !== void 0 && !workspaceLoading && !creativeProject, storedPreference = (0, import_react3.useMemo)(
4606
+ ), [inboxRows, pendingSubmissions]), chat = useChat((snapshot) => snapshot), productionIntents = (0, import_react4.useMemo)(() => settledProductionIntents(chat), [chat]), { workspace, error, loading: workspaceLoading, reload } = useWorkspace(sessionId), chosenPreference = useStore((memory) => memory.workbenchPreference), creativeProject = hasCreativeProject(workspace), welcome = useSessions((state) => state.byId[sessionId]?.blank === !0) && workspace !== void 0 && !workspaceLoading && !creativeProject, storedPreference = (0, import_react4.useMemo)(
4306
4607
  () => readWorkbenchPreference(workbenchPreferenceStorage(), workspace?.cwd),
4307
4608
  [workspace?.cwd]
4308
4609
  ), open = resolveWorkbenchOpen(chosenPreference ?? storedPreference, creativeProject);
4309
- return (0, import_react3.useLayoutEffect)(() => {
4610
+ return (0, import_react4.useLayoutEffect)(() => {
4310
4611
  let document = marker.current?.ownerDocument;
4311
4612
  if (document === void 0) return;
4312
4613
  let locate = () => {
@@ -4320,7 +4621,7 @@ function SessionWorkbenchBridge({ sessionId, useSession, useSessions, useProject
4320
4621
  return observer.observe(document.body, { childList: !0, subtree: !0 }), () => {
4321
4622
  observer.disconnect();
4322
4623
  };
4323
- }, [sessionId]), (0, import_react3.useLayoutEffect)(() => {
4624
+ }, [sessionId]), (0, import_react4.useLayoutEffect)(() => {
4324
4625
  let scroller = target?.parentElement;
4325
4626
  if (scroller == null) return;
4326
4627
  if (!open) {
@@ -4369,9 +4670,9 @@ function SessionWorkbenchBridge({ sessionId, useSession, useSessions, useProject
4369
4670
  scroller.removeEventListener(driven, markDriven);
4370
4671
  observer.disconnect(), seats.disconnect(), scroller.style.removeProperty("--oh-story-scroll-height"), scroller.style.removeProperty("--oh-story-composer-height"), delete scroller.dataset.ohStoryLayout, delete scroller.dataset.ohStoryWorkbench, delete scroller.dataset.ohStudioPane;
4371
4672
  };
4372
- }, [gamePane, open, target, videoPane, workbench]), /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
4373
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { ref: marker, className: "oh-story-bridge-marker", "aria-hidden": !0 }),
4374
- target === void 0 ? null : (0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4673
+ }, [gamePane, open, target, videoPane, workbench]), /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
4674
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { ref: marker, className: "oh-story-bridge-marker", "aria-hidden": !0 }),
4675
+ target === void 0 ? null : (0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4375
4676
  CreativeWorkbench,
4376
4677
  {
4377
4678
  sessionId,
@@ -4401,31 +4702,31 @@ function SessionWorkbenchBridge({ sessionId, useSession, useSessions, useProject
4401
4702
  ] });
4402
4703
  }
4403
4704
  function WelcomeGuide() {
4404
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("section", { className: "oh-story-welcome", "aria-label": "Oh Story \u4F7F\u7528\u5F15\u5BFC", children: [
4405
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("style", { children: plugin_default }),
4406
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h2", { children: "Oh Story \u5DF2\u52A0\u8F7D" }),
4407
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: "\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" }),
4408
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("ol", { children: [
4409
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { children: "\u70B9\u51FB\u5DE6\u4FA7\u300C\u5DE5\u4F5C\u533A / Workspaces\u300D\u65C1\u7684\u300C\u6DFB\u52A0\u5DE5\u4F5C\u533A / Add workspace\u300D\uFF0C\u9009\u62E9\u5B58\u653E\u4F5C\u54C1\u7684\u6587\u4EF6\u5939\u3002" }),
4410
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { children: "\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" }),
4411
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { children: "\u7A7A\u76EE\u5F55\uFF08\u5305\u62EC DSH \u81EA\u52A8\u5EFA\u7ACB\u7684\u300C\u9ED8\u8BA4\u5DE5\u4F5C\u533A / Default workspace\u300D\uFF09\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" })
4705
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "oh-story-welcome", "aria-label": "Oh Story \u4F7F\u7528\u5F15\u5BFC", children: [
4706
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("style", { children: plugin_default }),
4707
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h2", { children: "Oh Story \u5DF2\u52A0\u8F7D" }),
4708
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: "\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" }),
4709
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("ol", { children: [
4710
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { children: "\u70B9\u51FB\u5DE6\u4FA7\u300C\u5DE5\u4F5C\u533A / Workspaces\u300D\u65C1\u7684\u300C\u6DFB\u52A0\u5DE5\u4F5C\u533A / Add workspace\u300D\uFF0C\u9009\u62E9\u5B58\u653E\u4F5C\u54C1\u7684\u6587\u4EF6\u5939\u3002" }),
4711
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { children: "\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" }),
4712
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { children: "\u7A7A\u76EE\u5F55\uFF08\u5305\u62EC DSH \u81EA\u52A8\u5EFA\u7ACB\u7684\u300C\u9ED8\u8BA4\u5DE5\u4F5C\u533A / Default workspace\u300D\uFF09\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" })
4412
4713
  ] }),
4413
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { children: [
4714
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("p", { children: [
4414
4715
  "\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 ",
4415
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "/story" }),
4716
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("code", { children: "/story" }),
4416
4717
  "\u3001",
4417
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "/short-drama" }),
4718
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("code", { children: "/short-drama" }),
4418
4719
  "\u3001",
4419
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "/novel-to-game quick" }),
4720
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("code", { children: "/novel-to-game quick" }),
4420
4721
  " \u6216 ",
4421
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "/video-recap" }),
4722
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("code", { children: "/video-recap" }),
4422
4723
  "\u3002"
4423
4724
  ] })
4424
4725
  ] });
4425
4726
  }
4426
4727
  function WorkbenchWelcome() {
4427
- let marker = (0, import_react3.useRef)(null), [target, setTarget] = (0, import_react3.useState)();
4428
- return (0, import_react3.useLayoutEffect)(() => {
4728
+ let marker = (0, import_react4.useRef)(null), [target, setTarget] = (0, import_react4.useState)();
4729
+ return (0, import_react4.useLayoutEffect)(() => {
4429
4730
  let document = marker.current?.ownerDocument;
4430
4731
  if (document === void 0) return;
4431
4732
  let locate = () => {
@@ -4437,13 +4738,13 @@ function WorkbenchWelcome() {
4437
4738
  return observer.observe(document.body, { childList: !0, subtree: !0 }), () => {
4438
4739
  observer.disconnect();
4439
4740
  };
4440
- }, []), /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
4441
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { ref: marker, className: "oh-story-bridge-marker", "aria-hidden": !0 }),
4442
- target === void 0 ? null : (0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(WelcomeGuide, {}), target)
4741
+ }, []), /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
4742
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { ref: marker, className: "oh-story-bridge-marker", "aria-hidden": !0 }),
4743
+ target === void 0 ? null : (0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(WelcomeGuide, {}), target)
4443
4744
  ] });
4444
4745
  }
4445
4746
  function WorkbenchSeat({ SessionProvider, renderSlot }) {
4446
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SessionProvider, { empty: () => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(WorkbenchWelcome, {}), children: renderSlot("oh-story.workspace", {}) });
4747
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SessionProvider, { empty: () => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(WorkbenchWelcome, {}), children: renderSlot("oh-story.workspace", {}) });
4447
4748
  }
4448
4749
  function argsOf(block) {
4449
4750
  let raw = ("kind" in block ? block.call?.argsRaw : block.phase === "start" ? block.argsRaw : void 0) ?? "{}";
@@ -4461,32 +4762,32 @@ function resultOf(block) {
4461
4762
  }
4462
4763
  function RoleToolView({ block, inspect }) {
4463
4764
  let args = argsOf(block), role = typeof args.role == "string" ? args.role : "story-role", output = resultOf(block), state = "kind" in block ? block.isError ? "error" : "done" : "running";
4464
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("details", { className: "oh-story-role", "data-state": state, children: [
4465
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("style", { children: plugin_default }),
4466
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("summary", { children: [
4467
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u2726 Role" }),
4468
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: role }),
4469
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("em", { children: state === "running" ? "\u8FD0\u884C\u4E2D" : state === "error" ? "\u5931\u8D25" : "\u5B8C\u6210" })
4765
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("details", { className: "oh-story-role", "data-state": state, children: [
4766
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("style", { children: plugin_default }),
4767
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("summary", { children: [
4768
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u2726 Role" }),
4769
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("strong", { children: role }),
4770
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("em", { children: state === "running" ? "\u8FD0\u884C\u4E2D" : state === "error" ? "\u5931\u8D25" : "\u5B8C\u6210" })
4470
4771
  ] }),
4471
- output !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("pre", { children: output }),
4472
- inspect !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", onClick: inspect, children: "\u5728\u8F68\u8FF9\u4E2D\u68C0\u67E5" })
4772
+ output !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("pre", { children: output }),
4773
+ inspect !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", onClick: inspect, children: "\u5728\u8F68\u8FF9\u4E2D\u68C0\u67E5" })
4473
4774
  ] });
4474
4775
  }
4475
4776
  function ProductionToolView({ block, inspect }) {
4476
4777
  let args = argsOf(block), action = typeof args.action == "string" ? args.action : "production", episode = typeof args.episode == "string" ? args.episode : "\u77ED\u5267", state = "kind" in block ? block.isError ? "error" : "done" : "running";
4477
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("details", { className: "oh-story-role", "data-state": state, children: [
4478
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("style", { children: plugin_default }),
4479
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("summary", { children: [
4480
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u25A6 \u751F\u4EA7" }),
4481
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("strong", { children: [
4778
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("details", { className: "oh-story-role", "data-state": state, children: [
4779
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("style", { children: plugin_default }),
4780
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("summary", { children: [
4781
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u25A6 \u751F\u4EA7" }),
4782
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("strong", { children: [
4482
4783
  episode,
4483
4784
  " \xB7 ",
4484
4785
  action
4485
4786
  ] }),
4486
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("em", { children: state === "running" ? "\u6267\u884C\u4E2D" : state === "error" ? "\u5931\u8D25" : "\u5DF2\u5E94\u7528" })
4787
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("em", { children: state === "running" ? "\u6267\u884C\u4E2D" : state === "error" ? "\u5931\u8D25" : "\u5DF2\u5E94\u7528" })
4487
4788
  ] }),
4488
- resultOf(block) !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("pre", { children: resultOf(block) }),
4489
- inspect !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", onClick: inspect, children: "\u5728\u8F68\u8FF9\u4E2D\u68C0\u67E5" })
4789
+ resultOf(block) !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("pre", { children: resultOf(block) }),
4790
+ inspect !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", onClick: inspect, children: "\u5728\u8F68\u8FF9\u4E2D\u68C0\u67E5" })
4490
4791
  ] });
4491
4792
  }
4492
4793
  function apply(context) {