remote-pi 0.5.0 → 0.5.2
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/daemon/install.d.ts +33 -2
- package/dist/daemon/install.js +215 -24
- package/dist/daemon/install.js.map +1 -1
- package/dist/daemon/rpc_child.d.ts +31 -0
- package/dist/daemon/rpc_child.js +70 -6
- package/dist/daemon/rpc_child.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +0 -0
- package/dist/index.js.map +1 -1
- package/dist/protocol/types.d.ts +4 -0
- package/dist/transport/peer_channel.js +14 -1
- package/dist/transport/peer_channel.js.map +1 -1
- package/package.json +1 -1
- package/service-templates/task-launcher.vbs.template +10 -0
- package/service-templates/task-scheduler.xml.template +3 -3
|
@@ -41,7 +41,20 @@ export class PlainPeerChannel {
|
|
|
41
41
|
// `room_id`/`room_meta` in the WS-level `hello` — outer routing stays by
|
|
42
42
|
// `peer` alone. Re-add the field once downstream is ready.
|
|
43
43
|
const outer = { peer: this.remotePeerId, ct };
|
|
44
|
-
|
|
44
|
+
// Best-effort delivery. The relay WS can be mid-reconnect (idle/NAT drop, or
|
|
45
|
+
// a session_new/session-replacement teardown) when we push a server→app frame
|
|
46
|
+
// — notably the action_ok/action_error ack a handler emits right after
|
|
47
|
+
// newSession. `relay.send` throws "relay: not connected" in that window; since
|
|
48
|
+
// this runs inside an async SDK event callback, letting it propagate becomes an
|
|
49
|
+
// uncaughtException that kills the whole pi process. The relay auto-reconnects
|
|
50
|
+
// and the app re-syncs via session_sync, so a dropped frame is recoverable — a
|
|
51
|
+
// crash is not. Mirrors RelayClient.sendControl's no-op-when-closed policy.
|
|
52
|
+
try {
|
|
53
|
+
this.relay.send(JSON.stringify(outer));
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
/* relay down — drop this frame; reconnect + session_sync will recover */
|
|
57
|
+
}
|
|
45
58
|
}
|
|
46
59
|
/** Detaches from relay (does not close the relay itself). */
|
|
47
60
|
detach() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peer_channel.js","sourceRoot":"","sources":["../../src/transport/peer_channel.ts"],"names":[],"mappings":"AAyBA;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,gBAAgB;IAIR;IACA;IAOA;IAXF,YAAY,CAAa;IAE1C,YACmB,KAAkB,EAClB,YAAoB;IACrC;;;;OAIG;IACH,QAA4B,EACX,SAAuC;IACxD,oEAAoE;IACpE,aAA0B;QAVT,UAAK,GAAL,KAAK,CAAa;QAClB,iBAAY,GAAZ,YAAY,CAAQ;QAOpB,cAAS,GAAT,SAAS,CAA8B;QAIxD,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACtD,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAC9B,IAAI,CAAC,YAAY,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QACzD,KAAK,aAAa,CAAC;QACnB,KAAK,QAAQ,CAAC,CAAE,4CAA4C;IAC9D,CAAC;IAED,8EAA8E;IAE9E,IAAI,CAAC,GAAkB;QACrB,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC/D,wEAAwE;QACxE,mEAAmE;QACnE,yEAAyE;QACzE,2DAA2D;QAC3D,MAAM,KAAK,GAAkB,EAAE,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,EAAE,EAAE,CAAC;QAC7D,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"peer_channel.js","sourceRoot":"","sources":["../../src/transport/peer_channel.ts"],"names":[],"mappings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,CAAC;IAED,6DAA6D;IAC7D,MAAM;QACJ,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAED,+EAA+E;IAEvE,OAAO,CAAC,IAAY;QAC1B,IAAI,KAAoB,CAAC;QACzB,IAAI,CAAC;YACH,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAkB,CAAC;QAC5C,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,CAAC,iBAAiB;QAC3B,CAAC;QAED,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,YAAY;YAAE,OAAO;QAC7C,IAAI,CAAC,KAAK,CAAC,EAAE;YAAE,OAAO;QAEtB,IAAI,SAAiB,CAAC;QACtB,IAAI,CAAC;YACH,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC/D,CAAC;QAAC,MAAM,CAAC;YACP,OAAO;QACT,CAAC;QAED,IAAI,GAAY,CAAC;QACjB,IAAI,CAAC;YACH,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAC9B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO;QACT,CAAC;QAED,IACE,CAAC,GAAG;YACJ,OAAO,GAAG,KAAK,QAAQ;YACvB,OAAQ,GAA+B,CAAC,IAAI,KAAK,QAAQ,EACzD,CAAC;YACD,OAAO;QACT,CAAC;QAED,IAAI,CAAC,SAAS,CAAC,GAAoB,CAAC,CAAC;IACvC,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "remote-pi",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
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.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
' Remote Pi supervisor launcher — runs node hidden (no console window) and tees
|
|
2
|
+
' stdout+stderr to {LOG} so crashes are diagnosable (Task Scheduler gives the
|
|
3
|
+
' hidden process no console, mirroring launchd/systemd log redirection).
|
|
4
|
+
' `cmd /c` is required for the `>>` redirection. Run(cmd, 0, True): window
|
|
5
|
+
' style 0 = hidden, wait = True so wscript stays alive for node's lifetime →
|
|
6
|
+
' Task Scheduler's RestartOnFailure still monitors the supervisor.
|
|
7
|
+
' WScript.Quit propagates node's exit code.
|
|
8
|
+
Dim rc
|
|
9
|
+
rc = CreateObject("Wscript.Shell").Run("cmd /c """"{NODE}"" ""{SUPERVISOR}"" >> ""{LOG}"" 2>&1""", 0, True)
|
|
10
|
+
WScript.Quit rc
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
|
|
24
24
|
<ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
|
|
25
25
|
<Enabled>true</Enabled>
|
|
26
|
-
<Hidden>
|
|
26
|
+
<Hidden>true</Hidden>
|
|
27
27
|
<RestartOnFailure>
|
|
28
28
|
<Interval>PT1M</Interval>
|
|
29
29
|
<Count>999</Count>
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
</Settings>
|
|
32
32
|
<Actions Context="Author">
|
|
33
33
|
<Exec>
|
|
34
|
-
<Command>
|
|
35
|
-
<Arguments>"{
|
|
34
|
+
<Command>wscript.exe</Command>
|
|
35
|
+
<Arguments>"{VBS}"</Arguments>
|
|
36
36
|
</Exec>
|
|
37
37
|
</Actions>
|
|
38
38
|
</Task>
|