Commit Graph

132 Commits

Author SHA1 Message Date
yuzhiran a4242ada0e fix: search_rankings missing columns 500 error + campaigns.html var typo
database.py: add 5 missing search_rankings columns (ai_search_engine, citation_snippet, citation_url, geo_score, content_type) - caused /api/seo/rankings Internal Server Error

campaigns.html: fix template referencing rankingOverview instead of keywordRankingOverview

Ultraworked with Sisyphus

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-24 16:55:12 +08:00
yuzhiran d11d7f4980 fix: pipeline content tracking + topic article preview
db_helper.py: save_article now calculates and persists word_count
generator.py: run_creator_blocking sets word_count for HTML-imported articles
writer.py: fix title regex stripping content-leading numbers (35岁后→岁后)
trends.py: fix Baidu hot_score str/int type comparison crash
database.py: add missing content_tasks.org_id ALTER TABLE migration
schemas.py + topics.py: topic list API returns article_count + articles[] previews
topics.html: table view and card view show article badges with word counts, clickable to open preview

Ultraworked with Sisyphus

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-24 12:31:02 +08:00
yuzhiran 302efd5f2d fix(ui): responsive mobile layout with auth flow refactoring for campaigns
Adds: v-cloak fix, mobile card-list views for all tables, responsive CSS breakpoints, early auth redirect, CDN script reorder to head, ElementPlusIconsVue safety check, global ElMessage reference. Moves async mounted to .then() pattern to avoid Vue 3 SFC issues.

Ultraworked with Sisyphus

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-23 13:30:19 +08:00
yuzhiran ef289b18d1 feat(ui): add series filter to topics search area
Adds column/category filter dropdown in topics.html search form, with seriesOptions computed and filteredTopics logic

Ultraworked with Sisyphus

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-23 13:23:19 +08:00
yuzhiran 8a04a23e86 feat(ui): external promotion dashboard (campaigns.html)
Add campaigns.html with 6 tabs (Overview/Products/Campaigns/Rankings/Audits/Tasks) using Vue 3 + Element Plus CDN. Add nav entry to uni-nav.js.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-21 16:06:46 +08:00
yuzhiran a692f1dd44 fix: landing OG image + GitHub link
Create og-landing.png (1200x630, 62KB) for OG meta tag.
Fix GitHub link placeholder (your-org -> github.com).

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-18 16:27:59 +08:00
Yuzhiran Dev d3ea832b3b feat: admin.html task management tab (TaskConfig + TaskLog timeline)
- Add 任务管理 tab button
- Show all 7 task modules table with enable/disable switch, schedule, params
- Edit dialog for schedule/params editing
- Click module to show el-timeline of recent 30 run logs
- View result data dialog
- Supports toggleModule, saveTaskConfig, loadTaskLogs
2026-06-17 20:10:56 +08:00
Yuzhiran Dev f6e5e90736 feat: Wave 3 - Dashboard redesign + RBAC + AI assistant updates
- Redesign index.html from system-monitor to user-centric workspace
  (welcome banner, summary cards, 今日待办, AI 智能建议, collapsible admin section)
