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-06 16:18:56 -04:00
committed by GitHub
co-authored by Dax Raad
parent d603eed5a1
commit e57d9ca390
107 changed files with 2596 additions and 1987 deletions
@@ -70,7 +70,8 @@ describe("GitLabPlugin", () => {
yield* aisdk.runSDK({
model: ModelV2.Info.make({
...ModelV2.Info.empty(ProviderV2.ID.make("gitlab"), ModelV2.ID.make("claude")),
api: { id: ModelV2.ID.make("claude"), type: "aisdk", package: "test-provider" },
modelID: ModelV2.ID.make("claude"),
package: "aisdk:test-provider",
}),
package: "gitlab-ai-provider",
options: { name: "gitlab" },
@@ -107,7 +108,8 @@ describe("GitLabPlugin", () => {
yield* aisdk.runSDK({
model: ModelV2.Info.make({
...ModelV2.Info.empty(ProviderV2.ID.make("gitlab"), ModelV2.ID.make("claude")),
api: { id: ModelV2.ID.make("claude"), type: "aisdk", package: "test-provider" },
modelID: ModelV2.ID.make("claude"),
package: "aisdk:test-provider",
}),
package: "gitlab-ai-provider",
options: { name: "gitlab" },
@@ -132,7 +134,8 @@ describe("GitLabPlugin", () => {
yield* aisdk.runSDK({
model: ModelV2.Info.make({
...ModelV2.Info.empty(ProviderV2.ID.make("gitlab"), ModelV2.ID.make("claude")),
api: { id: ModelV2.ID.make("claude"), type: "aisdk", package: "test-provider" },
modelID: ModelV2.ID.make("claude"),
package: "aisdk:test-provider",
}),
package: "gitlab-ai-provider",
options: {
@@ -173,7 +176,8 @@ describe("GitLabPlugin", () => {
const result = yield* aisdk.runSDK({
model: ModelV2.Info.make({
...ModelV2.Info.empty(ProviderV2.ID.make("gitlab"), ModelV2.ID.make("claude")),
api: { id: ModelV2.ID.make("claude"), type: "aisdk", package: "test-provider" },
modelID: ModelV2.ID.make("claude"),
package: "aisdk:test-provider",
}),
package: "@ai-sdk/openai",
options: { name: "gitlab" },
@@ -192,11 +196,10 @@ describe("GitLabPlugin", () => {
const result = yield* aisdk.runLanguage({
model: ModelV2.Info.make({
...ModelV2.Info.empty(ProviderV2.ID.make("gitlab"), ModelV2.ID.make("duo-workflow-custom")),
api: { id: ModelV2.ID.make("duo-workflow-custom"), type: "aisdk", package: "test-provider" },
request: {
headers: {},
body: { workflowRef: "ref", workflowDefinition: "definition" },
},
modelID: ModelV2.ID.make("duo-workflow-custom"),
package: "aisdk:test-provider",
headers: {},
settings: { workflowRef: "ref", workflowDefinition: "definition" },
}),
sdk: {
workflowChat: (id: string, options: unknown) => {
@@ -227,7 +230,8 @@ describe("GitLabPlugin", () => {
const result = yield* aisdk.runLanguage({
model: ModelV2.Info.make({
...ModelV2.Info.empty(ProviderV2.ID.make("gitlab"), ModelV2.ID.make("duo-workflow-exact")),
api: { id: ModelV2.ID.make("duo-workflow-exact"), type: "aisdk", package: "test-provider" },
modelID: ModelV2.ID.make("duo-workflow-exact"),
package: "aisdk:test-provider",
}),
sdk: {
workflowChat: (id: string, options: unknown) => {
@@ -245,7 +249,7 @@ describe("GitLabPlugin", () => {
}),
)
it.effect("uses provider feature flags instead of request feature flags", () =>
it.effect("uses provider feature flags instead of model settings feature flags", () =>
Effect.gen(function* () {
const plugin = yield* PluginV2.Service
const aisdk = yield* AISDK.Service
@@ -254,11 +258,10 @@ describe("GitLabPlugin", () => {
yield* aisdk.runLanguage({
model: ModelV2.Info.make({
...ModelV2.Info.empty(ProviderV2.ID.make("gitlab"), ModelV2.ID.make("duo-workflow-custom")),
api: { id: ModelV2.ID.make("duo-workflow-custom"), type: "aisdk", package: "test-provider" },
request: {
headers: {},
body: { featureFlags: { request_flag: true } },
},
modelID: ModelV2.ID.make("duo-workflow-custom"),
package: "aisdk:test-provider",
headers: {},
settings: { featureFlags: { request_flag: true } },
}),
sdk: {
workflowChat: (id: string, options: unknown) => {
@@ -282,8 +285,10 @@ describe("GitLabPlugin", () => {
yield* aisdk.runLanguage({
model: ModelV2.Info.make({
...ModelV2.Info.empty(ProviderV2.ID.make("gitlab"), ModelV2.ID.make("claude")),
api: { id: ModelV2.ID.make("claude"), type: "aisdk", package: "test-provider" },
request: { headers: { h: "v" }, body: {} },
modelID: ModelV2.ID.make("claude"),
package: "aisdk:test-provider",
headers: { h: "v" },
settings: {},
}),
sdk: {
workflowChat: () => undefined,