mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-09-21 17:38:10 +00:00
- Add test OpenClaw plugins: oc-simple (openclaw.plugin.json) and oc-pkg (package.json#extensions) - Fix plugin.go Start() to detect package.json#openclaw.extensions as OC manifest - Add hasOCExtensions() helper for package.json OC field detection - Tests: simulator with manifest entry discovery, package.json extension discovery, full Plugin.Start() -> loadOCPlugin() -> register -> call pipeline
34 lines
874 B
JavaScript
34 lines
874 B
JavaScript
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 });
|
|
},
|
|
});
|
|
},
|
|
},
|
|
};
|