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":
|
|
4
|
-
"PostToolUse": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook PostToolUse", "timeout":
|
|
5
|
-
"UserPromptSubmit": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook UserPromptSubmit", "timeout":
|
|
6
|
-
"SubagentStop": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook SubagentStop", "timeout":
|
|
7
|
-
"PreCompact": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook PreCompact", "timeout":
|
|
8
|
-
"Notification": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook Notification", "timeout":
|
|
9
|
-
"Stop": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook Stop", "timeout":
|
|
10
|
-
"SessionStart": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "dna-hook SessionStart", "timeout":
|
|
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
|
}
|
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
|
package/dist/hooks/state.d.ts
CHANGED