opentology 0.2.6 → 0.2.7

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 (2) hide show
  1. package/dist/mcp/server.js +16 -6
  2. package/package.json +1 -1
@@ -467,20 +467,30 @@ async function handleContextInit(args) {
467
467
  const sessionStartCmd = 'node .opentology/hooks/session-start.mjs';
468
468
  if (!hooks.SessionStart)
469
469
  hooks.SessionStart = [];
470
- const hasSessionHook = hooks.SessionStart.some((h) => h.command === sessionStartCmd);
470
+ const hasSessionHook = hooks.SessionStart.some((h) => {
471
+ const entry = h;
472
+ const entryHooks = entry.hooks;
473
+ return entryHooks?.some((hook) => hook.command === sessionStartCmd);
474
+ });
471
475
  if (!hasSessionHook) {
472
- hooks.SessionStart.push({ type: 'command', command: sessionStartCmd });
476
+ hooks.SessionStart.push({
477
+ matcher: '',
478
+ hooks: [{ type: 'command', command: sessionStartCmd }],
479
+ });
473
480
  hooksChanged = true;
474
481
  }
475
482
  const preEditCmd = 'node .opentology/hooks/pre-edit.mjs';
476
483
  if (!hooks.PreToolUse)
477
484
  hooks.PreToolUse = [];
478
- const hasPreEditHook = hooks.PreToolUse.some((h) => h.command === preEditCmd);
485
+ const hasPreEditHook = hooks.PreToolUse.some((h) => {
486
+ const entry = h;
487
+ const entryHooks = entry.hooks;
488
+ return entryHooks?.some((hook) => hook.command === preEditCmd);
489
+ });
479
490
  if (!hasPreEditHook) {
480
491
  hooks.PreToolUse.push({
481
- type: 'command',
482
- command: preEditCmd,
483
- matcher: { tool_name: 'Edit|Write' },
492
+ matcher: 'Edit|Write',
493
+ hooks: [{ type: 'command', command: preEditCmd }],
484
494
  });
485
495
  hooksChanged = true;
486
496
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opentology",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "Ontology-powered project memory for AI coding assistants — your codebase as a knowledge graph",
5
5
  "type": "module",
6
6
  "bin": {