@privateclaw/privateclaw 0.1.24 → 0.1.25
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/README.md +13 -0
- package/dist/cli.js +24 -0
- package/dist/cli.js.map +1 -1
- package/dist/compat/openclaw.d.ts +14 -0
- package/dist/compat/openclaw.js +14 -0
- package/dist/compat/openclaw.js.map +1 -1
- package/dist/openclaw-plugin.d.ts +3 -0
- package/dist/openclaw-plugin.js +35 -0
- package/dist/openclaw-plugin.js.map +1 -1
- package/dist/provider.d.ts +15 -0
- package/dist/provider.js +327 -0
- package/dist/provider.js.map +1 -1
- package/dist/types.d.ts +13 -0
- package/openclaw.plugin.json +15 -1
- package/package.json +1 -1
- package/src/cli.ts +33 -0
- package/src/compat/openclaw.ts +15 -0
- package/src/openclaw-plugin.test.ts +3 -0
- package/src/openclaw-plugin.ts +46 -0
- package/src/provider.test.ts +427 -1
- package/src/provider.ts +419 -0
- package/src/types.ts +13 -0
package/src/provider.test.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
|
-
import test from "node:test";
|
|
2
|
+
import test, { type TestContext } from "node:test";
|
|
3
3
|
import {
|
|
4
4
|
decodeInviteString,
|
|
5
5
|
decryptPayload,
|
|
@@ -115,6 +115,76 @@ async function nextRelayPayload(
|
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
async function connectGroupApp(params: {
|
|
119
|
+
invite: ReturnType<typeof decodeInviteString>;
|
|
120
|
+
appId: string;
|
|
121
|
+
displayName: string;
|
|
122
|
+
deviceLabel?: string;
|
|
123
|
+
expectedFrameCount?: number;
|
|
124
|
+
}): Promise<WebSocket> {
|
|
125
|
+
const appUrl = new URL(params.invite.appWsUrl);
|
|
126
|
+
appUrl.searchParams.set("appId", params.appId);
|
|
127
|
+
const socket = new WebSocket(appUrl.toString());
|
|
128
|
+
const attached = nextMessage(socket);
|
|
129
|
+
await waitForOpen(socket);
|
|
130
|
+
assert.equal((await attached).type, "relay:attached");
|
|
131
|
+
const initialFrames = nextMessages(socket, params.expectedFrameCount ?? 3);
|
|
132
|
+
socket.send(
|
|
133
|
+
JSON.stringify({
|
|
134
|
+
type: "app:frame",
|
|
135
|
+
envelope: encryptPayload({
|
|
136
|
+
sessionId: params.invite.sessionId,
|
|
137
|
+
sessionKey: params.invite.sessionKey,
|
|
138
|
+
payload: {
|
|
139
|
+
kind: "client_hello",
|
|
140
|
+
appId: params.appId,
|
|
141
|
+
displayName: params.displayName,
|
|
142
|
+
appVersion: "flutter-test",
|
|
143
|
+
deviceLabel: params.deviceLabel ?? `${params.displayName} device`,
|
|
144
|
+
sentAt: new Date().toISOString(),
|
|
145
|
+
},
|
|
146
|
+
}),
|
|
147
|
+
}),
|
|
148
|
+
);
|
|
149
|
+
await initialFrames;
|
|
150
|
+
return socket;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
async function createGroupBotModeHarness(
|
|
154
|
+
t: TestContext,
|
|
155
|
+
bridge: { handleUserMessage(params: { message: string }): Promise<string> },
|
|
156
|
+
providerOptions?: Partial<ConstructorParameters<typeof PrivateClawProvider>[0]>,
|
|
157
|
+
): Promise<{ invite: ReturnType<typeof decodeInviteString>; provider: PrivateClawProvider }> {
|
|
158
|
+
const relay = createRelayServer({
|
|
159
|
+
host: "127.0.0.1",
|
|
160
|
+
port: 0,
|
|
161
|
+
sessionTtlMs: 60_000,
|
|
162
|
+
frameCacheSize: 8,
|
|
163
|
+
});
|
|
164
|
+
const { port } = await relay.start();
|
|
165
|
+
t.after(async () => {
|
|
166
|
+
await relay.stop();
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
const provider = new PrivateClawProvider({
|
|
170
|
+
providerWsUrl: `ws://127.0.0.1:${port}/ws/provider`,
|
|
171
|
+
appWsUrl: `ws://127.0.0.1:${port}/ws/app`,
|
|
172
|
+
bridge,
|
|
173
|
+
defaultTtlMs: DEFAULT_SESSION_TTL_MS,
|
|
174
|
+
...providerOptions,
|
|
175
|
+
});
|
|
176
|
+
await provider.connect();
|
|
177
|
+
t.after(async () => {
|
|
178
|
+
await provider.dispose();
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
const inviteBundle = await provider.createInviteBundle({ groupMode: true });
|
|
182
|
+
return {
|
|
183
|
+
provider,
|
|
184
|
+
invite: decodeInviteString(inviteBundle.inviteUri),
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
|
|
118
188
|
function decryptRelayPayload(
|
|
119
189
|
frame: Record<string, unknown>,
|
|
120
190
|
params: { sessionId: string; sessionKey: string },
|
|
@@ -157,6 +227,27 @@ class HistoryRecordingBridge {
|
|
|
157
227
|
}
|
|
158
228
|
}
|
|
159
229
|
|
|
230
|
+
class BotModeBridge {
|
|
231
|
+
readonly prompts: string[] = [];
|
|
232
|
+
readonly promptKinds: Array<"silent_join" | "idle_group" | "user"> = [];
|
|
233
|
+
|
|
234
|
+
async handleUserMessage(params: {
|
|
235
|
+
message: string;
|
|
236
|
+
}): Promise<string> {
|
|
237
|
+
this.prompts.push(params.message);
|
|
238
|
+
if (params.message.includes("joined this PrivateClaw group chat")) {
|
|
239
|
+
this.promptKinds.push("silent_join");
|
|
240
|
+
return "Bot mode hello";
|
|
241
|
+
}
|
|
242
|
+
if (params.message.includes("has had no new message")) {
|
|
243
|
+
this.promptKinds.push("idle_group");
|
|
244
|
+
return "Bot mode joke";
|
|
245
|
+
}
|
|
246
|
+
this.promptKinds.push("user");
|
|
247
|
+
return `OpenClaw bridge: ${params.message}`;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
160
251
|
class ThinkingTraceBridge {
|
|
161
252
|
readonly supportsThinkingTrace = true;
|
|
162
253
|
readonly conversationMessages: string[] = [];
|
|
@@ -2155,6 +2246,341 @@ test("group sessions can mute and unmute bot replies without stopping participan
|
|
|
2155
2246
|
await Promise.all([waitForClose(appOne), waitForClose(appTwo)]);
|
|
2156
2247
|
});
|
|
2157
2248
|
|
|
2249
|
+
test("group bot mode stays quiet when disabled", async (t) => {
|
|
2250
|
+
const bridge = new BotModeBridge();
|
|
2251
|
+
const { invite } = await createGroupBotModeHarness(t, bridge, {
|
|
2252
|
+
botMode: false,
|
|
2253
|
+
botModeSilentJoinDelayMs: 30,
|
|
2254
|
+
botModeIdleDelayMs: 30,
|
|
2255
|
+
});
|
|
2256
|
+
const app = await connectGroupApp({
|
|
2257
|
+
invite,
|
|
2258
|
+
appId: "app-one",
|
|
2259
|
+
displayName: "SolarFox",
|
|
2260
|
+
});
|
|
2261
|
+
t.after(async () => {
|
|
2262
|
+
app.close();
|
|
2263
|
+
await waitForClose(app);
|
|
2264
|
+
});
|
|
2265
|
+
|
|
2266
|
+
await waitForNoMessage(app, 120);
|
|
2267
|
+
assert.deepEqual(bridge.promptKinds, []);
|
|
2268
|
+
});
|
|
2269
|
+
|
|
2270
|
+
test("group bot mode greets a silent participant after the configured join delay", async (t) => {
|
|
2271
|
+
const bridge = new BotModeBridge();
|
|
2272
|
+
const { invite } = await createGroupBotModeHarness(t, bridge, {
|
|
2273
|
+
botMode: true,
|
|
2274
|
+
botModeSilentJoinDelayMs: 40,
|
|
2275
|
+
botModeIdleDelayMs: 250,
|
|
2276
|
+
});
|
|
2277
|
+
const app = await connectGroupApp({
|
|
2278
|
+
invite,
|
|
2279
|
+
appId: "app-one",
|
|
2280
|
+
displayName: "SolarFox",
|
|
2281
|
+
});
|
|
2282
|
+
t.after(async () => {
|
|
2283
|
+
app.close();
|
|
2284
|
+
await waitForClose(app);
|
|
2285
|
+
});
|
|
2286
|
+
|
|
2287
|
+
const proactive = await nextRelayPayload(app, invite);
|
|
2288
|
+
assert.equal(proactive.kind, "assistant_message");
|
|
2289
|
+
assert.equal(proactive.text, "Bot mode hello");
|
|
2290
|
+
assert.deepEqual(bridge.promptKinds, ["silent_join"]);
|
|
2291
|
+
assert.match(bridge.prompts[0]!, /SolarFox/u);
|
|
2292
|
+
assert.match(bridge.prompts[0]!, /has not sent any message yet/u);
|
|
2293
|
+
assert.doesNotMatch(
|
|
2294
|
+
bridge.prompts[0]!,
|
|
2295
|
+
/write the proactive message in English/u,
|
|
2296
|
+
);
|
|
2297
|
+
await waitForNoMessage(app, 120);
|
|
2298
|
+
});
|
|
2299
|
+
|
|
2300
|
+
test("group bot mode cancels the silent-join greeting after the participant speaks", async (t) => {
|
|
2301
|
+
const bridge = new BotModeBridge();
|
|
2302
|
+
const { invite } = await createGroupBotModeHarness(t, bridge, {
|
|
2303
|
+
botMode: true,
|
|
2304
|
+
botModeSilentJoinDelayMs: 80,
|
|
2305
|
+
botModeIdleDelayMs: 250,
|
|
2306
|
+
});
|
|
2307
|
+
const app = await connectGroupApp({
|
|
2308
|
+
invite,
|
|
2309
|
+
appId: "app-one",
|
|
2310
|
+
displayName: "SolarFox",
|
|
2311
|
+
});
|
|
2312
|
+
t.after(async () => {
|
|
2313
|
+
app.close();
|
|
2314
|
+
await waitForClose(app);
|
|
2315
|
+
});
|
|
2316
|
+
|
|
2317
|
+
const replyFramesPromise = nextMessages(app, 2);
|
|
2318
|
+
app.send(
|
|
2319
|
+
JSON.stringify({
|
|
2320
|
+
type: "app:frame",
|
|
2321
|
+
envelope: encryptPayload({
|
|
2322
|
+
sessionId: invite.sessionId,
|
|
2323
|
+
sessionKey: invite.sessionKey,
|
|
2324
|
+
payload: {
|
|
2325
|
+
kind: "user_message",
|
|
2326
|
+
appId: "app-one",
|
|
2327
|
+
text: "hello there",
|
|
2328
|
+
clientMessageId: "bot-mode-user-1",
|
|
2329
|
+
sentAt: new Date().toISOString(),
|
|
2330
|
+
},
|
|
2331
|
+
}),
|
|
2332
|
+
}),
|
|
2333
|
+
);
|
|
2334
|
+
|
|
2335
|
+
const replyFrames = await replyFramesPromise;
|
|
2336
|
+
const participantEcho = decryptRelayPayload(replyFrames[0]!, invite);
|
|
2337
|
+
const assistantReply = decryptRelayPayload(replyFrames[1]!, invite);
|
|
2338
|
+
assert.equal(participantEcho.kind, "participant_message");
|
|
2339
|
+
assert.equal(assistantReply.kind, "assistant_message");
|
|
2340
|
+
assert.deepEqual(bridge.promptKinds, ["user"]);
|
|
2341
|
+
await waitForNoMessage(app, 140);
|
|
2342
|
+
});
|
|
2343
|
+
|
|
2344
|
+
test("group bot mode sends an idle follow-up after the room stays quiet", async (t) => {
|
|
2345
|
+
const bridge = new BotModeBridge();
|
|
2346
|
+
const { invite } = await createGroupBotModeHarness(t, bridge, {
|
|
2347
|
+
botMode: true,
|
|
2348
|
+
botModeSilentJoinDelayMs: 250,
|
|
2349
|
+
botModeIdleDelayMs: 60,
|
|
2350
|
+
});
|
|
2351
|
+
const app = await connectGroupApp({
|
|
2352
|
+
invite,
|
|
2353
|
+
appId: "app-one",
|
|
2354
|
+
displayName: "SolarFox",
|
|
2355
|
+
});
|
|
2356
|
+
t.after(async () => {
|
|
2357
|
+
app.close();
|
|
2358
|
+
await waitForClose(app);
|
|
2359
|
+
});
|
|
2360
|
+
|
|
2361
|
+
const replyFramesPromise = nextMessages(app, 2);
|
|
2362
|
+
app.send(
|
|
2363
|
+
JSON.stringify({
|
|
2364
|
+
type: "app:frame",
|
|
2365
|
+
envelope: encryptPayload({
|
|
2366
|
+
sessionId: invite.sessionId,
|
|
2367
|
+
sessionKey: invite.sessionKey,
|
|
2368
|
+
payload: {
|
|
2369
|
+
kind: "user_message",
|
|
2370
|
+
appId: "app-one",
|
|
2371
|
+
text: "keep this in mind",
|
|
2372
|
+
clientMessageId: "bot-mode-user-2",
|
|
2373
|
+
sentAt: new Date().toISOString(),
|
|
2374
|
+
},
|
|
2375
|
+
}),
|
|
2376
|
+
}),
|
|
2377
|
+
);
|
|
2378
|
+
const replyFrames = await replyFramesPromise;
|
|
2379
|
+
assert.equal(decryptRelayPayload(replyFrames[0]!, invite).kind, "participant_message");
|
|
2380
|
+
assert.equal(decryptRelayPayload(replyFrames[1]!, invite).kind, "assistant_message");
|
|
2381
|
+
|
|
2382
|
+
const idleFollowUp = await nextRelayPayload(app, invite);
|
|
2383
|
+
assert.equal(idleFollowUp.kind, "assistant_message");
|
|
2384
|
+
assert.equal(idleFollowUp.text, "Bot mode joke");
|
|
2385
|
+
assert.deepEqual(bridge.promptKinds, ["user", "idle_group"]);
|
|
2386
|
+
assert.match(bridge.prompts[1]!, /has had no new message/u);
|
|
2387
|
+
assert.match(
|
|
2388
|
+
bridge.prompts[1]!,
|
|
2389
|
+
/Write the proactive message in the same language as the recent user\/assistant conversation already in this session\./u,
|
|
2390
|
+
);
|
|
2391
|
+
});
|
|
2392
|
+
|
|
2393
|
+
test("group bot mode idle timing ignores non-human assistant broadcasts", async (t) => {
|
|
2394
|
+
const bridge = new BotModeBridge();
|
|
2395
|
+
const { invite, provider } = await createGroupBotModeHarness(t, bridge, {
|
|
2396
|
+
botMode: true,
|
|
2397
|
+
botModeSilentJoinDelayMs: 250,
|
|
2398
|
+
botModeIdleDelayMs: 160,
|
|
2399
|
+
});
|
|
2400
|
+
const app = await connectGroupApp({
|
|
2401
|
+
invite,
|
|
2402
|
+
appId: "app-one",
|
|
2403
|
+
displayName: "SolarFox",
|
|
2404
|
+
});
|
|
2405
|
+
t.after(async () => {
|
|
2406
|
+
app.close();
|
|
2407
|
+
await waitForClose(app);
|
|
2408
|
+
});
|
|
2409
|
+
|
|
2410
|
+
const replyFramesPromise = nextMessages(app, 2);
|
|
2411
|
+
app.send(
|
|
2412
|
+
JSON.stringify({
|
|
2413
|
+
type: "app:frame",
|
|
2414
|
+
envelope: encryptPayload({
|
|
2415
|
+
sessionId: invite.sessionId,
|
|
2416
|
+
sessionKey: invite.sessionKey,
|
|
2417
|
+
payload: {
|
|
2418
|
+
kind: "user_message",
|
|
2419
|
+
appId: "app-one",
|
|
2420
|
+
text: "keep the room warm",
|
|
2421
|
+
clientMessageId: "bot-mode-user-3",
|
|
2422
|
+
sentAt: new Date().toISOString(),
|
|
2423
|
+
},
|
|
2424
|
+
}),
|
|
2425
|
+
}),
|
|
2426
|
+
);
|
|
2427
|
+
await replyFramesPromise;
|
|
2428
|
+
|
|
2429
|
+
await new Promise((resolve) => setTimeout(resolve, 110));
|
|
2430
|
+
const qrPayloadPromise = nextRelayPayload(app, invite);
|
|
2431
|
+
await provider.getSessionQrBundle(invite.sessionId, { notifyParticipants: true });
|
|
2432
|
+
const qrPayload = await qrPayloadPromise;
|
|
2433
|
+
assert.equal(qrPayload.kind, "assistant_message");
|
|
2434
|
+
|
|
2435
|
+
const idleWaitStartedAt = Date.now();
|
|
2436
|
+
const idleFollowUp = await nextRelayPayload(app, invite);
|
|
2437
|
+
const idleElapsedMs = Date.now() - idleWaitStartedAt;
|
|
2438
|
+
assert.equal(idleFollowUp.kind, "assistant_message");
|
|
2439
|
+
assert.equal(idleFollowUp.text, "Bot mode joke");
|
|
2440
|
+
assert.ok(
|
|
2441
|
+
idleElapsedMs < 120,
|
|
2442
|
+
`expected idle follow-up without assistant reset, waited ${idleElapsedMs}ms`,
|
|
2443
|
+
);
|
|
2444
|
+
});
|
|
2445
|
+
|
|
2446
|
+
test("group bot mode idle timing ignores participant joins", async (t) => {
|
|
2447
|
+
const bridge = new BotModeBridge();
|
|
2448
|
+
const { invite } = await createGroupBotModeHarness(t, bridge, {
|
|
2449
|
+
botMode: true,
|
|
2450
|
+
botModeSilentJoinDelayMs: 250,
|
|
2451
|
+
botModeIdleDelayMs: 160,
|
|
2452
|
+
});
|
|
2453
|
+
const appOne = await connectGroupApp({
|
|
2454
|
+
invite,
|
|
2455
|
+
appId: "app-one",
|
|
2456
|
+
displayName: "SolarFox",
|
|
2457
|
+
});
|
|
2458
|
+
let appTwo: WebSocket | undefined;
|
|
2459
|
+
t.after(async () => {
|
|
2460
|
+
appOne.close();
|
|
2461
|
+
if (appTwo) {
|
|
2462
|
+
appTwo.close();
|
|
2463
|
+
}
|
|
2464
|
+
await Promise.all([
|
|
2465
|
+
waitForClose(appOne),
|
|
2466
|
+
...(appTwo ? [waitForClose(appTwo)] : []),
|
|
2467
|
+
]);
|
|
2468
|
+
});
|
|
2469
|
+
|
|
2470
|
+
const replyFramesPromise = nextMessages(appOne, 2);
|
|
2471
|
+
appOne.send(
|
|
2472
|
+
JSON.stringify({
|
|
2473
|
+
type: "app:frame",
|
|
2474
|
+
envelope: encryptPayload({
|
|
2475
|
+
sessionId: invite.sessionId,
|
|
2476
|
+
sessionKey: invite.sessionKey,
|
|
2477
|
+
payload: {
|
|
2478
|
+
kind: "user_message",
|
|
2479
|
+
appId: "app-one",
|
|
2480
|
+
text: "staying active",
|
|
2481
|
+
clientMessageId: "bot-mode-user-4",
|
|
2482
|
+
sentAt: new Date().toISOString(),
|
|
2483
|
+
},
|
|
2484
|
+
}),
|
|
2485
|
+
}),
|
|
2486
|
+
);
|
|
2487
|
+
await replyFramesPromise;
|
|
2488
|
+
|
|
2489
|
+
await new Promise((resolve) => setTimeout(resolve, 110));
|
|
2490
|
+
const joinFramesPromise = nextMessages(appOne, 2);
|
|
2491
|
+
appTwo = await connectGroupApp({
|
|
2492
|
+
invite,
|
|
2493
|
+
appId: "app-two",
|
|
2494
|
+
displayName: "RiverCat",
|
|
2495
|
+
expectedFrameCount: 5,
|
|
2496
|
+
});
|
|
2497
|
+
await joinFramesPromise;
|
|
2498
|
+
|
|
2499
|
+
const idleWaitStartedAt = Date.now();
|
|
2500
|
+
const idleFollowUp = await nextRelayPayload(appOne, invite);
|
|
2501
|
+
const idleElapsedMs = Date.now() - idleWaitStartedAt;
|
|
2502
|
+
assert.equal(idleFollowUp.kind, "assistant_message");
|
|
2503
|
+
assert.equal(idleFollowUp.text, "Bot mode joke");
|
|
2504
|
+
assert.ok(
|
|
2505
|
+
idleElapsedMs < 120,
|
|
2506
|
+
`expected idle follow-up without join reset, waited ${idleElapsedMs}ms`,
|
|
2507
|
+
);
|
|
2508
|
+
});
|
|
2509
|
+
|
|
2510
|
+
test("group bot mode respects /mute-bot and suppresses proactive replies", async (t) => {
|
|
2511
|
+
const bridge = new BotModeBridge();
|
|
2512
|
+
const { invite } = await createGroupBotModeHarness(t, bridge, {
|
|
2513
|
+
botMode: true,
|
|
2514
|
+
botModeSilentJoinDelayMs: 50,
|
|
2515
|
+
botModeIdleDelayMs: 70,
|
|
2516
|
+
});
|
|
2517
|
+
const app = await connectGroupApp({
|
|
2518
|
+
invite,
|
|
2519
|
+
appId: "app-one",
|
|
2520
|
+
displayName: "SolarFox",
|
|
2521
|
+
});
|
|
2522
|
+
t.after(async () => {
|
|
2523
|
+
app.close();
|
|
2524
|
+
await waitForClose(app);
|
|
2525
|
+
});
|
|
2526
|
+
|
|
2527
|
+
const muteFramesPromise = nextMessages(app, 2);
|
|
2528
|
+
app.send(
|
|
2529
|
+
JSON.stringify({
|
|
2530
|
+
type: "app:frame",
|
|
2531
|
+
envelope: encryptPayload({
|
|
2532
|
+
sessionId: invite.sessionId,
|
|
2533
|
+
sessionKey: invite.sessionKey,
|
|
2534
|
+
payload: {
|
|
2535
|
+
kind: "user_message",
|
|
2536
|
+
appId: "app-one",
|
|
2537
|
+
text: "/mute-bot",
|
|
2538
|
+
clientMessageId: "bot-mode-mute-1",
|
|
2539
|
+
sentAt: new Date().toISOString(),
|
|
2540
|
+
},
|
|
2541
|
+
}),
|
|
2542
|
+
}),
|
|
2543
|
+
);
|
|
2544
|
+
await muteFramesPromise;
|
|
2545
|
+
|
|
2546
|
+
await waitForNoMessage(app, 150);
|
|
2547
|
+
assert.deepEqual(bridge.promptKinds, []);
|
|
2548
|
+
});
|
|
2549
|
+
|
|
2550
|
+
test("group bot mode does not greet the same silent participant twice after reconnect", async (t) => {
|
|
2551
|
+
const bridge = new BotModeBridge();
|
|
2552
|
+
const { invite } = await createGroupBotModeHarness(t, bridge, {
|
|
2553
|
+
botMode: true,
|
|
2554
|
+
botModeSilentJoinDelayMs: 40,
|
|
2555
|
+
botModeIdleDelayMs: 250,
|
|
2556
|
+
});
|
|
2557
|
+
const app = await connectGroupApp({
|
|
2558
|
+
invite,
|
|
2559
|
+
appId: "app-one",
|
|
2560
|
+
displayName: "SolarFox",
|
|
2561
|
+
});
|
|
2562
|
+
|
|
2563
|
+
const proactive = await nextRelayPayload(app, invite);
|
|
2564
|
+
assert.equal(proactive.kind, "assistant_message");
|
|
2565
|
+
assert.equal(proactive.text, "Bot mode hello");
|
|
2566
|
+
app.close();
|
|
2567
|
+
await waitForClose(app);
|
|
2568
|
+
|
|
2569
|
+
const reconnect = await connectGroupApp({
|
|
2570
|
+
invite,
|
|
2571
|
+
appId: "app-one",
|
|
2572
|
+
displayName: "SolarFox",
|
|
2573
|
+
expectedFrameCount: 4,
|
|
2574
|
+
});
|
|
2575
|
+
t.after(async () => {
|
|
2576
|
+
reconnect.close();
|
|
2577
|
+
await waitForClose(reconnect);
|
|
2578
|
+
});
|
|
2579
|
+
|
|
2580
|
+
await waitForNoMessage(reconnect, 120);
|
|
2581
|
+
assert.deepEqual(bridge.promptKinds, ["silent_join"]);
|
|
2582
|
+
});
|
|
2583
|
+
|
|
2158
2584
|
test("provider forwards unknown slash commands verbatim to the bridge even when bot replies are muted", async (t) => {
|
|
2159
2585
|
const relay = createRelayServer({
|
|
2160
2586
|
host: "127.0.0.1",
|