Commit Graph
144 Commits
Author SHA1 Message Date
liquid 30a9bbfd13 feat: enhance analytics and reporting functionality
- Updated PostHog integration to conditionally load based on local development environment and URL parameters.
- Refactored Sentry initialization to enable reporting based on environment settings.
- Added new menu item for cleaning invalid media links, including URL validity checks and user feedback.
- Introduced new icons and translations for the clean invalid links feature.
- Improved task queue management by consolidating service worker checks and ensuring compatibility with existing services.
- Updated version and build time in version.json to reflect recent changes.
2026-02-05 09:14:48 +08:00
liquid 4757a0d4bf feat: enhance video handling and task queue management
- Improved video blob retrieval by adding network fallback if not found in cache.
- Updated service worker to allow GitHub API requests to bypass caching for better performance.
- Enhanced task queue management by allowing tasks in the SUBMITTING phase to be retried without marking them as failed.
- Introduced a transparent placeholder response for missing video thumbnails to prevent playback issues.
- Added detailed logging for task retries and execution phases to aid in debugging.
2026-02-04 23:35:34 +08:00
liquidliang 4376be0cac feat: implement failed URL caching for external image requests
- Added a caching mechanism to store failed external image URLs for 5 minutes to avoid repeated requests for known 404 errors.
- Introduced functions to check if a URL is likely expired and to mark URLs as failed based on their response status.
- Enhanced the fetch event listener to skip requests for recently failed URLs, improving performance and reducing unnecessary network traffic.
2026-02-04 14:30:10 +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
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
liquidliang 10f953f73c docs: 添加编码规则 - IndexedDB 直接读取和 RPC 超时处理
- 主线程直接读取 IndexedDB 优于 RPC:避免 postMessage 限制
- RPC 超时与重连策略:合理超时 + 自动重连重试
2026-02-03 20:42:27 +08:00
liquidliang 6c01e7e33b Merge branch '92-sw' into develop 2026-02-01 22:21:32 +08:00
liquidliang 8ecc8e7571 docs: 添加 CSS 变量优先级和弹出菜单截断规则
- CLAUDE.md: 更新 createPortal 规则说明,新增组件内颜色使用规范
- CODING_RULES.md: 添加详细的 TDesign CSS 变量优先级问题说明
- CODING_RULES.md: 添加弹出菜单被 overflow 截断的解决方案
2026-02-01 22:19:02 +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
liquid 8b0b95bfd7 feat(sw): enhance thumbnail request handling with parameter prioritization
- Introduced a new parameter priority system for thumbnail requests, allowing for `bypass_sw` and `_retry` to take precedence over thumbnail processing.
- Updated logic to ensure thumbnail requests are only processed when neither `bypass_sw` nor `_retry` are present.
- Cleaned up cache key construction by removing control parameters from the original URL for better cache management.

This change improves the efficiency and clarity of thumbnail request handling in the Service Worker.
2026-01-31 23:45:03 +08:00
liquidandClaude 21a666637c chore: clean up debug console logs and fix winbox icon handling
Remove verbose debug logs from main thread, Service Worker, and workflow services to reduce console noise in production. Also fix winbox icon container creation when icon prop changes after window initialization.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-31 23:10:23 +08:00
liquid 738f8b9b86 feat(app): enhance board ID management via URL parameters and improve user interaction
- Added functions to retrieve and update the board ID from the URL, allowing for seamless board switching without page refresh.
- Updated the app to prioritize the board ID from the URL over the previous state when loading boards.
- Enhanced logging for board switch actions in both the App and ProjectDrawer components.
- Adjusted cursor style in project-drawer.scss for better user experience.
2026-01-31 22:27:24 +08:00
liquid 4b3a7842ee chore: update version and build time, refine toolbar styles, and ensure consistent type exports
- Updated version to 0.5.63 and adjusted build time in version.json.
- Refined styles in unified-toolbar.tsx for consistent button sizes and padding.
- Ensured consistent type exports across various components in the drawnix package.
2026-01-31 22:14:02 +08:00
liquid fbfd0f1329 docs: 添加 SW 重发 Tool Request 延迟规则
问题:页面刷新后 SW claim 工作流时立即重发 pending tool request,
但主线程的 registerToolRequestHandler 可能还没准备好,导致请求失败。

