pando-ai 0.2.3 → 0.2.5
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 +58 -3
- package/bin/pando-ai.js +22 -2
- package/dist/cli.js +175 -152
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,8 +26,11 @@ npx -y pando-ai
|
|
|
26
26
|
|
|
27
27
|
On a terminal this opens the **firewall console**: it detects whether `codex`
|
|
28
28
|
and `claude` are protected, offers to install supervised launchers for any that
|
|
29
|
-
aren't, and shows current status and policy.
|
|
30
|
-
`
|
|
29
|
+
aren't, and shows current status and policy. It also installs a persistent
|
|
30
|
+
`~/.pando/bin/pando-ai` command shim, so future commands such as
|
|
31
|
+
`pando-ai uninstall` work even when the first run came from `npx`. After
|
|
32
|
+
installation you keep running `codex` and `claude` normally — Pando supervises
|
|
33
|
+
each launch.
|
|
31
34
|
|
|
32
35
|
## How it works
|
|
33
36
|
|
|
@@ -117,6 +120,40 @@ context. Gateway mode is an additional full-wire layer for request/response
|
|
|
117
120
|
inspection, memory, and provider-bound enforcement; hooks still run when the
|
|
118
121
|
gateway is active.
|
|
119
122
|
|
|
123
|
+
#### Enabling gateway mode
|
|
124
|
+
|
|
125
|
+
Gateway mode starts only when Claude Code gateway credentials are present and
|
|
126
|
+
`[proxy].claude = "enforce"`. Provide one of:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# Environment variable (highest precedence)
|
|
130
|
+
export ANTHROPIC_API_KEY=sk-ant-...
|
|
131
|
+
# …or an auth token
|
|
132
|
+
export ANTHROPIC_AUTH_TOKEN=...
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
For local development you can keep the key in a git-ignored `.env` at the repo
|
|
136
|
+
root and source it before launching:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# .env (already git-ignored — never commit it)
|
|
140
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
141
|
+
|
|
142
|
+
export $(grep -v '^#' .env | xargs) # load it into the shell
|
|
143
|
+
claude -p 'hello' # Pando supervises + routes via gateway
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
A `apiKeyHelper` configured in Claude Code settings works as well. With any of
|
|
147
|
+
these present Pando logs `gateway listening on http://127.0.0.1:<port>
|
|
148
|
+
(memory=off)` and sets `ANTHROPIC_BASE_URL` for the child `claude` process.
|
|
149
|
+
Without them, Pando falls back to hooks-only enforcement over subscription OAuth.
|
|
150
|
+
|
|
151
|
+
The gateway forwards the Anthropic Messages and OpenAI Responses APIs
|
|
152
|
+
transparently, including compressed upstream responses: `fetch` decodes the
|
|
153
|
+
`content-encoding` (gzip/brotli) before Pando inspects or rewrites the body, and
|
|
154
|
+
the gateway emits the decoded, identity-encoded bytes — it never re-advertises a
|
|
155
|
+
`content-encoding` it isn't sending.
|
|
156
|
+
|
|
120
157
|
### Provider proxy toggle
|
|
121
158
|
|
|
122
159
|
Users can enable or disable the local provider proxy per supervised tool:
|
|
@@ -145,8 +182,9 @@ provider-bound gateway enforcement is disabled.
|
|
|
145
182
|
## Surfaces
|
|
146
183
|
|
|
147
184
|
```bash
|
|
148
|
-
pando-ai # firewall console (TTY): status
|
|
185
|
+
pando-ai # firewall console (TTY): status, install, uninstall
|
|
149
186
|
pando-ai install # force a (re)install pass
|
|
187
|
+
pando-ai uninstall # remove Pando shims, managed PATH block, install state, and global npm install when detected
|
|
150
188
|
pando-ai serve [path] # stdio MCP server for MCP clients
|
|
151
189
|
pando-ai serve-http # HTTP MCP server
|
|
152
190
|
pando-ai gateway # run the firewall gateway in the foreground (debug)
|
|
@@ -158,6 +196,23 @@ pando-ai config set telemetry false
|
|
|
158
196
|
`pando-ai launch codex|claude -- <args>` is the supervised launcher the shims
|
|
159
197
|
call; you don't run it directly.
|
|
160
198
|
|
|
199
|
+
## Uninstall
|
|
200
|
+
|
|
201
|
+
To stop supervising `codex` and `claude`:
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
pando-ai uninstall
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
This removes Pando-owned `codex`/`claude` shims from `~/.pando/bin`, removes
|
|
208
|
+
the Pando-owned `pando-ai` command shim, removes the managed PATH block from
|
|
209
|
+
your shell startup file when present, and deletes `~/.pando/state.json` so
|
|
210
|
+
declined/install state does not suppress future setup prompts. It does not
|
|
211
|
+
delete policy files, logs, or other user data. If the command is running from a
|
|
212
|
+
global npm install, it also removes that global `pando-ai` package
|
|
213
|
+
automatically. `npx` runs are temporary, so there is no persistent npm package
|
|
214
|
+
to remove in that case.
|
|
215
|
+
|
|
161
216
|
## MCP serve mode
|
|
162
217
|
|
|
163
218
|
When invoked without a TTY (e.g. spawned by an MCP client) `pando-ai` starts the
|
package/bin/pando-ai.js
CHANGED
|
@@ -29,10 +29,30 @@ const current = parseNodeVersion(process.version);
|
|
|
29
29
|
if (!isSupportedNode(current)) {
|
|
30
30
|
const detected = current ? `${current.major}.${current.minor}.${current.patch}` : process.version;
|
|
31
31
|
console.error(
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
"\n" +
|
|
33
|
+
`[pando] pando-ai requires Node.js 22.5.0 or newer. Detected ${detected}.\n` +
|
|
34
|
+
"[pando] Please update Node.js, then re-run: npx -y pando-ai\n",
|
|
34
35
|
);
|
|
35
36
|
process.exit(1);
|
|
36
37
|
}
|
|
37
38
|
|
|
39
|
+
const originalEmitWarning = process.emitWarning;
|
|
40
|
+
process.emitWarning = function pandoEmitWarning(warning, ...args) {
|
|
41
|
+
const text =
|
|
42
|
+
typeof warning === "string"
|
|
43
|
+
? warning
|
|
44
|
+
: warning && typeof warning === "object" && "message" in warning
|
|
45
|
+
? String(warning.message)
|
|
46
|
+
: "";
|
|
47
|
+
const type = typeof args[0] === "string" ? args[0] : undefined;
|
|
48
|
+
if (
|
|
49
|
+
type === "ExperimentalWarning" ||
|
|
50
|
+
text.includes("SQLite is an experimental feature") ||
|
|
51
|
+
text.includes("localStorage is not available")
|
|
52
|
+
) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
return originalEmitWarning.call(process, warning, ...args);
|
|
56
|
+
};
|
|
57
|
+
|
|
38
58
|
require("../dist/cli.js");
|