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>
This commit is contained in:
zhi
2026-04-18 17:12:10 +00:00
parent 3a36605238
commit c4a72b13c0
15 changed files with 462 additions and 0 deletions

47
package-lock.json generated Normal file
View File

@@ -0,0 +1,47 @@
{
"name": "prism-facet",
"version": "0.1.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "prism-facet",
"version": "0.1.0",
"devDependencies": {
"@types/node": "^25.6.0",
"typescript": "^5.5.0"
}
},
"node_modules/@types/node": {
"version": "25.6.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.6.0.tgz",
"integrity": "sha512-+qIYRKdNYJwY3vRCZMdJbPLJAtGjQBudzZzdzwQYkEPQd+PJGixUL5QfvCLDaULoLv+RhT3LDkwEfKaAkgSmNQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"undici-types": "~7.19.0"
}
},
"node_modules/typescript": {
"version": "5.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=14.17"
}
},
"node_modules/undici-types": {
"version": "7.19.2",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.19.2.tgz",
"integrity": "sha512-qYVnV5OEm2AW8cJMCpdV20CDyaN3g0AjDlOGf1OW4iaDEx8MwdtChUp4zu4H0VP3nDRF/8RKWH+IPp9uW0YGZg==",
"dev": true,
"license": "MIT"
}
}
}