Repository navigation
Anthropic SDK 1.x and TypeScript 7 - #165
Merged
Merged
Conversation
Supersedes the Dependabot bump (#163): @anthropic-ai/sdk 0.133.0 -> 1.3.0, typescript 6.0.3 -> 7.0.2, both pinned exactly. - SDK 1.x sends `apiKey` as `Authorization: Bearer`. The provider keeps sending the key as `x-api-key`, the SDK's documented hand-set header with `Authorization` omitted; `apiKey` stays passed so no credential chain is resolved in the browser. ai.spec and pilot.spec now also assert that no bearer goes along. - TypeScript 7: `row` in wordText() typed as Element | null (it narrowed to never), and followNavigation()'s filter narrows to defined files (filter(Boolean) no longer does). - AGENTS.md: the dev tooling pins as they are. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014YZFmFjqqPw2HLYh1MvmaA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #163 (Dependabot, "Bump the major group with 2 updates"). That PR fails CI and conflicts with main. This branch applies the same two bumps on top of current main and fixes what they break.
Bumps
@anthropic-ai/sdk0.133.0 -> 1.3.0 (exact pin, as in Bump the major group across 1 directory with 2 updates #163)typescript6.0.3 -> 7.0.2 (exact pin, as in Bump the major group across 1 directory with 2 updates #163)The key header (SDK 1.x)
SDK 1.0 moves to API version
2026-10-21and now sendsapiKeyasAuthorization: Bearer <key>(seeClientOptions.apiKeyin the SDK). Because of that,x-api-keywas missing andtests/ai.spec.js:83andtests/pilot.spec.js:93failed.createProvider()insrc/shell/llm-provider.mjsnow passes the key the way the SDK documents for a hand-set key:defaultHeaders: { "x-api-key": key, authorization: null }. That is the header the Messages API has always read a key from.apiKeyis still passed, so the SDK treats it as the client's credential and never tries its default credential chain in the browser. The workspace header is unchanged.ai.spec.jsandpilot.spec.jskeep assertingx-api-key, and now also assert that noauthorizationheader goes along, so the key is not sent twice.llm-provider.spec.jschecks the constructor options field by field, so it now expects the newdefaultHeaders.TypeScript 7 typecheck
src/shell/attachments.mjs: inwordText(),let row = nullwas narrowed tonever(TS2339 onrow.children). It now carries a/** @type {Element | null} */annotation.src/shell/deep-link.mjs: infollowNavigation(),.filter(Boolean)no longer narrows outundefined(TS18048). It is now.filter((file) => file !== undefined), which TypeScript infers as a type predicate.Also
src/vendor/agent/) does not use the SDK, so nothing needed re-vendoring._vendor/partial-json-parseris still at the pathai-common.mjsimports.Run locally
npm run lint,npm run typecheck,npm run test:unit(75/75): all greennpm run build,npm run check:size: green (site 156.5 MB of 220 MB)ai.spec.js,pilot.spec.js,llm-provider.spec.js73/73;link.spec.js,shell.spec.js,examples.spec.js65/65Generated by Claude Code