feat(core): flatten provider config and load native packages (#35563)

Co-authored-by: Dax Raad <d@ironbay.co>
This commit is contained in:
Shoubhit Dash 2026-07-07 01:48:56 +05:30 committed by GitHub
commit e57d9ca390
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
107 changed files with 2593 additions and 1984 deletions

View file

@ -4,6 +4,7 @@ import { Agent } from "../src/agent.js"
import { FileSystem } from "../src/filesystem.js"
import { Model } from "../src/model.js"
import { Project } from "../src/project.js"
import { Provider } from "../src/provider.js"
import { Pty } from "../src/pty.js"
import { Question } from "../src/question.js"
import { Session } from "../src/session.js"
@ -18,6 +19,19 @@ describe("contract hygiene", () => {
expect(Schema.encodeSync(Value)({ value: undefined })).toEqual({})
})
test("model defaults and provider overlays preserve public invariants", () => {
const id = Model.ID.make("model")
expect(Model.Info.empty(Provider.ID.make("provider"), id)).toMatchObject({ modelID: id, variants: [] })
expect(() =>
Schema.decodeUnknownSync(Provider.Info)({
id: "provider",
name: "Provider",
package: "native",
settings: { invalid: 1n },
}),
).toThrow()
})
test("todo status and priority preserve arbitrary strings", () => {
const decode = Schema.decodeUnknownSync(SessionTodo.Info)
expect(decode({ content: "ship", status: "waiting", priority: "urgent" })).toEqual({
@ -39,7 +53,7 @@ describe("contract hygiene", () => {
Model.Ref,
Model.Capabilities,
Model.Cost,
Model.Api,
Model.Variant,
Project.Current,
Project.Directory,
Project.DirectoriesInput,