agent-request-logger 0.1.1 → 0.2.1
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 +149 -86
- package/bin/agent-request-logger.js +3 -56
- package/dist/capture.js +21 -11
- package/dist/capture.js.map +1 -1
- package/dist/cli.js +105 -0
- package/dist/cli.js.map +1 -0
- package/dist/errors.js.map +1 -1
- package/dist/gateway.js +71 -17
- package/dist/gateway.js.map +1 -1
- package/dist/main.js +72 -41
- package/dist/main.js.map +1 -1
- package/dist/preferences.js +9 -5
- package/dist/preferences.js.map +1 -1
- package/dist/response-decoder.js +28 -0
- package/dist/response-decoder.js.map +1 -1
- package/dist/review.js +189 -0
- package/dist/review.js.map +1 -0
- package/dist/targets.js +1 -1
- package/docs/agents.md +8 -3
- package/package.json +22 -7
package/README.md
CHANGED
|
@@ -1,123 +1,186 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/chepetime/agent-request-logger/main/docs/assets/logo.svg" width="96" height="96" alt="agent-request-logger logo">
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
tool definitions, messages, responses, and token usage. This CLI runs a local
|
|
5
|
-
HTTP proxy, forwards traffic to the provider, and saves readable captures on
|
|
6
|
-
your machine while streaming responses back to the agent.
|
|
5
|
+
<h1 align="center">agent-request-logger</h1>
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
See
|
|
7
|
+
<p align="center">
|
|
8
|
+
See exactly what your coding agent sends to its model provider.
|
|
9
|
+
</p>
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://www.npmjs.com/package/agent-request-logger"><img src="https://img.shields.io/npm/v/agent-request-logger" alt="npm version"></a>
|
|
13
|
+
<a href="https://github.com/chepetime/agent-request-logger/actions/workflows/ci.yml"><img src="https://github.com/chepetime/agent-request-logger/actions/workflows/ci.yml/badge.svg" alt="CI status"></a>
|
|
14
|
+
<a href="https://github.com/chepetime/agent-request-logger/actions/workflows/compatibility.yml"><img src="https://github.com/chepetime/agent-request-logger/actions/workflows/compatibility.yml/badge.svg" alt="Real-agent compatibility"></a>
|
|
15
|
+
<img src="https://img.shields.io/node/v/agent-request-logger" alt="Node.js version">
|
|
16
|
+
<a href="https://github.com/chepetime/agent-request-logger/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/agent-request-logger" alt="MIT license"></a>
|
|
17
|
+
</p>
|
|
12
18
|
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
`agent-request-logger` is a local HTTP proxy for coding agents. It forwards
|
|
20
|
+
each request to the real provider, streams the response back unchanged, and
|
|
21
|
+
saves a readable Markdown capture of the system prompt, tools, messages,
|
|
22
|
+
response text, reasoning, tool calls, and token usage.
|
|
15
23
|
|
|
16
|
-
|
|
24
|
+
Works with **Claude Code, Codex, GitHub Copilot CLI, OpenCode, and Pi**, plus
|
|
25
|
+
any OpenAI- or Anthropic-compatible endpoint.
|
|
17
26
|
|
|
18
27
|
```sh
|
|
19
28
|
npx agent-request-logger
|
|
20
29
|
```
|
|
21
30
|
|
|
22
|
-
|
|
31
|
+
## Why
|
|
23
32
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
33
|
+
Coding agents build large prompts that you never see: system instructions,
|
|
34
|
+
tool schemas, injected context, and retries. When an agent behaves strangely,
|
|
35
|
+
the fastest way to understand it is to read the exact request it sent. This
|
|
36
|
+
tool shows you that request with one command, without changing the agent,
|
|
37
|
+
signing in again, or sending data anywhere except the provider you already use.
|
|
28
38
|
|
|
29
|
-
|
|
39
|
+
## Quick start
|
|
30
40
|
|
|
31
|
-
|
|
32
|
-
npm i -D agent-request-logger
|
|
33
|
-
```
|
|
41
|
+
Requires **Node.js 22.15 or newer** and an installed, signed-in coding agent.
|
|
34
42
|
|
|
35
|
-
|
|
43
|
+
1. In the project where you want captures, start the logger:
|
|
36
44
|
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"log:agent": "agent-request-logger"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
```
|
|
45
|
+
```sh
|
|
46
|
+
npx agent-request-logger
|
|
47
|
+
```
|
|
44
48
|
|
|
45
|
-
|
|
49
|
+
2. Choose your agent and provider. The logger can remember the choice.
|
|
50
|
+
3. In a second terminal, run the command that the logger prints, for example:
|
|
46
51
|
|
|
47
|
-
```sh
|
|
48
|
-
|
|
52
|
+
```sh
|
|
53
|
+
ANTHROPIC_BASE_URL='http://127.0.0.1:8787' ENABLE_TOOL_SEARCH=true claude
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
4. Send a message to the agent. Open the newest `.md` file in
|
|
57
|
+
`./request-logger-logs/`.
|
|
58
|
+
5. Press <kbd>Ctrl</kbd>+<kbd>C</kbd> in the logger terminal. Open streams are
|
|
59
|
+
saved before it exits.
|
|
60
|
+
|
|
61
|
+
Generated commands use bash or zsh syntax. Some setups also print a JSON
|
|
62
|
+
snippet to merge into the agent's configuration file. See
|
|
63
|
+
[agent setup](https://github.com/chepetime/agent-request-logger/blob/main/docs/agents.md)
|
|
64
|
+
for every agent and provider.
|
|
65
|
+
|
|
66
|
+
## How it works
|
|
67
|
+
|
|
68
|
+
```mermaid
|
|
69
|
+
flowchart LR
|
|
70
|
+
A[Coding agent] -- HTTP request --> L[agent-request-logger<br/>127.0.0.1:8787]
|
|
71
|
+
L -- same bytes --> P[Model provider]
|
|
72
|
+
P -- streamed response --> L
|
|
73
|
+
L -- streamed unchanged --> A
|
|
74
|
+
L -. after the response ends .-> C[(request-logger-logs/)]
|
|
49
75
|
```
|
|
50
76
|
|
|
51
|
-
|
|
52
|
-
|
|
77
|
+
- Requests and responses pass through byte for byte, including credentials
|
|
78
|
+
and compression. Streaming tokens reach the agent without delay.
|
|
79
|
+
- The capture is written only after the response finishes, so formatting
|
|
80
|
+
never slows the agent down.
|
|
81
|
+
- The logger listens on loopback only. Nothing leaves your machine except the
|
|
82
|
+
traffic that already goes to your provider.
|
|
83
|
+
|
|
84
|
+
## Captures
|
|
85
|
+
|
|
86
|
+
One agent turn can send several model requests. Each request produces three
|
|
87
|
+
files that share a timestamp and request ID:
|
|
53
88
|
|
|
54
|
-
|
|
89
|
+
| File | Contents |
|
|
90
|
+
| --------------- | ----------------------------------------------------------------------- |
|
|
91
|
+
| `.md` | Headers, system instructions, tools, messages, response text, and usage |
|
|
92
|
+
| `.request.txt` | The original request body bytes, including compression |
|
|
93
|
+
| `.response.txt` | The original response body bytes |
|
|
55
94
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
2. Choose your agent and provider. You can remember the setup for future runs.
|
|
59
|
-
3. Leave the logger running. It listens on `127.0.0.1:8787` by default.
|
|
60
|
-
4. In a second terminal, launch your agent with the exact command printed by
|
|
61
|
-
the logger. Merge any printed configuration settings into your existing
|
|
62
|
-
agent configuration first.
|
|
63
|
-
5. Send a message to the agent and open the newest Markdown file under
|
|
64
|
-
`./request-logger-logs/` in the logger's working directory.
|
|
65
|
-
6. Press Ctrl+C in the logger terminal when finished.
|
|
95
|
+
The `.md` file is written last, so its presence means the raw files are
|
|
96
|
+
complete.
|
|
66
97
|
|
|
67
|
-
|
|
68
|
-
are forwarded to the configured upstream; the logger does not sign you in.
|
|
98
|
+
### Review file for agents
|
|
69
99
|
|
|
70
|
-
|
|
71
|
-
|
|
100
|
+
Each session also keeps one `<start time>.review.md` file. The logger prints
|
|
101
|
+
its absolute path at startup, and the file updates after every capture. To
|
|
102
|
+
have an agent explain a session, paste one line into it at any time:
|
|
72
103
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
| `.request.txt` | Original request body bytes, including compression |
|
|
77
|
-
| `.response.txt` | Original upstream response body bytes |
|
|
104
|
+
```text
|
|
105
|
+
Read /Users/you/project/request-logger-logs/2026-11-26T19-04-00.000Z.review.md
|
|
106
|
+
```
|
|
78
107
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
108
|
+
The file is short on purpose. It has one table row per request (endpoint,
|
|
109
|
+
status, model, message count, tokens, stop reason, and the first line of the
|
|
110
|
+
reply). Identical system prompts and tool sets get one letter, so the agent
|
|
111
|
+
reads them once, and tool changes show as `+name` or `−name`. Absolute paths
|
|
112
|
+
lead to the full captures when a row is not enough. The file also tells the
|
|
113
|
+
agent to treat captures as data and not to follow the instructions inside
|
|
114
|
+
them. Use `--no-review` to turn it off.
|
|
82
115
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
116
|
+
Run the reviewing agent without the logger, or ignore the new rows that its
|
|
117
|
+
own reads create. Token-counting and health-check requests pass through without a
|
|
118
|
+
capture.
|
|
86
119
|
|
|
87
120
|
## Options
|
|
88
121
|
|
|
122
|
+
| Option | Environment variable | Default |
|
|
123
|
+
| --------------------- | --------------------------- | -------------------------- |
|
|
124
|
+
| `--port <number>` | `PORT` | `8787` |
|
|
125
|
+
| `--log-dir <path>` | `REQUEST_LOGGER_LOG_DIR` | `./request-logger-logs` |
|
|
126
|
+
| `--config-dir <path>` | `REQUEST_LOGGER_CONFIG_DIR` | `~/.agent-request-logger` |
|
|
127
|
+
| `--force` | | Choose the setup again |
|
|
128
|
+
| `--debug` | `REQUEST_LOGGER_DEBUG=1` | Add stack traces to errors |
|
|
129
|
+
| `-h`, `--help` | | Show help |
|
|
130
|
+
| `-v`, `--version` | | Show the installed version |
|
|
131
|
+
|
|
132
|
+
Flags take precedence over environment variables. Relative paths resolve from
|
|
133
|
+
the directory where you start the logger, also with `npx`, a global install,
|
|
134
|
+
or an npm script. Unknown flags are rejected, so a typo never runs a
|
|
135
|
+
different setup.
|
|
136
|
+
|
|
137
|
+
`--force` asks again but keeps the saved setup until you save a new one.
|
|
138
|
+
Cancelling the wizard does not lose your previous choice.
|
|
139
|
+
|
|
140
|
+
## Install options
|
|
141
|
+
|
|
89
142
|
```sh
|
|
90
|
-
npx agent-request-logger
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
npx agent-request-logger --config-dir ./preferences
|
|
94
|
-
npx agent-request-logger --debug
|
|
95
|
-
npx agent-request-logger --help
|
|
96
|
-
npx agent-request-logger --version
|
|
143
|
+
npx agent-request-logger # run without installing
|
|
144
|
+
npm i -g agent-request-logger # install the command globally
|
|
145
|
+
npm i -D agent-request-logger # add it to a project
|
|
97
146
|
```
|
|
98
147
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
148
|
+
In a project, add a script and pass options after `--`:
|
|
149
|
+
|
|
150
|
+
```json
|
|
151
|
+
{ "scripts": { "log:agent": "agent-request-logger" } }
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
```sh
|
|
155
|
+
npm run log:agent -- --port 9000
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Privacy and safety
|
|
159
|
+
|
|
160
|
+
- Credential headers such as `authorization`, `x-api-key`, `cookie`, and any
|
|
161
|
+
header named like a token, secret, or key are shown as `[REDACTED]` in
|
|
162
|
+
Markdown captures.
|
|
163
|
+
- Request and response **bodies are not redacted**. They can contain your
|
|
164
|
+
code, file contents, and secrets. Add the capture directory to `.gitignore`.
|
|
165
|
+
- Capture files are created with owner-only permissions (`0600`, in a `0700`
|
|
166
|
+
directory).
|
|
167
|
+
- Each body copy is limited to 64 MiB. Larger traffic is still forwarded in
|
|
168
|
+
full; the capture keeps the beginning and says that it is truncated.
|
|
108
169
|
|
|
109
|
-
|
|
110
|
-
|
|
170
|
+
This is a local inspection tool, not a production telemetry proxy. See
|
|
171
|
+
[SECURITY.md](https://github.com/chepetime/agent-request-logger/blob/main/SECURITY.md)
|
|
172
|
+
to report a vulnerability.
|
|
111
173
|
|
|
112
|
-
|
|
113
|
-
`REQUEST_LOGGER_CONFIG_DIR`. CLI options take precedence. Relative paths are
|
|
114
|
-
resolved from the logger's working directory.
|
|
174
|
+
## Documentation
|
|
115
175
|
|
|
116
|
-
|
|
176
|
+
- [Agent setup and troubleshooting](https://github.com/chepetime/agent-request-logger/blob/main/docs/agents.md)
|
|
177
|
+
- [Architecture](https://github.com/chepetime/agent-request-logger/blob/main/docs/architecture.md)
|
|
178
|
+
- [Testing](https://github.com/chepetime/agent-request-logger/blob/main/docs/testing.md)
|
|
179
|
+
- [Releases](https://github.com/chepetime/agent-request-logger/blob/main/docs/releases.md)
|
|
180
|
+
- [Contributing](https://github.com/chepetime/agent-request-logger/blob/main/CONTRIBUTING.md)
|
|
181
|
+
- [Changelog](https://github.com/chepetime/agent-request-logger/blob/main/CHANGELOG.md)
|
|
117
182
|
|
|
118
|
-
|
|
119
|
-
- [Contributing and local development](CONTRIBUTING.md)
|
|
120
|
-
- [Testing conventions](docs/testing.md)
|
|
121
|
-
- [Release process](docs/releases.md)
|
|
183
|
+
## License
|
|
122
184
|
|
|
123
|
-
|
|
185
|
+
[MIT](https://github.com/chepetime/agent-request-logger/blob/main/LICENSE).
|
|
186
|
+
Free to use, change, and share.
|
|
@@ -1,57 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
try {
|
|
6
|
-
const { values } = parseArgs({
|
|
7
|
-
options: {
|
|
8
|
-
help: { type: "boolean", short: "h" },
|
|
9
|
-
version: { type: "boolean", short: "v" },
|
|
10
|
-
debug: { type: "boolean" },
|
|
11
|
-
force: { type: "boolean" },
|
|
12
|
-
port: { type: "string" },
|
|
13
|
-
"log-dir": { type: "string" },
|
|
14
|
-
"config-dir": { type: "string" },
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
if (values.help) {
|
|
18
|
-
console.log(`Usage: agent-request-logger [options]
|
|
19
|
-
|
|
20
|
-
Inspect the HTTP requests your coding agent sends to its model provider.
|
|
21
|
-
|
|
22
|
-
--debug Include stack traces in error reports
|
|
23
|
-
--force Choose your agent and provider again
|
|
24
|
-
--port <number> Local port (default: PORT or 8787)
|
|
25
|
-
--log-dir <path> Capture directory (default: ./request-logger-logs)
|
|
26
|
-
--config-dir <path> Preferences directory (default: ~/.agent-request-logger)
|
|
27
|
-
-h, --help Show this help
|
|
28
|
-
-v, --version Show the version
|
|
29
|
-
|
|
30
|
-
Start this command, then launch your agent using the command it prints.
|
|
31
|
-
Press Ctrl+C to stop.`);
|
|
32
|
-
} else if (values.version) {
|
|
33
|
-
console.log(JSON.parse(readFileSync(new URL("../package.json", import.meta.url))).version);
|
|
34
|
-
} else {
|
|
35
|
-
const port = values.port ?? process.env.PORT ?? "8787";
|
|
36
|
-
if (!/^\d+$/.test(port) || Number(port) < 1 || Number(port) > 65535) {
|
|
37
|
-
throw new Error("Port must be an integer between 1 and 65535.");
|
|
38
|
-
}
|
|
39
|
-
process.env.PORT = port;
|
|
40
|
-
if (values.debug) process.env.REQUEST_LOGGER_DEBUG = "1";
|
|
41
|
-
if (values["log-dir"]) process.env.REQUEST_LOGGER_LOG_DIR = values["log-dir"];
|
|
42
|
-
if (values["config-dir"]) process.env.REQUEST_LOGGER_CONFIG_DIR = values["config-dir"];
|
|
43
|
-
const { main } = await import("../dist/main.js");
|
|
44
|
-
await main();
|
|
45
|
-
}
|
|
46
|
-
} catch (error) {
|
|
47
|
-
const { formatError } = await import("../dist/errors.js").catch(() => ({
|
|
48
|
-
formatError: (error) => error.message,
|
|
49
|
-
}));
|
|
50
|
-
console.error(
|
|
51
|
-
formatError(
|
|
52
|
-
error,
|
|
53
|
-
process.env.REQUEST_LOGGER_DEBUG === "1" || process.argv.includes("--debug"),
|
|
54
|
-
),
|
|
55
|
-
);
|
|
56
|
-
process.exitCode = 1;
|
|
57
|
-
}
|
|
2
|
+
// Thin launcher: all parsing and behavior live in the compiled, tested CLI module.
|
|
3
|
+
const { run } = await import("../dist/cli.js");
|
|
4
|
+
process.exitCode = await run();
|
package/dist/capture.js
CHANGED
|
@@ -3,19 +3,16 @@ import fs from "node:fs/promises";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import * as zlib from "node:zlib";
|
|
5
5
|
import { decodeResponse, parseJson } from "./response-decoder.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"cookie",
|
|
13
|
-
"set-cookie",
|
|
14
|
-
]);
|
|
6
|
+
// Names are matched as whole dash-separated words, so "x-auth-token" and
|
|
7
|
+
// "x-goog-api-key" are hidden while "anthropic-beta" and "session_id" remain.
|
|
8
|
+
const credentialHeader = /(?:^|-)(?:authorization|auth|api-?key|apikey|token|secret|password|cookie|signature|credential|credentials)(?:-|$)/i;
|
|
9
|
+
export function isCredentialHeader(name) {
|
|
10
|
+
return credentialHeader.test(name);
|
|
11
|
+
}
|
|
15
12
|
export function safeHeaders(headers) {
|
|
16
13
|
return Object.fromEntries(Object.entries(headers).map(([name, value]) => [
|
|
17
14
|
name,
|
|
18
|
-
|
|
15
|
+
isCredentialHeader(name) ? "[REDACTED]" : value,
|
|
19
16
|
]));
|
|
20
17
|
}
|
|
21
18
|
export function requestText(bytes, encoding = "") {
|
|
@@ -71,9 +68,22 @@ export function markdown(exchange) {
|
|
|
71
68
|
const text = requestText(exchange.request, Array.isArray(encoding) ? encoding[0] : encoding);
|
|
72
69
|
const request = parseJson(text);
|
|
73
70
|
const responseText = requestText(exchange.response, exchange.responseEncoding);
|
|
71
|
+
const notes = [
|
|
72
|
+
exchange.responseIncomplete &&
|
|
73
|
+
"Response stream closed before the upstream finished; capture may be incomplete.",
|
|
74
|
+
exchange.requestTruncated &&
|
|
75
|
+
"Request body exceeded the capture limit; only its beginning was saved.",
|
|
76
|
+
exchange.responseTruncated &&
|
|
77
|
+
"Response body exceeded the capture limit; only its beginning was saved.",
|
|
78
|
+
].filter(Boolean);
|
|
74
79
|
const sections = [
|
|
75
80
|
"# Agent HTTP capture",
|
|
76
|
-
|
|
81
|
+
[
|
|
82
|
+
exchange.agent,
|
|
83
|
+
`Request: ${exchange.requestId ?? "unassigned"}`,
|
|
84
|
+
`${exchange.method} ${exchange.url} → ${exchange.status} (${exchange.elapsedMs} ms)`,
|
|
85
|
+
...notes.map((note) => `> ${note}`),
|
|
86
|
+
].join("\n\n"),
|
|
77
87
|
`## Request headers\n\n${code(safeHeaders(exchange.headers))}`,
|
|
78
88
|
];
|
|
79
89
|
if (request && exchange.protocol !== "raw") {
|
package/dist/capture.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture.js","sourceRoot":"","sources":["../src/capture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAElC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"capture.js","sourceRoot":"","sources":["../src/capture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAElC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAsBlE,yEAAyE;AACzE,8EAA8E;AAC9E,MAAM,gBAAgB,GACpB,qHAAqH,CAAC;AACxH,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrC,CAAC;AACD,MAAM,UAAU,WAAW,CAAC,OAA4B;IACtD,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;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I,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC1C,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,EAAE,CAAC,SAAS,CAAC,GAAG,IAAI,cAAc,EAAE,QAAQ,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;QACtE,EAAE,CAAC,SAAS,CAAC,GAAG,IAAI,eAAe,EAAE,QAAQ,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;KACzE,CAAC,CAAC;IACH,4EAA4E;IAC5E,MAAM,EAAE,CAAC,SAAS,CAAC,GAAG,IAAI,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACtE,OAAO,GAAG,IAAI,KAAK,CAAC;AACtB,CAAC"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import os from "node:os";
|
|
3
|
+
import { parseArgs } from "node:util";
|
|
4
|
+
import { formatError } from "./errors.js";
|
|
5
|
+
import { locations } from "./preferences.js";
|
|
6
|
+
import { upstreamUrl } from "./targets.js";
|
|
7
|
+
export const HELP = `Usage: agent-request-logger [options]
|
|
8
|
+
|
|
9
|
+
Inspect the HTTP requests your coding agent sends to its model provider.
|
|
10
|
+
|
|
11
|
+
--port <number> Local port (default: PORT or 8787)
|
|
12
|
+
--log-dir <path> Capture directory (default: ./request-logger-logs)
|
|
13
|
+
--config-dir <path> Preferences directory (default: ~/.agent-request-logger)
|
|
14
|
+
--force Choose your agent and provider again
|
|
15
|
+
--no-review Do not write the session review file
|
|
16
|
+
--debug Include stack traces in error reports
|
|
17
|
+
-h, --help Show this help
|
|
18
|
+
-v, --version Show the version
|
|
19
|
+
|
|
20
|
+
Start this command, then launch your agent using the command it prints.
|
|
21
|
+
Press Ctrl+C to stop.`;
|
|
22
|
+
/** Pure: the only place that reads flags and environment variables. */
|
|
23
|
+
export function parseCommand({ argv, env, cwd, home }) {
|
|
24
|
+
const { values } = parseArgs({
|
|
25
|
+
args: argv,
|
|
26
|
+
strict: true,
|
|
27
|
+
allowPositionals: false,
|
|
28
|
+
allowNegative: true,
|
|
29
|
+
options: {
|
|
30
|
+
help: { type: "boolean", short: "h" },
|
|
31
|
+
version: { type: "boolean", short: "v" },
|
|
32
|
+
debug: { type: "boolean" },
|
|
33
|
+
force: { type: "boolean" },
|
|
34
|
+
review: { type: "boolean", default: true },
|
|
35
|
+
port: { type: "string" },
|
|
36
|
+
"log-dir": { type: "string" },
|
|
37
|
+
"config-dir": { type: "string" },
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
if (values.help)
|
|
41
|
+
return { kind: "help" };
|
|
42
|
+
if (values.version)
|
|
43
|
+
return { kind: "version" };
|
|
44
|
+
const paths = locations({
|
|
45
|
+
logDir: values["log-dir"] || env.REQUEST_LOGGER_LOG_DIR,
|
|
46
|
+
configDir: values["config-dir"] || env.REQUEST_LOGGER_CONFIG_DIR,
|
|
47
|
+
}, cwd, home);
|
|
48
|
+
return {
|
|
49
|
+
kind: "start",
|
|
50
|
+
options: {
|
|
51
|
+
port: parsePort(values.port ?? (env.PORT || "8787")),
|
|
52
|
+
...paths,
|
|
53
|
+
force: values.force ?? false,
|
|
54
|
+
debug: (values.debug ?? false) || env.REQUEST_LOGGER_DEBUG === "1",
|
|
55
|
+
review: values.review ?? true,
|
|
56
|
+
testUpstream: testUpstream(env.REQUEST_LOGGER_TEST_UPSTREAM),
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function parsePort(text) {
|
|
61
|
+
const port = Number(text);
|
|
62
|
+
if (!/^\d+$/.test(text) || port < 1 || port > 65535) {
|
|
63
|
+
throw new Error("Port must be an integer between 1 and 65535.");
|
|
64
|
+
}
|
|
65
|
+
return port;
|
|
66
|
+
}
|
|
67
|
+
function testUpstream(configured) {
|
|
68
|
+
if (!configured)
|
|
69
|
+
return;
|
|
70
|
+
const url = upstreamUrl(configured);
|
|
71
|
+
if (url.pathname !== "/")
|
|
72
|
+
throw new Error("Test upstream must be an origin without a path.");
|
|
73
|
+
return url;
|
|
74
|
+
}
|
|
75
|
+
export function version() {
|
|
76
|
+
return JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
|
|
77
|
+
}
|
|
78
|
+
/** Run the CLI and return its exit code. Errors become readable diagnostics. */
|
|
79
|
+
export async function run(environment = {
|
|
80
|
+
argv: process.argv.slice(2),
|
|
81
|
+
env: process.env,
|
|
82
|
+
cwd: process.cwd(),
|
|
83
|
+
home: os.homedir(),
|
|
84
|
+
}) {
|
|
85
|
+
let debug = environment.argv.includes("--debug") || environment.env.REQUEST_LOGGER_DEBUG === "1";
|
|
86
|
+
try {
|
|
87
|
+
const command = parseCommand(environment);
|
|
88
|
+
if (command.kind === "help")
|
|
89
|
+
console.log(HELP);
|
|
90
|
+
else if (command.kind === "version")
|
|
91
|
+
console.log(version());
|
|
92
|
+
else {
|
|
93
|
+
debug = command.options.debug;
|
|
94
|
+
// Load the server and prompt modules only when the logger actually starts.
|
|
95
|
+
const { start } = await import("./main.js");
|
|
96
|
+
await start(command.options);
|
|
97
|
+
}
|
|
98
|
+
return 0;
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
console.error(formatError(error, debug));
|
|
102
|
+
return 1;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa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