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>
This commit is contained in:
zhi
2026-04-18 17:22:17 +00:00
parent c4a72b13c0
commit d5c057a3f9
17 changed files with 502 additions and 306 deletions

View File

@@ -2,10 +2,10 @@
"name": "prism-facet",
"version": "0.1.0",
"type": "module",
"main": "dist/index.js",
"scripts": {
"build": "tsc",
"watch": "tsc --watch"
"build": "tsc --project tsconfig.plugin.json",
"install-plugin": "node scripts/install.mjs --install",
"uninstall-plugin": "node scripts/install.mjs --uninstall"
},
"devDependencies": {
"@types/node": "^25.6.0",