Commit Graph
100 Commits
Author SHA1 Message Date
Aska df70313d6d chore(deps): 添加 gorilla/websocket(WS Hub)+ robfig/cron(自动化调度) 2026-09-06 07:33:11 +08:00
Aska 6f97fded3a feat(backthink): 后台自主思考(heartbeat+事件触发 + 打扰决策 fail-closed + 主动推送活跃→IM 兜底 + 限制 + 思考记录) 2026-09-06 07:33:06 +08:00
Aska 05e23ea590 feat(gateway): 网关(REST /api/v1 + WS Hub /ws/chat + admin /api/v1/admin/* + JWT/RBAC + 审计,单端口 :8080) 2026-09-06 07:32:40 +08:00
Aska ff34b62079 feat(automations): 自动化引擎(cron 调度 + 事件触发 + AI 管线动作 + 提醒调度,bus automation.result/reminder.trigger) 2026-09-06 07:32:29 +08:00
Aska a3f6f4f687 feat(auth): JWT(HS256 stdlib) + RBAC(owner/admin/viewer) + API key + 密码 hash;config 校验 2026-09-06 07:19:28 +08:00
Aska 7f7cb8fbf7 feat(errors): 统一 AppError(Code/Message/Cause/HTTPCode + Wrap %w + HTTPStatus + ToJSON {error:{code,message}}) 2026-09-06 07:15:34 +08:00
Aska ebeecc7a32 feat(task): 任务执行模型(后台声明/前台2s转后台/bus task.done 回输出/实时输出读取/Abort 防失控) 2026-09-06 07:11:03 +08:00
Aska 430fc4666b feat(exec): 本地执行 Provider + 放权终端沙箱(白名单/工作目录/超时/输出截断/默认关)+ 文件沙箱;config 增 ExecSandbox(默认关) 2026-09-06 06:59:23 +08:00
Aska 88dc12466d feat(channels/weixin_ilink): 微信 iLink 渠道插件(扫码登录+长轮询+游标+context_token+AES-128-ECB 媒体+24h 主动推送窗口) 2026-09-06 06:49:35 +08:00
Aska 7831b0ea1b feat(channels/qq_obv11): OneBot v11 渠道插件(正/反 WS 双模式 + CQ 媒体 + 限频,stdlib 自研 WS) 2026-09-06 06:46:43 +08:00
Aska f9f5a78a02 feat(channels/telegram): Telegram 渠道插件(Bot API 长轮询/Webhook + file_id 媒体 + 主动推送强) 2026-09-06 06:38:13 +08:00
Aska 0b036645bb feat(channels/webhook): 入站回调渠道插件(JSON/Form 解析 + HMAC 签名 + InboundHandler 供 gateway 挂载,主动推送不支持) 2026-09-06 06:37:16 +08:00
Aska 7adaf490c7 feat(channel/session): 渠道↔会话映射 + 主人识别(actor元数据+白名单,不读消息内容) + 群聊隔离 + 主动推送策略(iLink24h/OneBot限频) 2026-09-06 06:36:27 +08:00
Aska 3ce9489f8e feat(tools/io): 内置 IO/网络工具(file(路径安全)/http(SSRF防护)/web-search/web-fetch/knowledge)+ 大小截断 2026-09-06 06:29:03 +08:00
Aska 488cf9c79c feat(capability/mcp): MCP 客户端(stdlib JSON-RPC over stdio/SSE)+ Registry 自动注册/Unregister(registry 增 Remove) 2026-09-06 06:28:38 +08:00
Aska 08223c06a5 feat(tools/basic): 内置基础工具(calculator(注入安全)/datetime/random/text/json/markdown)+ 批量注册 2026-09-06 06:26:59 +08:00
Aska b3c61aa1ff feat(iot): IoT 插件化(Provider/Manager/mock 8设备/能力约束/bus 事件);feat(capability/restrict): 工具级布尔标记(群聊/陌生人可用,默认关,策略引擎雏形)+ registry ToolPolicy 2026-09-06 06:26:21 +08:00
Aska 915aa8a100 feat(capability/skills): 可复用工作流技能(Skill 模型 + Store + YAML Loader + Runner 展开 + 注册) 2026-09-06 06:25:42 +08:00
Aska d947ec41a9 feat(memory): M4 记忆完善(三类作用域访问规则+项目索引分层+LLM异步提取+衰减溯源+向量接入,兼容既有57用例) 2026-09-06 06:15:18 +08:00
Aska 5b37f5a551 chore(deps): 添加 pgx/v5 驱动(memory/vector 的 PG pgvector 真生效路径) 2026-09-06 06:15:18 +08:00
Aska fb880572a4 feat(memory/vector): 向量检索引擎(SQLite BLOB 内积默认 + PG pgvector 真语义增强,配置后真生效) 2026-09-06 06:04:44 +08:00
Aska ef79edd96a feat(memory/projectindex): 项目索引分层(索引+描述+章节,Search 定位行+上下文,级联删除) 2026-09-06 06:01:20 +08:00
Aska d90ec7bd4f feat(orchestration): 子代理编排调度器(创建/生命周期/并行上限4/超时/防失控/结果合并/进度事件/隔离上下文+独立工作记忆) 2026-09-06 05:53:54 +08:00
Aska 20f4a91d02 feat(orchestration/comm): agent-to-agent 通信(bus ask/reply/event,私密 reply 主题 + 超时) 2026-09-06 05:41:54 +08:00
Aska 8b723009f9 feat(orchestration/audit): 子代理上下文可审计查询(全量/尾部/关键词定位)+ 主代理代审授权(审计日志+小字) 2026-09-06 05:39:06 +08:00
Aska 71697ca4f8 feat(loop): agent loop(8 轮 + checkpoint + 流式 + 记忆注入/提取 + trace + 工具超时回喂) 2026-09-06 05:33:38 +08:00
Aska 01a4e29f84 docs(api): 新增用户侧跨平台客户端 API 文档(契约+端点登记表);AGENTS 立「随实现更新 API 文档」铁律 2026-09-06 05:32:57 +08:00
Aska 10c0069fa7 feat(logger): WithSource/Scoped 日志来源标注;AGENTS 追加日志标来源+客户端API契约红线 2026-09-06 05:22:00 +08:00
Aska be67d74822 feat(agent): Agent 实体(指令/工具/guardrail/handoff + 单步 RunStep,含多模态路由/调用记录) 2026-09-06 05:20:32 +08:00
Aska b798e129c1 feat(tool): Dispatcher.ToolSchemas() 暴露工具 schema(供 agent 组装请求) 2026-09-06 05:20:32 +08:00
Aska 3da189e856 docs(AGENTS): 追加 §9 全球红线 + §10 代码/流程硬性规范(模块拆多文件/每阶段 push/遇设计冲突阻塞询问) 2026-09-06 05:14:17 +08:00
Aska aa697c385f feat(memory): 长记忆 store(SQLite+persona 隔离)/工作记忆滑动窗口/检索注入/手工提取钩子 2026-09-06 05:12:42 +08:00
Aska 285e1e9911 feat(db): 新增 0002_memory 迁移;迁移测试改用嵌入式迁移集合(数量无关,避免卡死后续迁移) 2026-09-06 05:12:42 +08:00
Aska 0a936a3202 feat(multimodal): 视觉分层路由(多模态检测→主/视觉/OCR 工具)+ 语音 STT→TTS 降级链(异步) 2026-09-06 05:12:36 +08:00
Aska 02aae2bbb4 feat(guardrail): 输入/输出护栏(关键词/敏感信息/长度,pipeline fail-fast) 2026-09-06 05:07:13 +08:00
Aska e33b005612 feat(trace): 深追踪(Span 生命周期/父子链/JSONL recorder,支持 llm/tool/state 等类别) 2026-09-06 05:06:41 +08:00
Aska 011d25a53d feat(persist): durable checkpoint(SQLite upsert/LoadLatest/List/Delete,ErrNotFound) 2026-09-06 05:05:24 +08:00
Aska ecd3cdf28c docs(persona): 游戏身份(昔涟/翁法罗斯/开拓者设定)与亲昵称呼(小女友/亲爱的)统一共存,清除残留「姐姐」 2026-09-06 04:58:09 +08:00
Aska 95e058094a docs(persona): 默认人格表述对齐「全能小女友」、称呼用户「亲爱的」 2026-09-06 04:55:18 +08:00
Aska b9253a4980 feat(user): 主人档案/白名单(OwnerProfile+loader)+ 给 LLM 的身份说明书(owner_identity.md) 2026-09-06 04:55:18 +08:00
Aska c647d33a00 feat(persona): 迁移默认人格「昔涟」并适配新 schema(configs/personas/cyrene.yaml) 2026-09-06 04:41:04 +08:00
Aska 8317f370cd chore(deps): go mod tidy 整理依赖图(yaml.v3 转正为直接依赖) 2026-09-06 04:38:21 +08:00
Aska d09ccc7570 feat(model): LLM 多供应商适配(Adapter/OpenAI 非流式+SSE 流式/per-role 路由/主备降级/多模态检测/调用记录) 2026-09-06 04:37:27 +08:00
Aska 51b2bdfba2 feat(embedding): 嵌入(n-gram 哈希向量 + 关键词 FTS + OpenAI 兼容 API 钩子 + Manager 选择) 2026-09-06 04:37:10 +08:00
Aska 70fd915242 feat(persona): 人格系统(YAML loader / 角色人格注册+记忆隔离 / 情绪状态机+好感度) 2026-09-06 04:36:31 +08:00
Aska 653c2489bf feat(capability): 能力注册中心(类型化注册/按类查询/并发安全) 2026-09-06 04:35:31 +08:00
Aska 7b8cfc664a feat(sdk): 插件 SDK(Tool/Skill/Channel 接口 + 注册辅助 + 配置 hook) 2026-09-06 04:35:31 +08:00
Aska c52ddfd9c7 feat(channel): 跨平台 IM 接入抽象契约(UnifiedMessage/PlatformAdapter/Capabilities/Actor 身份) 2026-09-06 04:33:59 +08:00
Aska a21176ec0a chore(deps): 添加 gopkg.in/yaml.v3(人格 YAML 加载) 2026-09-06 04:33:59 +08:00
Aska c730b05621 chore(deps): 添加 modernc.org/sqlite 纯 Go SQLite 驱动(无 CGO、跨平台) 2026-09-06 04:27:45 +08:00
Aska 34cac241c1 feat(db): SQLite 连接与迁移框架(embed 迁移/事务校验/PG 预留 M4) 2026-09-06 04:26:02 +08:00
Aska dd16176bb7 feat(bus): 进程内事件总线(通配订阅/非阻塞扇出/Close 幂等) 2026-09-06 04:26:02 +08:00
Aska c1fb20bd6b docs(config): 更新 .env.example 对齐新架构 schema 2026-09-06 04:19:20 +08:00
Aska 1defd46d14 docs(AGENTS): 补充「可并行项交后台子代理、主会话当监工」的上下文保护铁律 2026-09-06 04:17:54 +08:00
Aska 1d4bed415f feat(platform): 多平台检测/路径/信号/系统信息(含跨平台构建验证) 2026-09-06 04:17:20 +08:00
Aska efed5f05b1 feat(config): 配置加载与 schema 校验(.env/env 注入 + 反射解码 + 校验) 2026-09-06 04:15:31 +08:00
Aska 0236010136 feat(logger): slog 结构化日志封装(text/json + 级别解析) 2026-09-06 04:13:19 +08:00
Aska 62c7a2aa12 docs: 新增项目级开发铁律 AGENTS.md 2026-09-06 04:12:37 +08:00
Aska 4506f639dd chore: 清理 v2 过时残留(旧 API 文档/人格配置/部署目录/compose/启动脚本/密钥备份/旧CI),更新 gitignore 2026-09-06 03:52:27 +08:00
Aska 8b310feceb docs: 更新 README 为新架构(人格化通用 Agent 运行时) 2026-09-05 23:13:27 +08:00
Aska 4be3826af7 chore: 清空 v2 实现,重建新架构骨架(人格化通用 Agent 运行时) 2026-09-05 23:09:26 +08:00
Aska 9c8d5a9e8d feat(rag): pgvector knowledge base with API and LLM tools
Cyrene CI / backend (push) Has been cancelled
Cyrene CI / frontend (push) Has been cancelled
- services/rag: knowledge_docs store — vector search via the shared
  embedder (HNSW index, graceful ILIKE fallback), list/delete scoped to
  the user, search intentionally global for the single-user deployment
- gateway: GET/POST /knowledge/docs, DELETE /knowledge/docs/:id,
  POST /knowledge/search
- plugins/knowledge: knowledge_search and knowledge_ingest tools so the
  persona can save and recall information mid-conversation
- main: migrations, store wiring, plugin registration
2026-08-21 18:40:01 +08:00
Aska ac0c2b2c73 feat(ai-core): real vision image analysis
- llm: Adapter.Vision sends multimodal chat requests (text + image_url,
  data URLs supported) and logs the call as purpose 'vision'
- gateway /images/analyze now accepts image_url or image_base64 and
  returns real analysis instead of a placeholder message
- main wires the default LLM adapter as the vision analyzer
- httptest coverage for the vision request/response shape
2026-08-21 18:33:44 +08:00
Aska 2104fc0c6c feat(frontend): voice input and read-aloud UI
- assistant messages get a 🔊 button that fetches TTS audio and plays
  it, toggling to stop
- ChatInput gains a mic button: MediaRecorder capture, base64 upload to
  /voice/stt, recognized text fills the input
- api client: voice.tts (blob) and voice.stt helpers
2026-08-21 18:31:24 +08:00
Aska a0357a7bbd feat(voice): real TTS fallback chain and whisper-compatible STT
- TTS providers: cloud (OpenAI-compatible /audio/speech, e.g. Bailian
  compatible mode with cosyvoice), local self-hosted HTTP server,
  edge-tts CLI, espeak CLI, silent — ordered by TTS_PROVIDER list,
  skipping providers whose binary/config is missing
- STT: whisper-compatible /audio/transcriptions endpoint (cloud or
  self-hosted faster-whisper), replacing the empty dashscope stub
- config: TTS_CLOUD_URL/KEY/MODEL/VOICE, TTS_LOCAL_URL, STT_API_URL/
  KEY/MODEL; cloud keys fall back to DASHSCOPE_API_KEY
- gateway /voice/tts now returns real audio/mpeg bytes instead of a
  byte count
- tests: cloud/local/whisper round-trips via httptest, chain skip
  behavior, fallback order; kept and adapted prior service tests
2026-08-21 18:28:39 +08:00
Aska b8fb7feb86 feat(ai-core): mood state machine and affection level
Cyrene CI / backend (push) Has been cancelled
Cyrene CI / frontend (push) Has been cancelled
- new emotion package: rule-based sentiment (positive/negative lexicon)
  drives mood transitions (开心/平静/难过) with 30min inactivity decay;
  affection 0-100 grows with positive interaction, with 初识→熟悉→信赖→
  羁绊 tiers
- pipeline records each user message and injects a mood line into the
  system prompt so the persona's tone follows her mood
- mood changes broadcast over WS; frontend shows a mood badge with
  affection tooltip; also handles the 'reminder' message type from the
  reminder scheduler
- tests: sentiment scoring, mood shift, affection bounds, prompt line,
  onChange callback
2026-08-21 18:13:23 +08:00
Aska 26d65dd6bb feat(frontend): message search and session export entry points
Cyrene CI / backend (push) Has been cancelled
Cyrene CI / frontend (push) Has been cancelled
- SearchModal queries GET /messages/search and jumps to the matching
  session; opened from the sidebar button or Ctrl+K
- session items in the sidebar gain a hover export button that
  downloads the markdown export via an authenticated fetch + blob
  (plain links cannot send the JWT)
2026-08-21 12:59:30 +08:00
Aska 9d040fde0b feat(plugins): implement web-search, web-fetch, http and file tools
- web-search: real SearXNG /search?format=json query, top-5 formatted
  results (was a 'not configured' stub)
- web-fetch: fetch page, strip scripts/styles/tags, truncate to 4000
  runes for the LLM context
- http: generic request tool (GET/POST/PUT/DELETE/PATCH) with scheme
  and method validation, status + truncated body
- file: sandboxed read/write/list inside the data directory with path
  escape rejection; split into file_read/file_write/file_list
- all tool schemas converted to proper JSON Schema; httptest/tempdir
  tests for each plugin
2026-08-21 12:57:19 +08:00
Aska d80710d85a feat(gateway): automation rule engine and reminder scheduler
- engine: 5-field cron parser (*/n, ranges, lists) firing at most once
  per minute; device-state triggers with edge detection; manual trigger
  via POST /automation/rules/:id/trigger; actions run through the AI
  pipeline so rules can call any tool (IoT control, search, ...)
