Commit Graph

7 Commits

Author SHA1 Message Date
chaloemphong dd42b81639 Add scheduled automatic content drafts with Codex and image automation 2026-11-25 21:13:36 +07:00
Loma Bot Ops 55235718c3 Add self-service teams and assigned post approvals 2026-11-24 11:13:20 +07:00
Loma Bot Ops b14a9286cd Allow members to connect and manage their Facebook pages 2026-11-24 09:43:34 +07:00
Loma Bot Ops 5f8f0c9159 Add website link to page profile so the AI can read the shop site
Adds PageProfile.website (with migration). Codex runs without network, so
the profile draft route fetches the site server-side (public hosts only,
redirect-checked, size-capped, cached) and passes its text as
<shop_website>. Other prompts receive the URL via the shop profile.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 21:20:35 +07:00
Loma Bot Ops 4c93bf0a11 Add brand visual style to page profile and logo palette to image prompts
Adds PageProfile.visualStyle (with migration), feeds it into every AI
prompt route, and samples a logo palette for image generation. Also
hardens Chrome focus handling and image copy in the ChatGPT driver.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 20:58:06 +07:00
Loma Bot Ops 6994ba1a4e Move AI to Codex CLI + ChatGPT browser workers with a durable post queue
Text generation now runs through a PM2 automation worker (codex exec) and
images through the ChatGPT Chrome extension, replacing the Anthropic API.
generateStructured keeps its signature; results are Zod-validated on the web
side and the worker is reached with a bearer secret.

- AI image assistant in the post editor: editable prompt step, then image
  (square or 3:2 only, since Instagram rejects 2:3), stored via putBlob
- Full-post queue (PostGenerationJob + migration): enqueue returns 202, FIFO
  claim under an advisory lock, heartbeat, stale-job failure, per-user
  request key, cancel while QUEUED; output is always a DRAFT with audit rows
- Separate 10 images/page/day quota; text quota excludes images
- Worker reports Codex usage-limit as 429 with a clear Thai message
- Docs: AI-AUTOMATION.md, ARCHITECTURE/README/.env.example updated

Known gap: the live FIFO queue check (scripts/check-post-queue.mjs) has not
passed yet; the last run hit the Codex account usage limit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 21:52:09 +07:00
chaloemphong 9d32552457 Initial commit: page-manager Next.js app with Coolify deploy support
Replace Vercel-specific infra (Cron, Blob) with self-hosted equivalents
for deployment to Coolify: in-container cron scheduler
(scripts/cron-runner.mjs) and disk-based upload storage served via
/api/uploads/[...path]. Add Dockerfile, .dockerignore, and /api/health
for container health checks.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-22 11:52:17 +07:00