chore: generate

This commit is contained in:
opencode-agent[bot] 2026-06-21 12:07:16 +00:00
parent c780d7cee7
commit 02687b6324
13 changed files with 107 additions and 122 deletions

View File

@ -38,8 +38,7 @@ export const Native = Schema.Struct({
export const Api = Schema.Union([AISDK, Native]).pipe(Schema.toTaggedUnion("type"))
export type Api = typeof Api.Type
export type MutableApi<T extends Api = Api> = T extends Api
? Omit<Types.DeepMutable<T>, "settings"> &
(undefined extends T["settings"] ? { settings?: any } : { settings: any })
? Omit<Types.DeepMutable<T>, "settings"> & (undefined extends T["settings"] ? { settings?: any } : { settings: any })
: never
export const Request = Schema.Struct({

View File

@ -61,9 +61,7 @@ describe("ConfigProviderPlugin.Plugin", () => {
...ConfigProviderPlugin.Plugin,
effect: ConfigProviderPlugin.Plugin.effect(
host({ catalog: catalogHost(catalog), integration: integrationHost(integrations) }),
).pipe(
Effect.provideService(Config.Service, config),
),
).pipe(Effect.provideService(Config.Service, config)),
})
const model = required(yield* catalog.model.get(providerID, modelID))
@ -122,9 +120,7 @@ describe("ConfigProviderPlugin.Plugin", () => {
...ConfigProviderPlugin.Plugin,
effect: ConfigProviderPlugin.Plugin.effect(
host({ catalog: catalogHost(catalog), integration: integrationHost(integrations) }),
).pipe(
Effect.provideService(Config.Service, config),
),
).pipe(Effect.provideService(Config.Service, config)),
})
const model = required(yield* catalog.model.get(providerID, modelID))
@ -225,9 +221,7 @@ describe("ConfigProviderPlugin.Plugin", () => {
...ConfigProviderPlugin.Plugin,
effect: ConfigProviderPlugin.Plugin.effect(
host({ catalog: catalogHost(catalog), integration: integrationHost(integrations) }),
).pipe(
Effect.provideService(Config.Service, config),
),
).pipe(Effect.provideService(Config.Service, config)),
})
const provider = required(yield* catalog.provider.get(providerID))

View File

@ -255,7 +255,9 @@ function method(value: Integration.Method) {
}
}
function internalMethod(value: IntegrationOAuthMethod | IntegrationKeyMethod | IntegrationEnvMethod): Integration.Method {
function internalMethod(
value: IntegrationOAuthMethod | IntegrationKeyMethod | IntegrationEnvMethod,
): Integration.Method {
if (value.type === "env") return value
if (value.type === "key") return value
return {

View File

@ -35,7 +35,9 @@ describe("AnthropicPlugin", () => {
const catalog = yield* Catalog.Service
yield* addPlugin(plugin, AnthropicPlugin)
yield* catalog.transform((catalog) => catalog.provider.update(provider("openai").id, () => {}))
expect(required(yield* catalog.provider.get(ProviderV2.ID.openai)).request.headers["anthropic-beta"]).toBeUndefined()
expect(
required(yield* catalog.provider.get(ProviderV2.ID.openai)).request.headers["anthropic-beta"],
).toBeUndefined()
}),
)

View File

@ -157,7 +157,8 @@ describe("GithubCopilotPlugin", () => {
catalog.model.update(ProviderV2.ID.make("github-copilot"), ModelV2.ID.make("gpt-5-chat-latest"), () => {})
})
expect(
required(yield* catalog.model.get(ProviderV2.ID.make("github-copilot"), ModelV2.ID.make("gpt-5-chat-latest"))).enabled,
required(yield* catalog.model.get(ProviderV2.ID.make("github-copilot"), ModelV2.ID.make("gpt-5-chat-latest")))
.enabled,
).toBe(false)
}),
)
@ -172,7 +173,8 @@ describe("GithubCopilotPlugin", () => {
catalog.model.update(ProviderV2.ID.make("custom-copilot"), ModelV2.ID.make("gpt-5-chat-latest"), () => {})
})
expect(
required(yield* catalog.model.get(ProviderV2.ID.make("custom-copilot"), ModelV2.ID.make("gpt-5-chat-latest"))).enabled,
required(yield* catalog.model.get(ProviderV2.ID.make("custom-copilot"), ModelV2.ID.make("gpt-5-chat-latest")))
.enabled,
).toBe(true)
}),
)

View File

