perceptia-mcp 1.2.0 → 1.3.0

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/dist/setup.js +9 -4
  2. package/package.json +1 -1
package/dist/setup.js CHANGED
@@ -81,9 +81,12 @@ function setupHook(configPath, apiKey) {
81
81
  const scriptName = isWin ? "perceptia-ground.ps1" : "perceptia-ground.sh";
82
82
  const scriptPath = path.join(hooksDir, scriptName);
83
83
  if (isWin) {
84
- fs.writeFileSync(scriptPath, `$query = $env:CLAUDE_USER_PROMPT
85
- if (-not $query) { exit 0 }
84
+ fs.writeFileSync(scriptPath, `$json = [Console]::In.ReadToEnd()
85
+ if (-not $json) { exit 0 }
86
86
  try {
87
+ $data = $json | ConvertFrom-Json
88
+ $query = $data.prompt
89
+ if (-not $query) { exit 0 }
87
90
  $body = @{ query = $query } | ConvertTo-Json -Compress
88
91
  $headers = @{ "Authorization" = "Bearer ${apiKey}"; "Content-Type" = "application/json"; "X-Fingerprint" = "hook-claude-${apiKey.slice(-8)}" }
89
92
  $r = Invoke-RestMethod -Uri "https://api.perceptiamcp.com/v1/ground" -Method POST -Body $body -Headers $headers -ErrorAction Stop
@@ -93,9 +96,11 @@ try {
93
96
  }
94
97
  else {
95
98
  fs.writeFileSync(scriptPath, `#!/bin/bash
96
- QUERY="$CLAUDE_USER_PROMPT"
99
+ JSON=$(cat)
100
+ [ -z "$JSON" ] && exit 0
101
+ QUERY=$(echo "$JSON" | jq -r '.prompt // empty' 2>/dev/null)
97
102
  [ -z "$QUERY" ] && exit 0
98
- BODY=$(printf '{"query":"%s"}' "$QUERY")
103
+ BODY=$(jq -n --arg q "$QUERY" '{query: $q}')
99
104
  RESULT=$(curl -s -f "https://api.perceptiamcp.com/v1/ground" \\
100
105
  -H "Authorization: Bearer ${apiKey}" \\
101
106
  -H "Content-Type: application/json" \\
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "perceptia-mcp",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "MCP server for Perceptia grounding API — one command setup for Claude, Cursor, and more",
5
5
  "type": "module",
6
6
  "bin": {