Files
NianToB/task_plan.md
2026-05-13 23:52:11 +08:00

71 KiB
Raw Blame History

YINIAN Desktop Next Phase Plan

Goal

Move from M1 foundation closure to an M2 product slice that a business customer can actually pilot: authenticated desktop entry, stable workspace context, visible daily operations surface, skill lifecycle primitives, and a clear path to connect the real server without disturbing ClawX/OpenClaw basics.

2026-05-13 对话 Markdown 与隐藏提示泄漏修复

Status: complete

Goal:

  • 防止业务回答准则作为可见内容污染真实对话。
  • 增强会话内 Markdown 结构、表格展示,并把执行思考收成无框时间线。

Tasks:

  • 停止在 chat/cron 运行时消息里追加隐藏业务准则。
  • 历史里已有的隐藏准则在用户消息展示、标签和去重时自动剥离。
  • 为 Markdown 标题、列表、引用和表格增加工作台风格渲染。
  • 执行过程卡从边框卡片改为无框时间线。
  • 新对话空态删除品牌小标题和图标,只保留核心引导文案。
  • 补充测试并运行验证。

Verification:

  • pnpm vitest run tests/unit/chat-message.test.tsx tests/unit/chat-target-routing.test.ts tests/unit/cron-routes.test.ts tests/unit/business-guidance.test.ts: passed, 4 files / 24 tests.
  • pnpm vitest run tests/unit/chat-page-execution-graph.test.tsx tests/unit/task-visualization.test.ts tests/unit/chat-store-history-retry.test.ts: passed, 3 files / 18 tests.
  • pnpm vitest run tests/unit/chat-message.test.tsx tests/unit/chat-target-routing.test.ts tests/unit/cron-routes.test.ts tests/unit/chat-store-history-retry.test.ts: passed, 4 files / 27 tests.
  • pnpm run typecheck: passed.
  • pnpm run build:vite: passed with existing dynamic-import/chunk-size warnings.
  • pnpm exec playwright test tests/e2e/yinian-delivery-smoke.spec.ts: passed, 1 test.
  • pnpm exec playwright test --config=playwright.legacy.config.ts tests/e2e/yinian-visual-smoke.spec.ts: passed, 1 test.
  • pnpm exec playwright test --config=playwright.legacy.config.ts tests/e2e/chat-table-header-light.spec.ts: passed, 1 test after fixing the test route to load /chat.
  • git diff --check: passed.
  • pnpm run typecheck: passed after the new-chat empty-state cleanup.

Notes:

  • The first chat-table-header-light.spec.ts attempt failed because the legacy E2E started on the default new-chat route and never loaded seeded chat history. The test now sets #/chat before reload.

2026-05-13 桌面任务提醒与业务回答渲染

Status: complete

Goal:

  • 将任务提醒从任务卡片状态升级为 Electron 桌面系统通知。
  • 将业务型回答从纯 Markdown 增强为可扫读的结构化摘要 UI。

Tasks:

  • 新增 cron 完成事件到桌面通知的解析、去重和展示转换。
  • 主进程监听 Gateway cron 终态通知,弹出系统通知,点击回到任务中心并定位任务。
  • 任务中心支持 ?task= 高亮目标任务。
  • 聊天消息识别“状态/依据/影响/下一步”等业务标签,渲染业务摘要面板。
  • 更新隐藏业务回答准则,引导 OpenClaw 输出稳定标签。
  • 补充单测并运行类型检查、构建和 Electron 冒烟。

Verification:

  • pnpm vitest run tests/unit/cron-desktop-reminder.test.ts tests/unit/chat-message.test.tsx tests/unit/tasks-page.test.tsx tests/unit/business-guidance.test.ts: passed, 4 files / 20 tests.
  • pnpm run typecheck: passed.
  • pnpm run build:vite: passed with existing dynamic-import/chunk-size warnings.
  • pnpm exec playwright test tests/e2e/yinian-delivery-smoke.spec.ts: passed, 1 test.

Notes:

  • First E2E attempt failed because pnpm run build:vite was running in parallel and temporarily removed dist/index.html; a clean rerun after build completion passed.

2026-05-13 聊天页字体与 UI 统一

Status: complete

Goal:

  • 修正对话页字体、空态、消息气泡、执行过程和输入框与智念工作台整体 UI 不一致的问题。

Tasks:

  • 明确全局桌面中文系统字体栈,并让输入控件继承。
  • 将聊天外层从半透明玻璃感收敛为智念标准面板。
  • 将空态从卡片式居中块改成轻量无框状态。
  • 统一消息气泡、业务摘要、工具状态、文件/图片卡、执行过程卡的边框、圆角、底色与字号。
  • 统一聊天输入框、快捷任务 chip、知识库选择器和工具按钮样式。
  • 运行单测、类型检查、构建、主 E2E 和视觉截图验证。

Verification:

  • pnpm vitest run tests/unit/chat-message.test.tsx: passed, 1 file / 8 tests.
  • pnpm run typecheck: passed.
  • pnpm run build:vite: passed with existing dynamic-import/chunk-size warnings.
  • pnpm exec playwright test tests/e2e/yinian-delivery-smoke.spec.ts: passed, 1 test.
  • pnpm exec playwright test --config=playwright.legacy.config.ts tests/e2e/yinian-visual-smoke.spec.ts: passed, 1 test.
  • Visual chat screenshot reviewed at test-results/yinian-visual/02-chat.png.

2026-05-13 商品中心 Web 应用接入

Status: complete

Goal:

  • 在应用中心新增“商品中心”,内嵌 https://ticket.nianxx.cn/,用于酒店企业底价采购旅游资源。
  • 当前版本不注入真实 SSO 凭证,但 URL 构造和宿主页面要留下后续服务端单点登录接入边界。

Tasks:

  • 调研目标站点和当前应用中心接入方式。
  • 新增商品中心应用配置、路由和内嵌 Web 宿主页。
  • 补充中英文文案和操作状态。
  • 增加应用中心/商品中心的单元或冒烟测试。
  • 运行验证并确认本地开发预览。

Notes:

  • 目标站点当前页面标题为“一感旅游”,描述为景区商品采购、余额管理、订单退款、报表对账一体化工作台。
  • curl -I https://ticket.nianxx.cn/ 返回 HTTP/2 200,未看到 X-Frame-Options 或阻断性 Content-Security-Policy,可先按 iframe 内嵌处理。

Errors Encountered:

  • pnpm exec playwright test tests/e2e/yinian-delivery-smoke.spec.ts 首次失败在找不到 app-center-item-product-center;原因是 Electron E2E 使用的 dist 仍是旧构建。下一步先运行 pnpm run build:vite,再重跑 E2E。
  • 重建后 E2E 已进入 product-center-page,但中文 iframe title 定位失败;改为在 iframe 上增加稳定的 data-testid="product-center-frame"

Verification:

  • pnpm vitest run tests/unit/app-center.test.tsx tests/unit/product-center-url.test.ts: passed, 2 files / 3 tests.
  • pnpm run typecheck: passed.
  • pnpm run build:vite: passed with existing Vite dynamic-import/chunk-size warnings.
  • pnpm test: passed, 106 files / 675 tests; existing MaxListeners warnings remain.
  • pnpm exec playwright test tests/e2e/yinian-delivery-smoke.spec.ts: passed, 1 test.

2026-05-13 旅游资源订购 Login-State Follow-Up

Status: complete

Goal:

  • 将应用名称从“商品中心”改为“旅游资源订购”。
  • 内置 Web 使用持久化会话容器,保持 ticket.nianxx.cn 登录态。

Tasks:

  • 更新 zh/en 展示名、标题和测试用例命名。
  • 确认目标站点登录态存储方式。
  • 将宿主容器切换为 Electron <webview> 并指定持久 partition。
  • 运行单测、类型检查、构建和 E2E 验证。

Errors Encountered:

  • 首次 follow-up 单测失败在 app-center.test.tsx,原因是断言仍匹配“底价采购”,实际新文案已改为“底价订购”;已更新断言。

Verification:

  • pnpm vitest run tests/unit/app-center.test.tsx tests/unit/product-center-url.test.ts tests/unit/product-center-page.test.tsx: passed, 3 files / 4 tests.
  • pnpm run typecheck: passed.
  • pnpm run build:vite: passed with existing Vite dynamic-import/chunk-size warnings.
  • pnpm exec playwright test tests/e2e/yinian-delivery-smoke.spec.ts: passed, 1 test.

2026-05-13 快速视频创作 Rename And English Coverage

Status: complete

Goal:

  • 将“智念视频助手”展示名改为“快速视频创作”。
  • 核实英文状态下应用中心两个内置应用都有英文覆盖,不暴露 i18n key。

