@goodfoot/agent-hooks 1.0.4 → 1.0.5

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.
@@ -55,7 +55,7 @@ function generatePackageJson(projectName, outputPath) {
55
55
  typecheck: "tsc --noEmit",
56
56
  },
57
57
  dependencies: {
58
- [PACKAGE_NAME]: "^1.0.4",
58
+ [PACKAGE_NAME]: "^1.0.5",
59
59
  },
60
60
  devDependencies: {
61
61
  "@biomejs/biome": "2.4.9",
@@ -144,7 +144,11 @@ function generateHookSource(eventName) {
144
144
  return `import { ${importItems} } from "${CODEX_IMPORT_SPECIFIER}";
145
145
 
146
146
  export default ${factory}({ matcher: "Bash" }, (input) => {
147
- if (input.tool_input.command.includes("rm -rf")) {
147
+ // Codex does not give tool_input a fixed schema, so it's typed "unknown" —
148
+ // narrow before reading a field off it.
149
+ const toolInput = input.tool_input as { command?: unknown };
150
+ const command = typeof toolInput.command === "string" ? toolInput.command : "";
151
+ if (command.includes("rm -rf")) {
148
152
  return ${output}({
149
153
  systemMessage: "Blocked dangerous shell command.",
150
154
  permissionDecision: "deny",
@@ -157,8 +161,12 @@ export default ${factory}({ matcher: "Bash" }, (input) => {
157
161
  return `import { ${importItems} } from "${CODEX_IMPORT_SPECIFIER}";
158
162
 
159
163
  export default ${factory}({ matcher: "Bash" }, (input) => {
164
+ // Codex does not give tool_input a fixed schema, so it's typed "unknown" —
165
+ // narrow before reading a field off it.
166
+ const toolInput = input.tool_input as { command?: unknown };
167
+ const command = typeof toolInput.command === "string" ? toolInput.command : "<unknown>";
160
168
  return ${output}({
161
- additionalContext: \`Observed Bash command: \${input.tool_input.command}\`,
169
+ additionalContext: \`Observed Bash command: \${command}\`,
162
170
  });
163
171
  });
164
172
  `;
package/dist/cli.js CHANGED
@@ -26,7 +26,7 @@ import { scaffoldProject } from "./scaffold.js";
26
26
  // ============================================================================
27
27
  // Constants
28
28
  // ============================================================================
29
- const VERSION = "1.0.4";
29
+ const VERSION = "1.0.5";
30
30
  const DEFAULT_ESBUILD_LOADERS = {
31
31
  ".md": "text",
32
32
  };
package/dist/scaffold.js CHANGED
@@ -131,7 +131,7 @@ function generatePackageJson(projectName, outputPath) {
131
131
  typecheck: "tsc --noEmit",
132
132
  },
133
133
  dependencies: {
134
- "@goodfoot/agent-hooks": "^1.0.4",
134
+ "@goodfoot/agent-hooks": "^1.0.5",
135
135
  },
136
136
  devDependencies: {
137
137
  "@biomejs/biome": "2.4.16",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodfoot/agent-hooks",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Unified agent hooks library: shared core runtime with per-agent entry points for Claude Code, Codex, and Antigravity",
5
5
  "homepage": "https://github.com/goodfoot-io/marketplace/tree/main/packages/agent-hooks",
6
6
  "repository": {