解决:重发时延迟 500ms,等待主线程 handler 准备好。
2026-01-31 21:38:18 +08:00
liquidandClaude d27939f80b feat(sw): 改进工作流恢复机制和错误处理
- 修复工作流恢复时 UI 与 SW 状态不一致导致的错误失败状态
- 保持 AWAITING_CLIENT 错误处理链完整,避免错误属性丢失
- 重构 channel-manager 和 workflow-executor
- 添加崩溃恢复对话框组件
- 拆分 sw-channel 类型定义到独立文件
- 更新文档规则:工作流恢复状态不一致、错误处理链保持完整

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-31 20:53:06 +08:00
liquid a91afda0f4 docs: 更新 postmessage-duplex 规则 (v1.1.0)
- 更新通信模式:broadcast/onBroadcast 用于单向通知
- 更新初始化:enableGlobalRouting 自动管理 channel
- 新增客户端配置:autoReconnect 处理 SW 更新
- 新增任务队列双服务同步规则
2026-01-31 14:09:20 +08:00
liquidandClaude 50c94058af feat: move ai_analyze to SW and improve debug panel logging
- Move ai_analyze tool execution to Service Worker to avoid postMessage
  timeouts; system prompt built in app layer and passed to SW
- Add full response JSON display for LLM API logs (fetch on expand)
- Improve PostMessage logging: use source labels (应用页面/SW) instead
  of direction, filter debug panel messages, support request-response linking
- Add waitForStorageRestore() to ensure RPC handlers return complete data
- Remove syncTasksToClients() in favor of paginated RPC queries
- Better VideoGenerationFailedError detection for business failures
- Clean up debug console.log statements

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-31 09:12:07 +08:00
liquid 070801ca7a feat: implement LLM API log selection and batch actions
- Added UI elements for selecting and batch deleting LLM API logs in sw-debug.html.
- Introduced functions for toggling selection mode, selecting all logs, and batch deleting selected logs in llmapi-logs.js.
- Updated event listeners in app.js to handle new actions related to LLM API logs.
- Enhanced pagination and filtering capabilities for LLM API logs in sw-communication.js and llm-api-logger.ts.
- Implemented server-side deletion of selected logs with appropriate feedback to the user.

This update improves user interaction with LLM API logs, allowing for more efficient management of log entries.
2026-01-31 00:05:48 +08:00
liquid 597181ebca docs: 添加 postmessage-duplex 消息大小限制规则
- CLAUDE.md: 添加规则 12 - RPC 响应不超过 1MB,需后端分页+精简数据
- CODING_RULES.md: 添加详细规则和示例
  - postmessage-duplex RPC 消息大小限制
  - 分页查询必须在服务端过滤
