Repository navigation
feat: add Promote drip engine (Phase 1) - #93
Merged
Merged
Conversation
Implements the Promote feature per docs/promote-prd.md: - Migration: promo_list, promo_link, promo_post tables + RLS + indexes - Topnav: Promote link added after Ads - Pages: /promote (index), /promote/new, /promote/[id], /promote/accounts - Server actions: full CRUD (create, update, pause, resume, delete, post now) - lib/promote/generatePitch.ts: dual-provider (Anthropic/OpenAI) copywriter with per-platform profiles and anti-repeat prompt injection - lib/promote/sweep.ts: processDuePromoteLists() with round-robin link selection, trickle/burst modes, credit gating, auto-pause on low balance - Worker: promoteSweep() on 60s interval, reuses sp_account pool + postViaAccount - Components: list-actions, promote-form, edit-form, add-links, link-list - Tests: parseLinks, cadenceLabel, CADENCE_PRESETS Closes #92
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
Contributor
|
test is failing |
Contributor
Author
|
Fixed in the follow-up commit (27a36f1) — the |
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.
Summary
Implements the Promote feature per
docs/promote-prd.md(Phase 1 — Core drip engine).Closes #92
What is Promote?
A global, top-level feature (peer of Ads and Alerts) where the user pastes a list of links, and AI writes a fresh, custom marketing pitch for each link x each platform, then drip-publishes them across all connected social accounts on a recurring cadence (default every 30 minutes). Every send is uniquely generated — never the same copy twice.
Changes
Database
supabase/migrations/20260713000000_promote.sql—promo_list,promo_link,promo_posttables + RLS + indexes + updated_at triggerLibrary
lib/promote/generatePitch.ts— Dual-provider (Anthropic/OpenAI) copywriter with per-platform profiles (char limits, hashtag guidance, voice), anti-repeat prompt injection, link parsing/dedup, title fetching, cadence helperslib/promote/sweep.ts—processDuePromoteLists()with round-robin link selection, trickle/burst modes, credit gating viaconsume_credit, auto-pause on insufficient balanceServer Actions
app/actions/promote.ts— Full CRUD: createPromoteList, updatePromoteList, addLinksToList, removeLink, toggleLink, pausePromoteList, resumePromoteList, deletePromoteList, postNowPages
/promote— List index with stats (posts sent, credits spent)/promote/new— Create form with links textarea, cadence picker, account multiselect, burn estimator/promote/[id]— Detail view with settings editor, link management, recent posts log/promote/accounts— Global account connection surface (reuses social setup forms)Components
list-actions.tsx— Pause/Resume/PostNow/Delete buttonspromote-form.tsx— Create form with daily burn estimatepromote-edit-form.tsx— Settings editoradd-links-form.tsx— Add links to existing listlink-list.tsx— Link management (enable/disable/remove)Worker
promoteSweep()on 60s interval inworker/index.ts, reusessp_accountpool +postViaAccountNavigation
Promotelink added to topnav after AdsTests
tests/promote/generate-pitch.test.ts— parseLinks, cadenceLabel, CADENCE_PRESETSVerification