Commit Graph

2 Commits

Author SHA1 Message Date
JacobZyy 0a20844bd4 fix: address PR #4180 review - security, typing, and test coverage
- Apply mcp_env_allowlist to plugin hooks: intersect HTTP allowedEnvVars
  with MCP allowlist, set command allowedEnvVars to full MCP allowlist
- Scrub process.env in executeHookCommand when allowedEnvVars provided
- Add PluginHooksState class with per-directory Map storage
- Add PluginHooksConfig interface for typed boundary layer
- Pass directory context through hook-config-handler
- Add 16 tests across 4 files (40 assertions) covering allowlist
  filtering, env scrubbing, directory isolation, and edge cases
- Remove unnecessary 'as' type assertions, use discriminated union
  narrowing instead
2026-05-20 22:30:25 +08:00
YeonGyu-Kim 598a4389d1 refactor(core): split index.ts and config-handler.ts into focused modules
Main entry point:
- create-hooks.ts, create-tools.ts, create-managers.ts
- plugin-interface.ts: plugin interface types
- plugin/ directory: plugin lifecycle modules

Config handler:
- agent-config-handler.ts, command-config-handler.ts
- tool-config-handler.ts, mcp-config-handler.ts
- provider-config-handler.ts, category-config-resolver.ts
- agent-priority-order.ts, prometheus-agent-config-builder.ts
- plugin-components-loader.ts
2026-02-08 16:25:25 +09:00