Tasks:

  • 更新 zh/en app-center 文案,包括应用卡片、宿主页标题、导航和启动/失败状态。
  • 增加英文应用中心覆盖测试。
  • 运行针对性单测、类型检查、构建和 Electron 冒烟。

Verification:

  • pnpm vitest run tests/unit/app-center.test.tsx tests/unit/product-center-page.test.tsx tests/unit/product-center-url.test.ts: passed, 3 files / 5 tests.
  • pnpm run typecheck: passed.
  • pnpm run build:vite: passed with existing Vite dynamic-import/chunk-size warnings.
  • pnpm exec playwright test tests/e2e/yinian-delivery-smoke.spec.ts: passed, 1 test.

2026-05-13 快速视频创作内置 Web 英文覆盖

Status: complete

Goal:

  • 英文状态下,快速视频创作内置 Web 应用不再暴露主要中文导航、标题、按钮、表单标签和项目页文案。
  • 桌面宿主需要把当前语言传给内置 Web并让内置应用在跨页面导航后保持该语言状态。

Tasks:

  • 定位英文漏覆盖来源,区分桌面外壳 i18n 与 NianxxPlay 内置 Web 硬编码中文。
  • 桌面端 NianxxPlay 宿主 URL 注入 zhinianLang
  • NianxxPlay 内置应用新增英文覆盖桥,并持久化嵌入语言状态。
  • 补充针对 URL 语言参数和英文覆盖字典的测试。
  • 重建内置 Web bundle运行桌面验证。

Verification:

  • pnpm vitest run tests/unit/nianxx-play-url.test.ts tests/unit/app-center.test.tsx: passed, 2 files / 4 tests.
  • /Users/inmanx/Documents/NianxxPlay: npm test: passed, 4 files / 14 tests.
  • /Users/inmanx/Documents/NianxxPlay: npm run build: passed with existing ali-oss/urllib dynamic dependency warning.
  • NIANXX_PLAY_SKIP_BUILD=1 pnpm run prepare:nianxx-play: passed; refreshed build/apps/nianxx-play.
  • pnpm run typecheck: passed.
  • pnpm run build:vite: passed with existing Vite dynamic-import/chunk-size warnings.
  • Playwright page probe on http://127.0.0.1:3010/studio?zhinianEmbed=1&zhinianLang=en: key English checks passed and first-screen continuous Chinese matches were empty.
  • Playwright page probe on /planning?zhinianEmbed=1&zhinianLang=en: key English checks passed and continuous Chinese matches were empty.
  • pnpm exec playwright test tests/e2e/yinian-delivery-smoke.spec.ts: passed, 1 test.

2026-05-13 设置偏好深色 UI 修复

Status: complete

Goal:

  • 修复设置/使用偏好在深色主题下的色彩层级、对比度和局部浅色残留。
  • 顺带补上全局 app surface 和标题栏的深色背景兜底,减少其它深色页面出现同类问题。

Tasks:

  • 抓取当前深色偏好页截图并定位色彩问题。
  • 重构偏好页容器、分组和分段按钮的深色样式。
  • 调整全局深色背景与标题栏深色样式。
  • 运行类型检查/构建并重新截图验证。

Verification:

  • pnpm run typecheck: passed.
  • pnpm exec vitest run tests/unit/title-bar.test.tsx tests/unit/launch-at-startup.test.ts tests/unit/app-center.test.tsx tests/unit/nianxx-play-url.test.ts: passed, 4 files / 11 tests.
  • pnpm run build:vite: passed with existing dynamic-import/chunk-size warnings.
  • Electron visual screenshot: test-results/settings-preferences-dark-electron-after.png.
  • pnpm exec playwright test tests/e2e/yinian-delivery-smoke.spec.ts: passed, 1 test.

Notes:

  • pnpm exec playwright test --config=playwright.legacy.config.ts tests/e2e/settings-proxy.spec.ts was attempted but failed before reaching Settings because the legacy setup helper still expects main-layout immediately after setup, while the current product flow is login-first.

2026-05-13 WhatsApp 二维码生成检查

Status: complete

Goal:

  • 修复 WhatsApp 扫码连接时二维码生成不出来的问题,至少确保失败时不被前端吞掉,并让 WhatsApp WebSocket 走应用代理设置。

Tasks:

  • 检查前端扫码 Modal、Host API 路由、主进程 WhatsApp 登录管理器和 QR 渲染链路。
  • 用临时 HOME 拉起 WhatsApp 登录管理器,确认当前网络下直连 web.whatsapp.com WebSocket 超时/失败。
  • 给 WhatsApp 登录管理器接入应用代理设置,支持 HTTP/HTTPS 与 SOCKS 代理。
  • 修复 Host API unified envelope 非 2xx 时未抛错的问题,扫码启动失败时前端恢复状态并显示错误。
  • 补充 WhatsApp 网络/代理失败的本地化提示。
  • 补充代理解析和 Host API 非 2xx 单测。
  • 运行类型检查、相关单测和 Vite 构建。

Verification:

  • pnpm run typecheck: passed.
  • pnpm exec vitest run tests/unit/host-api.test.ts tests/unit/whatsapp-proxy.test.ts tests/unit/channel-routes.test.ts: passed, 3 files / 38 tests.
  • pnpm run build:vite: passed with existing Vite dynamic-import/chunk-size warnings.
  • 临时 HOME 直连实测仍无法连接 WhatsApp WebSocket当前网络环境预期如此但现在会返回明确错误需要检查网络或开启高级设置里的代理。

2026-05-13 OpenClaw 内核升级

Status: complete

Goal:

  • 将桌面端内置 OpenClaw 内核从 2026.4.29 升级到 npm stable latest并确认当前运行时补丁、依赖打包和核心验证仍可用。

Tasks:

  • 查询当前依赖版本和 npm dist-tag。
  • 更新 openclaw 依赖与 lockfile。
  • 检查 OpenClaw 运行时补丁是否仍能匹配新版 bundle。
  • 运行类型检查、相关单测、构建/打包前置验证。
  • 记录升级结果和残余风险。

Verification:

  • node build/openclaw/openclaw.mjs --version: OpenClaw 2026.5.7 (eeef486).
  • pnpm run typecheck: passed.
  • node scripts/assert-electron-runtime-deps.mjs: passed.
  • pnpm exec vitest run tests/unit/openclaw-cli.test.ts tests/unit/openclaw-proxy.test.ts tests/unit/channel-config.test.ts tests/unit/channel-routes.test.ts tests/unit/whatsapp-proxy.test.ts tests/unit/host-api.test.ts: passed, 6 files / 58 tests.
  • pnpm run build:vite: passed with existing Vite dynamic-import/chunk-size warnings.
  • pnpm exec playwright test tests/e2e/yinian-delivery-smoke.spec.ts: passed, 1 test.

Notes:

  • npm stable latest is 2026.5.7; beta remains newer at 2026.5.12-beta.4, but this upgrade intentionally stays on stable.
  • bundle-openclaw now builds build/openclaw from openclaw@2026.5.7 and critical YINIAN runtime boundaries are present in the bundled output.
  • Several old bundle patch snippets no longer match because OpenClaw 2026.5.7 moved or upstreamed equivalent logic; verified equivalents include raw-model fast path, disabled main-session recovery, stuck-session active abort threshold, agents skill discovery disable, and Windows hidden process spawn handling.

Current Baseline

  • M1 auth/config/skill registry foundation implemented.
  • Typecheck passed.
  • Unit tests passed: 89 files, 572 tests.
  • E2E passed: 26 passed, 1 skipped.
  • Production flow: login first, then Today.
  • E2E compatibility flow: legacy ClawX setup/main pages remain testable.

Phase 1: Stabilize M1 For Handoff

Status: complete

Tasks:

  • Review all uncommitted files and separate intentional YINIAN changes from accidental drift.
  • Add or update a concise M1 implementation note in docs/.
  • Document environment switches:
    • YINIAN_API_BASE_URL
    • CLAWX_LEGACY_AUTOSTART
    • CLAWX_E2E
  • Confirm storage namespace and logout cleanup behavior are captured in docs.
  • Run final verification after any cleanup:
    • pnpm run typecheck
    • pnpm run test
    • pnpm run test:e2e

Exit Criteria:

  • Working tree changes are explainable by module.
  • M1 behavior can be handed to another engineer without reading the full chat.

Result:

  • Completed in this session.
  • Added docs/M1_HANDOFF.md.
  • Updated docs/START_HERE.md.
  • Fixed a channel health timestamp edge case where success/failure could share the same millisecond.
  • Verification passed.

Phase 2: Real Server Contract v0

Status: complete

Tasks:

  • Define the first stable backend API contract for:
    • SMS login
    • password login
    • restore/refresh session
    • hotel list/current workspace
    • config snapshot
    • skills manifest
  • Add mock fixtures that mirror the proposed server JSON exactly.
  • Add response normalization tests for missing/extra fields.
  • Decide refresh-token persistence boundary:
    • mock can use local store
    • HTTP should persist refresh token only when server contract is explicit
  • Add failure states for expired session and unavailable server.

