feat(@browser-ai/core): rename input usage#157
Merged
jakobhoeg merged 1 commit intojakobhoeg:mainfrom Mar 10, 2026
Merged
Conversation
|
@mikechao is attempting to deploy a commit to the browser-ai OSS Program Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Owner
|
Thank you @mikechao! Mind resolving the merge conficts? I just pushed a small refactor |
890c1aa to
8d635c5
Compare
Contributor
Author
|
Hi @jakobhoeg I updated the main branch and rebased these changes on top it. |
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.
This PR addresses #150
Because
@types/dom-chromium-aihas not yet shipped the new names, yet, dom-chromium-ai-augmentation.d.ts was created to fill this gap.src/dom-chromium-ai-augmentation.d.ts(new)Merges the four new members into the existing global
LanguageModelinterface via TypeScript declaration merging. No types are duplicated or overridden — the new names simply sit alongside the old ones that@types/dom-chromium-aialready provides. Once the upstream package ships the new names, this file can be deleted with no other changes required.Runtime changes
contextoverflowwhen"oncontextoverflow" in session, falls back toquotaoverflowfor older Chrome builds.getContextUsage()andgetContextWindow()readcontextUsage/contextWindowwith?? inputUsage/?? inputQuotaas a fallback, so both old and new Chrome builds work correctly.onContextOverflowis the new option name;onQuotaOverflowis retained as a@deprecatedalias that resolves through the same code path.Public API changes (
@browser-ai/core)getContextUsage()/getContextWindow()— new methods (replacegetInputUsage()/getInputQuota())onContextOverflow— new setting (replacesonQuotaOverflow)@deprecatedaliases for backward compatibilityOther files updated
examples/next-hybrid— updated to use new method and option namesdocs/content/docs/ai-sdk-v6/core/api-reference.mdx— updated API referencetest/session-manager.test.ts— 33 tests, all passing (3 new tests cover fallback paths and deprecated alias behaviour)