@golproductions/check 1.3.3 → 1.3.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.
- package/package.json +1 -1
- package/src/index.js +8 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golproductions/check",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.4",
|
|
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
|
@@ -6,7 +6,7 @@ import { readFileSync, writeFileSync, mkdirSync, existsSync } from "node:fs";
|
|
|
6
6
|
import { join } from "node:path";
|
|
7
7
|
import { homedir } from "node:os";
|
|
8
8
|
|
|
9
|
-
const VERSION = "1.3.
|
|
9
|
+
const VERSION = "1.3.4";
|
|
10
10
|
const API = "https://triage.golproductions.com/preflight";
|
|
11
11
|
const LOG_API = "https://triage.golproductions.com/log";
|
|
12
12
|
const CLIENT_ID = process.env.GOL_CLIENT_ID || "";
|
|
@@ -155,7 +155,7 @@ function binaryExists(base) {
|
|
|
155
155
|
} catch { return false; }
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
function respond(platform, allowed, reason) {
|
|
158
|
+
async function respond(platform, allowed, reason) {
|
|
159
159
|
if (allowed) {
|
|
160
160
|
const out = {
|
|
161
161
|
cursor: { permission: "allow" },
|
|
@@ -163,10 +163,12 @@ function respond(platform, allowed, reason) {
|
|
|
163
163
|
claude: { hookSpecificOutput: { hookEventName: "PreToolUse", permissionDecision: "allow" } }
|
|
164
164
|
};
|
|
165
165
|
process.stdout.write(JSON.stringify(out[platform]));
|
|
166
|
+
await _logPromise;
|
|
166
167
|
process.exit(0);
|
|
167
168
|
}
|
|
168
169
|
if (platform === "gemini") {
|
|
169
170
|
process.stderr.write(reason + "\n");
|
|
171
|
+
await _logPromise;
|
|
170
172
|
process.exit(2);
|
|
171
173
|
}
|
|
172
174
|
const out = {
|
|
@@ -174,9 +176,12 @@ function respond(platform, allowed, reason) {
|
|
|
174
176
|
claude: { hookSpecificOutput: { hookEventName: "PreToolUse", permissionDecision: "deny", permissionDecisionReason: reason } }
|
|
175
177
|
};
|
|
176
178
|
process.stdout.write(JSON.stringify(out[platform]));
|
|
179
|
+
await _logPromise;
|
|
177
180
|
process.exit(0);
|
|
178
181
|
}
|
|
179
182
|
|
|
183
|
+
let _logPromise = Promise.resolve();
|
|
184
|
+
|
|
180
185
|
function logEvent(event) {
|
|
181
186
|
if (!CLIENT_ID) return;
|
|
182
187
|
const log = {
|
|
@@ -190,7 +195,7 @@ function logEvent(event) {
|
|
|
190
195
|
if (event.verdict === "deny") {
|
|
191
196
|
log.tokens_saved_est = 6000;
|
|
192
197
|
}
|
|
193
|
-
fetch(LOG_API, {
|
|
198
|
+
_logPromise = fetch(LOG_API, {
|
|
194
199
|
method: "POST",
|
|
195
200
|
headers: {
|
|
196
201
|
"Content-Type": "application/json",
|