intentdna 1.4.2 → 1.4.3

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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "hooks": {
3
- "PreToolUse": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook PreToolUse", "timeout": 5000 }] }],
4
- "PostToolUse": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook PostToolUse", "timeout": 3000 }] }],
5
- "UserPromptSubmit": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook UserPromptSubmit", "timeout": 5000 }] }],
6
- "SubagentStop": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook SubagentStop", "timeout": 3000 }] }],
7
- "PreCompact": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook PreCompact", "timeout": 3000 }] }],
8
- "Notification": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook Notification", "timeout": 3000 }] }],
9
- "Stop": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook Stop", "timeout": 3000 }] }],
10
- "SessionStart": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook SessionStart", "timeout": 5000 }] }]
3
+ "PreToolUse": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook PreToolUse", "timeout": 5 }] }],
4
+ "PostToolUse": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook PostToolUse", "timeout": 3 }] }],
5
+ "UserPromptSubmit": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook UserPromptSubmit", "timeout": 5 }] }],
6
+ "SubagentStop": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook SubagentStop", "timeout": 3 }] }],
7
+ "PreCompact": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook PreCompact", "timeout": 3 }] }],
8
+ "Notification": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook Notification", "timeout": 3 }] }],
9
+ "Stop": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook Stop", "timeout": 3 }] }],
10
+ "SessionStart": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook SessionStart", "timeout": 5 }] }]
11
11
  }
12
12
  }
@@ -9,8 +9,8 @@
9
9
  {
10
10
  "name": "intentdna",
11
11
  "description": "DNA template compilation + runtime enforcement",
12
- "version": "1.4.1",
13
- "source": "./.claude-plugin"
12
+ "version": "1.4.3",
13
+ "source": "./"
14
14
  }
15
15
  ]
16
16
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "intentdna",
3
- "version": "0.6.0",
3
+ "version": "1.4.3",
4
4
  "description": "Declarative policy layer for AI agent governance"
5
5
  }
package/dist/hooks/cli.js CHANGED
@@ -102,6 +102,10 @@ async function main() {
102
102
  const decision = output.continue === false ? "block"
103
103
  : output.hookSpecificOutput?.additionalContext?.startsWith("WARN") ? "warn"
104
104
  : "allow";
105
+ // Extract target file path from tool_input (Write/Edit/Read)
106
+ const toolInput = typeof rawInput.tool_input === "object" && rawInput.tool_input !== null
107
+ ? rawInput.tool_input : undefined;
108
+ const targetPath = typeof toolInput?.file_path === "string" ? toolInput.file_path : undefined;
105
109
  appendTrace(projectDir, {
106
110
  trace_id: randomUUID(),
107
111
  event,
@@ -110,6 +114,8 @@ async function main() {
110
114
  workflow: state.workflowState?.workflow,
111
115
  step: state.workflowState?.current_step,
112
116
  decision: decision,
117
+ reason: decision !== "allow" ? output.reason : undefined,
118
+ target_path: decision !== "allow" ? targetPath : undefined,
113
119
  duration_ms: durationMs,
114
120
  timestamp: new Date().toISOString(),
115
121
  }).catch(() => { }); // Fail-open
@@ -71,6 +71,8 @@ export interface TraceEntry {
71
71
  workflow?: string;
72
72
  step?: string;
73
73
  decision: "allow" | "block" | "warn";
74
+ reason?: string;
75
+ target_path?: string;
74
76
  duration_ms: number;
75
77
  timestamp: string;
76
78
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intentdna",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "Intent DNA — Declarative policy layer for AI agent behavior",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",