openclaw/src/hooks
fuller-stack-dev 235908c30e
fix: support multi-kind plugins for dual slot ownership (#57507) (thanks @fuller-stack-dev)
* feat(plugins): support multi-kind plugins for dual slot ownership

* fix: address review feedback on multi-kind plugin support

- Use sorted normalizeKinds() for kind-mismatch comparison in loader.ts
  (fixes order-sensitive JSON.stringify for arrays)
- Derive slot-to-kind reverse mapping from SLOT_BY_KIND in slots.ts
  (removes hardcoded ternary that would break for future slot types)
- Use shared hasKind() helper in config-state.ts instead of inline logic

* fix: don't disable dual-kind plugin that still owns another slot

When a new plugin takes over one slot, a dual-kind plugin that still
owns the other slot must not be disabled — otherwise context engine
resolution fails at runtime.

* fix: exempt dual-kind plugins from memory slot disablement

A plugin with kind: ["memory", "context-engine"] must stay enabled even
when it loses the memory slot, so its context engine role can still load.

* fix: address remaining review feedback

- Pass manifest kind (not hardcoded "memory") in early memory gating
- Extract kindsEqual() helper for DRY kind comparison in loader.ts
- Narrow slotKeyForPluginKind back to single PluginKind with JSDoc
- Reject empty array in parsePluginKind
- Add kindsEqual tests

* fix: use toSorted() instead of sort() per lint rules

* plugins: include default slot ownership in disable checks and gate dual-kind memory registration
2026-03-31 10:06:48 +05:30
..
bundled docs: fix hook load order, command event payload, and session-memory confirmation 2026-03-22 21:09:36 +00:00
bundled-dir.ts
config.ts refactor(hooks): unify hook policy resolution 2026-03-22 09:59:51 -07:00
fire-and-forget.test.ts refactor: unify message hook mapping and async dispatch 2026-03-02 22:51:28 +00:00
fire-and-forget.ts refactor: unify message hook mapping and async dispatch 2026-03-02 22:51:28 +00:00
frontmatter.test.ts
frontmatter.ts refactor(core): extract shared dedup helpers 2026-03-07 10:41:05 +00:00
gmail-ops.ts refactor(cli): separate json payload output from logging 2026-03-22 23:19:17 +00:00
gmail-setup-utils.test.ts
gmail-setup-utils.ts
gmail-watcher-errors.ts perf: extract lightweight runtime seams 2026-03-22 05:03:10 +00:00
gmail-watcher-lifecycle.test.ts
gmail-watcher-lifecycle.ts
gmail-watcher.ts perf: extract lightweight runtime seams 2026-03-22 05:03:10 +00:00
gmail.test.ts
gmail.ts
hooks-install.test.ts
hooks-status.ts refactor(hooks): unify hook policy resolution 2026-03-22 09:59:51 -07:00
hooks.ts
import-url.test.ts
import-url.ts
install.runtime.ts perf: lazy-load hook install runtime helpers 2026-03-22 21:52:42 +00:00
install.test.ts test: trim more local test startup overhead 2026-03-22 09:35:36 +00:00
install.ts perf: lazy-load hook install runtime helpers 2026-03-22 21:52:42 +00:00
installs.ts
internal-hooks.test.ts test: dedupe utility and config suites 2026-03-28 00:26:55 +00:00
internal-hooks.ts fix: skip session:patch hook clone without listeners 2026-03-25 16:12:39 +05:30
llm-slug-generator.ts
loader.test.ts hooks: default hooks.internal.enabled to true so bundled hooks load on fresh installs 2026-03-30 22:00:54 +05:30
loader.ts hooks: default hooks.internal.enabled to true so bundled hooks load on fresh installs 2026-03-30 22:00:54 +05:30
message-hook-mappers.test.ts Hooks: pass inbound attachment arrays to plugins (#55452) 2026-03-27 17:23:24 -04:00
message-hook-mappers.ts Hooks: pass inbound attachment arrays to plugins (#55452) 2026-03-27 17:23:24 -04:00
message-hooks.test.ts refactor: unify message hook mapping and async dispatch 2026-03-02 22:51:28 +00:00
module-loader.test.ts
module-loader.ts
plugin-hooks.test.ts feat(plugins): add compatible bundle support 2026-03-15 16:08:50 -07:00
plugin-hooks.ts fix: support multi-kind plugins for dual slot ownership (#57507) (thanks @fuller-stack-dev) 2026-03-31 10:06:48 +05:30
policy.test.ts refactor(hooks): unify hook policy resolution 2026-03-22 09:59:51 -07:00
policy.ts refactor(hooks): unify hook policy resolution 2026-03-22 09:59:51 -07:00
types.ts
update.ts refactor(cli): extract hook pack update flow 2026-03-22 12:02:52 -07:00
workspace.test.ts fix(hooks): harden workspace hook loading 2026-03-22 09:38:09 -07:00
workspace.ts refactor(hooks): unify hook policy resolution 2026-03-22 09:59:51 -07:00