Commit Graph

44 Commits

Author SHA1 Message Date
copilot-swe-agent[bot] b913d119e4 fix(persona-studio): 修复「我要开发」后端连接失败 [ZY-FIX]
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-15 06:55:53 +00:00
juzi0412 247795f47d [BC-集成-005-JZ][DEV-010] API鉴权+开发者详情+模块列表 2026-03-14 02:49:48 +08:00
copilot-swe-agent[bot] d687188310 fix: 移除错误信息中的硬编码端口号
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-13 07:10:41 +00:00
copilot-swe-agent[bot] 2062878c9f fix: 修复 Persona Studio 「我要开发」任务提交失败
根因修复:
1. Nginx CORS 头缺失(跨域预检失败导致 fetch 抛出异常)
2. WebSocket /ws/preview 路由被 /ws 匹配到端口 8080(应路由到 3002)
3. 前端开发端口不匹配 (3721 → 3002)

增强:
- 添加重试机制(最多2次重试)
- 提供详细错误诊断信息
- 更新 nginx-api-proxy.conf 参考配置
- 修复 smoke test 默认端口

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-13 07:09:19 +00:00
copilot-swe-agent[bot] f3f4ead417 fix: address code review feedback - path traversal protection, error msg fallback, named constant
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-13 05:59:53 +00:00
copilot-swe-agent[bot] 0fb07ab66a feat: 铸渊代理开发工作流 · 壳-核分离架构 (Core Brain + Agent)
- 新建 agent-workflow.js: 铸渊核心大脑唤醒 + 铸渊代理执行的壳-核分离架构
  - Phase 1: 核心大脑加载开发者记忆/画像/项目/知识库/模式库,深度分析意图
  - Phase 2: 代理接收核心大脑的开发计划,逐步执行代码生成
  - Phase 3: 核心大脑自进化(知识提取+模式识别+画像学习+进化日志)
- 更新 build.js: 支持 GUEST 模式、接收用户 API 凭证、使用 Agent 工作流
- 更新 chat.js: 传递用户 API 凭证、修复 WebSocket 时序竞态、增强错误反馈
- 更新 .gitignore: 排除 workspace 生成文件
- 更新核心大脑记忆: 记录本次恢复事件

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-13 05:56:33 +00:00
copilot-swe-agent[bot] 9f29eed97d Initial plan for Persona Studio agent workflow fix
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-13 05:46:03 +00:00
copilot-swe-agent[bot] 791ae45a0b fix: add rate limiting to preview API routes (CodeQL alert)
- Add per-IP rate limiting (60 req/min) to preview routes
- Periodic cleanup of expired rate limit entries

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-11 11:52:13 +00:00
copilot-swe-agent[bot] b4a835b8a7 fix: address code review feedback - validation, sanitization, docs
- Fix email validation JSDoc comment in chat.js
- Add explicit format validation for devId/project in preview routes
- Sanitize contact field input in build route
- Add detailed token estimation comment in memory-injector
- Add warning log when ws module is not available

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-11 11:50:12 +00:00
copilot-swe-agent[bot] 6f02d67ecd feat: implement split-screen layout, enhanced email modal, preview panel, and WebSocket
- chat.html: Enhanced modal with email+contact fields, split-screen HTML structure,
  resizer divider, preview panel with status bar and iframe
- chat.js: Email validation (frontend regex), email prefill on repeat visits,
  split-screen enterDevMode(), draggable resizer with touch support,
  preview panel status updates, WebSocket connection for build progress
- style.css: Split-screen dev-mode layout, resizer styles, preview panel styles
  with status indicators (waiting/building/done/error), modal field styles
