Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
cb1fd85
refactor: remove UE4/AI-man/TCP-UDP message actions and control encodes
Onweekendd Sep 17, 2026
bd1e52e
refactor(material): rebuild scroll table with structured columns/head…
Onweekendd Sep 17, 2026
5eac332
feat(types): add cross-field superRefine checks for component validation
Onweekendd Sep 17, 2026
071c08d
fix(sw): harden minio cache preload and force-cache strategy
Onweekendd Sep 17, 2026
a1ff1e6
feat(server): add in-memory job runner with tests
Onweekendd Sep 17, 2026
3a679dc
chore: rust formatter setting and diagram update
Onweekendd Sep 17, 2026
92ea0cf
feat(server): 新增生图模型角色与 GeneratedImage 表
Onweekendd Sep 18, 2026
9f26398
feat(server): 新增效果图落屏工作流 screenFromEffectImageWorkflow
Onweekendd Sep 18, 2026
147125d
chore: 统一 import 排序与格式化
Onweekendd Sep 18, 2026
a314e97
feat(build): 生图工具结果预览 + agent 编辑组件时的扫光提示
Onweekendd Sep 18, 2026
45945cd
fix(alignment-wasm): rbush 范围查询提前处理叶子节点
Onweekendd Sep 29, 2026
8cf9aa0
feat(types): swtext/swimg 升级为 v2 CSS 语义 schema,新增 swBox 与自动迁移函数
Onweekendd Sep 29, 2026
4e3af86
feat(material): swtext v2 渲染与配置面板重写
Onweekendd Sep 29, 2026
61b984c
feat(material): swimg v2 渲染重写,新增矩形 swBox 组件与配置面板
Onweekendd Sep 29, 2026
740b6f6
feat(app): 编辑器接入原子组件 v2(echartcommon 双通道、面板通用渲染适配)
Onweekendd Sep 29, 2026
362eaef
feat(server): 生图落屏工作流按原子组件 v2 改造
Onweekendd Sep 29, 2026
2c59341
docs: 新增原子组件(文字/图片/矩形/通用图表)迁移方案
Onweekendd Sep 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,8 @@
"rust-analyzer.linkedProjects": [
"apps/desktop/src-tauri/Cargo.toml",
"packages/alignment-wasm/Cargo.toml"
]
],
"[rust]": {
"editor.defaultFormatter": "rust-lang.rust-analyzer"
}
}
Binary file modified apps/app/public/img/scrollTable.70b511f1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions apps/app/src/api/aiModel.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { BaseEntity } from "@/model/BaseEntity";
import { serverRequest } from "@/utils/serverService";

/** 3 个模型角色 */
export type ModelRole = "reasoning" | "vision" | "embedding";
/** 4 个模型角色 */
export type ModelRole = "reasoning" | "vision" | "embedding" | "image";