Exit Criteria:

  • Backend engineer can implement against a documented contract.
  • UI/store can tolerate server errors without breaking the shell.

Result:

  • Added docs/SERVER_CONTRACT_V0.md.
  • Added tests/fixtures/yinian-server-contract.ts.
  • HTTP mode now refreshes persisted sessions through /auth/refresh.
  • HTTP mode normalizes contract v0 config and manifest responses.
  • Verification passed.

Phase 3: Today Page M2 Pilot Surface

Status: complete

Tasks:

  • Turn Today from foundation dashboard into B-end business cockpit.
  • Add real sections for:
    • pending guest requests
    • urgent exceptions
    • today arrival/departure summary
    • active skills and sync status
    • recent agent actions
  • Add empty/loading/error states that are operational, not marketing copy.
  • Merge entitlement and local registry states into clear labels:
    • enabled but not synced
    • installed
    • update available
    • disabled
  • Add tests for at least empty state, populated state, and workspace switch refresh.

Exit Criteria:

  • A business operator can understand what needs attention within 10 seconds.

Result:

  • Rebuilt src/pages/Today/index.tsx as an operations cockpit.
  • Added tests/unit/today-page.test.tsx.
  • Verification passed.

Phase 4: Skills Manager M2

Status: complete

Tasks:

  • Expand local registry UI beyond list/sync:
    • per-skill status
    • version
    • last synced time
    • entitlement source
    • retry failed sync
  • Keep real bundle download out of scope unless explicitly promoted.
  • Define install/update/skip/fail result semantics in UI state mapping over shared registry/status types.
  • Add tests for:
    • empty registry
    • manifest changes
    • disabled entitlement
    • sync failure
    • workspace switch isolation

Exit Criteria:

  • Skills page can explain exactly why a skill is available, unavailable, or stale.

Result:

  • Rebuilt src/pages/YinianSkills/index.tsx into an operator-facing Skills Manager.
  • Added tests/unit/yinian-skills-page.test.tsx.
  • Verification passed.

Phase 5: Design System Pass

Status: complete

Tasks:

  • Establish YINIAN visual language over the inherited ClawX shell:
    • calmer B-end business density
    • refined sidebar/topbar
    • consistent status chips, tables, and panels
    • no decorative landing-page treatment
  • Replace one-off page styling with reusable UI patterns where it reduces duplication.
  • Verify with typecheck, unit tests, Vite build, and Playwright E2E.

Exit Criteria:

  • Login, Today, Skills, and tenant switcher feel like one product.

Result:

  • Added lightweight YINIAN UI primitives in src/components/yinian/ui.tsx.
  • Unified Login, Today, Skills, sidebar service context, main workspace background, and sidebar active states around a calmer navy/slate operations style.
  • Verification passed.

Phase 6: Pilot Packaging And QA

Status: complete

Tasks:

  • Prepare a pilot checklist:
    • install/start
    • mock login
    • server login when configured
    • switch workspace
    • sync skills
    • logout
    • gateway starts only after auth
  • Add a known-issues section.
  • Decide whether to commit a clean M1 checkpoint before M2.

Exit Criteria:

  • The build can be handed to a stakeholder for a guided demo.

Result:

  • Added docs/PILOT_QA.md with demo script, QA checklist, verification gate, packaging notes, and known issues.
  • Updated docs/START_HERE.md and docs/M1_HANDOFF.md to point at the pilot QA baseline.
  • No git commit was created because the working assumption remains "do not commit unless explicitly requested".

Risks

  • E2E compatibility now has explicit YINIAN bypass logic; keep it narrow and documented.
  • Real server auth semantics may force storage changes, especially refresh token handling.
  • ClawX legacy pages still exist; YINIAN navigation must avoid exposing implementation/admin surfaces to business customers too early.
  • Skill registry is ready for OTA later, but real bundle download/signature verification remains intentionally out of scope.

Next, either create a clean checkpoint commit when requested, or start the next product phase: real server integration and first real business skill execution path.

2026-05-13 Task And Skill Management Clarification

Status: complete

Goal:

  • Remove ambiguity between quick tasks, ability-pack tasks, and scheduled tasks.
  • Restore ability-pack-owned quick-task management to the ability-pack/skills area.
  • Preserve the earlier scheduled-task creation design, including push channel selection.
  • Support adding skills into task editing content through @ mentions.

Tasks:

  • Inspect current ability-pack, quick-task, scheduled-task, and task editor code paths.
  • Recover earlier scheduled-task and quick-task design from local git history if current code no longer contains it.
  • Implement UI/data-flow changes with minimal disruption to existing stores and APIs.
  • Add or update focused tests for quick-task management, scheduled-task push channels, and skill insertion.
  • Run typecheck and targeted tests.

Exit Criteria:

  • Quick tasks that belong to ability packs are managed from the ability-pack UI.
  • Scheduled-task creation/editing still exposes the important earlier fields, especially push channels.
  • Task editing can insert a skill mention into the editor via @.

Result:

  • Restored the ability-pack quick-task tab in YinianSkills, including edit/save support.
  • Renamed the user-facing ability-pack concept from “快捷任务” to “快捷能力” to avoid confusion with scheduled/manual tasks.
  • Changed Task Center's quick tab into a run-now surface and removed quick-task creation/editing from it.
  • Brought scheduled-task delivery mode, channel, account, and target selection into the Task Center scheduled dialog.
  • Added @ skill insertion in manual/scheduled task textareas, inserting the existing 使用{name} skill trigger text.
  • Verification passed:
    • pnpm run typecheck
    • pnpm vitest run tests/unit/yinian-skills-page.test.tsx tests/unit/tasks-page.test.tsx
    • pnpm test (97 files / 638 tests; existing MaxListeners warnings remain)

2026-05-13 Task Center Separation Follow-up

Status: complete

Goal:

  • Fully separate quick capabilities from Task Center.
  • Keep Task Center focused on scheduled tasks and run history.
  • Remove quick-capability template selection from scheduled-task creation.
  • Fix @ capability mention keyboard navigation.
  • Make custom execution time friendlier than raw cron entry.

Tasks:

  • Remove quick-capability run/manage surfaces from Task Center.
  • Remove quick-capability template selection and binding creation from scheduled-task dialog.
  • Improve @ mention keyboard selection behavior.
  • Replace raw custom cron entry with a structured custom schedule form while preserving cron payload output.
  • Update locale copy and focused tests.
  • Run typecheck and relevant tests.

Exit Criteria:

  • Task Center no longer exposes quick capabilities as a task type.
  • New scheduled tasks are authored directly with content plus optional @ capability insertion.
  • ArrowUp/ArrowDown/Enter can reliably choose a capability mention.
  • Custom execution time is understandable through form controls and still saves a cron expression.

Result:

  • /tasks now defaults to scheduled tasks and only exposes Scheduled Tasks plus Run History tabs.
  • Scheduled-task creation/editing no longer offers quick-capability template selection or creates quick-capability bindings.
  • Existing scheduled-task binding cleanup remains on edit/delete so stale local quick-capability associations are removed opportunistically.
  • @ mention suggestions now preserve active selection across keyup, support Enter insertion, and scroll the active option into view when the browser supports it.
  • Custom execution time now uses structured controls for daily, weekly, monthly, and minute-interval schedules, with advanced Cron kept as a fallback.
  • Verification passed:
    • pnpm run typecheck
    • pnpm vitest run tests/unit/tasks-page.test.tsx tests/unit/task-center-store.test.ts
    • pnpm test (97 files / 638 tests; existing MaxListeners warnings remain)
    • pnpm run build:vite (existing Vite chunk warnings remain)
    • pnpm exec playwright test tests/e2e/yinian-delivery-smoke.spec.ts

Errors Encountered:

  • The first targeted E2E run still saw tasks-tab-quick because Electron E2E was using stale dist output. Rebuilt with pnpm run build:vite and reran the same E2E successfully.
  • jsdom does not implement scrollIntoView; guarded the mention-list scroll call so browser scrolling remains while tests and older DOM environments do not fail.

2026-05-13 Task Center Pinning Follow-up

Status: complete

Goal:

  • Rename the scheduled-task surface to Task Center without changing any time-setting controls.
  • Let each task card pin/unpin itself to the left sidebar.
  • Let pinned sidebar tasks trigger immediately from the sidebar.

Tasks:

  • Update task-center copy that still says scheduled task where it names the product surface, leaving execution-time labels untouched.
  • Add persisted pinned task ids to task-center store.
  • Add pin/unpin controls to task cards.
  • Render pinned task quick triggers in the left sidebar and wire immediate execution.
  • Add/update focused tests.
  • Run typecheck and relevant test/build checks.

