@golproductions/check 1.2.3 → 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.
- package/package.json +1 -1
- package/src/index.js +3 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golproductions/check",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Pre-execution firewall hook for AI agents. Validates every command before it reaches the shell. 152 failed commands without Check. 1 with it. Supports Claude Code, Gemini CLI, Antigravity, Cursor, and VS Code.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"check": "src/index.js"
|
package/src/index.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// Copyright (c) 2026 GOL Productions. All rights reserved. Proprietary and confidential.
|
|
3
3
|
|
|
4
4
|
import { execFileSync } from "node:child_process";
|
|
5
|
-
|
|
6
5
|
import { readFileSync, writeFileSync, mkdirSync, existsSync } from "node:fs";
|
|
7
6
|
import { join } from "node:path";
|
|
8
7
|
import { homedir } from "node:os";
|
|
9
8
|
|
|
9
|
+
const VERSION = "1.3.0";
|
|
10
10
|
const API = "https://triage.golproductions.com/preflight";
|
|
11
11
|
const CLIENT_ID = process.env.GOL_CLIENT_ID || "";
|
|
12
12
|
const TIMEOUT_MS = 5000;
|
|
@@ -179,6 +179,7 @@ async function main() {
|
|
|
179
179
|
try {
|
|
180
180
|
let input = "";
|
|
181
181
|
for await (const chunk of process.stdin) input += chunk;
|
|
182
|
+
input = input.replace(/^/, "").trim();
|
|
182
183
|
|
|
183
184
|
let parsed;
|
|
184
185
|
try { parsed = JSON.parse(input); } catch { respond("claude", true); return; }
|
|
@@ -187,12 +188,10 @@ async function main() {
|
|
|
187
188
|
const command = extractCommand(parsed, platform);
|
|
188
189
|
if (!command) { respond(platform, true); return; }
|
|
189
190
|
|
|
190
|
-
const toolName = parsed.tool_name;
|
|
191
191
|
const trimmed = command.trim();
|
|
192
192
|
const first = trimmed.split(/\s+/)[0];
|
|
193
193
|
|
|
194
194
|
if (SKIP.has(first)) { respond(platform, true); return; }
|
|
195
|
-
if (platform === "claude" && toolName === "PowerShell") { respond(platform, true); return; }
|
|
196
195
|
|
|
197
196
|
if (!CLIENT_ID) {
|
|
198
197
|
process.stderr.write("check: GOL_CLIENT_ID not set. Get your key at https://www.golproductions.com/check.html\n");
|
|
@@ -219,7 +218,7 @@ async function main() {
|
|
|
219
218
|
headers: {
|
|
220
219
|
"Content-Type": "application/json",
|
|
221
220
|
"X-GOL-CLIENT-ID": CLIENT_ID,
|
|
222
|
-
"User-Agent": "check/
|
|
221
|
+
"User-Agent": "check/" + VERSION,
|
|
223
222
|
},
|
|
224
223
|
body: JSON.stringify(payload),
|
|
225
224
|
signal: controller.signal,
|