fix: harden agent conversion and localize fonts#14
fix: harden agent conversion and localize fonts#14alexsssaalexsubay-afk wants to merge 2 commits into
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Template example HTML now travels with each fresh conversion prompt so agents can reproduce the shipped visual system while replacing the sample content with the user's full source. Successful runs are snapshotted locally so prior outputs can be reviewed and restored from the service UI. Constraint: users expect template-level fidelity and visible conversion history inside HTML Anything Rejected: latest-output-only persistence | it overwrites useful generated artifacts and makes regressions hard to compare Confidence: high Scope-risk: moderate Directive: keep result snapshots bounded to avoid unbounded localStorage growth Tested: pnpm -s exec tsc --noEmit; pnpm build; git diff --check; local /api/convert smoke returned start/delta/meta/done with HTML and no errors Not-tested: manual browser click-through of the history tab Co-authored-by: OmX <omx@openai.com>
* WIP feat(deploy): server-side Vercel pipeline + Settings Deploy panel Backend + settings UI for one-click HTML deployment. PR #14-style preview-pane button + result card + history dropdown still pending — this commit is checkpoint material so the work survives session boundaries. Files in this commit: - src/lib/deploy/config.ts ~/.html-anything/<provider>.json token I/O with mask-on-read; chmod 600; DeployError class. - src/lib/deploy/url-check.ts waitForReachableDeploymentUrl + Vercel SSO-protected detection. - src/lib/deploy/vercel.ts POST /v13/deployments + readyState polling + URL candidates resolver. - src/app/api/deploy/route.ts POST /api/deploy { taskId, provider, html } → { url, status, ... }; wraps bare HTML fragments in a defensive <!DOCTYPE> envelope; 501 for non-Vercel providers (CF Pages stub). - src/app/api/deploy/config/route.ts GET / PUT /api/deploy/config?provider=* for masked token CRUD. - src/lib/store.ts v6 → v7 migration: Task.deployments[] ring (latest 5) + DeploymentRecord type + push/remove setters. - src/lib/i18n.ts 30+ deploy.* + settings.deploy.* keys (en + zh-CN). - src/components/settings-modal.tsx New "Deploy" section in Settings; Vercel token input with auto-mask read-back and Save / Clear; Cloudflare Pages "coming soon" placeholder. Status: tsc clean. Backend smoke-tested via curl (`POST /api/deploy/config?provider=vercel`, `POST /api/deploy` with bad token → DeployError 400). End-to-end with a real Vercel token: not yet. TODO before merging: preview-pane Publish button + DeployResultCard + past-deployments dropdown; real-token e2e verification; CF Pages deployer (deferred to a follow-up because of blake3-wasm dependency). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(deploy): preview-pane Publish button + result card + history ring Wires the existing /api/deploy backend into a user-visible action. Sits on the preview-pane toolbar next to Refresh / Present, only appears once a Convert has produced HTML (`status === "done" && html`). Three things in one popover-anchor block: 1. Primary "📤 Publish" pill — disabled with an i18n tooltip when no HTML is ready. Coral pulse + "Deploying…" label while in flight. 2. Result card — rendered immediately under the button after a successful deploy. Shows the live URL with Copy / Open. Three colored status badges: - green = "Live at" (status: ready) - coral = "SSO-protected" (status: protected — Vercel Hobby default; we surface a paragraph pointing the user at Deployment Protection settings) - amber = "Waiting for CDN" (status: link-delayed) 3. History dropdown — bounded ring (latest 5 per task; v6→v7 store migration backfills `deployments: []`). Each row shows the URL, provider, timestamp, short html-fingerprint hash so the user can tell which version of the page each historical URL points to. Hover reveals Copy / Forget actions per row. `useDeploy()` (`src/lib/use-deploy.ts`) wraps fetch + status state + auto-persists successful deployments via `pushDeploymentFor`. The html-hash is FNV-1a → 12 hex chars, just a fingerprint, not crypto. Verification (macOS arm64): - Settings → Deploy section renders with Vercel token input + Cloudflare Pages "Coming soon" placeholder, in both en and zh-CN. - Deploy button hidden on idle tasks; visible after Convert completes. - POST /api/deploy/config?provider=vercel GET/PUT with masked-token read-back works. - POST /api/deploy without a configured token returns the i18n-friendly DeployError ("Vercel token is not configured. Open Settings → Deploy to add one.") — confirmed via curl. - Real-token end-to-end deploy: not yet exercised. Maintainers with a Vercel API token can validate by saving it in Settings and clicking Publish on any completed task. CF Pages still surfaced as "Coming soon" — the wasm-blake3 dependency required for the asset-upload step is intentionally deferred to its own follow-up PR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: joey <joey@joeydeMacBook-Air-2.local> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Heads-up: PR #27 is also open against |
|
@alexsssaalexsubay-afk I'm holding off on generating review comments for #14 because this pull request has merge conflicts right now. Please resolve the conflicts with main and push the updated branch. Once that's done, request or wait for the review to run again and I'll take another look. 🔁 Powered by Looper · runner=reviewer · agent=opencode · model=openai/gpt-5.4 · An autonomous AI dev team for your GitHub repos. |
|
Thanks for the PR. I am not going to patch this branch directly because the scope is broad and several parts now overlap with changes already on current What changed upstream:
Suggested next step:
Recommended validation for each smaller PR:
This should make the useful pieces much easier to review without accidentally changing unrelated agent or persistence behavior during the rebase. |
Summary
HTML_ANYTHING_AGENT_PROXYinstead of a machine-specific defaultnext/font/googleusage with bundled local woff2 fonts to avoid Google Fonts network stallsexample.htmlinto fresh conversion prompts as a visual fidelity referenceDetails
This keeps the existing curated agent/model picker, but lets users extend it without source edits:
HTML_ANYTHING_MODELS/HTML_ANYTHING_MODELS_<AGENT>append model optionsHTML_ANYTHING_BINS_<AGENT>andHTML_ANYTHING_BIN_<AGENT>add or override binariesHTML_ANYTHING_EXTRA_AGENTSregisters wrapper CLIs that reuse an existing adapter such ascodexHTML_ANYTHING_AGENT_PROXY/HTML_ANYTHING_AGENT_PROXY_<AGENT>opt agent subprocesses into a proxy when neededThe proxy path is intentionally opt-in so this does not bake any local network setup into upstream defaults.
Fresh conversions now include the template folder's example HTML in the prompt with explicit instructions to reuse its visual system while replacing all sample content with the user's source. Successful runs are stored as bounded per-task result snapshots (latest 12) in the existing browser-local task store. The preview pane includes a History tab for result review, current-result indication, restore, and delete.
Validation
pnpm -s exec tsc --noEmitpnpm buildgit diff --check/api/agentswith env-added Codex model and a customcodex-nightlyagent/api/convertwith Codex before and after the template-reference/history change: SSE emittedstart,delta,meta,done; HTML markers present; no error events/returns200and the rendered host HTML no longer referencesfonts.googleapis.comorfonts.gstatic.comNot Tested