Files
HomeAgent/internal/plugins/openclaw/testdata/oc-simple/index.js
root f68c8fff16 fix: complete OpenClaw plugin compatibility with test coverage
- 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
2026-07-04 13:46:15 +08:00

32 lines
734 B
JavaScript

module.exports = {
default: {
id: 'oc-simple',
name: 'OC Simple',
version: '1.0.0',
description: 'Simple test plugin for OpenClaw simulator',
register(api) {
api.registerTool({
name: 'greet',
description: 'Greet someone',
parameters: {
type: 'object',
properties: {
name: { type: 'string', description: 'Name to greet' },
},
required: ['name'],
},
execute(id, params) {
return `Hello, ${params.name}!`;
},
});
api.registerTool({
name: 'ping',
description: 'Health check ping',
execute(id, params) {
return 'pong';
},
});
},
},
};