Skip to content

🎬 Open-source, self-hosted AI agent that runs a YouTube channel end to end: researches topics, writes scripts, generates narration, visuals and video, optimizes SEO, and publishes after your approval, then learns from analytics. Works with Gemini, OpenAI, OpenRouter, DeepSeek and more.

Improve activation tracking and repository growth funnel

darkzOGx0fca2df9b1c2
diff --git a/.env.example b/.env.example
index bda75fb..87977fb 100644
--- a/.env.example
+++ b/.env.example
@@ -66,6 +66,13 @@ MAX_CONCURRENT_JOBS=1
# Optional Slack/Discord-compatible webhook for failures and review alerts.
# NOTIFICATION_WEBHOOK_URL=https://hooks.example.com/...
+# Optional anonymous activation milestones (OFF by default).
+# No telemetry is sent unless both values are explicitly configured.
+# Payload: milestone name, timestamp, Lumen version, OS family, Node major,
+# and a random installation ID. Never includes channel, topic, title, keys, or files.
+# ANONYMOUS_TELEMETRY_ENABLED=false
+# ANONYMOUS_TELEMETRY_ENDPOINT=https://your-collector.example/events
+
# Analytics & Monitoring
ENABLE_ANALYTICS=true
ANALYTICS_DB_PATH=./data/analytics.db
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..bd34753
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,60 @@
+# Changelog
+
+## Unreleased
+
+- Added local-only activation milestones for setup, first real MP4, approval, publication, and repeat generation
+- Added an explicit opt-in anonymous milestone reporter with no default endpoint
+- Added reproducible GitHub growth baselines and public fork census reports
+- Reworked the README around product outcomes and moved release history here
+- Synchronized the in-repo provider catalog with current official model IDs and corrected Gemini free-tier claims
+
+## v2.5
+
+- **Operator-first dashboard** β€” live jobs, content pipeline, review queue, calendar, idea backlog, analytics, and channel setup in one responsive console
+- **Asynchronous generation** β€” generation returns immediately with a persistent job ID; progress, errors, cancellation, and restart interruptions are visible
+- **Approval-first publishing** β€” generated content must pass quality checks, factual review, media-rights confirmation, and human approval before it can be scheduled by default
+- **Review studio** β€” preview real video and thumbnail assets, edit title/description/tags/privacy/schedule, reject, retry, or approve
+- **Brand guardrails** β€” channel goal, audience, voice, CTA, visual direction, timezone, and blocked-topic policy guide generation and quality review
+- **Actionable operations** β€” pause/resume automation, webhook-ready notifications, real activity history, and warning-free linting
+
+## v2.4
+
+- **Guided walkthrough for first-time setup** β€” `npm run walkthrough` explains each choice, opens provider pages, tests keys, guides Google Cloud setup, and saves progress
+- **`.env` loading fixed** β€” runtime and setup tools now load local environment settings
+- **Safer example environment** β€” placeholder credentials are commented out
+- **Browser OAuth opens automatically** β€” YouTube authorization opens in the default browser
+
+## v2.3
+
+- **Gemini media pipeline** β€” Gemini image generation (`gemini-3.1-flash-image`) and narration (`gemini-3.1-flash-tts-preview`) are supported. Text and TTS currently have free tiers; AI image generation requires Gemini paid-tier access. Gradient visuals remain the no-image-provider fallback.
+- **Faster slideshow rendering** β€” the renderer captures one still per slide and uses FFmpeg for video and crossfades
+- **Better template topics** β€” template mode uses curated evergreen topics and rejects malformed trend fragments
+- **Model catalog correction** β€” removed the nonexistent `gemini-3.5-pro` entry in favor of supported Gemini models
+
+## v2.2
+
+- Any configured AI text provider can satisfy startup credential validation
+- FFmpeg is bundled through `ffmpeg-static`
+- Successful production reaches the publish queue
+- Silent real MP4 output is supported when TTS is not configured
+- Startup reports real versus simulated capabilities
+- Missing credentials and FFmpeg produce actionable warnings
+- Publish-queue logging reports queue state and timing
+
+## v2.1
+
+- Real AI generation for strategy, scripts, and SEO
+- Optional API-key protection for mutating routes
+- Private-by-default publishing and placeholder upload protection
+- Scheduler, dependency, database, and publish-queue fixes
+- Template scripts no longer fabricate statistics
+- ESLint and GitHub Actions CI
+
+## v2.0
+
+- Provider and media model refresh
+- OpenAI SDK v6, `@google/genai` v2.9, `replicate` v1.4, and `googleapis` v173
+- Revamped setup wizard and TTS selection
+- Deprecated OpenAI SDK call patterns removed
+- Dynamic year handling in content strategy
+- Developer-focused README and Mermaid architecture diagrams
diff --git a/README.md b/README.md
index 03fec83..23a34a5 100644
--- a/README.md
+++ b/README.md
@@ -1,73 +1,57 @@
-# Lumen YouTube Automation Agent - B9eEkNbyYN9DekUup97vjSk7UGsqh6NBSHNN6sd8pump
+# Lumen
-<p align="center">
- <img src="assets/youtube-automation-agent.jpg" alt="YouTube Automation Agent mascot illustrating the AI-assisted content workflow" width="720">
-</p>
+**The open-source AI agent that runs a YouTube channel end to end.**
-## What's New in v2.5
+Research topics β†’ write scripts β†’ generate narration and visuals β†’ assemble videos β†’ optimize metadata β†’ review β†’ schedule β†’ publish β†’ learn from analytics.
-- **Operator-first dashboard** β€” live jobs, content pipeline, review queue, calendar, idea backlog, analytics, and channel setup in one responsive console
-- **Asynchronous generation** β€” generation returns immediately with a persistent job ID; progress, errors, cancellation, and restart interruptions are visible
-- **Approval-first publishing** β€” generated content must pass quality checks, factual review, media-rights confirmation, and human approval before it can be scheduled by default
-- **Review studio** β€” preview real video and thumbnail assets, edit title/description/tags/privacy/schedule, reject, retry, or approve
-- **Brand guardrails** β€” channel goal, audience, voice, CTA, visual direction, timezone, and blocked-topic policy guide generation and quality review
-- **Actionable operations** β€” pause/resume automation, webhook-ready notifications, real activity history, and warning-free linting
+[![CI](https://github.com/darkzOGx/youtube-automation-agent/actions/workflows/ci.yml/badge.svg)](https://github.com/darkzOGx/youtube-automation-agent/actions/workflows/ci.yml)
+[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
+[![Node.js 18+](https://img.shields.io/badge/node-18%2B-43853d.svg)](package.json)
-## What's New in v2.4
+- **Self-hosted:** your credentials, media, and channel data stay under your control.
+- **Approval-first:** nothing is scheduled until quality, rights, and human-review gates pass by default.
+- **Provider-flexible:** use Gemini, OpenAI, OpenRouter, Kimi, MiMo, GLM, or another OpenAI-compatible endpoint.
+- **Observable:** follow persistent generation jobs, failures, review state, publishing, and local activation milestones from the dashboard.
-- **Guided walkthrough for first-time setup** β€” `npm run walkthrough` (also offered when you run `npm run setup`). It explains every choice in plain English, shows exactly where to get each key (and opens the page in your browser), **live-tests keys the moment you paste them**, walks you click-by-click through Google Cloud for the YouTube connection, and signs you in via your browser instead of copy-pasting auth codes. Every step is skippable and progress is saved β€” re-run it any time.
-- **`.env` files actually work now** β€” `dotenv` was a dependency but was never loaded, so `.env` settings (API keys, `API_KEY`, `FFMPEG_PATH`…) were silently ignored unless exported in your shell. `index.js` and the setup tools now load `.env` on start.
-- **`.env.example` no longer poisons setup** β€” the uncommented `OPENAI_API_KEY=your-openai-api-key-here` placeholder would have been picked up as a real key; all placeholders are now commented out.
-- **Browser OAuth opens automatically** β€” the YouTube authorization URL now opens in your default browser.
+<!-- Launch gate: add only a real 30–45 second dashboard demo captured from a verified end-to-end run. -->
-## What's New in v2.3
+## Quick start
-- **Full free-tier pipeline with Gemini** β€” image generation (`gemini-3.1-flash-image`) and native voice narration (`gemini-3.1-flash-tts-preview`) now run on your Gemini key. A Gemini-only setup produces complete narrated videos end to end; OpenAI/ElevenLabs are used first when configured. Models and voice are configurable via `GEMINI_IMAGE_MODEL`, `GEMINI_TTS_MODEL`, `GEMINI_TTS_VOICE`. (Thanks to PR #6 for demonstrating the demand and fallback-chain direction.)
-- **~50Γ— faster slideshow rendering** β€” instead of screenshotting a headless browser at 30fps (~10 minutes for a 30-second video), the renderer captures one still per slide and lets FFmpeg build the video with crossfades (seconds).
-- **No more junk template topics** β€” template mode (no AI key) previously scraped single keywords from trending titles and produced videos like "crown: The Complete Guide". It now uses a curated evergreen topic list and only accepts trending topics that read like real subjects.
-- **Model catalog corrections** β€” replaced the nonexistent `gemini-3.5-pro` picker entry with `gemini-3.1-pro-preview` / `gemini-2.5-pro` (verified against Google's current model list).
-
-## What's New in v2.2
-
-This release resolves every open GitHub issue (#1, #2, #3, #4, #8, #9, #13):
-
-- **Gemini (and every other provider) now passes credential validation** β€” startup and setup no longer demand an OpenAI key. Any one configured AI provider (OpenAI, Gemini, OpenRouter, Kimi, MiMo, or GLM) is enough. (#3, #9)
-- **FFmpeg is bundled** β€” `npm install` now pulls a prebuilt FFmpeg binary via `ffmpeg-static`, so `'ffmpeg' is not recognized` is gone. A system install on your PATH or `FFMPEG_PATH` in `.env` still takes precedence. (#1)
-- **Generated content actually reaches the publish queue** β€” the `/generate` pipeline previously produced a video and then never scheduled it, so "Processing publish queue" ran forever with nothing to do. It now queues every successful production. (#2)
-- **Real .mp4 output without paid keys** β€” if TTS isn't configured, the slideshow renders as a silent video instead of dying on a placeholder file. Placeholder `.info` assets are filtered out of slides. (#4)
-- **No more silent failures** β€” a capability check at startup shows exactly which pipeline stages will run for real (βœ“) vs. what's missing and how to fix it (βœ—). Productions that only produced placeholders are marked `simulated`, are never scheduled for upload, and log a loud warning. (#4, #8, #13)
-- **Setup wizard no longer hard-aborts** β€” missing credentials or FFmpeg produce warnings with fix instructions instead of `❌ Setup failed!`. (#9)
-- **Publish-queue logging is informative** β€” shows how many items are waiting and when the next publish happens, instead of an identical line every 15 minutes. (#2)
-
-## What's New in v2.1
+```bash
+git clone https://github.com/darkzOGx/youtube-automation-agent.git
+cd youtube-automation-agent
+npm install
+npm run walkthrough
+npm start
+```
-- **Real AI generation wired in** β€” the Content Strategy, Script Writer, and SEO agents now call your configured AI provider (OpenAI, OpenRouter, Kimi, MiMo, GLM, or Gemini) for topics, scripts, titles, descriptions, and tags. If no provider key is set, they fall back to the built-in templates so the pipeline still runs.
-- **API protection** β€” set `API_KEY` in `.env` and the mutating endpoints (`POST /generate`, `POST /publish/:id`) require a matching `x-api-key` header. Request bodies are validated and size-limited.
-- **Safer publishing** β€” default privacy is now `private` (set `DEFAULT_PRIVACY_STATUS=public` to opt in), and the uploader streams the real video file β€” it refuses to upload placeholder assets from simulated runs.
-- **Startup and scheduler fixes** β€” added the missing `sharp` dependency (the app previously crashed on boot), created the missing `automation_events` table (every scheduled task previously threw on logging), fixed the double-insert in the content pipeline, and fixed the publish-queue removal.
-- **No more fabricated statistics** β€” template scripts no longer invent numbers like "90% of people…".
-- **Cleaner repo** β€” removed two dead OAuth flows (`authenticate.js`, `simple-auth.js` used Google's long-deprecated OOB flow), dead dependencies (`cron`, `jimp`), broken npm scripts, and committed build artifacts. Added ESLint (`npm run lint`) and GitHub Actions CI.
+Open `http://localhost:3456`. The walkthrough explains each provider choice, tests credentials, and guides YouTube authorization.
-## What's New in v2.0
+Already know what you are doing? `npm run setup` offers a shorter classic flow, and `.env.example` documents every setting.
-- **Model upgrades across the board** β€” GPT-5.5 / GPT-5.5 Instant replace GPT-4-turbo, GPT Image 2 replaces DALL-E 3, Gemini 3.5 Flash/Pro replace Gemini 1.x, ElevenLabs Eleven v3 replaces v1, Wan 2.7 replaces Stable Video Diffusion
-- **OpenAI SDK v6** β€” upgraded from v4, along with `@google/genai` v2.9, `replicate` v1.4, `googleapis` v173
-- **Revamped setup wizard** β€” new TTS service picker (OpenAI TTS / ElevenLabs / Azure), ElevenLabs credential setup, updated model selection menus
-- **Fixed deprecated API patterns** β€” OpenAI v3 SDK calls in credential testing replaced with v4+ patterns
-- **Dynamic year in content strategy** β€” no more hardcoded "2025" in trend analysis prompts
-- **README rewrite** β€” developer-focused docs with Mermaid architecture diagrams, no fluff
+### What you need
----
+- Node.js 18+
+- A Google account and YouTube Data API credentials
+- At least one AI text provider key
+- FFmpeg, installed automatically through `ffmpeg-static`
-Fully automated YouTube channel management system. AI agents handle content strategy, scriptwriting, thumbnail generation, SEO, publishing, and analytics β€” end to end, on a daily schedule.
+Gemini offers free access for supported text and TTS usage. Gemini AI image generation currently requires paid-tier access; without an image provider, Lumen can assemble gradient-based visuals instead.
-## Built by
+## From idea to published video
-[@darkzOGx](https://github.com/darkzOGx). Solo builder shipping AI automation and developer tools.
+| Stage | What Lumen does | What you control |
+| --- | --- | --- |
+| Research | Finds topics and builds a content strategy | Niche, audience, blocked topics |
+| Script | Writes the hook, narrative, CTA, and metadata | Voice, format, length, brand direction |
+| Production | Generates narration and visuals, then assembles a real MP4 | Provider choice and media fallbacks |
+| Review | Runs quality checks and opens the video in Review Studio | Facts, media rights, edits, approval |
+| Publish | Schedules and uploads approved content | Privacy, timing, final decision |
+| Learn | Pulls performance signals into the next strategy cycle | Automation and optimization settings |
-Find me on [X](https://x.com/darkzOGx) and [laderalabs.io](https://laderalabs.io).
+Lumen distinguishes real MP4 output from simulated placeholders. Simulated output cannot enter the approval or publishing path.
-If this saves you time, a star helps it reach more developers.
+For release history, see [CHANGELOG.md](CHANGELOG.md).
## Architecture
@@ -104,11 +88,11 @@ All OpenAI-compatible providers work out of the box β€” the system auto-configur
```mermaid
graph LR
subgraph Direct
- OA[OpenAI<br/>GPT-5.5]
- GM[Gemini<br/>3.5 Flash/Pro]
- KM[Kimi<br/>K2.6]
+ OA[OpenAI<br/>GPT-5.6 family]
+ GM[Gemini<br/>3.5 Flash / 3.1 Pro]
+ KM[Kimi<br/>K3]
MM[MiMo<br/>V2.5 Pro]
- GL[GLM<br/>GLM-5]
+ GL[GLM<br/>GLM-5.3]
end
subgraph Router
OR[OpenRouter<br/>300+ models]
@@ -119,37 +103,15 @@ graph LR
| Provider | Models | Base URL | Cost |
|----------|--------|----------|------|
-| **OpenAI** | GPT-5.5, GPT-5.5 Instant | `api.openai.com/v1` | ~$0.05–0.20/video |
-| **OpenRouter** | 300+ (GPT, Claude, Gemini, Kimi, GLM, etc.) | `openrouter.ai/api/v1` | varies by model |
-| **Google Gemini** | Gemini 3.5 Flash, 3.5 Pro | via `@google/genai` SDK | free tier available |
-| **Kimi (Moonshot AI)** | Kimi K2.6, K2.5 | `api.moonshot.ai/v1` | ~80% cheaper than GPT-5.5 |
-| **MiMo (Xiaomi)** | MiMo V2.5 Pro, V2.5 | `api.xiaomimimo.com/v1` | competitive |
-| **GLM (Zhipu AI)** | GLM-5, GLM-5.1 | `api.z.ai/api/paas/v4/` | ~$1/M input tokens |
+| **OpenAI** | GPT-5.6 Sol, Terra, Luna | `api.openai.com/v1` | provider pricing |
+| **OpenRouter** | 300+ models; curated defaults are validated against its live catalog | `openrouter.ai/api/v1` | varies by model |
+| **Google Gemini** | Gemini 3.5 Flash, 3.1 Pro Preview, 2.5 Pro | via `@google/genai` SDK | free tiers vary by model and modality |
+| **Kimi (Moonshot AI)** | Kimi K3, K2.7 Code, K2.6 | `api.moonshot.ai/v1` | provider pricing |
+| **MiMo (Xiaomi)** | MiMo V2.5 Pro, V2.5 | `api.xiaomimimo.com/v1` | provider pricing |
+| **GLM (Zhipu AI)** | GLM-5.3, 5.2, 5.1 | `api.z.ai/api/paas/v4/` | provider pricing |
Additional integrations: Anthropic Claude (`claude-opus-4-8`), ElevenLabs (Eleven v3 TTS), Replicate (Wan 2.7 video), local models via Ollama, any OpenAI-compatible endpoint.
-## Quick Start
-
-```bash
-git clone https://github.com/darkzOGx/youtube-automation-agent.git
-cd youtube-automation-agent
-npm install
-npm run walkthrough # guided first-time setup: explains everything, tests your keys live
-npm start
-```
-
-Dashboard runs at `http://localhost:3456`.
-
-Already know what you're doing? `npm run setup` offers a classic quick mode, and `.env.example` documents every setting.
-
-### Prerequisites
-
-- Node.js 18+
-- FFmpeg β€” bundled automatically via `ffmpeg-static` on `npm install`; a system install on your PATH or an `FFMPEG_PATH` env var takes precedence
-- Google account (YouTube Data API β€” free)
-- At least one AI provider key (OpenAI, Gemini, OpenRouter, Kimi, MiMo, or GLM) β€” without one, agents fall back to template-based generation
-- Images and narration come from your AI key: OpenAI **or Gemini** both cover image generation and TTS (ElevenLabs / Azure Speech optional for premium voices) β€” with no media provider at all you get gradient slides and silent video
-
## Configuration
### API Keys
@@ -212,8 +174,18 @@ DEFAULT_PRIVACY_STATUS=private
# Optional: protect mutating API routes (POST /generate, /publish)
# API_KEY=some-long-random-string
+
+# Optional anonymous activation milestones (off by default; HTTPS endpoint required)
+# ANONYMOUS_TELEMETRY_ENABLED=false
+# ANONYMOUS_TELEMETRY_ENDPOINT=https://your-collector.example/events
```
+### Activation measurement and privacy
+
+The dashboard calculates setup, first-real-MP4, approval, publication, and repeat-generation milestones locally from SQLite and files on disk. A video counts only when a non-simulated `.mp4` with an MP4 container signature still exists.
+
+Anonymous milestone reporting is disabled by default and has no built-in collector. It activates only when you explicitly set both telemetry variables. The allowlisted payload contains the milestone name and time, Lumen version, OS family, Node major version, and a random installation ID. It never includes credentials, channel data, prompts, topics, titles, filenames, or video contents.
+
## Automation Schedule
```mermaid
@@ -370,6 +342,12 @@ If this was useful, check out:
- [open-sales-researcher](https://github.com/darkzOGx/open-sales-researcher): autonomous B2B company research. Works with Claude Code, Cursor, Copilot.
- [darkzseo](https://github.com/darkzOGx/darkzseo): SEO tooling
+## Built by
+
+[@darkzOGx](https://github.com/darkzOGx), a solo builder shipping AI automation and developer tools. Find me on [X](https://x.com/darkzOGx) and [laderalabs.io](https://laderalabs.io).
+
+If Lumen saves you time, a star helps it reach more developers.
+
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) for ground rules (short version: one focused concern per PR, no lockfile churn, lint + tests must pass). For questions and setup help, use [Discussions](https://github.com/darkzOGx/youtube-automation-agent/discussions) β€” Issues is for bugs.
@@ -395,10 +373,11 @@ MIT β€” see [LICENSE](LICENSE).
- [OpenAI](https://openai.com/) β€” GPT-5.6 Sol, GPT Image 2, GPT-4o-mini-tts
- [OpenRouter](https://openrouter.ai/) β€” unified multi-model API
-- [Google](https://ai.google.dev/) β€” YouTube Data API, Gemini 3.6 Flash
+- [Google](https://ai.google.dev/) β€” Gemini 3.5 Flash, Gemini 3.1 Flash Image, Gemini 3.1 Flash TTS
+- [Google Cloud](https://console.cloud.google.com/) β€” YouTube Data API
- [Moonshot AI](https://www.moonshot.ai/) β€” Kimi K3
- [Xiaomi](https://mimo.mi.com/) β€” MiMo V2.5 Pro
-- [Zhipu AI](https://z.ai/) β€” GLM-5.2
+- [Zhipu AI](https://z.ai/) β€” GLM-5.3
- [ElevenLabs](https://elevenlabs.io/) β€” Eleven v3 TTS
- [Replicate](https://replicate.com/) β€” Wan 2.7 video generation
- [ConstructionBids.ai](https://constructionbids.ai) - AI scans every federal, state & local public works bid and matches you to contracts you'll win.
diff --git a/assets/demo/README.md b/assets/demo/README.md
new file mode 100644
index 0000000..734ed98
--- /dev/null
+++ b/assets/demo/README.md
@@ -0,0 +1,13 @@
+# Demo capture specification
+
+Capture a real Lumen run in approximately 30–45 seconds:
+
+1. Enter: `Create a channel about forgotten American engineering projects`.
+2. Start generation and show strategy, script, narration, visuals, video, thumbnail, and SEO stages completing.
+3. Open the generated real MP4 in Review Studio.
+4. Show the factual-review and media-rights confirmations.
+5. Approve the video and show its private YouTube schedule.
+
+Use actual elapsed generation off camera and edit the recording for time. Do not imply that the full generation completed in 30–45 seconds. Blur credentials, OAuth data, channel IDs, and private upload details.
+
+The final README asset should be optimized for GitHub rendering and accompanied by a linked full-resolution video.
diff --git a/config/credentials.example.json b/config/credentials.example.json
index cfbd9f7..5b95ada 100644
--- a/config/credentials.example.json
+++ b/config/credentials.example.json
@@ -8,7 +8,7 @@
},
"openai": {
"apiKey": "YOUR_OPENAI_API_KEY",
- "model": "gpt-5.5"
+ "model": "gpt-5.6"
},
"channel": {
"channelName": "Your Channel Name",
diff --git a/dashboard/app.js b/dashboard/app.js
index 9b02725..8e6a543 100644
--- a/dashboard/app.js
+++ b/dashboard/app.js
@@ -136,6 +136,7 @@ function renderDashboard() {
renderCalendar(state.schedule);
renderIdeas(state.ideas);
renderAnalytics(state.analytics);
+ renderActivation(state.activation);
populateSettings(state.profile, state.settings);
}
@@ -265,6 +266,31 @@ function renderAnalytics(analytics) {
<article class="performer-card"><strong>${escapeHTML(item.videoDetails?.title || item.title || 'Untitled video')}</strong><div class="meta-line">Performance ${escapeHTML(item.performance?.score ?? item.performance_score ?? 'β€”')} / 100</div></article>`).join('') : empty('No analyzed videos yet.');
}
+function renderActivation(activation = {}) {
+ const container = $('#activation-list');
+ if (!container) return;
+ const milestones = activation.milestones || {};
+ const rows = [
+ ['Setup ready', milestones.setupReady],
+ ['First real MP4', milestones.firstRealVideo],
+ ['First approval', milestones.firstApproval],
+ ['First YouTube publish', milestones.firstPublish],
+ ['Second real MP4', milestones.secondRealVideo]
+ ];
+ container.innerHTML = rows.map(([name, milestone = {}]) => `
+ <div class="timeline-item">
+ <div class="timeline-dot ${milestone.achieved ? 'done' : ''}"></div>
+ <div><strong>${escapeHTML(name)}</strong><div class="meta-line">${milestone.achieved ? escapeHTML(formatDate(milestone.at)) : 'Not reached yet'}</div></div>
+ </div>`).join('');
+ if (milestones.firstRealVideo?.achieved) {
+ container.insertAdjacentHTML('beforeend', `
+ <div class="activation-share">
+ <span>Made something real with Lumen?</span>
+ <a class="button secondary small" href="https://github.com/darkzOGx/youtube-automation-agent/discussions/new?category=show-and-tell" target="_blank" rel="noreferrer">Share what you built</a>
+ </div>`);
+ }
+}
+
function populateSettings(profile = {}, settings = {}) {
const form = $('#profile-form');
const mapping = {
diff --git a/dashboard/index.html b/dashboard/index.html
index d4ad1f3..10d962e 100644
--- a/dashboard/index.html
+++ b/dashboard/index.html
@@ -95,6 +95,7 @@
<article class="stat wide"><span>Recommended action</span><strong id="analytics-action" class="recommendation">Collecting enough data to recommend a move.</strong></article>
</div>
<article class="panel"><div class="panel-heading"><div><p class="eyebrow">TOP PERFORMERS</p><h2>What is working</h2></div></div><div id="top-performers" class="card-list"></div></article>
+ <article class="panel activation-panel"><div class="panel-heading"><div><p class="eyebrow">LOCAL ACTIVATION</p><h2>First-run journey</h2></div></div><p class="callout">Calculated locally from your database and video files. Nothing is transmitted unless anonymous telemetry is explicitly enabled.</p><div id="activation-list" class="timeline"></div></article>
</section>
<section id="settings-view" class="view">
diff --git a/dashboard/styles.css b/dashboard/styles.css
index de243b9..e202a05 100644
--- a/dashboard/styles.css
+++ b/dashboard/styles.css
@@ -128,6 +128,11 @@ label small { color: var(--muted); font-weight: 400; }
.dialog-heading h2 { font-size: 27px; }
.content-dialog { width: min(980px, calc(100vw - 30px)); }
.callout { background: rgba(114,165,255,.08); border: 1px solid rgba(114,165,255,.18); padding: 12px; border-radius: 10px; color: #b9d0fb; font-size: 12px; margin: 0; }
+.activation-panel { margin-top: 18px; }
+.activation-panel .callout { margin-bottom: 14px; }
+.timeline-dot { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; border: 2px solid var(--muted); }
+.timeline-dot.done { border-color: var(--green); background: var(--green); box-shadow: 0 0 0 4px rgba(72, 213, 151, .1); }
+.activation-share { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; padding-top: 4px; }
.content-layout { display: grid; grid-template-columns: 1fr 1.15fr; gap: 22px; }
.preview { background: #080a0d; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; aspect-ratio: 16/9; display: grid; place-items: center; }
.preview video, .preview img { width: 100%; height: 100%; object-fit: contain; }
diff --git a/eslint.config.js b/eslint.config.js
index c3c2a90..45b8e86 100644
--- a/eslint.config.js
+++ b/eslint.config.js
@@ -23,6 +23,7 @@ module.exports = [
ecmaVersion: 2022,
sourceType: 'commonjs',
globals: {
+ AbortController: 'readonly',
__dirname: 'readonly',
Buffer: 'readonly',
clearTimeout: 'readonly',
diff --git a/examples/README.md b/examples/README.md
new file mode 100644
index 0000000..cef08f1
--- /dev/null
+++ b/examples/README.md
@@ -0,0 +1,24 @@
+# Made with Lumen
+
+This directory is reserved for verified output evidence. Do not add mock videos, simulated runs, or estimated results.
+
+For each example, provide:
+
+```markdown
+## Video title
+
+- Niche or prompt:
+- Text provider and model:
+- Image provider and model:
+- TTS provider and model:
+- Started at:
+- Finished at:
+- Elapsed generation time:
+- Estimated API cost and calculation source:
+- Human editing time:
+- Lumen version or commit:
+- Final video URL:
+- Verification: non-simulated MP4 container signature confirmed
+```
+
+The preferred launch gallery contains three materially different niches and preserves truthful failures, retries, and manual edits in the notes.
diff --git a/index.js b/index.js
index cd1b9db..a617417 100644
--- a/index.js
+++ b/index.js
@@ -15,6 +15,8 @@ const { PublishingSchedulingAgent } = require('./agents/publishing-scheduling-ag
const { AnalyticsOptimizationAgent } = require('./agents/analytics-optimization-agent');
const { DailyAutomation } = require('./schedules/daily-automation');
const { OperatorService } = require('./utils/operator-service');
+const { ActivationMetrics } = require('./utils/activation-metrics');
+const { AnonymousTelemetry } = require('./utils/anonymous-telemetry');
const { version } = require('./package.json');
const chalk = require('chalk');
@@ -28,6 +30,8 @@ class YouTubeAutomationAgent {
this.isInitialized = false;
this.activeJobs = new Map();
this.operator = null;
+ this.activation = null;
+ this.telemetry = null;
this.setupRequired = false;
}
@@ -42,6 +46,8 @@ class YouTubeAutomationAgent {
await this.db.initialize();
await this.db.markInterruptedJobs();
this.operator = new OperatorService(this.db);
+ this.activation = new ActivationMetrics(this.db);
+ this.telemetry = new AnonymousTelemetry(this.db, this.logger);
// Load credentials
this.logger.info('Loading credentials...');
@@ -63,7 +69,10 @@ class YouTubeAutomationAgent {
await this.initializeAgents();
// Show which pipeline stages will run for real vs. be simulated
- await this.logCapabilitySummary();
+ const capabilities = await this.logCapabilitySummary();
+ if (capabilities.hasText && capabilities.hasFFmpeg && capabilities.hasUpload) {
+ await this.activation.markSetupReady(capabilities);
+ }
// Setup API endpoints
this.setupAPI();
@@ -144,6 +153,7 @@ class YouTubeAutomationAgent {
this.logger.warn('FFmpeg is missing: no .mp4 files can be produced until it is installed.');
}
console.log('');
+ return { hasText, hasImages, hasTTS, hasFFmpeg, hasUpload };
}
requireAPIKey() {
@@ -307,7 +317,7 @@ class YouTubeAutomationAgent {
this.app.get('/api/dashboard', async (_req, res) => {
try {
- const [stats, jobs, pipeline, schedule, events, notifications, profile, settings, ideas, analytics] = await Promise.all([
+ const [stats, jobs, pipeline, schedule, events, notifications, profile, settings, ideas, analytics, activation] = await Promise.all([
this.db.getStats(),
this.db.listGenerationJobs(20),
this.db.getPipelineOverview(50),
@@ -319,10 +329,14 @@ class YouTubeAutomationAgent {
this.db.listContentIdeas(),
this.agents.analytics
? this.agents.analytics.getRecentAnalytics(30)
- : Promise.resolve({ totalVideos: 0, averagePerformanceScore: 0, topPerformers: [], insights: [] })
+ : Promise.resolve({ totalVideos: 0, averagePerformanceScore: 0, topPerformers: [], insights: [] }),
+ this.activation
+ ? this.activation.getSummary()
+ : Promise.resolve({ privacy: 'local-only', counts: {}, milestones: {} })
]);
+ if (this.telemetry) void this.telemetry.sync(activation);
res.json({
- stats, jobs, pipeline, schedule, events, notifications, profile, settings, ideas, analytics,
+ stats, jobs, pipeline, schedule, events, notifications, profile, settings, ideas, analytics, activation,
system: {
initialized: this.isInitialized,
setupRequired: this.setupRequired,
diff --git a/package.json b/package.json
index 68d0f53..5d6fbbe 100644
--- a/package.json
+++ b/package.json
@@ -1,12 +1,13 @@
{
"name": "youtube-automation-agent",
"version": "2.5.0",
- "description": "Fully automated YouTube channel management system with specialized AI agents",
+ "description": "Lumen is an open-source AI agent that runs a YouTube channel end to end",
"main": "index.js",
"scripts": {
"start": "node index.js",
"setup": "node setup.js",
"walkthrough": "node walkthrough.js",
+ "growth:snapshot": "node scripts/growth/snapshot-github.js",
"scheduler": "node schedules/daily-automation.js",
"test": "node test.js",
"agent:strategy": "node agents/content-strategy-agent.js",
diff --git a/reports/growth/baseline-2026-08-18.json b/reports/growth/baseline-2026-08-18.json
new file mode 100644
index 0000000..dcc21ce
--- /dev/null
+++ b/reports/growth/baseline-2026-08-18.json
@@ -0,0 +1,285 @@
+{
+ "schemaVersion": 1,
+ "snapshotDate": "2026-08-18",
+ "capturedAt": "2026-08-18T19:51:41.427Z",
+ "repository": {
+ "fullName": "darkzOGx/youtube-automation-agent",
+ "stars": 2240,
+ "forks": 587,
+ "forkToStarPercent": 26.2,
+ "subscribers": 22,
+ "topics": 20,
+ "license": "MIT",
+ "defaultBranch": "master",
+ "pushedAt": "2026-08-18T17:03:25Z"
+ },
+ "traffic": {
+ "views": {
+ "count": 11824,
+ "uniques": 5482,
+ "days": [
+ {
+ "timestamp": "2026-08-04T00:00:00Z",
+ "count": 323,
+ "uniques": 216
+ },
+ {
+ "timestamp": "2026-08-05T00:00:00Z",
+ "count": 335,
+ "uniques": 201
+ },
+ {
+ "timestamp": "2026-08-06T00:00:00Z",
+ "count": 399,
+ "uniques": 205
+ },
+ {
+ "timestamp": "2026-08-07T00:00:00Z",
+ "count": 367,
+ "uniques": 198
+ },
+ {
+ "timestamp": "2026-08-08T00:00:00Z",
+ "count": 352,
+ "uniques": 179
+ },
+ {
+ "timestamp": "2026-08-09T00:00:00Z",
+ "count": 329,
+ "uniques": 171
+ },
+ {
+ "timestamp": "2026-08-10T00:00:00Z",
+ "count": 363,
+ "uniques": 200
+ },
+ {
+ "timestamp": "2026-08-11T00:00:00Z",
+ "count": 457,
+ "uniques": 225
+ },
+ {
+ "timestamp": "2026-08-12T00:00:00Z",
+ "count": 361,
+ "uniques": 195
+ },
+ {
+ "timestamp": "2026-08-13T00:00:00Z",
+ "count": 1003,
+ "uniques": 524
+ },
+ {
+ "timestamp": "2026-08-14T00:00:00Z",
+ "count": 3117,
+ "uniques": 1657
+ },
+ {
+ "timestamp": "2026-08-15T00:00:00Z",
+ "count": 1538,
+ "uniques": 860
+ },
+ {
+ "timestamp": "2026-08-16T00:00:00Z",
+ "count": 1250,
+ "uniques": 661
+ },
+ {
+ "timestamp": "2026-08-17T00:00:00Z",
+ "count": 1630,
+ "uniques": 846
+ }
+ ]
+ },
+ "clones": {
+ "count": 1437,
+ "uniques": 1058,
+ "days": [
+ {
+ "timestamp": "2026-08-04T00:00:00Z",
+ "count": 57,
+ "uniques": 33
+ },
+ {
+ "timestamp": "2026-08-05T00:00:00Z",
+ "count": 42,
+ "uniques": 32
+ },
+ {
+ "timestamp": "2026-08-06T00:00:00Z",
+ "count": 61,
+ "uniques": 38
+ },
+ {
+ "timestamp": "2026-08-07T00:00:00Z",
+ "count": 41,
+ "uniques": 34
+ },
+ {
+ "timestamp": "2026-08-08T00:00:00Z",
+ "count": 56,
+ "uniques": 23
+ },
+ {
+ "timestamp": "2026-08-09T00:00:00Z",
+ "count": 25,
+ "uniques": 20
+ },
+ {
+ "timestamp": "2026-08-10T00:00:00Z",
+ "count": 40,
+ "uniques": 29
+ },
+ {
+ "timestamp": "2026-08-11T00:00:00Z",
+ "count": 47,
+ "uniques": 40
+ },
+ {
+ "timestamp": "2026-08-12T00:00:00Z",
+ "count": 29,
+ "uniques": 27
+ },
+ {
+ "timestamp": "2026-08-13T00:00:00Z",
+ "count": 101,
+ "uniques": 87
+ },
+ {
+ "timestamp": "2026-08-14T00:00:00Z",
+ "count": 370,
+ "uniques": 294
+ },
+ {
+ "timestamp": "2026-08-15T00:00:00Z",
+ "count": 210,
+ "uniques": 180
+ },
+ {
+ "timestamp": "2026-08-16T00:00:00Z",
+ "count": 168,
+ "uniques": 137
+ },
+ {
+ "timestamp": "2026-08-17T00:00:00Z",
+ "count": 190,
+ "uniques": 155
+ }
+ ]
+ },
+ "referrers": [
+ {
+ "referrer": "Google",
+ "count": 4227,
+ "uniques": 2361
+ },
+ {
+ "referrer": "github.com",
+ "count": 1786,
+ "uniques": 914
+ },
+ {
+ "referrer": "search.brave.com",
+ "count": 187,
+ "uniques": 89
+ },
+ {
+ "referrer": "l.instagram.com",
+ "count": 154,
+ "uniques": 106
+ },
+ {
+ "referrer": "instagram.com",
+ "count": 128,
+ "uniques": 92
+ },
+ {
+ "referrer": "Bing",
+ "count": 98,
+ "uniques": 63
+ },
+ {
+ "referrer": "t.co",
+ "count": 98,
+ "uniques": 52
+ },
+ {
+ "referrer": "chatgpt.com",
+ "count": 57,
+ "uniques": 32
+ },
+ {
+ "referrer": "DuckDuckGo",
+ "count": 54,
+ "uniques": 30
+ },
+ {
+ "referrer": "darkzogx-youtube-automation-agent.mintlify.app",
+ "count": 41,
+ "uniques": 32
+ }
+ ],
+ "referrersUnavailable": null,
+ "uniqueCloneVisitorIndicatorPercent": 19.3
+ },
+ "stars": {
+ "totalTimestamped": 2240,
+ "daily": [
+ {
+ "date": "2026-08-05",
+ "stars": 6
+ },
+ {
+ "date": "2026-08-06",
+ "stars": 5
+ },
+ {
+ "date": "2026-08-07",
+ "stars": 9
+ },
+ {
+ "date": "2026-08-08",
+ "stars": 6
+ },
+ {
+ "date": "2026-08-09",
+ "stars": 3
+ },
+ {
+ "date": "2026-08-10",
+ "stars": 7
+ },
+ {
+ "date": "2026-08-11",
+ "stars": 5
+ },
+ {
+ "date": "2026-08-12",
+ "stars": 10
+ },
+ {
+ "date": "2026-08-13",
+ "stars": 45
+ },
+ {
+ "date": "2026-08-14",
+ "stars": 169
+ },
+ {
+ "date": "2026-08-15",
+ "stars": 50
+ },
+ {
+ "date": "2026-08-16",
+ "stars": 43
+ },
+ {
+ "date": "2026-08-17",
+ "stars": 57
+ },
+ {
+ "date": "2026-08-18",
+ "stars": 91
+ }
+ ]
+ }
+}
diff --git a/reports/growth/baseline-2026-08-18.md b/reports/growth/baseline-2026-08-18.md
new file mode 100644
index 0000000..6334e0f
--- /dev/null
+++ b/reports/growth/baseline-2026-08-18.md
@@ -0,0 +1,56 @@
+# Lumen growth baseline β€” 2026-08-18
+
+Captured at 2026-08-18T19:51:41.427Z. GitHub traffic and clone figures are rolling aggregates and are not cohort-aligned.
+
+## Public repository signals
+
+- Stars: 2,240
+- Forks: 587
+- Fork-to-star ratio: 26.2%
+- Subscribers: 22
+- Topics: 20
+- Last push: 2026-08-18T17:03:25Z
+
+## Rolling GitHub traffic
+
+- Views: 11,824 (5,482 unique)
+- Clones: 1,437 (1,058 unique)
+- Unique-cloner / unique-visitor indicator: 19.3%
+
+> This indicator is directional only. GitHub does not expose a cohort-aligned visitor-to-clone conversion rate.
+
+## Top referrers
+
+| Referrer | Views | Unique visitors |
+| --- | ---: | ---: |
+| Google | 4,227 | 2,361 |
+| github.com | 1,786 | 914 |
+| search.brave.com | 187 | 89 |
+| l.instagram.com | 154 | 106 |
+| instagram.com | 128 | 92 |
+| Bing | 98 | 63 |
+| t.co | 98 | 52 |
+| chatgpt.com | 57 | 32 |
+| DuckDuckGo | 54 | 30 |
+| darkzogx-youtube-automation-agent.mintlify.app | 41 | 32 |
+
+## Stars added by UTC day
+
+| Date | Stars |
+| --- | ---: |
+| 2026-08-05 | 6 |
+| 2026-08-06 | 5 |
+| 2026-08-07 | 9 |
+| 2026-08-08 | 6 |
+| 2026-08-09 | 3 |
+| 2026-08-10 | 7 |
+| 2026-08-11 | 5 |
+| 2026-08-12 | 10 |
+| 2026-08-13 | 45 |
+| 2026-08-14 | 169 |
+| 2026-08-15 | 50 |
+| 2026-08-16 | 43 |
+| 2026-08-17 | 57 |
+| 2026-08-18 | 91 |
+
+Generated by `npm run growth:snapshot`.
diff --git a/reports/growth/fork-census-2026-08-18.json b/reports/growth/fork-census-2026-08-18.json
new file mode 100644
index 0000000..9a1b267
--- /dev/null
+++ b/reports/growth/fork-census-2026-08-18.json
@@ -0,0 +1,68 @@
+{
+ "schemaVersion": 1,
+ "snapshotDate": "2026-08-18",
+ "capturedAt": "2026-08-18T19:51:41.427Z",
+ "repository": "darkzOGx/youtube-automation-agent",
+ "repositoryForkCount": 587,
+ "totalForks": 597,
+ "comparedCandidates": 40,
+ "aheadForks": 3,
+ "starredForks": 18,
+ "comparisonFailures": [],
+ "manualReview": [
+ {
+ "owner": "caglar203aydemir-create",
+ "fullName": "caglar203aydemir-create/youtube-automation-agent",
+ "htmlUrl": "https://github.com/caglar203aydemir-create/youtube-automation-agent",
+ "description": "🎬 Fully automated YouTube channel management with AI agents. Creates, optimizes & publishes videos 24/7. Works with FREE Gemini API or OpenAI. No coding required!",
+ "stars": 1,
+ "pushedAt": "2026-05-28T15:35:19Z",
+ "aheadBy": 1,
+ "behindBy": 20,
+ "status": "diverged",
+ "changedFiles": [
+ ".github/workflows/node.js.yml"
+ ]
+ },
+ {
+ "owner": "SMC-OS",
+ "fullName": "SMC-OS/youtube-automation-agent",
+ "htmlUrl": "https://github.com/SMC-OS/youtube-automation-agent",
+ "description": "🎬 Fully automated YouTube channel management with AI agents. Creates, optimizes & publishes videos 24/7. Works with FREE Gemini API or OpenAI. No coding required!",
+ "stars": 0,
+ "pushedAt": "2026-08-17T23:39:59Z",
+ "aheadBy": 2,
+ "behindBy": 3,
+ "status": "diverged",
+ "changedFiles": [
+ ".gitignore",
+ "agents/publishing-scheduling-agent.js",
+ "database/db.js",
+ "index.js",
+ "oauth-server.js",
+ "schedules/daily-automation.js",
+ "test.js",
+ "test/publishing-workflow.test.js",
+ "utils/credential-manager.js",
+ "utils/ffmpeg.js",
+ "utils/media-validator.js"
+ ]
+ },
+ {
+ "owner": "trendnearby",
+ "fullName": "trendnearby/youtube-automation-agent",
+ "htmlUrl": "https://github.com/trendnearby/youtube-automation-agent",
+ "description": "🎬 Fully automated YouTube channel management with AI agents. Creates, optimizes & publishes videos 24/7. Works with FREE Gemini API or OpenAI. No coding required!",
+ "stars": 0,
+ "pushedAt": "2026-08-18T09:12:22Z",
+ "aheadBy": 1,
+ "behindBy": 3,
+ "status": "diverged",
+ "changedFiles": [
+ ".dockerignore",
+ "Dockerfile",
+ "render.yaml"
+ ]
+ }
+ ]
+}
diff --git a/reports/growth/fork-census-2026-08-18.md b/reports/growth/fork-census-2026-08-18.md
new file mode 100644
index 0000000..f6a6f7f
--- /dev/null
+++ b/reports/growth/fork-census-2026-08-18.md
@@ -0,0 +1,19 @@
+# Lumen public fork census β€” 2026-08-18
+
+GitHub's repository summary reported 587 forks. The paginated REST census returned 597 unique public fork records and compared 40 high-signal candidates with upstream.
+
+- Forks with commits ahead of upstream: 3
+- Forks with their own stars: 18
+- Candidates requiring manual product/use-case review: 3
+
+The summary count and paginated enumeration can differ while GitHub updates an active fork network. Comparison status can also change as upstream advances. A fork being ahead does not prove deployment or production use.
+
+## Manual-review queue
+
+| Fork | Ahead | Stars | Last push | Changed files |
+| --- | ---: | ---: | --- | --- |
+| [caglar203aydemir-create/youtube-automation-agent](https://github.com/caglar203aydemir-create/youtube-automation-agent) | 1 | 1 | 2026-05-28T15:35:19Z | .github/workflows/node.js.yml |
+| [SMC-OS/youtube-automation-agent](https://github.com/SMC-OS/youtube-automation-agent) | 2 | 0 | 2026-08-17T23:39:59Z | .gitignore, agents/publishing-scheduling-agent.js, database/db.js, index.js, oauth-server.js |
+| [trendnearby/youtube-automation-agent](https://github.com/trendnearby/youtube-automation-agent) | 1 | 0 | 2026-08-18T09:12:22Z | .dockerignore, Dockerfile, render.yaml |
+
+Generated from public GitHub metadata by `npm run growth:snapshot`. No private fork data or profile geography is collected.
diff --git a/reports/growth/prelaunch-readiness-2026-08-18.md b/reports/growth/prelaunch-readiness-2026-08-18.md
new file mode 100644
index 0000000..cca6b33
--- /dev/null
+++ b/reports/growth/prelaunch-readiness-2026-08-18.md
@@ -0,0 +1,26 @@
+# Lumen pre-launch readiness β€” 2026-08-18
+
+## Completed in repository
+
+- Captured the GitHub traffic, clone, referrer, star-growth, and public-fork baseline.
+- Added a repeatable `npm run growth:snapshot` collector.
+- Added local-only activation milestones for setup, first real MP4, approval, publication, and second real MP4.
+- Added an anonymous milestone reporter that is off by default, requires an explicit HTTPS endpoint, and sends only allowlisted fields.
+- Reworked the README around the product outcome and moved release history to `CHANGELOG.md`.
+- Reconciled in-repository model IDs and removed unsupported price/free-tier claims.
+
+## Launch blockers
+
+- [ ] Capture a real 30–45 second dashboard demo from a verified end-to-end run.
+- [ ] Publish three verified outputs using the evidence template under `examples/`.
+- [ ] Run a clean Gemini-first installation through a real non-simulated MP4.
+- [ ] Synchronize the external Mintlify site with the repository. Its source is not present in this checkout, and the live site still contains older setup, model, and cost claims.
+- [ ] Replace the repository homepage field with the documentation URL only after the documentation is synchronized.
+- [ ] Review the high-signal public forks identified in the fork census for real use cases and potential contributors.
+
+## Evidence rules
+
+- Do not present generated or seeded dashboard data as a customer run.
+- Do not call a video verified unless the final file exists, carries an MP4 container signature, and is not marked simulated.
+- Record provider, elapsed generation time, estimated API cost, human editing time, and final-video URL for every gallery example.
+- Keep GitHub visitor-to-clone figures labeled as directional indicators rather than cohort conversion rates.
diff --git a/scripts/growth/snapshot-github.js b/scripts/growth/snapshot-github.js
new file mode 100644
index 0000000..0a1f54a
--- /dev/null
+++ b/scripts/growth/snapshot-github.js
@@ -0,0 +1,253 @@
+const { execFileSync } = require('child_process');
+const fs = require('fs');
+const path = require('path');
+
+const REPOSITORY = process.env.GITHUB_REPOSITORY || 'darkzOGx/youtube-automation-agent';
+const REPORT_ROOT = path.join(__dirname, '..', '..', 'reports', 'growth');
+const now = new Date();
+const snapshotDate = now.toISOString().slice(0, 10);
+
+function ghApi(endpoint, { paginate = false, accept } = {}) {
+ const args = ['api'];
+ if (accept) args.push('-H', `Accept: ${accept}`);
+ if (paginate) args.push('--paginate', '--slurp');
+ args.push(endpoint);
+ const output = execFileSync('gh', args, {
+ encoding: 'utf8',
+ maxBuffer: 50 * 1024 * 1024,
+ stdio: ['ignore', 'pipe', 'pipe']
+ });
+ const parsed = JSON.parse(output);
+ return paginate ? parsed.flat() : parsed;
+}
+
+function tryGhApi(endpoint, options = {}) {
+ try {
+ return ghApi(endpoint, options);
+ } catch (error) {
+ const detail = error.stderr?.toString().trim() || error.message;
+ return { unavailable: true, reason: detail };
+ }
+}
+
+function percent(numerator, denominator) {
+ return denominator ? Number(((numerator / denominator) * 100).toFixed(1)) : null;
+}
+
+function groupStarsByDay(stargazers, days = 14) {
+ const cutoff = new Date(now);
+ cutoff.setUTCDate(cutoff.getUTCDate() - (days - 1));
+ cutoff.setUTCHours(0, 0, 0, 0);
+ const daily = new Map();
+ for (let offset = 0; offset < days; offset++) {
+ const date = new Date(cutoff);
+ date.setUTCDate(cutoff.getUTCDate() + offset);
+ daily.set(date.toISOString().slice(0, 10), 0);
+ }
+ for (const entry of stargazers) {
+ const day = entry.starred_at?.slice(0, 10);
+ if (daily.has(day)) daily.set(day, daily.get(day) + 1);
+ }
+ return Array.from(daily, ([date, stars]) => ({ date, stars }));
+}
+
+function summarizeTraffic(traffic) {
+ if (traffic?.unavailable) return traffic;
+ return {
+ count: traffic.count,
+ uniques: traffic.uniques,
+ days: traffic.views || traffic.clones || []
+ };
+}
+
+function compareFork(repo, fork) {
+ const owner = fork.owner?.login;
+ const branch = fork.default_branch;
+ if (!owner || !branch) return null;
+ const comparison = tryGhApi(`repos/${repo.full_name}/compare/${repo.default_branch}...${owner}:${branch}`);
+ if (comparison.unavailable) {
+ return { owner, fullName: fork.full_name, unavailable: true, reason: comparison.reason };
+ }
+ return {
+ owner,
+ fullName: fork.full_name,
+ htmlUrl: fork.html_url,
+ description: fork.description,
+ stars: fork.stargazers_count,
+ pushedAt: fork.pushed_at,
+ aheadBy: comparison.ahead_by,
+ behindBy: comparison.behind_by,
+ status: comparison.status,
+ changedFiles: comparison.files?.map(file => file.filename) || []
+ };
+}
+
+function selectForkCandidates(forks) {
+ const recentCutoff = new Date(now);
+ recentCutoff.setUTCDate(recentCutoff.getUTCDate() - 120);
+ return forks
+ .filter(fork => !fork.archived && (fork.stargazers_count > 0 || new Date(fork.pushed_at) >= recentCutoff))
+ .sort((a, b) => {
+ const starDelta = b.stargazers_count - a.stargazers_count;
+ return starDelta || new Date(b.pushed_at) - new Date(a.pushed_at);
+ })
+ .slice(0, 40);
+}
+
+function markdownBaseline(snapshot) {
+ const lines = [
+ `# Lumen growth baseline β€” ${snapshot.snapshotDate}`,
+ '',
+ `Captured at ${snapshot.capturedAt}. GitHub traffic and clone figures are rolling aggregates and are not cohort-aligned.`,
+ '',
+ '## Public repository signals',
+ '',
+ `- Stars: ${snapshot.repository.stars.toLocaleString()}`,
+ `- Forks: ${snapshot.repository.forks.toLocaleString()}`,
+ `- Fork-to-star ratio: ${snapshot.repository.forkToStarPercent}%`,
+ `- Subscribers: ${snapshot.repository.subscribers.toLocaleString()}`,
+ `- Topics: ${snapshot.repository.topics}`,
+ `- Last push: ${snapshot.repository.pushedAt}`,
+ '',
+ '## Rolling GitHub traffic',
+ ''
+ ];
+
+ if (snapshot.traffic.views.unavailable || snapshot.traffic.clones.unavailable) {
+ lines.push(`Traffic unavailable: ${snapshot.traffic.views.reason || snapshot.traffic.clones.reason}`);
+ } else {
+ lines.push(
+ `- Views: ${snapshot.traffic.views.count.toLocaleString()} (${snapshot.traffic.views.uniques.toLocaleString()} unique)`,
+ `- Clones: ${snapshot.traffic.clones.count.toLocaleString()} (${snapshot.traffic.clones.uniques.toLocaleString()} unique)`,
+ `- Unique-cloner / unique-visitor indicator: ${snapshot.traffic.uniqueCloneVisitorIndicatorPercent}%`,
+ '',
+ '> This indicator is directional only. GitHub does not expose a cohort-aligned visitor-to-clone conversion rate.',
+ '',
+ '## Top referrers',
+ '',
+ '| Referrer | Views | Unique visitors |',
+ '| --- | ---: | ---: |'
+ );
+ for (const referrer of snapshot.traffic.referrers) {
+ lines.push(`| ${referrer.referrer} | ${referrer.count.toLocaleString()} | ${referrer.uniques.toLocaleString()} |`);
+ }
+ }
+
+ lines.push('', '## Stars added by UTC day', '', '| Date | Stars |', '| --- | ---: |');
+ for (const day of snapshot.stars.daily) lines.push(`| ${day.date} | ${day.stars} |`);
+ lines.push('', 'Generated by `npm run growth:snapshot`.');
+ return `${lines.join('\n')}\n`;
+}
+
+function markdownForks(census) {
+ const lines = [
+ `# Lumen public fork census β€” ${census.snapshotDate}`,
+ '',
+ `GitHub's repository summary reported ${census.repositoryForkCount.toLocaleString()} forks. The paginated REST census returned ${census.totalForks.toLocaleString()} unique public fork records and compared ${census.comparedCandidates} high-signal candidates with upstream.`,
+ '',
+ `- Forks with commits ahead of upstream: ${census.aheadForks}`,
+ `- Forks with their own stars: ${census.starredForks}`,
+ `- Candidates requiring manual product/use-case review: ${census.manualReview.length}`,
+ '',
+ 'The summary count and paginated enumeration can differ while GitHub updates an active fork network. Comparison status can also change as upstream advances. A fork being ahead does not prove deployment or production use.',
+ '',
+ '## Manual-review queue',
+ '',
+ '| Fork | Ahead | Stars | Last push | Changed files |',
+ '| --- | ---: | ---: | --- | --- |'
+ ];
+ for (const fork of census.manualReview) {
+ const changed = fork.changedFiles.slice(0, 5).join(', ') || 'Not reported';
+ lines.push(`| [${fork.fullName}](${fork.htmlUrl}) | ${fork.aheadBy} | ${fork.stars} | ${fork.pushedAt} | ${changed} |`);
+ }
+ lines.push('', 'Generated from public GitHub metadata by `npm run growth:snapshot`. No private fork data or profile geography is collected.');
+ return `${lines.join('\n')}\n`;
+}
+
+function writeReport(filePath, contents) {
+ if (fs.existsSync(filePath) && process.env.GROWTH_SNAPSHOT_REPLACE !== '1') {
+ throw new Error(`Snapshot already exists: ${filePath}. Set GROWTH_SNAPSHOT_REPLACE=1 only to correct the same baseline.`);
+ }
+ fs.writeFileSync(filePath, contents);
+}
+
+function main() {
+ const repo = ghApi(`repos/${REPOSITORY}`);
+ const views = tryGhApi(`repos/${REPOSITORY}/traffic/views`);
+ const clones = tryGhApi(`repos/${REPOSITORY}/traffic/clones`);
+ const referrers = tryGhApi(`repos/${REPOSITORY}/traffic/popular/referrers`);
+ const stargazers = tryGhApi(`repos/${REPOSITORY}/stargazers?per_page=100`, {
+ paginate: true,
+ accept: 'application/vnd.github.star+json'
+ });
+ const forkPages = ghApi(`repos/${REPOSITORY}/forks?per_page=100&sort=oldest`, { paginate: true });
+ // Forks can move between result pages while the network is active. De-duplicate
+ // the paginated snapshot so a concurrent push/star cannot create repeat rows.
+ const forks = Array.from(new Map(forkPages.map(fork => [fork.id, fork])).values());
+
+ const snapshot = {
+ schemaVersion: 1,
+ snapshotDate,
+ capturedAt: now.toISOString(),
+ repository: {
+ fullName: repo.full_name,
+ stars: repo.stargazers_count,
+ forks: repo.forks_count,
+ forkToStarPercent: percent(repo.forks_count, repo.stargazers_count),
+ subscribers: repo.subscribers_count,
+ topics: repo.topics?.length || 0,
+ license: repo.license?.spdx_id || null,
+ defaultBranch: repo.default_branch,
+ pushedAt: repo.pushed_at
+ },
+ traffic: {
+ views: summarizeTraffic(views),
+ clones: summarizeTraffic(clones),
+ referrers: referrers.unavailable ? [] : referrers,
+ referrersUnavailable: referrers.unavailable ? referrers.reason : null,
+ uniqueCloneVisitorIndicatorPercent: views.unavailable || clones.unavailable
+ ? null
+ : percent(clones.uniques, views.uniques)
+ },
+ stars: stargazers.unavailable
+ ? { unavailable: true, reason: stargazers.reason, daily: [] }
+ : { totalTimestamped: stargazers.length, daily: groupStarsByDay(stargazers) }
+ };
+
+ const candidates = selectForkCandidates(forks);
+ const comparisons = candidates.map(fork => compareFork(repo, fork)).filter(Boolean);
+ const useful = comparisons.filter(fork => !fork.unavailable && fork.aheadBy > 0);
+ const census = {
+ schemaVersion: 1,
+ snapshotDate,
+ capturedAt: now.toISOString(),
+ repository: repo.full_name,
+ repositoryForkCount: repo.forks_count,
+ totalForks: forks.length,
+ comparedCandidates: comparisons.length,
+ aheadForks: useful.length,
+ starredForks: forks.filter(fork => fork.stargazers_count > 0).length,
+ comparisonFailures: comparisons.filter(fork => fork.unavailable),
+ manualReview: useful
+ .sort((a, b) => b.stars - a.stars || b.aheadBy - a.aheadBy || new Date(b.pushedAt) - new Date(a.pushedAt))
+ .slice(0, 25)
+ };
+
+ fs.mkdirSync(REPORT_ROOT, { recursive: true });
+ writeReport(path.join(REPORT_ROOT, `baseline-${snapshotDate}.json`), `${JSON.stringify(snapshot, null, 2)}\n`);
+ writeReport(path.join(REPORT_ROOT, `baseline-${snapshotDate}.md`), markdownBaseline(snapshot));
+ writeReport(path.join(REPORT_ROOT, `fork-census-${snapshotDate}.json`), `${JSON.stringify(census, null, 2)}\n`);
+ writeReport(path.join(REPORT_ROOT, `fork-census-${snapshotDate}.md`), markdownForks(census));
+ console.log(`Saved GitHub baseline and fork census to ${REPORT_ROOT}`);
+}
+
+if (require.main === module) {
+ try {
+ main();
+ } catch (error) {
+ console.error(`Growth snapshot failed: ${error.message}`);
+ process.exitCode = 1;
+ }
+}
+
+module.exports = { groupStarsByDay, percent, selectForkCandidates };
diff --git a/test.js b/test.js
index 7e1923b..c283226 100644
--- a/test.js
+++ b/test.js
@@ -18,6 +18,8 @@ class SystemTest {
{ name: 'Database Connection', test: () => this.testDatabase() },
{ name: 'Production Persistence', test: () => this.testProductionPersistence() },
{ name: 'Automation Events Table', test: () => this.testAutomationEventsTable() },
+ { name: 'Local Activation Metrics', test: () => this.testActivationMetrics() },
+ { name: 'Anonymous Telemetry Opt-in', test: () => this.testAnonymousTelemetryOptIn() },
{ name: 'Operator Workflow API', test: () => this.testOperatorWorkflowAPI() },
{ name: 'API Validation and Security', test: () => this.testAPIValidationAndSecurity() },
{ name: 'Publishing Safety', test: () => this.testPublishingSafety() },
@@ -149,6 +151,91 @@ class SystemTest {
this.logger.info('Automation events table test completed successfully');
}
+ async testActivationMetrics() {
+ const fs = require('fs').promises;
+ const { ActivationMetrics } = require('./utils/activation-metrics');
+ const db = new Database();
+ await db.initialize();
+ const id = `activation_test_${Date.now()}`;
+ const videoPath = path.join(__dirname, 'temp', `${id}.mp4`);
+ const mp4Header = Buffer.from([
+ 0x00, 0x00, 0x00, 0x18,
+ 0x66, 0x74, 0x79, 0x70,
+ 0x69, 0x73, 0x6f, 0x6d
+ ]);
+
+ try {
+ await fs.mkdir(path.dirname(videoPath), { recursive: true });
+ await fs.writeFile(videoPath, mp4Header);
+ await db.saveProductionData({
+ id,
+ status: 'ready',
+ assets: { finalVideo: { path: videoPath, simulated: false } },
+ timeline: { readyForUpload: new Date().toISOString() },
+ scheduledPublishTime: null,
+ priority: 1,
+ estimatedDuration: '0:01'
+ });
+
+ const activation = new ActivationMetrics(db);
+ const summary = await activation.getSummary();
+ if (!summary.milestones.firstRealVideo.achieved || summary.counts.realVideos < 1) {
+ throw new Error('A verified non-simulated MP4 was not counted as activation');
+ }
+
+ await fs.writeFile(videoPath, Buffer.from('renamed-but-not-an-mp4'));
+ const invalidContainerSummary = await activation.getSummary();
+ if (invalidContainerSummary.counts.realVideos >= summary.counts.realVideos) {
+ throw new Error('A file with an .mp4 extension but no MP4 signature was counted as activation');
+ }
+
+ await fs.writeFile(videoPath, mp4Header);
+ await db.updateProductionData({
+ id,
+ status: 'simulated',
+ assets: { finalVideo: { path: videoPath, simulated: true } },
+ timeline: {},
+ scheduledPublishTime: null,
+ priority: 1
+ });
+ const simulatedSummary = await activation.getSummary();
+ if (simulatedSummary.counts.realVideos >= summary.counts.realVideos) {
+ throw new Error('A simulated MP4 was incorrectly counted as activation');
+ }
+ } finally {
+ await db.executeQuery('DELETE FROM productions WHERE id = ?', [id]);
+ await fs.unlink(videoPath).catch(() => {});
+ await db.close();
+ }
+
+ this.logger.info('Local activation metrics test completed successfully');
+ }
+
+ async testAnonymousTelemetryOptIn() {
+ const { AnonymousTelemetry } = require('./utils/anonymous-telemetry');
+ const savedEnabled = process.env.ANONYMOUS_TELEMETRY_ENABLED;
+ const savedEndpoint = process.env.ANONYMOUS_TELEMETRY_ENDPOINT;
+ const db = new Database();
+ await db.initialize();
+ try {
+ delete process.env.ANONYMOUS_TELEMETRY_ENABLED;
+ delete process.env.ANONYMOUS_TELEMETRY_ENDPOINT;
+ const telemetry = new AnonymousTelemetry(db, this.logger);
+ if (telemetry.configuration().enabled) throw new Error('Anonymous telemetry was enabled without opt-in');
+
+ process.env.ANONYMOUS_TELEMETRY_ENABLED = 'true';
+ process.env.ANONYMOUS_TELEMETRY_ENDPOINT = 'http://example.com/events';
+ if (telemetry.configuration().enabled) throw new Error('Anonymous telemetry accepted a non-HTTPS endpoint');
+ } finally {
+ if (savedEnabled === undefined) delete process.env.ANONYMOUS_TELEMETRY_ENABLED;
+ else process.env.ANONYMOUS_TELEMETRY_ENABLED = savedEnabled;
+ if (savedEndpoint === undefined) delete process.env.ANONYMOUS_TELEMETRY_ENDPOINT;
+ else process.env.ANONYMOUS_TELEMETRY_ENDPOINT = savedEndpoint;
+ await db.close();
+ }
+ this.logger.info('Anonymous telemetry opt-in test completed successfully');
+ }
+
async testOperatorWorkflowAPI() {
const { YouTubeAutomationAgent } = require('./index');
const { OperatorService } = require('./utils/operator-service');
@@ -196,7 +283,12 @@ class SystemTest {
const { port } = server.address();
const response = await fetch(`http://127.0.0.1:${port}/api/dashboard`);
const dashboard = await response.json();
- if (!response.ok || !Array.isArray(dashboard.jobs) || !Array.isArray(dashboard.pipeline)) {
+ if (
+ !response.ok ||
+ !Array.isArray(dashboard.jobs) ||
+ !Array.isArray(dashboard.pipeline) ||
+ dashboard.activation?.privacy !== 'local-only'
+ ) {
throw new Error('Operator dashboard API did not return its data contract');
}
} finally {
@@ -396,7 +488,7 @@ class SystemTest {
delete process.env.OPENAI_API_KEY;
try {
const service = new AITextService({
- aiProvider: { provider: 'openai', apiKey: 'test-key', model: 'gpt-5.5' }
+ aiProvider: { provider: 'openai', apiKey: 'test-key', model: 'gpt-5.6' }
});
// Newer OpenAI models (gpt-5.x) reject max_tokens β€” the request must use
diff --git a/utils/activation-metrics.js b/utils/activation-metrics.js
new file mode 100644
index 0000000..2a2b211
--- /dev/null
+++ b/utils/activation-metrics.js
@@ -0,0 +1,98 @@
+const fs = require('fs').promises;
+const path = require('path');
+
+class ActivationMetrics {
+ constructor(db) {
+ this.db = db;
+ }
+
+ async markSetupReady(details = {}) {
+ const existing = await this.db.getSetting('setup_completed_at');
+ if (existing) return existing;
+
+ const completedAt = new Date().toISOString();
+ await this.db.setSetting(
+ 'setup_completed_at',
+ completedAt,
+ 'First time credentials, YouTube authorization, and local video assembly were ready'
+ );
+ await this.db.executeQuery(
+ 'INSERT INTO automation_events (event_type, status, data, created_at) VALUES (?, ?, ?, ?)',
+ ['activation_setup_ready', 'success', JSON.stringify({
+ hasText: Boolean(details.hasText),
+ hasMedia: Boolean(details.hasImages || details.hasTTS),
+ hasFFmpeg: Boolean(details.hasFFmpeg),
+ hasUpload: Boolean(details.hasUpload)
+ }), completedAt]
+ );
+ return completedAt;
+ }
+
+ async validRealVideo(production) {
+ const video = production.assets?.finalVideo;
+ if (!video?.path || video.simulated || path.extname(video.path).toLowerCase() !== '.mp4') return false;
+ let handle;
+ try {
+ const stats = await fs.stat(video.path);
+ if (!stats.isFile() || stats.size < 12) return false;
+
+ handle = await fs.open(video.path, 'r');
+ const header = Buffer.alloc(12);
+ const { bytesRead } = await handle.read(header, 0, header.length, 0);
+ return bytesRead === header.length && header.toString('ascii', 4, 8) === 'ftyp';
+ } catch (_error) {
+ return false;
+ } finally {
+ await handle?.close().catch(() => {});
+ }
+ }
+
+ async getSummary() {
+ const [setupCompletedAt, jobs, productions, approvedRows, publishedRows] = await Promise.all([
+ this.db.getSetting('setup_completed_at'),
+ this.db.listGenerationJobs(1000),
+ this.db.getProductionPipeline(),
+ this.db.getAllRows(
+ "SELECT production_id, reviewed_at, created_at FROM content_reviews WHERE status = 'approved' ORDER BY COALESCE(reviewed_at, created_at) ASC"
+ ),
+ this.db.getAllRows(
+ "SELECT production_id, published_at, youtube_url FROM publish_schedule WHERE status = 'published' AND youtube_url IS NOT NULL ORDER BY published_at ASC"
+ )
+ ]);
+
+ const realVideos = [];
+ for (const production of productions.sort((a, b) => new Date(a.created_at) - new Date(b.created_at))) {
+ if (await this.validRealVideo(production)) realVideos.push(production);
+ }
+
+ const completedJobs = jobs.filter(job => job.status === 'completed');
+ const failedJobs = jobs.filter(job => job.status === 'failed');
+ const firstRealVideoAt = realVideos[0]?.timeline?.readyForUpload || realVideos[0]?.created_at || null;
+ const secondRealVideoAt = realVideos[1]?.timeline?.readyForUpload || realVideos[1]?.created_at || null;
+ const firstApprovedAt = approvedRows[0]?.reviewed_at || approvedRows[0]?.created_at || null;
+ const firstPublishedAt = publishedRows[0]?.published_at || null;
+
+ return {
+ schemaVersion: 1,
+ privacy: 'local-only',
+ definition: 'A real video is a non-simulated .mp4 with an MP4 container signature that still exists on disk.',
+ counts: {
+ generationJobs: jobs.length,
+ completedJobs: completedJobs.length,
+ failedJobs: failedJobs.length,
+ realVideos: realVideos.length,
+ approvedVideos: approvedRows.length,
+ publishedVideos: publishedRows.length
+ },
+ milestones: {
+ setupReady: { achieved: Boolean(setupCompletedAt), at: setupCompletedAt },
+ firstRealVideo: { achieved: Boolean(firstRealVideoAt), at: firstRealVideoAt },
+ firstApproval: { achieved: Boolean(firstApprovedAt), at: firstApprovedAt },
+ firstPublish: { achieved: Boolean(firstPublishedAt), at: firstPublishedAt },
+ secondRealVideo: { achieved: Boolean(secondRealVideoAt), at: secondRealVideoAt }
+ }
+ };
+ }
+}
+
+module.exports = { ActivationMetrics };
diff --git a/utils/ai-text-service.js b/utils/ai-text-service.js
index 8c639d5..0cb7678 100644
--- a/utils/ai-text-service.js
+++ b/utils/ai-text-service.js
@@ -5,22 +5,22 @@ const PROVIDERS = {
openai: {
name: 'OpenAI',
baseURL: 'https://api.openai.com/v1',
- defaultModel: 'gpt-5.5',
- models: ['gpt-5.5', 'gpt-5.5-instant', 'gpt-5.4'],
+ defaultModel: 'gpt-5.6',
+ models: ['gpt-5.6', 'gpt-5.6-terra', 'gpt-5.6-luna'],
envKey: 'OPENAI_API_KEY',
},
openrouter: {
name: 'OpenRouter',
baseURL: 'https://openrouter.ai/api/v1',
- defaultModel: 'openai/gpt-5.5',
- models: ['openai/gpt-5.5', 'anthropic/claude-opus-4-8', 'google/gemini-3.5-flash', 'moonshotai/kimi-k2.6', 'zhipu/glm-5'],
+ defaultModel: 'openai/gpt-5.6-sol',
+ models: ['openai/gpt-5.6-sol', 'anthropic/claude-opus-4-8', 'google/gemini-3.5-flash', 'moonshotai/kimi-k3', 'z-ai/glm-5.2'],
envKey: 'OPENROUTER_API_KEY',
},
kimi: {
name: 'Kimi (Moonshot AI)',
baseURL: 'https://api.moonshot.ai/v1',
- defaultModel: 'kimi-k2.6',
- models: ['kimi-k2.6', 'kimi-k2.5', 'moonshot-v1-auto'],
+ defaultModel: 'kimi-k3',
+ models: ['kimi-k3', 'kimi-k2.7-code', 'kimi-k2.6'],
envKey: 'MOONSHOT_API_KEY',
},
mimo: {
@@ -33,8 +33,8 @@ const PROVIDERS = {
glm: {
name: 'GLM (Zhipu AI)',
baseURL: 'https://api.z.ai/api/paas/v4/',
- defaultModel: 'glm-5',
- models: ['glm-5', 'glm-5.1'],
+ defaultModel: 'glm-5.3',
+ models: ['glm-5.3', 'glm-5.2', 'glm-5.1'],
envKey: 'GLM_API_KEY',
},
};
@@ -99,10 +99,12 @@ class AITextService {
const temperature = options.temperature ?? 0.7;
if (this.gemini) {
+ const config = { maxOutputTokens: maxTokens };
+ if (!/^gemini-3\.[56]-/.test(model)) config.temperature = temperature;
const response = await this.gemini.models.generateContent({
model,
contents: prompt,
- config: { maxOutputTokens: maxTokens, temperature },
+ config,
});
const text = response && response.text;
if (typeof text !== 'string' || !text.trim()) {
diff --git a/utils/anonymous-telemetry.js b/utils/anonymous-telemetry.js
new file mode 100644
index 0000000..c7354d4
--- /dev/null
+++ b/utils/anonymous-telemetry.js
@@ -0,0 +1,108 @@
+const crypto = require('crypto');
+const { version } = require('../package.json');
+
+const ALLOWED_EVENTS = new Set([
+ 'setup_ready',
+ 'first_real_video',
+ 'first_approval',
+ 'first_publish',
+ 'second_real_video'
+]);
+
+class AnonymousTelemetry {
+ constructor(db, logger) {
+ this.db = db;
+ this.logger = logger;
+ this.inFlight = new Set();
+ }
+
+ configuration() {
+ const optedIn = String(process.env.ANONYMOUS_TELEMETRY_ENABLED || '').toLowerCase() === 'true';
+ const endpoint = process.env.ANONYMOUS_TELEMETRY_ENDPOINT || '';
+ if (!optedIn) return { enabled: false, reason: 'not_opted_in' };
+ try {
+ const url = new URL(endpoint);
+ if (url.protocol !== 'https:') return { enabled: false, reason: 'https_endpoint_required' };
+ return { enabled: true, endpoint: url.toString() };
+ } catch (_error) {
+ return { enabled: false, reason: 'valid_endpoint_required' };
+ }
+ }
+
+ async installationId() {
+ let id = await this.db.getSetting('anonymous_telemetry_installation_id');
+ if (!id) {
+ id = crypto.randomUUID();
+ await this.db.setSetting(
+ 'anonymous_telemetry_installation_id',
+ id,
+ 'Random installation ID used only when anonymous telemetry is explicitly enabled'
+ );
+ }
+ return id;
+ }
+
+ async emit(event, occurredAt) {
+ if (!ALLOWED_EVENTS.has(event)) throw new Error(`Anonymous telemetry event is not allowlisted: ${event}`);
+ const config = this.configuration();
+ if (!config.enabled) return { sent: false, reason: config.reason };
+
+ const sentKey = `anonymous_telemetry_sent_${event}`;
+ if (await this.db.getSetting(sentKey)) return { sent: false, reason: 'already_sent' };
+ if (this.inFlight.has(event)) return { sent: false, reason: 'in_flight' };
+
+ const payload = {
+ schemaVersion: 1,
+ event,
+ occurredAt,
+ appVersion: version,
+ installationId: await this.installationId(),
+ platform: process.platform,
+ nodeMajor: Number(process.versions.node.split('.')[0])
+ };
+
+ const controller = new AbortController();
+ const timeout = setTimeout(() => controller.abort(), 5000);
+ this.inFlight.add(event);
+ try {
+ const response = await fetch(config.endpoint, {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify(payload),
+ signal: controller.signal
+ });
+ if (!response.ok) throw new Error(`Anonymous telemetry endpoint returned HTTP ${response.status}`);
+ await this.db.setSetting(sentKey, new Date().toISOString(), `Anonymous ${event} milestone sent`);
+ return { sent: true };
+ } finally {
+ clearTimeout(timeout);
+ this.inFlight.delete(event);
+ }
+ }
+
+ async sync(summary) {
+ const config = this.configuration();
+ if (!config.enabled) return config;
+
+ const milestoneEvents = [
+ ['setup_ready', summary.milestones.setupReady],
+ ['first_real_video', summary.milestones.firstRealVideo],
+ ['first_approval', summary.milestones.firstApproval],
+ ['first_publish', summary.milestones.firstPublish],
+ ['second_real_video', summary.milestones.secondRealVideo]
+ ];
+ const results = [];
+ for (const [event, milestone] of milestoneEvents) {
+ if (!milestone.achieved) continue;
+ try {
+ results.push({ event, ...(await this.emit(event, milestone.at)) });
+ } catch (error) {
+ this.logger?.warn(`Anonymous telemetry ${event} was not sent: ${error.message}`);
+ results.push({ event, sent: false, reason: 'delivery_failed' });
+ }
+ }
+ return { enabled: true, results };
+ }
+}
+
+module.exports = { AnonymousTelemetry, ALLOWED_EVENTS };
diff --git a/utils/credential-manager.js b/utils/credential-manager.js
index dc70d24..611bf72 100644
--- a/utils/credential-manager.js
+++ b/utils/credential-manager.js
@@ -171,11 +171,11 @@ class CredentialManager {
name: 'model',
message: 'Select your preferred model:',
choices: [
- 'gpt-5.5',
- 'gpt-5.5-instant',
- 'gpt-5.4'
+ 'gpt-5.6',
+ 'gpt-5.6-terra',
+ 'gpt-5.6-luna'
],
- default: 'gpt-5.5'
+ default: 'gpt-5.6'
}
]);
@@ -240,13 +240,13 @@ class CredentialManager {
name: 'model',
message: 'Select default model:',
choices: [
- 'openai/gpt-5.5',
+ 'openai/gpt-5.6-sol',
'anthropic/claude-opus-4-8',
'google/gemini-3.5-flash',
- 'moonshotai/kimi-k2.6',
- 'zhipu/glm-5'
+ 'moonshotai/kimi-k3',
+ 'z-ai/glm-5.2'
],
- default: 'openai/gpt-5.5'
+ default: 'openai/gpt-5.6-sol'
}
]);
@@ -276,8 +276,8 @@ class CredentialManager {
type: 'list',
name: 'model',
message: 'Select model:',
- choices: ['kimi-k2.6', 'kimi-k2.5', 'moonshot-v1-auto'],
- default: 'kimi-k2.6'
+ choices: ['kimi-k3', 'kimi-k2.7-code', 'kimi-k2.6'],
+ default: 'kimi-k3'
}
]);
@@ -338,8 +338,8 @@ class CredentialManager {
type: 'list',
name: 'model',
message: 'Select model:',
- choices: ['glm-5', 'glm-5.1'],
- default: 'glm-5'
+ choices: ['glm-5.3', 'glm-5.2', 'glm-5.1'],
+ default: 'glm-5.3'
}
]);
@@ -642,12 +642,12 @@ class CredentialManager {
name: 'service',
message: 'Select your preferred AI service:',
choices: [
- { name: 'OpenAI (GPT-5.5)', value: 'openai' },
+ { name: 'OpenAI (GPT-5.6)', value: 'openai' },
{ name: 'Google Gemini (Gemini 3.5 β€” free tier)', value: 'gemini' },
{ name: 'OpenRouter (300+ models, one API key)', value: 'openrouter' },
- { name: 'Kimi (Moonshot AI β€” K2.6)', value: 'kimi' },
+ { name: 'Kimi (Moonshot AI β€” K3)', value: 'kimi' },
{ name: 'MiMo (Xiaomi β€” V2.5 Pro)', value: 'mimo' },
- { name: 'GLM (Zhipu AI β€” GLM-5)', value: 'glm' },
+ { name: 'GLM (Zhipu AI β€” GLM-5.3)', value: 'glm' },
]
}
]);
@@ -727,4 +727,4 @@ if (require.main === module) {
}
}
-module.exports = { CredentialManager };
\ No newline at end of file
+module.exports = { CredentialManager };
diff --git a/walkthrough.js b/walkthrough.js
index 08d9fdb..1deeb19 100644
--- a/walkthrough.js
+++ b/walkthrough.js
@@ -13,7 +13,7 @@ const { checkFFmpeg, ffmpegInstallHint } = require('./utils/ffmpeg');
// Everything a beginner needs to know about each provider, in one place
const AI_PROVIDER_GUIDE = {
gemini: {
- label: 'Google Gemini β€” FREE tier, no credit card (recommended for beginners)',
+ label: 'Google Gemini β€” free text/TTS tiers; paid AI images',
keyUrl: 'https://aistudio.google.com/apikey',
keyHint: 'starts with "AIza"',
instructions: [
@@ -23,14 +23,14 @@ const AI_PROVIDER_GUIDE = {
],
models: ['gemini-3.5-flash', 'gemini-3.1-pro-preview', 'gemini-2.5-pro'],
defaultModel: 'gemini-3.5-flash',
- covers: 'scripts + images + voice narration (full free pipeline)',
+ covers: 'scripts + voice narration on supported free tiers; AI images require paid access',
save(credentials, apiKey, model) {
credentials.gemini = { apiKey, model };
},
validationCreds: (apiKey, model) => ({ gemini: { apiKey, model } })
},
openai: {
- label: 'OpenAI β€” paid (~$0.05–0.20/video), premium image + voice quality',
+ label: 'OpenAI β€” paid text, image, and voice models',
keyUrl: 'https://platform.openai.com/api-keys',
keyHint: 'starts with "sk-"',
instructions: [
@@ -38,8 +38,8 @@ const AI_PROVIDER_GUIDE = {
'Click "Create new secret key"',
'Copy the key β€” it is shown only once'
],
- models: ['gpt-5.5', 'gpt-5.5-pro', 'gpt-5.4'],
- defaultModel: 'gpt-5.5',
+ models: ['gpt-5.6', 'gpt-5.6-terra', 'gpt-5.6-luna'],
+ defaultModel: 'gpt-5.6',
covers: 'scripts + images + voice narration',
save(credentials, apiKey, model) {
credentials.openai = { apiKey, model };
@@ -54,7 +54,7 @@ const AI_PROVIDER_GUIDE = {
'Sign in and add a few dollars of credit',
'Create a key and copy it'
],
- models: ['openai/gpt-5.5', 'anthropic/claude-opus-4-8', 'google/gemini-3.5-flash', 'moonshotai/kimi-k2.6', 'zhipu/glm-5'],
+ models: ['openai/gpt-5.6-sol', 'anthropic/claude-opus-4-8', 'google/gemini-3.5-flash', 'moonshotai/kimi-k3', 'z-ai/glm-5.2'],
defaultModel: 'google/gemini-3.5-flash',
covers: 'scripts only (add a Gemini or OpenAI key for images/voice)',
save(credentials, apiKey, model) {
@@ -63,12 +63,12 @@ const AI_PROVIDER_GUIDE = {
validationCreds: (apiKey, model) => ({ aiProvider: { provider: 'openrouter', apiKey, model } })
},
kimi: {
- label: 'Kimi (Moonshot AI) β€” very cheap, strong quality',
+ label: 'Kimi (Moonshot AI) β€” K3 and K2 family text models',
keyUrl: 'https://platform.kimi.ai',
keyHint: 'from the Moonshot platform console',
instructions: ['Create an account', 'Open the API keys page and create a key'],
- models: ['kimi-k2.6', 'kimi-k2.5', 'moonshot-v1-auto'],
- defaultModel: 'kimi-k2.6',
+ models: ['kimi-k3', 'kimi-k2.7-code', 'kimi-k2.6'],
+ defaultModel: 'kimi-k3',
covers: 'scripts only (add a Gemini or OpenAI key for images/voice)',
save(credentials, apiKey, model) {
credentials.aiProvider = { provider: 'kimi', apiKey, model };
@@ -89,12 +89,12 @@ const AI_PROVIDER_GUIDE = {
validationCreds: (apiKey, model) => ({ aiProvider: { provider: 'mimo', apiKey, model } })
},
glm: {
- label: 'GLM (Zhipu AI) β€” ~$1/M input tokens',
+ label: 'GLM (Zhipu AI) β€” GLM-5 family text models',
keyUrl: 'https://z.ai',
keyHint: 'from the Z.ai console',
instructions: ['Create an account', 'Create an API key in the console'],
- models: ['glm-5', 'glm-5.1'],
- defaultModel: 'glm-5',
+ models: ['glm-5.3', 'glm-5.2', 'glm-5.1'],
+ defaultModel: 'glm-5.3',
covers: 'scripts only (add a Gemini or OpenAI key for images/voice)',
save(credentials, apiKey, model) {
credentials.aiProvider = { provider: 'glm', apiKey, model };
@@ -210,8 +210,8 @@ class SetupWalkthrough {
if (!redo) return;
} else {
console.log(chalk.white('The agent needs one AI service. If you don\'t want to spend money,'));
- console.log(chalk.white('pick Google Gemini β€” its free tier covers the whole pipeline:'));
- console.log(chalk.white('scripts, images, and voice narration.'));
+ console.log(chalk.white('Google Gemini offers free tiers for supported text and TTS usage.'));
+ console.log(chalk.white('AI image generation requires paid access; gradient visuals are the fallback.'));
}
const { providerId } = await inquirer.prompt([{