@stagewhisper/stagewhisper 0.19.0 → 0.22.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 +2 -2
- package/package.json +1 -1
- package/plugin-main.ts +24 -15
- package/src/channel.ts +3 -3
- package/src/service.ts +8 -5
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "stagewhisper",
|
|
3
3
|
"name": "StageWhisper",
|
|
4
4
|
"description": "Turn live call moments into assistant tasks via StageWhisper",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.22.0",
|
|
6
6
|
"channels": [
|
|
7
7
|
"stagewhisper"
|
|
8
8
|
],
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"apiBaseUrl": {
|
|
17
17
|
"type": "string",
|
|
18
18
|
"description": "StageWhisper backend URL (e.g. https://api.stagewhisper.io)",
|
|
19
|
-
"default": ""
|
|
19
|
+
"default": "https://api.stagewhisper.io"
|
|
20
20
|
},
|
|
21
21
|
"integrationId": {
|
|
22
22
|
"type": "string",
|
package/package.json
CHANGED
package/plugin-main.ts
CHANGED
|
@@ -23,9 +23,10 @@ export default definePluginEntry({
|
|
|
23
23
|
"Pair with StageWhisper using a pairing code from the desktop app",
|
|
24
24
|
)
|
|
25
25
|
.requiredOption("--code <code>", "Pairing code from Settings → Assistant")
|
|
26
|
-
.
|
|
26
|
+
.option(
|
|
27
27
|
"--api-url <url>",
|
|
28
|
-
"StageWhisper backend URL
|
|
28
|
+
"StageWhisper backend URL",
|
|
29
|
+
"https://api.stagewhisper.io",
|
|
29
30
|
)
|
|
30
31
|
.option("--label <label>", "Label for this OpenClaw host", "OpenClaw")
|
|
31
32
|
.action(
|
|
@@ -74,8 +75,7 @@ export default definePluginEntry({
|
|
|
74
75
|
|
|
75
76
|
sw.command("status")
|
|
76
77
|
.description("Show StageWhisper relay connection status")
|
|
77
|
-
.action(() => {
|
|
78
|
-
const relayState = service.getState();
|
|
78
|
+
.action(async () => {
|
|
79
79
|
const cfg = api.pluginConfig as Record<string, string> | undefined;
|
|
80
80
|
const configured = !!(
|
|
81
81
|
cfg?.["integrationId"] && cfg?.["relayToken"]
|
|
@@ -92,17 +92,26 @@ export default definePluginEntry({
|
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
console.log(
|
|
97
|
-
console.log(
|
|
98
|
-
|
|
99
|
-
);
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
95
|
+
const apiBaseUrl = cfg?.["apiBaseUrl"] ?? "(unset)";
|
|
96
|
+
console.log(`\nStageWhisper:`);
|
|
97
|
+
console.log(` Backend: ${apiBaseUrl}`);
|
|
98
|
+
console.log(` Integration: ${cfg?.["integrationId"]}`);
|
|
99
|
+
console.log(` Label: ${cfg?.["label"] ?? "(unset)"}`);
|
|
100
|
+
|
|
101
|
+
if (cfg?.["apiBaseUrl"] && cfg?.["integrationId"] && cfg?.["relayToken"]) {
|
|
102
|
+
try {
|
|
103
|
+
const { StageWhisperClient } = await import("./src/client.js");
|
|
104
|
+
const client = new StageWhisperClient(
|
|
105
|
+
cfg["apiBaseUrl"],
|
|
106
|
+
cfg["integrationId"],
|
|
107
|
+
cfg["relayToken"],
|
|
108
|
+
);
|
|
109
|
+
await client.heartbeat();
|
|
110
|
+
console.log(" Connection: ✓ reachable\n");
|
|
111
|
+
} catch (err) {
|
|
112
|
+
console.log(` Connection: ✗ ${err}\n`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
106
115
|
});
|
|
107
116
|
},
|
|
108
117
|
{ commands: ["stagewhisper"] },
|
package/src/channel.ts
CHANGED
|
@@ -37,9 +37,9 @@ export function resolveAccount(
|
|
|
37
37
|
| undefined;
|
|
38
38
|
|
|
39
39
|
const apiBaseUrl =
|
|
40
|
-
(section["apiBaseUrl"] as string)
|
|
41
|
-
(swConfig?.["apiBaseUrl"] as string)
|
|
42
|
-
"";
|
|
40
|
+
(section["apiBaseUrl"] as string) ||
|
|
41
|
+
(swConfig?.["apiBaseUrl"] as string) ||
|
|
42
|
+
"https://api.stagewhisper.io";
|
|
43
43
|
const integrationId =
|
|
44
44
|
(section["integrationId"] as string) ??
|
|
45
45
|
(swConfig?.["integrationId"] as string) ??
|
package/src/service.ts
CHANGED
|
@@ -121,8 +121,10 @@ export function createRelayService(api: OpenClawPluginApi) {
|
|
|
121
121
|
);
|
|
122
122
|
|
|
123
123
|
abortController = new AbortController();
|
|
124
|
+
const url = client.streamUrl();
|
|
125
|
+
api.logger.info(`Connecting to relay stream: ${url}`);
|
|
124
126
|
|
|
125
|
-
const res = await fetch(
|
|
127
|
+
const res = await fetch(url, {
|
|
126
128
|
headers: client.streamHeaders(),
|
|
127
129
|
signal: abortController.signal,
|
|
128
130
|
});
|
|
@@ -223,14 +225,15 @@ export function createRelayService(api: OpenClawPluginApi) {
|
|
|
223
225
|
!account.relayToken
|
|
224
226
|
) {
|
|
225
227
|
api.logger.info(
|
|
226
|
-
"StageWhisper not
|
|
227
|
-
);
|
|
228
|
-
api.logger.info(
|
|
229
|
-
"Get the pairing code from StageWhisper desktop: Settings → Assistant → Generate Pairing Code",
|
|
228
|
+
"StageWhisper not configured — skipping relay service. Pair first with: openclaw stagewhisper pair",
|
|
230
229
|
);
|
|
231
230
|
return;
|
|
232
231
|
}
|
|
233
232
|
|
|
233
|
+
api.logger.info(
|
|
234
|
+
`StageWhisper relay starting — backend: ${account.apiBaseUrl}, integration: ${account.integrationId}`,
|
|
235
|
+
);
|
|
236
|
+
|
|
234
237
|
state.running = true;
|
|
235
238
|
startHeartbeat(account);
|
|
236
239
|
runLoop(account).catch((err) => {
|