Exit Criteria:

  • Time configuration controls and labels are unchanged.
  • Task cards can be pinned to the sidebar.
  • Sidebar pinned tasks can be clicked to run immediately.

Result:

  • Renamed the scheduled-task product surface copy to “任务中心” / “Task Center” while preserving execution-time labels and controls.
  • Added yinian:pinned-task-ids local persistence through useTaskCenterStore.
  • Added task-card pin/unpin controls.
  • Sidebar now renders pinned task quick triggers and calls the existing cron trigger API immediately on click.
  • Sidebar-triggered runs are also recorded in task run history.
  • Verification passed:
    • pnpm run typecheck
    • pnpm vitest run tests/unit/tasks-page.test.tsx tests/unit/task-center-store.test.ts tests/unit/today-page.test.tsx
    • pnpm test (97 files / 640 tests; existing MaxListeners warnings remain)
    • pnpm run build:vite (existing Vite chunk warnings remain)
    • pnpm exec playwright test tests/e2e/yinian-delivery-smoke.spec.ts

2026-05-13 Task Center Density And Sidebar Structure

Status: complete

Goal:

  • Convert Task Center from card-grid management to dense list management.
  • Preserve important task actions: enable/disable, pin, run now, edit, open session, delete, delivery visibility, and execution metadata.
  • Improve sidebar structure so pinned quick triggers are contained and the navigation remains scannable.

Tasks:

  • Apply data-dense dashboard guidance to Task Center layout.
  • Replace task-card grid with a responsive list/table layout.
  • Keep all execution-time controls untouched.
  • Restructure sidebar navigation and pinned triggers into a scrollable, organized area.
  • Update focused tests if accessible labels or copy change.
  • Run typecheck, focused tests, full tests, and E2E/build checks as needed.

Exit Criteria:

  • Task Center uses a compact list layout and shows more tasks per screen.
  • All existing task actions remain available.
  • Sidebar groups are clearly separated and pinned tasks do not overwhelm the menu.

Result:

  • Replaced the task card grid with a compact list/table layout that keeps task name/content, enabled state, schedule metadata, delivery info, pin, run, edit, open-session, and delete actions in each row.
  • Moved scheduled-task metrics into compact chips in the panel header.
  • Kept ScheduledTaskDialog execution-time controls unchanged.
  • Put sidebar navigation into a scrollable structured area and bounded pinned quick triggers so chat/settings remain reachable.
  • Verification passed:
    • pnpm run typecheck
    • pnpm vitest run tests/unit/tasks-page.test.tsx tests/unit/task-center-store.test.ts tests/unit/today-page.test.tsx
    • pnpm test (97 files / 640 tests; existing MaxListeners warnings remain)
    • pnpm run build:vite (existing Vite chunk warnings remain)
    • pnpm exec playwright test tests/e2e/yinian-delivery-smoke.spec.ts

2026-05-13 Immediate History Session Visibility

Status: complete

Goal:

  • Make newly started sessions appear in the sidebar history immediately instead of waiting for sessions.list.
  • Cover both desktop new chats and Task Center / background automation sessions.

Tasks:

  • Add a shared local session visibility patch for optimistic history rows.
  • Mark new desktop sessions with updatedAt so they sort into the visible history area without turning into permanent activity.
  • Mark outgoing messages as active sessions immediately.
  • Mark cron trigger and Gateway started/completed sessions visible immediately.
  • Add focused regression tests.
  • Run typecheck, focused tests, full tests, build, and smoke E2E.

Result:

  • New blank sessions get a local updatedAt immediately, so the history list can show them near the top while cleanupEmptySession can still remove unused blanks.
  • Sending a first message now upserts the session row, label, and activity timestamp in one store update.
  • Cron trigger calls insert a visible agent:main:cron:<id> session with the task name before the backend refresh returns.
  • Gateway started/completed notifications insert background sessions optimistically, so scheduled automation runs appear as soon as the frontend hears about them.
  • Verification passed:
    • pnpm run typecheck
    • pnpm vitest run tests/unit/chat-session-actions.test.ts tests/unit/gateway-events.test.ts tests/unit/cron-store-fetch-dedupe.test.ts tests/unit/tasks-page.test.tsx tests/unit/task-center-store.test.ts
    • pnpm test (98 files / 645 tests; existing MaxListeners warnings remain)
    • pnpm run build:vite (existing Vite chunk warnings remain)
    • pnpm exec playwright test tests/e2e/yinian-delivery-smoke.spec.ts

2026-05-13 Task Execution Conversation Follow-up

Status: complete

Goal:

  • Treat each Task Center task as one stable follow-up conversation.
  • Jump to that conversation immediately after user-triggered execution.

Tasks:

  • Use a stable agent:main:cron:<jobId> session key for Task Center execution records and open-session actions.
  • Switch to the fixed task session and navigate to Chat when clicking Task Center "Run now".
  • Switch to the fixed task session and navigate to Chat when using sidebar pinned task triggers.
  • Add a regression test for Task Center "Run now" switching to the fixed task conversation.
  • Run typecheck, focused tests, full tests, build, and smoke E2E.

Result:

  • Task Center run-now and sidebar pinned triggers now immediately open the task's fixed conversation.
  • Each execution of the same task continues to land in the same agent:main:cron:<jobId> session, keeping follow-up context together.
  • Verification passed:
    • pnpm run typecheck
    • pnpm vitest run tests/unit/tasks-page.test.tsx tests/unit/task-center-store.test.ts tests/unit/cron-store-fetch-dedupe.test.ts tests/unit/chat-session-actions.test.ts
    • pnpm test (98 files / 646 tests; existing MaxListeners warnings remain)
    • pnpm run build:vite (existing Vite chunk warnings remain)
    • pnpm exec playwright test tests/e2e/yinian-delivery-smoke.spec.ts

2026-05-13 Task Conversation Naming

Status: complete

Goal:

  • Show Task Center conversations directly with the task name.
  • Prevent task conversations from being renamed to the first execution prompt.

Tasks:

  • Force task session label/displayName to the task name when running, opening, or sidebar-triggering a task.
  • Keep cron session labels protected during history hydration and message sends.
  • Let Gateway automation events backfill the task name from local cron jobs when available.
  • Add focused regression coverage.
  • Run typecheck, focused tests, full tests, build, and smoke E2E.

Result:

  • Task sessions now display the task name directly instead of agent:main:cron:<id> or task prompt text.
  • History refresh no longer overwrites cron task names with the first user message.
  • Verification passed:
    • pnpm run typecheck
    • pnpm vitest run tests/unit/tasks-page.test.tsx tests/unit/chat-history-actions.test.ts tests/unit/cron-store-fetch-dedupe.test.ts tests/unit/gateway-events.test.ts tests/unit/chat-session-actions.test.ts
    • pnpm test (98 files / 647 tests; existing MaxListeners warnings remain)
    • pnpm run build:vite (existing Vite chunk warnings remain)
    • pnpm exec playwright test tests/e2e/yinian-delivery-smoke.spec.ts

2026-05-13 Task History Merge Reliability

Status: complete

Goal:

  • Fix task conversations sometimes showing no prior history or only the current prompt.
  • Preserve the stable task conversation while merging available Gateway transcript and cron run-log fallback history.

Tasks:

  • Diagnose task conversation history loading.
  • Merge cron fallback history even when chat.history returns partial messages.
  • Deduplicate near-identical fallback/Gateway messages.
  • Make failed cron run fallback messages visible instead of filtered as system messages.
  • Add regression tests for partial Gateway history and failed run fallback visibility.
  • Run typecheck, focused tests, full tests, build, and smoke E2E.

Result:

  • Cron task sessions now combine Gateway chat.history with /api/cron/session-history instead of using the fallback only when Gateway history is empty.
  • If Gateway only returns the current execution prompt, previous cron run summaries still appear in the same task conversation.
  • Failed task run fallback messages now render as assistant messages with isError, so failures are visible in the task conversation.
  • Verification passed:
    • pnpm run typecheck
    • pnpm vitest run tests/unit/chat-history-actions.test.ts tests/unit/cron-routes.test.ts tests/unit/tasks-page.test.tsx tests/unit/gateway-events.test.ts tests/unit/cron-store-fetch-dedupe.test.ts
    • pnpm test (98 files / 649 tests; existing MaxListeners warnings remain)
    • pnpm run build:vite (existing Vite chunk warnings remain)
    • pnpm exec playwright test tests/e2e/yinian-delivery-smoke.spec.ts

2026-05-12 Customer Clean Install Stabilization

Status: complete

Goal:

  • Fix the customer clean-install path where the app restores an old login/session, skips initialization, starts Gateway, then cannot chat because the managed OpenClaw runtime is incomplete.

