@nicfox77/parakeet-stt 0.2.4 → 0.2.5

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/package.json +2 -2
  2. package/scripts/install.sh +35 -49
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@nicfox77/parakeet-stt",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Parakeet TDT INT8 speech-to-text plugin for OpenClaw. Supports V2 (English) and V3 (Multilingual) models.",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "git+https://github.com/Nicfox77/openclaw-parakeet-stt.git"
8
+ "url": "git+https://github.com/Nicfox77/openclaw-parakeet-stt-plugin.git"
9
9
  },
10
10
  "author": "Nicfox77",
11
11
  "license": "MIT",
@@ -8,7 +8,6 @@ set -e
8
8
  # Configuration
9
9
  PARAKEET_DIR="${PARAKEET_DIR:-$HOME/.openclaw/tools/parakeet}"
10
10
  VENV_DIR="$PARAKEET_DIR/.venv"
11
- OPENCLAW_CONFIG="$HOME/.openclaw/openclaw.json"
12
11
 
13
12
  # Model URLs (GitHub release - mirrored from Handy project)
14
13
  # Fallback to Handy if GitHub is unavailable
@@ -146,64 +145,51 @@ done
146
145
 
147
146
  # Configure OpenClaw to use Parakeet for audio transcription
148
147
  configure_openclaw() {
149
- if [ ! -f "$OPENCLAW_CONFIG" ]; then
150
- echo "Warning: OpenClaw config not found at $OPENCLAW_CONFIG"
151
- return 1
152
- fi
153
-
154
- # Check if parakeet is already configured
155
- if jq -e '.tools.media.audio.models[]? | select(.command | contains("parakeet"))' "$OPENCLAW_CONFIG" > /dev/null 2>&1; then
156
- echo "Parakeet already configured in OpenClaw"
157
- return 0
158
- fi
159
-
160
148
  echo "Configuring OpenClaw to use Parakeet for audio transcription..."
161
149
 
162
- # Use config.patch RPC for partial update (cleaner than modifying file directly)
150
+ # Use config.patch RPC for partial update (no jq needed)
163
151
  if command -v openclaw &> /dev/null; then
164
- local patch_json=$(cat <<EOF
165
- {
166
- "patch": {
167
- "tools": {
168
- "media": {
169
- "audio": {
170
- "models": [
171
- {
172
- "type": "cli",
173
- "command": "$PARAKEET_DIR/parakeet-audio-client.py",
174
- "args": ["{{MediaPath}}", "{{OutputDir}}"]
152
+ openclaw gateway call config.patch --params '{
153
+ "patch": {
154
+ "tools": {
155
+ "media": {
156
+ "audio": {
157
+ "models": [{
158
+ "type": "cli",
159
+ "command": "'$PARAKEET_DIR'/parakeet-audio-client.py",
160
+ "args": ["{{MediaPath}}", "{{OutputDir}}"]
161
+ }]
162
+ }
163
+ }
164
+ }
175
165
  }
176
- ]
177
- }
178
- }
179
- }
180
- }
181
- }
182
- EOF
183
- )
184
- openclaw gateway call config.patch --params "$patch_json" 2>/dev/null && {
166
+ }' 2>/dev/null && {
185
167
  echo "Applied config.patch - Parakeet configured and gateway reloaded"
186
168
  return 0
187
169
  } || {
188
- echo "config.patch failed, falling back to file modification..."
170
+ echo "Warning: config.patch failed"
189
171
  }
190
- fi
191
-
192
- # Fallback: modify config file directly if jq available
193
- if command -v jq &> /dev/null; then
194
- local tmp_config=$(mktemp)
195
- jq '.tools.media.audio.models += [{
196
- "type": "cli",
197
- "command": "'$PARAKEET_DIR'/parakeet-audio-client.py",
198
- "args": ["{{MediaPath}}", "{{OutputDir}}"]
199
- }]' "$OPENCLAW_CONFIG" > "$tmp_config" && mv "$tmp_config" "$OPENCLAW_CONFIG"
200
- echo "Added Parakeet to tools.media.audio.models (file modified directly)"
201
- echo "Note: Gateway will auto-reload, or run: openclaw gateway restart"
202
172
  else
203
- echo "Warning: jq not found, skipping automatic config"
204
- echo "Please manually add to openclaw.json:"
205
- echo ' tools.media.audio.models: [{"type": "cli", "command": "'$PARAKEET_DIR'/parakeet-audio-client.py", "args": ["{{MediaPath}}", "{{OutputDir}}"]}]'
173
+ echo "Warning: openclaw CLI not found"
206
174
  fi
175
+
176
+ # Fallback: manual instructions
177
+ echo ""
178
+ echo "Please manually add to your openclaw.json:"
179
+ echo ""
180
+ echo ' "tools": {'
181
+ echo ' "media": {'
182
+ echo ' "audio": {'
183
+ echo ' "models": [{'
184
+ echo ' "type": "cli",'
185
+ echo ' "command": "'$PARAKEET_DIR'/parakeet-audio-client.py",'
186
+ echo ' "args": ["{{MediaPath}}", "{{OutputDir}}"]'
187
+ echo ' }]'
188
+ echo ' }'
189
+ echo ' }'
190
+ echo ' }'
191
+ echo ""
192
+ echo "Then run: openclaw gateway restart"
207
193
  }
208
194
 
209
195
  configure_openclaw || true