Commit Graph

7 Commits

Author SHA1 Message Date
h z
bd851f2b9d Merge pull request 'zhi-2026-04-18' (#1) from zhi-2026-04-18 into main
Reviewed-on: #1
2026-05-01 07:21:25 +00:00
zhi
6a70a68c7e fix: use parameters + content[] format per OpenClaw plugin spec
- inputSchema → parameters
- { result: text } → { content: [{ type: "text", text }] }

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-22 12:04:41 +00:00
zhi
76ac2e959a refactor: remove built-in routers
PrismFacet is a generic framework — routers are registered by
consumers (e.g., ClawRoles), not bundled with the plugin.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-21 10:35:28 +00:00
zhi
bee3dcb84c fix: correct routers/rules path resolution
pluginDir already points to the plugin install root, no need for ..

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 19:54:20 +00: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
zhi
c4a72b13c0 feat: PrismFacet core implementation
- Plugin scaffold: manifest, tsconfig, package.json
- Router loader with dynamic import + cache busting for hot reload
- Rule store: CRUD on rules.json
- Prompt injector: resolve routers → match rules → read files → inject
- MCP tool: prompt_rules (add/remove/list/test/reload-routers/list-routers)
- Built-in routers: agent-id (zero-dep), role, position (ego.json)
- before_prompt_build hook for system prompt injection

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 17:12:10 +00:00
zhi
3a36605238 init: PrismFacet project plan
Dynamic system prompt injection plugin for OpenClaw.
Routes agent context through configurable routers, matches
against registered rules, and injects prompt files.

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