Add AI/ML API (aimlapi.com) as a built-in provider - #2
Merged
Conversation
Return typed results from JSONL parsers, add file context during replay, and classify torn tails explicitly.
This is incremental work towards I2 in the harness-v2.md plan.
Part of I2, "passive events and watch buffering," in packages/agent/docs/harness-v2.md.
paintBox ran every visible text row through compositeTuiLine on every frame, rebuilding each row string via ANSI/grapheme segmentation even when nothing changed. Full-width boxes painting onto untouched rows now assign the source line reference directly; padding is unnecessary since rows are written with erase-line and the final width clamp still truncates over-wide lines. Cuts alt-screen per-frame allocation churn 9-18x (test/render-churn-bench.ts) and removes the fullscreen RSS penalty over regular mode on short sessions (previously +11-29 MiB loaded, +26-36 MiB peak).
npm 12 returns an object keyed by package name instead of an array, which broke packPackage with a TypeError.
Auto-detect DeepSeek in generated and runtime compatibility metadata so built-in and custom models use the supported token limit field.
…#6847) Add missing ToolExecutionEndEvent, ToolExecutionStartEvent, and ToolExecutionUpdateEvent type exports to packages/coding-agent/src/index.ts so they are available to consumers of the package. Fixes earendil-works#6687
Registers "aimlapi" alongside the other built-in providers: a live-catalog fetcher in generate-models.ts (api.aimlapi.com/v1/models?include=pricing already returns per-model pricing, including tiered/threshold pricing and a reasoning-phase signal used to set the `reasoning` flag), the generated provider shard/catalog wiring, the aimlapi.ts provider factory (OpenAI-completions compatible, AIMLAPI_API_KEY), and referral/attribution headers (X-AIMLAPI-Partner-ID, X-AIMLAPI-Source) gated the same way OpenRouter's own attribution headers already are, behind install telemetry.
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.
Summary
aimlapias a built-in provider, following the same pattern asopenrouter/vercel-ai-gateway(OpenAI-completions compatible,AIMLAPI_API_KEY).generate-models.tsfromapi.aimlapi.com/v1/models?include=pricing(353 chat models at time of writing), mapping AI/ML API's per-unit pricing schema into pi'sModelCost(including tiered/threshold pricing and areasoning-phase signal used to set thereasoningflag).X-AIMLAPI-Partner-ID,X-AIMLAPI-Source) are added inprovider-attribution.ts, gated behind install telemetry the same way OpenRouter's own attribution headers already are.all.ts/models.generated.ts, so it also surfaces first in the interactive provider picker.Test plan
npm run generate-models --strict(real run, live network) completed cleanly and picked upaimlapi: 353 modelsalongside every other provider, with no unrelated diff to other providers' generated shards.npm run check(biome, ts-imports, shrinkwrap,tsgo --noEmit, browser-smoke) passes via the pre-commit hook.