@sjhmars/happy-bridge 0.3.5 → 0.3.6
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 +11 -4
- package/lib/types/bridge.d.ts +3 -0
- package/lib/types/catalogs.d.ts +2 -1
- package/package.json +1 -1
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
|
+
"description": "l9rBEq_description",
|
|
21
|
+
"headText": "l9rBEq_headText",
|
|
20
22
|
"error": "l9rBEq_error",
|
|
23
|
+
"select": "l9rBEq_select",
|
|
24
|
+
"row": "l9rBEq_row",
|
|
25
|
+
"body": "l9rBEq_body",
|
|
21
26
|
"status": "l9rBEq_status",
|
|
27
|
+
"label": "l9rBEq_label",
|
|
22
28
|
"header": "l9rBEq_header",
|
|
23
|
-
"row": "l9rBEq_row",
|
|
24
29
|
"card": "l9rBEq_card",
|
|
25
|
-
"label": "l9rBEq_label",
|
|
26
30
|
"button": "l9rBEq_button",
|
|
27
|
-
"headText": "l9rBEq_headText",
|
|
28
|
-
"name": "l9rBEq_name",
|
|
29
|
-
"chevron": "l9rBEq_chevron",
|
|
30
31
|
"checkbox": "l9rBEq_checkbox",
|
|
31
|
-
"
|
|
32
|
-
"select": "l9rBEq_select",
|
|
32
|
+
"chevron": "l9rBEq_chevron",
|
|
33
33
|
"qr": "l9rBEq_qr",
|
|
34
|
-
"
|
|
34
|
+
"name": "l9rBEq_name"
|
|
35
35
|
};
|
|
36
36
|
//#endregion
|
|
37
37
|
//#region src/client/HappyBridgeCard.tsx
|
package/lib/index.js
CHANGED
|
@@ -303,11 +303,12 @@ async function buildSessionMetadata(ctx, source, machineId, title, selection, _g
|
|
|
303
303
|
resume: false,
|
|
304
304
|
rpcMethods: [
|
|
305
305
|
"permission",
|
|
306
|
+
"communication",
|
|
306
307
|
"killSession",
|
|
307
308
|
"abort"
|
|
308
309
|
],
|
|
309
310
|
shell: false,
|
|
310
|
-
steering:
|
|
311
|
+
steering: true
|
|
311
312
|
},
|
|
312
313
|
currentOperatingModeCode: currentPreset === "custom" ? operatingModes[0]?.code ?? "workspace-write" : currentPreset,
|
|
313
314
|
...selected === void 0 ? {} : {
|
|
@@ -3788,7 +3789,8 @@ var HappyBridge = class {
|
|
|
3788
3789
|
const effort = messageEffort(meta);
|
|
3789
3790
|
const permissionMode = meta.permissionMode;
|
|
3790
3791
|
const publishedModel = this.lastPublished.get(agent.id)?.model;
|
|
3791
|
-
|
|
3792
|
+
const modelIsEcho = model !== void 0 && publishedModel !== void 0 && sameCatalogPick({ model: publishedModel }, { model });
|
|
3793
|
+
if (model !== void 0 && !modelIsEcho) {
|
|
3792
3794
|
if (!grantAtLeast(this.config.remoteGrant, "full")) link.socket.sendText("service", "改模型需要远程档「完整」,这条消息仍会发出。");
|
|
3793
3795
|
else this.applyModel(agent, model, typeof effort === "string" ? effort : effort === null ? null : void 0);
|
|
3794
3796
|
} else if (effort === null || typeof effort === "string") {
|
|
@@ -3953,6 +3955,9 @@ var HappyBridge = class {
|
|
|
3953
3955
|
* Queue the phone text as a user followup. The App already shows the typed
|
|
3954
3956
|
* bubble; do not send a second user envelope. Images ride as DSH
|
|
3955
3957
|
* attachments; other files land under `happy-inbox` for Harness `read`.
|
|
3958
|
+
* A turn that is still running gets the text as steering (`agent.steer`),
|
|
3959
|
+
* matching the `steering: true` capability we advertise — otherwise the
|
|
3960
|
+
* App unlocks the composer only to have the message wait a whole turn.
|
|
3956
3961
|
*/
|
|
3957
3962
|
async followup(link, agent, text, files) {
|
|
3958
3963
|
const blocks = [];
|
|
@@ -3977,10 +3982,12 @@ var HappyBridge = class {
|
|
|
3977
3982
|
if (blocks.length === 0) return;
|
|
3978
3983
|
link.skipNextUser += 1;
|
|
3979
3984
|
link.agent = agent;
|
|
3980
|
-
|
|
3985
|
+
const message = createUserMessage({
|
|
3981
3986
|
content: blocks,
|
|
3982
3987
|
source: { kind: "user" }
|
|
3983
|
-
})
|
|
3988
|
+
});
|
|
3989
|
+
if (agent.status === "running" && link.pendingHuman === void 0) agent.steer(message);
|
|
3990
|
+
else agent.followup(message);
|
|
3984
3991
|
}
|
|
3985
3992
|
/**
|
|
3986
3993
|
* Claim every download started before this text, wait, keep the successes.
|
package/lib/types/bridge.d.ts
CHANGED
|
@@ -188,6 +188,9 @@ export declare class HappyBridge {
|
|
|
188
188
|
* Queue the phone text as a user followup. The App already shows the typed
|
|
189
189
|
* bubble; do not send a second user envelope. Images ride as DSH
|
|
190
190
|
* attachments; other files land under `happy-inbox` for Harness `read`.
|
|
191
|
+
* A turn that is still running gets the text as steering (`agent.steer`),
|
|
192
|
+
* matching the `steering: true` capability we advertise — otherwise the
|
|
193
|
+
* App unlocks the composer only to have the message wait a whole turn.
|
|
191
194
|
*/
|
|
192
195
|
private followup;
|
|
193
196
|
/**
|
package/lib/types/catalogs.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sjhmars/happy-bridge",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
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",
|