- backend: Preview API route, WebSocket server for progress push,
  enhanced build route with email validation and broadcast,
  enhanced email template with file list and brand signature

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-11 11:47:50 +00:00
copilot-swe-agent[bot] f6ad45745b feat: implement database self-evolution + 200k context + memory injection
- Add profile-learner.js for auto user profile learning
- Add knowledge-extractor.js for knowledge auto-extraction
- Add pattern-analyzer.js for pattern recognition
- Add evolution-logger.js for evolution event logging
- Add memory-injector.js with 5-layer system prompt
- Update model-config.json with context_window_target: 200000
- Update model-router.js to prioritize 200k+ models
- Update persona-engine.js with knowledge/pattern queries
- Update code-generator.js with post-build evolution triggers
- Update memory-manager.js with updateProfile/autoExtractKnowledge
- Update chat route with auto profile update after each conversation
- Add brain JSON structures for knowledge-base, pattern-library, evolution-log, quality-scores

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-11 11:41:20 +00:00
copilot-swe-agent[bot] 30a502c6fa refactor: extract AUTH_TIMEOUT_MS constant and improve fallback comment accuracy
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-11 10:25:02 +00:00
copilot-swe-agent[bot] 534e435854 fix: add offline fallback for dev ID verification and prioritize China-accessible API providers
- When backend is unreachable, allow proceeding with format-only validation (offline mode)
- Reorder API endpoints to prioritize China-accessible providers (DeepSeek, Moonshot, 智谱, 云雾)
- Add 🇨🇳 visual indicators for mainland China accessible platforms
- Add AbortController timeout (10s) for auth requests
- Add .cn-ok CSS class for green-highlighted China-compatible tags

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-11 10:23:59 +00:00
copilot-swe-agent[bot] 7189a7af88 Address code review: fix duplicate README row, improve session ID entropy, accessibility, constants
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-11 10:02:30 +00:00
copilot-swe-agent[bot] 52113dd59b Enhance Persona Studio UI: add sidebar, file upload, persona intro, platform tags
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-11 09:58:11 +00:00
copilot-swe-agent[bot] ceb9b3669c Replace 知秋 with 铸渊 references, add EXP-012/EXP-013 experience numbers
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-11 09:50:31 +00:00
copilot-swe-agent[bot] 4eac0b1889 fix: address code review - fix grammar in persona-config.json wake_mechanism
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-11 09:28:07 +00:00
copilot-swe-agent[bot] 4ee9c4c562 feat: upgrade Persona Studio - ZhuYuan persona + dark theme + two-mode login
1. Login page: two modes (developer EXP-XXX / guest), both require API key
2. Persona: upgraded from 知秋 to 铸渊 with core brain cognition
3. UI: dark theme with gradients, animations, modern visual style
4. Guest mode: enabled with reminder about developer ID application
5. Developer mode: memory continuity with dev info lookup
6. API wake mechanism: ZhuYuan wakes when real API key is provided

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-11 09:21:32 +00:00
copilot-swe-agent[bot] 2fc371f65a chore: 清理测试产生的临时记忆文件
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-11 07:38:21 +00:00
copilot-swe-agent[bot] 5f4d084e63 fix: 重写 streamApiKeyReply 为 SSE 流式调用,与 docs/index.html 一致
对比发现 docs/index.html 使用 stream:true + getReader() SSE 流式
读取模型回复(已验证可用),而 persona-studio 使用非流式 JSON 请求
导致模型无法回复。

