Commit Graph

114 Commits

Author SHA1 Message Date
3a5f548326 fix(clawhubadapter): manager CLI improvements, pysimulator updates, sidecar fixes 2026-07-23 13:54:04 +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
9b4d0cb50d feat(clawhubadapter): rename plugin tools, universal uninstall; feat(mcp): add dynamic server management; feat(prompt): long-task guidance 2026-07-22 17:32:45 +08:00
bd0f84c1f7 fix: deduplicate assistant content in multi-tool turns to prevent premature loop exit
- process.go: only emit resp.Content on the first tool call per batch,
  subsequent assistant messages use empty content (serialized as null)
- provider.go: MarshalJSON outputs null content when empty with tool_calls
  to comply with DeepSeek/OpenAI expected format
- output.go: update parameter interface (payload/type/meta) to match
  tool definitions (uncommitted from previous refactor)
2026-07-22 17:05:13 +08:00
85992902d9 refactor: split agent.go into 12 files + add mcp_restart_server tool 2026-07-22 15:40:27 +08:00
76a4619ed5 refactor: rename openclaw -> clawhubadapter, add ClawHub search/install, fix agent interrupt
- Rename internal/plugins/openclaw/ -> internal/plugins/clawhubadapter/
- Add RegistryDispatcher with 5 sub-registries (Tool, Provider, Channel, Stage, Cap)
- Add clawhubadapter_search tool for ClawHub marketplace search
- Add clawhub: prefix support for installing from ClawHub (ZIP/tgz auto-detect)
- Add CallProvider RPC and provider/call routing
- Fix QQ interrupt: check interceptCh before/after each tool execution
2026-07-21 22:47:14 +08:00
906d117bdd feat: add cfgmgr built-in plugin 2026-07-21 21:07:37 +08:00
23082fa92d chore: remove local replace directive for homeagent-sdk 2026-07-21 17:58:04 +08:00
54fa2ca93d fix: merge os.Environ() with custom env in NewStdioTransport 2026-07-21 12:45:26 +08:00
cfb4b72587 fix: CORE_REGISTER_TOOL fallback to raw string on unmarshal error
Previously the wrapper silently ignored json.Unmarshal errors and returned
nil, causing tools returning raw JSON strings (via C ABI bridge's
json.Marshal) to appear as empty map[] to the agent.
2026-07-20 17:51:56 +08:00
aa0f0ad8ea fix: NSIS File paths relative to script dir (package/ -> ../build/) 2026-07-20 12:44:33 +08:00
3a3149b2e2 feat: add initconfig + setup.sh to Linux packages, combine tar.gz 2026-07-20 12:24:03 +08:00
e9e2e6b823 delete: Delete file 审查.md
Signed-off-by: JianFeeeee <2198972886@qq.com>
2026-07-20 11:04:20 +08:00
4b0f2f332a feat: Linux packaging, SDK v0.7.1, fix rawmode conflict
- go.mod: SDK pseudo-version -> v0.7.1 (remote tag), go.sum updated
- cmd/waiter/rawmode_linux.go: remove (conflicts with raw_unix.go)
- cmd/gui/package.json: add rpm/AppImage Linux targets
- package/package-linux.sh: cross-distro packaging script (deb/tar.gz/rpm)
- package/linux/: DEBIAN control files, postinst/prerm, RPM spec
2026-07-20 11:03:43 +08:00
5002f00bb7 remove toolchain.nsi — belongs in SDK repo 2026-07-19 23:48:28 +08:00
0edd7c0b47 feat: Windows NSIS installer, embedded icons, GUI auto-launch backend
- Add package/installer.nsi (Full/Server/Client) and toolchain.nsi
- Embed icon.ico (rounded corners) into homed.exe/waiter.exe via .syso
- GUI auto-launches homed.exe from parent dir (Windows only)
- GUI fallback connections.json from app resource dir
- Add initconfig command for config.db seeding
- Replace waiter rawmode* with raw_{unix,windows,other}.go
- Fix .gitignore: /homed instead of homed, add login.json
- Update icon.svg with rounded rect, new mascot.svg
2026-07-19 23:46:16 +08:00
7609c39191 fix(webui,gui): terminal/cmd count badge ID mismatch 2026-07-19 14:52:17 +08:00
4495447b85 fix(document memory): dedup graph sync, filter terminal output from archive, add min relevance threshold 2026-07-19 14:21:04 +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
22c62e26ff fix: waiter Ctrl+C not responding in interactive mode
rawmode_linux.go only cleared ICANON|ECHO but left ISIG enabled,
so the terminal driver caught Ctrl+C and generated SIGINT.
signal.Notify caught the SIGINT but no goroutine consumed the
channel, effectively swallowing the signal.

