@stagewhisper/stagewhisper 0.43.0 → 0.44.0
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/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/plugin-main.ts +9 -2
- package/src/openresponses.ts +9 -17
- package/src/reasoning.ts +2 -2
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
package/plugin-main.ts
CHANGED
|
@@ -114,10 +114,17 @@ export default definePluginEntry({
|
|
|
114
114
|
|
|
115
115
|
sw.command("reasoning-check")
|
|
116
116
|
.description("Test reasoning capability against the local OpenResponses endpoint")
|
|
117
|
-
.option("--model <model>", "Model to use (omit to use your configured default)", "default")
|
|
117
|
+
.option("--model <model>", "Model to use (omit to use your configured default)", "openclaw/default")
|
|
118
118
|
.action(async (opts: { model: string }) => {
|
|
119
119
|
const { callOpenResponses } = await import("./src/openresponses.js");
|
|
120
|
-
const modelLabel = opts.model === "default" ? "default (configured)" : opts.model;
|
|
120
|
+
const modelLabel = opts.model === "openclaw/default" ? "default (configured)" : opts.model;
|
|
121
|
+
|
|
122
|
+
const cfg = api.config as Record<string, unknown>;
|
|
123
|
+
const gw = (cfg?.gateway as Record<string, unknown>) ?? {};
|
|
124
|
+
const auth = (gw?.auth as Record<string, unknown>) ?? {};
|
|
125
|
+
const port = Number(gw?.port) || 18789;
|
|
126
|
+
const hasToken = typeof auth?.token === "string" && auth.token.length > 0;
|
|
127
|
+
console.log(`Gateway: 127.0.0.1:${port}, auth token: ${hasToken ? "present" : "MISSING"}`);
|
|
121
128
|
console.log(`Testing reasoning with model: ${modelLabel}`);
|
|
122
129
|
console.log("Sending test request to local /v1/responses ...");
|
|
123
130
|
|
package/src/openresponses.ts
CHANGED
|
@@ -5,25 +5,17 @@ type GatewayConfig = { url: string; apiKey: string | null };
|
|
|
5
5
|
function resolveGatewayConfig(api: OpenClawPluginApi): GatewayConfig {
|
|
6
6
|
const cfg = api.config as Record<string, unknown>;
|
|
7
7
|
const gw = (cfg?.gateway as Record<string, unknown>) ?? {};
|
|
8
|
-
const
|
|
9
|
-
const rawKey = typeof gw?.apiKey === "string" ? gw.apiKey : null;
|
|
8
|
+
const auth = (gw?.auth as Record<string, unknown>) ?? {};
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
parsed.hostname === "::1" ||
|
|
19
|
-
parsed.protocol === "https:";
|
|
20
|
-
apiKey = safe ? rawKey : null;
|
|
21
|
-
} catch {
|
|
22
|
-
apiKey = null;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
10
|
+
const port = Number(gw?.port) || 18789;
|
|
11
|
+
const explicitUrl = typeof gw?.url === "string" ? gw.url : null;
|
|
12
|
+
const url = (explicitUrl ?? `http://127.0.0.1:${port}`).replace(/\/+$/, "");
|
|
13
|
+
|
|
14
|
+
const token =
|
|
15
|
+
(typeof auth?.token === "string" ? auth.token : null) ??
|
|
16
|
+
(typeof process !== "undefined" ? process.env.OPENCLAW_GATEWAY_TOKEN ?? null : null);
|
|
25
17
|
|
|
26
|
-
return { url, apiKey };
|
|
18
|
+
return { url, apiKey: token };
|
|
27
19
|
}
|
|
28
20
|
|
|
29
21
|
export async function callOpenResponses(
|
package/src/reasoning.ts
CHANGED
|
@@ -16,7 +16,7 @@ export async function probeOpenResponses(
|
|
|
16
16
|
api: OpenClawPluginApi,
|
|
17
17
|
): Promise<ProbeResult> {
|
|
18
18
|
const body: OpenResponsesCreateResponseRequestBody = {
|
|
19
|
-
model: "default",
|
|
19
|
+
model: "openclaw/default",
|
|
20
20
|
input: "Reply with exactly: OK",
|
|
21
21
|
max_output_tokens: 16,
|
|
22
22
|
temperature: 0,
|
|
@@ -103,7 +103,7 @@ export async function executeReasoningJob(
|
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
const model = job.model ?? displayModel ?? "default";
|
|
106
|
+
const model = job.model ?? displayModel ?? "openclaw/default";
|
|
107
107
|
const correlationId = job.correlation_id;
|
|
108
108
|
|
|
109
109
|
const requestBody: OpenResponsesCreateResponseRequestBody = {
|