export interface AiModelVo {
role: ModelRole;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { cloneDeep } from "lodash-es";
import { shallowRef, watch } from "vue";

import { echartsCore as echarts } from "@screenwright/material/chart";
Expand All @@ -6,6 +7,41 @@ import { useBaseData } from "@/hooks/useBaseData";
import { getFunction } from "@/utils/utils";
import type { ComponentType } from "@/views/build/components/buildRender/type";

/** echartcommon 组件既有的 {categories, series}[] 数据形状 */
type CategorySeriesDataItem = {
categories: string[];
series: { name: string; data: unknown[] }[];
};

const isCategorySeriesShape = (data: unknown): data is CategorySeriesDataItem[] =>
Array.isArray(data) &&
data.length > 0 &&
data.every((item) => item && typeof item === "object" && "categories" in item && "series" in item);

/**
* 把 dataChart 转换为可作为 echarts dataset.source 使用的行记录表
* - 已是扁平记录数组(非 {categories, series} 形状):直接原样使用
* - {categories, series}[] 形状:取第一项,转换为按 category 行展开的表
*/
const buildDatasetSource = (data: unknown): Record<string, unknown>[] => {
if (!isCategorySeriesShape(data)) {
return Array.isArray(data) ? (data as Record<string, unknown>[]) : [];
}

const [first] = data;

if (!first) {
return [];
}

const { categories, series } = first;

return categories.map((name, i) => ({
name,
...Object.fromEntries(series.map((s) => [s.name, s.data[i]]))
}));
};

export const useEchartsCommon = (options: ComponentType) => {
const { dataChart, option, styleSizeName } = useBaseData(options);
const echartsOptions = shallowRef<Record<string, unknown>>({});
Expand All @@ -17,7 +53,37 @@ export const useEchartsCommon = (options: ComponentType) => {
console.error(`[useEchartsCommon] echartFormatter 执行失败: ${message}`, error);
};

const getEchartsOptions = () => {
/** 新链路:存在 echartsOption 时,注入 dataset 并(可选)交给 echartFormatter 做二次处理 */
const getEchartsOptionsFromEchartsOption = (echartsOption: Record<string, unknown>) => {
try {
const nextOption = cloneDeep(echartsOption);

nextOption.dataset = { source: buildDatasetSource(dataChart.value) };

const echartFormatter = getFunction(option.value.echartFormatter, false);

if (typeof echartFormatter !== "function") {
echartsOptions.value = nextOption;
return echartsOptions.value;
}

const formatted = echartFormatter(dataChart.value, nextOption);

// 仅在返回有效配置时更新,避免把已有配置覆盖成异常值
if (formatted && typeof formatted === "object") {
echartsOptions.value = formatted;
}

return echartsOptions.value;
} catch (error) {
showFormatterError(error);
// 出错时保持旧配置,不影响后续逻辑
return echartsOptions.value;
}
};

/** 旧链路:无 echartsOption 时,保持与迁移前完全一致的行为 */
const getEchartsOptionsLegacy = () => {
try {
const echartFormatter = getFunction(option.value.echartFormatter, true);

Expand All @@ -39,6 +105,16 @@ export const useEchartsCommon = (options: ComponentType) => {
return echartsOptions.value;
}
};

const getEchartsOptions = () => {
const echartsOption = option.value.echartsOption as Record<string, unknown> | undefined;

if (echartsOption) {
return getEchartsOptionsFromEchartsOption(echartsOption);
}

return getEchartsOptionsLegacy();
};
watch(
() => dataChart.value,
(nv) => {
Expand Down
1 change: 1 addition & 0 deletions apps/app/src/components/componentEntry/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const renderMediaComponentType: MediaEnum[] = [
MediaEnum.SwEmbedAudio,
MediaEnum.SwIframe,
MediaEnum.SwImg,
MediaEnum.SwBox,
MediaEnum.SwOpenVideo,
MediaEnum.SwImgBorder,
MediaEnum.SwSwiper,
Expand Down
155 changes: 0 additions & 155 deletions apps/app/src/hooks/eventHandling/actionStrategies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1088,127 +1088,6 @@ export class SwitchVideoStrategy extends ActionStrategy<ActionExecutionParams> {
}
}

export class sendUE4MessageStrategy extends ActionStrategy<ActionExecutionParams> {
async execute({
componentIds,
isConditionSatisfied,
globalComponentMap,
ue4Config,
info,
animation,
action,
eventList
}: ActionExecutionParams & {
info: Record<string, any> | null;
}): Promise<void> {
if (!isConditionSatisfied || action === undefined) {
return;
}

const ue4Info = action === ActionTypeEnum.SendUe4Msg ? info : null;

const targetComponentId = componentIds[0];

/**
* @description 获取组件类型
* @returns "PixelStreaming" | "PeerStreaming" | "" | null
*/
const getComponentType = () => {
const targetComponent = globalComponentMap.get(String(targetComponentId));
if (!targetComponent) {
return null;
}

const propMap: Record<string, "PixelStreaming" | "PeerStreaming" | "ue-vessel" | "sw-unreal-engine"> = {
[extendsEnumType.UePixelStreaming]: "PixelStreaming",
[extendsEnumType.UePeerStreaming]: "PeerStreaming",
[extendsEnumType.UeVessel]: "ue-vessel",
[extendsEnumType.SwUnrealEngine]: "sw-unreal-engine"
};

if (!propMap[targetComponent.component.prop]) {
return "";
}

return propMap[targetComponent.component.prop];
};

/**
* @description 处理消息数据
*/
const processMessageData = (messageContent: any, messageType: string, info?: any) => {
if (info) {
return messageType === "string" ? JSON.stringify(info) : { ...info };
}

switch (messageType) {
case "string":
return messageContent;
case "json":
return typeof messageContent === "string" ? JSON.parse(messageContent) : { data: messageContent };
default:
return messageContent;
}
};

/**
* @description 发送UE消息
*/
const sendUEMessage = () => {
console.log("sendUEMessage", window, (window as any).pixelStreaming, window.ue4);
if (!window.ue4 || !ue4Config) {
return;
}

const { messageName, messageContent, messageType } = ue4Config;

if (!messageName) {
return;
}

const componentType = getComponentType();
console.log("sendUEMessage22", componentType);
if (!componentType) {
return;
}

const data = processMessageData(messageContent, messageType, ue4Info);

// 根据组件类型发送消息
switch (componentType) {
case "PeerStreaming":
if (window.funPS) {
window.funPS.emitMessage({ name: messageName, data });
}
return;

case "PixelStreaming":
console.log("PixelStreaming", { name: messageName, data }, (window as any).pixelStreaming);
if (window.playerStream) {
(window as any).playerStream.emitUIInteraction({ name: messageName, data });
}
return;

case "ue-vessel":
console.log("window.ue4.v2", messageName, data);
window.ue4?.v2?.(messageName, data);
return;
case "sw-unreal-engine":
componentIds.forEach((componentId) => {
const event = eventList[`${extendsEnumType.SwUnrealEngine}-${componentId}`];
event.sendMessageToUe(messageName, data);
});
break;
default:
return;
}
};

await delay(animation?.delay || 0);
sendUEMessage();
}
}

export class SwitchBlueprintTab extends ActionStrategy<ActionExecutionParams> {
execute({ componentIds, blueprintKey, eventList, info }: ActionExecutionParams): void {
if (!blueprintKey) {
Expand All @@ -1222,37 +1101,6 @@ export class SwitchBlueprintTab extends ActionStrategy<ActionExecutionParams> {
}
}

export class sendAIManMsgStaticStrategy extends ActionStrategy<ActionExecutionParams> {
async execute({
componentIds,
isConditionSatisfied,
globalComponentMap,
eventList,
animation,
info
}: ActionExecutionParams & {
info: Record<string, any> | null;
}): Promise<void> {
console.log("receiveWSMessage 触发数字人方法", info, isConditionSatisfied);
if (!isConditionSatisfied) {
return;
}
await delay(animation?.delay || 0);
componentIds.forEach((id) => {
const component = globalComponentMap.get(`${id}`);
if (!component) {
return;
}

const event = (eventList as Record<string, any>)[`${component.component.prop}-${id}`];
if (!event.sendMsgToHuman) {
return;
}
event.sendMsgToHuman(info);
});
}
}

export class SetIndexStrategy extends ActionStrategy<ActionExecutionParams> {
async execute({
componentIds,
Expand Down Expand Up @@ -1632,9 +1480,6 @@ export class ActionStrategyFactory {
[ActionTypeEnum.VideoToFastin]: new VideoToFastinStrategy(),
[ActionTypeEnum.VideoToRewind]: new VideoToRewindStrategy(),
[ActionTypeEnum.SwitchVideoProgress]: new SwitchVideoStrategy(),
[ActionTypeEnum.SendUe4Msg]: new sendUE4MessageStrategy(),
[ActionTypeEnum.SendUe4MsgStatic]: new sendUE4MessageStrategy(),
[ActionTypeEnum.SendAIManMsgStatic]: new sendAIManMsgStaticStrategy(),
[ActionTypeEnum.SwitchBlueprintTab]: new SwitchBlueprintTab(),
[ActionTypeEnum.nextPage]: new nextPageStrategy(),
[ActionTypeEnum.prevPage]: new prevPageStrategy(),
Expand Down
2 changes: 0 additions & 2 deletions apps/app/src/hooks/eventHandling/useActionMessage.ts

This file was deleted.

2 changes: 0 additions & 2 deletions apps/app/src/hooks/eventHandling/useTcpUdpWebSocket.ts

This file was deleted.

32 changes: 32 additions & 0 deletions apps/app/src/hooks/useEditingComponents.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* 追踪"正在被 agent 编辑"的组件 id 集合,供画布渲染层叠加扫光效果。
*
* 模块级单例(不是 Pinia store):这类纯 UI 提示状态没有持久化/多处 action 的需求,
* 用一个模块作用域的 reactive 就够了,聊天面板(写入方)和画布(读取方)分处两棵组件树,
* import 同一个模块自然共享同一份状态,不需要为它专门开一个 store module。
*
* 用引用计数而不是简单的 add/delete:同一个组件短时间内可能被多个工具调用同时命中
* (比如一次批量 edit_files 里出现两次),后进的调用先结束不该把还在跑的那次的高亮撤掉。
*/
import { reactive } from "vue";

const refCounts = new Map<string, number>();

/** 当前正在编辑的组件 id(字符串形式,和画布渲染层 `component.id` 的比较口径一致)。 */
export const editingComponentIds = reactive(new Set<string>());

export const markComponentEditing = (id: string): void => {
const next = (refCounts.get(id) ?? 0) + 1;
refCounts.set(id, next);
editingComponentIds.add(id);
};

export const unmarkComponentEditing = (id: string): void => {
const next = (refCounts.get(id) ?? 0) - 1;
if (next <= 0) {
refCounts.delete(id);
editingComponentIds.delete(id);
} else {
refCounts.set(id, next);
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ async function cleanExpiredCache() {

for (const request of requests) {
const response = await cache.match(request);
if (!response) continue;
if (!response) {
continue;
}

const dateHeader = response.headers.get("date");
if (dateHeader) {
Expand Down
7 changes: 4 additions & 3 deletions apps/app/src/service-workers/minioCache/minio-cache-online.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import { ForceCacheStrategy } from "./ForceCacheStrategy";
self.__WB_DISABLE_DEV_LOGS = true;

/**
* 匹配 MinIO 资源请求(仅图片、视频,不包含字体)
* 匹配对象存储资源请求(仅图片、视频,不包含字体)
* MinIO 形态:`/assets/...`;fs 存储形态:`/blobs/<key>`
*/
registerRoute(({ url }) => {
const isMinioPath = url.pathname.includes("/version-test/") || url.pathname.includes("/assets/");
const isMinioPath = ["/assets/", "/blobs/"].some((seg) => url.pathname.includes(seg));
const isMediaFile = /\.(png|jpg|jpeg|gif|mp4|webm)$/i.test(url.pathname);
return isMinioPath && isMediaFile;
}, new ForceCacheStrategy());
Expand All @@ -26,5 +27,5 @@ registerRoute(({ url }) => {
return isFontPath && isFontFile;
}, new ForceCacheStrategy());

console.log("[SW] MinIO 媒体资源缓存策略已激活(仅图片和视频)");
console.log("[SW] 对象存储媒体资源缓存策略已激活(仅图片和视频)");
console.log("[SW] 本地字体文件缓存策略已激活(/lib/fonts/)");
Loading
Loading