runsignal 0.1.3 → 0.1.4

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.
Files changed (2) hide show
  1. package/bin/runsignal.js +75 -11
  2. package/package.json +1 -1
package/bin/runsignal.js CHANGED
@@ -120,21 +120,85 @@ function stripHookBlock(content) {
120
120
  function buildHookBlock(shellKind) {
121
121
  if (shellKind === 'powershell') {
122
122
  return `${HOOK_START}
123
- function claude { runsignal wrap -- claude @args }
124
- function codex { runsignal wrap -- codex @args }
125
- function cursor { runsignal wrap -- cursor @args }
126
- function gemini { runsignal wrap -- gemini @args }
127
- function aider { runsignal wrap -- aider @args }
123
+ function RunSignal-Resolve-NativeCommand {
124
+ param([string]$Name)
125
+ $cmd = Get-Command $Name -CommandType Application -ErrorAction SilentlyContinue | Select-Object -First 1
126
+ if (-not $cmd) { return $null }
127
+ return $cmd.Source
128
+ }
129
+ function claude {
130
+ $native = RunSignal-Resolve-NativeCommand "claude"
131
+ if (-not $native) { Write-Error "RunSignal hook: native claude executable not found."; return }
132
+ if ($args.Count -eq 0) { & $native; return }
133
+ runsignal wrap -- $native @args
134
+ }
135
+ function codex {
136
+ $native = RunSignal-Resolve-NativeCommand "codex"
137
+ if (-not $native) { Write-Error "RunSignal hook: native codex executable not found."; return }
138
+ if ($args.Count -eq 0) { & $native; return }
139
+ runsignal wrap -- $native @args
140
+ }
141
+ function cursor {
142
+ $native = RunSignal-Resolve-NativeCommand "cursor"
143
+ if (-not $native) { Write-Error "RunSignal hook: native cursor executable not found."; return }
144
+ if ($args.Count -eq 0) { & $native; return }
145
+ runsignal wrap -- $native @args
146
+ }
147
+ function gemini {
148
+ $native = RunSignal-Resolve-NativeCommand "gemini"
149
+ if (-not $native) { Write-Error "RunSignal hook: native gemini executable not found."; return }
150
+ if ($args.Count -eq 0) { & $native; return }
151
+ runsignal wrap -- $native @args
152
+ }
153
+ function aider {
154
+ $native = RunSignal-Resolve-NativeCommand "aider"
155
+ if (-not $native) { Write-Error "RunSignal hook: native aider executable not found."; return }
156
+ if ($args.Count -eq 0) { & $native; return }
157
+ runsignal wrap -- $native @args
158
+ }
128
159
  ${HOOK_END}
129
160
  `;
130
161
  }
131
162
 
132
163
  return `${HOOK_START}
133
- claude() { runsignal wrap -- claude "$@"; }
134
- codex() { runsignal wrap -- codex "$@"; }
135
- cursor() { runsignal wrap -- cursor "$@"; }
136
- gemini() { runsignal wrap -- gemini "$@"; }
137
- aider() { runsignal wrap -- aider "$@"; }
164
+ runsignal_resolve_native() {
165
+ type -P "$1" 2>/dev/null
166
+ }
167
+ claude() {
168
+ local native
169
+ native="$(runsignal_resolve_native claude)"
170
+ if [ -z "$native" ]; then echo "RunSignal hook: native claude executable not found." >&2; return 127; fi
171
+ if [ "$#" -eq 0 ]; then "$native"; return $?; fi
172
+ runsignal wrap -- "$native" "$@"
173
+ }
174
+ codex() {
175
+ local native
176
+ native="$(runsignal_resolve_native codex)"
177
+ if [ -z "$native" ]; then echo "RunSignal hook: native codex executable not found." >&2; return 127; fi
178
+ if [ "$#" -eq 0 ]; then "$native"; return $?; fi
179
+ runsignal wrap -- "$native" "$@"
180
+ }
181
+ cursor() {
182
+ local native
183
+ native="$(runsignal_resolve_native cursor)"
184
+ if [ -z "$native" ]; then echo "RunSignal hook: native cursor executable not found." >&2; return 127; fi
185
+ if [ "$#" -eq 0 ]; then "$native"; return $?; fi
186
+ runsignal wrap -- "$native" "$@"
187
+ }
188
+ gemini() {
189
+ local native
190
+ native="$(runsignal_resolve_native gemini)"
191
+ if [ -z "$native" ]; then echo "RunSignal hook: native gemini executable not found." >&2; return 127; fi
192
+ if [ "$#" -eq 0 ]; then "$native"; return $?; fi
193
+ runsignal wrap -- "$native" "$@"
194
+ }
195
+ aider() {
196
+ local native
197
+ native="$(runsignal_resolve_native aider)"
198
+ if [ -z "$native" ]; then echo "RunSignal hook: native aider executable not found." >&2; return 127; fi
199
+ if [ "$#" -eq 0 ]; then "$native"; return $?; fi
200
+ runsignal wrap -- "$native" "$@"
201
+ }
138
202
  ${HOOK_END}
139
203
  `;
140
204
  }
@@ -795,7 +859,7 @@ async function runLogout() {
795
859
 
796
860
  const program = new Command();
797
861
 
798
- program.name('runsignal').description('RunSignal CLI').version('0.1.3');
862
+ program.name('runsignal').description('RunSignal CLI').version('0.1.4');
799
863
 
800
864
  program
801
865
  .command('login')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runsignal",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "RunSignal CLI for wrapping AI agent runs and handling approvals",
5
5
  "type": "module",
6
6
  "license": "MIT",