SMOODEV-2272: th heypage — dogfood HeyPage via the real product API#175
Merged
Conversation
|
…duct API
Replaces the broken TS seed-heypage-examples script (which illegally read
SST `Resource.SecretKeySupabaseServiceKey` and died) with a `th heypage`
subcommand that drives the SAME endpoints a customer/the web builder hits:
generate POST /organizations/{org}/content-items/generate (contentType=website)
build generate -> POST heypage/sites -> (optional) publish -> live /p/<slug>
publish POST heypage/sites/{id}/publish
get GET heypage/sites/{id}
Going through the API means server-side @smooai/config owns every secret — no
backdoor. Mirrors products.rs (require_authed / require_active_org / print_json /
read_body). `--brief` accepts the bare SiteBrief or a {brief, brand?, assetUrls?}
wrapper.
No `--studio` flag: the studio pipeline is chosen server-side by the
heypageStudioPipeline feature flag, not per-request. No `--url` crawl seam: the
generate endpoint takes brand/assetUrls directly, there is no URL->brand extract
endpoint (follow-up).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`build` creates a NEW site each run (slug de-collides → duplicates), which is
wrong for refreshing the 6 LIVE showcase examples. `regen --site <id> --brief
<f>` mirrors the old seed `--regen`: generate a fresh spec → PUT a new revision
on each page the site already has (revisable_paths intersects generated-spec
paths with the site's existing paths; the PUT endpoint 404s on unknown paths) →
publish. The site's slug/URL are unchanged — no duplicate.
Build idempotency-by-slug and a `list` command aren't added: there is no
`GET /organizations/{org}/heypage/sites` (list) endpoint, so slug→id can't be
resolved via the API. Follow-up: add that route, then wire build idempotency.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
43903fb to
5c272df
Compare
Contributor
Author
Update — idempotent regen + rebase
Deferred follow-ups (not blocking)
|
…ing)
`th heypage list` → GET /organizations/{org}/heypage/sites (new backend route,
smooai #2536), printing slug + id. `regen` now takes `--slug <slug>` as an
alternative to `--site <id>` (mutually exclusive), resolving the id via that
list. So the showcase refresh loop is `th api login → th heypage list → th
heypage regen --slug <slug> --brief <f>` with no site ids to copy from a DB.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The TS
seed-heypage-examplesscript illegally read SSTResource.SecretKeySupabaseServiceKeyand died, so the showcase examples on heypage.ai were never (re)generated legitimately.Solution
A
th heypagesubcommand that dogfoods HeyPage by driving the same product API endpoints a customer / the web builder hits — so server-side@smooai/configowns every secret. No backdoor.generate --brief <f>POST /organizations/{org}/content-items/generate(contentType: website)build --brief <f> --name <n> [--publish]POST heypage/sites→ (optional)POST heypage/sites/{id}/publish→ prints live/p/<slug>publish --site <id>POST heypage/sites/{id}/publishget --site <id>GET heypage/sites/{id}Mirrors
products.rsexactly (require_authed/require_active_org/print_json/read_body).--briefaccepts the bareSiteBriefor a{brief, brand?, assetUrls?}wrapper.Deliberate omissions
--studioflag — the studio pipeline is selected server-side by theheypageStudioPipelinefeature flag (ADR-065), not per-request.--urlcrawl seam — the generate endpoint takesbrand/assetUrlsdirectly; there is no URL→brand-extract endpoint. Follow-up if wanted.Verification
cargo build/cargo clippy/cargo fmt --checkgreen (pre-commit hook).generatecall reached prodapi.smoo.aiand returned a well-formed 403 — client, auth, path, and body-shaping all work end-to-end; the only blocker to publishing the canonical showcase slugs is that the signed-in session isn't a member of the HeyPage Showcase org (63dcb347-…, provisioned under a dedicated user). See PR discussion for the exactbuild --publishcommands + the org/auth note.🤖 Generated with Claude Code