Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,32 @@ MEDIA_OPS_REVIEW_PORT=8787
# Optional direct token override. Prefer local review-server generated files.
MEDIA_OPS_REVIEW_TOKEN=

# X / Twitter API for approved publishing and metric collection.
# Keep real values only in your local .env or system keychain.
X_API_KEY=
X_API_SECRET=
X_ACCESS_TOKEN=
X_ACCESS_TOKEN_SECRET=
X_BEARER_TOKEN=

# Image generation provider used by media-ops asset factories.
OPENAI_API_KEY=
OPENAI_IMAGE_MODEL=gpt-image-1

# Video generation provider. Use either Seedance token or Volcengine AK/SK.
SEEDANCE_API_TOKEN=
VOLCENGINE_ACCESS_KEY_ID=
VOLCENGINE_SECRET_ACCESS_KEY=

# Optional Reddit API app for trend ingestion and future approved publishing.
REDDIT_CLIENT_ID=
REDDIT_CLIENT_SECRET=
REDDIT_REFRESH_TOKEN=
REDDIT_USER_AGENT=botcom-workbench-local/0.1

# Browser profile used only for local, approved domestic-platform workflows.
MEDIA_OPS_BROWSER_PROFILE_DIR=$HOME/BotCom/browser-profile

# Feishu / Lark custom bot
FEISHU_BOT_WEBHOOK=
FEISHU_BOT_SECRET=
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Core operating modules:
- operating-state snapshot;
- eight-module one-person company map;
- local operating adapters for CRM, delivery, revenue, assets, and automation;
- Growth Autopilot benchmark panel for social-media operating loops;
- approval queues and mobile approval links;
- service health, blockers, next actions, and review suggestions.
- AI beginner guide explaining agents, skills, models, API keys, context, and approval queues.
Expand Down Expand Up @@ -172,6 +173,8 @@ BotCom Workbench only proxies to `127.0.0.1`; it does not accept arbitrary backe

See `docs/INTEGRATION.md`.

For the Growth Autopilot loop and social-media benchmark model, see `docs/GROWTH_AUTOPILOT.md`.

For the broader product model, see `docs/ONE_PERSON_COMPANY_OS.md`.

## Notifications
Expand Down Expand Up @@ -215,6 +218,7 @@ See `docs/SECURITY.md`.

- `docs/ARCHITECTURE.md`
- `docs/CONFIGURATION.md`
- `docs/GROWTH_AUTOPILOT.md`
- `docs/INTEGRATION.md`
- `docs/ONE_PERSON_COMPANY_OS.md`
- `docs/PUBLISHING.md`
Expand Down
31 changes: 31 additions & 0 deletions docs/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,37 @@ WECHAT_BOT_WEBHOOK=
WECHAT_WEBHOOK=
```

## Growth Autopilot connectors

These variables are optional until you enable the related connector. Keep real values in local `.env` or the OS keychain; do not commit them.

```text
# X API
X_API_KEY=
X_API_SECRET=
X_ACCESS_TOKEN=
X_ACCESS_TOKEN_SECRET=
X_BEARER_TOKEN=

# Image generation
OPENAI_API_KEY=
OPENAI_IMAGE_MODEL=gpt-image-1

# Video generation
SEEDANCE_API_TOKEN=
VOLCENGINE_ACCESS_KEY_ID=
VOLCENGINE_SECRET_ACCESS_KEY=

# Reddit trend ingestion / approved posting
REDDIT_CLIENT_ID=
REDDIT_CLIENT_SECRET=
REDDIT_REFRESH_TOKEN=
REDDIT_USER_AGENT=botcom-workbench-local/0.1