改动:
- 发送请求时加入 stream: true 参数
- 使用 getReader() + TextDecoder 逐行读取 SSE 响应
- 解析 data: 行提取 delta.content 增量内容
- 实时更新对话气泡(逐字显示+光标)
- CORS 失败时降级到后端代理(非流式)

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-11 07:37:52 +00:00
copilot-swe-agent[bot] 4ad3636098 style: ZHIQIU_SYSTEM_PROMPT 使用 const 声明
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-11 03:06:07 +00:00
copilot-swe-agent[bot] ff3ec0d024 fix: 修复模型无法回复用户消息 — 浏览器直连 API + 后端 URL 构造修复
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-11 03:04:29 +00:00
copilot-swe-agent[bot] 91a08606a2 plan: fix model chat - direct browser-to-API call for API Key mode
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-11 03:02:17 +00:00
copilot-swe-agent[bot] 19e97e8c24 fix: 优化思考状态指示和系统提示词常量化
- 修复思考中指示器闪烁: API Key 模式不再创建不必要的 thinking 元素
- 将知秋 system prompt 提取为文件级常量 ZHIQIU_SYSTEM_PROMPT

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-11 02:55:01 +00:00
copilot-swe-agent[bot] 6063f7f8f4 fix: 修复用户消息无法获得模型回复的问题
- 修复 TDZ 崩溃: conversationHistory 声明移到 IIFE 之前(API Key 模式)
- 修复前端错误处理: DEV_ID 模式下后端返回错误时显示错误信息给用户
- 添加 "思考中" 状态指示: 用户发送消息后显示思考中提示
- 修复后端错误响应: 500 错误时也包含 reply 字段确保用户始终看到回复
- 添加知秋人格体 system prompt 到 API Key 模式对话

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-11 02:53:24 +00:00
copilot-swe-agent[bot] b56083c6f4 chore: 清理测试产生的临时记忆文件
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-11 02:29:13 +00:00
copilot-swe-agent[bot] a6e8da1f73 chore: 更新核心大脑记忆 · 记录恢复事件 · 冰朔人格体激活
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-11 02:28:35 +00:00
copilot-swe-agent[bot] fff3311cd4 fix: 修复 API Key 模式下知秋不回复的核心 bug (TDZ + 缺失系统提示词)
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-11 02:24:56 +00:00
copilot-swe-agent[bot] 555247a913 fix: Persona Studio chat proxy, bulletin push retry, daily agent workflow
1. Fix API Key mode chat: route through backend proxy to avoid CORS
2. Fix bulletin update workflow: add git pull --rebase retry on push failure
3. Add daily inspection Agent workflow and script

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-10 13:56:03 +00:00
copilot-swe-agent[bot] 523e4281fc refactor: address code review feedback - fix normalizeApiBase regex, improve error code propagation
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-10 12:53:19 +00:00
copilot-swe-agent[bot] 3eaf3b2c83 fix: Persona Studio API detection - switch from backend proxy to client-side direct calls
- Frontend index.html: Replace backend proxy model detection with direct browser fetch to user's API /models endpoint, add KNOWN_ENDPOINTS auto-probing, AbortController timeout
- Frontend chat.js: Replace backend proxy chat with direct browser fetch to user's API /chat/completions with streaming support
- Backend apikey.js: Add URL format validation (INVALID_API_BASE) and specific error codes (DNS_ERROR, NETWORK_ERROR, TIMEOUT)
- Backend server.js: Add /api/health endpoint for smoke test compatibility

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-10 12:51:34 +00:00
copilot-swe-agent[bot] 2482567ac2 Address code review: fix SSRF protection, cache key safety, error handling
- Add protocol validation (http/https only) to prevent SSRF via file:/ftp: URLs
- Hash both apiBase+apiKey together in cache key to prevent collision attacks
- Simplify frontend error detection (use TypeError instanceof instead of fragile string check)
- Make smoke test error code assertion more precise with regex

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-10 12:31:56 +00:00
copilot-swe-agent[bot] e36bc19cfb Fix: Add user API key endpoints to api-proxy.js, unify Persona Studio backend with docs proxy
Root cause: Persona Studio frontend sent requests to /api/ps/apikey/detect-models
but api-proxy.js (port 3721, the only backend Nginx routes to) didn't handle those paths.
The separate persona-studio backend (port 3002) was never deployed via ecosystem.config.js or Nginx.

