claude-code-infinite 1.0.35 → 1.0.37
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 +114 -10
- package/dist/body-shape.d.ts +49 -0
- package/dist/body-shape.d.ts.map +1 -0
- package/dist/body-shape.js +232 -0
- package/dist/body-shape.js.map +1 -0
- package/dist/cc-request.d.ts +15 -0
- package/dist/cc-request.d.ts.map +1 -1
- package/dist/cc-request.js +30 -0
- package/dist/cc-request.js.map +1 -1
- package/dist/claude-env.d.ts +24 -1
- package/dist/claude-env.d.ts.map +1 -1
- package/dist/claude-env.js +48 -7
- package/dist/claude-env.js.map +1 -1
- package/dist/cli-args.d.ts +1 -1
- package/dist/cli-args.d.ts.map +1 -1
- package/dist/cli-args.js +1 -1
- package/dist/cli-args.js.map +1 -1
- package/dist/cli-main.js +113 -11
- package/dist/cli-main.js.map +1 -1
- package/dist/config.d.ts +5 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/count-tokens.d.ts +15 -2
- package/dist/count-tokens.d.ts.map +1 -1
- package/dist/count-tokens.js +13 -4
- package/dist/count-tokens.js.map +1 -1
- package/dist/desktop-command.d.ts +38 -0
- package/dist/desktop-command.d.ts.map +1 -0
- package/dist/desktop-command.js +324 -0
- package/dist/desktop-command.js.map +1 -0
- package/dist/desktop-service.d.ts +41 -0
- package/dist/desktop-service.d.ts.map +1 -0
- package/dist/desktop-service.js +449 -0
- package/dist/desktop-service.js.map +1 -0
- package/dist/desktop-setup.d.ts +94 -0
- package/dist/desktop-setup.d.ts.map +1 -0
- package/dist/desktop-setup.js +288 -0
- package/dist/desktop-setup.js.map +1 -0
- package/dist/financial-redaction.d.ts +12 -0
- package/dist/financial-redaction.d.ts.map +1 -0
- package/dist/financial-redaction.js +509 -0
- package/dist/financial-redaction.js.map +1 -0
- package/dist/hooks.d.ts +2 -0
- package/dist/hooks.d.ts.map +1 -1
- package/dist/hooks.js +4 -0
- package/dist/hooks.js.map +1 -1
- package/dist/https-proxy-eligibility.d.ts +31 -0
- package/dist/https-proxy-eligibility.d.ts.map +1 -0
- package/dist/https-proxy-eligibility.js +204 -0
- package/dist/https-proxy-eligibility.js.map +1 -0
- package/dist/https-proxy-mode.d.ts +59 -0
- package/dist/https-proxy-mode.d.ts.map +1 -0
- package/dist/https-proxy-mode.js +255 -0
- package/dist/https-proxy-mode.js.map +1 -0
- package/dist/https-proxy-session.d.ts +64 -0
- package/dist/https-proxy-session.d.ts.map +1 -0
- package/dist/https-proxy-session.js +165 -0
- package/dist/https-proxy-session.js.map +1 -0
- package/dist/image-tokens.d.ts +6 -1
- package/dist/image-tokens.d.ts.map +1 -1
- package/dist/image-tokens.js +75 -14
- package/dist/image-tokens.js.map +1 -1
- package/dist/lane-activity.d.ts +42 -0
- package/dist/lane-activity.d.ts.map +1 -0
- package/dist/lane-activity.js +79 -0
- package/dist/lane-activity.js.map +1 -0
- package/dist/memtree-mcp.d.ts +32 -1
- package/dist/memtree-mcp.d.ts.map +1 -1
- package/dist/memtree-mcp.js +73 -7
- package/dist/memtree-mcp.js.map +1 -1
- package/dist/memtree.d.ts +10 -0
- package/dist/memtree.d.ts.map +1 -1
- package/dist/memtree.js +59 -12
- package/dist/memtree.js.map +1 -1
- package/dist/message-refs.d.ts +81 -0
- package/dist/message-refs.d.ts.map +1 -0
- package/dist/message-refs.js +378 -0
- package/dist/message-refs.js.map +1 -0
- package/dist/mitm-ca.d.ts +31 -0
- package/dist/mitm-ca.d.ts.map +1 -0
- package/dist/mitm-ca.js +236 -0
- package/dist/mitm-ca.js.map +1 -0
- package/dist/paused-session.d.ts.map +1 -1
- package/dist/paused-session.js +9 -2
- package/dist/paused-session.js.map +1 -1
- package/dist/proxy.d.ts +25 -0
- package/dist/proxy.d.ts.map +1 -1
- package/dist/proxy.js +168 -22
- package/dist/proxy.js.map +1 -1
- package/dist/refusal-reason.d.ts +3 -2
- package/dist/refusal-reason.d.ts.map +1 -1
- package/dist/refusal-reason.js +4 -3
- package/dist/refusal-reason.js.map +1 -1
- package/dist/reqlog.d.ts +13 -3
- package/dist/reqlog.d.ts.map +1 -1
- package/dist/reqlog.js +1 -1
- package/dist/reqlog.js.map +1 -1
- package/dist/request-sizing.d.ts +38 -2
- package/dist/request-sizing.d.ts.map +1 -1
- package/dist/request-sizing.js +72 -6
- package/dist/request-sizing.js.map +1 -1
- package/dist/secret-redaction.d.ts +25 -0
- package/dist/secret-redaction.d.ts.map +1 -0
- package/dist/secret-redaction.js +492 -0
- package/dist/secret-redaction.js.map +1 -0
- package/dist/statusline-auto.d.ts +15 -0
- package/dist/statusline-auto.d.ts.map +1 -0
- package/dist/statusline-auto.js +125 -0
- package/dist/statusline-auto.js.map +1 -0
- package/dist/statusline.d.ts.map +1 -1
- package/dist/statusline.js +3 -2
- package/dist/statusline.js.map +1 -1
- package/dist/utf8-bytes.d.ts +10 -0
- package/dist/utf8-bytes.d.ts.map +1 -0
- package/dist/utf8-bytes.js +107 -0
- package/dist/utf8-bytes.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -206,7 +206,7 @@ From a shell or script (no session needed):
|
|
|
206
206
|
| --- | --- |
|
|
207
207
|
| `ccc link <session-id>` | Prints the session's newest MemTree page URL on stdout, one line and nothing else. `--json` prints `{session_id, url, tree, updated_at}` instead (`updated_at` is the session's last activity). Exit status 0 printed, 1 no saved key or the server could not be reached (5 s timeout), 2 bad invocation, 3 the session has no MemTree yet (or no session with that id on your key; stderr says which). Only your own sessions (those of your saved key) are found. `ccc staging link` / `ccc local link` use that environment's key. |
|
|
208
208
|
| `ccc fetch <memtree-url>` | Prints one of your MemTree pages as JSON, using your saved key. |
|
|
209
|
-
| `ccc statusline install` | Adds this session's MemTree link to Claude Code's status line ([details](#memtree-link-in-the-status-line)). `ccc statusline uninstall` undoes it. |
|
|
209
|
+
| `ccc statusline install` | Adds this session's MemTree link to Claude Code's status line (on by default: [details](#memtree-link-in-the-status-line)). `ccc statusline uninstall` undoes it. |
|
|
210
210
|
|
|
211
211
|
Environment variables, set when launching `ccc`:
|
|
212
212
|
|
|
@@ -235,14 +235,19 @@ line only reads that file, so it never waits on the server. While the status lin
|
|
|
235
235
|
settings.json, set `CCC_STATUSLINE_REFRESH=1` (otherwise it refreshes at prompts and turn
|
|
236
236
|
ends).
|
|
237
237
|
|
|
238
|
-
- **
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
238
|
+
- **On by default:** the first interactive `ccc` run (after installing or upgrading) runs
|
|
239
|
+
`ccc statusline install` once and says so in the session's first message. It points
|
|
240
|
+
`statusLine` in `~/.claude/settings.json` (or `$CLAUDE_CONFIG_DIR/settings.json`) at
|
|
241
|
+
`ccc statusline`, which runs your existing status-line command with the same input and
|
|
242
|
+
appends ` | 🌿 tree`. Your original command is saved in
|
|
243
|
+
`~/.claude-code-infinite/statusline-<id>.json` (one per settings file) and settings.json is
|
|
244
|
+
backed up first. When that can't be done safely (settings.json is not valid JSON, your
|
|
245
|
+
`statusLine` is not a command, or `ccc` is not on PATH) it changes nothing and tells you.
|
|
246
|
+
It is done once (`~/.claude-code-infinite/statusline-auto.json`), so after
|
|
247
|
+
`ccc statusline uninstall` it stays off; `CCC_STATUSLINE_AUTO=0` skips it. A `statusLine`
|
|
248
|
+
in a project's `.claude/settings*.json` overrides yours. `ccc statusline uninstall` puts the
|
|
249
|
+
original back; run it before uninstalling ccc. `ccc statusline install` adds it again. Not
|
|
250
|
+
on Windows yet (Claude Code runs status lines in Git Bash there): use the snippet.
|
|
246
251
|
- **Manage it yourself:** add this to the end of your own status-line command (it reads
|
|
247
252
|
Claude Code's JSON from `$input`, as most status lines do; needs `jq`):
|
|
248
253
|
|
|
@@ -280,6 +285,14 @@ refusal before `ccc` ever saw the request. `ccc` sets
|
|
|
280
285
|
`CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE` (unless you exported your own) so such a
|
|
281
286
|
request reaches the proxy, which compresses it mid-turn.
|
|
282
287
|
|
|
288
|
+
On Anthropic's own API, Claude Code can send tool-loop turns as "message threads":
|
|
289
|
+
only the newest messages, with Anthropic keeping the rest of the conversation. MemTree
|
|
290
|
+
needs the whole conversation to compress and index it, so `ccc` sets
|
|
291
|
+
`CLAUDE_CODE_TETHER_LIVE=0` for the Claude Code it starts, and every request carries
|
|
292
|
+
the full conversation as before. This is an undocumented Claude Code switch (checked on
|
|
293
|
+
2.1.325). A value under `env` in your Claude Code settings would win over it, so don't
|
|
294
|
+
set it there. For the desktop app, run `ccc desktop setup` again and paste the new lines.
|
|
295
|
+
|
|
283
296
|
A session whose last response reached the verified local refusal threshold
|
|
284
297
|
(for example one sent whole while MemTree was unavailable) would otherwise be
|
|
285
298
|
refused locally with "Context limit reached" on every prompt after a resume.
|
|
@@ -304,7 +317,7 @@ Code connects directly to Anthropic. The official
|
|
|
304
317
|
|
|
305
318
|
## Privacy & architecture: your Anthropic credentials never leave your machine
|
|
306
319
|
|
|
307
|
-
`ccc` runs a small proxy on `127.0.0.1` and launches Claude Code with `ANTHROPIC_BASE_URL` pointed at it and automatic compaction disabled. Claude Code keeps its **native login** — token refresh, plan-default model selection, and rate-limit handling behave exactly like vanilla Claude Code, and your OAuth token is sent only to `api.anthropic.com` from your own machine.
|
|
320
|
+
`ccc` runs a small proxy on `127.0.0.1` and launches Claude Code with `ANTHROPIC_BASE_URL` pointed at it (or, in the opt-in HTTPS-proxy mode below, `HTTPS_PROXY`) and automatic compaction disabled. Claude Code keeps its **native login** — token refresh, plan-default model selection, and rate-limit handling behave exactly like vanilla Claude Code, and your OAuth token is sent only to `api.anthropic.com` from your own machine.
|
|
308
321
|
|
|
309
322
|
```
|
|
310
323
|
Claude Code ──▶ localhost proxy (ccc)
|
|
@@ -317,6 +330,97 @@ Claude Code ──▶ localhost proxy (ccc)
|
|
|
317
330
|
- Anthropic requests go directly from the local proxy to api.anthropic.com using the authentication Claude Code supplied. PolyChat never sees that credential or Anthropic traffic.
|
|
318
331
|
- If MemTree is unreachable, slow, or your MemTree plan needs payment, `ccc` degrades to a transparent passthrough so your session is never interrupted. While MemTree is paused (usage limit reached), a request that still fits the model's context window (by Anthropic's token count, or ccc's conservative estimate when counting is unavailable) goes out unchanged, as plain Claude Code would send it, and once the session reaches the compression budget the paused notice suggests Claude Code's own `/compact` while it still fits. A request that no longer fits is refused at once with "MemTree is paused (usage limit reached), so this long conversation can't be compressed…", your subscribe link, and `/clear` to start fresh (`/memtree-compact` needs MemTree, so it is not offered then). After you subscribe, the next request compresses again with no restart.
|
|
319
332
|
|
|
333
|
+
### Remote Control (`/remote-control`): HTTPS-proxy mode (opt-in, macOS and Linux)
|
|
334
|
+
|
|
335
|
+
Claude Code offers Remote Control only when it talks to `api.anthropic.com` itself, so in the
|
|
336
|
+
default mode above `/remote-control` is "Unknown command". HTTPS-proxy mode keeps Claude Code's
|
|
337
|
+
base URL at `api.anthropic.com` and makes `ccc` its `HTTPS_PROXY` instead. Every model turn still
|
|
338
|
+
goes through MemTree. Turn it on for one session, or for every session:
|
|
339
|
+
|
|
340
|
+
```bash
|
|
341
|
+
CCC_HTTPS_PROXY_MODE=1 ccc
|
|
342
|
+
# or always: add "httpsProxyMode": true to ~/.claude-code-infinite/config.json
|
|
343
|
+
# (CCC_HTTPS_PROXY_MODE=0 turns it off for one session)
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
How it works and what it changes:
|
|
347
|
+
|
|
348
|
+
- **A certificate for `api.anthropic.com` only, new each session.** At each start `ccc` makes a
|
|
349
|
+
certificate authority in memory, signs one certificate for `api.anthropic.com` with it, and
|
|
350
|
+
drops its key. The key is never written to disk. The CA is name-constrained: it can't vouch for
|
|
351
|
+
any other host name, a subdomain or an IP address. Only Claude Code trusts it, through
|
|
352
|
+
`NODE_EXTRA_CA_CERTS` in its own environment. Nothing goes into your system or keychain trust
|
|
353
|
+
store. The public certificate sits in `~/.claude-code-infinite/https-proxy/` and is removed when
|
|
354
|
+
`ccc` exits.
|
|
355
|
+
- **What `ccc` decrypts.** Only Claude Code's connections to `api.anthropic.com` that carry the
|
|
356
|
+
session's proxy token. Model calls get MemTree as before. Everything else Claude Code sends
|
|
357
|
+
there (Remote Control's bridge and session events, file uploads, settings, telemetry) is
|
|
358
|
+
relayed to Anthropic unchanged and never logged or sent to MemTree. Connections to any other
|
|
359
|
+
host go through a blind tunnel that `ccc` doesn't decrypt. A connection without the token (for
|
|
360
|
+
example from another user on the machine) is refused.
|
|
361
|
+
- **Programs you run from Claude Code's Bash tool see what they see today.** `ccc` gives Claude
|
|
362
|
+
Code a `CLAUDE_ENV_FILE` that puts back your own proxy, CA and `NO_PROXY` settings and the
|
|
363
|
+
usual `ANTHROPIC_BASE_URL`, so scripts, SDK apps and a `ccc` started from Bash work as in the
|
|
364
|
+
default mode, and none of them sees the proxy token. A `CLAUDE_ENV_FILE` of your own is still
|
|
365
|
+
sourced.
|
|
366
|
+
- **Hooks, status-line commands and MCP servers** that Claude Code starts aren't Bash commands,
|
|
367
|
+
so they inherit the proxy and the session CA. Node-based ones work. A non-Node one that calls
|
|
368
|
+
`api.anthropic.com` itself (for example a status line that curls Anthropic's usage endpoint, or
|
|
369
|
+
a Python MCP server using the Anthropic API) fails TLS. Run such sessions with
|
|
370
|
+
`CCC_HTTPS_PROXY_MODE=0`.
|
|
371
|
+
- **When it stays off.** `ccc` uses the default mode for the session, and says so in one line,
|
|
372
|
+
on Windows; when you already use a proxy (`HTTPS_PROXY`, `HTTP_PROXY` or `ALL_PROXY` in your
|
|
373
|
+
environment); when a Claude Code settings file (user, project, local, managed, or
|
|
374
|
+
`--settings`) sets a proxy, `NO_PROXY`, `NODE_EXTRA_CA_CERTS` or `CLAUDE_ENV_FILE` in its `env`;
|
|
375
|
+
and when Claude Code's Bash sandbox is enabled. These are checked at startup. If you turn one on mid-session
|
|
376
|
+
and your prompts stop reaching `ccc`, it warns you once. Restart `ccc` then.
|
|
377
|
+
- `CCC_PROXY_TRACE=<file>` writes a debug trace: connection targets, and the method, path,
|
|
378
|
+
status and User-Agent of each decrypted request. It holds no other header values and no bodies.
|
|
379
|
+
|
|
380
|
+
Remote Control also needs a full-scope Claude login (`claude auth login`). A long-lived setup
|
|
381
|
+
token isn't enough.
|
|
382
|
+
|
|
383
|
+
### The Claude desktop app (opt-in, macOS)
|
|
384
|
+
|
|
385
|
+
The desktop app's Code tab runs its own copy of Claude Code, so `ccc` can't wrap it. Instead
|
|
386
|
+
`ccc desktop setup` runs a small always-on `ccc` service (a launchd agent) that is the HTTPS
|
|
387
|
+
proxy of the Desktop sessions you point at it, with the same interception as HTTPS-proxy mode
|
|
388
|
+
above. Desktop keeps its own sign-in, plan and Remote Control.
|
|
389
|
+
|
|
390
|
+
```bash
|
|
391
|
+
ccc desktop setup # service, certificate, memory tools; prints six lines
|
|
392
|
+
ccc desktop env # print the six lines again
|
|
393
|
+
ccc desktop status # is the service up, how many sessions it serves
|
|
394
|
+
ccc desktop uninstall # stop and remove it all
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
Paste the six lines into the desktop app once: Code tab > environment menu > add a local
|
|
398
|
+
environment (for example "ccc") > **Environment variables**. New sessions started from that
|
|
399
|
+
environment get MemTree. Sessions in other environments are unchanged.
|
|
400
|
+
|
|
401
|
+
- **What setup installs:** `~/.claude-code-infinite/desktop/` (0700): the service's port and
|
|
402
|
+
token, its certificate, and a Bash env file; the launch agent
|
|
403
|
+
`~/Library/LaunchAgents/co.polychat.ccc-desktop.plist`; and a user-scope `memtree` MCP server
|
|
404
|
+
(through `claude mcp add-json`), which has no tools in sessions that don't go through `ccc`.
|
|
405
|
+
- **The certificate** is for `api.anthropic.com` only, from a name-constrained CA whose key is
|
|
406
|
+
dropped as soon as it signs it. Only the certificate's own key is kept, readable only by
|
|
407
|
+
you. Nothing goes into your system or keychain trust store: only the sessions with the pasted
|
|
408
|
+
`NODE_EXTRA_CA_CERTS` trust it. Setup keeps a corporate CA from your shell's
|
|
409
|
+
`NODE_EXTRA_CA_CERTS` in that bundle. It lasts a year: `ccc desktop status` and a terminal
|
|
410
|
+
`ccc` say when it's due, and `ccc desktop setup` renews it (restart open sessions then).
|
|
411
|
+
`--rotate-ca` makes a new one at once; `--rotate-token` a new proxy token (paste the lines
|
|
412
|
+
again).
|
|
413
|
+
- **If the service stops**, sessions in the ccc environment can't reach Claude ("Unable to
|
|
414
|
+
connect to API") until it's back. launchd restarts it if it crashes. `ccc desktop status`
|
|
415
|
+
says what's wrong and how to restart it, and a terminal `ccc` warns when it's down. To stop
|
|
416
|
+
using it, switch those sessions to another environment.
|
|
417
|
+
- Setup refuses when your shell already uses a proxy or a `NO_PROXY` that covers
|
|
418
|
+
`api.anthropic.com`, or when Claude Code's settings set a proxy, `NO_PROXY`,
|
|
419
|
+
`NODE_EXTRA_CA_CERTS`, `CLAUDE_ENV_FILE` or the Bash sandbox, as HTTPS-proxy mode does. A
|
|
420
|
+
session whose project's settings do so gets an error explaining why instead of running.
|
|
421
|
+
- After upgrading Node or moving ccc, run `ccc desktop setup` again: the agent and the MCP server
|
|
422
|
+
name the Node and ccc paths setup ran with.
|
|
423
|
+
|
|
320
424
|
### Diagnostics
|
|
321
425
|
|
|
322
426
|
`ccc` sends a few diagnostics to MemTree so we can see why a session fails to start or stalls:
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** Below this a body is never anchored (its plain bound is small): no parse, no hashing. */
|
|
2
|
+
export declare const SHAPE_MIN_BYTES: number;
|
|
3
|
+
export interface BodyShape {
|
|
4
|
+
/** Hash of the body without `messages` (system, tools, thinking, ...). */
|
|
5
|
+
frame: string;
|
|
6
|
+
/** One hash per message, in order. */
|
|
7
|
+
messages: string[];
|
|
8
|
+
/** Each message's canonical JSON length (UTF-8 bytes, as the per-model ratios assume). */
|
|
9
|
+
sizes: number[];
|
|
10
|
+
/** Each message's inline image base64 characters (within its size). */
|
|
11
|
+
imageChars: number[];
|
|
12
|
+
/**
|
|
13
|
+
* The body asks Anthropic to edit its input (context_management, compaction): a count or
|
|
14
|
+
* usage may describe the edited input, so it never anchors a size (review r2 P3).
|
|
15
|
+
*/
|
|
16
|
+
serverEdits: boolean;
|
|
17
|
+
/** Each inline base64 image's dimensions (undefined when unreadable), in order. */
|
|
18
|
+
imageDims: Array<[number, number] | undefined>;
|
|
19
|
+
/**
|
|
20
|
+
* The body holds something the anchor cannot bound: a message block outside
|
|
21
|
+
* MESSAGE_BLOCKS (a document, a URL or file image, search results, server tool blocks, an
|
|
22
|
+
* upload), a request field outside FRAME_FIELDS (mcp_servers) or a tool that is not a
|
|
23
|
+
* custom one. Such a body never anchors a size (Codex r4-r7 P1s).
|
|
24
|
+
*/
|
|
25
|
+
unanchorable: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Index of the last message holding a tool_reference (Anthropic expands it into the
|
|
28
|
+
* tool's definition, past its bytes); -1 when none. Fine in the sampled part, which
|
|
29
|
+
* Anthropic counted expanded; one appended disables the anchor.
|
|
30
|
+
*/
|
|
31
|
+
lastExpanding: number;
|
|
32
|
+
/**
|
|
33
|
+
* Canonical bytes of the frame fields left out of the hash because Claude Code rewrites
|
|
34
|
+
* them every turn (UNHASHED_FIELDS): an anchored bound charges them in full each time, on
|
|
35
|
+
* top of the sample's count, which already held their earlier version (errs high).
|
|
36
|
+
*/
|
|
37
|
+
unhashedBytes: number;
|
|
38
|
+
}
|
|
39
|
+
/** The body's shape; undefined when it is small or not a JSON request with messages. */
|
|
40
|
+
export declare function bodyShape(body: Buffer): BodyShape | undefined;
|
|
41
|
+
/** The shape already worked out for `body`, if any; never computes one. */
|
|
42
|
+
export declare function knownShape(body: Buffer): BodyShape | undefined;
|
|
43
|
+
/** Remember `shape` for another copy of the same bytes. */
|
|
44
|
+
export declare function rememberShape(body: Buffer, shape: BodyShape | undefined): void;
|
|
45
|
+
/** Digest of the frame and the first `count` messages; undefined past the end. */
|
|
46
|
+
export declare function prefixDigest(shape: BodyShape, count: number): string | undefined;
|
|
47
|
+
/** Canonical text bytes (images left out) of messages [from, to). */
|
|
48
|
+
export declare function textBytes(shape: BodyShape, from: number, to?: number): number;
|
|
49
|
+
//# sourceMappingURL=body-shape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"body-shape.d.ts","sourceRoot":"","sources":["../src/body-shape.ts"],"names":[],"mappings":"AAmBA,4FAA4F;AAC5F,eAAO,MAAM,eAAe,QAAa,CAAC;AAE1C,MAAM,WAAW,SAAS;IACxB,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,0FAA0F;IAC1F,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,uEAAuE;IACvE,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB;;;OAGG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB,mFAAmF;IACnF,SAAS,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC,CAAC;IAC/C;;;;;OAKG;IACH,YAAY,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB;AAID,wFAAwF;AACxF,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAI7D;AAED,2EAA2E;AAC3E,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAE9D;AAED,2DAA2D;AAC3D,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,IAAI,CAE9E;AAED,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKhF;AAED,qEAAqE;AACrE,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,SAAwB,GAAG,MAAM,CAM5F"}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A request body's lineage, so a size anchored on an earlier body (request-sizing.ts
|
|
3
|
+
* anchoredBound) is used only for a body that extends it: the same system prompt, tools
|
|
4
|
+
* and model fields, and the earlier body's messages unchanged at the start of this one's.
|
|
5
|
+
* Byte totals alone cannot say that (review r1, Codex r1 P1): Claude Code dropping old
|
|
6
|
+
* thinking signatures (base64, nearly free) while adding as many bytes of dense tool output
|
|
7
|
+
* keeps the totals and changes the tokens.
|
|
8
|
+
*
|
|
9
|
+
* Each message is hashed on its own in a canonical form: JSON.stringify of the message with
|
|
10
|
+
* the cache_control markers Claude Code moves every turn removed, only where the API puts
|
|
11
|
+
* them (a content block, a tool_result's inner block; in the frame, a system block, a tool,
|
|
12
|
+
* the top level), never inside tool inputs or schemas (Codex r2 P1). The canonical length
|
|
13
|
+
* and image characters of each message are kept too, so what was appended is sized from its
|
|
14
|
+
* own canonical bytes, not from a raw byte difference a re-encoded prefix could hide
|
|
15
|
+
* (Codex r2 P1).
|
|
16
|
+
*/
|
|
17
|
+
import { createHash } from "node:crypto";
|
|
18
|
+
import { imageDimensions } from "./image-tokens.js";
|
|
19
|
+
/** Below this a body is never anchored (its plain bound is small): no parse, no hashing. */
|
|
20
|
+
export const SHAPE_MIN_BYTES = 256 * 1024;
|
|
21
|
+
const shapes = new WeakMap();
|
|
22
|
+
/** The body's shape; undefined when it is small or not a JSON request with messages. */
|
|
23
|
+
export function bodyShape(body) {
|
|
24
|
+
if (body.length < SHAPE_MIN_BYTES)
|
|
25
|
+
return undefined;
|
|
26
|
+
if (!shapes.has(body))
|
|
27
|
+
shapes.set(body, computeShape(body));
|
|
28
|
+
return shapes.get(body) ?? undefined;
|
|
29
|
+
}
|
|
30
|
+
/** The shape already worked out for `body`, if any; never computes one. */
|
|
31
|
+
export function knownShape(body) {
|
|
32
|
+
return shapes.get(body) ?? undefined;
|
|
33
|
+
}
|
|
34
|
+
/** Remember `shape` for another copy of the same bytes. */
|
|
35
|
+
export function rememberShape(body, shape) {
|
|
36
|
+
if (shape)
|
|
37
|
+
shapes.set(body, shape);
|
|
38
|
+
}
|
|
39
|
+
/** Digest of the frame and the first `count` messages; undefined past the end. */
|
|
40
|
+
export function prefixDigest(shape, count) {
|
|
41
|
+
if (!Number.isInteger(count) || count < 0 || count > shape.messages.length)
|
|
42
|
+
return undefined;
|
|
43
|
+
const hash = createHash("sha256").update(shape.frame);
|
|
44
|
+
for (let i = 0; i < count; i++)
|
|
45
|
+
hash.update(shape.messages[i]);
|
|
46
|
+
return hash.digest("hex");
|
|
47
|
+
}
|
|
48
|
+
/** Canonical text bytes (images left out) of messages [from, to). */
|
|
49
|
+
export function textBytes(shape, from, to = shape.messages.length) {
|
|
50
|
+
let total = 0;
|
|
51
|
+
for (let i = Math.max(0, from); i < Math.min(to, shape.sizes.length); i++) {
|
|
52
|
+
total += Math.max(0, shape.sizes[i] - shape.imageChars[i]);
|
|
53
|
+
}
|
|
54
|
+
return total;
|
|
55
|
+
}
|
|
56
|
+
function computeShape(body) {
|
|
57
|
+
let parsed;
|
|
58
|
+
try {
|
|
59
|
+
parsed = JSON.parse(body.toString("utf-8"));
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
65
|
+
return null;
|
|
66
|
+
const { messages, ...frame } = parsed;
|
|
67
|
+
if (!Array.isArray(messages))
|
|
68
|
+
return null;
|
|
69
|
+
const unhashed = UNHASHED_FIELDS.filter((key) => frame[key] !== undefined)
|
|
70
|
+
.map((key) => JSON.stringify(frame[key])).join("");
|
|
71
|
+
const shape = { frame: hash(JSON.stringify(canonicalFrame(frame))),
|
|
72
|
+
messages: [], sizes: [], imageChars: [],
|
|
73
|
+
serverEdits: !noOpEdits(frame.context_management) || frame.compaction !== undefined,
|
|
74
|
+
imageDims: [], unanchorable: !frameAnchorable(frame), lastExpanding: -1,
|
|
75
|
+
unhashedBytes: Buffer.byteLength(unhashed, "utf-8") };
|
|
76
|
+
for (const message of messages) {
|
|
77
|
+
const text = JSON.stringify(canonicalMessage(message)) ?? "";
|
|
78
|
+
shape.messages.push(hash(text));
|
|
79
|
+
shape.sizes.push(Buffer.byteLength(text, "utf-8"));
|
|
80
|
+
shape.imageChars.push(imageCharsOf(message, shape));
|
|
81
|
+
if (!message || typeof message !== "object" ||
|
|
82
|
+
!Object.keys(message).every((key) => MESSAGE_FIELDS.has(key)))
|
|
83
|
+
shape.unanchorable = true;
|
|
84
|
+
if (text.includes('"type":"tool_reference"'))
|
|
85
|
+
shape.lastExpanding = shape.messages.length - 1;
|
|
86
|
+
}
|
|
87
|
+
return shape;
|
|
88
|
+
}
|
|
89
|
+
function hash(text) {
|
|
90
|
+
return createHash("sha256").update(text).digest("hex");
|
|
91
|
+
}
|
|
92
|
+
/** The frame without cache_control (top level, system blocks, tools) and diagnostics. */
|
|
93
|
+
function canonicalFrame(frame) {
|
|
94
|
+
const rest = { ...frame };
|
|
95
|
+
delete rest.cache_control;
|
|
96
|
+
// Claude Code's cache-diagnosis metadata names the previous message id: it changes every
|
|
97
|
+
// turn and costs no prompt tokens (review r3 P1). Anything else under it stays hashed.
|
|
98
|
+
if (onlyPreviousMessageId(rest.diagnostics))
|
|
99
|
+
delete rest.diagnostics;
|
|
100
|
+
for (const key of UNHASHED_FIELDS)
|
|
101
|
+
delete rest[key];
|
|
102
|
+
if (Array.isArray(rest.system))
|
|
103
|
+
rest.system = rest.system.map(withoutMarker);
|
|
104
|
+
if (Array.isArray(rest.tools))
|
|
105
|
+
rest.tools = rest.tools.map(withoutMarker);
|
|
106
|
+
return rest;
|
|
107
|
+
}
|
|
108
|
+
/** A message without cache_control on its content blocks (and tool results' blocks). */
|
|
109
|
+
function canonicalMessage(message) {
|
|
110
|
+
const content = message?.content;
|
|
111
|
+
if (!Array.isArray(content))
|
|
112
|
+
return message;
|
|
113
|
+
return { ...message, content: content.map((block) => {
|
|
114
|
+
const bare = withoutMarker(block);
|
|
115
|
+
if (bare && bare.type === "tool_result" && Array.isArray(bare.content)) {
|
|
116
|
+
return { ...bare, content: bare.content.map(withoutMarker) };
|
|
117
|
+
}
|
|
118
|
+
return bare;
|
|
119
|
+
}) };
|
|
120
|
+
}
|
|
121
|
+
function withoutMarker(block) {
|
|
122
|
+
if (!block || typeof block !== "object" || Array.isArray(block))
|
|
123
|
+
return block;
|
|
124
|
+
const rest = { ...block };
|
|
125
|
+
delete rest.cache_control;
|
|
126
|
+
return rest;
|
|
127
|
+
}
|
|
128
|
+
/** Base64 characters of the message's inline images (content and tool results); each
|
|
129
|
+
* image's dimensions, and any image that is not inline, are noted on `shape`. */
|
|
130
|
+
function imageCharsOf(message, shape) {
|
|
131
|
+
const content = message?.content;
|
|
132
|
+
return Array.isArray(content) ? blockImageChars(content, shape) : 0;
|
|
133
|
+
}
|
|
134
|
+
function blockImageChars(blocks, shape, nested = false) {
|
|
135
|
+
let total = 0;
|
|
136
|
+
for (const item of blocks) {
|
|
137
|
+
const block = item;
|
|
138
|
+
if (!block || typeof block !== "object")
|
|
139
|
+
continue;
|
|
140
|
+
const source = block.source;
|
|
141
|
+
if (block.type === "image" && source?.type === "base64" && typeof source.data === "string") {
|
|
142
|
+
total += source.data.length;
|
|
143
|
+
shape.imageDims.push(imageDimensions(source.data));
|
|
144
|
+
}
|
|
145
|
+
else if (block.type === "tool_result" && !nested) {
|
|
146
|
+
if (Array.isArray(block.content))
|
|
147
|
+
total += blockImageChars(block.content, shape, true);
|
|
148
|
+
else if (block.content !== undefined && typeof block.content !== "string") {
|
|
149
|
+
shape.unanchorable = true;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
else if (!(nested ? NESTED_BLOCKS : MESSAGE_BLOCKS).has(String(block.type))) {
|
|
153
|
+
shape.unanchorable = true;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return total;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Blocks whose cost the anchor can bound: text (by its bytes), inline base64 images (by
|
|
160
|
+
* their dimensions), tool calls and results, thinking, tool additions (their definition
|
|
161
|
+
* is inline), tool references (only where already counted: BodyShape.lastExpanding). Anything else (a document, which
|
|
162
|
+
* Anthropic expands into page images and text far past its bytes; a URL or file image;
|
|
163
|
+
* search results; server tool blocks; uploads) disables the anchor, so its size is the
|
|
164
|
+
* plain bound or a count as before (Codex r4-r6 P1s).
|
|
165
|
+
*/
|
|
166
|
+
/**
|
|
167
|
+
* Request fields whose cost is in the body (or none): anything else, such as mcp_servers
|
|
168
|
+
* (tool definitions fetched remotely, Codex r7 P1), disables the anchor. compaction, and a
|
|
169
|
+
* context_management that edits anything, are refused too (serverEdits, noOpEdits).
|
|
170
|
+
* Fields stay in the frame hash, so whatever they cost was in the sample's count too and a
|
|
171
|
+
* change to them breaks the lineage, except UNHASHED_FIELDS, charged in full instead. Claude Code features that turn the anchor off (safe, just
|
|
172
|
+
* no anchor; a request log without compaction.anchoredBound): message `thread`s,
|
|
173
|
+
* `program_use_case_id`/`fallbacks`, tool-result clearing after idle, an advisor call's
|
|
174
|
+
* result blocks in the messages.
|
|
175
|
+
*/
|
|
176
|
+
const FRAME_FIELDS = new Set(["model", "max_tokens", "stream", "system", "tools", "tool_choice",
|
|
177
|
+
"metadata", "thinking", "temperature", "top_p", "top_k", "stop_sequences", "output_config",
|
|
178
|
+
"output_format", "speed", "service_tier", "cache_control", "context_management",
|
|
179
|
+
"diagnostics", "safeguards", "data_flow"]);
|
|
180
|
+
/**
|
|
181
|
+
* Whether `context_management` edits nothing: absent, or only Claude Code's
|
|
182
|
+
* `clear_thinking_20251015` with `keep: "all"`, which it sends whenever thinking is on.
|
|
183
|
+
* Any other edit (clearing tool uses, or thinking past some turns) may make a count
|
|
184
|
+
* describe edited input (review r2 P3).
|
|
185
|
+
*/
|
|
186
|
+
function noOpEdits(management) {
|
|
187
|
+
if (management === undefined)
|
|
188
|
+
return true;
|
|
189
|
+
const edits = management?.edits;
|
|
190
|
+
return Array.isArray(edits) && Object.keys(management).every((k) => k === "edits") &&
|
|
191
|
+
edits.every((edit) => {
|
|
192
|
+
const e = edit;
|
|
193
|
+
return !!e && e.type === "clear_thinking_20251015" && e.keep === "all" &&
|
|
194
|
+
Object.keys(e).every((k) => k === "type" || k === "keep");
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Server tools whose definition is fixed by their versioned type (no remote content): the
|
|
199
|
+
* hash covers them like any field. Claude Code 2.1.32x adds an advisor tool to every request
|
|
200
|
+
* (review r3); its results arrive as message blocks, which MESSAGE_BLOCKS refuses.
|
|
201
|
+
*/
|
|
202
|
+
const VERSIONED_TOOL = /^advisor_\d{8}$/;
|
|
203
|
+
/**
|
|
204
|
+
* Fields Claude Code rebuilds every turn from the conversation (auto mode's classifier
|
|
205
|
+
* context, data-flow tracking; both outside its own prompt-identity hash): hashed, they
|
|
206
|
+
* would break lineage on every turn (review r4 P2), so they are charged instead
|
|
207
|
+
* (BodyShape.unhashedBytes).
|
|
208
|
+
*/
|
|
209
|
+
const UNHASHED_FIELDS = ["safeguards", "data_flow"];
|
|
210
|
+
function onlyPreviousMessageId(diagnostics) {
|
|
211
|
+
return !!diagnostics && typeof diagnostics === "object" && !Array.isArray(diagnostics) &&
|
|
212
|
+
Object.keys(diagnostics).every((key) => key === "previous_message_id");
|
|
213
|
+
}
|
|
214
|
+
/** Message fields an anchor can bound (Claude Code's turn-scoped system messages included). */
|
|
215
|
+
const MESSAGE_FIELDS = new Set(["role", "content", "clear_at", "output_config"]);
|
|
216
|
+
/** Whether the frame's cost is all in the body: known fields, custom or versioned tools. */
|
|
217
|
+
function frameAnchorable(frame) {
|
|
218
|
+
if (!Object.keys(frame).every((key) => FRAME_FIELDS.has(key)))
|
|
219
|
+
return false;
|
|
220
|
+
const tools = frame.tools;
|
|
221
|
+
if (tools === undefined)
|
|
222
|
+
return true;
|
|
223
|
+
return Array.isArray(tools) && tools.every((tool) => {
|
|
224
|
+
const type = tool?.type;
|
|
225
|
+
return tool !== null && typeof tool === "object" && (type === undefined ||
|
|
226
|
+
type === "custom" || (typeof type === "string" && VERSIONED_TOOL.test(type)));
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
const MESSAGE_BLOCKS = new Set(["text", "tool_use", "tool_result", "thinking",
|
|
230
|
+
"redacted_thinking", "tool_addition", "tool_reference"]);
|
|
231
|
+
const NESTED_BLOCKS = new Set(["text", "tool_reference"]);
|
|
232
|
+
//# sourceMappingURL=body-shape.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"body-shape.js","sourceRoot":"","sources":["../src/body-shape.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,4FAA4F;AAC5F,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,GAAG,IAAI,CAAC;AAuC1C,MAAM,MAAM,GAAG,IAAI,OAAO,EAA4B,CAAC;AAEvD,wFAAwF;AACxF,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,IAAI,IAAI,CAAC,MAAM,GAAG,eAAe;QAAE,OAAO,SAAS,CAAC;IACpD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5D,OAAO,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC;AACvC,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC;AACvC,CAAC;AAED,2DAA2D;AAC3D,MAAM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KAAK,SAAS;YACrE,IAAI,KAAK,QAAQ,IAAI,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClF,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU;IAC3E,mBAAmB,EAAE,eAAe,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAC3D,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC"}
|
package/dist/cc-request.d.ts
CHANGED
|
@@ -42,6 +42,21 @@ export declare function sessionTag(sessionId: string | undefined): string | unde
|
|
|
42
42
|
* and never involves MemTree or the main thread's route state.
|
|
43
43
|
*/
|
|
44
44
|
export declare function isClaudeCodeSideRequest(info: ClaudeCodeRequestInfo): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Why a request's messages are not its session's conversation; undefined when they are.
|
|
47
|
+
* Such a request must neither become the conversation the session's final index sends
|
|
48
|
+
* nor be uploaded to MemTree as a conversation of its own: either one builds a tree of a
|
|
49
|
+
* fragment, and the session's newest tree (the status line's link) becomes that fragment.
|
|
50
|
+
*
|
|
51
|
+
* - `side-request`: Claude Code's own one-off request on the session (title, Remote
|
|
52
|
+
* Control's "user walked away" status summary, WebFetch summary, security monitor).
|
|
53
|
+
* - `thread-continue`: a message-threads continuation (`thread: {type: "continue"}`,
|
|
54
|
+
* first-party API only, so in HTTPS-proxy mode): its messages are only those after
|
|
55
|
+
* the reply it continues; the API holds the rest.
|
|
56
|
+
*/
|
|
57
|
+
export type NotConversationKind = "side-request" | "thread-continue";
|
|
58
|
+
export declare function notSessionConversation(body: Record<string, any>, info: ClaudeCodeRequestInfo | undefined): NotConversationKind | undefined;
|
|
59
|
+
export declare function isThreadContinuation(body: Record<string, any>): boolean;
|
|
45
60
|
/**
|
|
46
61
|
* Shape of the monitor's `<transcript>` block, checked on every side request
|
|
47
62
|
* so a change in Claude Code's internal format shows up in the request log
|
package/dist/cc-request.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cc-request.d.ts","sourceRoot":"","sources":["../src/cc-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAmBrD,8EAA8E;AAC9E,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC,MAAM,WAAW,qBAAqB;IACpC,mEAAmE;IACnE,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,QAAQ,EAAE,OAAO,CAAC;IAClB,8EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,oBAAoB,EAAE,OAAO,CAAC;IAC9B;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,qBAAqB,CAqC1F;AAED,+EAA+E;AAC/E,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAE5E;AA6CD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAE5E;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,OAAO,CAAC;IACZ,wDAAwD;IACxD,MAAM,CAAC,EAAE,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AE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uFAAuF;IACvF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAID,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,IAAI,CAAC,EAAE,qBAAqB,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,GAAG,iBAAiB,CAmBpB"}
|
package/dist/cc-request.js
CHANGED
|
@@ -115,6 +115,36 @@ function oneLine(text) {
|
|
|
115
115
|
export function isClaudeCodeSideRequest(info) {
|
|
116
116
|
return info.billingHeader && info.turnOrigin === undefined && info.tools === 0;
|
|
117
117
|
}
|
|
118
|
+
/** Most messages a Claude Code one-off side request was seen to send (title, status summary). */
|
|
119
|
+
const SIDE_REQUEST_MAX_MESSAGES = 2;
|
|
120
|
+
export function notSessionConversation(body, info) {
|
|
121
|
+
if (isThreadContinuation(body))
|
|
122
|
+
return "thread-continue";
|
|
123
|
+
// One-off requests send one or two messages. A release from before cc_turn_origin sends
|
|
124
|
+
// its main thread without one too: there, only a recognised side request is one.
|
|
125
|
+
const messages = Array.isArray(body?.messages) ? body.messages.length : 0;
|
|
126
|
+
if (info && isClaudeCodeSideRequest(info) && messages <= SIDE_REQUEST_MAX_MESSAGES &&
|
|
127
|
+
(knownSideRequestKind(info) !== undefined || sendsTurnOrigin(info.ccVersion))) {
|
|
128
|
+
return "side-request";
|
|
129
|
+
}
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
/** Claude Code releases from 2.1.281 on mark main-thread requests with cc_turn_origin. */
|
|
133
|
+
const TURN_ORIGIN_SINCE = [2, 1, 281];
|
|
134
|
+
function sendsTurnOrigin(ccVersion) {
|
|
135
|
+
const parts = (ccVersion ?? "").split(".").slice(0, 3).map(Number);
|
|
136
|
+
if (parts.length < 3 || parts.some((n) => !Number.isInteger(n)))
|
|
137
|
+
return false;
|
|
138
|
+
for (let i = 0; i < 3; i++) {
|
|
139
|
+
if (parts[i] !== TURN_ORIGIN_SINCE[i])
|
|
140
|
+
return parts[i] > TURN_ORIGIN_SINCE[i];
|
|
141
|
+
}
|
|
142
|
+
return true;
|
|
143
|
+
}
|
|
144
|
+
export function isThreadContinuation(body) {
|
|
145
|
+
const thread = body?.thread;
|
|
146
|
+
return thread !== null && typeof thread === "object" && thread.type === "continue";
|
|
147
|
+
}
|
|
118
148
|
export function knownSideRequestKind(info) {
|
|
119
149
|
if (info.systemHead?.includes("You are naming a coding session"))
|
|
120
150
|
return "session-title";
|
package/dist/cc-request.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cc-request.js","sourceRoot":"","sources":["../src/cc-request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC;;;;;;;;;;;;;;GAcG;AAEH,MAAM,qBAAqB,GAAG,6BAA6B,CAAC;AAC5D,8EAA8E;AAC9E,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAmCrC,MAAM,UAAU,yBAAyB,CAAC,IAAyB;IACjE,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAChC,IAAI,MAA0C,CAAC;IAC/C,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,UAAU,CAAC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AK,CAAC,IAAI;QAChB,QAAQ,EAAE,KAAK,CAAC,OAAO;QACvB,eAAe,EAAE,KAAK,CAAC,aAAa;QACpC,eAAe,EAAE,KAAK,CAAC,KAAK;KAC7B,CAAC;IACF,MAAM,IAAI,GAA2B,EAAE,CAAC;IACxC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QACrD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;YAAE,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IAC7E,CAAC;IACD,OAAO,IAAyB,CAAC;AACnC,CAAC"}
|
package/dist/claude-env.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HttpsProxyChild } from "./https-proxy-session.js";
|
|
1
2
|
/**
|
|
2
3
|
* Environment for the Claude Code child process.
|
|
3
4
|
*
|
|
@@ -40,7 +41,29 @@
|
|
|
40
41
|
*/
|
|
41
42
|
/** Claude Code's local refusal limit under ccc: effectively never reached. */
|
|
42
43
|
export declare const UNREACHABLE_BLOCKING_LIMIT = "1000000000";
|
|
43
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Message threads off. On the first-party API, Claude Code 2.1.325 sends
|
|
46
|
+
* `thread: {type: "continue", previous_message_id}` on tool-loop turns: only the messages
|
|
47
|
+
* after the continued reply, Anthropic holding the rest. ccc then can't compress mid-loop
|
|
48
|
+
* and the final index misses the last tool loop. HTTPS-proxy mode gets threads from
|
|
49
|
+
* Anthropic's rollout flag today; base-URL mode would too if the flag reached it (it
|
|
50
|
+
* does with the opt-in set). Claude Code reads this env var (a tri-state in its env
|
|
51
|
+
* schema, once per process) before that flag; "0" turns message threads off. A settings
|
|
52
|
+
* `env` value would win over it. Undocumented: if a later release drops it, threads come
|
|
53
|
+
* back and proxy.ts still forwards continuations untouched (logged as notConversation).
|
|
54
|
+
*/
|
|
55
|
+
export declare const MESSAGE_THREADS_OFF: Readonly<Record<string, string>>;
|
|
56
|
+
/**
|
|
57
|
+
* `httpsProxy` (HTTPS-proxy mode, https-proxy-session.ts): Claude Code reaches ccc
|
|
58
|
+
* through HTTPS_PROXY instead, with no custom base URL (so Remote Control stays
|
|
59
|
+
* available and no first-party override is needed); the MemTree MCP server and agents
|
|
60
|
+
* find the loopback in CCC_MEMTREE_PROXY, and Bash commands get today's variables back
|
|
61
|
+
* from CLAUDE_ENV_FILE.
|
|
62
|
+
*
|
|
63
|
+
* Both modes turn message threads off (MESSAGE_THREADS_OFF), whatever the parent exported,
|
|
64
|
+
* so every request carries the whole conversation.
|
|
65
|
+
*/
|
|
66
|
+
export declare function claudeChildEnv(parentEnv: NodeJS.ProcessEnv, anthropicBaseUrl: string, httpsProxy?: HttpsProxyChild): NodeJS.ProcessEnv;
|
|
44
67
|
/**
|
|
45
68
|
* Keep the proxy's MemTree budget in lockstep with Claude Code's own context
|
|
46
69
|
* accounting. This is the documented escape hatch for forcing native-1M
|
package/dist/claude-env.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-env.d.ts","sourceRoot":"","sources":["../src/claude-env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,8EAA8E;AAC9E,eAAO,MAAM,0BAA0B,eAAe,CAAC;AAEvD,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,CAAC,UAAU,EAC5B,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"claude-env.d.ts","sourceRoot":"","sources":["../src/claude-env.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,8EAA8E;AAC9E,eAAO,MAAM,0BAA0B,eAAe,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAChB,CAAC;AAElD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,CAAC,UAAU,EAC5B,gBAAgB,EAAE,MAAM,EACxB,UAAU,CAAC,EAAE,eAAe,GAC3B,MAAM,CAAC,UAAU,CA0BnB;AA0BD;;;;GAIG;AACH,wBAAgB,oCAAoC,CAClD,SAAS,EAAE,MAAM,CAAC,UAAU,GAC3B,OAAO,CAET"}
|