- Add fetchTodos/fetchSuggestions/getPriorityClass/isOverdue methods
- Update uni-nav current-page from 'dashboard' to 'workspace'
- Add require_role to 10 admin router imports (RBAC foundation)
- Update ai-assistant.js: add factory/insights pages, org_id in chat requests
2026-06-17 18:24:57 +08:00
Yuzhiran Dev 5caf7bc52e feat: Wave 2 - API org isolation + factory.html + insights.html
- Add org_id auto-population to articles.py, publishing.py, metrics.py
- Add org_id filtering to search_rankings.py geo endpoints
- Add org_id to calendar.py create/update/delete endpoints
- Add org_id to tasks.py create endpoints
- Create factory.html content pipeline page (3-tab: 待创作/进行中/待审查)
- Create insights.html analytics page (4-tab: 概览/搜索排名/GEO/平台对比)
2026-06-17 16:13:48 +08:00
Yuzhiran Dev c069a140bb fix: Auth redirects and navigation for landing page routing
- login.html: Post-login redirect / -> /index.html; already-logged-in redirect / -> /index.html
- articles.html, topics.html: Auth failure redirect -> /login.html
- uni-nav.js: Dashboard link / -> /index.html; navigate function fix for prefix handling
- sw.js: Remove / pre-cache; HTML documents use Network First strategy for fresh content

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-16 08:28:06 +08:00
Yuzhiran Dev 24e46eced5 feat: Product landing page at / with responsive design
- landing.html: Full product website (hero, features, how-it-works, platform coverage, pricing, FAQ, CTA, footer)
- main.py: Route / to landing.html (overrides StaticFiles default index.html)
- Workspace dashboard remains at /index.html
- Responsive: desktop nav, hamburger mobile menu, single-column on small screens
- No Vue/Element Plus dependency; standalone HTML+CSS+JS (~30KB)

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-16 08:27:38 +08:00
Yuzhiran Dev f15e0f720a feat: Admin GEO readiness dashboard tab
- New 'GEO 就绪度' tab button in filter bar
- Overview stat cards: total checks, AI citations, citation rate, avg readiness
- AI engine breakdown display (DeepSeek/ChatGPT/Perplexity)
- Readiness scores table with 6-dimension color-coded tags
- Manual GEO tracking trigger button

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-16 08:27:11 +08:00
Yuzhiran Dev 8595bbc521 feat: GEO/SEO structured data + search ranking tracker 2026-06-09 17:18:09 +08:00
Yuzhiran Dev 23ff63baa9 fix: 三平台内容差异化 + admin敏感词管理表格化
- writer.py: _expand_section() 去除 <100字阈值,始终调用 LLM 平台专属扩写
- prompt_loader.py: 新增 section_expansion_zhihu/wechat/xiaohongshu 三个独立 prompt
- admin.html: 配置管理标签页 + 敏感词/清理规则子标签 + 敏感词表格化管理(编辑/删除)
- config_items.py: PUT /sensitive-words/{id} 支持更新 word/category
- compliance_checker.py: AI 套话从 DB 加载 + 人称规则修正
- initial_data.py: PlatformConfig 字数迁移 + 新种子
- 各前端页面: LLM 配置 rate_limit 字段 + 供应商列表排序
2026-06-08 13:51:35 +08:00
Yuzhiran Dev c6628b22f6 fix: 任务抽屉产出结果优化 + server 启动修复
- 任务抽屉产出结果 tab 优先显示 last_message(日志消息),
  过滤 result_data 中的 None/空值
- 修复 tasks.py 因 opencode 块删除导致的 SyntaxError
- 修复 scheduled_generate 存储 None 值问题
- 清理 DB 中旧 scheduled_refresh_search_cache 的 56 条
  TaskLog + 1 条 TaskConfig
- 更新 PROGRESS.md
2026-06-03 11:06:25 +08:00
Yuzhiran Dev 499c511140 chore: opencode冗余清理 + LLM任务级模型选择 + systemd服务化
- 删除 opencode_search.py / mcp_search_server.py 及所有 MCP 引用
- 移除搜索缓存定时任务(scheduled_refresh_search_cache)
- 清理前后端所有 opencode/MCP 代码和注释
- LLM 提供商量换:opencode-go→nvidia(默认)+sensenova(合规审查)
- llm_configs 新增 is_default 字段,API 层互斥逻辑
- 所有定时任务支持独立 LLM 模型选择(LLM_TASK_PROVIDER env)
- compliance_optimizer.py 修复:import os / 解硬编码 / 关键词过滤
- Scheduler 日志修复:始终 INSERT,避免僵尸 running 行
- Systemd 服务化:Restart=always / 单 worker / Type=exec
- 搜索提供商:替换 opencode→360/搜狗/微信(免 Key)
- 更新 AGENTS.md / PROGRESS.md
2026-06-02 15:38:16 +08:00
Yuzhiran Dev abbf1468bc fix(admin): LLM 路由标签动态化
- 默认提供商按 id 排序取第一个活跃的(nvidia step-3.7-flash)
- 合规审查取活跃且 model=deepseek-v4-flash 的(sensenova)
- 不再硬编码
2026-06-01 14:46:22 +08:00
Yuzhiran Dev 53f105305f fix(admin): LLM 路由显示不准确
- 默认路由改为动态取第一个活跃提供商(当前为 nvidia step-3.7-flash)
- 合规审查标签改为固定 sensenova (deepseek-v4-flash)
- 移除硬编码的 opencode-go 标签
2026-06-01 14:42:32 +08:00
Yuzhiran Dev f1dc29f439 fix(llm): 分场景使用不同模型
- nvidia 激活、模型改为 step-3.7-flash → 用于日常生成/采集/优化等
- compliance_optimizer.py 显式指定 provider=sensenova → 合规审查走 deepseek-v4-flash
- _FALLBACK 同步更新为 step-3.7-flash
- 管理后台标签同步更新
2026-06-01 14:35:41 +08:00
Yuzhiran Dev 475945418e feat(llm): LLM 配置完全通过管理后台维护
- _get_provider_config 改从 DB 读取 api_key(.env 为 fallback)
- 前端 admin.html 新增 sensenova provider 选项,默认值更新为 sensenova
- 新增提供商不再需要改代码,后台直接配即可
2026-06-01 14:23:24 +08:00
Yuzhiran Dev 1084388fec fix(topics): 外键约束导致 delete 400
选题有关联 content_tasks/article/publish_record/metrics 表,
外键约束阻止删除。改为先级联删除关联数据再删选题。