Fix: also clear ISIG so Ctrl+C is delivered as byte 0x03,
which the line editor handles with os.Exit(130). Also set
VMIN=1, VTIME=0 for proper blocking read behavior.
2026-07-19 12:25:21 +08:00
9cc8176a53 fix: waiter Chinese input garbled — decode UTF-8 multi-byte sequences
editor.go read bytes one at a time; byte &gt;= 0x20 was treated as
a single rune, so multi-byte UTF-8 chars (Chinese, emoji, etc.)
became garbled. Add decodeRune to reassemble multi-byte sequences
from the raw byte stream.
2026-07-19 12:21:03 +08:00
4e13bbba5e fix: use platformBinaries for bundle skip (keep main.lua/SKILL.md) 2026-07-19 12:12:11 +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
c7209b9861 feat: add package/build.sh cross-platform build script
- build.sh supports linux/amd64, linux/arm64, darwin/amd64, darwin/arm64,
  windows/amd64, and 'all' for matrix build
- Components: homed (CGO, Linux/macOS-only), waiter (all platforms), gui
- Platform matrix documented in script header
- waiter: extract setRawMode into rawmode_linux.go + rawmode_other.go for
  cross-platform support
- Add cmd/gui/node_modules/ and dist/ to .gitignore
- Fix .gitignore waiter pattern to not ignore cmd/waiter/ directory
2026-07-19 11:40:14 +08:00
24698e7c82 fix: include openclaw manager/pysimulator sources, remove from gitignore
manager/main.js, pysimulator/main.py, and simulator/main.js are
production source files for the OpenClaw sidecar system, not build
artifacts. Remove them from .gitignore so fresh clones can make build
without manual stub creation.
2026-07-19 11:07:18 +08:00
7601a2970f docs: update output channel interface (payload/meta/type) in architecture docs 2026-07-19 10:35:25 +08:00
8ae1d19869 refactor: output channel interface (payload/meta/type) + memory fixes
- Redesign output_send__ tools: content JSON string -> structured
  payload/meta/type params for LLM reliability
- executeOutputSendTool: route by type with capability check
- executeOutputSendHelp: show meta format + type enum
- Updated system prompt rules for new interface
- docToTriples: use jieba exact mode adjacent co-occurrence
- Unify vector space: Doc.Vector field, ContextToDoc vectorizer,
  ReindexWithVectorizer on startup
2026-07-19 10:29:21 +08:00
9b3a751d98 fix: correct system prompt — remove misleading auto-reply statement, agent must use output_send__ tool 2026-07-18 21:28:59 +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
2cc600121c docs: 品牌吉祥物→看板娘 2026-07-17 21:54:04 +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
69ceedf0ab feat: register embedding_model_path in ConfigRegistry instead of JSON config
- Add core.agent.embedding_model_path to seedDBValues and seedCoreDefs
- Wire cfgReg.GetString in main.go to AgentConfig.EmbeddingModelPath
- Follow existing core.agent.* ConfigRegistry pattern
2026-07-17 21:07:54 +08:00
7892d7b0f2 feat: multi-language embedding with CleanTemplateText + three-branch vector strategy
- StaticEmbedder: pre-trained ConceptNet Numberbatch/fastText word embeddings,
  auto-download with TF-IDF fallback, comma-separated multi-model paths
- CleanTemplateText: regex stripping of QQ tool call templates and noise
- textForVector: per-source vector strategy (agent→Response, user→Input,
  cold_storage→both)
