1
0
Fork 0
mirror of https://github.com/imjasonh/cnotes synced 2026-07-18 06:39:02 +00:00

Fix user prompt parsing to handle string content format

- Add support for message.content as direct string (not just array format)
- Handles both old and new transcript formats from Claude
- User prompts like 'I would expect cnotes show to include my user prompt' now captured correctly
This commit is contained in:
Jason Hall 2025-07-21 14:02:53 -04:00
parent 042ee0911b
commit f7482327c3
Failed to extract signature
4 changed files with 76 additions and 10 deletions

View file

@ -96,10 +96,9 @@ func InstallHooksToPath(binaryPath, settingsPath string) error {
settings.Hooks = make(map[string][]HookDefinition)
}
hookCmd := binaryPath + " run"
hookAction := HookAction{
Type: "command",
Command: hookCmd,
Command: binaryPath,
}
hookDef := HookDefinition{
@ -123,7 +122,7 @@ func InstallHooksToPath(binaryPath, settingsPath string) error {
found := false
for i, def := range settings.Hooks[claudeEvent] {
for j, action := range def.Hooks {
if action.Command == hookCmd {
if action.Command == binaryPath {
// Update existing hook
settings.Hooks[claudeEvent][i].Hooks[j] = hookAction
found = true
@ -158,8 +157,6 @@ func UninstallHooksFromPath(binaryPath, settingsPath string) error {
return nil
}
hookCmd := binaryPath + " run"
// Remove our hook from all events
for eventName, hookDefs := range settings.Hooks {
newDefs := make([]HookDefinition, 0)
@ -167,7 +164,7 @@ func UninstallHooksFromPath(binaryPath, settingsPath string) error {
for _, def := range hookDefs {
newActions := make([]HookAction, 0)
for _, action := range def.Hooks {
if action.Command != hookCmd {
if action.Command != binaryPath {
newActions = append(newActions, action)
}
}