sessionpipe 0.5.0 → 0.6.0
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 +44 -0
- package/dist/cli.js +946 -243
- package/dist/cli.js.map +4 -4
- package/dist/control/autoupdate.d.ts +156 -0
- package/dist/control/autoupdate.d.ts.map +1 -0
- package/dist/control/cli.d.ts +4 -0
- package/dist/control/cli.d.ts.map +1 -1
- package/dist/control/daemon.d.ts +54 -1
- package/dist/control/daemon.d.ts.map +1 -1
- package/dist/control/local.d.ts +4 -0
- package/dist/control/local.d.ts.map +1 -1
- package/dist/control/pair.d.ts +3 -0
- package/dist/control/pair.d.ts.map +1 -1
- package/dist/control/route.d.ts +6 -0
- package/dist/control/route.d.ts.map +1 -1
- package/dist/control/store.d.ts +4 -0
- package/dist/control/store.d.ts.map +1 -1
- package/dist/hook.js +1 -1
- package/dist/hook.js.map +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +2 -2
- package/dist/update.d.ts +70 -0
- package/dist/update.d.ts.map +1 -0
- package/dist/worker.js +1 -1
- package/dist/worker.js.map +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -68,6 +68,50 @@ comes first wins. Nothing is ever auto-allowed. Safe mode (the default) runs hea
|
|
|
68
68
|
turns with `--permission-mode dontAsk`, so nothing that needs approval runs while
|
|
69
69
|
you're away.
|
|
70
70
|
|
|
71
|
+
## Updates
|
|
72
|
+
|
|
73
|
+
The control daemon keeps its own copy current. About a minute after it starts, and then
|
|
74
|
+
once a day (the last check is kept in `~/.local/state/sessionpipe/control/update.json`,
|
|
75
|
+
so a restart or a machine that sleeps doesn't ask more often), it reads
|
|
76
|
+
`https://registry.npmjs.org/sessionpipe/latest`. When that is a newer release it waits
|
|
77
|
+
until nothing is in hand — no message being delivered, no headless run or new session,
|
|
78
|
+
no Agent SDK turn, no permission prompt waiting for your answer, no session of yours
|
|
79
|
+
mid-turn — stops taking new
|
|
80
|
+
messages (the receiver holds them meanwhile), runs
|
|
81
|
+
`npm install --global --ignore-scripts sessionpipe@<version>` into the prefix it was
|
|
82
|
+
installed in, re-copies the hook launcher's files, and restarts onto the new code. A
|
|
83
|
+
running turn is never interrupted.
|
|
84
|
+
|
|
85
|
+
How it restarts depends on how it runs:
|
|
86
|
+
|
|
87
|
+
- **launchd (macOS) or systemd (Linux)**, as `control pair` / `connect` set it up: the
|
|
88
|
+
daemon exits with code 75 and the service starts it again. Every service file
|
|
89
|
+
sessionpipe has written restarts on a non-zero exit, so older installs need nothing.
|
|
90
|
+
- **Anything else** (a terminal, tmux, a container that starts `sessionpipe control run`
|
|
91
|
+
itself): the old process stays as the new daemon's parent, with the same environment
|
|
92
|
+
and output, and restarts it the same way after each later update. Whatever waits on
|
|
93
|
+
the daemon (a shell, a container's init) keeps waiting.
|
|
94
|
+
|
|
95
|
+
One daemon runs per machine: a second `sessionpipe control run` finds the first one
|
|
96
|
+
answering on the local socket, says so, and exits 0.
|
|
97
|
+
|
|
98
|
+
Only a global npm install that this user can write updates itself; a copy in the npx
|
|
99
|
+
cache, a git checkout or a dev build is left alone. `sessionpipe status` and
|
|
100
|
+
`sessionpipe doctor` say whether it's on, when it last checked and what it found; the
|
|
101
|
+
daemon's log (`~/.local/state/sessionpipe/control/daemon.log` under launchd,
|
|
102
|
+
`journalctl --user -u sessionpipe-control.service` under systemd) has one line per check
|
|
103
|
+
and per update.
|
|
104
|
+
|
|
105
|
+
```sh
|
|
106
|
+
sessionpipe update off # the daemon stops checking ("update_check": false in config.json)
|
|
107
|
+
sessionpipe update on
|
|
108
|
+
sessionpipe update # install the latest now; the daemon restarts onto it once idle
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
`SESSIONPIPE_NO_UPDATE_CHECK=1` turns it off too, but only where the daemon can see it:
|
|
112
|
+
a launchd or systemd service doesn't inherit your shell's variables, while
|
|
113
|
+
`sessionpipe update off` reaches it (it re-reads the config every ten minutes).
|
|
114
|
+
|
|
71
115
|
Docs and the protocol: [sessionpipe.org](https://sessionpipe.org) · Source:
|
|
72
116
|
[github.com/micmmakarov/sessionpipe](https://github.com/micmmakarov/sessionpipe) · Apache-2.0.
|
|
73
117
|
Provided as-is; check what a sink receives with `sessionpipe tail` before you point it anywhere.
|