Tasks:

  • Inspect customer logs and screenshots.
  • Confirm packaged runtime is missing docs/reference/templates/AGENTS.md.
  • Confirm managed runtime cannot resolve OpenClaw self-imports such as openclaw/plugin-sdk/provider-model-shared.
  • Preserve required OpenClaw runtime templates in bundled and packaged resources.
  • Add a self-reference package/symlink for managed runtime module resolution.
  • Make setup status validate actual runtime files instead of trusting only setupComplete.
  • Prevent Gateway auto-start unless setup is verified complete and user is authenticated.
  • Restore NianxxPlay compiled generated-results route while still excluding user generated files.
  • Verify with bundle/build checks and targeted tests.

Current Findings:

  • Customer log shows Missing workspace template: AGENTS.md during chat.
  • Customer log shows ERR_MODULE_NOT_FOUND: Cannot find package 'openclaw' imported from .../dist/extensions/codex/prompt-overlay.js.
  • Customer log shows providerKeys=0 and diagnostics screenshot shows missing local model credentials; this remains a likely next blocker after runtime repair.
  • NianxxPlay also reported missing .next/server/app/generated-results/[...path]/route.js after excluding generated results; the bundle filter now keeps compiled routes while continuing to exclude public/generated-results.

Enterprise Space Service Integration

Status: in_progress

Goal:

  • Connect the desktop client to the service-side enterprise space and application/skill distribution APIs.
  • Keep the current single-account-single-service product assumption, while making backend endpoints configurable enough to match CloudClaw once repository access is available.

Tasks:

  • Check whether https://git.nianxx.cn/brother7/CloudClaw can be read from this workspace.
  • Record the current desktop API assumptions for enterprise space, config, and app manifest.

2026-05-13 Task Center Iteration

Status: complete

Goal:

  • Promote tasks into a primary product module so ordinary business users can reuse capability-pack workflows manually or on a schedule.

Completed:

  • Added /tasks and redirected /cron to /tasks?tab=scheduled.
  • Reworked the customer sidebar into 快速使用 / 任务 / 对话 business groups.
  • Added task center tabs: 快捷任务、定时任务、执行记录.
  • Moved visible quick-task configuration out of the capability-pack settings tab.
  • Added unified quick-task prompt composition shared by chat and task execution.
  • Added local scheduled-task bindings and task run record persistence with separate storage keys:
    • yinian:scheduled-task-bindings
    • yinian:task-run-records
  • Added tasks i18n namespace for Chinese and English.
  • Updated delivery smoke to cover task center and /cron compatibility.
  • Added unit coverage for prompt construction and task-center store behavior.

Verification:

  • pnpm run typecheck
  • pnpm test
  • pnpm run build:vite
  • pnpm exec playwright test tests/e2e/yinian-delivery-smoke.spec.ts
  • Add configurable endpoint support for enterprise space/config/app manifest APIs.
  • Normalize common backend field names for app/skill manifests.
  • Add fallback behavior when the enterprise space service has not implemented config or manifest endpoints yet.
  • Add focused tests for enterprise space and manifest normalization.
  • Run typecheck and focused unit tests.

Known Blocker:

  • Anonymous git access requires authentication, but source was readable through the user's logged-in Chrome session.
  • Current CloudClaw backend does not yet expose enterprise app/skill distribution APIs; desktop falls back to empty registry until those routes are added.

Product Simplification Pass

Status: complete

Goal:

  • Remove customer-facing fields and metrics that are not supported by the real service today.
  • Keep the product lighter and more credible for non-technical enterprise users.

Tasks:

  • Audit login, sidebar, Today, Settings, mock control-plane, and tests for unsupported business claims.
  • Remove account profile fields such as role/job/location when they are not returned by the server contract.
  • Remove or replace unsupported operational metrics such as health score/运营健康度.
  • Keep only service-backed or local-real features:
    • 登录
    • 当前服务名称
    • 应用列表/同步状态
    • 知识库文件
    • 对话与历史
    • 定时任务入口
  • Run focused and full verification.

Result:

  • Today now shows service/application readiness instead of unsupported operational health, fake pending business metrics, or recent run traces.
  • Login no longer claims fixed time savings, fixed v1 app counts, or frontend key ownership.
  • Sidebar and Settings no longer show service city/role/profile metadata.
  • Shared YINIAN service type no longer models role/city/permissions/OTA as product-level fields.
  • Mock fixtures and contract examples now use generic B-end service/application language.

UI Customization Phase 1: Brand Foundation

Status: complete

Tasks:

  • Persist project-level design system for 智念助手.
  • Create a new app icon concept and SVG sources.
  • Generate desktop icon outputs for macOS, Windows, and Linux.
  • Rename customer-facing product surfaces to 智念助手.
  • Update packaging metadata, desktop shortcut names, tray labels, and window title.
  • Keep low-level ClawX/OpenClaw technical compatibility names where they still protect inherited behavior.

Result:

  • Added design-system/智念助手/MASTER.md.
  • Updated resources/icons/, src/assets/logo.svg, electron-builder.yml, package.json, Login, Sidebar, TitleBar, tray, and startup metadata.
  • Verification passed.

Next UI Step:

  • Continue with UI Customization Phase 2: extend YINIAN primitives into a fuller design kit and refactor Login/Today/Skills shell details against the new brand system.

UI Customization Phase 2: Core Surface Refinement

Status: complete

Tasks:

  • Extend src/components/yinian/ui.tsx with reusable primitives for mature product surfaces.
  • Refine Login into a more branded enterprise desktop entry.
  • Refactor Today onto section panels, metric cards, info rows, and list items.
  • Refactor Skills Manager card internals onto shared info rows and panels.
  • Refine sidebar service context as a workspace context surface.
  • Verify typecheck, focused unit tests, and Vite build.

Result:

  • Core YINIAN pages now share a stronger design vocabulary without changing backend/session/skill semantics.

Next UI Step:

  • Continue with UI Customization Phase 3: visual QA and polish pass across sidebar density, Chat/Settings inherited ClawX pages, and customer/admin navigation boundaries.

UI Customization Phase 3: Inherited Surface Brand Boundary

Status: complete

Tasks:

  • Group Sidebar navigation into B-end operations, AI work, and extension sections.
  • Keep existing route test ids and navigation behavior stable.
  • Replace major Chinese customer-visible Chat/Settings/Setup ClawX strings with 智念助手.
  • Swap Setup welcome logo alt/asset to 智念助手.
  • Verify typecheck, focused unit tests, Vite build, and navigation E2E.

Result:

  • Customer-facing shell now has a clearer information architecture and less inherited ClawX branding.

Next UI Step:

  • Continue with UI Customization Phase 4: full visual QA screenshots and deeper inherited page polish for Chat, Settings, Channels, Agents, Models, and Cron.

UI Customization Phase 4: Inherited Page Visual Polish

Status: complete

Tasks:

  • Remove oversized serif title treatment from inherited Chat, Settings, Models, Agents, Channels, and Cron surfaces.
  • Normalize inherited page headings toward the 智念助手 system-font dashboard style.
  • Remove remaining major Chinese customer-visible ClawX copy from Agents, Cron, Channels, Chat, Settings, and Setup.
  • Keep technical GitHub/upstream references available where still useful.
  • Verify typecheck, focused unit tests, Vite build, and inherited navigation/provider E2E.

Result:

  • Inherited pages now feel less like the original ClawX shell and closer to the 智念助手 product system while preserving behavior.

Next UI Step:

  • Continue with UI Customization Phase 5: screenshot-based visual QA across authenticated YINIAN flow and legacy E2E flow, then fix concrete layout issues found at desktop widths.

UI Customization Phase 5: Screenshot Visual QA

Status: complete

Tasks:

  • Add a production YINIAN visual smoke test that bypasses legacy setup only at the renderer level.
  • Capture desktop screenshots for Login, Today, and Skills at 1440x900.
  • Fix the fresh-user production routing issue where legacy setup could override the 智念登录入口.
  • Verify typecheck, Vite build, and the new visual smoke test.

Result:

  • Added tests/e2e/yinian-visual-smoke.spec.ts.
  • Baseline screenshots are written to test-results/yinian-visual/01-login.png, 02-today.png, and 03-skills.png.
  • Fresh production sessions now land on /login before authentication and /today after login.

Next UI Step:

  • Continue with per-surface detail polish for Settings, Channels, Agents, Models, and Cron, using screenshot comparison as the acceptance gate.

Product Positioning Pass: B-end Workspace Model

Status: complete

Tasks:

  • Change the primary navigation group to 快速使用.
  • Replace customer-visible hotel-specific copy with workspace/business-object language.
  • Update mock tenant names and demo skill labels for broader B-end demos.
  • Add forward-compatible workspace aliases without breaking existing storage/API field names.
  • Refresh visual screenshots and verification after the repositioning pass.

