|
4 | 4 | "sessionStart": [ |
5 | 5 | { |
6 | 6 | "type": "command", |
7 | | - "bash": "S=\"${COPILOT_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-$HOME/.copilot/installed-plugins/_direct/abhi-singhs--copilot-token-meter}}}/bin/token-meter.js\"; [ -f \"$S\" ] && exec node \"$S\" --hook=sessionStart; exit 0", |
8 | | - "powershell": "$r = if ($env:COPILOT_PLUGIN_ROOT) { $env:COPILOT_PLUGIN_ROOT } elseif ($env:CLAUDE_PLUGIN_ROOT) { $env:CLAUDE_PLUGIN_ROOT } elseif ($env:PLUGIN_ROOT) { $env:PLUGIN_ROOT } else { \"$env:USERPROFILE\\.copilot\\installed-plugins\\_direct\\abhi-singhs--copilot-token-meter\" }; $s = Join-Path $r 'bin\\token-meter.js'; if (Test-Path $s) { node $s --hook=sessionStart }", |
| 7 | + "bash": "[ -n \"$COPILOT_PLUGIN_ROOT\" ] || exit 0; S=\"$COPILOT_PLUGIN_ROOT/bin/token-meter.js\"; [ -f \"$S\" ] && exec node \"$S\" --hook=sessionStart; exit 0", |
| 8 | + "powershell": "if (-not $env:COPILOT_PLUGIN_ROOT) { exit 0 }; $s = Join-Path $env:COPILOT_PLUGIN_ROOT 'bin\\token-meter.js'; if (Test-Path $s) { node $s --hook=sessionStart }", |
9 | 9 | "timeoutSec": 10 |
10 | 10 | } |
11 | 11 | ], |
12 | 12 | "postToolUse": [ |
13 | 13 | { |
14 | 14 | "type": "command", |
15 | | - "bash": "S=\"${COPILOT_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-$HOME/.copilot/installed-plugins/_direct/abhi-singhs--copilot-token-meter}}}/bin/token-meter.js\"; [ -f \"$S\" ] && exec node \"$S\" --hook=postToolUse; exit 0", |
16 | | - "powershell": "$r = if ($env:COPILOT_PLUGIN_ROOT) { $env:COPILOT_PLUGIN_ROOT } elseif ($env:CLAUDE_PLUGIN_ROOT) { $env:CLAUDE_PLUGIN_ROOT } elseif ($env:PLUGIN_ROOT) { $env:PLUGIN_ROOT } else { \"$env:USERPROFILE\\.copilot\\installed-plugins\\_direct\\abhi-singhs--copilot-token-meter\" }; $s = Join-Path $r 'bin\\token-meter.js'; if (Test-Path $s) { node $s --hook=postToolUse }", |
| 15 | + "bash": "[ -n \"$COPILOT_PLUGIN_ROOT\" ] || exit 0; S=\"$COPILOT_PLUGIN_ROOT/bin/token-meter.js\"; [ -f \"$S\" ] && exec node \"$S\" --hook=postToolUse; exit 0", |
| 16 | + "powershell": "if (-not $env:COPILOT_PLUGIN_ROOT) { exit 0 }; $s = Join-Path $env:COPILOT_PLUGIN_ROOT 'bin\\token-meter.js'; if (Test-Path $s) { node $s --hook=postToolUse }", |
17 | 17 | "timeoutSec": 10 |
18 | 18 | } |
19 | 19 | ], |
20 | 20 | "userPromptSubmitted": [ |
21 | 21 | { |
22 | 22 | "type": "command", |
23 | | - "bash": "S=\"${COPILOT_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-$HOME/.copilot/installed-plugins/_direct/abhi-singhs--copilot-token-meter}}}/bin/token-meter.js\"; [ -f \"$S\" ] && exec node \"$S\" --hook=userPromptSubmitted; exit 0", |
24 | | - "powershell": "$r = if ($env:COPILOT_PLUGIN_ROOT) { $env:COPILOT_PLUGIN_ROOT } elseif ($env:CLAUDE_PLUGIN_ROOT) { $env:CLAUDE_PLUGIN_ROOT } elseif ($env:PLUGIN_ROOT) { $env:PLUGIN_ROOT } else { \"$env:USERPROFILE\\.copilot\\installed-plugins\\_direct\\abhi-singhs--copilot-token-meter\" }; $s = Join-Path $r 'bin\\token-meter.js'; if (Test-Path $s) { node $s --hook=userPromptSubmitted }", |
| 23 | + "bash": "[ -n \"$COPILOT_PLUGIN_ROOT\" ] || exit 0; S=\"$COPILOT_PLUGIN_ROOT/bin/token-meter.js\"; [ -f \"$S\" ] && exec node \"$S\" --hook=userPromptSubmitted; exit 0", |
| 24 | + "powershell": "if (-not $env:COPILOT_PLUGIN_ROOT) { exit 0 }; $s = Join-Path $env:COPILOT_PLUGIN_ROOT 'bin\\token-meter.js'; if (Test-Path $s) { node $s --hook=userPromptSubmitted }", |
25 | 25 | "timeoutSec": 10 |
26 | 26 | } |
27 | 27 | ], |
28 | 28 | "agentStop": [ |
29 | 29 | { |
30 | 30 | "type": "command", |
31 | | - "bash": "S=\"${COPILOT_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-$HOME/.copilot/installed-plugins/_direct/abhi-singhs--copilot-token-meter}}}/bin/token-meter.js\"; [ -f \"$S\" ] && exec node \"$S\" --hook=agentStop; exit 0", |
32 | | - "powershell": "$r = if ($env:COPILOT_PLUGIN_ROOT) { $env:COPILOT_PLUGIN_ROOT } elseif ($env:CLAUDE_PLUGIN_ROOT) { $env:CLAUDE_PLUGIN_ROOT } elseif ($env:PLUGIN_ROOT) { $env:PLUGIN_ROOT } else { \"$env:USERPROFILE\\.copilot\\installed-plugins\\_direct\\abhi-singhs--copilot-token-meter\" }; $s = Join-Path $r 'bin\\token-meter.js'; if (Test-Path $s) { node $s --hook=agentStop }", |
| 31 | + "bash": "[ -n \"$COPILOT_PLUGIN_ROOT\" ] || exit 0; S=\"$COPILOT_PLUGIN_ROOT/bin/token-meter.js\"; [ -f \"$S\" ] && exec node \"$S\" --hook=agentStop; exit 0", |
| 32 | + "powershell": "if (-not $env:COPILOT_PLUGIN_ROOT) { exit 0 }; $s = Join-Path $env:COPILOT_PLUGIN_ROOT 'bin\\token-meter.js'; if (Test-Path $s) { node $s --hook=agentStop }", |
33 | 33 | "timeoutSec": 10 |
34 | 34 | } |
35 | 35 | ] |
|
0 commit comments