@golproductions/check 3.0.0 → 3.0.2
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 +2 -10
- package/src/index.js +10 -6
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golproductions/check",
|
|
3
|
-
"version": "3.0.
|
|
4
|
-
"description": "The anti-hallucination layer for AI agents.
|
|
3
|
+
"version": "3.0.2",
|
|
4
|
+
"description": "The anti-hallucination layer for AI agents. Supports Claude Code, Antigravity, and Cursor.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"check": "src/index.js",
|
|
7
7
|
"check-mcp": "src/mcp.js"
|
|
@@ -17,20 +17,12 @@
|
|
|
17
17
|
],
|
|
18
18
|
"keywords": [
|
|
19
19
|
"claude-code",
|
|
20
|
-
"gemini-cli",
|
|
21
20
|
"antigravity",
|
|
22
21
|
"cursor",
|
|
23
|
-
"hooks",
|
|
24
|
-
"pretooluse",
|
|
25
|
-
"beforetool",
|
|
26
|
-
"beforeshellexecution",
|
|
27
22
|
"command-validation",
|
|
28
23
|
"anti-hallucination",
|
|
29
24
|
"firewall",
|
|
30
25
|
"ai-agents",
|
|
31
|
-
"vscode",
|
|
32
|
-
"openvsx",
|
|
33
|
-
"windsurf",
|
|
34
26
|
"mcp",
|
|
35
27
|
"model-context-protocol"
|
|
36
28
|
],
|
package/src/index.js
CHANGED
|
@@ -5,7 +5,8 @@ import { homedir, platform, arch } from "node:os";
|
|
|
5
5
|
import { pipeline } from "node:stream/promises";
|
|
6
6
|
import { Readable } from "node:stream";
|
|
7
7
|
|
|
8
|
-
const VERSION = "3.0.
|
|
8
|
+
const VERSION = "3.0.2";
|
|
9
|
+
const BINARY_VERSION = "3.0.0";
|
|
9
10
|
const API = "https://triage.golproductions.com/preflight";
|
|
10
11
|
const CDN = "https://pub-e55366a7f5994be9be04f0e205179f4a.r2.dev/releases";
|
|
11
12
|
const CLIENT_ID = process.env.GOL_CLIENT_ID || "";
|
|
@@ -14,8 +15,7 @@ async function downloadBinary(dest) {
|
|
|
14
15
|
const os = platform() === "win32" ? "win" : platform() === "darwin" ? "macos" : "linux";
|
|
15
16
|
const cpu = arch() === "arm64" ? "arm64" : "x64";
|
|
16
17
|
const ext = os === "win" ? ".exe" : "";
|
|
17
|
-
const url = `${CDN}/truth-gate-v${
|
|
18
|
-
console.log(` Downloading truth engine...`);
|
|
18
|
+
const url = `${CDN}/truth-gate-v${BINARY_VERSION}-${os}-${cpu}${ext}`;
|
|
19
19
|
const res = await fetch(url);
|
|
20
20
|
if (!res.ok) throw new Error(`Download failed: ${res.status}`);
|
|
21
21
|
await pipeline(Readable.fromWeb(res.body), createWriteStream(dest));
|
|
@@ -87,6 +87,7 @@ async function install() {
|
|
|
87
87
|
}
|
|
88
88
|
];
|
|
89
89
|
|
|
90
|
+
let hasClaude = false;
|
|
90
91
|
for (const t of targets) {
|
|
91
92
|
if (!existsSync(t.dir)) continue;
|
|
92
93
|
const filepath = join(t.dir, t.file);
|
|
@@ -95,6 +96,7 @@ async function install() {
|
|
|
95
96
|
const updated = t.config(existing);
|
|
96
97
|
writeFileSync(filepath, JSON.stringify(updated, null, 2) + "\n", "utf8");
|
|
97
98
|
installed++;
|
|
99
|
+
if (t.name === "Claude Code") hasClaude = true;
|
|
98
100
|
}
|
|
99
101
|
|
|
100
102
|
if (installed === 0) {
|
|
@@ -104,15 +106,17 @@ async function install() {
|
|
|
104
106
|
try { existing = JSON.parse(readFileSync(filepath, "utf8")); } catch {}
|
|
105
107
|
const updated = targets[0].config(existing);
|
|
106
108
|
writeFileSync(filepath, JSON.stringify(updated, null, 2) + "\n", "utf8");
|
|
109
|
+
hasClaude = true;
|
|
107
110
|
}
|
|
108
111
|
|
|
109
|
-
const agentsMd = join(process.cwd(), "AGENTS.md");
|
|
110
112
|
const checkRule = "Never fabricate, hallucinate, or invent values. If you don't have it, say you don't have it. No fake keys, no fake IDs, no fake paths, no fake URLs. If unsure, ask. Never guess and present it as fact.";
|
|
113
|
+
const ruleFile = hasClaude ? "CLAUDE.md" : "AGENTS.md";
|
|
114
|
+
const rulePath = join(process.cwd(), ruleFile);
|
|
111
115
|
try {
|
|
112
|
-
const existing = existsSync(
|
|
116
|
+
const existing = existsSync(rulePath) ? readFileSync(rulePath, "utf8") : "";
|
|
113
117
|
if (!existing.includes("Never fabricate")) {
|
|
114
118
|
const prefix = existing.length > 0 ? existing.trimEnd() + "\n\n" : "";
|
|
115
|
-
writeFileSync(
|
|
119
|
+
writeFileSync(rulePath, prefix + checkRule + "\n", "utf8");
|
|
116
120
|
}
|
|
117
121
|
} catch {}
|
|
118
122
|
|