- Indexer.BuildContext and ExtractKeywords now clean input before vectorization
- Protect recent 10 events in Prune (regression fix: use local var not const)
2026-07-17 21:02:35 +08:00
d2aec1fd5f feat(gui): add electron-packager for app bundling 2026-07-17 12:56:31 +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
724febf7b4 fix: remove closure-captured h.api, use stateless pluginMap lookup
- Replace invokeTool/invokeOutput/invokeStage callbacks with standalone
  functions pluginInvokeTool/pluginInvokeOutput/pluginInvokeStage
- Case 1: sync tool invocation (not async - LLM needs return value)
- Case 2/3: use pluginID + pluginMap lookup instead of closures
- Store ps.api in pluginState for direct C function calls
2026-07-17 09:59:17 +08:00
a00198a9b0 feat: complete SDK dispatch - all methods implemented (32-41)
- DocMemory: Insert/Remove/Stats dispatch (32-34)
- Knowledge: Add/List dispatch (35-36)
- LLM: CurrentSource dispatch (37)
- Social: GetTrait/GetRelations/ListPersons dispatch (38-40)
- TextMemory: Append dispatch (41)
- EventBus: subscribe stub (not wired for external plugins)
- All bridge template stubs replaced with real dispatch calls
2026-07-17 09:46:33 +08:00
babef149b5 fix: comprehensive dispatch fixes
- go_core_dispatch case 1: tool handler now calls back to plugin via invokeTool
- go_core_dispatch case 2: stage handler sends full StageContext (11 fields)
- New dispatch methods 26-31: Settings.GetCore/SetCore/ListCore/GetPlugin/SetPlugin/ListPlugin
- Remove dlclose (plugin goroutines may still be running after Stop)
- invokeTool/invokeOutput/invokeStage callbacks with proper error handling
- Fix n2 unused variable
2026-07-17 09:33:53 +08:00
f9fe852ded fix: RegisterOutputChannel and RegisterStage now route through plugin callbacks
- go_core_dispatch case 2/3 no longer stub - real callbacks to plugin
- pluginState.invokeOutput/invokeStage call plugin's go_invoke_output/stage
- OutputChannel registration via IOManager.RegisterDevice
- Stage handler registration via PluginSDK.RegisterStage
2026-07-17 09:26:46 +08:00
1624c57867 fix: CoreAPI lifecycle - don't FreeCoreAPI until Stop
- Move FreeCoreAPI from defer in Start() to Stop()
- Call handle.Stop() before freeing resources
- This prevents SIGSEGV from plugins accessing freed CoreAPI memory
- Plugin's Go bridge code is safe (no C memory bugs)
2026-07-17 09:21:50 +08:00
9ca793e66d feat: C ABI plugin loader with full CoreAPI dispatch
- internal/plugin/cabi/: dlopen + dlsym for plugin_init
- create_core_api(): C struct with dispatch_bridge→go_core_dispatch
- go_core_dispatch routes all 25 SDK methods (RegisterTool, MemoryAPI, etc.)
- dynamic.go: cabiPlugin uses CreateCoreAPI(sdk)→Start(corePtr)
- Each plugin gets a unique ID stored in CoreAPI.ctx
- C functions moved to loader.c to avoid cgo duplicate symbol issues
2026-07-17 08:54:45 +08:00
277a29a786 feat: C ABI plugin bridge for Linux c-shared plugins
- New internal/plugin/cabi/ package: dlopen + dlsym loader
- plugindev: generates z_entry.c + z_bridge_gen.go for c-shared builds
- plugindev: replaces -buildmode=plugin with -buildmode=c-shared
- Go bridge uses mock SDK during Start(), core discovers registrations
- PluginAPI: init/start/stop + invoke_tool/stage/output + get_tool_defs/stages/channels
- ha_dispatch: single C function handles all plugin→core calls via method ID
- tryLoadSO: tries C ABI first, falls back to Go plugin.Open
- All example plugins updated (main.go removed, plg.json targets updated)
2026-07-17 08:11:26 +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