@ -90,7 +90,7 @@ export function addPlugin(plugin: PluginV2.Interface, definition: Plugin<any>) {
const npm = yield* Effect.serviceOption(Npm.Service)
const effect =
typeof definition.effect === "function"
? definition.effect(
? definition.effect(
host({
aisdk: aisdkHost(plugin),
...(Option.isSome(catalog) ? { catalog: catalogHost(catalog.value) } : {}),

View File

@ -118,7 +118,9 @@ describe("OpenAIPlugin", () => {
catalog.model.update(item.id, ModelV2.ID.make("gpt-5-chat-latest"), () => {})
})
expect(required(yield* catalog.model.get(ProviderV2.ID.openai, ModelV2.ID.make("gpt-5"))).enabled).toBe(true)
expect(required(yield* catalog.model.get(ProviderV2.ID.openai, ModelV2.ID.make("gpt-5-chat-latest"))).enabled).toBe(false)
expect(
required(yield* catalog.model.get(ProviderV2.ID.openai, ModelV2.ID.make("gpt-5-chat-latest"))).enabled,
).toBe(false)
}),
)
@ -133,7 +135,8 @@ describe("OpenAIPlugin", () => {
catalog.model.update(item.id, ModelV2.ID.make("gpt-5-chat-latest"), () => {})
})
expect(
required(yield* catalog.model.get(ProviderV2.ID.make("custom-openai"), ModelV2.ID.make("gpt-5-chat-latest"))).enabled,
required(yield* catalog.model.get(ProviderV2.ID.make("custom-openai"), ModelV2.ID.make("gpt-5-chat-latest")))
.enabled,
).toBe(true)
}),
)

View File

@ -22,9 +22,7 @@ const locationLayer = Layer.succeed(
const pluginWithIntegrations = (catalog: Catalog.Interface, integrations: Integration.Interface) => ({
...OpencodePlugin,
effect: OpencodePlugin.effect(
host({ catalog: catalogHost(catalog), integration: integrationHost(integrations) }),
),
effect: OpencodePlugin.effect(host({ catalog: catalogHost(catalog), integration: integrationHost(integrations) })),
})
describe("OpencodePlugin", () => {
@ -83,7 +81,9 @@ describe("OpencodePlugin", () => {
})
})
expect(required(yield* catalog.provider.get(ProviderV2.ID.opencode)).request.body.apiKey).toBe("public")
expect(required(yield* catalog.model.get(ProviderV2.ID.opencode, ModelV2.ID.make("output-only"))).enabled).toBe(true)
expect(required(yield* catalog.model.get(ProviderV2.ID.opencode, ModelV2.ID.make("output-only"))).enabled).toBe(
true,
)
}),
),
)

View File

@ -92,12 +92,15 @@ describe("OpenRouterPlugin", () => {
})
expect(
required(yield* catalog.model.get(ProviderV2.ID.make("openrouter"), ModelV2.ID.make("openai/gpt-5-chat"))).enabled,
required(yield* catalog.model.get(ProviderV2.ID.make("openrouter"), ModelV2.ID.make("openai/gpt-5-chat")))
.enabled,
).toBe(false)
expect(
required(yield* catalog.model.get(ProviderV2.ID.make("openrouter"), ModelV2.ID.make("openai/gpt-5"))).enabled,
).toBe(true)
expect(required(yield* catalog.model.get(ProviderV2.ID.openai, ModelV2.ID.make("openai/gpt-5-chat"))).enabled).toBe(true)
expect(
required(yield* catalog.model.get(ProviderV2.ID.openai, ModelV2.ID.make("openai/gpt-5-chat"))).enabled,
).toBe(true)
}),
)
@ -111,8 +114,9 @@ describe("OpenRouterPlugin", () => {
catalog.model.update(ProviderV2.ID.make("custom-openrouter"), ModelV2.ID.make("gpt-5-chat-latest"), () => {})
})
expect(
required(yield* catalog.model.get(ProviderV2.ID.make("custom-openrouter"), ModelV2.ID.make("gpt-5-chat-latest")))
.enabled,
required(
yield* catalog.model.get(ProviderV2.ID.make("custom-openrouter"), ModelV2.ID.make("gpt-5-chat-latest")),
).enabled,
).toBe(true)
}),
)

View File

@ -44,7 +44,9 @@ describe("VercelPlugin", () => {
expect(required(yield* catalog.provider.get(ProviderV2.ID.make("vercel"))).request.headers).not.toHaveProperty(
"HTTP-Referer",
)
expect(required(yield* catalog.provider.get(ProviderV2.ID.make("vercel"))).request.headers).not.toHaveProperty("X-Title")
expect(required(yield* catalog.provider.get(ProviderV2.ID.make("vercel"))).request.headers).not.toHaveProperty(
"X-Title",
)
}),
)

