@oh-my-pi/cli 1.3.371 → 1.3.372

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -67,18 +67,20 @@ omp installs plugins globally via npm and sets up your pi configuration:
67
67
  ├── agent/ # Pi's agent directory
68
68
  │ ├── agents/ # Agent definitions (.md) - symlinked
69
69
  │ ├── commands/ # Slash commands (.md) - symlinked
70
+ │ ├── hooks/omp/ # Hook loader
71
+ │ │ └── index.ts # Generated loader - imports hooks from node_modules
70
72
  │ ├── tools/omp/ # Tool loader
71
73
  │ │ └── index.ts # Generated loader - imports tools from node_modules
72
74
  │ └── themes/ # Theme files (.json) - symlinked
73
75
  └── plugins/
74
76
  ├── package.json # Installed plugins manifest
75
- ├── node_modules/ # Plugin packages (tools loaded directly from here)
77
+ ├── node_modules/ # Plugin packages (tools/hooks loaded directly from here)
76
78
  └── store/ # Runtime configs (survives npm updates)
77
79
  ```
78
80
 
79
81
  **Non-tool files** (agents, commands, themes) are symlinked via `omp.install` entries.
80
82
 
81
- **Tools** are loaded directly from node_modules via a generated loader. Plugins specify `omp.tools` pointing to their tool factory. This allows tools to use npm dependencies without workarounds.
83
+ **Tools and Hooks** are loaded directly from node_modules via generated loaders. Plugins specify `omp.tools` and/or `omp.hooks` pointing to their factory modules. This allows using npm dependencies without workarounds.
82
84
 
83
85
  ## Project-Level Overrides
84
86
 
@@ -248,6 +250,24 @@ For plugins with custom tools, use the `tools` field instead of `install`:
248
250
 
249
251
  The `tools` field points to a directory containing an `index.ts` that exports a tool factory. Tools are loaded directly from node_modules, so npm dependencies work normally.
250
252
 
253
+ ### Hooks
254
+
255
+ For plugins with lifecycle hooks, use the `hooks` field:
256
+
257
+ ```json
258
+ {
259
+ "name": "@oh-my-pi/my-hooks",
260
+ "version": "1.0.0",
261
+ "keywords": ["omp-plugin"],
262
+ "omp": {
263
+ "hooks": "hooks"
264
+ },
265
+ "files": ["hooks"]
266
+ }
267
+ ```
268
+
269
+ The `hooks` field points to a directory containing an `index.ts` that exports a hook factory (`HookFactory`). Hooks subscribe to agent events like `tool_call`, `session`, etc.
270
+
251
271
  ### Features and Variables
252
272
 
253
273
  Plugins can define optional features and configurable variables: