@oh-my-pi/cli 1.3.37 → 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.
Files changed (41) hide show
  1. package/README.md +73 -53
  2. package/dist/cli.js +10067 -2956
  3. package/dist/commands/config.d.ts +1 -1
  4. package/dist/commands/config.d.ts.map +1 -1
  5. package/dist/commands/create.d.ts.map +1 -1
  6. package/dist/commands/doctor.d.ts.map +1 -1
  7. package/dist/commands/enable.d.ts.map +1 -1
  8. package/dist/commands/env.d.ts.map +1 -1
  9. package/dist/commands/features.d.ts.map +1 -1
  10. package/dist/commands/info.d.ts.map +1 -1
  11. package/dist/commands/init.d.ts.map +1 -1
  12. package/dist/commands/install.d.ts +2 -2
  13. package/dist/commands/install.d.ts.map +1 -1
  14. package/dist/commands/link.d.ts.map +1 -1
  15. package/dist/commands/list.d.ts.map +1 -1
  16. package/dist/commands/outdated.d.ts.map +1 -1
  17. package/dist/commands/render-web.d.ts +10 -0
  18. package/dist/commands/render-web.d.ts.map +1 -0
  19. package/dist/commands/search.d.ts.map +1 -1
  20. package/dist/commands/uninstall.d.ts.map +1 -1
  21. package/dist/commands/update.d.ts.map +1 -1
  22. package/dist/commands/why.d.ts.map +1 -1
  23. package/dist/conflicts.d.ts +1 -1
  24. package/dist/conflicts.d.ts.map +1 -1
  25. package/dist/index.d.ts +19 -19
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/loader.d.ts +17 -5
  28. package/dist/loader.d.ts.map +1 -1
  29. package/dist/lockfile.d.ts.map +1 -1
  30. package/dist/manifest.d.ts +3 -1
  31. package/dist/manifest.d.ts.map +1 -1
  32. package/dist/npm.d.ts +2 -2
  33. package/dist/npm.d.ts.map +1 -1
  34. package/dist/paths.d.ts.map +1 -1
  35. package/dist/progress.d.ts.map +1 -1
  36. package/dist/runtime.d.ts +1 -1
  37. package/dist/symlinks.d.ts +1 -1
  38. package/dist/symlinks.d.ts.map +1 -1
  39. package/dist/utils/fetch.d.ts +18 -0
  40. package/dist/utils/fetch.d.ts.map +1 -0
  41. package/package.json +2 -1
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
 
@@ -214,16 +216,16 @@ Plugins are npm packages with an `omp` field in `package.json`:
214
216
 
215
217
  ```json
216
218
  {
217
- "name": "my-cool-plugin",
218
- "version": "1.0.0",
219
- "keywords": ["omp-plugin"],
220
- "omp": {
221
- "install": [
222
- { "src": "agents/researcher.md", "dest": "agent/agents/researcher.md" },
223
- { "src": "commands/research.md", "dest": "agent/commands/research.md" }
224
- ]
225
- },
226
- "files": ["agents", "commands"]
219
+ "name": "my-cool-plugin",
220
+ "version": "1.0.0",
221
+ "keywords": ["omp-plugin"],
222
+ "omp": {
223
+ "install": [
224
+ { "src": "agents/researcher.md", "dest": "agent/agents/researcher.md" },
225
+ { "src": "commands/research.md", "dest": "agent/commands/research.md" }
226
+ ]
227
+ },
228
+ "files": ["agents", "commands"]
227
229
  }
228
230
  ```
229
231
 
@@ -233,58 +235,76 @@ For plugins with custom tools, use the `tools` field instead of `install`:
233
235
 
234
236
  ```json
235
237
  {
236
- "name": "@oh-my-pi/my-tools",
237
- "version": "1.0.0",
238
- "keywords": ["omp-plugin"],
239
- "omp": {
240
- "tools": "tools"
241
- },
242
- "files": ["tools"],
243
- "dependencies": {
244
- "some-npm-package": "^1.0.0"
245
- }
238
+ "name": "@oh-my-pi/my-tools",
239
+ "version": "1.0.0",
240
+ "keywords": ["omp-plugin"],
241
+ "omp": {
242
+ "tools": "tools"
243
+ },
244
+ "files": ["tools"],
245
+ "dependencies": {
246
+ "some-npm-package": "^1.0.0"
247
+ }
246
248
  }
247
249
  ```
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:
254
274
 
255
275
  ```json
256
276
  {
257
- "name": "@oh-my-pi/exa",
258
- "version": "1.0.0",
259
- "keywords": ["omp-plugin"],
260
- "omp": {
261
- "tools": "tools",
262
- "runtime": "tools/runtime.json",
263
- "variables": {
264
- "apiKey": {
265
- "type": "string",
266
- "env": "EXA_API_KEY",
267
- "description": "Exa API key",
268
- "required": true
269
- }
270
- },
271
- "features": {
272
- "search": {
273
- "description": "Web search capabilities",
274
- "default": true
275
- },
276
- "websets": {
277
- "description": "Curated content collections",
278
- "default": false,
279
- "variables": {
280
- "defaultCollection": {
281
- "type": "string",
282
- "default": "general"
283
- }
284
- }
285
- }
286
- }
287
- }
277
+ "name": "@oh-my-pi/exa",
278
+ "version": "1.0.0",
279
+ "keywords": ["omp-plugin"],
280
+ "omp": {
281
+ "tools": "tools",
282
+ "runtime": "tools/runtime.json",
283
+ "variables": {
284
+ "apiKey": {
285
+ "type": "string",
286
+ "env": "EXA_API_KEY",
287
+ "description": "Exa API key",
288
+ "required": true
289
+ }
290
+ },
291
+ "features": {
292
+ "search": {
293
+ "description": "Web search capabilities",
294
+ "default": true
295
+ },
296
+ "websets": {
297
+ "description": "Curated content collections",
298
+ "default": false,
299
+ "variables": {
300
+ "defaultCollection": {
301
+ "type": "string",
302
+ "default": "general"
303
+ }
304
+ }
305
+ }
306
+ }
307
+ }
288
308
  }
289
309
  ```
290
310