15 Commits
Author SHA1 Message Date
liquidliang 2fdaf01f9e Merge branch '107-skill' into develop 2026-02-26 22:31:40 +08:00
liquidliang 84285d9e01 refactor(web): 优化类型定义和构建配置
refactor(sw): 增强类型安全处理
refactor(dawnix): 完善类型导入和配置
2026-02-26 21:35:32 +08:00
gongchengtuandClaude Opus 4.6 262eea92d3 fix: 修复签名 URL(TOS)因 Referer 校验导致缩略图/插入/下载 403
- 新增 cacheRemoteUrl/cacheRemoteUrls 在任务完成时将远程 URL 缓存到本地
- useThumbnailUrl 不再对外部 URL 追加 thumbnail 参数(会破坏签名)
- 所有 <img>/<video>/new Image() 加 referrerPolicy="no-referrer"
- fetch 下载路径加 referrerPolicy: 'no-referrer'
- useAutoInsertToCanvas 展开 task.result.urls 支持多图自动插入

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 20:30:23 +08:00
liquid bfad96d5c3 docs(claude): 添加新规则 - 自定义 Plait 组件 onContextChanged 必须处理 viewport 变化 2026-02-08 16:08:12 +08:00
liquidliang cbe11e0865 perf: 优化同步上传性能,避免 UI 阻塞
问题:pushToRemote 在主线程连续执行大量 CPU 密集型操作(JSON.stringify、加密等),
导致事件处理器无法及时响应,页面卡顿。

解决方案:
- 在 @aitu/utils 中添加 yieldToMain() 和 processBatched() 工具函数
- 在同步相关的 CPU 密集型循环中添加 yield 点,每 3-5 次迭代让出主线程
- 更新 CLAUDE.md 和 CODING_RULES.md 记录此规则

优化的文件:
- sync-engine.ts: 画板增量比较/上传循环
- data-serializer.ts: collectSyncData、serializeToGistFiles* 方法
- task-sync-service.ts: syncTasks、uploadTaskData 方法
- workflow-sync-service.ts: syncWorkflows、uploadWorkflowData 方法
2026-02-05 14:10:43 +08:00
liquidliang 036cce5291 chore: update build time and refactor imports for consistency
- Updated build time in version.json to reflect recent changes.
- Refactored imports in various components to utilize @aitu/utils for consistency and improved maintainability.
- Removed unnecessary console logs and debug statements across multiple files to clean up the codebase.
2026-02-04 14:27:27 +08:00
liquidliang dae0bb8ac3 feat: integrate fake-indexeddb and refactor media executor
- Added fake-indexeddb as a dev dependency for improved testing.
- Refactored media executor by extracting utility functions for building image request bodies, parsing image responses, and polling video status.
- Updated workflow engine to utilize new utility functions for better code clarity and maintainability.
- Adjusted version.json build time to reflect recent changes.
2026-02-04 11:19:47 +08:00
liquid 900db04dc5 feat(executor): implement unified media execution and workflow enhancements
- Added a new media executor to handle image, video, and AI analysis tasks, allowing for asynchronous execution and improved task management.
- Introduced new RPC methods for executor operations, including PING and EXECUTOR_EXECUTE.
- Updated workflow executor to support pending main thread steps, ensuring proper handling of canvas operations and media generation tools.
- Enhanced workflow status synchronization with a new hook for better UI updates and reliability.
- Removed deprecated tool response handling for improved code clarity and efficiency.
- Updated documentation to reflect changes in workflow and executor functionalities.
2026-02-04 09:16:36 +08:00
liquid da0c37e11c docs: 添加 SW 任务持久化规则和敏感 ID 脱敏说明
- CLAUDE.md: 新增规则14 - 任务数据必须通过 RPC 持久化到 SW
- CLAUDE.md: 规则7 补充 maskId 函数用于敏感 ID 脱敏
- CODING_RULES.md: 添加详细示例说明主线程任务数据持久化流程
2026-02-01 09:53:55 +08:00
liquidliang cacf6b43e5 docs: 添加 postmessage-duplex 库使用规范
- CLAUDE.md: 新增 SW 规则第 10 条摘要
- CODING_RULES.md: 详细规则包含 3 个错误/正确示例
  - subscribe 回调需从 response.data 提取数据
  - handler 必须返回响应避免发送方超时
  - 客户端需先发 SW_CHANNEL_CONNECT 让 SW 创建 channel
2026-01-30 19:27:59 +08:00
liquidliang a4ca6ca6ee refactor: rename project from Aitu to Opentu
- Updated project references across various files to reflect the new name "Opentu" instead of "Aitu".
- Adjusted ESLint configuration, documentation, and user manuals to ensure consistency with the rebranding.
- Removed outdated README backup file.

This change marks a significant rebranding effort to align the project identity with its new vision.
2026-01-29 11:24:47 +08:00
liquidliangandClaude 064549732c refactor: 迁移通用工具函数到 @aitu/utils 并消除二次导出
- 新增 @aitu/utils 模块:id (generateId, generateUUID)、dom (download, copyToClipboard)、security (sanitizeObject, sanitizeUrl)
- 删除 drawnix 中的 sanitize-utils.ts,改为直接从 @aitu/utils 导入
- 精简 common.ts,只保留 Plait 特有函数 (boardToImage, getShortcutKey, trackMemory)
- 统一 Z-Index 常量,新增 DROPDOWN_PORTAL 替代硬编码 10000
- 提取 useControllableState hook 简化受控/非受控组件状态逻辑
- 删除 SW 中废弃的 cleanup 方法 (cleanupOldTasks, cleanupOldWorkflows, cleanupOldChatWorkflows)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-29 10:47:34 +08:00
liquidandClaude 77340d8e4a chore: 清理 console.log 调试日志
删除项目中的 console.log 调试语句,保留 console.error 和 console.warn 用于错误处理。
同时修复 getFileExtension 函数支持相对路径 URL 解析。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-14 23:37:00 +08:00
liquidliang 69233ddb7a refactor(utils): 重构工具模块并迁移共享代码到独立包
feat(utils): 添加数组、字符串、异步工具函数和测试
feat(utils): 实现日志、编码和类型工具模块
fix(web): 修复Service Worker缓存策略和CSP头
ci: 添加bundle大小检查工作流
build: 添加size-limit依赖和配置
perf(web): 优化vite分包策略
2026-01-07 15:03:10 +08:00
liquidliang a34e2eb5c7 feat(utils): 新增共享工具函数库并重构相关代码
refactor(drawnix): 使用@aitu/utils替换lodash和内部工具函数
perf(drawnix): 通过代码分割和懒加载优化性能
ci: 添加bundle分析和工作流artifact上传功能
build: 更新依赖并移除lodash相关包
2026-01-07 15:03:10 +08:00