@golproductions/check 2.5.0 → 3.0.1
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 +8 -5
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golproductions/check",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "The anti-hallucination layer for AI agents.
|
|
3
|
+
"version": "3.0.1",
|
|
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,7 @@ 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 = "
|
|
8
|
+
const VERSION = "3.0.1";
|
|
9
9
|
const API = "https://triage.golproductions.com/preflight";
|
|
10
10
|
const CDN = "https://pub-e55366a7f5994be9be04f0e205179f4a.r2.dev/releases";
|
|
11
11
|
const CLIENT_ID = process.env.GOL_CLIENT_ID || "";
|
|
@@ -15,7 +15,6 @@ async function downloadBinary(dest) {
|
|
|
15
15
|
const cpu = arch() === "arm64" ? "arm64" : "x64";
|
|
16
16
|
const ext = os === "win" ? ".exe" : "";
|
|
17
17
|
const url = `${CDN}/truth-gate-v${VERSION}-${os}-${cpu}${ext}`;
|
|
18
|
-
console.log(` Downloading truth engine...`);
|
|
19
18
|
const res = await fetch(url);
|
|
20
19
|
if (!res.ok) throw new Error(`Download failed: ${res.status}`);
|
|
21
20
|
await pipeline(Readable.fromWeb(res.body), createWriteStream(dest));
|
|
@@ -87,6 +86,7 @@ async function install() {
|
|
|
87
86
|
}
|
|
88
87
|
];
|
|
89
88
|
|
|
89
|
+
let hasClaude = false;
|
|
90
90
|
for (const t of targets) {
|
|
91
91
|
if (!existsSync(t.dir)) continue;
|
|
92
92
|
const filepath = join(t.dir, t.file);
|
|
@@ -95,6 +95,7 @@ async function install() {
|
|
|
95
95
|
const updated = t.config(existing);
|
|
96
96
|
writeFileSync(filepath, JSON.stringify(updated, null, 2) + "\n", "utf8");
|
|
97
97
|
installed++;
|
|
98
|
+
if (t.name === "Claude Code") hasClaude = true;
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
if (installed === 0) {
|
|
@@ -104,15 +105,17 @@ async function install() {
|
|
|
104
105
|
try { existing = JSON.parse(readFileSync(filepath, "utf8")); } catch {}
|
|
105
106
|
const updated = targets[0].config(existing);
|
|
106
107
|
writeFileSync(filepath, JSON.stringify(updated, null, 2) + "\n", "utf8");
|
|
108
|
+
hasClaude = true;
|
|
107
109
|
}
|
|
108
110
|
|
|
109
|
-
const agentsMd = join(process.cwd(), "AGENTS.md");
|
|
110
111
|
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.";
|
|
112
|
+
const ruleFile = hasClaude ? "CLAUDE.md" : "AGENTS.md";
|
|
113
|
+
const rulePath = join(process.cwd(), ruleFile);
|
|
111
114
|
try {
|
|
112
|
-
const existing = existsSync(
|
|
115
|
+
const existing = existsSync(rulePath) ? readFileSync(rulePath, "utf8") : "";
|
|
113
116
|
if (!existing.includes("Never fabricate")) {
|
|
114
117
|
const prefix = existing.length > 0 ? existing.trimEnd() + "\n\n" : "";
|
|
115
|
-
writeFileSync(
|
|
118
|
+
writeFileSync(rulePath, prefix + checkRule + "\n", "utf8");
|
|
116
119
|
}
|
|
117
120
|
} catch {}
|
|
118
121
|
|