feat: add user-level WeChat channel accounts
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
# Task: 新增渠道菜单及多微信账号管理
|
||||
|
||||
## Identity
|
||||
|
||||
- Task ID: 20260913-user-channels-ml-8d61e4a9
|
||||
- Mode: Feature
|
||||
- Branch: codex/20260913-user-channels-ml-8d61e4a9-user-channels
|
||||
- Worktree: D:\Datas\OthersProjects\.codex-worktrees\makelore\20260913-user-channels-ml-8d61e4a9
|
||||
- Base commit: 46e7f6f1cd37124493be48bbb85f6a6d1de59c17
|
||||
- Owner: codex
|
||||
- Status: Ready for Integration
|
||||
|
||||
## Scope
|
||||
|
||||
- Implement the MakeLore desktop user-level Channels navigation and WeChat account workspace over the agreed user-level ChannelAccount contract.
|
||||
- Support multiple independently connected accounts, including unassigned connection, independent target selection, multiple accounts routed to one published Agent, target switching without QR, and explicit enable/pause/reconnect/disconnect controls.
|
||||
- Replace embedded Agent publication management with linked-channel summaries and a shortcut while keeping existing invitation, permission, activity, conversation, notification and recovery flows reachable from the selected account detail.
|
||||
- Own only this isolated client worktree's Renderer/Main typed client surface, focused tests, Electron E2E, README and this task record. No canonical project-memory writes, commit, merge, deploy or cleanup.
|
||||
|
||||
## Intent And Constraints
|
||||
|
||||
- Concurrent Task Gate passed: official check/status match task `20260913-user-channels-ml-8d61e4a9`, feature mode, branch and managed worktree, with base `46e7f6f1cd37124493be48bbb85f6a6d1de59c17` and owner `codex`.
|
||||
- Planning Gate passed after reading the project-memory entry, active record, integrated state, decisions, architecture/data flow, domain/success criteria, evidence/reflection/commitment/stale indexes, accepted personal cloud Agent ADR and all other planning peer scopes. The related target-picker task is read-only; old placeholder tasks are unknown coordination state without a concrete semantic dependency. No semantic conflict blocks this isolated worktree.
|
||||
- Product facts: account connection lifecycle is independent from Agent publication; target Agent is optional; route switching must preserve the connection and need no QR; account list comes from the user-level API rather than reconstructing accounts from Agent lists. Existing billing identity, Main Host API/recovery and QR challenge behavior remain.
|
||||
- Agreed contract: user-level `/api/makelore/channel-accounts`, per-account `/route` and `/wechat-bind/*`, plus operation lookup by operation ID. Existing per-Agent detail endpoints remain compatibility/detail paths. Reused details must bind to the explicitly selected account ID/binding ID.
|
||||
- Keep the native Electron light UI and current components; do not introduce a new design system or foreground backend pairing complexity. Creator self-code remains removed. Audience behavior remains unchanged.
|
||||
- Planned validation is limited to checks that can change the implementation: focused unit behavior, TypeScript, scoped lint, Vite build and the actual Electron channel fixture with screenshot inspection.
|
||||
|
||||
## Outcome
|
||||
|
||||
- Added a user-level `渠道 > 微信` workspace that reads ChannelAccounts from the agreed user-level API, supports adding an account without an Agent, account-specific QR/verification, target assignment and switching, enable/pause/reconnect/disconnect, and durable operation recovery.
|
||||
- Added typed Renderer/Main channel-account operations and safe DTO projection. Mutations use account-scoped routes, operation IDs and expected revisions; verification recovery uses the user-level operation lookup and keeps verification secrets out of the journal.
|
||||
- Preserved account identity while routing: multiple accounts may target the same published Agent, an enabled account can switch targets without starting QR again, and clearing a target leaves the route disabled.
|
||||
- Replaced the Agent Publish page's embedded management panel with linked-account summaries and shortcuts into the channel workspace. A shortcut can select an exact account or preselect the Agent for a new/unassigned account.
|
||||
- Reused the existing access, activity and personal-conversation detail flows below the selected account. The embedded form is scoped to the exact account ID/binding ID and starts directly at its tabs, without the old publication heading, setup step numbering or duplicate connection status controls.
|
||||
- Updated the Electron fixture for a legacy connected account plus an unassigned second account and captured the list, QR/target, Agent shortcut and compact account-detail states at 980x680.
|
||||
|
||||
## Verification
|
||||
|
||||
- `corepack pnpm --version`: passed with the required `10.33.4`.
|
||||
- `corepack pnpm install --frozen-lockfile`: passed.
|
||||
- Focused Vitest suites covering the account workspace, Main operation boundary, existing channel panel/recovery and Agent Publish integration: passed (the broad focused run reported 85 tests; the final Main rerun reported 25/25 after its added recovery case).
|
||||
- `corepack pnpm typecheck`: passed after the final UI simplification.
|
||||
- Scoped ESLint over the changed TypeScript/TSX files: passed after the final UI simplification.
|
||||
- `corepack pnpm run build:vite`: passed for Renderer, Main, Preload and worker targets; Vite reported only its existing chunk-size warnings.
|
||||
- Actual Electron fixture `tests/e2e/cloud-agent-channels.spec.ts`: passed 1/1 after the final UI simplification, including two accounts, unassigned scan, same-Agent routing, enabled target switching without another QR start, legacy account visibility, explicit account detail and small-window overflow.
|
||||
- Inspected the resulting screenshots under `test-results/cloud-agent-channels-own-W-43513-ry-in-the-desktop-workspace/`; the final list shows the `渠道` eyebrow and `微信` title, compact account controls and secondary details without the duplicated legacy panel chrome.
|
||||
- `git diff --check`: passed.
|
||||
- Independent Reviewer: Standards PASS and Spec PASS with no MakeLore source findings; its independent focused/Main run passed 28 tests and its diff check passed.
|
||||
|
||||
## Follow-ups
|
||||
|
||||
- Integration must land with the coordinated AgentBus Core and Yuxi user-level ChannelAccount APIs; this client fixture does not verify a live WeChat login, production backend, deployment or packaged installer.
|
||||
- The legacy per-Agent endpoints remain intentionally used only for account-scoped detail data until the backend exposes equivalent user-level detail endpoints. Every reused detail request is locked to the selected account ID/binding ID.
|
||||
- No commit, merge, deployment or worktree cleanup was performed, per task ownership instructions.
|
||||
|
||||
## Promotion Candidates
|
||||
|
||||
- Target `.project-docs/20-current/current-state.md`: record that desktop channel lifecycle is user/account-owned and Agent publication is an optional route; evidence is the coordinated Core/Yuxi contract plus the focused unit and Electron fixture above. Future work should enter through the user-level account list instead of reconstructing accounts from Agent bindings. This may conflict with older language that treats WeChat setup as part of Agent publication, so integration should reconcile it with the accepted personal cloud Agent ADR. Human confirmation is not required beyond the owning integration task's normal semantic review.
|
||||
Reference in New Issue
Block a user