# Local browser-assisted domestic-platform workflows
MEDIA_OPS_BROWSER_PROFILE_DIR=$HOME/BotCom/browser-profile
```

## Local env files

The notification bridge reads, in order:
Expand Down
115 changes: 115 additions & 0 deletions docs/GROWTH_AUTOPILOT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# Growth Autopilot

Growth Autopilot is BotCom Workbench's operating loop for AI-assisted social growth. It is designed for one-person companies that want AI workers to run the heavy work while the owner only reviews high-risk decisions.

The goal is not to clone a scheduler. The loop covers the full operating chain:

```text
trend signals
-> positioning and experiment hypothesis
-> platform-specific drafts
-> image/video asset factory
-> quality and compliance gates
-> owner approval queue
-> publish-prep or approved publishing connector
-> metric capture
-> next experiment
```

## Public benchmark posture

BotCom compares the local workflow against public reference products and workflow patterns:

- Postiz-style open-source AI social scheduling;
- n8n-style automation graphs and social templates;
- Buffer-style creator scheduling and analytics;
- Publer-style bulk scheduling and recurring content workflows.

Those systems are useful references, but most of them are scheduler-centric. BotCom's differentiator is the company-level loop: strategy, agent roles, content matrix, asset generation, quality gate, approval UX, connectors, metrics, and the next experiment are evaluated together.

## Local reports

When a compatible `media-ops` workspace is present, the BotCom OS dashboard reads:

```text
$BOTCOM_MEDIA_OPS_ROOT/reports/growth_autopilot.json
$BOTCOM_MEDIA_OPS_ROOT/reports/growth_autopilot.md
$BOTCOM_MEDIA_OPS_ROOT/research/latest_public_benchmark.md
```

The desktop UI shows:

- BotCom loop score;
- best public reference score;
- margin;
- capability matrix;
- missing credentials or login steps;
- recent loop findings;
- buttons to rerun the loop or open reports.

The score is an architectural and readiness benchmark. Real growth performance still depends on live credentials, platform permissions, publishing cadence, and 24-hour / 72-hour metric feedback.

## Owner approval model

Growth Autopilot should keep irreversible or reputation-sensitive actions behind owner approval:

- account connection;
- platform publishing;
- paid API usage above local thresholds;
- external messages to customers or communities;
- monetization offers;
- policy-sensitive content.

Safe local steps can run automatically:

- research summarization;
- draft generation;
- image/video draft generation;
- formatting;
- queue creation;
- quality checks;
- report generation;
- metric analysis after import.

## Credential slots

Keep real credentials out of Git. Use local `.env`, the operating system keychain, or an approved secret manager.

Common variables:

```text
X_API_KEY=
X_API_SECRET=
X_ACCESS_TOKEN=
X_ACCESS_TOKEN_SECRET=
OPENAI_API_KEY=
OPENAI_IMAGE_MODEL=gpt-image-1
SEEDANCE_API_TOKEN=
VOLCENGINE_ACCESS_KEY_ID=
VOLCENGINE_SECRET_ACCESS_KEY=
REDDIT_CLIENT_ID=
REDDIT_CLIENT_SECRET=
REDDIT_REFRESH_TOKEN=
FEISHU_BOT_WEBHOOK=
WECHAT_WORK_BOT_WEBHOOK=
MEDIA_OPS_BROWSER_PROFILE_DIR=$HOME/BotCom/browser-profile
```

## Platform connector stance

- **X**: prefer official API for posting and public metrics.
- **Reddit**: prefer official OAuth API for trend ingestion and approved posting.
- **TikTok / Douyin**: prefer official content posting APIs where account permissions allow it; use local browser-assisted steps only when explicitly approved by the operator and allowed by the platform/account context.
- **Xiaohongshu**: treat direct publishing as a connector slot. Use official partner/open-platform paths when available; otherwise keep publishing in owner-reviewed browser or service-provider workflows.

## Extending the loop

A new connector or generator should expose:

1. `status`: ready, blocked, missing credentials, last successful run;
2. `inputs`: accepted local files or queue fields;
3. `actions`: dry-run, prepare, publish, collect metrics;
4. `evidence`: local logs, request IDs, generated files, metric snapshots;
5. `risk`: whether owner approval is required.

This keeps the product usable for non-technical operators while preserving auditability for advanced users.
1 change: 1 addition & 0 deletions docs/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- Installer-friendly first-run setup.
- In-app environment configuration screen.
- Optional sample media-ops workspace generator.
- Growth Autopilot panel: public workflow benchmark, capability matrix, missing-credential checklist, and loop rerun command.
- Better empty-state guidance when no operating adapters are configured.
- Adapter contracts for CRM, delivery, revenue, assets, and metrics.
- Signed and notarized macOS release.
Expand Down
64 changes: 62 additions & 2 deletions public/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1880,8 +1880,9 @@ function hlTerm(text, term) {

// ---------- BotCom OS:一人公司经营控制台 ----------
const botcomDashboard = {
ov: null, data: null, review: null, reviewError: '',
async show() {
ov: null, data: null, review: null, reviewError: '', focus: '',
async show(focus = '') {
this.focus = focus;
if (this.ov) this.ov.remove();
const ov = document.createElement('div');
this.ov = ov;
Expand Down Expand Up @@ -2177,6 +2178,48 @@ const botcomDashboard = {
</div>
</section>`;
},
growthAutopilotSection(autopilot) {
if (!autopilot || !autopilot.score) {
return `<section class="botcom-card botcom-autopilot-card" id="growth-autopilot-workflow">
<div class="botcom-card-title">Growth Autopilot · 公开最佳工作流基准</div>
<div class="botcom-sub">尚未生成基准报告。运行 loop 后会对比 Postiz、n8n、Buffer、Publer 等公开方案,并列出 API / Cookie / 指标缺口。</div>
<div class="botcom-actions inline">
<button class="primary" data-cmd="growth-autopilot">运行 Growth Autopilot Loop</button>
</div>
</section>`;
}
const score = autopilot.score || {};
const caps = autopilot.capabilities || [];
const needs = autopilot.needs_from_owner || [];
const loops = autopilot.loops || [];
const verdict = score.verdict === 'architecturally_ahead' ? '架构和执行闭环已领先公开 scheduler' : '领先但仍需凭据和真实指标';
return `<section class="botcom-card botcom-autopilot-card" id="growth-autopilot-workflow">
<div class="botcom-card-title">Growth Autopilot · 公开最佳工作流基准</div>
<div class="botcom-score-row">
<div><span>BotCom Loop</span><b>${escapeHtml(score.botcom_after_loops ?? '—')}</b></div>
<div><span>公开最佳参考</span><b>${escapeHtml(score.best_public_reference ?? '—')}</b></div>
<div><span>领先差值</span><b class="${Number(score.margin || 0) > 0 ? 'good' : 'warn'}">${escapeHtml(score.margin ?? '—')}</b></div>
</div>
<div class="botcom-sub">${escapeHtml(verdict)}。这里比较的是“研究→生成→质检→审核→发布准备→复盘→下一轮实验”的完整经营闭环,不是单个发帖按钮。</div>
<div class="botcom-cap-grid">
${caps.slice(0, 12).map((c) => `<div class="botcom-cap">
<span>${escapeHtml(c.label || c.id)}</span>
<b>${escapeHtml(c.score ?? '')}</b>
<em>${escapeHtml(c.next_step || '')}</em>
</div>`).join('')}
</div>
${needs.length ? `<div class="botcom-card-title sub-title">需要你后续提供 / 登录</div><div class="botcom-needs">
${needs.map((n) => `<div class="botcom-need"><b>${escapeHtml(n.label || n.id)}</b><span>${escapeHtml(n.why || '')}</span><em>${escapeHtml(n.fields || '')}</em></div>`).join('')}
</div>` : '<div class="botcom-ok">凭据和连接器已齐,可以进入真实发布 loop。</div>'}
<div class="botcom-card-title sub-title">最近 Loop</div>
<div class="botcom-list">${loops.slice(-4).map((l) => `<div>Loop ${escapeHtml(l.loop)} · score ${escapeHtml(l.score)} · ${escapeHtml(l.focus)}:${escapeHtml(l.finding)}</div>`).join('')}</div>
<div class="botcom-actions inline">
<button class="primary" data-cmd="growth-autopilot">重跑 Growth Loop</button>
<button data-open-autopilot="md">打开报告</button>
<button data-open-autopilot="benchmark">打开竞品基准</button>
</div>
</section>`;
},
render() {
const d = this.data || {};
const body = this.ov && this.ov.querySelector('.botcom-body');
Expand All @@ -2185,6 +2228,7 @@ const botcomDashboard = {
const w = d.workbench || {};
const lr = m.launchReadiness || {};
const growth = m.growth || {};
const autopilot = m.growthAutopilot || null;
const queue = m.queue || {};
const services = m.services || {};
const op = d.operatingAdapters || {};
Expand Down Expand Up @@ -2241,6 +2285,8 @@ const botcomDashboard = {

${this.moduleMapSection(modules)}

${this.growthAutopilotSection(autopilot)}

${this.queueSection(queue)}

<div class="botcom-two">
Expand Down Expand Up @@ -2284,13 +2330,26 @@ const botcomDashboard = {
});
body.querySelector('[data-open-workbench]')?.addEventListener('click', () => (w.dashboard ? openWith(w.dashboard, 'default') : toast('AI-Workbench 未配置', true)));
body.querySelectorAll('[data-cmd]').forEach((b) => b.addEventListener('click', () => this.run(cmds.find((c) => c.id === b.dataset.cmd))));
body.querySelectorAll('[data-open-autopilot]').forEach((b) => b.addEventListener('click', () => {
const kind = b.dataset.openAutopilot;
const p = kind === 'benchmark'
? this.mediaPath('research', 'latest_public_benchmark.md')
: this.mediaPath('reports', 'growth_autopilot.md');
openWith(p, 'default');
}));
body.querySelectorAll('[data-botcom-day]').forEach((b) => b.addEventListener('click', () => {
body.querySelectorAll('[data-botcom-day]').forEach((x) => x.classList.toggle('active', x === b));
body.querySelectorAll('[data-q-day]').forEach((row) => row.classList.toggle('hidden', row.dataset.qDay !== b.dataset.botcomDay));
}));
body.querySelectorAll('[data-q-open]').forEach((b) => b.addEventListener('click', () => this.openQueuePath(b.dataset.qOpen, b.dataset.day, b.dataset.platform)));
body.querySelectorAll('[data-q-copy]').forEach((b) => b.addEventListener('click', () => this.copyQueueText(b.dataset.day, b.dataset.platform)));
body.querySelectorAll('[data-review-action]').forEach((b) => b.addEventListener('click', () => this.reviewAction(b.dataset.reviewAction, b.dataset.day, b.dataset.platform)));
if (this.focus === 'growth') {
const target = body.querySelector('#growth-autopilot-workflow');
target?.scrollIntoView({ block: 'start', behavior: 'smooth' });
target?.classList.add('botcom-focus-pulse');
window.setTimeout(() => target?.classList.remove('botcom-focus-pulse'), 1800);
}
},
};

