The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 06:00 UTC
| 1 | # yaml-language-server: $schema=../../tools/ai-codegen/codegen.schema.json |
| 2 | # Pinned to anthropic-sdk-typescript sdk-v0.135.0 (2026-10-15). To update, pin the latest release |
| 3 | # commit and regenerate from the repo root: |
| 4 | # nix develop -c node packages/tools/ai-codegen/src/bin.ts generate --provider anthropic |
| 5 | spec: https://raw.githubusercontent.com/anthropics/anthropic-sdk-typescript/04a4c28c70de498d6d0e930e43edb5edb9ac545e/scripts/mock-spec.json.gz |
| 6 | output: src/Generated.ts |
| 7 | # Generate the public API only; the bundled spec also covers admin and managed-agent endpoints. |
| 8 | includePaths: |
| 9 | - /v1/complete |
| 10 | - /v1/files |
| 11 | - /v1/messages |
| 12 | - /v1/models |
| 13 | - /v1/skills |
| 14 | name: AnthropicClient |
| 15 | patches: |
| 16 | # Upstream reuses released Skills names for reshaped schemas. Move the current wire schemas to |
| 17 | # *Resource names, and point the operations at them, so the released contracts below keep their names. |
| 18 | - patches/current-skills.json |
| 19 | # Released Skills contracts, before upstream renamed and reshaped them. Copied verbatim from the |
| 20 | # spec generated on 2026-02-20 (anthropic-sdk-typescript fdaa72bed1). Regenerate with: |
| 21 | # curl -sL 'https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic%2Fanthropic-29a6b7ba51942cd606e5bf4b533e5aac1bef42f6d4b1f7f45f756304cf676782.yml' \ |
| 22 | # | jq '[.components.schemas | to_entries[] | select(.key | test("^(Beta)?((Create|Get|Delete)Skill(Version)?Response|api__schemas__skills__Skill|Skill(Version)?|List(Skills|SkillVersions)Response)$")) | {op: "add", path: "/components/schemas/\(.key)", value: .value}]' \ |
| 23 | # > packages/ai/anthropic/patches/legacy-skills.json |
| 24 | - patches/legacy-skills.json |
| 25 | # Keep usage fields optional when the API or Anthropic-compatible gateways omit them (#8464, #9963). |
| 26 | - '[{"op":"replace","path":"/components/schemas/BetaUsage/required","value":["input_tokens","output_tokens"]},{"op":"replace","path":"/components/schemas/Usage/required","value":["cache_creation","cache_creation_input_tokens","cache_read_input_tokens","input_tokens","output_tokens","service_tier"]},{"op":"replace","path":"/components/schemas/BetaMessageDeltaUsage/required","value":["output_tokens"]},{"op":"replace","path":"/components/schemas/MessageDeltaUsage/required","value":["cache_creation_input_tokens","cache_read_input_tokens","input_tokens","output_tokens"]}]' |
| 27 | # Keep message metadata optional when the API omits it. |
| 28 | - '[{"op":"replace","path":"/components/schemas/BetaMessage/required","value":["id","type","role","content","model","stop_reason","stop_sequence","usage"]},{"op":"replace","path":"/components/schemas/Message/required","value":["id","type","role","content","model","stop_reason","stop_sequence","usage","container"]},{"op":"replace","path":"/components/schemas/BetaMessageDeltaEvent/required","value":["delta","type","usage"]},{"op":"replace","path":"/components/schemas/BetaMessageDelta/required","value":["stop_reason","stop_sequence"]}]' |
| 29 | # Keep fields added since the released schemas optional, so responses without them still decode |
| 30 | # (the thinking token estimate needs a beta header; older API versions and gateways omit the rest). |
| 31 | - '[{"op":"replace","path":"/components/schemas/BetaThinkingContentBlockDelta/required","value":["thinking","type"]},{"op":"replace","path":"/components/schemas/BetaCompactionContentBlockDelta/required","value":["content","type"]},{"op":"replace","path":"/components/schemas/BetaResponseCompactionBlock/required","value":["content","type"]},{"op":"replace","path":"/components/schemas/ModelInfo/required","value":["created_at","display_name","id","type"]},{"op":"replace","path":"/components/schemas/BetaModelInfo/required","value":["created_at","display_name","id","type"]},{"op":"replace","path":"/components/schemas/Container/required","value":["expires_at","id"]},{"op":"replace","path":"/components/schemas/MessageDelta/required","value":["container","stop_reason","stop_sequence"]}]' |
| 32 | # Make citations optional in text blocks (API may omit this field). |
| 33 | - '[{"op":"replace","path":"/components/schemas/ResponseTextBlock/required","value":["text","type"]},{"op":"replace","path":"/components/schemas/BetaResponseTextBlock/required","value":["text","type"]}]' |
| 34 | # Make model optional in BetaMessageIterationUsage (gateways and older responses may omit it) |
| 35 | - '[{"op":"replace","path":"/components/schemas/BetaMessageIterationUsage/required","value":["cache_creation","cache_creation_input_tokens","cache_read_input_tokens","input_tokens","output_tokens","type"]}]' |
| 36 | # Decode every error envelope and let the status code decide the error, as released. |
| 37 | collapseErrorResponses: true |
| 38 | # Released schemas that no operation references: stream events, batch results, memory tool |
| 39 | # commands, multipart bodies, and the deprecated Skills contracts patched in above. |
| 40 | includeSchemas: |
| 41 | - BetaContentBlockDeltaEvent |
| 42 | - BetaContentBlockStartEvent |
| 43 | - BetaContentBlockStopEvent |
| 44 | - BetaMessageDeltaEvent |
| 45 | - BetaMessageStartEvent |
| 46 | - BetaMessageStopEvent |
| 47 | - ContentBlockDeltaEvent |
| 48 | - ContentBlockStartEvent |
| 49 | - ContentBlockStopEvent |
| 50 | - MessageDeltaEvent |
| 51 | - MessageStartEvent |
| 52 | - MessageStopEvent |
| 53 | - CitationsDelta |
| 54 | - InputJsonContentBlockDelta |
| 55 | - MessageDelta |
| 56 | - SignatureContentBlockDelta |
| 57 | - TextContentBlockDelta |
| 58 | - ThinkingContentBlockDelta |
| 59 | - BetaCanceledResult |
| 60 | - BetaErroredResult |
| 61 | - BetaExpiredResult |
| 62 | - BetaSucceededResult |
| 63 | - CanceledResult |
| 64 | - ErroredResult |
| 65 | - ExpiredResult |
| 66 | - SucceededResult |
| 67 | - BetaMemoryTool_20250818_CreateCommand |
| 68 | - BetaMemoryTool_20250818_DeleteCommand |
| 69 | - BetaMemoryTool_20250818_InsertCommand |
| 70 | - BetaMemoryTool_20250818_RenameCommand |
| 71 | - BetaMemoryTool_20250818_StrReplaceCommand |
| 72 | - BetaMemoryTool_20250818_ViewCommand |
| 73 | - BetaBody_create_skill_v1_skills_post |
| 74 | - BetaBody_create_skill_version_v1_skills__skill_id__versions_post |
| 75 | - Body_create_skill_v1_skills_post |
| 76 | - Body_create_skill_version_v1_skills__skill_id__versions_post |
| 77 | - Betaapi__schemas__skills__Skill |
| 78 | - BetaCreateSkillResponse |
| 79 | - BetaCreateSkillVersionResponse |
| 80 | - BetaDeleteSkillResponse |
| 81 | - BetaDeleteSkillVersionResponse |
| 82 | - BetaGetSkillResponse |
| 83 | - BetaGetSkillVersionResponse |
| 84 | - CreateSkillResponse |
| 85 | - CreateSkillVersionResponse |
| 86 | - DeleteSkillResponse |
| 87 | - DeleteSkillVersionResponse |
| 88 | - GetSkillResponse |
| 89 | - GetSkillVersionResponse |
| 90 | - Skill |
| 91 | - SkillVersion |
| 92 | - BetaSkill |
| 93 | - BetaSkillVersion |
| 94 | - ListSkillsResponse |
| 95 | - ListSkillVersionsResponse |
| 96 | - BetaListSkillsResponse |
| 97 | - BetaListSkillVersionsResponse |
| 98 | header: | |
| 99 | /** |
| 100 | * @stability unstable |
| 101 | * @since 4.0.0 |
| 102 | */ |
| 103 | excludeAnnotations: |
| 104 | - examples |
| 105 | disableAdditionalProperties: true |
| 106 | replacements: |
| 107 | # Schema.Unknown doesn't work with Schema.toCodecJson (used by HttpClientResponse.schemaBodyJson) |
| 108 | # Replace with Schema.Json which properly handles arbitrary JSON values |
| 109 | - from: "Schema.Record(Schema.String, Schema.Unknown)" |
| 110 | to: "Schema.Record(Schema.String, Schema.Json)" |
| 111 | - from: "{ readonly [x: string]: unknown }" |
| 112 | to: "{ readonly [x: string]: Schema.Json }" |
| 113 | # Index signature in struct rest pattern |
| 114 | - from: "readonly [x: string]: unknown" |
| 115 | to: "readonly [x: string]: Schema.Json" |
| 116 | # Keep the released types: tool input examples accept any value, and beta headers accept a string |
| 117 | - from: "export type BetaJsonValue = Schema.Json" |
| 118 | to: "export type BetaJsonValue = unknown" |
| 119 | - from: 'export const BetaJsonValue = Schema.Json.annotate({ "expected": "JSON value", "identifier": "BetaJsonValue" })' |
| 120 | to: "export const BetaJsonValue = Schema.Unknown" |
| 121 | - from: "export type JsonValue = Schema.Json" |
| 122 | to: "export type JsonValue = unknown" |
| 123 | - from: 'export const JsonValue = Schema.Json.annotate({ "expected": "JSON value", "identifier": "JsonValue" })' |
| 124 | to: "export const JsonValue = Schema.Unknown" |
| 125 | - from: 'readonly "anthropic-beta"?: ReadonlyArray<AnthropicBeta>' |
| 126 | to: 'readonly "anthropic-beta"?: string | ReadonlyArray<AnthropicBeta>' |
| 127 | - from: '"anthropic-beta": Schema.optionalKey(Schema.Array(AnthropicBeta).annotate(' |
| 128 | to: '"anthropic-beta": Schema.optionalKey(Schema.Union([Schema.String, Schema.Array(AnthropicBeta)]).annotate(' |