@zeulewan/glueclaw-provider 1.2.1 → 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 +19 -8
package/package.json
CHANGED
package/src/healthcheck.ts
CHANGED
|
@@ -89,21 +89,32 @@ const isMain =
|
|
|
89
89
|
typeof process !== "undefined" && process.argv[1]?.endsWith("healthcheck.ts");
|
|
90
90
|
if (isMain) {
|
|
91
91
|
const { scrubPrompt } = await import("./stream.js");
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
+
}
|
|
97
104
|
|
|
98
|
-
console.log("GlueClaw healthcheck");
|
|
99
105
|
console.log(" Testing scrubbed prompt against Claude CLI...\n");
|
|
100
106
|
|
|
101
|
-
const result = await runHealthcheck({ systemPrompt:
|
|
107
|
+
const result = await runHealthcheck({ systemPrompt: prompt });
|
|
102
108
|
if (result.ok) {
|
|
103
109
|
console.log(" PASS: scrubbed prompt accepted");
|
|
104
110
|
} else {
|
|
105
111
|
console.log(" FAIL: prompt rejected");
|
|
106
|
-
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
|
+
}
|
|
107
118
|
}
|
|
108
119
|
process.exit(result.ok ? 0 : 1);
|
|
109
120
|
}
|