@ghl-ai/aw 0.1.37-beta.78 → 0.1.37-beta.79

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 +21 -10
  2. package/package.json +1 -1
package/integrate.mjs CHANGED
@@ -669,25 +669,36 @@ export function installIdeHooks() {
669
669
  for (const [event, { cmd, timeout }] of Object.entries(codexEvents)) {
670
670
  if (!codexHooksFile.hooks[event]) codexHooksFile.hooks[event] = [];
671
671
 
672
- // Remove old aw entries
673
- codexHooksFile.hooks[event] = codexHooksFile.hooks[event].filter(h =>
674
- !h.command?.includes('.aw/hooks/')
675
- );
672
+ // Codex expects grouped hook entries:
673
+ // { matcher?, hooks: [{ type, command, timeoutSec, statusMessage }] }
674
+ // Preserve non-AW groups and non-AW hooks inside mixed groups.
675
+ const existingGroups = Array.isArray(codexHooksFile.hooks[event]) ? codexHooksFile.hooks[event] : [];
676
+ const preservedGroups = existingGroups
677
+ .map(group => {
678
+ if (!group || !Array.isArray(group.hooks)) return null;
679
+ const hooks = group.hooks.filter(h => !h.command?.includes('.aw/hooks/'));
680
+ return hooks.length > 0 ? { ...group, hooks } : null;
681
+ })
682
+ .filter(Boolean);
676
683
 
677
- // Codex hooks are flat objects: { command, type, timeoutSec, statusMessage }
678
- codexHooksFile.hooks[event].push({
684
+ const awHook = {
679
685
  type: 'command',
680
686
  command: cmd,
681
687
  timeoutSec: timeout,
682
688
  statusMessage: `AW telemetry (${event})`,
683
- });
689
+ };
690
+
691
+ const awGroup = event === 'SessionStart'
692
+ ? { matcher: 'startup', hooks: [awHook] }
693
+ : { hooks: [awHook] };
694
+
695
+ codexHooksFile.hooks[event] = [...preservedGroups, awGroup];
684
696
 
685
- // Clean up legacy top-level event wrappers from earlier installs so Codex
686
- // has a single canonical hook definition and we avoid duplicate execution.
697
+ // Clean up incorrect top-level event wrappers from prior installs.
687
698
  if (Array.isArray(codexHooksFile[event])) {
688
699
  const cleaned = codexHooksFile[event]
689
700
  .map(group => {
690
- if (!group || !Array.isArray(group.hooks)) return group;
701
+ if (!group || !Array.isArray(group.hooks)) return null;
691
702
  const hooks = group.hooks.filter(h => !h.command?.includes('.aw/hooks/'));
692
703
  return hooks.length > 0 ? { ...group, hooks } : null;
693
704
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ghl-ai/aw",
3
- "version": "0.1.37-beta.78",
3
+ "version": "0.1.37-beta.79",
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",