mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-10-03 15:53:56 +00:00
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
This commit is contained in:
33
internal/plugins/clawhubadapter/testdata/oc-pkg/lib/entry.js
vendored
Normal file
33
internal/plugins/clawhubadapter/testdata/oc-pkg/lib/entry.js
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
module.exports = {
|
||||
default: {
|
||||
id: 'oc-pkg',
|
||||
name: 'OC Package',
|
||||
version: '2.0.0',
|
||||
description: 'Test plugin discovered via package.json extensions',
|
||||
register(api) {
|
||||
api.registerTool({
|
||||
name: 'add',
|
||||
description: 'Add two numbers',
|
||||
parameters: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
a: { type: 'number', description: 'First number' },
|
||||
b: { type: 'number', description: 'Second number' },
|
||||
},
|
||||
required: ['a', 'b'],
|
||||
},
|
||||
execute(id, params) {
|
||||
return String(params.a + params.b);
|
||||
},
|
||||
});
|
||||
|
||||
api.registerTool({
|
||||
name: 'info',
|
||||
description: 'Return plugin info',
|
||||
execute(id, params) {
|
||||
return JSON.stringify({ id: this.id, name: this.name, version: this.version });
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user