feat(skills): wowerpoint share-link upload step (#2445)
* feat(skills): wowerpoint share-link upload step After the kawaii NotebookLM PDF lands on disk, the subagent now also POSTs it to the WOWerpoint Server (if configured) and reports back a share URL. The PDF is still the backup; the share URL is the primary deliverable. Gated on three env vars (WOWERPOINT_API_BASE, WOWERPOINT_VIEWER_BASE, WOWERPOINT_UPLOAD_TOKEN) — if any are missing the skill skips the upload silently and behaves exactly as before. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(skills): address CodeRabbit + Greptile findings on wowerpoint - Drop the ~/.wowerpoint.env reference: the subagent inherits the parent's environment and never sources a dotenv file, so storing vars there would silently disable the upload step. Documented only the shell-export path. - Switch jq parsing to `.id // empty` so a missing key yields an empty string instead of the literal "null", letting the [-z "$DECK_ID"] guard fire correctly on error responses. - Capture the full JSON response so a non-empty .error field is surfaced as a warning rather than emitting an invalid …/d/null share URL. - Add TITLE to the subagent template's Inputs block so the parent agent knows it must supply a title slot the curl command depends on. - Make step 6 itself guard on the env vars instead of relying on prose, so the snippet works in isolation if a future agent skips the surrounding instructions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(skills): gate the top-level upload snippet on env vars too CodeRabbit pointed out the prose snippet at the top of the Share-link section uploaded unconditionally, while the subagent step 6 version had the env-var guard. Anyone copying the standalone snippet would have skipped "silently" by failing the curl request. Wrapping both in the same guard keeps the two snippets in sync. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(skills): cap wowerpoint upload curls at 30 s Greptile flagged that a bare curl on an unreachable WOWERPOINT_API_BASE can sit on the OS TCP timeout (75–130 s) before returning, stalling the background subagent and delaying the completion notification. Adding --connect-timeout 10 --max-time 30 to both upload snippets bounds the hang and lets the share-link step fail fast. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(skills): wowerpoint slug example reflects 3-word IDs Server now mints adjective-noun-creature slugs (e.g. quirky-compass-hawk) instead of base64url. The curl/jq snippets are unchanged — they already parse .id as opaque — but the prose was stale. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(skills): wowerpoint slug example reflects title-aware IDs Server now slugifies the title and appends a creature suffix (tokenrouter-quest-hawk) instead of three random words. Falls back to a 3-word slug when the title is empty or non-ASCII. The curl/jq snippets are unchanged — they parse .id as opaque — but the prose was stale. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -76,6 +76,46 @@ Adjacent to the source, parallel filename:
|
||||
|
||||
If the source isn't somewhere that makes sense as an output location, default to `reports/<stem>-slides.pdf`.
|
||||
|
||||
## Share link (WOWerpoint Server)
|
||||
|
||||
After the PDF lands on disk, the subagent also POSTs it to the WOWerpoint Server, which converts the 16:9 deck into a 9:16 mobile twin and returns a share URL. The share URL is the primary deliverable to the user; the PDF on disk is the backup.
|
||||
|
||||
Required env (exported in the user's shell — the subagent inherits the parent's environment, so plain `export` is enough; no dotenv loader runs):
|
||||
|
||||
```bash
|
||||
WOWERPOINT_API_BASE=https://wowerpoint-api.<subdomain>.workers.dev
|
||||
WOWERPOINT_VIEWER_BASE=https://wowerpoint-viewer.<subdomain>.workers.dev
|
||||
WOWERPOINT_UPLOAD_TOKEN=<token>
|
||||
```
|
||||
|
||||
If any var is missing, skip the share-link step and just hand the PDF over.
|
||||
|
||||
Upload pattern (run AFTER the subagent confirms the PDF exists on disk). Capture the full response so empty `id` and `error` payloads are handled — `jq -r '.id'` returns the literal string `null` on a missing key, so always pipe through `.id // empty`:
|
||||
|
||||
```bash
|
||||
if [ -n "$WOWERPOINT_API_BASE" ] && [ -n "$WOWERPOINT_UPLOAD_TOKEN" ] && [ -n "$WOWERPOINT_VIEWER_BASE" ]; then
|
||||
UPLOAD_JSON=$(curl -sS --connect-timeout 10 --max-time 30 -X POST "$WOWERPOINT_API_BASE/api/decks" \
|
||||
-H "Authorization: Bearer $WOWERPOINT_UPLOAD_TOKEN" \
|
||||
-F "file=@<OUTPUT_PATH>" \
|
||||
-F "title=<TITLE>")
|
||||
DECK_ID=$(printf '%s' "$UPLOAD_JSON" | jq -r '.id // empty')
|
||||
API_ERROR=$(printf '%s' "$UPLOAD_JSON" | jq -r '.error // empty')
|
||||
if [ -n "$API_ERROR" ] || [ -z "$DECK_ID" ]; then
|
||||
echo "WOWerpoint upload warning: ${API_ERROR:-missing id}"
|
||||
else
|
||||
echo "Share URL: $WOWERPOINT_VIEWER_BASE/d/$DECK_ID"
|
||||
fi
|
||||
fi
|
||||
```
|
||||
|
||||
The returned `id` is a kebab-case slug derived from the title with a random creature suffix (e.g. `tokenrouter-quest-hawk`, or `velvet-comet-tiger` if the title is empty or non-ASCII). The share URL is:
|
||||
|
||||
```text
|
||||
$WOWERPOINT_VIEWER_BASE/d/<id>
|
||||
```
|
||||
|
||||
It works immediately (shows a "still converting…" page that auto-reloads when ready). Conversion takes ~1–2 min per slide. Print the share URL in your final response.
|
||||
|
||||
## The prompt
|
||||
|
||||
One sentence. Default:
|
||||
@@ -100,6 +140,7 @@ Inputs:
|
||||
- Source ID: `<SOURCE_ID>`
|
||||
- Generation prompt: `<PROMPT>`
|
||||
- Output path: `<OUTPUT_PATH>`
|
||||
- Deck title: `<TITLE>` (the notebook title, used by the share-link step)
|
||||
|
||||
Steps:
|
||||
|
||||
@@ -116,10 +157,31 @@ Steps:
|
||||
|
||||
5. Verify: `ls -la <OUTPUT_PATH>` confirms the file exists.
|
||||
|
||||
6. Upload to WOWerpoint Server for a mobile share link. Skip silently if any of `WOWERPOINT_API_BASE`, `WOWERPOINT_UPLOAD_TOKEN`, or `WOWERPOINT_VIEWER_BASE` is unset. Otherwise:
|
||||
|
||||
```bash
|
||||
if [ -n "$WOWERPOINT_API_BASE" ] && [ -n "$WOWERPOINT_UPLOAD_TOKEN" ] && [ -n "$WOWERPOINT_VIEWER_BASE" ]; then
|
||||
UPLOAD_JSON=$(curl -sS --connect-timeout 10 --max-time 30 -X POST "$WOWERPOINT_API_BASE/api/decks" \
|
||||
-H "Authorization: Bearer $WOWERPOINT_UPLOAD_TOKEN" \
|
||||
-F "file=@<OUTPUT_PATH>" \
|
||||
-F "title=<TITLE>")
|
||||
DECK_ID=$(printf '%s' "$UPLOAD_JSON" | jq -r '.id // empty')
|
||||
API_ERROR=$(printf '%s' "$UPLOAD_JSON" | jq -r '.error // empty')
|
||||
if [ -n "$API_ERROR" ] || [ -z "$DECK_ID" ]; then
|
||||
echo "WOWerpoint upload warning: ${API_ERROR:-missing id}"
|
||||
else
|
||||
echo "Share URL: $WOWERPOINT_VIEWER_BASE/d/$DECK_ID"
|
||||
fi
|
||||
fi
|
||||
```
|
||||
|
||||
On warning, the PDF on disk is still a valid deliverable — do not retry the upload.
|
||||
|
||||
Report briefly (under 200 words):
|
||||
- Final artifact ID
|
||||
- Time per phase (source wait, generation, render wait, download)
|
||||
- Output file path + size
|
||||
- Share URL (if produced)
|
||||
- Any retries or warnings
|
||||
- Exact error message if any step failed
|
||||
|
||||
|
||||
Reference in New Issue
Block a user