@ghl-ai/aw 0.1.37-beta.70 → 0.1.37-beta.71

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/integrate.mjs +11 -15
  2. package/package.json +1 -1
package/integrate.mjs CHANGED
@@ -680,28 +680,24 @@ export function installIdeHooks() {
680
680
  mkdirSync(codexDir, { recursive: true });
681
681
  const codexHooksPath = join(codexDir, 'hooks.json');
682
682
 
683
- let codexHooks = {};
683
+ let codexHooksFile = {};
684
684
  if (existsSync(codexHooksPath)) {
685
- try { codexHooks = JSON.parse(readFileSync(codexHooksPath, 'utf8')); } catch { codexHooks = {}; }
685
+ try { codexHooksFile = JSON.parse(readFileSync(codexHooksPath, 'utf8')); } catch { codexHooksFile = {}; }
686
686
  }
687
+ if (!codexHooksFile.hooks) codexHooksFile.hooks = {};
687
688
 
688
689
  // Codex supports: SessionStart, Stop, PreToolUse, PostToolUse, UserPromptSubmit
689
690
  const codexEvents = { SessionStart: dispatchers.SessionStart, Stop: dispatchers.Stop };
690
691
  for (const [event, { cmd, timeout }] of Object.entries(codexEvents)) {
691
- if (!codexHooks[event]) codexHooks[event] = [];
692
+ if (!codexHooksFile.hooks[event]) codexHooksFile.hooks[event] = [];
692
693
 
693
- // Each entry is a matcher group: { matcher: "*", hooks: [...] }
694
- // Find existing aw matcher group or create one
695
- let awGroup = codexHooks[event].find(g =>
696
- g.hooks?.some(h => h.command?.includes('.aw/hooks/'))
694
+ // Remove old aw entries
695
+ codexHooksFile.hooks[event] = codexHooksFile.hooks[event].filter(h =>
696
+ !h.command?.includes('.aw/hooks/')
697
697
  );
698
- if (!awGroup) {
699
- awGroup = { hooks: [] };
700
- codexHooks[event].push(awGroup);
701
- }
702
- // Replace aw hooks in the group
703
- awGroup.hooks = awGroup.hooks.filter(h => !h.command?.includes('.aw/hooks/'));
704
- awGroup.hooks.push({
698
+
699
+ // Codex hooks are flat objects: { command, type, timeoutSec, statusMessage }
700
+ codexHooksFile.hooks[event].push({
705
701
  type: 'command',
706
702
  command: cmd,
707
703
  timeoutSec: timeout,
@@ -709,7 +705,7 @@ export function installIdeHooks() {
709
705
  });
710
706
  }
711
707
 
712
- writeFileSync(codexHooksPath, JSON.stringify(codexHooks, null, 2) + '\n');
708
+ writeFileSync(codexHooksPath, JSON.stringify(codexHooksFile, null, 2) + '\n');
713
709
 
714
710
  // Enable codex_hooks feature if not already set
715
711
  const codexConfigPath = join(codexDir, 'config.toml');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ghl-ai/aw",
3
- "version": "0.1.37-beta.70",
3
+ "version": "0.1.37-beta.71",
4
4
  "description": "Agentic Workspace CLI — pull, push & manage agents, skills and commands from the registry",
5
5
  "type": "module",
6
6
  "bin": "bin.js",