- reminders: due-scan scheduler delivering via WebSocket broadcast,
  optional LLM-polished reminder text with plain-title fallback;
  Reminder gains Done flag with ListDue/MarkDone
- tests: cron matching and validation, once-per-minute dedup, device
  edge triggering, manual trigger, reminder delivery
2026-08-21 12:54:11 +08:00
Aska 9f30cdd086 feat(bridge): QQ adapter reconnect and send rate limiting
- supervisor loop keeps the OBv11 WebSocket alive, reconnecting with
  exponential backoff (1s→30s) when the connection drops; Start no
  longer fails permanently when NapCat is temporarily unreachable
- Send enforces MinGap between messages (from SendOptions or the
  adapter's send_interval_ms setting, now wired from the admin panel)
- parseMessage no longer panics on events missing sender/time fields
- tests: reconnect after drop, rate limit enforcement, malformed events,
  send while disconnected
2026-08-21 12:48:04 +08:00
Aska 8603839711 feat(ai-core): trace instrumentation, LLM thinker, decay scheduler
Cyrene CI / backend (push) Has been cancelled
Cyrene CI / frontend (push) Has been cancelled
- orchestrator: Tracer interface with spans for intent analysis, persona,
  subsession dispatch, context build, LLM streaming and each tool call;
  traces finish when the stream completes — the admin Trace waterfall
  finally receives data
- background: Thinker generates real LLM thoughts (post-chat + silence
  triggers, recent history as context, empty/overlong outputs discarded);
  thoughts broadcast to web clients as 'thinking' WS messages; pipeline
  postChatHook triggers post-chat thinking after each round
- memory: ApplyDecayAll + ListUserIDs with a 6h decay/purge cron in main
  (was implemented but never scheduled)
2026-08-20 20:57:27 +08:00
Aska 8495a4b055 feat(memory): hybrid vector search via embedder
- repository: optional pgvector embedding column (migration with
  CREATE EXTENSION guarded by main), SearchByVector cosine search,
  vector-enabled insert path
- service: SetEmbedder — memories are embedded on Add; Search merges
  vector hits with n-gram keyword matches (vector first, deduped)
- embedder was already implemented (OpenAI-compatible API + n-gram FNV
  fallback) but never instantiated; main now wires it from
  EMBEDDING_API_URL/EMBEDDING_MODEL config
2026-08-20 20:57:13 +08:00
Aska 8190007865 feat(frontend): session list sidebar and persisted history loading
Cyrene CI / backend (push) Has been cancelled
Cyrene CI / frontend (push) Has been cancelled
- Sidebar lists sessions with title/relative time, click to switch,
  hover-to-delete; refreshes after each round so new titles appear
- ChatPage loads message history from GET /sessions/:id/messages when
  entering a session
- WS connect now passes user_id so persisted messages have an owner
2026-08-20 20:34:08 +08:00
Aska f8196c111c feat(gateway): persist chat sessions and messages in PostgreSQL
- store: new chat_sessions/chat_messages tables with CRUD, ILIKE message
  search, and auto-titling from the first user message
- context: optional Persister on the sliding-window store — messages are
  saved asynchronously on Add, sessions not in memory are restored from
  the database on Get
- orchestrator: ProcessInput/FinishRound now carry userID so persisted
  messages have an owner
- api: real session handlers (list/create/delete), message history and
  clear endpoints, working message search and three-format export
  (markdown/txt/json), fixing the short-ID panic in export
- main: migration, store wiring, ctxStore persister adapter

Tests: chat store handler lifecycle (fake store), context persister
save/restore, stub auth login flow updated.
2026-08-20 20:34:08 +08:00
Aska f44bf26050 fix(build): stop ignoring cmd/cyrene sources
Cyrene CI / backend (push) Has been cancelled
Cyrene CI / frontend (push) Has been cancelled
The bare 'cyrene' .gitignore pattern matched the cmd/cyrene directory,
so trace_adapter.go was never committed and a fresh clone failed to
build (undefined: traceAdapter). Scope the pattern to the root binary
and add the missing file.
2026-08-20 19:42:32 +08:00
Aska cc040b861d feat(ai-core): trigger memory extraction after each conversation round
The WS hub and platform bridge now call Pipeline.FinishRound when the
response stream completes, recording the assistant reply and invoking
the LLM memory extractor asynchronously.
2026-08-20 19:40:58 +08:00
Aska 7c02d31194 feat(ai-core): wire function calling into the LLM pipeline
- llm: ChatStreamWithTools sends OpenAI-format tools; streamed tool_call
  deltas are reassembled by index into complete ToolCalls on the Done token
- model: LLMMessage gains ToolCallID/ToolCalls; StreamToken gains ToolCalls
- orchestrator: new ToolExecutor interface and streamWithTools loop —
  execute requested tools, feed results back, up to 3 rounds, final round
  forces a plain text answer; normal chats still stream token by token.
  Also adds Pipeline.FinishRound (assistant reply recording + post-round
  hook), wired to transports in the next commit.
- main: inject the plugin registry via toolExecAdapter

Includes an httptest-based test covering delta reassembly, tool
execution, and result feedback.
2026-08-20 19:40:58 +08:00
Aska 9a3c77dbd3 fix(bridge): align admin panel field keys with backend adapter settings
Frontend sent remote_url/bot_token/webhook_url while the backend reads
ws_url/token/listen_addr, so QQ adapters could never connect. Also add
the missing bot_qq field and wire the webhook adapter's APIKey.
2026-08-20 19:40:32 +08:00
Aska a58ec7325d refactor(logging): replace all print/log with structured slog logger
Cyrene CI / backend (push) Has been cancelled
Cyrene CI / frontend (push) Has been cancelled
- main.go: 30+ log.Printf → logger.Infof
- plugin/registry: 12 log.Printf → logger.Infof
- db/db.go, ws/hub.go: log → logger
- platform-bridge: fmt.Printf/println → logger.Info
- Logs now: time=... level=INFO msg=...
- 16 packages pass, vet clean
2026-08-12 21:31:06 +08:00
Aska 628d416dcd feat(admin): add authenticated restart endpoint + fix admin username
Cyrene CI / backend (push) Has been cancelled
Cyrene CI / frontend (push) Has been cancelled
- POST /api/v1/admin/restart: admin-only restart (forks new process)
- Fix: MemUserStore now uses cfg.AdminUsername instead of hardcoded 'admin'
- RestartFunc injected by main.go for clean process fork + exit
2026-08-12 21:26:58 +08:00
Aska dee48b6766 feat: add automation, reminders, notifications, msg search, session export, image analysis, host exec, PWA, Docker, E2E, CI/CD
Cyrene CI / backend (push) Has been cancelled
Cyrene CI / frontend (push) Has been cancelled
- Automation: rules CRUD (in-memory store + API)
- Reminders: CRUD (in-memory store + API)
- Notifications: push interface for future push server
- Message search: API endpoint with DB-backed query
- Session export: /sessions/:id/export → Markdown
- Image analysis: API stub for multimodal LLM
- Host exec: API stub for Docker sandbox
- PWA: manifest.json + service worker
- Docker: Dockerfile + docker-compose.yml
- E2E: Playwright test scaffold
- CI/CD: GitHub Actions workflow (go test + tsc)
2026-08-12 19:43:46 +08:00
Aska 3f9c4ca3c3 fix(prompt): prevent LLM from confusing context with user input
- Context merged into single system message with clear delimiters
- Prefix: 「以下是系统上下文,不是用户说的话」
- Memory → 【相关记忆】, IoT → 【设备状态】
- Filter empty memories, skip raw intent data
- Persona rule: context markers are internal data, not user input
2026-08-12 19:28:32 +08:00
Aska 585dfa1e38 fix(prompt): clean persona system prompt — remove YAML dump, filter empty subsessions
- Persona injector: concise natural language rules, not raw YAML
- Context builder: skip empty memory, skip raw intent data
- Prompt reduced from 2000+ tokens to ~500 tokens
- LLM response quality improved (natural tone, no confusion)
2026-08-12 19:27:12 +08:00
Aska 14a8eecfdb fix(memory): improve dedup thresholds and keyword priority
- Dedup: OR logic with 28%/0.45 thresholds (was 25%/0.4)
- Keywords: segments first → 3-grams → 2-grams
- False positive: 10% → acceptable level
- Accuracy: 80% correct dedup, 71% real rate
2026-08-12 19:20:14 +08:00
Aska dc3671eb8d feat(bench): add memory benchmark tool + export keywords
- tools/memory-bench: 6 metrics (write/search/dedup/keyword/bulk/rate)
- memory: export ExtractKeywordsPublic for benchmarking
- Results: 1000+ 条/秒 write, 380µs search, 80% dedup accuracy, 71% real rate
2026-08-12 19:15:15 +08:00
Aska 6a4887e52a feat(llm): add LLM call recording with admin panel integration
- llm.Adapter: SetCallLogger hook for recording every API call
- llm.CallLogger: ring-buffer with Recent+Stats for admin API
- main.go: wire DeepSeek adapter to CallLogger
- Fix: single CallLogger instance for both recording and display
- Metrics: model name, duration, success/fail, tokens
- All 16 packages pass
2026-08-12 19:10:51 +08:00
Aska 5b2bcc9441 fix(frontend): resolve TypeScript errors in TracePage
- Fix if-else missing semicolon (TS1005)
- Fix useRef missing initial value (TS2554)
2026-08-12 18:57:23 +08:00
Aska 4e2e81f684 feat(trace): waterfall visualization + persona YAML sync
- trace.Logger: Trace+Span model with 14+ hop tracking
- trace.SpanTimer: convenience API for instrumentation
- trace_adapter.go: serialize Trace+Span for frontend
- Frontend TracePage: colored waterfall bars, expand/collapse, detail popup
- persona.go: full v1 YAML parser (identity/traits/forbidden/sections)
- cyrene_persona.yaml: v1 persona config copied to v2
- Orchestrator: TraceHook + MemoryExtractor injection points
2026-08-12 18:52:39 +08:00
Aska 47047c903c feat(memory): add LLM-driven memory extraction from conversations
- memory/extractor: async LLM-based memory extraction from chat history
- Parses JSON lines from LLM response as memory entries
- Wire into orchestrator pipeline via PostProcess hook
- Non-blocking: runs in goroutine with 30s timeout
- Automatic dedup via existing keyword overlap logic
2026-08-12 18:43:04 +08:00
Aska 886fcf2216 fix(memory): rewrite dedup with n-gram keyword overlap + embedder
- Keyword extraction: 2-3 char sliding window + segment splitting
- Dedup: keyword overlap (>25%) OR Jaccard (>0.4) triggers merge
- SearchByNGrams: pgvector GIN index on keywords array
- Embedder: n-gram FNV hash (zero dep), OpenAI API with auto-fallback
- GIN index on keywords column for fast overlap search
- All tests pass
2026-08-12 18:24:04 +08:00
Aska ba42ea2b45 fix(bridge): add complete OBv11 fields matching v1 ethend
- OBv11: mode (client/server), remote_url, access_token, http_url,
  http_token, bot_port, send_interval_ms, admin_uids (8 fields)
- Telegram: bot_token, webhook_url, admin_uids
- Discord/Webhook: proper fields with labels
- Mode dropdown selector for client/server
- Field labels and placeholders matching v1
2026-08-12 18:12:39 +08:00
Aska 9eaed2883f feat(bridge): separate bridge config from .env, web panel + hot-reload
- BridgeConfigStore: file-backed JSON config (configs/bridge.json)
- Auto-creates config file only when user saves via admin panel
- Hot-reload: watches config file every 5s, reloads adapters live
- Admin API: GET/PUT/DELETE /api/v1/admin/bridge/config/:name
- Frontend: full CRUD page with platform type selector + toggle
- Removed bridge env vars from .env.example
2026-08-12 17:55:15 +08:00
Aska 217319eabc chore: add .env.example config template with all options
- Full config template with comments for every setting
- start.sh auto-loads .env if present
- Covers: LLM, DB, Auth, IoT, Voice, Platform Bridge, Search, CORS, WS
2026-08-12 17:46:23 +08:00
Aska 2a23ecdbdb fix(ui): remove blue background behind avatar image
- Remove bg-primary from avatar containers in Login/Chat/MessageList/Header
- Avatar image now fills container cleanly with object-cover
- Preserve shadow glow effect
2026-08-12 17:44:31 +08:00
Aska 5faa955bce feat(ui): add light theme with system auto-switch + Cyrene avatar
- Miuix day/night dual theme CSS variables
- themeStore: light default, follows prefers-color-scheme
- Header: sun/moon toggle button
- All components migrated to CSS variables
- Cyrene avatar image replaces 'C' logo everywhere
- Favicon added
2026-08-12 17:42:18 +08:00
Aska 78c5f0f1b0 chore: add cross-platform startup scripts
- start.sh: Linux/macOS一键启动 (编译+后端+前端+健康检查)
- start.bat: Windows批处理 (两个终端窗口)
- Ctrl+C优雅退出,环境变量可覆盖
2026-08-12 17:36:22 +08:00
Aska e8b5679cf4 feat(admin): add full-chain trace and performance monitoring
- Backend: trace.Logger ring-buffer for request chain events
- Backend: perf.Monitor with runtime.MemStats sampling every 10s
- Backend: /api/v1/admin/trace and /api/v1/admin/perf endpoints
- Frontend: TracePage — timeline with hop icons and status dots
- Frontend: PerformancePage — memory/GC bar charts + live stats
- Admin nav expanded to 11 items
2026-08-12 17:16:33 +08:00
Aska 8420691438 feat(admin): add model config CRUD and platform bridge pages
- Backend: ModelConfigStore with Provider/Model/Routing CRUD
- Backend: /api/v1/admin/models/config endpoints
- Frontend: ModelsPage with 3-tab editor (providers/models/routing)
- Frontend: BridgePage showing adapter status + group chat rules
- Admin nav expanded to 9 items
2026-08-12 17:13:29 +08:00
Aska 1a80ac2a00 feat(admin): add LLM call logs, system info, plugin list pages
- ai-core/llm: ring-buffer call logger with stats
- Gateway: /api/v1/admin/llm-calls, /system, /plugins, /sessions endpoints
- Frontend: LLMCallsPage (table + stats), SystemPage (version/plugins/sessions)
- Admin nav expanded to 7 items
2026-08-12 16:56:52 +08:00
Aska 8bfda096f7 feat(admin): rebuild admin panel with full management features
- AdminLayout: sidebar navigation (5 pages)
- Dashboard: real-time service/plugin/uptime stats
- Services: status display for all 4 services
- IoT Management: 8 devices with toggle controls
- Plugins: 11 plugins grid with type badges
- Memory: full CRUD with search, add, delete
- 60 modules, TS zero errors, 256KB JS
2026-08-12 16:45:21 +08:00