Expand Down Expand Up @@ -2707,6 +2766,7 @@ function bindEvents() {
$('#setup-entry').onclick = () => setupWizard.show();
$('#skills-entry').onclick = () => skillsView.show();
$('#botcom-entry').onclick = () => botcomDashboard.show();
$('#growth-entry').onclick = () => botcomDashboard.show('growth');
$('#term-newtab').onclick = () => term.newTab();
$('#term-max').onclick = () => term.toggleMax();
$('#term-dock').onclick = () => term.setDock(term.dock === 'bottom' ? 'right' : 'bottom');
Expand Down
4 changes: 4 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 13h8V3H3z"/><path d="M13 21h8V11h-8z"/><path d="M13 3h8v6h-8z"/><path d="M3 21h8v-6H3z"/></svg>
BotCom OS <span class="entry-badge">老板只审核</span>
</div>
<div id="growth-entry" class="nav-title side-link botcom-growth-entry" title="Growth Autopilot:媒体自动化工作流,公开基准对比、内容生产、质检、审核、发布准备和复盘 loop">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2v6"/><path d="M12 16v6"/><path d="M2 12h6"/><path d="M16 12h6"/><path d="m4.93 4.93 4.24 4.24"/><path d="m14.83 14.83 4.24 4.24"/><path d="m4.93 19.07 4.24-4.24"/><path d="m14.83 9.17 4.24-4.24"/></svg>
Growth Autopilot <span class="entry-badge">新工作流</span>
</div>
<div id="usage-sec">
<div class="nav-title" id="usage-toggle" title="Claude Code / Codex 用量——官方限额窗口 + 本机会话日志,不用开着它们">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>
Expand Down
Loading