Files

4.4 KiB

1. Proposal Gate

  • 1.1 Review and approve this OpenSpec change before implementation.
  • 1.2 Decide whether social-auto-upload is vendored, installed by setup, or referenced through a configured local path.
  • 1.3 Confirm first-release channel list and whether experimental channels should be visible.

2. Data Model And Aggregation

  • 2.1 Define PublishableAsset, SocialAccount, PublishDraft, PublishCampaign, PublishTarget, and PublishJob types.
  • 2.2 Add a service that aggregates completed image/video outputs from task queue summaries, prompt history previews, media library assets, digital avatar outputs, and canvas media exports.
  • 2.3 Add de-duplication by canonical media URL/file reference and preserve source links back to task/asset/project/canvas.
  • 2.4 Add filters for source module, media type, publish status, date, project, and keyword.
  • 2.5 Add platform capability metadata for video, image-note, schedule, cover images, Bilibili partition tid, Douyin product fields, and draft-only behavior.
  • 2.6 Add publish history state linking each asset to campaigns, targets, attempts, and result logs.

3. Local Runtime Bridge

  • 3.1 Add local runtime endpoints for platform capability discovery, account login, account check, publish enqueue, job status, logs, retry, and cancel.
  • 3.2 Wrap sau command forms for login, check, upload-video, and upload-note.
  • 3.3 Materialize remote/blob/cache media into local files before invoking upload commands.
  • 3.4 Keep cookies/session files outside frontend storage and expose only safe metadata to the UI.
  • 3.5 Add per-platform/account concurrency limits and command timeout handling.
  • 3.6 Support fast account listing plus background validation, matching the useful legacy frontend pattern.
  • 3.7 Stream login progress, QR data or required-user-action messages, command logs, and final status to the frontend.
  • 3.8 Map CLI options for --schedule, cover thumbnails, Douyin product link/title, Bilibili --tid, and headless/headed/debug execution preferences.

4. Workbench UI

  • 4.1 Add social.publish capability and a left nav item labeled "自动发布".
  • 4.2 Add an app definition card for "自动发布".
  • 4.3 Build the auto-publishing page using the project workbench style and existing lucide/TDesign patterns.
  • 4.4 Build tabs for "发布任务" and "账号授权", with asset selection and publish records embedded in the publish-task page.
  • 4.5 Build a publish composer that supports selected assets, captions, tags, account targets, per-channel overrides, schedule time, and validation.
  • 4.6 Build status cards and tables for accounts, queued jobs, logs, and publish results.
  • 4.7 Build campaign draft tabs/groups inspired by upstream PublishCenter while using TrueGrowth native layout.
  • 4.8 Build finished-asset picker and manual local upload fallback inspired by upstream material selection.
  • 4.9 Build account platform filters, search, add/edit/delete, re-login, QR/progress display, and background validation indicators.
  • 4.10 Build topic/tag controls with custom and recommended entries, plus channel-specific composer sections.

5. Publishing Behavior

  • 5.1 Support video publishing to stable CLI-backed channels.
  • 5.2 Support image-note publishing where the channel supports upload-note.
  • 5.3 Validate channel-specific required fields before enqueueing.
  • 5.4 Track per-target success/failure without failing the entire campaign when only one channel fails.
  • 5.5 Connect published result state back to the finished asset list.
  • 5.6 Support batch submission of multiple campaign drafts with progress, cancellation, and per-draft result summaries.
  • 5.7 Support immediate and scheduled publish for channels whose CLI wrapper supports --schedule.
  • 5.8 Preserve source asset selection after partial failure so failed targets can be retried without recreating the draft.

6. Verification

  • 6.1 Add unit tests for asset aggregation and capability validation.
  • 6.2 Add runtime bridge tests with mocked sau command execution.
  • 6.3 Add UI tests for navigation, account status rendering, composer validation, and job status transitions.
  • 6.4 Run targeted typecheck/build for the affected web app.
  • 6.5 Add UI tests for campaign draft batch publishing, cancellation, and mixed success/failure rendering.