Result:

  • 智念助手 now reads as a configurable B-end AI Agent desktop product, where different customers can install or receive tailored Skills for their own business object.
  • Existing hotelId/hotel_id internals remain intentionally stable until a dedicated server-contract migration is planned.

Next Product Step:

  • Define the generic tenant model in the PRD/server contract (workspace / businessObject) and plan a controlled API rename only after server compatibility is clear.

Shell Simplification Pass: Account-Bound Service

Status: complete

Tasks:

  • Remove the old top workspace bar from the authenticated shell.
  • Move current service identity into the left sidebar.
  • Remove workspace selection from the customer-facing shell.
  • Move sync and logout controls into the sidebar footer.
  • Refresh screenshot QA after the shell change.

Result:

  • The product now assumes one account corresponds to one B-end service in the UI, while lower-level compatibility fields remain untouched.

Next UI Step:

  • Continue simplifying inherited admin surfaces so the left sidebar remains the single persistent navigation and account-control surface.

Sidebar IA Pass: Service-Managed Configuration

Status: complete

Tasks:

  • Hide developer/configuration surfaces from the production sidebar.
  • Keep Models, Agents, Channels, and Cron available only through E2E compatibility navigation.
  • Reorganize the customer-facing sidebar around two primary areas: 快速使用 and 对话.
  • Move account actions and service-managed capability notices into Settings.
  • Add Settings to the visual smoke baseline.

Result:

  • The production shell now presents Today, Skills, New Chat, Chat, and Settings as the only persistent customer navigation.
  • Model/provider, Agent orchestration, channel, and scheduled-task configuration are documented in Settings as service-side managed capabilities.
  • Logout and service config sync live in Settings instead of competing with the primary sidebar navigation.

Next UI Step:

  • Continue refining the Chat landing layout so the 对话 area feels as deliberate as 快速使用.

Sidebar UX Pass: Dashboard Card, Quick Use, Chat History

Status: complete

Tasks:

  • Move Dashboard entry from the quick-use menu to the top service card.
  • Rebuild 快速使用 as three direct actions: Skills, 定时任务, 知识库.
  • Add a Knowledge page and route for user-uploaded files.
  • Rebuild the 对话 area as New Chat plus hoverable History.
  • Make History click open the latest session and hover reveal the history list.
  • Refresh visual smoke screenshots and compatibility navigation E2E.

Result:

  • The sidebar now reads as a compact launch surface: service card for Dashboard, quick actions for tools, and a quiet chat module with history on demand.
  • Knowledge Base v0 is implemented as a local upload/list/search surface, ready for later server indexing.

Next UI Step:

  • Upgrade Knowledge Base from local UI state to persisted service-scoped registry when the server API is ready.

CloudClaw Direct Plugin Install Pass

Status: complete

Tasks:

  • Read CloudClaw repository through the user's logged-in browser session.
  • Confirm the available integration point is plugins/openclaw-cloud-sync.
  • Build a 智念内置 cloud-sync OpenClaw plugin mirror.
  • Auto-install the mirror into ~/.openclaw/extensions/cloud-sync before Gateway launch.
  • Auto-write plugins.entries.cloud-sync.config.serverUrl into openclaw.json.
  • Include the static plugin mirror in dev build and packaged afterPack flows.
  • Patch plugin metadata and command registration shape for the current OpenClaw runtime.
  • Verify Gateway startup and openclaw plugins list show cloud-sync as loaded.

Result:

  • CloudClaw's existing OpenClaw cloud-sync plugin is now directly installed and enabled by 智念助手.
  • This does not yet mean enterprise application/skill distribution is available from CloudClaw; that server API still does not exist in the inspected repo.

Next Integration Step:

  • Decide whether 智念助手 should expose Cloud Sync as a customer-facing setting/action, or keep it hidden as infrastructure until the CloudClaw server URL and account contract are finalized.

Version 3.5: Application Center Large-App Integration

Status: planned

Goal:

  • Move 应用中心 from a lightweight launcher into the first real large-application host inside 智念助手.
  • Keep 能力包 focused on agent/skill capability expansion, while 应用中心 hosts fixed product applications that may be native React modules or embedded web applications.
  • Use one large application as the 3.5 proving ground for routing, launch/close behavior, state persistence, permissions, service context, and desktop-grade UX.

Current Baseline:

  • 应用中心 exists at /app-center with a compact app-launcher layout.
  • Built-in app registry exists in src/stores/app-center.ts.
  • App item typing exists in src/types/app-center.ts and shared YINIAN app-center types.
  • Small built-in demo apps have been removed from the customer-facing app center.
  • 应用中心 now focuses on the single NianxxPlay large-app entry.
  • 能力包 has been renamed from application/skill language and now owns 快捷任务配置.
  • 快捷任务 can inject 使用{能力包名称} skill into the chat send path, is single-select, and is single-use per send.
  • Dev port has moved from 5173 to 5188 to avoid local project conflicts.

Target Large App Candidate:

  • Local project path: /Users/inmanx/Documents/NianxxPlay.
  • Product name: NianxxPlay智念视频助手.
  • Current positioning: Seedance 2.0 AI video generation workspace for ordinary users and local merchants.
  • Current modes:
    • 宣传片制作
    • 创意复刻
  • Technical shape:
    • Next.js 15 app router application.
    • Own routes for home, studio, projects, project details, billing, and API routes.
    • Own local MVP data layer at .data/app-state.json.
    • Own asset upload, OSS, Seedance task creation/query, prompt assembly, project history, and credit logic.
  • Verified status:
    • npm test: passed, 3 files / 11 tests.
    • npm run build: passed, with existing ali-oss dependency-chain dynamic require warning.
  • Integration implication:
    • NianxxPlay is too large to treat like a small native utility route.
    • It is a good 3.5 candidate for an embedded web large-app host, with a local service process during internal testing and a packaged/served app strategy later.

Scope For 3.5:

  • Define the large-app host contract:
    • app identity, source, type, route/url, icon, description, permissions, and service-context needs
    • native app vs embedded web app launch behavior
    • close/back behavior and app-level route ownership
    • app state restore boundary
  • Upgrade 应用中心 UI from static launcher-only semantics to an app hub:
    • launch large apps
    • show fixed built-in apps clearly
    • keep tag filtering compact
    • avoid introducing “enable/disable” semantics for applications
  • Integrate the first large application:
    • choose app name and business workflow
    • decide native React implementation vs embedded web
    • define data/API dependencies and local fallback behavior
    • add route shell, loading/error/empty states, and close behavior
  • Add verification:
    • app-center unit tests for registry/filter/launch decisions
    • large-app smoke tests
    • pnpm run typecheck
    • pnpm run build:vite
    • targeted visual check at desktop size

Out Of Scope Until Explicitly Promoted:

  • App marketplace/downloading from server.
  • Multi-window app management.
  • Server-driven per-user app permissions unless the backend contract is ready.
  • Real embedded web sandbox hardening beyond the first controlled integration.

Risks:

  • Current 应用中心 uses a static local registry; large-app delivery may need a stronger manifest and app lifecycle model.
  • Current webview-type apps open externally; true embedded web applications need a safer host strategy.
  • Large apps may need their own navigation and data domain, so they should not be crammed into the small-card launcher model.
  • Customer-facing naming must keep 应用中心 and 能力包 distinct: 应用中心 opens product apps; 能力包 expands agent capabilities.

Next Recommended Action:

  • Use NianxxPlay as the concrete 3.5 target.
  • First implement an embedded-web app host inside 智念助手:
    • app launcher entry
    • app detail/host route
    • loading, error, reload, close/back controls
    • local development URL support
    • safe external-link behavior
  • Then connect the NianxxPlay local dev app as the first hosted large application before deciding the production packaging strategy.

Version 3.5: Bundled NianxxPlay Runtime

Status: planned

Goal:

  • Ship NianxxPlay as a desktop-managed companion application.
  • 智念助手 should install, update, launch, stop, and health-check NianxxPlay together with the desktop app.
  • Customers should not need Node.js, npm, pnpm, Next.js, or terminal knowledge.

Preferred Architecture:

  • Build NianxxPlay as a Next.js standalone server bundle.
  • Copy the standalone bundle into build/apps/nianxx-play/.
  • Add the bundle to electron-builder.yml as an extraResources entry, similar to bundled OpenClaw.
  • At first-run or app update, copy the bundled app into an app-managed user runtime directory:
    • macOS/Linux: under app userData or ~/.zhinian/apps/nianxx-play
    • avoid writing mutable state into process.resourcesPath
  • Launch the app from Electron main process as a managed child runtime.
  • Host it in 智念助手 through an embedded web app route, using a local loopback URL.