View File

@ -23,10 +23,7 @@ export const V2Command = effectCmd({
small: Object.fromEntries(
yield* Effect.all(
all.map((provider) =>
Effect.map(
catalog.model.small(provider.id),
(model) => [provider.id, model?.id] as const,
),
Effect.map(catalog.model.small(provider.id), (model) => [provider.id, model?.id] as const),
),
{ concurrency: "unbounded" },
),

View File

@ -6,7 +6,6 @@ export type ClientOptions = {
export type Event =
| EventModelsDevRefreshed
| EventPluginAdded
| EventIntegrationUpdated
| EventCatalogUpdated
| EventSessionCreated
@ -53,6 +52,7 @@ export type Event =
| EventInstallationUpdated
| EventInstallationUpdateAvailable
| EventFileEdited
| EventPluginAdded
| EventPermissionV2Asked
| EventPermissionV2Replied
| EventReferenceUpdated
@ -737,13 +737,6 @@ export type GlobalEvent = {
[key: string]: unknown
}
}
| {
id: string
type: "plugin.added"
properties: {
id: string
}
}
| {
id: string
type: "integration.updated"
@ -1264,6 +1257,13 @@ export type GlobalEvent = {
file: string
}
}
| {
id: string
type: "plugin.added"
properties: {
id: string
}
}
| {
id: string
type: "permission.v2.asked"
@ -4003,7 +4003,7 @@ export type ModelV2Info = {
}
}>
time: {
released: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN"
released: number
}
cost: Array<{
tier?: {
@ -4228,14 +4228,6 @@ export type EventModelsDevRefreshed = {
}
}
export type EventPluginAdded = {
id: string
type: "plugin.added"
properties: {
id: string
}
}
export type EventIntegrationUpdated = {
id: string
type: "integration.updated"
@ -4802,6 +4794,14 @@ export type EventFileEdited = {
}
}
export type EventPluginAdded = {
id: string
type: "plugin.added"
properties: {
id: string
}
}
export type EventPermissionV2Asked = {
id: string
type: "permission.v2.asked"

View File

@ -14481,9 +14481,6 @@
{
"$ref": "#/components/schemas/EventModels-devRefreshed"
},
{
"$ref": "#/components/schemas/EventPluginAdded"
},
{
"$ref": "#/components/schemas/EventIntegrationUpdated"
},
@ -14622,6 +14619,9 @@
{
"$ref": "#/components/schemas/EventFileEdited"
},
{
"$ref": "#/components/schemas/EventPluginAdded"
},
{
"$ref": "#/components/schemas/EventPermissionV2Asked"
},
@ -16645,31 +16645,6 @@
"required": ["id", "type", "properties"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^evt_"
},
"type": {
"type": "string",
"enum": ["plugin.added"]
},
"properties": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
},
"required": ["id"],
"additionalProperties": false
}
},
"required": ["id", "type", "properties"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
@ -18453,6 +18428,31 @@
"required": ["id", "type", "properties"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^evt_"
},
"type": {
"type": "string",
"enum": ["plugin.added"]
},
"properties": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
},
"required": ["id"],
"additionalProperties": false
}
},
"required": ["id", "type", "properties"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
@ -26900,27 +26900,7 @@
"type": "object",
"properties": {
"released": {
"anyOf": [
{
"type": "number"
},
{
"type": "string",
"enum": ["NaN"]
},
{
"type": "string",
"enum": ["Infinity"]
},
{
"type": "string",
"enum": ["-Infinity"]
},
{
"type": "string",
"enum": ["Infinity", "-Infinity", "NaN"]
}
]
"type": "number"
}
},
"required": ["released"],
@ -27643,31 +27623,6 @@
"required": ["id", "type", "properties"],
"additionalProperties": false
},
"EventPluginAdded": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^evt_"
},
"type": {
"type": "string",
"enum": ["plugin.added"]
},
"properties": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
},
"required": ["id"],
"additionalProperties": false
}
},
"required": ["id", "type", "properties"],
"additionalProperties": false
},
"EventIntegrationUpdated": {
"type": "object",
"properties": {
@ -29443,6 +29398,31 @@
"required": ["id", "type", "properties"],
"additionalProperties": false
},
"EventPluginAdded": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^evt_"
},
"type": {
"type": "string",
"enum": ["plugin.added"]
},
"properties": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
},
"required": ["id"],
"additionalProperties": false
}
},
"required": ["id", "type", "properties"],
"additionalProperties": false
},
"EventPermissionV2Asked": {
"type": "object",
"properties": {