@isaacthoman/pulpo 0.131.3 → 0.132.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.
Files changed (3) hide show
  1. package/README.md +31 -0
  2. package/dist/index.js +17 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -106,6 +106,37 @@ errors remain on stderr, and noninteractive destructive commands require
106
106
  `--yes`. Add `--verbose` to print method, path, status, and timing diagnostics
107
107
  without printing authorization headers or request bodies.
108
108
 
109
+ ### Detailed payloads
110
+
111
+ ```sh
112
+ pulpo usage requests --range 7d --model model-id --limit 20 --json
113
+ pulpo usage requests --range 7d --limit 20 --cursor '2026-09-09T12:00:00.000Z' --json
114
+ pulpo usage payloads MODEL_CALL_ID
115
+ pulpo usage payloads REQUEST_LOG_ID --json
116
+ pulpo settings get instance.logging
117
+ pulpo settings set instance.logging.payloadRetention 24h --yes
118
+ pulpo settings set instance.logging.logDetailedPayloads true --yes
119
+ ```
120
+
121
+ `usage requests` returns model-call IDs, parent request-log IDs, and `nextCursor`.
122
+ Keep the same filters on subsequent pages. Ranges are `24h` (default), `7d`,
123
+ `30d`, `90d`, and `all`; additional filters include `--status`, `--origin`, and
124
+ `--identity` (user or API key ID).
125
+
126
+ `usage payloads` prints untruncated, indented JSON in both human and machine modes.
127
+ It includes the parent request/response bodies, agent turn arrays when captured,
128
+ and OCR attempts. Bodies cover the parent request, potentially including multiple
129
+ model calls or retries. `available`, `captureActive`, `payloadExpiresAt`, and
130
+ `unavailableReason` distinguish retained data, expiry, capture disabled/cleared,
131
+ and bodies not yet captured. Expired bodies return null, even before cleanup runs.
132
+ `usage request ID` remains the metadata view.
133
+
134
+ Viewing payloads requires a current administrator with `usage:read` and a server
135
+ advertising `detailedPayloads`. Logging settings require `instance:read` and
136
+ `instance:write`. Capture defaults to off; enable it before the request you want to
137
+ inspect. Retention choices are `1h`, `24h`, `7d`, `30d`, `90d`, and `indefinite`.
138
+ Bodies may contain sensitive prompts, outputs, tool data, and OCR images.
139
+
109
140
  Configuration precedence is command-line options, then `PULPO_CONTEXT` /
110
141
  `PULPO_URL` / `PULPO_TOKEN`, then the current stored context. Context metadata
111
142
  lives in the platform config directory. Session tokens use Keychain on macOS or
package/dist/index.js CHANGED
@@ -20730,7 +20730,7 @@ async function runModelTest(input) {
20730
20730
  }
20731
20731
 
20732
20732
  // src/index.ts
20733
- var CLI_VERSION = true ? "0.131.3" : "0.1.0";
20733
+ var CLI_VERSION = true ? "0.132.1" : "0.1.0";
20734
20734
  var CLI_BUNDLED = true;
20735
20735
  var commandIo = /* @__PURE__ */ new WeakMap();
20736
20736
  var commandClientFactory = /* @__PURE__ */ new WeakMap();
@@ -21396,9 +21396,23 @@ function createProgram(io = processIo, dependencies = {}) {
21396
21396
  const { client } = await clientFor(command);
21397
21397
  emit(io, command, await client.request("/api/management/v1/usage/summary"));
21398
21398
  });
21399
- usage.command("requests").action(async (_options, command) => {
21399
+ usage.command("requests").description("List model calls with request-log IDs and a pagination cursor").addOption(new Option("--range <range>", "time range").choices(["24h", "7d", "30d", "90d", "all"]).default("24h")).option("--limit <count>", "page size (1-100)", "50").option("--cursor <timestamp>", "nextCursor from the previous page").option("--status <statuses>", "comma-separated model-call statuses").option("--origin <origin>", "call source").option("--model <id>", "catalog or upstream model ID").option("--identity <id>", "user or API key ID").action(async (options2, command) => {
21400
+ const limit = external_exports.coerce.number().int().min(1).max(100).parse(options2.limit);
21401
+ if (options2.cursor) external_exports.iso.datetime({ offset: true }).parse(options2.cursor);
21402
+ const query = new URLSearchParams({ range: options2.range, limit: String(limit) });
21403
+ for (const key of ["cursor", "status", "origin", "model", "identity"]) {
21404
+ if (options2[key]) query.set(key, options2[key]);
21405
+ }
21400
21406
  const { client } = await clientFor(command);
21401
- emit(io, command, await client.request("/api/management/v1/usage/requests"));
21407
+ emit(io, command, await client.request(`/api/management/v1/usage/requests?${query}`));
21408
+ });
21409
+ usage.command("payloads <id>").description("View retained request, response, and OCR bodies by model-call or request-log ID").action(async (id, _options, command) => {
21410
+ const { client, info } = await clientFor(command);
21411
+ if (!info.capabilities.includes("detailedPayloads")) {
21412
+ throw new Error("The selected Pulpo instance does not advertise the detailedPayloads capability; update the server to view payloads");
21413
+ }
21414
+ const payloads = await client.request(`/api/management/v1/usage/requests/${encodeURIComponent(id)}/payloads`);
21415
+ writeOutput(io, payloads, true);
21402
21416
  });
21403
21417
  usage.command("request <id>").action(async (id, _options, command) => {
21404
21418
  const { client } = await clientFor(command);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isaacthoman/pulpo",
3
- "version": "0.131.3",
3
+ "version": "0.132.1",
4
4
  "description": "Operator-first command-line client for Pulpo",
5
5
  "type": "module",
6
6
  "bin": {