前端同时显示服务端返回的具体错误信息,而不是笼统的 删除失败。
2026-06-01 12:08:51 +08:00
Yuzhiran Dev 3fab87ee11 feat: 新增360/搜狗/微信搜索提供商 + PG15→16升级 & 项目文档更新
- search_utils.py: 新增 _call_360/_call_sogou/_call_wechat HTML爬取函数
- initial_data.py: 种子数据新增三个搜索提供商(priority 3/4/5)
- models.py: provider_type 注释补充新类型
- admin.html: 搜索提供商类型下拉框新增三个选项
- AGENTS.md/PROGRESS.md/README.md: PostgreSQL 15→16
- README.md: 移除硬编码数据库密码
2026-05-29 09:35:15 +08:00
Yuzhiran Dev bd3228806d fix: 合规审查卡死修复 + 小红书复制格式 + today-only过滤 2026-05-27 18:25:30 +08:00
Yuzhiran Dev b105eee9bb fix: add LLM config status display + routing info
- 状态列: icon → el-tag 文字标签(当前使用/未启用)
- 新增路由状态提示条, 显示默认 vs 审查固定路由
- 移动端卡片同样改为文字标签
2026-05-27 10:09:23 +08:00
Yuzhiran Dev ac8644d752 fix: content quality, image format, task monitor, calendar data source, search UI & sort 2026-05-26 11:26:10 +08:00
Yuzhiran Dev b2d043b231 新增用户管理/角色管理/菜单管理功能,修复创作流水线研究脚本
- 用户管理:新增编辑弹窗(修改用户名/角色/密码),增加组织/创建时间/最后登录列
- 角色管理:新增 Role 模型 + CRUD API,admin.html 新增角色管理 tab
- 菜单管理:新增 Menu 模型 + CRUD API,导航栏从 API 动态加载菜单项
- 个人中心:右上角下拉菜单(个人信息/修改密码/退出),新增修改密码 API
- 种子数据:initial_data.py 自动创建默认角色(admin/editor)和默认菜单(7项)
- 修复 research.py 缺少 enrich_topic_research 函数导致导入失败
- 修复 db_helper.py 中 generated_at 条件导致重创作不更新时间戳
- admin.html 操作列加宽防止按钮换行,平台配置增加删除按钮
- articles.html 预览弹窗加 lock-scroll=false 防止页面尺寸跳动
2026-05-22 18:34:27 +08:00
Yuzhiran Dev 1855f190f5 配置全面迁移数据库:PromptConfig、TaskConfig动态调度、敏感词/清洗规则/趋势映射/平台标签/痛点模板全部可编辑
- 新增 PromptConfig 模型 + API,支持提示词在线编辑(16条默认)
- 调度器动态读取 TaskConfig.schedule,admin 可调执行时间
- 新增 KeywordDomainMap、SensitiveWord、ContentCleanRule、TrendFieldMapping 表
- DOMAINS、TREND_DOMAIN_MAP、PLATFORM_TAGS、china_pains、RSS关键词、priority_weights 全部迁移到 DB
- tasks.html 重构:卡片网格+配置/产出/历史/提示词四个Tab,折叠显示
- 清理冗余代码:DEFAULT_PROMPTS死代码、collector.py unreachable代码、compliance_checker bug
- strip_thinking_html 改用 DB 规则优先
2026-05-22 11:18:23 +08:00
Yuzhiran Dev a8e0a76e07 任务页输入参数旁加'前往编辑'链接
- 采集类别参数 → admin.html#tab=categories
- 信息源参数 → admin.html#tab=sources
- admin.html 已支持 URL hash 自动切tab
- 新窗口打开,不打断当前任务浏览
2026-05-21 10:38:30 +08:00
Yuzhiran Dev 9178f436b2 任务页面全面改版: 模块输入/输出/历史详情抽屉
后端新增:
- GET /api/tasks/modules/{module_id}/detail
  每个模块返回: inputs(自动填充的参数)、outputs(格式化产出结果)、
  history(今日运行记录)、log_excerpt(日志原文)

