7 tools total now:
- dialectic_list_topics
- dialectic_topic_detail
- dialectic_propose_topic
- dialectic_signup
- dialectic_post_argument
- dialectic_submit_verdict (NEW — POST /api/topics/{id}/verdict)
- dialectic_view_verdict
Also added contracts.tools entry for the new tool, updated README +
startup log line. Sim smoke verified the other 4 (list/propose/signup/
detail) via direct plugin import; submit_verdict not yet smoke-tested
end-to-end (requires running through a full debate to debate_end_at).
Code path is identical to other write tools — bearer + JSON body +
shape-coerced response.
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
/**
|
|
* Dialectic — OpenClaw plugin entry.
|
|
*
|
|
* Tools: dialectic_list_topics, dialectic_topic_detail,
|
|
* dialectic_propose_topic, dialectic_signup,
|
|
* dialectic_post_argument, dialectic_submit_verdict,
|
|
* dialectic_view_verdict
|
|
*
|
|
* Loader gotchas (per [[reference-meridian-plugin-contract]]):
|
|
* - openclaw.plugin.json MUST declare `activation.onStartup: true`
|
|
* or this plugin is silently treated as lazy/on-demand and
|
|
* register() is never called.
|
|
* - Every tool name MUST appear in contracts.tools or the tool
|
|
* never surfaces to agents.
|
|
* - Plain `export default { id, name, register }` works in jiti
|
|
* (matches prism-facet); don't pull SDK helpers without
|
|
* `openclaw` actually being resolvable at runtime.
|
|
*/
|
|
|
|
import { registerDialecticTools } from './src/tools.js';
|
|
|
|
interface PluginApi {
|
|
logger: {
|
|
info(msg: string): void;
|
|
warn(msg: string): void;
|
|
error(msg: string): void;
|
|
};
|
|
on(hook: string, handler: (...args: any[]) => any): void;
|
|
registerTool(def: any): void;
|
|
config?: { backendUrl?: string };
|
|
}
|
|
|
|
export default {
|
|
id: 'dialectic',
|
|
name: 'Dialectic',
|
|
|
|
register(api: PluginApi) {
|
|
registerDialecticTools(api);
|
|
api.logger.info('[dialectic] plugin registered');
|
|
},
|
|
};
|