Required NianxxPlay Changes:

  • Add output: 'standalone' to next.config.ts.
  • Move mutable local data away from process.cwd():
    • .data/app-state.json
    • local upload fallback storage
  • Support env-driven runtime paths:
    • NIANXXPLAY_DATA_DIR
    • NIANXXPLAY_UPLOAD_DIR
    • NIANXXPLAY_PUBLIC_BASE_URL
  • Do not bundle .env.local.
  • Move real API keys to desktop-managed secure configuration or future server-issued config.
  • Make the app work behind a dynamic local port instead of assuming localhost:3000.

Required Desktop Changes:

  • Add an electron/apps/nianxx-play runtime manager:
    • resolve bundled and managed app paths
    • install/update managed app from bundled resources
    • find a free local port
    • launch and stop the standalone server
    • probe health/readiness
    • expose app status over IPC
  • Add an application host route:
    • /app-center/nianxx-play
    • loading, error, reload, close/back controls
    • embedded webview/iframe target URL from app runtime manager
  • Add setup/update integration:
    • initialization step for bundled applications
    • runtime diagnostics in Settings
    • shutdown cleanup on app quit
  • Add packaging scripts:
    • bundle-nianxx-play.mjs
    • package/build pipeline integration
    • release artifact size check

Main Risks:

  • public/seedance-starter-assets is currently large, roughly hundreds of MB, and will significantly increase installer size.
  • The current NianxxPlay project root is about 1GB mostly due to node_modules, .next/cache, and media assets; production bundling must exclude dev cache and raw node_modules.
  • Next.js standalone output still needs static assets and selected runtime dependencies.
  • API keys in .env.local are sensitive and must never be shipped as a plain file.
  • If NianxxPlay runs as an HTTP server, port management and crash recovery must be owned by the desktop main process.
  • Local-only uploaded files cannot be used by Seedance unless they are reachable via public OSS; the local fallback remains preview-only.

Acceptance Criteria:

  • Fresh customer install can open NianxxPlay from 应用中心 without installing Node/npm.
  • App restart restores NianxxPlay project history from the app-managed data directory.
  • Desktop update can replace NianxxPlay code without deleting user projects/assets.
  • App quit stops the managed NianxxPlay process.
  • pnpm run typecheck, pnpm run build:vite, NianxxPlay npm test, and NianxxPlay npm run build pass.

Service-Managed Boundary:

  • NianxxPlay account, permission, secret, quota, and billing decisions belong to the server.
  • The desktop app must not expose real service credentials in UI or ship them in plain files.
  • Desktop responsibilities are limited to:
    • local installation/update of the application bundle
    • process lifecycle
    • health status
    • embedded display inside 应用中心
    • passing only server-issued, scoped runtime context when needed.

Version 3.5: NianxxPlay Bundling Implementation Pass

Status: implemented in first pass

Goal:

  • Move NianxxPlay from a development-only embedded URL to a packageable desktop companion app.
  • Keep the existing 应用中心 UI and product flow intact.
  • Make packaged builds launch NianxxPlay without requiring customers to install Node.js, npm, pnpm, or Next.js.

Implementation Steps:

  • Configure NianxxPlay for Next.js standalone output.
  • Add a desktop packaging script that:
    • builds NianxxPlay
    • copies only standalone runtime files, static assets, public assets, and content manifests
    • excludes .env*, .data, dev caches, and raw development dependencies
    • writes a bundle manifest for diagnostics
  • Include the prepared bundle through electron-builder.yml extra resources.
  • Update the Electron-side NianxxPlay service manager to:
    • resolve source-project runtime in development
    • resolve bundled standalone runtime in packaged builds
    • start standalone bundles through Electron's own Node runtime via ELECTRON_RUN_AS_NODE
    • inject a user-writable data directory and upload/result directories
    • stop the managed process on app quit
  • Update NianxxPlay local persistence to respect desktop-managed runtime paths.

Verification:

  • NianxxPlay npm run build
  • desktop pnpm run prepare:nianxx-play
  • desktop pnpm run typecheck
  • desktop pnpm run build:vite
  • confirm no .env* files are copied into bundled resources

Mac Pilot: Optional Native Clipboard Gatekeeper Fix

Status: complete

Goal:

  • Stop the repeated macOS security prompt for clipboard.darwin-arm64.node on customer machines.

Implementation:

  • Remove optional @mariozechner/clipboard* packages at OpenClaw bundle generation time.
  • Bump the Yinian OpenClaw runtime patch marker so existing managed runtimes reinstall from the cleaned bundle.
  • Clean known user OpenClaw dependency caches before Gateway launch, covering prior pilot installs.
  • Add a focused unit test for runtime cleanup behavior.

Verification:

  • pnpm run typecheck
  • pnpm vitest run tests/unit/optional-native-cleanup.test.ts
  • pnpm run build:vite
  • pnpm exec zx scripts/bundle-openclaw.mjs
  • find build/openclaw -name 'clipboard.darwin-arm64.node' -o -path '*@mariozechner/clipboard*' returns no output.

2026-05-06 Complete Project Self Check

Status: complete

Goal:

  • Re-run the delivery health checks after the latest mac pilot fixes.
  • Stabilize stale test expectations that no longer matched the current product language and homepage/ability-pack UI.
  • Verify the pilot packaging resource chain without producing a new customer installer.

Verification:

  • pnpm vitest run tests/unit/language-detection.test.ts tests/unit/chat-session-actions.test.ts tests/unit/task-visualization.test.ts tests/unit/today-page.test.tsx tests/unit/yinian-skills-page.test.tsx: passed, 29 tests.
  • pnpm test: passed, 93 files / 620 tests.
  • pnpm run typecheck: passed.
  • pnpm run package:pilot: passed.
  • Resource scans:
    • no tavily in resources/skills/preinstalled-manifest.json or build/preinstalled-skills.
    • no clipboard.darwin-arm64.node or @mariozechner/clipboard* under build/openclaw or release.
    • NianxxPlay bundle includes server.js, node_modules/next/package.json, and .env.runtime.
    • NianxxPlay bundle scan found no bundled upload directory, generated-results directory, or .next/cache.

Notes:

  • Removed tavily-search from the preinstalled skills manifest and regenerated build/preinstalled-skills.
  • package:pilot still emits known Vite chunk/dynamic-import warnings and OpenClaw patch-skip warnings.
  • NianxxPlay bundle remains large, currently about 419 MB in build/apps/nianxx-play.

2026-05-09 Office Skills Runtime Hardening

Status: complete

Goal:

  • Consolidate the new MiniMax office/document skills so customer installs do not fall back to "please install LibreOffice/global npm/pip" guidance.
  • Ensure startup/initialization can prepare the common runtime layer for docx, pdf, pptx, and xlsx.
  • Keep the public skill names stable as docx, pdf, pptx, and xlsx.

Implementation Steps:

  • Confirm the MiniMax replacement bundle is generated with stable frontmatter names and Zhinian runtime policies.
  • Add a reusable office-skill dependency check/repair path for:
    • bundled/project Node modules used by pptx
    • managed Python 3.12 plus common packages used by pdf/xlsx
    • .NET availability for docx
  • Trigger the repair path during Gateway warmup without blocking normal startup more than necessary.
  • Expose the result through diagnostics/admin tooling so support can see what is missing.
  • Validate with typecheck and targeted runtime scans.

Verification:

  • pnpm run bundle:preinstalled-skills: passed.
  • Managed Python 3.12 import check: pypdf, reportlab, pandas, openpyxl, matplotlib, and bs4 all import successfully.
  • openclaw config validate: passed after removing invalid provider timeoutSeconds and models.pricing writes.
  • openclaw skills list --json: docx, pdf, pptx, xlsx, and design are openclaw-managed and enabled.
  • pnpm run typecheck: passed.
  • pnpm vitest run tests/unit/model-diagnostics.test.ts tests/unit/diagnostics-routes.test.ts: passed, 4 tests.
  • pnpm test: passed, 93 files / 622 tests.
  • pnpm run build:vite: passed with existing Vite chunk/dynamic-import warnings.

Notes:

  • .NET is still not installed on this machine. The runtime diagnostic treats this as a visible warning for advanced docx OpenXML flows, not as a blocker for the basic office runtime.
  • OpenClaw CLI still warns that the config was last written by newer OpenClaw 2026.4.29 while the shell openclaw command is 2026.4.15; the desktop-managed runtime remains the intended source for packaged users.

2026-05-12 Customer Clean Install Stabilization

Status: complete

Goal:

  • Fix the customer clean-install failure where the app skipped initialization, entered the workspace, and then could not chat on machines without a prior OpenClaw install.