前端重构 tasks.html:
- 上半: 定时任务模块卡片网格(与仪表盘风格统一)
- 点击卡片→右侧抽屉展示3个tab:
  📥 输入参数: 搜索词/类别/待处理数量等(自动填充)
  📤 产出结果: 表格/标签/评分/建议等(按类型格式化)
  📋 运行记录: 日志原文+时间轴
- 底部保留创作任务列表(分页/筛选/详情)
- 抽屉底部立即运行按钮
2026-05-21 10:18:21 +08:00
Yuzhiran Dev 6f81167691 联网搜索能力集成: opencode webfetch → 采集器
新增:
- scripts/opencode_search.py: 通过 npx opencode run 调用 webfetch 联网搜索
- 搜索缓存每日 02:30 自动刷新 (scheduler)
- 管理后台「搜索缓存」模块 + 立即运行按钮
- POST /api/system/refresh-search-cache/run 手动触发端点
- 8个分类搜索词从sources.yaml读取,调用AI联网搜索真实内容

机制:
  Python脚本 → npx opencode run → AI webfetch → 真实搜索结果 → 写入search_cache.json
  → 采集器读缓存 → LLM基于真实数据生成选题

不再需要API Key,不依赖任何搜索引擎,搜索结果来自AI的webfetch能力
2026-05-21 09:01:02 +08:00
Yuzhiran Dev c8bee712d7 Phase3: 三平台封面图生成
- cover_generator.py: Pillow生成知乎/微信/小红书封面图(渐变背景+标题)
- 知乎 1200×630 蓝调, 微信 900×500 绿调, 小红书 1080×1440 红调
- creator.py 流水线增加 cover_generator 作为最终回退
- db_helper.py 新增 save_cover_to_article
- main.py 挂载 /automation/images 静态目录
- articles.py preview 接口返回 images 字段
- topics.html 预览dialog展示封面图
2026-05-20 19:12:58 +08:00
Yuzhiran Dev 40a77cad2c Phase2: 真实热点数据接入
- trends.py新增百度/微博/知乎实时热搜API抓取,LLM为fallback
- 新增 source 字段标记数据来源
- scheduler.py新增 scheduled_fetch_trends 每日03:00定时刷新
- system.py新增 POST /api/system/trends/run 手动触发端点
- system.py modules/status 加入热点趋势模块
- index.html triggerModule 加入 trends 触发按钮
2026-05-20 19:07:35 +08:00
Yuzhiran Dev 09da2f9dc4 Phase1: 效果数据真实化
- 替换scheduler.py中假随机数metrics_sync为知乎API自动获取
- 新增 POST /api/metrics/zhihu-fetch 知乎公开数据API端点
- metrics.html新增「数据录入」tab:手动录入表单+已有数据列表+知乎自动获取
- gitignore清理已跟踪的生成文件(outlines/research/images/cache)
2026-05-20 19:04:35 +08:00
Yuzhiran Dev 9a328323c0 Filter outline markers in writer, add min-height to preview dialog 2026-05-20 18:11:32 +08:00
Yuzhiran Dev 2244736318 Fix preview: keep article title and tags, adjust scroll height 2026-05-20 15:37:26 +08:00
Yuzhiran Dev 63f074e4df Fix preview dialog scroll & preserve HTML structure on edit save 2026-05-20 15:18:48 +08:00
Yuzhiran Dev 0a8fbda4fd Fix calendar filter, module triggers, API cleanup, consolidate get_current_admin, fix LLM schema 2026-05-20 14:15:00 +08:00
Yuzhiran Dev 498165440f Add platform config website_url, admin tab, fix writer DB config fallback, add trigger endpoints 2026-05-20 09:38:56 +08:00
Yuzhiran Dev 55e5f3d166 Fix topics mobile card list pagination: use paginatedTopics instead of filteredTopics 2026-05-19 08:28:56 +08:00
Yuzhiran Dev 3dce54b359 Fix writer max_tokens (500→1000) for titles/tags, fix preview scrollbar height 2026-05-19 07:44:56 +08:00
Yuzhiran Dev 671cec58fa Fix preview platform switching, add stale task cleanup on startup 2026-05-18 23:38:30 +08:00
Yuzhiran Dev 7b4e52743b Fix pagination: all pages default to 10 per page, add total counts, fix tasks pagination position and use client-side slicing 2026-05-18 22:59:03 +08:00
Yuzhiran Dev f427aea1b3 Fix task status stuck at 'running': use new DB session in thread, add frontend auto-polling 2026-05-18 22:37:59 +08:00
Yuzhiran Dev 33766a396d Fix topic preview: add missing edit/save methods, fix scrollbar, strip tags from preview body 2026-05-18 19:40:26 +08:00
Yuzhiran Dev a09e7e6671 Add pagination to admin management tabs (cases/categories/sources/orgs) 2026-05-18 19:18:09 +08:00
Yuzhiran Dev 52564ad036 fix: 今日新增筛选统计不准 + LLM提示词动态当前日期 + 微信配图按选题生成
topics.html:
- 今日新增筛选时全量拉取 allTopics 用于保持 stats 统计正确,todayTopics
  存储服务端日期过滤结果
