@zeulewan/glueclaw-provider 1.2.0 → 1.2.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 +1 -1
- package/src/healthcheck.ts +25 -11
package/package.json
CHANGED
package/src/healthcheck.ts
CHANGED
|
@@ -52,11 +52,14 @@ export async function runHealthcheck(opts: {
|
|
|
52
52
|
return new Promise((resolve) => {
|
|
53
53
|
const env = { ...process.env, MOCK_SCENARIO: scenario };
|
|
54
54
|
const args = [
|
|
55
|
-
"--
|
|
56
|
-
|
|
55
|
+
"--dangerously-skip-permissions",
|
|
56
|
+
"-p",
|
|
57
57
|
"--output-format",
|
|
58
58
|
"stream-json",
|
|
59
|
-
"-
|
|
59
|
+
"--system-prompt",
|
|
60
|
+
prompt,
|
|
61
|
+
"--model",
|
|
62
|
+
"claude-sonnet-4-6",
|
|
60
63
|
"say pong",
|
|
61
64
|
];
|
|
62
65
|
const proc = spawn(claudeBin, args, {
|
|
@@ -86,21 +89,32 @@ const isMain =
|
|
|
86
89
|
typeof process !== "undefined" && process.argv[1]?.endsWith("healthcheck.ts");
|
|
87
90
|
if (isMain) {
|
|
88
91
|
const { scrubPrompt } = await import("./stream.js");
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
const promptFile = process.argv[2];
|
|
93
|
+
|
|
94
|
+
let prompt: string;
|
|
95
|
+
if (promptFile) {
|
|
96
|
+
const { readFileSync } = await import("node:fs");
|
|
97
|
+
const raw = readFileSync(promptFile, "utf8");
|
|
98
|
+
prompt = scrubPrompt(raw);
|
|
99
|
+
console.log(`GlueClaw healthcheck (prompt: ${promptFile})`);
|
|
100
|
+
} else {
|
|
101
|
+
prompt = "You are a helpful assistant running inside GlueClaw.";
|
|
102
|
+
console.log("GlueClaw healthcheck (connectivity test)");
|
|
103
|
+
}
|
|
94
104
|
|
|
95
|
-
console.log("GlueClaw healthcheck");
|
|
96
105
|
console.log(" Testing scrubbed prompt against Claude CLI...\n");
|
|
97
106
|
|
|
98
|
-
const result = await runHealthcheck({ systemPrompt:
|
|
107
|
+
const result = await runHealthcheck({ systemPrompt: prompt });
|
|
99
108
|
if (result.ok) {
|
|
100
109
|
console.log(" PASS: scrubbed prompt accepted");
|
|
101
110
|
} else {
|
|
102
111
|
console.log(" FAIL: prompt rejected");
|
|
103
|
-
console.log(` Trigger line: ${result.trigger}`);
|
|
112
|
+
if (result.trigger) console.log(` Trigger line: ${result.trigger}`);
|
|
113
|
+
if (promptFile) {
|
|
114
|
+
console.log(
|
|
115
|
+
"\n To narrow further, run with the full OpenClaw system prompt.",
|
|
116
|
+
);
|
|
117
|
+
}
|
|
104
118
|
}
|
|
105
119
|
process.exit(result.ok ? 0 : 1);
|
|
106
120
|
}
|