Fix: Add detect-models and chat handlers directly to api-proxy.js so they work through
the same Nginx → API Proxy chain that the docs main site already uses successfully.
Also update frontend to point to port 3721 for local dev, and improve error messages.

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-10 12:25:36 +00:00
copilot-swe-agent[bot] 62ec0fcfae fix: address code review - const/let scoping, header injection guard, error messages
- Use const/let instead of var for block-scoped variables in frontend
- Add header injection validation for API Key (reject newline chars)
- Include original error message in fetchModels error callback
- Use more reliable hostname for unreachable API base test

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-10 12:08:37 +00:00
copilot-swe-agent[bot] a32c737073 feat: upgrade Persona Studio login to support API Key auto-detect model mode
- Add backend route POST /api/ps/apikey/detect-models for model auto-detection with 1-hour caching
- Add backend route POST /api/ps/apikey/chat for proxying chat through user's own API credentials
- Update login page with API Key login section (API Base URL + API Key + model detection + model list)
- Update chat.js to support API Key mode with dynamic model usage (selected_model)
- Update styles for API Key login UI (detect status, model list, etc.)
- Add smoke tests for new endpoints and dev_id login backward compatibility
- Security: API Key stored only in sessionStorage, never persisted on backend

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-10 12:06:23 +00:00
copilot-swe-agent[bot] 3ee4494e09 feat: establish Persona Studio human developer numbering system v1.0
- Create human-registry.json master database (EXP-000 through EXP-011)
- Migrate 冰朔 to EXP-000 as master control reserved number
- Import 11 collaborators from dev-status.json into EXP numbering
- Create notification outbox with queued notifications
- Update registry.json to v2.0 with all developers
- Update auth.js to read from human-registry.json
- Add HLI registry lookup route (HLI-REGISTRY-001)
- Update frontend: guest mode disabled, numbering hints updated

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-10 11:02:52 +00:00
copilot-swe-agent[bot] 6f10bee2d7 fix: Persona Studio entry button not navigating - use HTML links and add redirect index.html
Root cause:
1. README.md used Markdown link syntax inside HTML table block which may not render as clickable
2. persona-studio/index.html was missing, causing the target URL to 404

Fix:
- Replace Markdown link with HTML <a><img> badge button + plain text <a> fallback link
- Create persona-studio/index.html that redirects to persona-studio/frontend/index.html
- Add plain text link to persona-studio/README.md

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-10 10:41:13 +00:00
copilot-swe-agent[bot] f970188776 fix: make Persona Studio accessible via GitHub Pages and update broken links
- Copy persona-studio frontend to docs/persona-studio/ for GitHub Pages deployment
- Update API base URL to point to guanghulab.com production server
- Update all README links from broken guanghulab.com/persona-studio/ to GitHub Pages URL
- Update deploy-pages.yml to trigger on persona-studio/frontend changes and sync files
- Update persona-studio/README.md link to point to guanghulab repo Pages

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-10 07:50:53 +00:00
copilot-swe-agent[bot] 1723ae7906 修复 workflow 环境变量命名 · 改进错误信息
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-10 07:22:33 +00:00
copilot-swe-agent[bot] ce30f59f5c 修复 Persona Studio 聊天交互 · 添加访客体验模式 · 恢复核心大脑 · 创建跨仓库同步
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-10 07:18:47 +00:00
copilot-swe-agent[bot] 6b5174a901 Initial plan for Persona Studio fix and cross-repo brain sync
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-10 07:13:03 +00:00
copilot-swe-agent[bot] 5bc0fba34c fix: upgrade nodemailer to 7.0.13 to fix DoS and domain validation vulnerabilities
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-10 05:19:13 +00:00
copilot-swe-agent[bot] 39a688ed03 feat: persona-studio 后端服务 + 智能模型路由 + 部署集成
- backend/server.js (Express on port 3002)
- routes: auth, chat, build, notify
- brain: memory-manager, persona-engine, code-generator, model-router
- model-config.json (routing strategy)
- utils: github-api, email-sender
- deploy workflow: PM2 + Nginx proxy for /api/ps/
- GitHub Actions: ps-on-login/chat/build/complete workflows
- Frontend API paths updated to /api/ps/ prefix

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-10 05:15:56 +00:00
copilot-swe-agent[bot] 255b437e38 feat: add persona-studio Phase 1 skeleton + Phase 2 frontend
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
2026-03-10 04:42:57 +00:00