- filteredTopics 对 'today' 返回 todayTopics,不按不存在的 status 过滤

writer.py/research.py/outline.py:
- 所有 LLM 提示词注入今天的动态年月日(datetime.now)
- 禁用过时数据的年份改为动态 {当前年-1}-{当前年}
- 每个论点必须配真实最新案例+数据来源

writer.py WeChat 配图:
- 从 null placeholder 改为动态 SVG,展示选题标题+领域
- 标题自动换行(24字/行),附蓝色装饰条 + 渐变背景
2026-05-18 06:25:47 +08:00
Yuzhiran Dev bb50d5d925 fix: 今日新增筛选filteredTopics未处理'today'导致始终为空,状态筛选改为全量拉取保统计准确
- filteredTopics 对 filterStatus='today' 直接返回 this.topics(服务器已按日期过滤),避免按不存在的 status 再次过滤导致空列表
- fetchTopics 改为只有 'today' 走服务端 ?today=true;其他状态仍然全量拉取后客户端过滤,保证 statusStats 统计按钮数字准确
- 保留 watch 移除(用户能自由清除筛选)
2026-05-18 06:14:15 +08:00
Yuzhiran Dev a46fedabb5 fix: 选题页状态过滤器改用服务端过滤,移除watch覆写URL参数导致无法清除筛选的问题
- fetchTopics 根据 filterStatus 发送 status/today 参数到后端,而非全量拉取后客户端过滤
- 移除 watch.topics 处理器,解决 URL 参数反复覆写用户筛选操作的问题
- 今日新增(?today=true)和服务端 status 参数均走 API 过滤
2026-05-18 06:08:33 +08:00
Yuzhiran Dev 41b0f694ee feat: 平台配置表扩展配图/字数字段,微信公众号正文插入配图,合规检查从DB读规则
- PlatformConfig模型新增requires_image、image_count_min/max、image_width/height、min_words/max_words
- schemas.py同步PlatformConfigBase/Create/Update/Response新字段
- initial_data.py为三大平台填充初始值(微信需配图、字数800-1500等)
- database.py添加新列ALTER TABLE迁移
- platforms.html重写编辑弹窗(正确字段名+配图/字数设置)
- writer.py微信公众号文章正文h1后插入<img>占位
- compliance_checker.py接受platform_config参数,从DB读取规则替代硬编码
- compliance_optimizer.py启动时加载DB平台配置传入checker
2026-05-17 23:08:43 +08:00
Yuzhiran Dev eb472d232e fix: 仪表盘概览标题颜色过浅改用CSS变量;模块状态列表从3个扩展至6个与定时任务数匹配 2026-05-17 17:01:14 +08:00