Commit Graph

2 Commits

Author SHA1 Message Date
4d7f7dc6c8 fix: declare prompt_rules tool in contracts.tools
Same class of bug as Meridian (zhi/Meridian#2), HarborForge.OpenclawPlugin
(zhi/HarborForge.OpenclawPlugin#6), and PaddedCell (already fixed in
787d88c). OpenClaw's plugin host requires that any tool registered via
`api.registerTool()` is also declared in `contracts.tools` in the
plugin manifest, or the tool is silently dropped from the agent's
available tool list. plugin doctor was warning:

  prism-facet: plugin must declare contracts.tools before registering
  agent tools

PrismFacet registers exactly one tool, `prompt_rules` (in
tools/prompt-rules.js). Declaring it in the manifest. Verified in sim
that with this change the warning disappears and the tool becomes
visible to agents.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 14:49:42 +01:00
zhi
d5c057a3f9 refactor: restructure PrismFacet per OpenClaw plugin spec
- plugin/ directory structure: hooks/, tools/, core/
- export default { id, name, register } entry format
- globalThis state management with lifecycle protection
- WeakSet dedup on before_prompt_build hook
- Tool uses inputSchema + execute (not parameters + handler)
- additionalProperties: false in config schema
- Core logic in plugin/core/ (no plugin-sdk dependency)
- Install/uninstall script (scripts/install.mjs)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 17:22:17 +00:00