Repository navigation
Conversation
Worker (TASK-013): POST /api/generate turns a short description into pipeline steps with Claude. It stays off (503 ai_off) until AI_GENERATE=on and the ANTHROPIC_API_KEY and AI_IP_SALT secrets are set. A daily dollar budget and a per-IP daily limit, both kept in D1 (migrations/0002_ai_generate.sql), cap spend. Replies are cached by a hash of the description, and every step is checked against the catalog before it is returned. App (TASK-014): a "Describe it" button beside the step list and a "Describe a pipeline (AI)" palette command open a lazy-loaded dialog. It sends only the description, checks the returned steps again, and loads them with Replace or Add to the end as one undoable change. Every failure except a too-long description links utility search and the MCP server. The privacy policy describes what is sent, to whom and what is kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
What and why
Visitors can describe a pipeline in words and get suggested steps from Claude (REQ-027, NFR-007). The feature is built to keep the AI bill bounded, and it stays off in production until the switch-on step (TASK-015) is done.
Worker:
POST /api/generate(TASK-013)503 ai_offunlessAI_GENERATE=onand theANTHROPIC_API_KEYandAI_IP_SALTsecrets are set.AI_DAILY_BUDGET_USD, default 5) and a per-IP daily limit (AI_IP_DAILY_LIMIT, default 10). Both counters live in D1 (migrations/0002_ai_generate.sql). The IP is stored only as a keyed daily hash.@anthropic-ai/sdkas a dependency (used only by the Worker).App: describe dialog (TASK-014)
sanitizeSteps, code utilities removed), because the Worker and an open tab can be different versions.Reviewer notes
AI_GENERATE=on.release:minormay be the right one.How it was tested
src/app/generate/*, tool, commands,SitePage, i18n andworker/generate,ai-budget,ai-catalog. The Worker tests use a fake model and an in-memory D1; no real API call was made.npm run typecheck, the workertscandnpm run lintpass.npm run build(295 pages) andnpm run check:bundlepass, and the dialog is its own chunk. The build was not re-run after the last one-line change (fallback links on upstream failures).npx wrangler deploy --dry-runbuilds the Worker.{ description }was sent, and there were no console errors.npm testand Playwright E2E (CI runs both).Checklist
npm test,npm run typecheckandnpm run lintpass (typecheck and lint pass; only targeted tests were run locally)index.test.ts,guide.mdand regenerated_generated/files (no new utilities)## [Unreleased]inCHANGELOG.md(not yet)release:minororrelease:majorif a patch release isn't right🤖 Generated with Claude Code