2026-01-31 00:05:21 +08:00
liquid cac87cf458 docs: 添加 postmessage-duplex publish 模式规则
- CLAUDE.md: 新增规则 #11 - publish 模式下 ret 可能是 undefined,isReady 返回数字
- CODING_RULES.md: 新增错误示例 4-6,包含 ret 检查、isReady 检查、响应格式解析
2026-01-30 22:11:53 +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
ljquan 316754593f Merge pull request #94 from ljquan/feat/async-image-model
feat(image): 接入香蕉生图异步模型
2026-01-29 16:31:07 +08:00
gongchengtu e85dda82b1 feat(image): support async models with size and references 2026-01-29 15:30:43 +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
liquidliang 243725e596 chore: update version to 0.5.61 and enhance batch processing logic in image and video generation 2026-01-27 16:42:05 +08:00
liquid 37231354e5 chore: update version to 0.5.60 and improve board selection logic 2026-01-27 00:29:58 +08:00
liquid 8b93fb260d chore: bump version to 0.5.59 2026-01-27 00:29:58 +08:00
liquid d96f066b01 refactor(task-queue): update resume methods to reuse original LLM API log entries
- Modified the resume methods in CharacterHandler and VideoHandler to avoid creating new log entries for resumed tasks.
- Implemented logic to retrieve the original log ID using taskId, ensuring that the original log is updated upon completion of polling.
- Added comments in Chinese to clarify the changes made to the logging process.
2026-01-26 00:28:13 +08:00
liquidandClaude ebca700560 fix(batch-generation): 修复批量生成只执行第一个任务的问题
批量生成时(通过 AIInputBar 指定数量 n),之前只会执行 1 个任务,其余被跳过为"重复"。
修复包括:
- 跳过 batchId 存在时的重复检测逻辑
- 在工作流转换和执行时正确传递批量参数 (batchId, batchIndex, batchTotal)
- 添加跨层数据转换的编码规则文档

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-26 00:13:03 +08:00
liquid 7a92d70963 fix(task-queue): enhance task submission and execution checks
- Added checks to prevent duplicate task submissions and executions based on task status and prompt similarity.
- Improved logging for task submissions, completions, and failures when debug mode is enabled.
- Updated broadcast method to include uncontrolled clients, ensuring messages reach all windows during updates or refreshes.
- Incremented build time in version.json to reflect recent changes.
2026-01-25 21:53:13 +08:00
liquid 989e919860 去掉参数n 2026-01-25 21:11:44 +08:00
liquid c714761174 docs(claude): 添加新规则 - 日志记录应反映实际发送的数据 2026-01-24 23:37:30 +08:00
liquid c688c159ab docs(claude): 添加新规则 - 多组件共享异步数据时使用 Context 2026-01-24 22:54:13 +08:00
liquid 895b867560 Merge branch 'origin/feat/model-api-hint' into develop
解决 index.html 版本冲突,保留 0.5.42 版本号
2026-01-23 22:58:45 +08:00
liquidliang 53d0900a3c docs: 添加共享模块设计规则
- 清理 CLAUDE.md 中重复的规则 8-10
- 添加规则 11:共享模块设计(*-core.ts 命名规范)
- 在 CODING_RULES.md 添加详细示例(TrimMode 配置模式)
2026-01-23 15:42:53 +08:00
gongchengtu 8571c798ec feat(branding): update OpenTu labels and model hints 2026-01-23 15:39:41 +08:00
liquidliangandClaude fae807b091 fix(task-queue): 阻止无效配置下创建的任务被执行
- SW 端拒绝未初始化时提交的任务,返回 TASK_REJECTED 消息
- 首次初始化时清除所有 PENDING 状态的孤儿任务
- 主线程检查 initialize 返回值,失败时发出 taskRejected 事件
- 客户端收到 TASK_REJECTED 时从本地缓存移除任务

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-23 13:33:15 +08:00
liquidliang 70c83b6e46 feat(security): 增强敏感信息处理和日志记录
- 添加 sanitize-utils 模块以处理敏感信息,确保在 Sentry 和 PostHog 上报时过滤敏感数据。
- 更新 Service Worker 和主线程的错误记录,确保只记录错误类型而不泄露详细信息。
- 优化请求体和响应数据的脱敏处理,防止敏感信息泄露。
2026-01-21 19:50:32 +08:00
liquidliang 7b8c32e17d chore: update app version to 0.5.35 and adjust build time in version.json 2026-01-21 11:17:37 +08:00
liquidliang f44fea3e72 feat: implement precache manifest generation and update service worker activation strategy
- Added a Vite plugin to generate a precache-manifest.json for static assets.
- Enhanced service worker to load and cache files based on the precache manifest.
- Updated service worker to automatically activate new versions and notify clients.
- Bumped app version to 0.5.33 and adjusted build time in version.json.
2026-01-21 10:47:22 +08:00
gongchengtu 614fc8b00d fix(sw): preserve image ratio in payload
derive size from aspectRatio to keep generation outputs aligned
2026-01-20 16:35:32 +08:00
liquidliang 0b3c40b749 chore: bump version to 0.5.27 2026-01-20 16:24:48 +08:00
liquidliang c94b0323bd feat: add reference image handling in LLM API logs and enhance task recovery mechanisms 2026-01-20 16:01:26 +08:00
liquidliang 155ec00987 chore: enhance CDN response validation and update version to 0.5.25 2026-01-20 13:20:52 +08:00
liquidliang 8bd7f30c19 chore: bump version to 0.5.25 2026-01-20 13:11:17 +08:00
liquidliang 91799c9abd chore: bump version to 0.5.17 2026-01-20 13:06:28 +08:00
liquidliang 51b5f3f99b chore: bump version to 0.5.17 and update build time in version.json 2026-01-20 12:13:55 +08:00
liquidliang de1329701d feat(sw): implement CORS domain handling and cache validation
- Added functionality to mark domains with CORS issues, allowing the Service Worker to skip these domains in future requests.
- Introduced a mechanism to check for expired CORS failures, enabling retries after a specified TTL.
- Enhanced debug status reporting to include counts and lists of CORS failed domains.
- Updated image request handling to manage CORS errors more effectively, including support for opaque responses.
- Improved asset loading logic to prioritize Cache Storage and ensure only valid assets are processed.
2026-01-19 20:09:34 +08:00
liquidliang 310b7d02f7 docs(claude): 添加缓存策略和数据一致性规则
- 更新素材库数据来源说明,增加 Cache Storage 作为第三数据源
- 添加缓存策略区分表格(AI生成 vs 本地图片)
- 新增规则:批量加载与单个加载方法必须保持逻辑一致
- 新增规则:IndexedDB 元数据必须验证 Cache Storage 实际数据
- 新增规则:本地缓存图片只存 Cache Storage,不存 IndexedDB
2026-01-19 19:46:26 +08:00
liquidliang f6bd3af058 feat: 封装函数不应被绕过、页面卸载清理定时器 2026-01-19 15:25:58 +08:00