@zeulewan/glueclaw-provider 1.2.1 → 1.2.3
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 +20 -8
package/package.json
CHANGED
package/src/healthcheck.ts
CHANGED
|
@@ -56,6 +56,7 @@ export async function runHealthcheck(opts: {
|
|
|
56
56
|
"-p",
|
|
57
57
|
"--output-format",
|
|
58
58
|
"stream-json",
|
|
59
|
+
"--verbose",
|
|
59
60
|
"--system-prompt",
|
|
60
61
|
prompt,
|
|
61
62
|
"--model",
|
|
@@ -89,21 +90,32 @@ const isMain =
|
|
|
89
90
|
typeof process !== "undefined" && process.argv[1]?.endsWith("healthcheck.ts");
|
|
90
91
|
if (isMain) {
|
|
91
92
|
const { scrubPrompt } = await import("./stream.js");
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
const promptFile = process.argv[2];
|
|
94
|
+
|
|
95
|
+
let prompt: string;
|
|
96
|
+
if (promptFile) {
|
|
97
|
+
const { readFileSync } = await import("node:fs");
|
|
98
|
+
const raw = readFileSync(promptFile, "utf8");
|
|
99
|
+
prompt = scrubPrompt(raw);
|
|
100
|
+
console.log(`GlueClaw healthcheck (prompt: ${promptFile})`);
|
|
101
|
+
} else {
|
|
102
|
+
prompt = "You are a helpful assistant running inside GlueClaw.";
|
|
103
|
+
console.log("GlueClaw healthcheck (connectivity test)");
|
|
104
|
+
}
|
|
97
105
|
|
|
98
|
-
console.log("GlueClaw healthcheck");
|
|
99
106
|
console.log(" Testing scrubbed prompt against Claude CLI...\n");
|
|
100
107
|
|
|
101
|
-
const result = await runHealthcheck({ systemPrompt:
|
|
108
|
+
const result = await runHealthcheck({ systemPrompt: prompt });
|
|
102
109
|
if (result.ok) {
|
|
103
110
|
console.log(" PASS: scrubbed prompt accepted");
|
|
104
111
|
} else {
|
|
105
112
|
console.log(" FAIL: prompt rejected");
|
|
106
|
-
console.log(` Trigger line: ${result.trigger}`);
|
|
113
|
+
if (result.trigger) console.log(` Trigger line: ${result.trigger}`);
|
|
114
|
+
if (promptFile) {
|
|
115
|
+
console.log(
|
|
116
|
+
"\n To narrow further, run with the full OpenClaw system prompt.",
|
|
117
|
+
);
|
|
118
|
+
}
|
|
107
119
|
}
|
|
108
120
|
process.exit(result.ok ? 0 : 1);
|
|
109
121
|
}
|