The paste flow (internal/web/paste.go, docs/use-cases/paste_url.feature) already does the right thing, but it is reachable only from a form post in a browser session. An agent needs the same use case over HTTP.
Reuse parseYouTubeVideoID verbatim — do not fork the parser. Tracking params (?si=) must be tolerated; add a case if not already covered.
Reuse the existing paste use case path so dedup, per-user scoping, and the shared rate gate behave identically to the browser flow.
Idempotent: re-submitting a video the caller already has returns 200 with the existing video_id, not a duplicate. This mirrors the existing dedup scenario.
Invalid or non-YouTube URL → 400 with a clear message, nothing created.
Video not found at the provider → 404, nothing created.
Non-goals
Waiting for the summary in the request. Submission is async; reading is #25.
Providers other than YouTube.
Acceptance
caveman: me queue a pasted video for the calling user, not summarize it inline
Red-first handler tests for each response case above
The four scenarios in paste_url.feature hold identically through the API path
?si= and other tracking params accepted
Unauthenticated request → 401, nothing created
docs/use-cases/api_access.feature extended
Handoff
Branch from main, one file per commit, squash-merge PR back to main, human review gate.
## Problem
The paste flow (`internal/web/paste.go`, `docs/use-cases/paste_url.feature`) already does the right thing, but it is reachable only from a form post in a browser session. An agent needs the same use case over HTTP.
Depends on #23.
## Scope
`POST /api/v1/videos`
```json
{ "url": "https://youtu.be/-EInjdpjKy0?si=..." }
```
Response `202 Accepted`:
```json
{ "video_id": "...", "provider_video_id": "...", "status": "queued" }
```
- Reuse `parseYouTubeVideoID` verbatim — do not fork the parser. Tracking params (`?si=`) must be tolerated; add a case if not already covered.
- Reuse the existing paste use case path so dedup, per-user scoping, and the shared rate gate behave identically to the browser flow.
- Idempotent: re-submitting a video the caller already has returns `200` with the existing `video_id`, not a duplicate. This mirrors the existing dedup scenario.
- Invalid or non-YouTube URL → `400` with a clear message, nothing created.
- Video not found at the provider → `404`, nothing created.
## Non-goals
- Waiting for the summary in the request. Submission is async; reading is #25.
- Providers other than YouTube.
## Acceptance
- [ ] `caveman: me queue a pasted video for the calling user, not summarize it inline`
- [ ] Red-first handler tests for each response case above
- [ ] The four scenarios in `paste_url.feature` hold identically through the API path
- [ ] `?si=` and other tracking params accepted
- [ ] Unauthenticated request → 401, nothing created
- [ ] `docs/use-cases/api_access.feature` extended
## Handoff
Branch from `main`, one file per commit, squash-merge PR back to `main`, human review gate.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
The paste flow (
internal/web/paste.go,docs/use-cases/paste_url.feature) already does the right thing, but it is reachable only from a form post in a browser session. An agent needs the same use case over HTTP.Depends on #23.
Scope
POST /api/v1/videosResponse
202 Accepted:parseYouTubeVideoIDverbatim — do not fork the parser. Tracking params (?si=) must be tolerated; add a case if not already covered.200with the existingvideo_id, not a duplicate. This mirrors the existing dedup scenario.400with a clear message, nothing created.404, nothing created.Non-goals
Acceptance
caveman: me queue a pasted video for the calling user, not summarize it inlinepaste_url.featurehold identically through the API path?si=and other tracking params accepteddocs/use-cases/api_access.featureextendedHandoff
Branch from
main, one file per commit, squash-merge PR back tomain, human review gate.