From 5c9fc025b50422206e310715ef9a37e902e12686 Mon Sep 17 00:00:00 2001 From: Eric Wang Date: Tue, 18 Aug 2026 00:12:53 -0700 Subject: [PATCH 1/2] Update spec to v2.1.234; read methods and headers from the binary Documents @anthropic-ai/claude-code@2.1.234 and corrects the extraction method this repo has used since releases went binary-only. The correction. Every previous revision carried this caveat: Header sets, request bodies and timeouts are NOT recoverable from a Bun binary -- those are read from v2.1.76, the last release with a readable bundle, and carried forward explicitly labelled. That was wrong, and has been since v2.1.117. The binary embeds the entire minified JavaScript bundle as printable text. It reads as one enormous line, so `rg -A/-B` context returns nothing useful and "not recoverable" looked like a fair conclusion. Cut a fixed byte window instead and the call site is complete: fs.get("/v1/ultrareview/quota", {auth: "teleport-org", timeout: 3000}) Methods, header sets, auth modes, timeouts and beta flags for v2.1.234 are now read from v2.1.234. Auth modes -- the most useful thing this recovered. axios call sites name their auth mode and the mode decides the whole header set: teleport-org Authorization + Content-Type + anthropic-version + anthropic-client-platform + x-organization-uuid, and substitutes the literal ":orgUUID" in the path -- which is why paths in the constant pool contain it verbatim session-jwt Authorization: Bearer , nothing else claude-ai-oauth Authorization + anthropic-beta: oauth-2025-04-20 none no auth headers async / unset resolved OAuth headers, or x-api-key under API-key auth Two pre-flight refusals apply to every axios call: essential-traffic-only mode, and a non-first-party provider (data-residency). New scripts, none hardcoding a minified identifier: extract-routes.py method + path + beta + auth + timeout per call site. Anchors the SDK shape on the literal `_client.`, detects axios instances by frequency, resolves hoisted path constants. 242 routes (129 SDK, 114 axios). extract-calls.py printable byte window per endpoint anchor, replacing the `rg -B 10 -A 20 cli.js` recipe that a one-line bundle broke. binary-literals.sh binary -> one-literal-per-line text; the input validate-spec.sh needs for a compiled release. validate-spec.sh: trims captures at URL-invalid characters (a binary capture runs straight into adjacent data), widens the path scope to the families the specs actually cover, normalises {server_id}-style placeholders, and takes --routes so template-built paths stop reading as phantoms. Adds a `# PATH-ONLY` declaration for a path literal whose call site builds it through a helper the route extractor does not follow: the path is verified, the method is not, and the spec says so instead of guessing. 47 such paths. Both gates pass: 0 undocumented, 0 phantom for claude-code-api-complete.http and (--subset) claude-oauth-api.http. Surface changes: 101 path literals (+33), 53 beta flags (+9), 161 routes newly written up. New families -- self-hosted runner pools, MCP tunnels, dreams, deployments, Design consent/grants, ultrareview quota, a much larger frame (Artifact) surface, local/org memory, plugin and skill search. Removed and commented out as history: team_usage, team_memory, user_settings, claude_cli/client_data, /v1/code/egress/gateway, /v1/code/upstreamproxy, and the bare /v1/code/ root. The embedded gateway protocol document grew 9,598 -> 13,246 bytes; recovered whole to extractions/v2.1.234/GATEWAY-PROTOCOL.md. New sections: the overage 429 header contract, TLS leaf-certificate pinning, client guarantees, and proxying to Bedrock/Vertex/Foundry. Section 43 records a cross-check of the binary-derived header sets against a local capture of one live v2.1.234 session. This does not infer endpoints from runtime logs -- it checks facts already read from the binary. No identifiers, tokens, request-ids or organization UUIDs from that capture appear anywhere. Co-Authored-By: Claude Opus 5 --- CLAUDE.md | 21 +- README.md | 82 +- WORKFLOW.md | 98 + extractions/v2.1.234/COMPARE.txt | 56 + extractions/v2.1.234/GATEWAY-PROTOCOL.md | 289 +++ extractions/v2.1.234/SUMMARY.md | 200 ++ .../v2.1.234/calls/api-cli-bootstrap.txt | 8 + .../calls/api-cowork-remote-devices.txt | 8 + .../v2.1.234/calls/api-directory-servers.txt | 8 + .../v2.1.234/calls/api-event-logging.txt | 11 + .../v2.1.234/calls/api-frame-comments.txt | 32 + .../v2.1.234/calls/api-frame-contract.txt | 29 + .../v2.1.234/calls/api-frame-deploy.txt | 32 + .../v2.1.234/calls/api-frame-upload.txt | 8 + .../v2.1.234/calls/api-grove-settings.txt | 8 + extractions/v2.1.234/calls/api-hello.txt | 38 + .../v2.1.234/calls/api-mcp-connectors.txt | 20 + .../calls/api-oauth-account-settings.txt | 14 + extractions/v2.1.234/calls/api-oauth-cri.txt | 11 + .../v2.1.234/calls/api-oauth-profile.txt | 8 + .../v2.1.234/calls/api-oauth-usage.txt | 14 + .../v2.1.234/calls/api-oauth-validate.txt | 14 + .../v2.1.234/calls/api-penguin-mode.txt | 8 + .../v2.1.234/calls/api-plugin-ratings.txt | 26 + .../v2.1.234/calls/api-plugins-search.txt | 8 + extractions/v2.1.234/calls/api-projects.txt | 8 + .../v2.1.234/calls/api-skills-search.txt | 8 + .../v2.1.234/calls/auth-header-builder.txt | 8 + extractions/v2.1.234/calls/auth-modes.txt | 5 + extractions/v2.1.234/calls/mcp-registry.txt | 8 + .../v2.1.234/calls/v1-code-agent-proxy.txt | 14 + extractions/v2.1.234/calls/v1-code-memory.txt | 14 + .../v2.1.234/calls/v1-code-scm-connectors.txt | 8 + .../calls/v1-code-self-hosted-runners.txt | 38 + .../v2.1.234/calls/v1-code-triggers.txt | 38 + .../calls/v1-code-webhook-triggers.txt | 17 + extractions/v2.1.234/calls/v1-deployments.txt | 38 + extractions/v2.1.234/calls/v1-design.txt | 38 + extractions/v2.1.234/calls/v1-dreams.txt | 26 + .../v2.1.234/calls/v1-environments.txt | 38 + extractions/v2.1.234/calls/v1-mcp-servers.txt | 17 + .../v2.1.234/calls/v1-memory-stores.txt | 38 + extractions/v2.1.234/calls/v1-messages.txt | 26 + extractions/v2.1.234/calls/v1-tunnels.txt | 38 + extractions/v2.1.234/calls/v1-ultrareview.txt | 14 + .../v2.1.234/calls/v1-user-profiles.txt | 26 + extractions/v2.1.234/calls/v1-vaults.txt | 38 + extractions/v2.1.234/raw/axios_routes.tsv | 115 ++ extractions/v2.1.234/raw/beta_flags.txt | 53 + extractions/v2.1.234/raw/paths.txt | 101 + extractions/v2.1.234/raw/pkg_version.txt | 2 + extractions/v2.1.234/raw/routes.tsv | 243 +++ extractions/v2.1.234/raw/sdk_routes.tsv | 130 ++ scripts/binary-literals.sh | 37 + scripts/extract-calls.py | 112 + scripts/extract-routes.py | 170 ++ scripts/validate-spec.sh | 51 +- specs/claude-code-api-complete.http | 1828 ++++++++++++++++- specs/claude-code-gateway.http | 28 +- specs/claude-oauth-api.http | 1169 +++++++++-- 60 files changed, 5279 insertions(+), 314 deletions(-) create mode 100644 extractions/v2.1.234/COMPARE.txt create mode 100644 extractions/v2.1.234/GATEWAY-PROTOCOL.md create mode 100644 extractions/v2.1.234/SUMMARY.md create mode 100644 extractions/v2.1.234/calls/api-cli-bootstrap.txt create mode 100644 extractions/v2.1.234/calls/api-cowork-remote-devices.txt create mode 100644 extractions/v2.1.234/calls/api-directory-servers.txt create mode 100644 extractions/v2.1.234/calls/api-event-logging.txt create mode 100644 extractions/v2.1.234/calls/api-frame-comments.txt create mode 100644 extractions/v2.1.234/calls/api-frame-contract.txt create mode 100644 extractions/v2.1.234/calls/api-frame-deploy.txt create mode 100644 extractions/v2.1.234/calls/api-frame-upload.txt create mode 100644 extractions/v2.1.234/calls/api-grove-settings.txt create mode 100644 extractions/v2.1.234/calls/api-hello.txt create mode 100644 extractions/v2.1.234/calls/api-mcp-connectors.txt create mode 100644 extractions/v2.1.234/calls/api-oauth-account-settings.txt create mode 100644 extractions/v2.1.234/calls/api-oauth-cri.txt create mode 100644 extractions/v2.1.234/calls/api-oauth-profile.txt create mode 100644 extractions/v2.1.234/calls/api-oauth-usage.txt create mode 100644 extractions/v2.1.234/calls/api-oauth-validate.txt create mode 100644 extractions/v2.1.234/calls/api-penguin-mode.txt create mode 100644 extractions/v2.1.234/calls/api-plugin-ratings.txt create mode 100644 extractions/v2.1.234/calls/api-plugins-search.txt create mode 100644 extractions/v2.1.234/calls/api-projects.txt create mode 100644 extractions/v2.1.234/calls/api-skills-search.txt create mode 100644 extractions/v2.1.234/calls/auth-header-builder.txt create mode 100644 extractions/v2.1.234/calls/auth-modes.txt create mode 100644 extractions/v2.1.234/calls/mcp-registry.txt create mode 100644 extractions/v2.1.234/calls/v1-code-agent-proxy.txt create mode 100644 extractions/v2.1.234/calls/v1-code-memory.txt create mode 100644 extractions/v2.1.234/calls/v1-code-scm-connectors.txt create mode 100644 extractions/v2.1.234/calls/v1-code-self-hosted-runners.txt create mode 100644 extractions/v2.1.234/calls/v1-code-triggers.txt create mode 100644 extractions/v2.1.234/calls/v1-code-webhook-triggers.txt create mode 100644 extractions/v2.1.234/calls/v1-deployments.txt create mode 100644 extractions/v2.1.234/calls/v1-design.txt create mode 100644 extractions/v2.1.234/calls/v1-dreams.txt create mode 100644 extractions/v2.1.234/calls/v1-environments.txt create mode 100644 extractions/v2.1.234/calls/v1-mcp-servers.txt create mode 100644 extractions/v2.1.234/calls/v1-memory-stores.txt create mode 100644 extractions/v2.1.234/calls/v1-messages.txt create mode 100644 extractions/v2.1.234/calls/v1-tunnels.txt create mode 100644 extractions/v2.1.234/calls/v1-ultrareview.txt create mode 100644 extractions/v2.1.234/calls/v1-user-profiles.txt create mode 100644 extractions/v2.1.234/calls/v1-vaults.txt create mode 100644 extractions/v2.1.234/raw/axios_routes.tsv create mode 100644 extractions/v2.1.234/raw/beta_flags.txt create mode 100644 extractions/v2.1.234/raw/paths.txt create mode 100644 extractions/v2.1.234/raw/pkg_version.txt create mode 100644 extractions/v2.1.234/raw/routes.tsv create mode 100644 extractions/v2.1.234/raw/sdk_routes.tsv create mode 100755 scripts/binary-literals.sh create mode 100755 scripts/extract-calls.py create mode 100755 scripts/extract-routes.py diff --git a/CLAUDE.md b/CLAUDE.md index 101298a..96ce34a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -9,14 +9,29 @@ Gates at Step 4 and Step 7 - stop and report if they fail. - Don't use line numbers (change every build) - Don't use obfuscated names like `XQ`, `o9`, `yk` in documentation -- Don't infer endpoints from runtime logs +- Don't infer endpoints from runtime logs (using a capture to *check* header + sets already read from the binary is fine, and is what SECTION 43 does) +- Don't guess a method you couldn't read -- use `# PATH-ONLY` instead - Don't document without `rg` verification ## Validation +Releases ship as a compiled binary, not `cli.js`. Render it first: + ```bash -# If this returns nothing, endpoint doesn't exist -rg '/api/oauth/profile' cli.js +scripts/binary-literals.sh /tmp/literals.txt + +# If this returns nothing, the endpoint doesn't exist +rg '/api/oauth/profile' /tmp/literals.txt + +# Method + auth mode + timeout + beta flag, per call site +scripts/extract-routes.py --all extractions/vX.Y.Z/raw/routes.tsv + +# Both gates, both specs +scripts/validate-spec.sh --routes extractions/vX.Y.Z/raw/routes.tsv \ + /tmp/literals.txt specs/claude-code-api-complete.http +scripts/validate-spec.sh --subset --routes extractions/vX.Y.Z/raw/routes.tsv \ + /tmp/literals.txt specs/claude-oauth-api.http ``` ## File Types diff --git a/README.md b/README.md index cf548ce..0bfd284 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ > `@anthropic-ai/claude-code` release talks to. [![license](https://img.shields.io/badge/license-MIT-blue)](LICENSE) -[![version](https://img.shields.io/badge/documented-v2.1.197-success)](extractions/v2.1.197/SUMMARY.md) -[![deps](https://img.shields.io/badge/deps-strings%20%2B%20rg-blue)](scripts/) +[![version](https://img.shields.io/badge/documented-v2.1.234-success)](extractions/v2.1.234/SUMMARY.md) +[![deps](https://img.shields.io/badge/deps-strings%20%2B%20rg%20%2B%20python3-blue)](scripts/) This repo documents which API paths, beta flags, headers, OAuth scopes, and model identifiers a given Claude Code release references, by reading the @@ -19,26 +19,75 @@ credentials. The output is plain text you can diff across versions. ## Currently Documented -**v2.1.197** — see [extractions/v2.1.197/SUMMARY.md](extractions/v2.1.197/SUMMARY.md). -69 API paths, 45 beta flags. 12 paths and 3 beta flags added since v2.1.170. +**v2.1.234** — see [extractions/v2.1.234/SUMMARY.md](extractions/v2.1.234/SUMMARY.md). +101 API path literals (+33 vs v2.1.197), 53 beta flags (+9), and **242 +call-site routes** with method, beta flag, auth mode and timeout. +`scripts/validate-spec.sh` reports 0 undocumented and 0 phantom endpoints for +both specs. + +New families in this release: self-hosted runner pools, MCP tunnels, dreams, +deployments, Design consent/grants, ultrareview quota, and a much larger frame +(Artifact) surface. The binary also embeds a complete, verbatim self-hosted gateway protocol -specification (`CLAUDE_CODE_USE_GATEWAY`) — not inferred, the literal ~9.6KB -Markdown doc the CLI ships internally. Recovered whole to -[extractions/v2.1.197/GATEWAY-PROTOCOL.md](extractions/v2.1.197/GATEWAY-PROTOCOL.md), +specification (`CLAUDE_CODE_USE_GATEWAY`) — not inferred, the literal Markdown +doc the CLI ships internally. It grew from 9,598 bytes in v2.1.197 to 13,246 in +v2.1.234, adding the rate-limit / overage 429 header contract, TLS leaf +certificate pinning, client guarantees, and a section on proxying to Bedrock, +Vertex and Foundry. Recovered whole to +[extractions/v2.1.234/GATEWAY-PROTOCOL.md](extractions/v2.1.234/GATEWAY-PROTOCOL.md), with a runnable request set at [specs/claude-code-gateway.http](specs/claude-code-gateway.http). +### Correction: methods and headers ARE recoverable from the binary + Since v2.1.117 the release ships as a Bun-compiled binary rather than a -readable `cli.js`. String literals still live in the binary's constant pool, -so `strings` + `rg` remains the extraction method for paths, beta flags, model -IDs, and env-var names. +readable `cli.js`, and this README used to say: + +> Header sets, request bodies, timeouts and retry behaviour are **not** +> recoverable from a binary. + +That was wrong. The binary embeds the whole minified JavaScript bundle as +printable text. It reads as one enormous line, so `rg -A/-B` context returns +nothing useful and it looks unrecoverable — but cut a fixed *byte* window and +the call site is right there: + +```js +fs.get("/v1/ultrareview/quota", {auth: "teleport-org", timeout: 3000}) +``` + +From v2.1.234 on, methods, header sets, auth modes, timeouts and beta flags are +read from the release being documented rather than carried forward from +v2.1.76. `scripts/extract-routes.py` does it mechanically for every call site; +`scripts/extract-calls.py` cuts the window when you want to read a body by +hand. The same method works retroactively on older binaries. + +**Auth modes.** The most useful thing this recovered: axios call sites name +their auth mode, and the mode decides the entire header set. + +| `auth:` | Headers | +|---------|---------| +| `teleport-org` | `Authorization`, `Content-Type`, `anthropic-version`, `anthropic-client-platform`, `x-organization-uuid` — and substitutes the literal `:orgUUID` in the path | +| `session-jwt` | `Authorization: Bearer ` only | +| `claude-ai-oauth` | `Authorization`, `anthropic-beta: oauth-2025-04-20` | +| `none` | no auth headers | +| `async` / unset | resolved OAuth headers, or `x-api-key` under API-key auth | + +That also explains why paths in the constant pool contain `:orgUUID` verbatim — +the auth layer substitutes it, not the call site. + +The OAuth surface is documented to full depth in +[specs/claude-oauth-api.http](specs/claude-oauth-api.http): per-call header +builders, timeouts, status handling, scope gating, the refresh-lock protocol, +and recorded negatives (there is no revocation endpoint). +`specs/claude-code-api-complete.http` is the breadth index. ## What It Extracts | Output | File | How | |--------|------|-----| | API paths | `extractions/v/raw/paths.txt` | quoted `"/api/..."` / `"/v1/..."` literals | +| Routes (method + auth) | `extractions/v/raw/routes.tsv` | `_client.(...)` and axios call sites | | Beta flags | `extractions/v/raw/beta_flags.txt` | tokens ending in a dated `YYYY-MM-DD` suffix | | Call contexts | `extractions/v/calls/*.txt` | bounded windows around each endpoint literal | | Headers / scopes / URLs | `extractions/v/raw/*.txt` | literal header names, `user:`/`org:` scopes, hardcoded URLs | @@ -52,10 +101,15 @@ What a literal can and cannot prove: published version. A documented path/flag/scope is backed by a verifiable `rg` pattern against the release. This is the bar for everything in `raw/` and `specs/`. -- **Medium confidence (context-inferred).** Method, headers, and request body - are read from the bounded text window around the literal (`calls/*.txt`). - Minifier variable names in those windows are noise, not facts — they change - every build and are never treated as documentation. +- **High confidence (call site read).** Method, auth mode, timeout and beta + flag come from the call site itself, in the release being documented + (`raw/routes.tsv`). Minifier variable names in those windows are noise, not + facts — they change every build and are never treated as documentation, which + is why the extractors detect identifiers rather than hardcoding them. +- **Declared unknown.** Where a path literal exists but its call site builds + the path through a helper the extractor does not follow, the spec carries a + `# PATH-ONLY` line: the path is verified, the method is not, and the spec + says so rather than guessing. 47 such paths in v2.1.234. - **Not claimed.** Anything seen only at runtime, anything inferred from logs, and anything that cannot be reproduced with a literal pattern. If it is not in a release string, it is not documented. diff --git a/WORKFLOW.md b/WORKFLOW.md index 2b2f246..6fd8086 100644 --- a/WORKFLOW.md +++ b/WORKFLOW.md @@ -3,6 +3,29 @@ Sequential runbook for extracting HTTP endpoints from Claude Code CLI. Agent executes top-to-bottom. Gates require pass before proceeding. +## Reading a compiled release (v2.1.117+) + +Releases ship as a Bun-compiled binary, not a readable `cli.js`. The whole +minified JavaScript bundle is still in there as printable text -- it just reads +as one enormous line, so `rg -A/-B` context returns nothing useful and it *looks* +unrecoverable. It is not. Two moves make the binary as readable as the old +bundle: + +```bash +# 1. one literal per line, for the rg-based path patterns and the validator +scripts/binary-literals.sh /tmp/literals.txt + +# 2. method + path + beta flag + auth mode + timeout, per call site +scripts/extract-routes.py --all extractions/vX.Y.Z/raw/routes.tsv + +# 3. a printable byte window around each endpoint, for reading bodies/headers +scripts/extract-calls.py extractions/vX.Y.Z/calls/ +``` + +Header sets, request bodies and timeouts ARE recoverable from a binary. Earlier +revisions of this repo said otherwise and carried them forward from v2.1.76; +that was wrong. Read them from the release you are documenting. + ## HTTP Precision Requirements For each endpoint, document ALL of: @@ -103,6 +126,19 @@ rg 'grove_notice_viewed' cli.js -B 10 -A 20 > ../$OUT/calls/api-oauth-grove-noti rg 'create_api_key' cli.js -B 10 -A 20 > ../$OUT/calls/api-oauth-create-api-key.txt rg 'claude_cli/roles' cli.js -B 10 -A 20 > ../$OUT/calls/api-oauth-roles.txt rg 'client_data' cli.js -B 10 -A 20 > ../$OUT/calls/api-oauth-client-data.txt +rg 'api/claude_cli_profile' cli.js -B 10 -A 20 > ../$OUT/calls/api-cli-profile.txt +rg 'admin_requests' cli.js -B 10 -A 20 > ../$OUT/calls/api-oauth-admin-requests.txt +rg 'api/oauth/file_upload' cli.js -B 10 -A 30 > ../$OUT/calls/api-oauth-file-upload.txt +rg 'api/oauth/files' cli.js -B 10 -A 30 > ../$OUT/calls/api-oauth-file-download.txt +rg '/v1/oauth/hello' cli.js -B 10 -A 20 > ../$OUT/calls/api-oauth-hello.txt + +# OAuth plumbing that determines headers for ALL of the above. +# These are the highest-value windows: three distinct header builders exist +# and mixing them up is the most common spec error. +rg 'BASE_API_URL: "' cli.js -B 20 -A 30 > ../$OUT/calls/oauth-config.txt +rg 'CLAUDE_CODE_CUSTOM_OAUTH_URL' cli.js -B 5 -A 25 > ../$OUT/calls/oauth-custom-url-allowlist.txt +rg '"anthropic-beta": ' cli.js -B 12 -A 4 > ../$OUT/calls/header-builders.txt +rg 'claude-cli/\$\{|claude-code/\$\{' cli.js -B 12 -A 2 > ../$OUT/calls/user-agent-builders.txt rg 'api/claude_code_grove' cli.js -B 10 -A 20 > ../$OUT/calls/api-grove-settings.txt rg 'first_token_date' cli.js -B 10 -A 20 > ../$OUT/calls/api-first-token-date.txt rg 'sonnet_1m_access' cli.js -B 10 -A 20 > ../$OUT/calls/api-sonnet-1m-access.txt @@ -259,11 +295,34 @@ Update version in file headers. ./scripts/validate-spec.sh --subset package/cli.js specs/claude-oauth-api.http ``` +Pass `--routes` so the call-site table counts as code, alongside the literal +scan. Without it, any path assembled from a template +(`/v1/environments/${id}/work/${w}/ack` -- never a whole literal) reads as a +phantom: + +```bash +scripts/binary-literals.sh /tmp/literals.txt +scripts/validate-spec.sh --routes extractions/vX.Y.Z/raw/routes.tsv \ + /tmp/literals.txt specs/claude-code-api-complete.http +scripts/validate-spec.sh --subset --routes extractions/vX.Y.Z/raw/routes.tsv \ + /tmp/literals.txt specs/claude-oauth-api.http +``` + **GATE**: Script must exit 0. If fails, STOP and report: - Undocumented endpoints (in code, not in spec) - Phantom endpoints (in spec, not in code) +When a path literal exists but its call site builds the path through a helper +the route extractor does not follow, do NOT guess a method. Declare it: + +``` +# PATH-ONLY {{baseUrl}}/api/frame/contract/latest +``` + +The validator counts that as documented. It claims the path exists and nothing +else -- no method, no headers, no body. + ## Step 8: Prepare Commit (HUMAN REVIEW) Generate commit message, DO NOT execute: @@ -314,6 +373,45 @@ rm -f current_spec_paths.txt new_extracted_paths.txt added_endpoints.txt removed | Grant types | `rg 'grant_type.*"[^"]*"' cli.js -o` | | Scopes | `rg '"user:[^"]*"\|"org:[^"]*"' cli.js -o` | +## Known Extraction Blind Spots + +The path-literal patterns above key on `"/api/...` or `BASE_API_URL}/api/...`. +Endpoints whose host comes from a *helper call* are invisible to both: + +```js +`${ubY()}/api/oauth/file_upload` // host helper, not BASE_API_URL +`${qPz()}/api/oauth/files/${uuid}/content` +``` + +`scripts/validate-spec.sh` carries explicit rules for these two. When a new +endpoint is built the same way, add a rule there or it will be reported as a +phantom forever. Sweep for the shape with: + +```bash +rg -o '\}/api/[a-z_/]+' cli.js | sort -u +``` + +Header sets used to be guesswork. They are not any more: axios call sites name +their auth mode, and the mode decides the entire header set. + +| `auth:` | Emits | +|---------|-------| +| `teleport-org` | `Authorization` + `Content-Type` + `anthropic-version` + `anthropic-client-platform` + `x-organization-uuid`; also substitutes `:orgUUID` in the path | +| `session-jwt` | `Authorization: Bearer `, nothing else | +| `claude-ai-oauth` | `Authorization` + `anthropic-beta: oauth-2025-04-20` | +| `none` | no auth headers | +| `async` / unset | resolved OAuth headers, or `x-api-key` under API-key auth | + +`scripts/extract-routes.py` records the mode per route. Two pre-flight refusals +apply to every axios call: essential-traffic-only mode, and a non-first-party +provider (`data-residency`). + +Stainless SDK resources take auth from the client, not per call, and pin their +own `anthropic-beta` flag per resource. + +Still: never copy a header block from a neighbouring endpoint. Read the call +site, or read the `auth` column. + ## HTTP Precision Patterns ```bash diff --git a/extractions/v2.1.234/COMPARE.txt b/extractions/v2.1.234/COMPARE.txt new file mode 100644 index 0000000..5a87443 --- /dev/null +++ b/extractions/v2.1.234/COMPARE.txt @@ -0,0 +1,56 @@ +## paths: 101 total, 33 added, 1 removed (v2.1.197 -> v2.1.234) + +### Added +- "/api/desktop/ +- "/api/directory/ +- "/api/event_logging/ +- "/api/frame/ +- "/api/frame/contract/latest +- "/api/frame/db/agent +- "/api/frame/deploy/prepare +- "/api/frame/frames?limit=200 +- "/api/frame/upload +- "/api/oauth/organizations/:orgUUID/mcp/connectors/list +- "/api/oauth/organizations/:orgUUID/mcp/connectors/search +- "/api/oauth/organizations/:orgUUID/mcp/connectors/suggest +- "/api/oauth/organizations/:orgUUID/plugin_ratings +- "/api/oauth/organizations/:orgUUID/plugin_ratings/appearances +- "/api/oauth/organizations/:orgUUID/plugin_ratings/appearances/outcome +- "/api/oauth/organizations/:orgUUID/plugins/search +- "/api/oauth/organizations/:orgUUID/skills/search +- "/api/organizations/:orgUUID/cowork/remote_devices +- "/v1/code/agent-proxy/artifact +- "/v1/code/agent-proxy/frame +- "/v1/code/local/memory/credential +- "/v1/code/local/memory/mounts +- "/v1/code/memory/ +- "/v1/code/scm-connectors/{provider}/{id}/tunnel +- "/v1/code/webhook-triggers +- "/v1/deployment_runs?beta=true +- "/v1/deployments?beta=true +- "/v1/design/consent +- "/v1/design/grants +- "/v1/design/mcp +- "/v1/dreams?beta=true +- "/v1/tunnels?beta=true +- "/v1/ultrareview/quota + +### Removed +- "/api/claude_code/discovery/team_usage + +## beta_flags: 53 total, 9 added, 1 removed (v2.1.197 -> v2.1.234) + +### Added +- agent-memory-2026-07-22 +- auto-mode-classifier-2026-07-16 +- dreaming-2026-04-21 +- mcp-tunnels-2026-06-22 +- mid-conversation-tool-changes-2026-07-01 +- per-turn-control-2026-07-01 +- pre-2026-07-28 +- prompt-caching-evict-2026-05-12 +- server-side-fallback-2026-07-01 + +### Removed +- summarize-connector-text-2026-03-13 + diff --git a/extractions/v2.1.234/GATEWAY-PROTOCOL.md b/extractions/v2.1.234/GATEWAY-PROTOCOL.md new file mode 100644 index 0000000..ebde21b --- /dev/null +++ b/extractions/v2.1.234/GATEWAY-PROTOCOL.md @@ -0,0 +1,289 @@ + + +# Claude Code gateway protocol + +This is the wire contract the Claude Code CLI uses to talk to this gateway: +sign-in, inference, managed settings, and telemetry. It's served from the +gateway itself so it always matches the version you're running. + +> **Stability:** this protocol exists to give you a more stable target than +> proxying raw CLI traffic. Auth is standard OAuth 2.0, inference is the +> Messages API, and headers are the lowest common denominator across +> backends. We keep it backwards compatible within reason to support older +> clients, but not forever — expect changes, managed settings in particular, +> with notice. + +A developer points Claude Code at your gateway's base URL via `/login` and +the client does the rest. All paths below are relative to that base URL, and +the client does not follow cross-origin redirects. + +## Flow + +1. Client fetches `GET {base}/.well-known/oauth-authorization-server`. +2. On first contact, client fingerprints your TLS certificate and asks the + user to trust it. +3. Client runs the RFC 8628 device flow: `POST device_authorization_endpoint` + -> user approves in a browser at `verification_uri` -> client polls + `token_endpoint` until it gets a bearer token. +4. Client sends `Authorization: Bearer ` on every subsequent request. +5. Client uses fixed paths under `{base}` for inference (`/v1/messages`), + policy (`/managed/settings`), model discovery (`/v1/models`), and + telemetry (`/v1/{metrics,logs,traces}`). +6. Before the token expires, client silently calls `token_endpoint` with + `grant_type=refresh_token`. If you didn't issue a refresh token, the user + is sent back through the browser flow instead. + +## Discovery — required + +`GET /.well-known/oauth-authorization-server` (unauthenticated) + +RFC 8414 authorization server metadata. The client reads +`device_authorization_endpoint` and `token_endpoint` and ignores the rest; +both must be same-origin with `{base}`. `authorization_endpoint` is +intentionally absent. + + { + "issuer": "https://gw.corp.example.com", + "device_authorization_endpoint": "https://gw.corp.example.com/oauth/device_authorization", + "token_endpoint": "https://gw.corp.example.com/oauth/token", + "grant_types_supported": ["urn:ietf:params:oauth:grant-type:device_code", "refresh_token"] + } + +## Device authorization — required + +`POST {device_authorization_endpoint}` (unauthenticated) + +RFC 8628 \xA73.2. The client opens `verification_uri_complete` in the user's +browser and polls `token_endpoint` every `interval` seconds. + + { + "device_code": "AbK9-s3n4C8H...", + "user_code": "WDJB-MJHT", + "verification_uri": "https://gw.corp.example.com/device", + "verification_uri_complete": "https://gw.corp.example.com/device?user_code=WDJB-MJHT", + "expires_in": 600, + "interval": 5 + } + +`device_code` should be >=256 bits, opaque, single-use. `user_code` should +use a base-20 charset (RFC 8628 \xA76.1). + +## Verification page — required + +`GET/POST {verification_uri}` (browser-facing; the client never calls this) + +Accept the user code, authenticate the user against your IdP, and mark the +matching `device_code` approved so the next token poll succeeds. Apply a +per-IP rate limit (RFC 8628 \xA75.1) and don't auto-submit a pre-filled code +(\xA75.4). + +## Token — required + +`POST {token_endpoint}` (unauthenticated, +`application/x-www-form-urlencoded`) + +**Device grant** (`grant_type=urn:ietf:params:oauth:grant-type:device_code`): + +| Status | Body | Client reaction | +|---|---|---| +| 200 | `{"access_token","token_type":"Bearer","expires_in","refresh_token"?}` | Login complete. `refresh_token` is optional; omit it and the client re-runs the device flow on expiry. | +| 400 | `{"error":"authorization_pending"}` | Keep polling. | +| 400/429 | `{"error":"slow_down"}` | Add 5s to the poll interval. | +| 400 | `{"error":"access_denied"}` | Stop. | +| 400 | `{"error":"expired_token"}` | Stop. | + +**Refresh grant** (`grant_type=refresh_token`): return a fresh +`{"access_token","token_type","expires_in","refresh_token"}` on 200. Return +`401 {"error":"invalid_grant"}` to force re-login — this is your +deprovisioning hook. + +## Messages — required + +`POST /v1/messages` and `POST /v1/messages/count_tokens` (bearer) + +The Anthropic Messages API (https://platform.claude.com/docs/en/api/messages), +unchanged. Proxy to your upstream and stream the response back. Enforce your +model allowlist here, returning `400 invalid_request_error` for a denied +model. Don't buffer SSE on the `stream: true` path. The client always sets +`Content-Length`, so you may reject chunked-without-CL (`411`) and cap body +size (`413`). The client doesn't assume server-side tools are available. The +client also sends `x-app` and `x-stainless-*` headers — pass them through or +drop them, but don't reject the request because of them. + +## Managed settings — optional + +`GET /managed/settings` (bearer) + +The authenticated user's Claude Code `managed-settings.json`; see +https://code.claude.com/docs/en/settings for the key reference. The client +polls about once an hour; support `ETag`/`If-None-Match` -> `304` to keep +that cheap. Return `404` for "no managed policy"; `200 {}` means "this user +has an empty policy" — they're not the same. **This is the endpoint most +likely to change.** + +## Models — optional + +`GET /v1/models` (bearer) + +Anthropic models-list shape: `{"data":[{"id","display_name"},...]}`. Use +Anthropic-style IDs (`claude-{family}-{major}-{minor}`) — the client's +model-family logic keys on that shape. The client only calls this when +`CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY` is set on the client, which you +can push via the `env` block in `/managed/settings`. Return `404` to fall +back to the client's built-in list. + +## Telemetry — optional + +`POST /v1/metrics`, `/v1/logs`, `/v1/traces` (bearer) + +OTLP/HTTP (protobuf or JSON). When connected to a gateway the client sends +telemetry here and ignores `OTEL_EXPORTER_OTLP_*` env vars. Return `200` +whether you forward or discard — `404` makes the client's exporter log an +error on every flush. + +## Errors + +OAuth endpoints use `{"error":"...","error_description":"..."}` +(RFC 6749/8628). Bearer-authenticated endpoints use the Anthropic envelope so +the SDK surfaces the message to the user: + + {"type":"error","error":{"type":"authentication_error","message":"..."}} + +| HTTP | error.type | Use for | +|---|---|---| +| 400 | `invalid_request_error` | Denied model, malformed body, policy violation | +| 401 | `authentication_error` | Missing/expired/invalid bearer; client prompts re-login | +| 403 | `permission_error` | Authenticated but not allowed | +| 413 | `request_too_large` | Body over your cap | +| 429 | `rate_limit_error` | Throttling; include `Retry-After` | +| 429 | `billing_error` | The user's own cap on your gateway is reached; see Usage-limit headers below | +| 501 | `not_supported` | Endpoint not available on this backend | +| 529 | `overloaded_error` | Upstream at capacity; client backs off and retries | +| 5xx | `api_error` | Anything else | + +## Usage-limit headers — optional + +If you enforce a per-user spend or usage cap, report the caller's standing +against it on each successful `POST /v1/messages` response and Claude Code +(2.1.225 and later, when signed in to a gateway) shows its usual "You've used +NN% of your usage credits \xB7 resets \u2026" notice past 75% and again past 95%. +These are the same `anthropic-ratelimit-unified-*` headers api.anthropic.com +sends its subscribers, so strip the upstream's own `anthropic-ratelimit-*` +response headers first — otherwise your org-wide quota reaches users as if it +were theirs. Send none of these for a user with no cap. + +| Header | Value | +|---|---| +| `anthropic-ratelimit-unified-status` | `allowed`, or `allowed_warning` once past a threshold | +| `anthropic-ratelimit-unified-representative-claim` | `overage` — the window-agnostic claim; `5h`/`7d` mean rolling 5-hour/7-day windows the client does time math on, so don't borrow them for a calendar budget | +| `anthropic-ratelimit-unified-overage-status` | Same value as `-status` | +| `anthropic-ratelimit-unified-overage-utilization` | Fraction of the cap used, two decimals, kept below `1` while you're still allowing requests (`0.82`) | +| `anthropic-ratelimit-unified-overage-surpassed-threshold` | `0.75` or `0.95` once utilization passes it — this header is what triggers the client's notice; omit it below 75% | +| `anthropic-ratelimit-unified-reset`, `-overage-reset` | When the cap resets, Unix seconds | + +When the cap is reached, reject `POST /v1/messages` before proxying: + + HTTP/1.1 429 + retry-after: 37800 + x-should-retry: false + anthropic-ratelimit-unified-status: rejected + anthropic-ratelimit-unified-reset: 1786147200 + anthropic-ratelimit-unified-overage-reset: 1786147200 + anthropic-ratelimit-unified-overage-utilization: 1 + anthropic-ratelimit-unified-overage-surpassed-threshold: 1 + anthropic-ratelimit-unified-overage-period: daily + anthropic-ratelimit-unified-overage-disabled-reason: org_spend_cap_reached + + {"type":"error","error":{"type":"billing_error","message":"spend limit reached (daily; resets 2026-08-08 00:00 UTC) — request an increase at https://go.corp.example.com/claude-limits"}} + +Leave `representative-claim` and `overage-status` off the 429. With them the +client composes its own "You've hit your limit" line and drops your message; +without them it prints `error.message` as-is (older clients too, behind a +generic "API Error" prefix), so put the period, the reset time, and what the +user should do next in that one sentence. `retry-after` is seconds until the +reset; `x-should-retry: false` keeps the SDK from retrying into the block. If +you can't read your counter and choose to fail closed, send the 429 with +`x-should-retry: false`, +`anthropic-ratelimit-unified-overage-disabled-reason: fetch_error`, and a +message, nothing else. This gateway sends exactly the shapes above for caps +set through its admin API (`overage-period` is `daily`, `weekly`, or +`monthly`); when several caps apply it describes the fullest one, or once +blocked the one that resets last. + +## Bearer token + +Your `access_token` is opaque to the client — it stores it, sends it, and +refreshes it before `expires_in`, but never inspects the payload. Encode the +user's identity and groups in the token (or in server-side state keyed by it) +so you can apply per-user RBAC at `/v1/messages` and per-group policy at +`/managed/settings`. The same token must work across every +bearer-authenticated endpoint. + +## TLS + +`https://` is required; `http://` is accepted only for loopback during +development. The client pins the SHA-256 fingerprint of your TLS leaf +certificate per-hostname after the user confirms it on first connect, and +re-prompts on mismatch — rotating your certificate costs every user one +confirmation prompt. + +## Client guarantees + +- OAuth endpoint paths come from your discovery document; the client never + hard-codes `/oauth/token`. +- Fixed-path endpoints are resolved against `{base}`, never a redirect. +- Every request body carries `Content-Length`. +- The OTLP exporter is locked to `{base}/v1/{signal}` regardless of the + user's environment. +- `404` from `/v1/models` or `/managed/settings` is a clean "not + implemented", with no retry storm. + +## Proxying to Bedrock, Vertex, or Foundry + +Proxying to `api.anthropic.com` is pass-through. Proxying to a cloud +provider's Claude endpoint needs translation: + +- **Model IDs.** The client sends Anthropic-style IDs like + `claude-sonnet-4-5`; translate to the upstream's form (Bedrock model ID or + inference-profile ARN; Vertex `@`-versioned ID), or advertise + upstream-native IDs from `/v1/models`. +- **`anthropic-beta`.** Bedrock rejects some betas in the *header*; move them + into the request body as `"anthropic_beta": [...]`. Vertex and Foundry + accept the header. +- **Streaming.** Bedrock's native stream is AWS binary event-stream, not SSE; + decode and re-emit Anthropic-shaped `text/event-stream`. The provider SDKs + handle this, but their stream iterators drop the upstream's `ping` events + (and Bedrock sends none) — emit your own `event: ping` during silent gaps + so long thinking pauses don't trip client or proxy idle timeouts. +- **`count_tokens`.** Bedrock has no count-tokens API. Return + `501 not_supported`; the client falls back to a Haiku `max_tokens:1` probe. +- **Headers.** Forward `content-type`, `accept`, `accept-encoding`, + `anthropic-version`, `anthropic-beta`, `user-agent`, and `x-stainless-*`; + strip the client's `Authorization` and apply the upstream's own + credentials. On the response, strip hop-by-hop headers + (`content-encoding`, `content-length`, `transfer-encoding`, `connection`). +- **Errors.** Upstream error messages can carry your cloud account + IDs/ARNs/project IDs — log them for the operator and return a generic + message, keeping `error.type`. The exception is a 400/413 in Anthropic's + own error envelope (e.g. `prompt is too long: \u2026`): relay that + `error.message`, the client's recovery (auto-compact etc.) keys on it. + +## References + +RFC 6749 (OAuth 2.0), RFC 8414 (AS metadata), RFC 8628 (device grant), +Anthropic Messages API, Claude Code settings reference, OTLP spec. diff --git a/extractions/v2.1.234/SUMMARY.md b/extractions/v2.1.234/SUMMARY.md new file mode 100644 index 0000000..cd2b30b --- /dev/null +++ b/extractions/v2.1.234/SUMMARY.md @@ -0,0 +1,200 @@ +# Claude Code HTTP API — v2.1.234 + +Source: `@anthropic-ai/claude-code-linux-x64@2.1.234`. + +## The correction this release forced + +Every previous revision of this repo carried the same caveat: + +> Header sets, request bodies and timeouts are **not** recoverable from a +> binary. Those are read from v2.1.76, the last release with a readable bundle, +> and carried forward explicitly labelled. + +That was wrong, and it has been wrong since v2.1.117. The compiled binary +embeds the entire minified JavaScript bundle as printable text. It reads as one +enormous line, which is why `rg -A/-B` context looked empty and the conclusion +"not recoverable" seemed reasonable. Cut a fixed **byte window** instead and the +call site is right there, complete: + +```js +fs.get("/v1/ultrareview/quota", {auth: "teleport-org", timeout: 3000}) +``` + +```js +this._client.post(Fa`/v1/tunnels/${e}/certificates?beta=true`, { + body: o, ...r, + headers: yi([{"anthropic-beta": [...n ?? [], "mcp-tunnels-2026-06-22"]... +``` + +So methods, header sets, auth modes, timeouts and beta flags for v2.1.234 are +read from v2.1.234, not carried forward from a two-year-old release. The same +method works retroactively on v2.1.197 and earlier binaries. + +## New tooling + +| Script | What it recovers | +|--------|------------------| +| `scripts/extract-routes.py` | method + path + beta flag + auth mode + timeout, per call site | +| `scripts/extract-calls.py` | printable byte window around each endpoint anchor | +| `scripts/binary-literals.sh` | binary → one-literal-per-line text, the input `validate-spec.sh` needs | + +`extract-routes.py` hardcodes no minified identifier. It anchors the SDK shape +on the literal `_client.`, detects the axios instances as the identifiers that +most often precede an `/api/` or `/v1/` call, and resolves paths that were +hoisted into a constant before the call. + +## Auth modes + +The single most useful thing recovered. axios call sites name their auth mode, +and the mode decides the whole header set. From +`calls/auth-modes.txt`: + +| `auth:` | Headers | +|---------|---------| +| `teleport-org` | `Authorization`, `Content-Type`, `anthropic-version`, `anthropic-client-platform`, `x-organization-uuid` — **and** substitutes the literal `:orgUUID` in the path | +| `session-jwt` | `Authorization: Bearer `, nothing else | +| `claude-ai-oauth` | `Authorization`, `anthropic-beta: oauth-2025-04-20` | +| `none` | no auth headers | +| `async` / unset | resolved OAuth headers (`Authorization` + `anthropic-beta: oauth-2025-04-20`), or `x-api-key` under API-key auth | + +This also explains a long-standing oddity: paths in the constant pool contain +`:orgUUID` verbatim because the auth layer, not the call site, substitutes it. + +Two pre-flight refusals apply to every axios call before a request is made: +essential-traffic-only mode blocks it unless the call opts out, and a +non-first-party provider blocks it with reason `data-residency`. + +## Counts + +| Metric | Value | +|--------|-------| +| Path literals (`raw/paths.txt`) | 101 (+33 / −1 vs v2.1.197) | +| Beta flags (`raw/beta_flags.txt`) | 53 (+9 / −1 vs v2.1.197) | +| Call-site routes (`raw/routes.tsv`) | 242 (129 SDK, 114 axios) | +| Routes with a beta flag | 120 | +| Endpoints in `claude-code-api-complete.http` | 281 | + +`scripts/validate-spec.sh --routes raw/routes.tsv` reports **0 undocumented, +0 phantom** for both `claude-code-api-complete.http` and (in `--subset` mode) +`claude-oauth-api.http`. + +## Added surface + +New first-class families, all verified by method: + +- **Self-hosted runners** — `/v1/code/runners/self-hosted/*`: registration, + spawn-hint long-poll (30s), session release, report-failure, deregister. + Pairs with the 24 `SELF_HOSTED_RUNNER_*` env vars in the same release. +- **MCP tunnels** — `/v1/tunnels/*`, 10 routes, all pinning + `mcp-tunnels-2026-06-22`. Includes `reveal_token` and `rotate_token`. +- **Dreams** — `/v1/dreams/*`, 5 routes, `dreaming-2026-04-21`. +- **Deployments** — `/v1/deployments/*` and `/v1/deployment_runs/*`, + `managed-agents-2026-04-01`. Includes pause/unpause/run/archive. +- **Design** — `/v1/design/consent`, `/grants`, `/mcp`. The consent GET is a + pre-flight; on failure the client falls back to a 403-seeded cache rather + than blocking. `/v1/design/mcp` is `auth: "none"` with a 60s timeout. +- **Ultrareview** — `/v1/ultrareview/quota` and `/preflight`, both + `auth: "teleport-org"`. `CLAUDE_CODE_ULTRAREVIEW_QUOTA_FIXTURE` short-circuits + the quota call entirely: the env value is parsed as JSON and no request goes + out. +- **Frames** — `/api/frame/*` grew comments, contract, blob and subscribe + routes. Uploads run through a relay probe, so a 429 with `retry-after` is + expected and retried once. +- **Local / org memory** — `/v1/code/local/memory/mounts` and `/credential`. +- **Plugin and skill discovery** — `/plugins/search`, `/skills/search`, + `/plugin_ratings` and its appearance-outcome reporting. +- **MCP connectors** — `/mcp/connectors/{list,search,suggest}` under the org + OAuth path. + +New beta flags (9): `agent-memory-2026-07-22`, `auto-mode-classifier-2026-07-16`, +`dreaming-2026-04-21`, `mcp-tunnels-2026-06-22`, +`mid-conversation-tool-changes-2026-07-01`, `per-turn-control-2026-07-01`, +`pre-2026-07-28`, `prompt-caching-evict-2026-05-12`, +`server-side-fallback-2026-07-01`. Removed: `summarize-connector-text-2026-03-13`. + +## Gateway protocol document + +The binary embeds the self-hosted gateway wire contract +(`CLAUDE_CODE_USE_GATEWAY`) verbatim as a string literal. Recovered whole to +`GATEWAY-PROTOCOL.md`. It grew from 9,598 bytes in v2.1.197 to 13,246 here, and +the new material is all contract detail rather than new endpoints: + +- **Usage-limit headers** — the exact 429 shape, including + `anthropic-ratelimit-unified-overage-*` headers and the warning that sending + `representative-claim` / `overage-status` makes the client compose its own + message and *drop* yours. +- **TLS** — the client pins the SHA-256 fingerprint of the gateway's leaf + certificate per hostname after first-connect confirmation, and re-prompts on + mismatch. Rotating a certificate costs every user one prompt. +- **Client guarantees** — OAuth paths always come from discovery (never + hardcoded), fixed paths resolve against `{base}` and never a redirect, the + OTLP exporter is locked to `{base}/v1/{signal}` regardless of the user's + `OTEL_*` env, and a 404 from `/v1/models` or `/managed/settings` is a clean + "not implemented" with no retry storm. +- **Proxying to Bedrock, Vertex, Foundry** — model-ID translation, + `anthropic-beta` moving from header to request body for Bedrock, re-emitting + AWS binary event-stream as Anthropic-shaped SSE (and synthesising `ping` + events, which the provider SDKs drop), and returning `501 not_supported` from + `count_tokens` so the client falls back to a Haiku `max_tokens:1` probe. + +`specs/claude-code-gateway.http` validates as "phantom" by design: it specifies +the *server* side, and the CLI resolves those paths from the gateway's own +discovery document rather than hardcoding them. Validate it against +`GATEWAY-PROTOCOL.md`, not against client literals. A note in the spec says so. + +## Removed surface + +Verified absent from the binary, commented out in the specs rather than deleted: + +- `/api/claude_code/discovery/team_usage` +- `/api/claude_code/team_memory` (GET and POST) +- `/api/claude_code/user_settings` +- `/api/oauth/claude_cli/client_data` +- `/v1/code/egress/gateway` +- `/v1/code/upstreamproxy` +- `/v1/code/` (bare root; every surviving path under it is a full route) + +## Cross-check against live traffic + +`WORKFLOW.md`'s rule stands — endpoints are never *inferred* from runtime logs. +This goes the other way: a local MITM capture of one interactive v2.1.234 +session was used to check the header sets that were read from the binary. +Section 43 of `claude-code-api-complete.http` records the result. No +identifiers, tokens, request-ids or organization UUIDs from that capture are +reproduced anywhere in this repository. + +The capture confirms the auth-mode table exactly: + +- `/v1/code/triggers` and `/v1/ultrareview/quota` went out with + `authorization` + `content-type` + `anthropic-version` + + `anthropic-client-platform` + `x-organization-uuid` — the `teleport-org` set, + matching `auth: "teleport-org"` at both call sites. +- The `/api/oauth/*` calls went out with `authorization` + + `anthropic-beta: oauth-2025-04-20` and no organization header — the default + OAuth set. +- `/mcp-registry/v0/servers` went out with no `authorization` header at all, + matching `auth: "none"`. + +It also pins down the two User-Agents, which map to the two client shapes: +`claude-cli/2.1.234 (external, cli)` for axios, `claude-code/2.1.234` for the +SDK client. + +Volume, for a sense of what a session actually costs: 132 calls to +`/api/event_logging/v2/batch`, 123 to `/v1/messages`, and 83 to a Datadog logs +intake at `http-intake.logs.us5.datadoghq.com/api/v2/logs` (`dd-api-key` +header) — a narrower host than the generic `datadoghq.com` previously recorded. + +## Coverage honesty + +`raw/routes.tsv` holds 242 call-site routes. 161 of them were new to the spec +and are written up in Section 42 with method, beta flag, auth mode and timeout. +137 sit in a named family with prose; 24 are grouped under "Other v2.1.234 +routes" with the same verified fields but no prose yet. + +A further 47 path literals exist in the constant pool whose call site builds the +path through a helper `extract-routes.py` does not follow. Those are declared +with `# PATH-ONLY` lines: the path is verified, the method is not, and the spec +says so instead of guessing. `validate-spec.sh` counts a `PATH-ONLY` line as +documented for the completeness gate, so "0 undocumented" means *every path +literal is accounted for*, not that every method is known — 47 of them are +explicitly marked unknown. diff --git a/extractions/v2.1.234/calls/api-cli-bootstrap.txt b/extractions/v2.1.234/calls/api-cli-bootstrap.txt new file mode 100644 index 0000000..d583299 --- /dev/null +++ b/extractions/v2.1.234/calls/api-cli-bootstrap.txt @@ -0,0 +1,8 @@ +# anchor: /api/claude_cli/bootstrap +# occurrences shown: 2 + +--- offset 149148560 --- +.................................................................................................................................................................................................................................................... ............... .......................(.......................................P.1.............`.1.....i.........1..............67...............1.....).........1.............................................[Bootstrap] Fetching............................/api/claude_cli/bootstrap.......................application/json................r.......1.......................t...........................................(...[Bootstrap] Response failed validation: ........................api_bootstrap_fetch.............................parse_failed....................................[Bootstrap] Fetch ok................................................%............................@ ..X....p......@.4V....@....p........k.@.,.....@.\.........................J!<.@.4.E.....3.@.<.H...@.M.@...F....a4.~.hA......,.....@@?.X...@.-.E...............................................[......................h.......................0.........................'..................... .8......................z&.....................0.8......................u........................'.......................8.....................p.&....................../4.......................E......................%... + +--- offset 304877612 --- +_GATEWAY_MODEL_DISCOVERY)return E("[Bootstrap] Skipped gateway /v1/models (CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY not set)"),{response:{additional_model_options:[]},viaScopelessOAuth:!1};let a=await mAS();return a&&{response:a,viaScopelessOAuth:!1}}if(ia())return E("[Bootstrap] Skipped: Nonessential traffic disabled"),null;if(Yn()!=="firstParty")return E("[Bootstrap] Skipped: 3P provider"),null;let{params:t,userAgent:r}=p4f(e),n=async(a,l)=>{E("[Bootstrap] Fetching");let c=await si.get(`${a}/api/claude_cli/bootstrap`,{headers:{"Content-Type":"application/json","User-Agent":r,...EZo(),...l},params:t,timeout:5000}),u=uAS().safeParse(c.data);if(!u.success)return E(`[Bootstrap] Response failed validation: ${u.error.message}`),we("api_bootstrap_fetch","parse_failed"),null;return E("[Bootstrap] Fetch ok"),u.data},o=ZQ();if(!o&&lD())try{let[a,l]=await Promise.all([AVe(),dxr()]);if(a!==null){let c=await n(V.ANTHROPIC_BASE_URL||l?.baseURL||za().BASE_API_URL,{...l?.extraHeaders,Authorization:`Bearer ${await a.getToken()}`,"anthropic-beta":yx});return c&&{response:c,viaScopelessOAuth:!1}}}catch(a){return E(`[Bootstrap] WIF fetch failed: ${si.isAxiosError(a)?a.response?.status??a.code:a instanceof Error?a.constructor.name:"unknown"}`),we("api_bootstrap_fetch","wif_unavailable"),null}if(!ua()?.accessToken&&!o)return E("[Bootstrap] Skipped: no usable OAuth, WIF, or API key"),null;if(V.ANTHROPIC_UNIX_SOCKET)retur diff --git a/extractions/v2.1.234/calls/api-cowork-remote-devices.txt b/extractions/v2.1.234/calls/api-cowork-remote-devices.txt new file mode 100644 index 0000000..2299bcb --- /dev/null +++ b/extractions/v2.1.234/calls/api-cowork-remote-devices.txt @@ -0,0 +1,8 @@ +# anchor: /cowork/remote_devices +# occurrences shown: 2 + +--- offset 93793771 --- +ndshakeTimer.....I.......................injectSyntheticInitialize................G......handleReject....................deliver.I.......................replyInternalError.......................................<......__synthetic_init__.......................~......claude-code-device..............................get_device_info............."...wss://bridge.claudeusercontent.com......I...............I...*...wss://bridge-staging.claudeusercontent.com..................1.../api/organizations/:orgUUID/cowork/remote_devices........................<.."...cowork_remote_device_limit_reached......I...............I7......account_session_invalid.I.......................creg_...I)..............H#......Y.o.u. .a.r.e. .c.o.m.i.n.g. .u.p. .w.i.t.h. .a. .t.i.t.l.e. .a.n.d. .a. .g.i.t. .b.r.a.n.c.h. .n.a.m.e. .f.o.r. .a. .c.o.d.i.n.g. .s.e.s.s.i.o.n. .b.a.s.e.d. .o.n. .t.h.e. .p.r.o.v.i.d.e.d. .d.e.s.c.r.i.p.t.i.o.n.......T.h.e. .t.i.t.l.e. .i.s. .a. .n.a.m.e. .f.o.r. .w.h.a.t. .t.h.e. .s.e.s.s.i.o.n. .i.s. .a.b.o.u.t.,. .n.o.t. .a. .s.e.n.t.e.n.c.e. .d.e.s.c.r.i.b.i.n.g. .t.h.e. .t.a.s.k.:. .a. .s.h.o.r.t. .n.o.u.n. .p.h.r.a.s.e. .o.f. .t.w.o. .t.o. .f.i.v.e. .w.o.r.d.s. .i.n. .s.e.n.t.e.n.c.e. .c.a.s.e. .(.c.a.p.i.t.a.l.i.z.e. .o.n.l.y. .t.h.e. .f.i.r.s.t. .w.o.r.d.,. .p.l.u.s. .p.r.o.p.e.r. .n.o.u.n.s.,. .a.c.r.o.n.y.m.s.,. .a.n.d. .c.o.d.e. .i.d.e.n.t.i.f.i.e.r.s. .a.s. .w.r.i.t.t.e.n.).,. .n.o.t. .T.i.t.l.e. .C.a + +--- offset 299308213 --- +viceRegistry] registered device row=${a}`),_e("device_registry_register"),{deviceUUID:a,priv:r}}async function LUp(e,t){await al().mutate((r)=>{if(r.coworkRemoteDevice?.[e]?.privateKeyPkcs8B64!==t)return r;let{[e]:n,...o}=r.coworkRemoteDevice;return{...r,coworkRemoteDevice:o}})}async function DUp(e){await xUp(e,(t)=>{if(t.rowPk===void 0)return t;let{rowPk:r,...n}=t;return n})}function fxa(){return`Claude Code on ${kUp.hostname()} \xB7 ${gHr("linux")}`}var _Ur,kUp,jyv="/api/organizations/:orgUUID/cowork/remote_devices",zyv="cowork_remote_device_limit_reached",Gyv="account_session_invalid",mFn,bUr,RUp;var mxa=A(()=>{Zd();fFn();tr();K_();Ze();pt();Ii();nee();vr();jr();fx();_Ur=require("crypto"),kUp=require("os");mFn=class mFn extends wt{constructor(){super("deviceRegistry: account device limit reached","deviceRegistry: account device limit reached","limit_reached")}};bUr=class bUr extends wt{constructor(e){super(`deviceRegistry: device registration unavailable for this account or organization (${e})`,"deviceRegistry: device registration unavailable for this account or organization","registration_unavailable")}};RUp=class RUp extends wt{constructor(){super("deviceRegistry: device key revoked server-side; a new key will be minted on the next registration","deviceRegistry: device key revoked","key_revoked")}}});var BUp={};yt(BUp,{DEVICE_REGISTRY_KID_PREFIX:()=>$Up,buildCreateSessionBindPreimage:()=>OUp,pr diff --git a/extractions/v2.1.234/calls/api-directory-servers.txt b/extractions/v2.1.234/calls/api-directory-servers.txt new file mode 100644 index 0000000..34a268e --- /dev/null +++ b/extractions/v2.1.234/calls/api-directory-servers.txt @@ -0,0 +1,8 @@ +# anchor: /api/directory/servers +# occurrences shown: 2 + +--- offset 107705280 --- +............................................................................................................................................................................................(.......................................................pP......................i...............................................).......................Pi.............. P......I.......................................,...............................500.............................cursor........................../api/directory/servers?.........................none............................................remote......................+...Iterator result interface is not an object..........................9....................................@.<.E....QL.@Pm..@.......Cf.@....dJ.@.>.@ ..D...@.L.LQ....-.....@.N..A.%....@...C...@.e.E....Q4..p{...L.....@...E.....3.@ &.G....rL.@.\..0..@ ......@.<.@ ..D...@`4.C..........y....@...E....Q4.@p}.....@.4..@.....b....@.D@...C...........j...........=...a...}...................................&...G...K...T.......F...............f.......................................................X.)......................>......................8'......................p.......................H.......................P........................i......................`.......................hb .....................P.......................x................................................j................ + +--- offset 294192439 --- +URLSearchParams({version:"latest",limit:"100",visibility:r});if(n)i.set("cursor",n);let s=await fs.get(`/mcp-registry/v0/servers?${i}`,{auth:"none",timeout:5000});if(!s.ok)break;for(let a of s.data.servers??[])for(let l of a.server?.remotes??[]){let c=bed(l.url);if(c)t.add(c)}if(n=s.data.metadata?.nextCursor,!n)break}return t}async function gU_(e){let t=new Set,r=e.join(","),n;for(let o=0;o<_ed;o++){let i=new URLSearchParams({limit:"500",visibility:r});if(n)i.set("cursor",n);let s=await fs.get(`/api/directory/servers?${i}`,{auth:"none",timeout:5000});if(!s.ok)break;for(let a of s.data.servers??[]){if(a.type!=="remote")continue;let l=a.remote?.url;if(!l)continue;let c=bed(l);if(c)t.add(c)}if(n=s.data.next_cursor??void 0,!n)break}return t}async function ved(){if(ia())return;if(kAt())return;let e=tt("tengu_mcp_directory_bff",!1),t=Ce(e?"bff":"legacy"),r=mU_();if(r.length===0){H_().officialUrls=new Set,_e("mcp_registry_fetch"),O("tengu_mcp_registry_fetch",{source:t,success:!0,url_count:0,duration_ms:0,empty_visibility:!0});return}let n=Date.now();try{let o=e?await gU_(r):await hU_(r);H_().officialUrls=o,E(`[mcp-registry] Loaded ${o.size} official MCP URLs (${e?"bff":"legacy"})`),_e("mcp_registry_fetch"),O("tengu_mcp_registry_fetch",{source:t,success:!0,url_count:o.size,duration_ms:Date.now()-n})}catch(o){E(`Failed to fetch MCP registry: ${ue(o)}`,{level:"error"}),we("mcp_registry_fetch","fetch_failed"), diff --git a/extractions/v2.1.234/calls/api-event-logging.txt b/extractions/v2.1.234/calls/api-event-logging.txt new file mode 100644 index 0000000..006cd91 --- /dev/null +++ b/extractions/v2.1.234/calls/api-event-logging.txt @@ -0,0 +1,11 @@ +# anchor: /api/event_logging/ +# occurrences shown: 3 + +--- offset 290759088 --- +............................................0...............................................................................................................................................4..............L..t........!........................".....i.............P...............P...........................................................................................H...Cannot destructure property 'anthropicHost' from null or undefined value........................e.............................../api/event_logging/.............................renderer.........................................@..............................................................................@J.......................u..................4...z.......z.......4............D..P...............................................`.l.....x...................................................................................................................................................................................h...h...h...h...h...h...h...h...h...h...h...............................................................................................(...0...0...0...0...0...0...0...0...0...0...0...0...0...0...0...0...................................(...............................................................................................................................................h..............L..t........!......O......O..... + +--- offset 294289077 --- +Hn.join(In(),"telemetry")}class gGs{endpoint;timeout;maxBatchSize;skipAuth;batchDelayMs;baseBackoffDelayMs;maxBackoffDelayMs;maxAttempts;isKilled;storageV5;pendingExports=[];isShutdown=!1;schedule;cancelBackoff=null;attempts=0;drainPromise=null;queueFileLock=Promise.resolve();lastExportErrorContext;constructor(e={}){let t=e.baseUrl||(process.env.ANTHROPIC_BASE_URL==="https://api-staging.anthropic.com"?"https://api-staging.anthropic.com":"https://api.anthropic.com");this.endpoint=`${t}${e.path||"/api/event_logging/v2/batch"}`,this.timeout=e.timeout||1e4,this.maxBatchSize=e.maxBatchSize||200,this.skipAuth=e.skipAuth??!1,this.batchDelayMs=e.batchDelayMs||100,this.baseBackoffDelayMs=e.baseBackoffDelayMs||500,this.maxBackoffDelayMs=e.maxBackoffDelayMs||30000,this.maxAttempts=e.maxAttempts??8,this.isKilled=e.isKilled??(()=>!1),this.storageV5=e.storageV5,this.schedule=e.schedule??((r,n)=>{let o=setTimeout(r,n);return()=>clearTimeout(o)}),this.retryPreviousBatches()}async getQueuedEventCount(){return(await this.loadEventsFromCurrentBatch()).length}getCurrentBatchFilePath(){return PHn.join(r7t(),`${hGs}${qt()}.${DHn}.json`)}currentBatchStream(){return Rn.log(qt(),"telemetry",{runId:DHn})}async loadEventsFromFile(e){try{return await pTr(e)}catch{return[]}}currentBatch(){return this.storageV5?{kind:"stream",storageV5:this.storageV5,stream:this.currentBatchStream()}:{kind:"file",filePath:this.getCurrentBatch + +--- offset 317860713 --- +ment:{toggleKey:"disableNonessentialTelemetry",label:(0,hst.msg)({defaultMessage:"Nonessential telemetry",id:"UzLHrala3Q"}),endpoints:[{host:$ce.SEGMENT_CDN_HOST,origin:"renderer",cspDirective:["connect-src","script-src"]},{host:$ce.SEGMENT_API_HOST,origin:"renderer",cspDirective:["connect-src","script-src"]}]},"anthropic-telemetry":{toggleKey:"disableNonessentialTelemetry",label:(0,hst.msg)({defaultMessage:"Nonessential telemetry",id:"UzLHrala3Q"}),endpoints:({anthropicHost:e})=>[{host:e,path:"/api/event_logging/",origin:"renderer"}]},"anthropic-mcp-registry":{toggleKey:"disableNonessentialServices",label:(0,hst.msg)({defaultMessage:"Nonessential services",id:"Pc8UzwjRqD"}),endpoints:[{host:$ce.ANTHROPIC_API_HOST,path:"/mcp-registry/",origin:"renderer"},{host:$ce.ANTHROPIC_API_HOST,path:"/api/directory/",origin:"renderer"}]},"connector-favicons":{toggleKey:"disableNonessentialServices",label:(0,hst.msg)({defaultMessage:"Nonessential services",id:"Pc8UzwjRqD"}),endpoints:[{host:$ce.FAVICON_PROXY_HOST,path:"/s2/favicons",followRedirects:!0,origin:"renderer",cspDirective:"img-src"},{host:$ce.GSTATIC_WILDCARD,path:"/faviconV2",origin:"renderer",cspDirective:"img-src"}]},"artifact-sandbox":{toggleKey:"disableNonessentialServices",label:(0,hst.msg)({defaultMessage:"Nonessential services",id:"Pc8UzwjRqD"}),endpoints:({artifactIframeHost:e})=>[{host:e!==null&&e!==void 0?e:$ce.ARTIFACT_IFRAME_HOST,origin diff --git a/extractions/v2.1.234/calls/api-frame-comments.txt b/extractions/v2.1.234/calls/api-frame-comments.txt new file mode 100644 index 0000000..fcfd602 --- /dev/null +++ b/extractions/v2.1.234/calls/api-frame-comments.txt @@ -0,0 +1,32 @@ +# anchor: /api/frame/comments/ +# occurrences shown: 10 + +--- offset 138694720 --- +...!......".i.i......Fy............. ...............................................................................................................................................................................................................................0...............P.......................................................(.......................................p(...............(......i........(...............................(......)........(............................................../api/frame/comments/.....................:......................................server_read_request_error...................%...comments fetch failed (network error)...................h......................................._...............................no-auth.........................comments read unavailable: .....................server_read_relay_error....................."...comments fetch failed (relay HTTP ..............................)...............................server_read_unavailable.............................................5.............................P........N.@ ...............P..@..{.......*........@ ......@.T.....@...@ .._..S....@...C...@.L.@ ..@ ..G....r4...d.^.:.@PN.G....`U.@ ..G.....3.@.f.G...@...J...@0M.@ ..@@..G...o.a[....@.d.G....`..@ ..@ ..@............................................../...................\...............5................................-7..................... + +--- offset 138717536 --- +....................................................................................................................................................................................................................................@...............p............................................... ...............@.......................(.......................................P...............`.......i........................`......................)......................................................./api/frame/comments/............................e.............................../...............................t...............................r...............................n...............1...............................................artifact_comment_reply..........................relay_request_error.............................error.......................o...c.o.m.m.e.n.t. .r.e.p.l.y. .o.u.t.c.o.m.e. .u.n.k.n.o.w.n. .(.r.e.l.a.y. .r.e.q.u.e.s.t. .f.a.i.l.e.d.). .. .i.t. .m.a.y. .h.a.v.e. .p.o.s.t.e.d.;. .r.e.-.r.e.a.d. .t.h.e. .c.o.m.m.e.n.t.s. .b.e.f.o.r.e. .r.e.t.r.y.i.n.g...................request_error...............$...comment reply failed (network error)....................HT......................................_...............................no-auth.........................comment reply unavailable: .....................transport.......................................malformed_echo.......... + +--- offset 138725392 --- +i.i......FL.........@.......................................................................................................................................................................................................................................................................................................................................(...............................................................i...............................)......................................................./api/frame/comments/............................/.............................../summon-status..................................................failed..........................request_error...................skipped.........................relay_error.....................................route_absent............,.......................http_failed.....................accepted............................................".............................Pu.......N.@ ........m.@ ......@P...........@..........D...@...C...@ ..G...@.t.J...@...G...@.t.G...@...G.....3.@.$.G.....3N....@...G..................................#...J...`...t.............................6.....................H.$.....................p5.......................fP.....................P...............................................@W&.......................8.....................p.................................................4..................... + +--- offset 138732480 --- +....................................0...............@.......................(...............................................................i....... ...............@'.............. .......).......0...........................................?...Cannot destructure property 'slug' from null or undefined value.................t...............................r...............................error...........................invalid slug or thread id.......................input.........................../api/frame/comments/............................/.............................../resolve........................n...............................o...............................................artifact_comment_resolve........................request_error...............%...thread resolve failed (network error)...................X......................................._...............................thread resolve unavailable: ....................transport.......................................ok..............................relay_error.................+...thread resolve outcome unknown (relay HTTP .....................)...............................principal_mismatch..................................................T...........................T.........p......@p4...3...T.....@p4...3`..............N.@ ....3...m.@ ....3.@....PL.@ ....3v......<=........@ ......@.T.................@...C.....L.@...G....r4...d..@9 + +--- offset 138744160 --- +8...8...8...................................................X...............(...............(...............................x.............................................................................................................................................................................................................j...!.......................................................i.............P...............p.............................................................................../api/frame/comments/............................e.............................../...............................t.................................................................p........N.@ ........m.@ ......@.l..@..@ .....c,.....<.........................................n6.....................x`$...............................................P......................^.......................wJ......................E4......................=...........B......d...:>..A...L...B...p............H..P.........................J.....................p.J.....x...................................................................................................................................................................................h...h...h...h...h...h...h...h...h...h...h...h...h...h...h...h...h...h...h...h...h...h...x...x...x...x...x...................(...(...(...(...(...(...(...(...(...(...(...(...(...(...(...(... + +--- offset 302544939 --- +{status:e.status}),{err:"comments are not available on this artifact right now",unavailable:!0};let o=i6v(e.data,t);if(o===null)return n(t,"malformed_body"),{err:"comments fetch failed (unexpected response)"};return{err:null,threads:o.threads,...o.threadsDegraded&&{threadsDegraded:!0},...o.threadsDropped&&{threadsDropped:!0}}}async function Vgf(e,t,r,n){let o=await tyf(e,r,n);if(o.err!==null)Jo().contentHostEgressDenied.delete(t);return o}async function tyf(e,t,r,n=pe){let o;try{o=await vW.get(`/api/frame/comments/${encodeURIComponent(e)}`,{refreshOAuth:!0,headers:XP(),timeout:15000,maxContentLength:QRa,signal:t})}catch(i){if(pk(i))throw i;return n(r,"server_read_request_error"),{err:"comments fetch failed (network error)"}}if(!o.ok)return n(r,o.reason.replace(/-/g,"_")),{err:o.reason==="no-auth"?rW(o.detail):`comments read unavailable: ${o.reason}`};if(!o.fromFrame)return n(r,"server_read_relay_error",{status:o.status}),{err:`comments fetch failed (relay HTTP ${o.status})`};return eyf(o,r,"server_read_unavailable",n)}async function K3r(e,t,r="artifact_comments_read"){let n=await NMt(e,r,t);if(n.err!==null)return{err:n.err};let{ver:o,assetToken:i}=n;if(i===void 0)return{err:"comments are not readable on a public artifact serve"};if(Jo().contentHostEgressDenied.has(e.env))return Vgf(e.slug,e.env,t,r);let s;if(tt("tengu_onyx_sluice",!1)){let p=()=>{},f=await tyf(e.slug,t,r,(...m)=>{p=(h)=>h(...m)}); + +--- offset 302547147 --- +:pe),d}function oyf(e){if(!e||typeof e!=="object")return{};return{..."error"in e&&typeof e.error==="string"&&{error:e.error},..."reason"in e&&typeof e.reason==="string"&&{reason:e.reason}}}function V3n(e){return oyf(e).reason??null}function Hbi(e){let t=oyf(e).error??e;return typeof t==="string"?gIr(t,300):""}function I4a(e){return{refreshOAuth:!0,headers:XP(),timeout:30000,maxContentLength:nyf,signal:e}}async function iyf({slug:e,threadId:t,text:r,answersSummon:n},o){let i;try{i=await vW.post(`/api/frame/comments/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{text:r,...n===!0&&{answers_summon:!0}},I4a(o))}catch(u){if(pk(u))throw u;if(QUr(u))return pe("artifact_comment_reply","relay_request_error"),{kind:"error",message:"comment reply outcome unknown (relay request failed) \u2014 it may have posted; re-read the comments before retrying",reason:"relay_request_error"};return pe("artifact_comment_reply","request_error"),{kind:"error",message:"comment reply failed (network error)",reason:"request_error"}}if(!i.ok)return pe("artifact_comment_reply",i.reason.replace(/-/g,"_")),{kind:"error",message:i.reason==="no-auth"?rW(i.detail):`comment reply unavailable: ${i.reason}`,reason:"transport"};if(i.status===201){let u=a6v().safeParse(i.data);if(!u.success)return we("artifact_comment_reply","malformed_echo"),{kind:"ok",threadId:t,commentId:""};let d=gg.test(u.data.thread_id),p=Oht.test(u.data.comment_ + +--- offset 302549668 --- +tatus===404?"artifact or comment thread not found \u2014 it may have been deleted, or you may not have access":i.status===429?"rate limited \u2014 comment replies spend the user's budget; do not retry now":i.status===503?`comment reply temporarily unavailable${l} \u2014 retry later if still needed`:i.status===409?`comment reply conflicted${l} \u2014 re-read the comments before retrying`:`comment reply refused (HTTP ${i.status})${l}`,reason:a}}async function syf(e,t,r){let n;try{n=await vW.post(`/api/frame/comments/${encodeURIComponent(e)}/${encodeURIComponent(t)}/summon-status`,r,{isBackground:!0,headers:XP(),timeout:5000,maxContentLength:nyf})}catch{return{kind:"failed",reason:"request_error"}}if(!n.ok)return{kind:"skipped",reason:n.reason};if(!n.fromFrame)return{kind:"failed",reason:"relay_error",status:n.status};if(n.status===404)return{kind:"route_absent"};if(n.status<200||n.status>=300)return{kind:"failed",reason:"http_failed",status:n.status};return{kind:"accepted"}}function d6v(e,t){if(e===409&&t.includes(l6v))return{kind:"superseded"};if(e===403){if(t.includes(c6v))return{kind:"grant_inactive"};if(t.includes(u6v))return{kind:"principal_mismatch"};if(t.includes(x4a))return{kind:"not_activated"}}return{kind:"error",message:`thread resolve failed (status ${e})`,reason:e===404?"not_found":e===429?"rate_limited":"http"}}async function ayf(e){let{slug:t,threadId:r,afterVersion:n,signal:o}=e;if(! + +--- offset 302550711 --- +d:"superseded"};if(e===403){if(t.includes(c6v))return{kind:"grant_inactive"};if(t.includes(u6v))return{kind:"principal_mismatch"};if(t.includes(x4a))return{kind:"not_activated"}}return{kind:"error",message:`thread resolve failed (status ${e})`,reason:e===404?"not_found":e===429?"rate_limited":"http"}}async function ayf(e){let{slug:t,threadId:r,afterVersion:n,signal:o}=e;if(!gg.test(t)||!gg.test(r))return{kind:"error",message:"invalid slug or thread id",reason:"input"};let i;try{i=await vW.post(`/api/frame/comments/${encodeURIComponent(t)}/${encodeURIComponent(r)}/resolve`,{resolved:!0,after_version:n},I4a(o))}catch(a){if(pk(a))throw a;return pe("artifact_comment_resolve","request_error"),{kind:"error",message:"thread resolve failed (network error)",reason:"request_error"}}if(!i.ok)return pe("artifact_comment_resolve",i.reason.replace(/-/g,"_")),{kind:"error",message:`thread resolve unavailable: ${i.reason}`,reason:"transport"};if(i.status===200)return _e("artifact_comment_resolve"),{kind:"ok"};if(!i.fromFrame)return pe("artifact_comment_resolve","relay_error",{status:i.status}),{kind:"error",message:`thread resolve outcome unknown (relay HTTP ${i.status})`,reason:"relay_error"};let s=d6v(i.status,Hbi(i.data));if(s.kind==="error")pe("artifact_comment_resolve",s.reason);else if(s.kind==="principal_mismatch")pe("artifact_comment_resolve",s.kind);else we("artifact_comment_resolve",s.kind);return s}asy + +--- offset 302551790 --- +atus:i.status}),{kind:"error",message:`thread resolve outcome unknown (relay HTTP ${i.status})`,reason:"relay_error"};let s=d6v(i.status,Hbi(i.data));if(s.kind==="error")pe("artifact_comment_resolve",s.reason);else if(s.kind==="principal_mismatch")pe("artifact_comment_resolve",s.kind);else we("artifact_comment_resolve",s.kind);return s}async function lyf({slug:e,threadId:t},r){if(!gg.test(e)||!gg.test(t))return{kind:"error",message:"invalid slug or thread id",reason:"input"};let n=(c)=>vW.post(`/api/frame/comments/${encodeURIComponent(e)}/${encodeURIComponent(t)}/${c}`,{resolved:!0},I4a(r)),o;try{o=await n("session-resolve");let c=o.ok&&o.status===404&&V3n(o.data)!==h6v,u=o.ok&&o.status===403&&Hbi(o.data).includes(g6v);if(c||u)we("artifact_comment_session_resolve",u?"session_route_ccr_denied":"session_route_fell_back"),o=await n("resolve")}catch(c){if(pk(c))throw c;return pe("artifact_comment_session_resolve","request_error"),{kind:"error",message:"thread resolve failed (network error)",reason:"request_error"}}if(!o.ok)return pe("artifact_comment_session_resolve",o.reason.replace(/-/g,"_")),{kind:"error",message:o.reason==="no-auth"?rW(o.detail):`thread resolve unavailable: ${o.reason}`,reason:"transport"};if(o.status===200)return _e("artifact_comment_session_resolve"),{kind:"ok"};if(!o.fromFrame)return pe("artifact_comment_session_resolve","relay_error",{status:o.status}),{kind:"error",message:`t diff --git a/extractions/v2.1.234/calls/api-frame-contract.txt b/extractions/v2.1.234/calls/api-frame-contract.txt new file mode 100644 index 0000000..e350a24 --- /dev/null +++ b/extractions/v2.1.234/calls/api-frame-contract.txt @@ -0,0 +1,29 @@ +# anchor: /api/frame/contract/ +# occurrences shown: 9 + +--- offset 94781824 --- + . . .<.h.2.>.P.h.a.s.e.s.<./.h.2.>... . . . .<.!.-.-. .S.L.O.T.:. .p.h.a.s.e.s. .-.-.>... . .<./.s.e.c.t.i.o.n.>..... . .<.s.e.c.t.i.o.n.>... . . . .<.h.2.>.V.e.r.i.f.i.c.a.t.i.o.n.<./.h.2.>... . . . .<.!.-.-. .S.L.O.T.:. .v.e.r.i.f.i.c.a.t.i.o.n. .-.-.>... . .<./.s.e.c.t.i.o.n.>...<./.a.r.t.i.c.l.e.>............../'.....http://www.w3.org/2000/svg'..............0'."...http://www.w3.org/1998/Math/MathML.......0'.....u........1'..............r......http://www.w3.org/1999/xhtml............I1'...../api/frame/contract/latest'..............2'.....x-contract-missing-caps.I...............I2'...........ffffff.?.................3'.........I...................................5'...............I5'.....thumbtype_unsupported_cp.5'..............................x......publish denied: ............R...the artifact you're updating was deleted, or you no longer have write access to it.......;...............t......publish outcome unknown (................6'.....cowritten-artifact-html..7'.............I7'.)...(?:\./)?(?:(?:npx|bunx|uvx|uv\s+run)\s+)?8'.......z.....I8'..............8'.....precompa + +--- offset 128184848 --- +H..i.................................................G..!...............i.......i.i................. ...............................................0...............@...............`...............X...............P...............`.......................(.........................................q...............q.....i....... .q.............@.w............. .q.....).......0.q.............................................invalid contract version........................malformed......................./api/frame/contract/............................................err.............................malformed contract response.........................!............................@P..I.....[...%.....@p4.H.....3T........@ ..I.....[.@.>.H.....|.@ ...0......@.......@.<.........J!<.@.4.E.....3.@.<.H..M....@...E..K...................1...}...........................!...f....................=.......................*a.....................P.........................g......................:.......................Py.....................P8..............................................`.......................X?v......................*`.....................XAu.......................s.......................w.........H7......*....(..i.......j...<............H..P.......................8....................... .......x...............................................8;f............................................................. + +--- offset 128188768 --- +.i..................`...............X...............P.......................................................................................................................................................................................................(........................................wq..............wq.....i........wq..............wq.....)........wq.........................................+...invalid contract version or capability name.....................malformed......................./api/frame/contract/............................/................................d.ts...........................text............................................err.............................string..........................................empty or non-text defs body........................................................t.....@p4.......T.....@p4...._........@...@P..@......S............@.......@.<.@...E.....K.@.=.E....Q4..R4P$...@...E..`...........................n...................9...K...........................................8.f......................-...............................................mf......................*.......................@y.....................h(.......................Lf......................T......................`.......................xU........................`.......................g.....................................................dts.................H7..........&*...... + +--- offset 128192880 --- +.................................................................................................................................................................................................... .......................................................(........................................gq..............gq.....i........gq...............v..............gq.....)........gq.............................................invalid contract version........................malformed......................./api/frame/contract/............................/prompt.........................text............................................err.............................string..........................................empty or non-text prompt body...................................,...................................................'....................................@p4....L........@...@......PL...........@.......@.<.@...E.....K.@.=.E....Q4..R4M....@...R...@...R....$5.Hfd.F.<..iL..[<..LT...=300)return{err:`HTTP ${n.status}`,cause:n.status===404?"http_404":n.status>=500?"http_5xx":"http_4xx"};let o=n.response?.headers?.[DCv];return{body:n.data,...typeof o==="string"&&{missingCapsHeader:o}}}async function vmt(e){if(e?.version!==void 0&&!cJe.test(e.version))return{err:"invalid contract version",cause:"malformed"};let t=await FDa(e?.version!==void 0?`/api/frame/contract/${e.version}`:ICv,e);if("err"in t)return t;let r=xCv().safeParse(t.body);if(!r.success)return{err:"malformed contract response",cause:"malformed"};return r.data}async function UDa(e,t,r){if(!cJe.test(e)||!ici.test(t))return{err:"invalid contract version or capability name",cause:"malformed"};let n=await FDa(`/api/frame/contract/${e}/${t}.d.ts`,r,{responseType:"text",maxContentLength:RCv});if("err"in n)return n;if(typeof n.body!=="string"||n.body.trim()==="")return{err:"empty or non-text defs body",cause:"malformed"};return{dts:n.body}}async function jDa(e,t){if(!cJe.test(e))return{err:"invalid contract version",cause:"malformed"};let r=await FDa(`/api/frame/contract/${e}/prompt`,t,{responseType:"text",maxContentLength:LCv});if("err"in r)return r;if(typeof r.body!=="string"||r.body.trim()==="")return{err:"empty or non-text prompt body",cause:"malformed"};let n=r.missingCapsHeader===void 0 + +--- offset 300509492 --- +ader:o}}}async function vmt(e){if(e?.version!==void 0&&!cJe.test(e.version))return{err:"invalid contract version",cause:"malformed"};let t=await FDa(e?.version!==void 0?`/api/frame/contract/${e.version}`:ICv,e);if("err"in t)return t;let r=xCv().safeParse(t.body);if(!r.success)return{err:"malformed contract response",cause:"malformed"};return r.data}async function UDa(e,t,r){if(!cJe.test(e)||!ici.test(t))return{err:"invalid contract version or capability name",cause:"malformed"};let n=await FDa(`/api/frame/contract/${e}/${t}.d.ts`,r,{responseType:"text",maxContentLength:RCv});if("err"in n)return n;if(typeof n.body!=="string"||n.body.trim()==="")return{err:"empty or non-text defs body",cause:"malformed"};return{dts:n.body}}async function jDa(e,t){if(!cJe.test(e))return{err:"invalid contract version",cause:"malformed"};let r=await FDa(`/api/frame/contract/${e}/prompt`,t,{responseType:"text",maxContentLength:LCv});if("err"in r)return r;if(typeof r.body!=="string"||r.body.trim()==="")return{err:"empty or non-text prompt body",cause:"malformed"};let n=r.missingCapsHeader===void 0?[]:r.missingCapsHeader.slice(0,4096).split(",").map((o)=>o.trim()).filter((o)=>ici.test(o));return{promptMd:r.body,missingCaps:n}}function sor(e){return(t,r,n)=>e((o)=>{let i=r===void 0||n===void 0?void 0:n;if(o.artifactReadVersions?.[t]===r&&o.staleGuardSeedBatch?.[t]===i)return o;let{[t]:s,...a}=o.artifactReadVersions??{},{[t + +--- offset 300509837 --- +.data}async function UDa(e,t,r){if(!cJe.test(e)||!ici.test(t))return{err:"invalid contract version or capability name",cause:"malformed"};let n=await FDa(`/api/frame/contract/${e}/${t}.d.ts`,r,{responseType:"text",maxContentLength:RCv});if("err"in n)return n;if(typeof n.body!=="string"||n.body.trim()==="")return{err:"empty or non-text defs body",cause:"malformed"};return{dts:n.body}}async function jDa(e,t){if(!cJe.test(e))return{err:"invalid contract version",cause:"malformed"};let r=await FDa(`/api/frame/contract/${e}/prompt`,t,{responseType:"text",maxContentLength:LCv});if("err"in r)return r;if(typeof r.body!=="string"||r.body.trim()==="")return{err:"empty or non-text prompt body",cause:"malformed"};let n=r.missingCapsHeader===void 0?[]:r.missingCapsHeader.slice(0,4096).split(",").map((o)=>o.trim()).filter((o)=>ici.test(o));return{promptMd:r.body,missingCaps:n}}function sor(e){return(t,r,n)=>e((o)=>{let i=r===void 0||n===void 0?void 0:n;if(o.artifactReadVersions?.[t]===r&&o.staleGuardSeedBatch?.[t]===i)return o;let{[t]:s,...a}=o.artifactReadVersions??{},{[t]:l,...c}=o.staleGuardSeedBatch??{};return{...o,artifactReadVersions:r===void 0?a:{...a,[t]:r},staleGuardSeedBatch:i===void 0?c:{...c,[t]:i}}})}function aor(e){return(t,r,n)=>e((o)=>{let i=uJe(r),s=o.artifactRefs??[],a=s.find((c)=>c.slug===t),l=i??a?.pin;if(n?.cachePinOnly){if(a!==void 0){if(a.pin===l)return o;return{...o,artifactRefs:s.map((c + +--- offset 300560377 --- +let o=hxv(t);if(o){let i=gxv.find((a)=>a===o.reason),s=i?ge(i):void 0;return{code:"publish_denied",...s&&{extra:{deny_reason:s}},msg:Q2n+gIr(o.error,300)}}}if(e===404&&r)return{code:"slug_gone",msg:yxv};return{}}function nTe(e){return gIr(mJe(e),200)}function mJe(e){if(typeof e==="string")return e;if(e&&typeof e==="object"){if("error"in e&&typeof e.error==="string"){let t="reason"in e&&typeof e.reason==="string"?` [${e.reason}]`:"";return e.error+t}return Re(e)??""}return""}var U5=16777216,IDa="/api/frame/contract/latest",xCv,ICv="/api/frame/contract/latest",RCv=262144,LCv=65536,DCv="x-contract-missing-caps",PCv=16384,MCv,$Cv,OCv="",NCv,t8p=8192,J2n=300000,UCv,GCv=2097152,VDa=8,VCv=0.7,o8p,KCv,JDa="',a8p=`.`,Wci=`.`,YCv=32,W6p=2000,ZCv="thumbtype_unsupported_cp",exv=64,V6p=3,rxv=5000,nxv=20000,Zci,c8p,PDa,MMt,ixv,sxv,$Mt=67108864,Qci=15728640,axv=12582912,CDa=20971520,Y6p=256,X6p,eui,nPa,dxv,pxv,p8p,MDa,fxv,J6p=200,mxv=4194304,Q2n="publish denied: ",gxv,yxv="the artifact you're updating was deleted, or you no longer have write access to it",tui="publish outcome unknown (";var o8=A(()=>{Xje();qn( + +--- offset 300560414 --- +=>a===o.reason),s=i?ge(i):void 0;return{code:"publish_denied",...s&&{extra:{deny_reason:s}},msg:Q2n+gIr(o.error,300)}}}if(e===404&&r)return{code:"slug_gone",msg:yxv};return{}}function nTe(e){return gIr(mJe(e),200)}function mJe(e){if(typeof e==="string")return e;if(e&&typeof e==="object"){if("error"in e&&typeof e.error==="string"){let t="reason"in e&&typeof e.reason==="string"?` [${e.reason}]`:"";return e.error+t}return Re(e)??""}return""}var U5=16777216,IDa="/api/frame/contract/latest",xCv,ICv="/api/frame/contract/latest",RCv=262144,LCv=65536,DCv="x-contract-missing-caps",PCv=16384,MCv,$Cv,OCv="",NCv,t8p=8192,J2n=300000,UCv,GCv=2097152,VDa=8,VCv=0.7,o8p,KCv,JDa="',a8p=`.`,Wci=`.`,YCv=32,W6p=2000,ZCv="thumbtype_unsupported_cp",exv=64,V6p=3,rxv=5000,nxv=20000,Zci,c8p,PDa,MMt,ixv,sxv,$Mt=67108864,Qci=15728640,axv=12582912,CDa=20971520,Y6p=256,X6p,eui,nPa,dxv,pxv,p8p,MDa,fxv,J6p=200,mxv=4194304,Q2n="publish denied: ",gxv,yxv="the artifact you're updating was deleted, or you no longer have write access to it",tui="publish outcome unknown (";var o8=A(()=>{Xje();qn();lLa();Wct();bte();VH();dLa();ljr(); diff --git a/extractions/v2.1.234/calls/api-frame-deploy.txt b/extractions/v2.1.234/calls/api-frame-deploy.txt new file mode 100644 index 0000000..16b42ae --- /dev/null +++ b/extractions/v2.1.234/calls/api-frame-deploy.txt @@ -0,0 +1,32 @@ +# anchor: /api/frame/deploy/ +# occurrences shown: 10 + +--- offset 128365840 --- +....................................................................................................................................H..!....................................H..!.......................................H.&!.............................................!........................................................a................i................................................................................................................................................................./api/frame/deploy/init..........2.......1.......................N...............................ee..............................frame...........................claude-ai-oauth..:........................................................................`N.@ ........S...=.......k...,.......k.@.,......p,#.........@-...........-...T........f............,..............................9...........................................H....................... .......................x.......................p...............................................@.%.......................%.....................0Px.....................x\%..............................................W%.....................................................................`.g.....................H.........................................................................u.....................(.......................................................THUMB_ + +--- offset 128394416 --- +...........H........F......................... ....j........i.....F.................................x...............p.......................................................................................................................................................................................................................(........................................Tn..............Tn.....i.......0Tn.............P.s.............0Tn.....).......@Tn............................................./api/frame/deploy/complete......1...............................frame...........................claude-ai-oauth..........:..................................$...[artifact] deploy/complete skipped: ............................................[artifact] deploy/complete .....................: ..........................#...[artifact] deploy/complete failed: .................................3.............................0......@.n.@...@P..@P........,.....@PT.@@...@...@......@.t....T........................@...C...@PL.@...G...spi.@.?.G.....3.@.%.@...G.....d.@ ..E.....3.z.qE....@.T.@...@...E...@p\.H.....D.@ .....P....@.t........................................s...|...................B...\...h...j...............................................hK..............................................8i......................pIc.....................H.]......................(c......................Au.....................`1c... + +--- offset 128435008 --- +.....................................................................................................................H..................H..!........................................H..................H..!..........................................................!.................................................................0...................................i........p...............................................................x...............p...............h.............................../api/frame/deploy/direct........2.......1.......................`................................... .............................`......@p4..@..@ ........S...=.......k...,.......k.@.,.....@`,.@..#.....0..@.-.@...@....0..@.. .............0.......0e............-...........#...@...................................................x.........................d.....................8.........................b.......................................................................b.......................d.....................HBw.......................d..............................................k........................l.......................................................................t.................................................................................................................................V7.......B...>..3...nB..4....B...B.......H..P.......................x\......................`\.... + +--- offset 128482096 --- +x...x.......................................................................................................................(.................................................................................................................................................................................!.................................................................0...................................i...............@...............`...............X...............P.............................../api/frame/deploy/direct................`.........................................................`......@ N..........0.......0em...............................................p...............................................0.r......................Q..............................................x.s..................... ...............................................`.......................Xb......................@............................M......p.......q....M..XO.......D..P............................................... .r.....x...............................................x...................................................................................,...............................................h...h...h...h...h...h...h...h...h...h...h...h...h...h...h...h...h...h...h...p...p...p...p...p...p...p...p....................... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... . + +--- offset 128496160 --- +............................X...............................................................h.....................................................................................................................H..!............................................................H..!....................................!...................................................i.....p...............................................................x...............p...............h.............................../api/frame/deploy/prepare.......2.......................1...............0u........................................................`......@pN.....@0].....@.=.G.....+.@0]............|...............K...........................P.................................................#...............................................#............................................. .......................H.........................s..........................................R..5.......5........R...R.......D..P.......................................................................................................H...............................................................................h....... ................9..............`Z#.....8Z#.......#.......#.......#.....X.#.....p.#.......#.......c.....H...................................................................h...h...h...h...h...h...h...h...h...h...h...h...h...h...h. + +--- offset 300532954 --- +_cobalt_plinth_direct",!0))return se(K6p(k,b,N,y,g,{t0:r,pageBytes:C,lane:"inline",isRedeploy:f,hasCaps:m,template:D,...M&&{workshopInfo:M},forced:g,...z!==null&&{echoedPin:z}},t.ownPublishes,R,t.createPath,t.onRetry,t.signal));let le={page_bytes:C,lane:Ce("signed"),forced:g,template:ge(D)},ee=DWp(),ie=ee?await ee.preflightThumbnailCapture():null,de=ie!==null&&"chrome"in ie?ie.chrome:null,te=Yci(k),re=ee!==null&&ee.pageFitsCapture(te),ce=de!==null&&re,fe=null;try{let he=g,Ee=y,He=(vt)=>fs.post("/api/frame/deploy/init",{...zDa(b),...KDa(),...YDa(),...N,...he&&{force:!0},...Ee&&{baseVersion:Ee},...vt&&{thumbType:ee.THUMB_CONTENT_TYPE}},{host:"frame",auth:"claude-ai-oauth",refreshOAuth:!0,headers:XP(),timeout:15000,validateStatus:()=>!0}),Ie=async(vt)=>{let ht=await He(vt);if(ht.ok&&ht.status===503)await kr(2000),ht=await He(vt);return ht},Ge=await Ie(ce);if(he&&Ge.ok&&Ge.status===400&&/unknown field/i.test(mJe(Ge.data))&&(/\bforce\b/.test(mJe(Ge.data))||Ee!==void 0&&/\bbaseVersion\b/.test(mJe(Ge.data))))we("artifact_publish","force_field_rejected",le),E("[artifact] CP rejected force/baseVersion as unknown \u2014 retrying without them"),he=!1,Ee=void 0,Ge=await Ie(ce);if(he&&Ee&&Ge.ok&&Ge.status===400&&/force and baseVersion are mutually exclusive/.test(mJe(Ge.data)))we("artifact_publish","exclusivity_retry",le),E("[artifact] pre-relaxation CP rejected force+baseVersion \u2014 retrying without the + +--- offset 300539406 --- +lready written (create-only precondition). Re-run publish to mint a fresh version.",precondition:!0}}if(typeof s.status!=="number"||s.status<200||s.status>=300)return{status:s.status,err:`upload ${s.status}: ${nTe(s.data)}`,precondition:!1};if(kCv()&&!s.headers?.["x-goog-generation"])return{status:403,err:"upload intercepted: 2xx without x-goog-generation \u2014 a proxy answered in place of GCS",precondition:!1,intercepted:!0};return null}async function q6p(e,t,r,n,o,i){try{let s=await fs.post("/api/frame/deploy/complete",{slug:e,version:t,ok:r,...i,...Q6p()&&n&&{publish_context:n},...e8p()&&{template:o}},{host:"frame",auth:"claude-ai-oauth",refreshOAuth:!0,headers:XP(),timeout:15000,validateStatus:()=>!0});if(!s.ok)E(`[artifact] deploy/complete skipped: ${s.reason}`);else if(s.status!==204)E(`[artifact] deploy/complete ${s.status}: ${nTe(s.data)}`)}catch(s){E(`[artifact] deploy/complete failed: ${s instanceof Error?s.message:String(s)}`)}}function tPa(){if(ij()==="claude-vscode")return"epitaxy_pane";if(hO())return"desktop_pane";return"terminal_link"}async function Jci(e,t){try{let r=await vW.post("/api/frame/track",{event_name:e,...t.slug&&{slug:t.slug},...t.via&&{via:t.via},...t.mode&&{mode:t.mode}},{refreshOAuth:!0,headers:XP(),timeout:5000});if(!r.ok)E(`[artifact] /track skipped: ${r.reason}`);else if(r.status!==204)E(`[artifact] /track ${r.status}: ${nTe(r.data)}`)}catch(r){E(`[artifact] /t + +--- offset 300542046 --- +tried",{...n,deploy_attempts:s,deploy_final_status:a||!i.ok?0:i.status,...r?.aborted&&{cancelled:!0}}),t?.({settled:!0})}}function rPa(){return V2n("the server answered for a different artifact than the one targeted, so its answer was not adopted")}function q2n(e){return V2n(`${e} returned an incomplete or malformed response`)}async function K6p(e,t,r,n,o,i,s,a,l,c,u){let d={page_bytes:i.pageBytes,lane:ge(i.lane),forced:i.forced,template:ge(i.template)};try{let p=o,f=n,m=()=>u8p(()=>vW.post(l??"/api/frame/deploy/direct",{...zDa(t),...KDa(),...YDa(),...r,...l===void 0&&p&&{force:!0},...l===void 0&&f&&{baseVersion:f},content:e},{refreshOAuth:!0,headers:XP(),timeout:60000,maxBodyLength:2*U5,relayProbe:IDa}),c,u,d),h=await m();if(p&&h.ok&&h.fromFrame&&h.status===400){let k=mJe(h.data);if(PDa.test(k)&&(/\bforce\b/.test(k)||f!==void 0&&/\bbaseVersion\b/.test(k)))we("artifact_publish","force_field_rejected",d),E("[artifact] CP rejected force/baseVersion as unknown \u2014 retrying without them"),p=!1,f=void 0,h=await m()}if(p&&f&&h.ok&&h.fromFrame&&h.status===400&&/force and baseVersion are mutually exclusive/.test(mJe(h.data)))we("artifact_publish","exclusivity_retry",d),E("[artifact] pre-relaxation CP rejected force+baseVersion \u2014 retrying without the precondition"),f=void 0,h=await m();if(!h.ok)return pe("artifact_publish",h.reason,d),Ch(h.reason==="no-auth"?rW(h.detail):`publish unavailable: ${h + +--- offset 300547115 --- +-encoded; split or shrink the file")}m+=L}if(m>$Mt)return p(`total content is ${Math.ceil(m/1024/1024)}MB \u2014 a version's `+`files may total at most ${$Mt/1024/1024}MB`);let h=Object.create(null);h["index.html"]={content:e,contentType:"text/html"};let g=[],y=axv-G2n(e);for(let C of t){let R=xDa(C),L=G2n(R);if(L<=y)y-=L,h[C.path]={content:R,contentType:C.contentType};else{let M=Pm(C.content);g.push({f:C,sha:M,wire:R}),h[C.path]={sha256:M,contentType:C.contentType}}}let b=(C)=>u8p(()=>vW.post("/api/frame/deploy/direct",C,{refreshOAuth:!0,headers:XP(),timeout:60000,maxBodyLength:2*U5,relayProbe:IDa}),l,c,u),v={...zDa(r),...KDa(),...YDa(),...n},S=15728640,w=[];{let C=[],R=0;for(let L of g){let M=G2n(L.wire);if(C.length>0&&R+M>S)w.push(C),C=[],R=0;C.push(L),R+=M}if(C.length>0)w.push(C)}let H=async(C,R)=>{let L=()=>vW.post("/api/frame/upload",{slug:C,files:R.map(({f:P,wire:D})=>({path:P.path,content:D,contentType:P.contentType}))},{refreshOAuth:!0,headers:XP(),timeout:60000,maxBodyLength:2*U5,relayProbe:IDa}),M=await L();if(M.ok&&M.fromFrame&&M.status===429){let P=KPe(M.response?.headers?.["retry-after"])??2000;await kr(Math.min(P,30000)),M=await L()}return M},T=(C,R,L)=>Ch(`multi-file publish is not available here yet (server or proxy rejected it: ${C}${R?` \u2014 ${nTe(R)}`:""})${L?.maybeGone?", or this artifact no longer exists or is not yours to update":""}. The extra files were NOT published; + +--- offset 300548280 --- +}return M},T=(C,R,L)=>Ch(`multi-file publish is not available here yet (server or proxy rejected it: ${C}${R?` \u2014 ${nTe(R)}`:""})${L?.maybeGone?", or this artifact no longer exists or is not yours to update":""}. The extra files were NOT published; retry as a single-file artifact, or wait for the multi-file rollout to reach this path.${L?.debris??""}`),k="";try{let C=r.slug,R,L,M=!1,P=!1;if(t.length>0){let z=t.map((U)=>({f:U,sha:Pm(U.content),wire:xDa(U)})),X=async(U,N)=>{let K=()=>vW.post("/api/frame/deploy/prepare",{...U!==void 0&&{slug:U},...N.length>0&&{shas:N}},{refreshOAuth:!0,headers:XP(),timeout:30000}),se=await K();if(se.ok&&se.fromFrame&&se.status===429){let Z=KPe(se.response?.headers?.["retry-after"])??2000;await kr(Math.min(Z,30000)),se=await K()}return se};for(let U=0;U<2;U++){let N=await X(C,z.map((te)=>te.sha));if(!N.ok)break;if(N.status===404){if(N.data?.error==="not_found")return pe("artifact_publish","prepare_not_found",u),Ch("the server does not recognize this artifact for updating (it may no longer exist or may not be yours to update). The files were NOT published.");break}if(N.status!==200)break;let K=N.data?.slug,se=N.data?.missing;if(typeof K!=="string"||!gg.test(K)||!Array.isArray(se)||!se.every((te)=>typeof te==="string"&&/^[0-9a-f]{64}$/.test(te)))break;if(C!==void 0&&K!==C)return pe("artifact_publish","prepare_slug_mismatch",u),Ch("the server answered the upload pr diff --git a/extractions/v2.1.234/calls/api-frame-upload.txt b/extractions/v2.1.234/calls/api-frame-upload.txt new file mode 100644 index 0000000..45e1c7f --- /dev/null +++ b/extractions/v2.1.234/calls/api-frame-upload.txt @@ -0,0 +1,8 @@ +# anchor: /api/frame/upload +# occurrences shown: 2 + +--- offset 128487088 --- +`...`...`...`...`...`...`...................................X...............X...............................................................................................h.................................................................!...............................................a................!.................................................................0...................................i..............@...............`...............X...............P.............................../api/frame/upload.......................`.........................................................`......@.n.@...D..E....@ATb.............0.......0e....................................................................x.........................r.....................H........................w.......................fZ.....................`/.......................=................................................s.....................0...............................................p.......................hN......................P...........................................*N..4...B...4...C...*N..lN.......D..P.......................................................x...................................................................................................................................................................................h...h...h...h...h...h...h...h...h...h...h................................ + +--- offset 300547448 --- +={content:R,contentType:C.contentType};else{let M=Pm(C.content);g.push({f:C,sha:M,wire:R}),h[C.path]={sha256:M,contentType:C.contentType}}}let b=(C)=>u8p(()=>vW.post("/api/frame/deploy/direct",C,{refreshOAuth:!0,headers:XP(),timeout:60000,maxBodyLength:2*U5,relayProbe:IDa}),l,c,u),v={...zDa(r),...KDa(),...YDa(),...n},S=15728640,w=[];{let C=[],R=0;for(let L of g){let M=G2n(L.wire);if(C.length>0&&R+M>S)w.push(C),C=[],R=0;C.push(L),R+=M}if(C.length>0)w.push(C)}let H=async(C,R)=>{let L=()=>vW.post("/api/frame/upload",{slug:C,files:R.map(({f:P,wire:D})=>({path:P.path,content:D,contentType:P.contentType}))},{refreshOAuth:!0,headers:XP(),timeout:60000,maxBodyLength:2*U5,relayProbe:IDa}),M=await L();if(M.ok&&M.fromFrame&&M.status===429){let P=KPe(M.response?.headers?.["retry-after"])??2000;await kr(Math.min(P,30000)),M=await L()}return M},T=(C,R,L)=>Ch(`multi-file publish is not available here yet (server or proxy rejected it: ${C}${R?` \u2014 ${nTe(R)}`:""})${L?.maybeGone?", or this artifact no longer exists or is not yours to update":""}. The extra files were NOT published; retry as a single-file artifact, or wait for the multi-file rollout to reach this path.${L?.debris??""}`),k="";try{let C=r.slug,R,L,M=!1,P=!1;if(t.length>0){let z=t.map((U)=>({f:U,sha:Pm(U.content),wire:xDa(U)})),X=async(U,N)=>{let K=()=>vW.post("/api/frame/deploy/prepare",{...U!==void 0&&{slug:U},...N.length>0&&{shas:N}},{refresh diff --git a/extractions/v2.1.234/calls/api-grove-settings.txt b/extractions/v2.1.234/calls/api-grove-settings.txt new file mode 100644 index 0000000..7381475 --- /dev/null +++ b/extractions/v2.1.234/calls/api-grove-settings.txt @@ -0,0 +1,8 @@ +# anchor: /api/claude_code_grove +# occurrences shown: 2 + +--- offset 260620176 --- +........................W............................]..p....~...............................!................................~.......%...i.....%....O...s..........G.,............................j..........s.i.i.p.......................................................................................................................(....................................... ...............0.......i.......P...............pJ..............P.......).......`.............................................../api/claude_code_grove......................................%...Failed to fetch Grove notice config: ......................................................................n.........C...@.L.@...G...tai..O?.@.......@..............X...g........................|......................................................................................................................................................................xH...........K......j...........F... ...j............D..P.......................................................x................................................n..................................................................................................................................h...h...h...h...h...h...h...h...h...h...h...h...h...h...h...h...h...h...h...h...h...h...h...h...h...h...h.......(...(...X..................................................................................... + +--- offset 305025563 --- +;OF();qr();tr();K_();c$e=iu(async()=>{try{return{success:!0,data:(await SG(async()=>{let t=await fs.get("/api/oauth/account/settings",{timeout:R3f});if(!t.ok)throw Error(`Failed to get Grove settings: ${t.reason}`);return t})).data}}catch(e){if(!(e instanceof Error)||!/data-residency|essential-traffic-only|no-auth/.test(e.message))E(`Failed to fetch Grove settings: ${e}`,{level:"error"});return c$e.cache.clear?.(),{success:!1}}});Hgt=iu(async()=>{try{let e=await SG(async()=>{let i=await fs.get("/api/claude_code_grove",{timeout:R3f});if(!i.ok)throw Error(`Failed to fetch Grove notice config: ${i.reason}`);return i}),{grove_enabled:t,domain_excluded:r,notice_is_grace_period:n,notice_reminder_frequency:o}=e.data;return{success:!0,data:{grove_enabled:t,domain_excluded:r??!1,notice_is_grace_period:n??!0,notice_reminder_frequency:o}}}catch(e){return E(`Failed to fetch Grove notice config: ${e}`),{success:!1}}})});function c8n(e){if(Array.isArray(e))return e.map(c8n);if(e!==null&&typeof e==="object"){let t={};for(let r of Object.keys(e).sort())t[r]=c8n(e[r]);return t}return e}function qki(e){let t=c8n(e),r=Re(t);return`sha256:${D3f.createHash("sha256").update(r).digest("hex")}`}var D3f;var Vki=A(()=>{vr();D3f=require("crypto")});function yQe(e){if(!e)return{shellSettings:{},envVars:{},hasHooks:!1,hasClaudeMd:!1};let t={};for(let s of Xpu){let a=e[s],l;if(typeof a==="string")l=a;else if(a!==null&&typeof a== diff --git a/extractions/v2.1.234/calls/api-hello.txt b/extractions/v2.1.234/calls/api-hello.txt new file mode 100644 index 0000000..4a543eb --- /dev/null +++ b/extractions/v2.1.234/calls/api-hello.txt @@ -0,0 +1,38 @@ +# anchor: /api/hello +# occurrences shown: 12 + +--- offset 18914588 --- + string };. export = classes;.}.# {[name]s}..To install dependencies:..```bash.bun install.```..To start a development server:..```bash.bun dev.```..To run for production:..```bash.bun start.```..This project was created using `bun init` in bun v{[bunVersion]s}. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime..import { serve } from "bun";.import index from "./index.html";..const server = serve({. routes: {. // Serve index.html for all unmatched routes.. "/*": index,.. "/api/hello": {. async GET(req) {. return Response.json({. message: "Hello, world!",. method: "GET",. });. },. async PUT(req) {. return Response.json({. message: "Hello, world!",. method: "PUT",. });. },. },.. "/api/hello/:name": async req => {. const name = req.params.name;. return Response.json({. message: `Hello, ${name}!`,. });. },. },.. development: process.env.NODE_ENV !== "production" && {. // Enable browser hot reloading in development. hmr: true,.. // Echo console logs from the browser to the server. console: true,. },.});..console.log(`.... Server running at ${server.url}`);.src/App.tsximport { APITester } from "./APITester";.import "./index.css";..import logo from "./logo.svg";.import reactLogo from "./react.svg";..export function App() {. return (.
{. const name = req.params.name;. return Response.json({. message: `Hello, ${name}!`,. });. },. },.. development: process.env.NODE_ENV !== "production" && {. // Enable browser hot reloading in development. hmr: true,.. // Echo console logs from the browser to the server. console: true,. },.});..console.log(`.... Server running at ${server.url}`);.src/App.tsximport { APITester } from "./APITester";.import "./index.css";..import logo from "./logo.svg";.import reactLogo from "./react.svg";..export function App() {. return (.
.
. Bun Logo. React Logo.
..

Bun + React

.

. Edit src/App.tsx and save to + +--- offset 18920623 --- +ta = await res.json();. responseInputRef.current!.value = JSON.stringify(data, null, 2);. } catch (error) {. responseInputRef.current!.value = String(error);. }. };.. return (.

.
. . . .
.