# AetherDesk YouTube Studio lane

This lane makes YouTube work as a local-first production system for AetherDesk.

It is not a blind auto-publisher. It helps a human or agent create scripts, voiceover direction, captions, metadata, upload plans, live-stream runbooks, and channel-update receipts while keeping OAuth tokens, client secrets, stream keys, and voice-provider secrets out of repo files and artifacts.

## Command

```powershell
npm run aetherdesk:youtube:studio
```

## Artifacts

- `artifacts/aetherdesk_youtube_studio/latest.json`
- `artifacts/aetherdesk_youtube_studio/latest.md`
- `artifacts/aetherdesk_youtube_studio/latest.receipts.json`
- `artifacts/aetherdesk_youtube_studio/latest.state.json`
- `artifacts/aetherdesk_youtube_studio/latest.edit-plan.json`
- `artifacts/aetherdesk_youtube_studio/latest.edit-plan.md`
- `artifacts/aetherdesk_youtube_studio/editing_projects/<media>/README.md`
- `artifacts/aetherdesk_youtube_studio/editing_projects/<media>/edit-plan.json`
- `artifacts/aetherdesk_youtube_studio/latest.video-assembly.json`
- `artifacts/aetherdesk_youtube_studio/latest.video-assembly.md`
- `artifacts/aetherdesk_youtube_studio/episode_packs/episode_01/assembly/README.md`
- `artifacts/aetherdesk_youtube_studio/episode_packs/episode_01/assembly/asset-prompts/*.image.txt`
- `artifacts/aetherdesk_youtube_studio/episode_packs/episode_01/assembly/voiceover/voiceover-master.txt`
- `artifacts/aetherdesk_youtube_studio/episode_packs/episode_01/assembly/captions/episode_01.assembly.srt`
- `artifacts/aetherdesk_youtube_studio/episode_packs/episode_01/assembly/render/render-commands.ps1`
- `artifacts/aetherdesk_youtube_studio/latest.animatic-preview.html`

## What it covers

- Google OAuth and YouTube Studio sign-in boundary.
- Local video/content folder contract.
- Local video/audio edit setup with per-source project folders, ffmpeg command decks, caption scaffolds, chapter scaffolds, thumbnail frame targets, and review-master/upload-master output paths.
- Episode assembly pack with shot-by-shot image prompts, motion prompts, voiceover master, captions, chapters, render commands, and QA checklist.
- Content brief and channel-update packet.
- Custom AI voiceover direction and provider boundary.
- Local render/caption/metadata workflow.
- YouTube upload plan using OAuth and explicit operator consent.
- YouTube Live plan using broadcasts/streams and stream-key-safe boundaries.
- Publish/update receipt template.

## Safety boundary

- No OAuth tokens in artifacts.
- No stream keys in artifacts.
- No automatic upload, live transition, channel update, or community post.
- Default upload posture is private/unlisted until reviewed.
- Voiceover generation must respect provider terms and voice rights; do not clone or impersonate a real person without rights/consent.

## Official references used

- YouTube upload guide: https://developers.google.com/youtube/v3/guides/uploading_a_video
- videos.insert reference: https://developers.google.com/youtube/v3/docs/videos/insert
- YouTube Live Streaming API reference: https://developers.google.com/youtube/v3/live/docs
- Authorization credentials: https://developers.google.com/youtube/registering_an_application


## Visual entry

Open **This PC -> YouTube Studio**. The same lane is available from the desktop icon, launcher nav, side rail, hero quick buttons, mission card, command finder, and shared action-card panel.

The visual surface fetches `/api/agent/youtube-studio`, stages safe local actions into the terminal, opens official Google/YouTube pages only when selected, and keeps OAuth tokens, stream keys, upload consent, and voice-provider secrets outside artifacts.

Read-only helper routes:

- `GET /api/youtube/edit-plan` returns the latest generated edit setup JSON.
- `GET /api/youtube/assembly-pack` returns the latest generated video assembly pack JSON.
- `GET /api/youtube/animatic-preview` serves the latest local animatic HTML preview.

The assembly pack turns the Episode 1 production pack into editor-ready folders: asset prompts, voiceover script/SSML, caption/chapter files, render command deck, and a QA checklist. It does not generate images, call a voice provider, upload to YouTube, or overwrite source media.

The edit setup scans bounded local media roots such as `Videos`, `Videos\YouTube`, `Downloads`, `Music`, `OneDrive\Videos`, `OneDrive\Pictures`, and `artifacts/youtube_studio/renders`. It never overwrites originals. Render/audio cleanup commands write only into the generated edit project folders. If `ffmpeg` is missing, the lane records `winget install Gyan.FFmpeg` as an operator setup command and marks render commands as blocked until the tool is available.