Completed:

  • Preserve OpenClaw docs/reference/templates in bundled and packaged resources.
  • Create a managed runtime self-reference at ~/.openclaw/runtime/openclaw/node_modules/openclaw.
  • Treat setupComplete as a cached hint only; main-process setup verification now resets stale state when runtime/config/model auth/office markers are missing.
  • Gate Gateway startup behind verified setup plus authenticated Yinian session.
  • Keep NianxxPlay compiled generated-results route code while excluding user-generated output directories.
  • Bundle six preinstalled skills for the pilot package: docx, pdf, pptx, xlsx, design, image-search.
  • Include internal pilot model auth and NianxxPlay runtime env for closed testing only.

Verification:

  • pnpm run typecheck: passed.
  • pnpm test: passed, 94 files / 628 tests.
  • pnpm run package:pilot: passed.
  • pnpm run package:mac:pilot:arm64: passed.
  • Packaged resource scan passed for OpenClaw templates, NianxxPlay route code, preinstalled skills, and absence of the optional clipboard native module.
  • codesign --verify --deep --strict: passed.
  • spctl --assess: rejected as Unnotarized Developer ID; notarization remains the next distribution blocker.

Deliverable:

  • /Users/inmanx/Desktop/智念助手-0.1.0-mac-arm64-20260512.dmg

2026-05-12 Design And HTML Slides Skill Split

Status: complete

Goal:

  • Keep the design capability in the Zhinian app first, then promote globally after app testing.
  • Split design direction from HTML deck execution.

Completed:

  • Upgraded design into a general design director/design-system skill for product design, UI/HTML direction, PPT narrative, brand direction, redesigns, and design reviews.
  • Added html-slides as a new preinstalled execution skill focused on browser-based HTML decks and PPTX-to-HTML conversion.
  • Bundled beautiful-html-templates HTML/JSON/runtime resources without screenshots.
  • Bundled lightweight frontend-slides references for viewport fitting, animation patterns, and PPTX extraction.
  • Bumped preinstalled versions:
    • design: 2026-05-12-design-system-v2
    • html-slides: 2026-05-12-html-slides-v1
  • Synced the local OpenClaw test install under ~/.openclaw/skills.

Verification:

  • python3 resources/skills/local/design/scripts/search.py "B2B SaaS presentation dashboard" --design-system: passed.
  • pnpm run bundle:preinstalled-skills: passed.
  • Preinstalled resource scan found no screenshots and no .app directories under html-slides.
  • python3 -m py_compile passed for both bundled and local extract-pptx.py.
  • node node_modules/openclaw/openclaw.mjs skills list --json: design and html-slides are eligible and enabled.
  • Temporary 8-slide HTML smoke deck passed 1280x720, 1440x900, and 390x844 overflow checks.

2026-05-13 Playwright Chromium Runtime Hardening

Status: in_progress

Goal:

  • Prevent customer tasks from stalling on task-time npx playwright install chromium downloads.
  • Reduce collisions between app-driven browser setup and user/manual Playwright installs.
  • Make Chromium/browser preview readiness visible in diagnostics without blocking PPT/HTML deck delivery.

Implementation Steps:

  • Set an app-scoped Playwright browser cache path in Gateway child process environment.
  • Add Office/Slides runtime diagnostics for Playwright module and Chromium binary availability.
  • Update html-slides and preinstalled skill bundling policies to forbid task-time Chromium downloads.
  • Run targeted typecheck/tests and update the generated preinstalled skill bundle if needed.

Verification:

  • pnpm run typecheck: passed.
  • pnpm run bundle:preinstalled-skills: passed after bumping pdf and html-slides skill versions.
  • pnpm vitest run tests/unit/playwright-runtime.test.ts: passed, 2 tests.
  • Real Playwright probe with app-scoped browser cache: Chromium executable exists after symlink mirroring.
  • Generated preinstalled pdf policy now forbids task-time browser installers, and html-slides policy explicitly forbids npx playwright install chromium.

2026-05-13 Cron Run Final-State Reconciliation

Status: complete

Goal:

  • Prevent Task Center from showing a recovered cron run as failed when the artifact was actually produced.

Implementation Steps:

  • Inspect local cron run logs, desktop output, and matching session trajectory files.
  • Reconcile failed cron summaries with trace.artifacts.data.finalStatus.
  • Update cron session fallback messages to prefer recovered final assistant summaries.
  • Cover the behavior with cron route tests and run project verification.

Verification:

  • pnpm run typecheck: passed.
  • pnpm vitest run tests/unit/chat-history-actions.test.ts tests/unit/cron-routes.test.ts tests/unit/tasks-page.test.tsx tests/unit/cron-store-fetch-dedupe.test.ts: passed, 32 tests.
  • pnpm test: passed, 98 files / 652 tests; existing MaxListeners warnings remain.

2026-05-13 Cron Conversation Live Refresh

Status: complete

Goal:

  • Ensure a Task Center run shows this run's query and response/running hint in its fixed task conversation without requiring manual refresh.

Implementation Steps:

  • Make cron fallback history produce visible user query and assistant running/empty messages.
  • Optimistically append current run query and running placeholder when a task is manually triggered.
  • After manual trigger completion, refresh the active fixed task conversation and clear running state.
  • Fold run-specific cron event session keys into the fixed task conversation key.
  • Force current cron conversation history refresh on terminal cron events.

Verification:

  • pnpm run typecheck: passed.
  • pnpm vitest run tests/unit/gateway-events.test.ts tests/unit/cron-store-fetch-dedupe.test.ts tests/unit/cron-routes.test.ts tests/unit/tasks-page.test.tsx: passed, 25 tests.
  • pnpm vitest run tests/unit/chat-history-actions.test.ts tests/unit/chat-session-actions.test.ts tests/unit/chat-runtime-event-handlers.test.ts tests/unit/gateway-events.test.ts tests/unit/cron-store-fetch-dedupe.test.ts tests/unit/cron-routes.test.ts tests/unit/tasks-page.test.tsx: passed, 61 tests.
  • pnpm test: passed, 98 files / 655 tests; existing MaxListeners warnings remain.

2026-05-13 Sidebar Navigation Restructure

Status: complete

Goal:

  • Make the left sidebar more structured and space-efficient:
    • conversation entry at the top, directly below Home/Today.
    • Task Center followed by up to five pinned quick tasks.
    • App Center and Knowledge moved to the bottom, above Settings.

Implementation Steps:

  • Move App Center and Knowledge from the primary quick-use area into a footer utility group.
  • Add a dedicated conversation container for New Chat and History below the service/home card.
  • Group Task Center and pinned quick task triggers together in the main navigation area.
  • Limit sidebar pinned task rendering to five items.
  • Add a unit test that locks the expected sidebar order and the five-item pinned task cap.

Verification:

  • pnpm run typecheck: passed.
  • pnpm vitest run tests/unit/sidebar-layout.test.tsx: passed, 1 test.
  • pnpm vitest run tests/unit/sidebar-layout.test.tsx tests/unit/tasks-page.test.tsx tests/unit/task-center-store.test.ts: passed, 7 tests.
  • pnpm run build:vite: passed with existing Vite chunk/dynamic-import warnings.
  • pnpm test: passed, 99 files / 656 tests; existing MaxListeners warnings remain.
  • pnpm exec playwright test tests/e2e/yinian-delivery-smoke.spec.ts: passed, 1 test.

2026-05-13 App-Scoped Local Preference Recovery

Status: complete

Goal:

  • Restore quick capabilities and channel account remarks after they appeared to disappear when the dev renderer origin changed.
  • Prevent future dev-port or renderer-origin changes from hiding local business preferences.

Implementation Steps:

  • Restart the dev app on the original data-bearing origin http://localhost:5173.
  • Add an app-level Electron local-preferences store and Host API route.
  • Sync quick capabilities from origin-local storage into app-level preferences, and hydrate from app-level preferences when the current origin has no data.
  • Sync desktop user name, workspace display name, and channel account remarks through the same app-level preference store.
  • Add unit tests for both hydration and migration directions.

Verification:

  • Confirmed the app-level preference file contains the user's quick capabilities 写word文章 and 做网页.
  • Confirmed account remarks are present, including 徐明微信, 小石的微信, 徐明飞书, and 宗琦A2A.
  • pnpm run typecheck: passed.
  • pnpm vitest run tests/unit/quick-tasks-store.test.ts tests/unit/yinian-local-prefs.test.ts: passed, 4 tests.
  • pnpm vitest run tests/unit/yinian-skills-page.test.tsx tests/unit/tasks-page.test.tsx tests/unit/sidebar-layout.test.tsx tests/unit/quick-tasks-store.test.ts tests/unit/yinian-local-prefs.test.ts: passed, 16 tests.
  • pnpm run build:vite: passed with existing Vite chunk/dynamic-import warnings.
  • pnpm test: passed, 101 files / 660 tests; existing MaxListeners warnings remain.
  • pnpm exec playwright test tests/e2e/yinian-delivery-smoke.spec.ts: passed, 1 test.