@sjhmars/happy-bridge 0.3.4 → 0.3.5
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/lib/client.js +8 -8
- package/lib/index.js +8 -3
- package/package.json +2 -2
package/lib/client.js
CHANGED
|
@@ -17,21 +17,21 @@ window.__ModuleLoader__.load({
|
|
|
17
17
|
document.head.appendChild(tag);
|
|
18
18
|
}
|
|
19
19
|
var HappyBridgeCard_module_css_default = {
|
|
20
|
-
"status": "l9rBEq_status",
|
|
21
|
-
"description": "l9rBEq_description",
|
|
22
|
-
"row": "l9rBEq_row",
|
|
23
20
|
"error": "l9rBEq_error",
|
|
21
|
+
"status": "l9rBEq_status",
|
|
24
22
|
"header": "l9rBEq_header",
|
|
25
|
-
"
|
|
23
|
+
"row": "l9rBEq_row",
|
|
26
24
|
"card": "l9rBEq_card",
|
|
27
|
-
"
|
|
28
|
-
"qr": "l9rBEq_qr",
|
|
25
|
+
"label": "l9rBEq_label",
|
|
29
26
|
"button": "l9rBEq_button",
|
|
30
27
|
"headText": "l9rBEq_headText",
|
|
31
28
|
"name": "l9rBEq_name",
|
|
32
29
|
"chevron": "l9rBEq_chevron",
|
|
33
|
-
"
|
|
34
|
-
"
|
|
30
|
+
"checkbox": "l9rBEq_checkbox",
|
|
31
|
+
"body": "l9rBEq_body",
|
|
32
|
+
"select": "l9rBEq_select",
|
|
33
|
+
"qr": "l9rBEq_qr",
|
|
34
|
+
"description": "l9rBEq_description"
|
|
35
35
|
};
|
|
36
36
|
//#endregion
|
|
37
37
|
//#region src/client/HappyBridgeCard.tsx
|
package/lib/index.js
CHANGED
|
@@ -4266,7 +4266,10 @@ var HappyBridge = class {
|
|
|
4266
4266
|
onPermission(dshId, rpc) {
|
|
4267
4267
|
const link = this.links.get(dshId);
|
|
4268
4268
|
const pending = link?.pendingHuman;
|
|
4269
|
-
if (link === void 0 || pending === void 0 || pending.id !== rpc.id)
|
|
4269
|
+
if (link === void 0 || pending === void 0 || pending.id !== rpc.id) {
|
|
4270
|
+
this.log(`收到无法匹配的审批答复 id=${rpc.id}(旧卡片,或另一个实例抢走了本会话的 RPC)`);
|
|
4271
|
+
return;
|
|
4272
|
+
}
|
|
4270
4273
|
if (pending.kind === "approval") {
|
|
4271
4274
|
if (rpc.approved) {
|
|
4272
4275
|
if (rpc.decision === "approved_for_session") link.alwaysAllow.add(pending.toolName);
|
|
@@ -4314,8 +4317,10 @@ var HappyBridge = class {
|
|
|
4314
4317
|
onCommunication(dshId, rpc) {
|
|
4315
4318
|
const link = this.links.get(dshId);
|
|
4316
4319
|
const pending = link?.pendingHuman;
|
|
4317
|
-
if (link === void 0 || pending === void 0 || pending.kind !== "ask")
|
|
4318
|
-
|
|
4320
|
+
if (link === void 0 || pending === void 0 || pending.kind !== "ask" || pending.id !== rpc.id || pending.communication === void 0) {
|
|
4321
|
+
this.log(`收到无法匹配的表单答复 id=${rpc.id}(旧卡片,或另一个实例抢走了本会话的 RPC)`);
|
|
4322
|
+
return;
|
|
4323
|
+
}
|
|
4319
4324
|
if (rpc.status !== "answered" || rpc.answers === void 0) {
|
|
4320
4325
|
pending.deferred ??= {};
|
|
4321
4326
|
this.completeCommunication(link, rpc.id, pending.communication, "cancelled");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sjhmars/happy-bridge",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"description": "Remote-control bridge: pair a running dsh web/desktop client with the Happy mobile app by QR code, then remote-control the same harness sessions from the phone (send messages, read replies, approve tool calls, switch models)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|
|
@@ -121,6 +121,6 @@
|
|
|
121
121
|
"scripts": {
|
|
122
122
|
"build": "tsc -p tsconfig.json && tsdown -c tsdown.config.ts",
|
|
123
123
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
124
|
-
"test": "node --experimental-strip-types --test tests/*.test.ts"
|
|
124
|
+
"test": "node --experimental-strip-types --experimental-test-isolation=none --import ./tests/peer-stubs/register.mjs --test tests/*.test.ts"
|
|
125
125
|
}
|
|
126
126
|
}
|