@alessandroraffa/tangyr 0.21.0 → 0.21.2
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.
- package/dist/index.js +503 -396
- package/mappings/hook-events.yaml +40 -60
- package/package.json +1 -1
|
@@ -143,81 +143,61 @@ targets:
|
|
|
143
143
|
|
|
144
144
|
cursor:
|
|
145
145
|
delivery: native-versioned-object
|
|
146
|
-
#
|
|
146
|
+
# Measured on 2026-09-06 against cursor-agent 2026.09.02-c22c1a3, by writing a
|
|
147
|
+
# .cursor/hooks.json, running a real agent turn, and checking whether the hook's
|
|
148
|
+
# script had run. Every entry below is a result, not a reading of the binary.
|
|
147
149
|
#
|
|
148
|
-
#
|
|
149
|
-
#
|
|
150
|
-
#
|
|
150
|
+
# The steps are camelCase and come from a 21-value enum: beforeShellExecution,
|
|
151
|
+
# beforeMCPExecution, afterShellExecution, afterMCPExecution, beforeReadFile,
|
|
152
|
+
# afterFileEdit, beforeTabFileRead, afterTabFileEdit, stop, beforeSubmitPrompt,
|
|
153
|
+
# afterAgentResponse, afterAgentThought, sessionStart, sessionEnd, preCompact,
|
|
154
|
+
# subagentStart, subagentStop, preToolUse, postToolUse, postToolUseFailure,
|
|
155
|
+
# workspaceOpen. Every one of this file's source events has an equivalent there.
|
|
151
156
|
#
|
|
152
|
-
#
|
|
153
|
-
# beforeReadFile, beforeShellExecution, postToolUse, postToolUseFailure,
|
|
154
|
-
# preCompact, preToolUse, subagentStart, subagentStop
|
|
157
|
+
# What the 2026-09-04 note above this block got wrong, and how:
|
|
155
158
|
#
|
|
156
|
-
# The
|
|
157
|
-
# and
|
|
159
|
+
# 1. The enum was read from the GUI app and had twelve values. The CLI's has
|
|
160
|
+
# twenty-one, sessionStart and beforeSubmitPrompt among them. Two events
|
|
161
|
+
# recorded here as having no equivalent do have one.
|
|
162
|
+
# 2. PascalCase was suspected of being the whole defect. It is not: a file in
|
|
163
|
+
# Claude Code's own shape with PascalCase keys and { matcher, hooks: [] }
|
|
164
|
+
# entries did not fire either, though the binary carries a detector for
|
|
165
|
+
# that shape. Case and shape had to change together.
|
|
166
|
+
# 3. The entry was thought to hold one command per event, so the compiler
|
|
167
|
+
# reported a collapse. It holds an array: three commands on one step all
|
|
168
|
+
# ran, in parallel. There is nothing to collapse.
|
|
158
169
|
#
|
|
159
|
-
#
|
|
160
|
-
#
|
|
161
|
-
#
|
|
162
|
-
# 2. preCompact, subagentStart and subagentStop ARE in that enum, while the entries below
|
|
163
|
-
# say they have "no documented equivalent". That claim is wrong, whatever the case
|
|
164
|
-
# question turns out to be.
|
|
165
|
-
# 3. The same file resolves ~/.claude/settings.json and <project>/.claude/settings.json as
|
|
166
|
-
# hook sources alongside ~/.cursor/hooks.json. Cursor may already be reading the
|
|
167
|
-
# Claude Code artifact this CLI writes, which would make its own hooks.json redundant.
|
|
168
|
-
#
|
|
169
|
-
# Nothing below was changed on this evidence. Minified code read without running it is a
|
|
170
|
-
# strong hint and not a measurement, and swapping one unverified mapping for another is the
|
|
171
|
-
# same mistake in the other direction. To settle it: install this kit for cursor, open the
|
|
172
|
-
# Cursor GUI, run one agent turn that executes a shell command, and check whether the hook
|
|
173
|
-
# script ran — then repeat with the keys lowercased. Cursor has no CLI on the machine this
|
|
174
|
-
# was measured on, which is why it stopped here.
|
|
170
|
+
# One finding has no entry here because it belongs to the compiler: `matcher` is
|
|
171
|
+
# honoured, alternation included, but against Cursor's tool names. A hook scoped
|
|
172
|
+
# to "Bash" never runs; "Shell" does. See CURSOR_TOOL_NAMES in compiler/hooks.ts.
|
|
175
173
|
source_to_target:
|
|
176
174
|
SessionStart:
|
|
177
|
-
status:
|
|
178
|
-
|
|
179
|
-
Not in the observed enum under any casing, and not probeable without the GUI. See the
|
|
180
|
-
note above this block.
|
|
175
|
+
status: mapped
|
|
176
|
+
target_event: sessionStart
|
|
181
177
|
UserPromptSubmit:
|
|
182
|
-
status:
|
|
183
|
-
|
|
184
|
-
Not in the observed enum; the nearest candidate is beforeSubmitPrompt, which is a
|
|
185
|
-
different contract. See the note above this block.
|
|
186
|
-
PostToolUseFailure:
|
|
187
|
-
status: probe
|
|
188
|
-
reason: >-
|
|
189
|
-
postToolUseFailure is in the observed enum, camelCased. Unverified. See the note above
|
|
190
|
-
this block.
|
|
178
|
+
status: mapped
|
|
179
|
+
target_event: beforeSubmitPrompt
|
|
191
180
|
PreToolUse:
|
|
192
181
|
status: mapped
|
|
193
|
-
target_event:
|
|
182
|
+
target_event: preToolUse
|
|
194
183
|
PostToolUse:
|
|
195
184
|
status: mapped
|
|
196
|
-
target_event:
|
|
185
|
+
target_event: postToolUse
|
|
186
|
+
PostToolUseFailure:
|
|
187
|
+
status: mapped
|
|
188
|
+
target_event: postToolUseFailure
|
|
197
189
|
PreCompact:
|
|
198
|
-
status:
|
|
199
|
-
|
|
200
|
-
reason: >-
|
|
201
|
-
preCompact is in the observed enum, camelCased. The previous entry here said there was
|
|
202
|
-
no documented equivalent, which the enum contradicts. See the note above this block.
|
|
190
|
+
status: mapped
|
|
191
|
+
target_event: preCompact
|
|
203
192
|
SubagentStart:
|
|
204
|
-
status:
|
|
205
|
-
|
|
206
|
-
reason: >-
|
|
207
|
-
subagentStart is in the observed enum, camelCased. The previous entry here said there was
|
|
208
|
-
no documented equivalent, which the enum contradicts. See the note above this block.
|
|
193
|
+
status: mapped
|
|
194
|
+
target_event: subagentStart
|
|
209
195
|
SubagentStop:
|
|
210
|
-
status:
|
|
211
|
-
|
|
212
|
-
reason: >-
|
|
213
|
-
subagentStop is in the observed enum, camelCased. The previous entry here said there was
|
|
214
|
-
no documented equivalent, which the enum contradicts. See the note above this block.
|
|
196
|
+
status: mapped
|
|
197
|
+
target_event: subagentStop
|
|
215
198
|
Stop:
|
|
216
|
-
status:
|
|
217
|
-
|
|
218
|
-
reason: >-
|
|
219
|
-
Not in the observed enum. `stop` appears in that file but as an unrelated identifier, so
|
|
220
|
-
this stays a drop rather than becoming a guess. See the note above this block.
|
|
199
|
+
status: mapped
|
|
200
|
+
target_event: stop
|
|
221
201
|
|
|
222
202
|
# OpenCode and Cline exchange no declarative hook file at all: hooks are
|
|
223
203
|
# plugin code (an OpenCode plugin, a @cline/sdk AgentPlugin), which a kit
|