8a1a7df406
docs(plugin-arch): 外部插件多进程化适配计划(修改→审查→验证三步微循环)
...
7 个 Part,每 Part 一个微循环:
- Part 0 脆弱基线先行(11.1/11.3/11.6,现网止血,不依赖迁移)
- Part 1 加载分派骨架(entry 双通道共存,可回退前提)
- Part 2 子进程通道原型(spawn/JSON-RPC/procPlugin,参考 sidecar.go)
- Part 3 plugindev 工具链改造(.bin 产物,SDK 仓)
- Part 4 共享内存数据面(StageContext 并发改写,最高风险)
- Part 5 通知面(EvtRing + eventfd,post-and-forget)
- Part 6 迁移收尾(17 插件 + 删 cabi + 权限显式化)
每 Part 含修改对象/审查要点/验证标准 + 13 项最终验收 + 风险回退表
2026-08-31 12:01:11 +08:00
fa99f6b4eb
docs(plugin-arch): 外部插件接口不变矩阵(多进程化整改基线 v1)
...
钉死「暴露给外部插件的接口不变」约束的合同面:
- 合同面A: 公开SDK类型/接口(sdk/plugin.go等,纯Go无cgo)
- 合同面B: bridge 51个method id ↔ SDK方法映射表(RPC平移清单)
- 合同面C: StageContext 跨ABI 10字段 → 共享内存16字段(能力扩展)
- 外部插件实测触达面 ⊆ 公开SDK合同面(接口不变成立的依据)
- 迁移后新获得能力/刻意不给项/检查点
2026-08-31 11:52:31 +08:00
304cad0648
docs(plugin-arch): 归档插件架构迁移评估 + plan 第11节整改计划
...
- docs/zh/架构迁移评估.md: C ABI→子进程+共享内存完整迁移论证(1621行)
- docs/zh/experiments/: 18项可复跑可行性实验(架构评估的所有数字来源)
- plan.md §11: 11.1~11.9 插件架构缺陷修复清单(唯一权威编号)
- main 保持干净,本批次为 update 特性分支的整改起点
2026-08-31 11:45:52 +08:00
bc9ef15eb0
三层回退恢复机制(L0写前留档/L1恢复梯子/L2离线回滚)+ guard 父守护
...
- L0: files 插件写受保护系统路径(/etc 等)前自动留档,AbstractBeforeWrite 到 data/file_baseline
- L1: failback 受限 worker 执行恢复梯子 probe→还原DNS/proxy→还原LLM配置+ReloadFromConfig→probe,N轮有界
- L2: tracker changeset 持久化原文 blob,guard 离线 RollbackFromDisk 回滚 agentfs;SystemSnapshot 支撑
- guard 父守护: 心跳 IPC(PING/ACK unix socket, 文件心跳回退)、失败计数、退出码协议(42/43/44)、最后手段
- 发行版路径适配: system.protected_paths/network_paths 可注入,默认面向主流 Linux
- Windows 兼容: guard.go/failback.go 加 //go:build linux, guard_windows.go 提供 no-op 桩
- 修复: guard.yaml last_resort 键冲突、changeset Content 不落盘导致离线回滚丢原文
Build 全绿, vet 干净, system/recovery/ipc/tracker 单元测试全过
2026-08-05 16:00:08 +08:00
dbbd73b930
refactor: migrate built-in plugins to SDK-only interface
...
- Six-phase plan complete: webui/cli/healthcheck/pluginmgr/clawhubadapter
now interact with the kernel exclusively via internal/sdk interfaces;
all Configure() calls and package-level global injection removed
- buildSDK in internal/plugin/registry.go is the single assembly point
- Add internal/sdk/events.go exporting event types/constants
- Fix ProviderManager cooldown sharing: LuaAdaptedProvider.Name() now
returns the source name instead of lua_<adapter>, so multiple sources
sharing an adapter (single script load via shared VM AdapterCache) no
longer share failure-cooldown state
- Verified: build/vet/tests green, deployed to homeagent.service with
full plugin capability testing via local OpenAI-compatible mock
2026-08-01 12:17:17 +08:00
2c5f9ff262
v0.7.2: 根目录清理 + Agent 心跳重构 + 内嵌 ONNX 模型
...
- 根目录清理: branding/docs/knowledge -> assets/, package/tools/deploy -> deploy/
- meta.go: Version 0.7.2, SDKCompatibleVersion 语义改为最高兼容
- Makefile: 版本回退 0.7.2
- registry.go: 系统提示词改用 meta.Version 格式化
- Agent 心跳: reorgGraph 拆分为三个独立循环(archive/merge/review),各自可配间隔
- GraphDB: 新增 sentences 表 + 关系句子溯源 + ClearSentenceID + CleanupOrphanedSentences
- Knowledge: 支持词嵌入向量化器
- NLP 四阶段流水线: Parse -> Extract -> Verify -> Fuse + SentenceRef
- 移除远程 HTTP 解析器(remote_parser.go)
- 新增内嵌 ONNX 模型(vocab + dep_parser.onnx):
+build onnxruntime: 全量 ONNX Runtime 推理
!build onnxruntime: 内嵌词表规则式降级解析器
- config: core.agent.onnx_model_path 替代 dep_parser_url
2026-07-28 09:56:26 +08:00
1cb3e87dde
feat: 完整实现 NLP 三元组提取系统 + token budget 上下文分配
...
- 重写 extractor.go: 分句、17条 POS 模板、依存模板 + COO 链、ATT合并
- parser.go: 分句循环 + TransE 向量验证(h+r≈t)
- fallback.go: jieba POS 降级解析器
- bridge.go: nlp.Triple ↔ memory.Triple 转换
- pipeline.go: extractKeyTriples 改用 NLP 提取器, 删除5条旧前缀规则
- distill.go: docToTriples 改用 NLP 提取器
- reorgGraph: 语义相似度增强检测, 保持纯 LLM 决断
- Provider 接口加 MaxContextTokens() + 模型窗口映射表
- tokenbudget.go: 中文 token 估算器 + budget 分配(80%利用率)
- process.go/buildSystemPrompt: 按 token 预算截断 memory+timeline
2026-07-27 15:26:23 +08:00
31664a7853
feat: NoMemory/Cleaner memory system + doc update
...
- _sdk_local/ removed (moved to standalone sdk repo)
- internal/agent/core: NoMemory/Cleaner data-flow breakpoints
- internal/memory: clean_text, document store refactor
- internal/plugin/registry.go: plugin API alignment
- docs: PLUGIN_DEV.md, ARCHITECTURE.md NoMemory/Cleaner docs
- plan.md, review.md: status update
2026-07-25 11:17:31 +08:00
097c8e80b7
docs: revise architecture docs for academic rigor and source-code accuracy
...
- Rewrite 体系结构原则/Architectural Principles section with precise
implementation details from source code (3-way eventLoop select,
StageHost parallelism, provider ordered fallback, recency bias)
- Document shared StaticEmbedder vector space between Context and Document
- Remove marketing tone, OS analogy table, and mascot emoji separators
- Remove contrastive sentence patterns (而非/not...but/rather than)
- Align terminology with actual implementation across all 6 doc files
2026-07-24 12:12:37 +08:00
659545069a
docs: update file references after agent.go split (process.go, eventloop.go, distill.go)
2026-07-22 17:34:35 +08:00
85992902d9
refactor: split agent.go into 12 files + add mcp_restart_server tool
2026-07-22 15:40:27 +08:00
c1d14681bf
docs: sync PLUGIN_DEV.md with SDK toolchain updates
...
- Fix project structure: remove main.go, add auto-generated bridge files note
- Clarify plg.json (targets) vs plugin.json (entry/platforms) distinction
- Add --bundle multi-platform build section
- Add plugindev sdk version management subcommands
- Update entry point section: NewPlugin is in plugin.go, no separate main.go
- Sync zh and en versions
2026-07-19 12:32:56 +08:00
4da2ad5376
feat: multi-platform .hmap bundle + platform auto-selection
...
- PluginManifest: add platforms field declaring supported OS
- validatePackage: accept bundle .hmap with platform-aware binary check
- extractPackage: extract only current OS binary, skip others (macOS renames .dylib → .so)
- installFromPath/installFromURL: path install keeps source, URL install auto-cleanup
- cabi/loader.go + dynamic.go: add linux/darwin build constraints for Windows cross-compile
- dynamic_loader_unix/windows: split SO loading with proper build tags
- package/build.sh: enable windows/amd64 for homed, add CXX export for arm64
- tryLoadSO: fallback to plugin.dylib on macOS
- docs: update PLUGIN_DEV.md for bundle format and install methods
2026-07-19 12:01:35 +08:00
7601a2970f
docs: update output channel interface (payload/meta/type) in architecture docs
2026-07-19 10:35:25 +08:00
c70c95d6d9
docs: restore bili entry, update browser to web+webfetch merge only
2026-07-18 21:11:18 +08:00
bfa6d4854a
docs: replace web/webfetch/bili with merged browser plugin in example tables
2026-07-18 21:06:56 +08:00
719eb11078
docs: 恢复内置插件中断投递 API 文档
...
PLUGIN_DEV.md 第二节保留公开 API (InjectText/InjectInterruptText/InjectTextNoMemory),
第四节新增"输入投递(内置插件)"小节展示 InjectInput/InjectInterrupt/InjectInputSync 等
内置插件专属方法,附注说明区分外部与内置插件 API 边界。
2026-07-18 20:48:54 +08:00
c9e67d3d55
docs: 修正全部文档使其与源码实现一致
...
主仓库:
- 修复 4 份英文文档语言切换链接指向错误 (../zh/ → ../en/)
- ARCHITECTURE.md 标题 "三种加载方式" → "四种加载方式" (实际表格4行)
- PLUGIN_DEV.md 示例表: 添加 webfetch, 移除不存在的 luaplugintest/testlua
- PLUGIN_DEV.md 代码示例: InjectInput/InjectInterrupt → InjectText/InjectInterruptText
- PLUGIN_DEV.md 代码示例: Memory/Knowledge/LLM/Events 接口签名修正
- PLUGIN_DEV.md .hmap 内容统一, plugindev 编译去除 .exe 后缀
SDK 仓库:
- Plugin.Start(sdk *PluginSDK) 接口签名改为指针
- 方法表重写: 移除 CallLLM/QueryKnowledge/SetMemory 等不存在方法
- IOInjector 参数顺序修正为 (source, channel, text)
- 删除虚构 SDKConfig, 替换为实际 New() 构造函数签名
- .hmap 内容描述一致化
修正前一次会话中的 QQ/Bili 插件问题:
- qq napcat() 超时, fetchBotInfo 竞态, handleWebhook 同步阻塞
- bili CDN 直连失败, 添加 HTTP_PROXY 代理
2026-07-18 20:46:58 +08:00
f9ea80abbf
docs: update sequence diagram, memory flow, vectorization strategy for StaticEmbedder + CleanTemplateText + three-branch vector
2026-07-17 21:51:03 +08:00
3c441649c9
docs: mascot before each section heading in tutorial docs
2026-07-17 21:44:15 +08:00
10638f1308
feat: mascot integration - WebUI/GUI icons, chat avatar, system prompt, docs
2026-07-17 21:41:03 +08:00
3cad4b635f
RegisterStage: add scope parameter, remove RegisterStageOwnTools
...
- SDK: RegisterStage(stage, handler, scope...) with StageScopeGlobal/StageScopeOwnTools
- Delete RegisterStageOwnTools, migrate cmd and qq plugins
- Internal SDK: add StageScope alias
- Docs: update all zh/en docs for C ABI buildmode and stage scope
- C ABI: fix nil errorOut in Handle.Start/Handle.Stop (SIGSEGV fix)
- C ABI header: add dispatch IDs 26-45 for Settings/Doc/Knowledge/LLM/Social/TextMemory
2026-07-17 11:25:54 +08:00
8c6c8e71d2
docs: graph memory uses jieba keyword extraction via ExtractKeywords
...
- Indexer uses dual recall: char-bigram TF-IDF vector search + jieba keywords
- Document layer: char-bigram TF-IDF + jieba keyword extraction
- Memory Indexer description: add jieba keyword extraction
2026-07-17 07:04:05 +08:00
fb2a02af22
docs: update vectorization algorithm - LocalWordEmbedder (jieba + TF-IDF + PMI co-occurrence)
...
Context layer uses LocalWordEmbedder not plain TF-IDF:
- jieba segmentation, TF-IDF weights, sliding window PMI co-occurrence
- Document/Indexer layers still use char-bigram TF-IDF (TFIDFVectorizer)
- Add 'protect last 10 events' detail to Context pruning description
2026-07-17 07:02:53 +08:00
dd01388e76
docs: fix documentation-source mismatches across all doc files
...
- Go version: 1.19+/1.21+ → 1.25+ (matches go.mod)
- document/doc.go → document/document.go (actual filename)
- PluginSDK: 3 channels → 4 channels (add RegisterOutputChannel)
- InjectInput/InjectInterrupt: 3 params → 4 params (add eventType)
- RegisterChannel: document agentIO.Device interface requirement
- Architecture: remove non-existent snapshot/tokenizer dirs, add skill/meta
- Architecture: fix double internal/internal/sdk, fix Jaccard threshold
- Adapter: add http_get/http_post Lua VM built-ins
- Knowledge: 4-layer → 3-layer memory, CGO for go-sqlite3 not overlayfs
- Code structure tree: fix sdk/ and lua/adapters/ path consistency
2026-07-16 23:17:55 +08:00
f93b5eccb6
docs: update for v0.7.1 - output channels, restricted API, LLM chain event
2026-07-16 18:54:20 +08:00
c7e22fbe30
refactor: move webui.listen_addr from core.daemon to webui category
2026-07-14 11:22:46 +08:00
28dc095dc5
feat: 实现多语言文档架构
...
- 创建 docs/zh/ 和 docs/en/ 目录结构
- 迁移文档至多语言目录,添加中英文切换链接
- 创建 README_EN.md 英文版本
- 更新 README.md 添加语言切换链接
- 删除旧文档和临时文件
2026-07-13 23:29:35 +08:00