Anthropic Client
Path:
_archive/loom-stale-pre-sprint-snapshot/src/execution/anthropic-client.tsRelative: loom-stale-pre-sprint-snapshot/src/execution/anthropic-client.tsSubproject: _archiveCategory: archivedLines: 92Bytes: 3,295Imports: 3Exports: 2
Content Preview
- import { withRetry } from "../lib/retry";
- import { LoomError } from "../types/errors";
- import type { AssistantBlock, ModelClient, ModelRequest, ModelTurn, StopReason } from "./ports";
- /**
- * Anthropic Messages API client (fetch-based, workerd-native).
- * Shapes per current docs (verified 2026-06): POST /v1/messages with
- * x-api-key + anthropic-version headers; response carries content blocks
- * (text | tool_use), stop_reason, and usage.{input,output}_tokens.
- * Retry policy (HC-6): 429/5xx/net