@m64/nats-pi-bridge 0.0.1 → 0.0.3
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 +56 -3
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -93,10 +93,63 @@ Each session is its own NATS microservice instance (the same pattern that `nats-
|
|
|
93
93
|
```
|
|
94
94
|
nats micro list
|
|
95
95
|
→ pi-exec │ 0.0.1 │ ABC123 │ intake
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
│ │ DEF456 │ worker-1 — /home/mario/code/nats-zig
|
|
97
|
+
│ │ GHI789 │ sid-gpt — /home/mario/code/sid-gpt
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
+
## NATS server
|
|
101
|
+
|
|
102
|
+
The Quick Start uses `demo.nats.io` because it's zero-setup, but you'll usually want your own server. The bridge picks the server from a [NATS CLI context](https://docs.nats.io/using-nats/nats-tools/nats_cli#contexts) named via the `NATS_CONTEXT` environment variable.
|
|
103
|
+
|
|
104
|
+
### Localhost
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# 1. One-time: create a context pointing at your local NATS
|
|
108
|
+
nats context save local --server nats://localhost:4222
|
|
109
|
+
|
|
110
|
+
# 2. Run the bridge against it
|
|
111
|
+
NATS_CONTEXT=local npx @m64/nats-pi-bridge
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
pi-exec: connecting to nats://localhost:4222 (context: local)
|
|
116
|
+
pi-exec: connected
|
|
117
|
+
pi-exec: intake registered on agents.pi-exec.m64
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
> **Don't have a local NATS server yet?** The fastest way:
|
|
121
|
+
>
|
|
122
|
+
> ```bash
|
|
123
|
+
> docker run --rm -p 4222:4222 nats:latest
|
|
124
|
+
> ```
|
|
125
|
+
>
|
|
126
|
+
> Or grab a binary from the [nats-server releases](https://github.com/nats-io/nats-server/releases).
|
|
127
|
+
|
|
128
|
+
### Make a context the default
|
|
129
|
+
|
|
130
|
+
To avoid setting `NATS_CONTEXT` on every invocation, drop a one-line config file:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
mkdir -p ~/.pi-exec
|
|
134
|
+
echo '{"context":"local"}' > ~/.pi-exec/config.json
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
After that, plain `npx @m64/nats-pi-bridge` connects to your chosen server.
|
|
138
|
+
|
|
139
|
+
### Authenticated and remote servers
|
|
140
|
+
|
|
141
|
+
The same context format works for any NATS auth scheme — credentials files, NKeys, JWTs, TLS, user/password. Anything `nats context save` can store, the bridge can use:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
nats context save prod \
|
|
145
|
+
--server nats://nats.example.com:4222 \
|
|
146
|
+
--creds ~/.nkeys/creds/synadia/MyAccount/me.creds
|
|
147
|
+
|
|
148
|
+
NATS_CONTEXT=prod npx @m64/nats-pi-bridge
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Context files live at `~/.config/nats/context/<name>.json`. See the [NATS CLI context docs](https://docs.nats.io/using-nats/nats-tools/nats_cli#contexts) for the full list of supported fields.
|
|
152
|
+
|
|
100
153
|
## Install
|
|
101
154
|
|
|
102
155
|
```bash
|
|
@@ -149,7 +202,7 @@ Environment overrides:
|
|
|
149
202
|
| `PI_EXEC_DEFAULT_MODEL` | Default model spec, e.g. `anthropic/claude-sonnet-4-5` |
|
|
150
203
|
| `PI_EXEC_DEFAULT_MAX_LIFETIME` | Default max session lifetime in seconds |
|
|
151
204
|
|
|
152
|
-
PI credentials are read from `~/.pi/agent/auth.json` (the standard PI agent location).
|
|
205
|
+
PI credentials are read from `~/.pi/agent/auth.json` (the standard PI agent location). Create the file directly — see the [Quick Start prerequisite](#quick-start) for the one-liner. If you have PI installed locally, `pi /login` populates it automatically.
|
|
153
206
|
|
|
154
207
|
## Intake protocol
|
|
155
208
|
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m64/nats-pi-bridge",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Standalone headless service that spawns and manages PI coding agent sessions on demand via NATS. Control plane / data plane split, streaming wire protocol, multi-session microservice registration.",
|
|
5
5
|
"author": "m64",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
|
-
"homepage": "
|
|
7
|
+
"homepage": "",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "
|
|
10
|
+
"url": ""
|
|
11
11
|
},
|
|
12
12
|
"bugs": {
|
|
13
|
-
"url": "
|
|
13
|
+
"url": ""
|
|
14
14
|
},
|
|
15
15
|
"type": "module",
|
|
16
16
|
"engines": {
|