@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/healthcheck.ts +19 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeulewan/glueclaw-provider",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "GlueClaw - Claude CLI subprocess provider for Max subscription",
5
5
  "type": "module",
6
6
  "engines": {
@@ -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 testPrompt =
93
- "You are a personal assistant running inside OpenClaw. " +
94
- "HEARTBEAT_OK reply_to_current [[reply_to:user]] " +
95
- "openclaw.inbound_meta generated by OpenClaw";
96
- const scrubbed = scrubPrompt(testPrompt);
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: scrubbed });
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
  }