@geohar/un-bien 0.20.2 → 0.20.4
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/dist/bin/launcher.js +8 -1
- package/dist/bin/launcher.js.map +1 -1
- package/dist/commands/housekeeping.js +19 -1
- package/dist/commands/housekeeping.js.map +1 -1
- package/dist/daemon/install.d.ts +2 -0
- package/dist/daemon/install.js +4 -0
- package/dist/daemon/install.js.map +1 -1
- package/dist/daemon/relayService.d.ts +2 -0
- package/dist/daemon/relayService.js +3 -1
- package/dist/daemon/relayService.js.map +1 -1
- package/dist/launch.d.ts +2 -2
- package/dist/launch.js +14 -3
- package/dist/launch.js.map +1 -1
- package/dist/launcher/launcher.d.ts +15 -1
- package/dist/launcher/launcher.js +192 -53
- package/dist/launcher/launcher.js.map +1 -1
- package/dist/pairing/storage.d.ts +11 -0
- package/dist/pairing/storage.js +20 -1
- package/dist/pairing/storage.js.map +1 -1
- package/dist/protocol/types.d.ts +24 -0
- package/dist/session/rpc_envelope.d.ts +21 -0
- package/dist/session/rpc_envelope.js +6 -1
- package/dist/session/rpc_envelope.js.map +1 -1
- package/dist/transport/peer_channel.d.ts +14 -1
- package/dist/transport/peer_channel.js +21 -3
- package/dist/transport/peer_channel.js.map +1 -1
- package/package.json +1 -1
- package/service-templates/launchd.plist.template +2 -0
- package/service-templates/relay-launchd.plist.template +2 -0
- package/service-templates/relay-systemd.service.template +1 -0
- package/service-templates/systemd.service.template +1 -0
|
@@ -27,7 +27,14 @@ export declare class PlainPeerChannel implements PeerChannel {
|
|
|
27
27
|
/** Supplies the SENDING session's pi sessionId, stamped on every outbound
|
|
28
28
|
* envelope so the app keys per-session state by the pi id (not the room). */
|
|
29
29
|
private readonly sessionIdProvider?;
|
|
30
|
+
/** Re-enable the forward-compat room stamp: outbound outer envelopes
|
|
31
|
+
* carry `room: myRoomId`. Required for hosts whose reply routing needs
|
|
32
|
+
* the (peer, room) pair to match a registered connection — e.g. the
|
|
33
|
+
* launcher daemon, whose control room is NOT the relay default. The
|
|
34
|
+
* session-extension path stays on the legacy roomless form. */
|
|
35
|
+
private readonly includeRoomInOuter?;
|
|
30
36
|
private readonly _unsubscribe;
|
|
37
|
+
private readonly _myRoomId;
|
|
31
38
|
constructor(relay: RelayClient, remotePeerId: string,
|
|
32
39
|
/**
|
|
33
40
|
* This Pi's room id. Currently NOT injected in the outer envelope
|
|
@@ -42,7 +49,13 @@ export declare class PlainPeerChannel implements PeerChannel {
|
|
|
42
49
|
onRpc?: ((env: EnvelopeMessage, sender: PlainPeerChannel) => void) | undefined,
|
|
43
50
|
/** Supplies the SENDING session's pi sessionId, stamped on every outbound
|
|
44
51
|
* envelope so the app keys per-session state by the pi id (not the room). */
|
|
45
|
-
sessionIdProvider?: (() => string | undefined) | undefined
|
|
52
|
+
sessionIdProvider?: (() => string | undefined) | undefined,
|
|
53
|
+
/** Re-enable the forward-compat room stamp: outbound outer envelopes
|
|
54
|
+
* carry `room: myRoomId`. Required for hosts whose reply routing needs
|
|
55
|
+
* the (peer, room) pair to match a registered connection — e.g. the
|
|
56
|
+
* launcher daemon, whose control room is NOT the relay default. The
|
|
57
|
+
* session-extension path stays on the legacy roomless form. */
|
|
58
|
+
includeRoomInOuter?: boolean | undefined);
|
|
46
59
|
send(msg: ServerMessage): void;
|
|
47
60
|
/**
|
|
48
61
|
* Send an rpc-envelope message (`{ rpc | evt }`, docs/rpc-envelope.md) to the
|
|
@@ -18,7 +18,9 @@ export class PlainPeerChannel {
|
|
|
18
18
|
onMessage;
|
|
19
19
|
onRpc;
|
|
20
20
|
sessionIdProvider;
|
|
21
|
+
includeRoomInOuter;
|
|
21
22
|
_unsubscribe;
|
|
23
|
+
_myRoomId;
|
|
22
24
|
constructor(relay, remotePeerId,
|
|
23
25
|
/**
|
|
24
26
|
* This Pi's room id. Currently NOT injected in the outer envelope
|
|
@@ -33,12 +35,20 @@ export class PlainPeerChannel {
|
|
|
33
35
|
onRpc,
|
|
34
36
|
/** Supplies the SENDING session's pi sessionId, stamped on every outbound
|
|
35
37
|
* envelope so the app keys per-session state by the pi id (not the room). */
|
|
36
|
-
sessionIdProvider
|
|
38
|
+
sessionIdProvider,
|
|
39
|
+
/** Re-enable the forward-compat room stamp: outbound outer envelopes
|
|
40
|
+
* carry `room: myRoomId`. Required for hosts whose reply routing needs
|
|
41
|
+
* the (peer, room) pair to match a registered connection — e.g. the
|
|
42
|
+
* launcher daemon, whose control room is NOT the relay default. The
|
|
43
|
+
* session-extension path stays on the legacy roomless form. */
|
|
44
|
+
includeRoomInOuter) {
|
|
37
45
|
this.relay = relay;
|
|
38
46
|
this.remotePeerId = remotePeerId;
|
|
39
47
|
this.onMessage = onMessage;
|
|
40
48
|
this.onRpc = onRpc;
|
|
41
49
|
this.sessionIdProvider = sessionIdProvider;
|
|
50
|
+
this.includeRoomInOuter = includeRoomInOuter;
|
|
51
|
+
this._myRoomId = myRoomId;
|
|
42
52
|
const listener = (line) => this._onLine(line);
|
|
43
53
|
relay.on("message", listener);
|
|
44
54
|
this._unsubscribe = () => relay.off("message", listener);
|
|
@@ -52,7 +62,11 @@ export class PlainPeerChannel {
|
|
|
52
62
|
// (W1.C) accept the field. Multi-Pi multiplexing already works via
|
|
53
63
|
// `room_id`/`room_meta` in the WS-level `hello` — outer routing stays by
|
|
54
64
|
// `peer` alone. Re-add the field once downstream is ready.
|
|
55
|
-
const outer = {
|
|
65
|
+
const outer = {
|
|
66
|
+
peer: this.remotePeerId,
|
|
67
|
+
...(this.includeRoomInOuter ? { room: this._myRoomId } : {}),
|
|
68
|
+
ct,
|
|
69
|
+
};
|
|
56
70
|
// Best-effort delivery. The relay WS can be mid-reconnect (idle/NAT drop, or
|
|
57
71
|
// a session_new/session-replacement teardown) when we push a server→app frame
|
|
58
72
|
// — notably the action_ok/action_error ack a handler emits right after
|
|
@@ -121,7 +135,11 @@ export class PlainPeerChannel {
|
|
|
121
135
|
sessionId: env.sessionId ?? this.sessionIdProvider?.(),
|
|
122
136
|
};
|
|
123
137
|
const ct = Buffer.from(JSON.stringify(wire)).toString("base64");
|
|
124
|
-
const outer = {
|
|
138
|
+
const outer = {
|
|
139
|
+
peer: this.remotePeerId,
|
|
140
|
+
...(this.includeRoomInOuter ? { room: this._myRoomId } : {}),
|
|
141
|
+
ct,
|
|
142
|
+
};
|
|
125
143
|
return JSON.stringify(outer);
|
|
126
144
|
}
|
|
127
145
|
/** Detaches from relay (does not close the relay itself). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peer_channel.js","sourceRoot":"","sources":["../../src/transport/peer_channel.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,eAAe,GAEhB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAyBhD;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,gBAAgB;
|
|
1
|
+
{"version":3,"file":"peer_channel.js","sourceRoot":"","sources":["../../src/transport/peer_channel.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,eAAe,GAEhB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAyBhD;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,gBAAgB;IAKR;IACA;IAOA;IAKA;IAMA;IAMA;IA7BF,YAAY,CAAY;IACxB,SAAS,CAAoB;IAE9C,YACmB,KAAkB,EAClB,YAAoB;IACrC;;;;OAIG;IACH,QAA4B,EACX,SAAuC;IACxD,oEAAoE;IACpE,aAA0B;IAC1B;iFAC6E;IAC5D,KAGR;IACT;kFAC8E;IAC7D,iBAA4C;IAC7D;;;;oEAIgE;IAC/C,kBAA4B;QAzB5B,UAAK,GAAL,KAAK,CAAa;QAClB,iBAAY,GAAZ,YAAY,CAAQ;QAOpB,cAAS,GAAT,SAAS,CAA8B;QAKvC,UAAK,GAAL,KAAK,C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AAC,UAAU,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,GAAG,KAAK,SAAS,QAAQ,GAAG,CAAC,GAAG,KAAK,SAAS,EAAE,CAChI,CAAA;QAED,uEAAuE;QACvE,mEAAmE;QACnE,4EAA4E;QAC5E,yEAAyE;QACzE,IAAI,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,IAAI,CAAC,KAAK,EAAE,CAAC,GAAsB,EAAE,IAAI,CAAC,CAAA;YAC1C,OAAM;QACR,CAAC;QAED,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAM;QACxC,IAAI,CAAC,SAAS,CAAC,GAAoB,CAAC,CAAA;IACtC,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geohar/un-bien",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.4",
|
|
4
4
|
"description": "Mobile remote control and local agent mesh for the Pi coding agent. Pair your phone via QR over a relay, watch tool calls in real time, run multi-Pi sessions over a local Unix Domain Socket broker, and let agents talk to each other through structured request/reply. Derived from remote-pi by Jacob Moura (https://github.com/jacobaraujo7/remote_pi), MIT.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|