# Shipcast — instructions for personal agents

Shipcast turns a shipped feature into a launch video and a draft post.

1. Open the Shipcast link you were given. Keep its `?token=…` part if it has one. A server that takes requests without a token does so for public repositories only: free within a daily limit, and paid for once the free ones are used up.
2. Fill **Repo URL** (`#repo`); a pull request link is best. **Preview URL** (`#preview`) is the deployed page where the feature is live; leave it empty when the repo URL is a pull request with a deploy preview. Optional: **PR number** (`#pr`) and **Notes** (`#notes`, steps to reach the feature).
3. Format (`#format`): `vertical` for Instagram, TikTok or X; `horizontal` for LinkedIn, YouTube, Reddit or Hacker News. Otherwise leave it.
4. Length: if the user asked for one, put the seconds in `#seconds`. For a "short" video use `19`. Otherwise leave it empty: a vertical video comes out short, about 19 seconds, and a horizontal one runs longer.
5. Press **Start launch video** (`#start`) once. If the form comes back with a message in `#error`, report that text and stop.
6. Stay on the job page. It refreshes itself; jobs take up to 15 minutes. Read the element with id `status` until it says `ready` or `failed`.
   If it says `payment`, the free videos are used up and this one is to be paid for first (`#price`). Send the user the link in `#pay` and tell them the price; do not pay it yourself unless the user has told you to. The link works for an hour. Keep reading `#status`: the video starts once the payment goes through, and a payment for a video that fails is refunded.
7. On `ready`, send the user the job page URL, the video link (`#download`, and `#download-vertical` if there is one) and the draft post (`#post`).
8. On `failed`, report the text in `#error`.

If you can open links but not press buttons: open the link as `/?repo=<repo or pull request URL>&notes=<what the user asked for>`. When the video for that is already made, the page shows a link with id `ready-link`; open it and carry on from step 7. Otherwise tell the user the form has to be sent by them.

Never post anything yourself.

HTTP alternative: `POST /api/launch` with JSON `{repo, preview_url?, pr?, notes?, format?, seconds?}` and header `x-access-token` if you have a token, then poll the `status_url` it returns. While its `status` is `payment`, it carries `payment_url` and `price`: send those to the user, as in step 6.
