chore: generate
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -21,42 +21,47 @@ export interface Interface {
|
|||||||
|
|
||||||
export class Service extends Context.Service<Service, Interface>()("@opencode/v2/PluginBoot") {}
|
export class Service extends Context.Service<Service, Interface>()("@opencode/v2/PluginBoot") {}
|
||||||
|
|
||||||
export const layer: Layer.Layer<Service, never, Catalog.Service | PluginV2.Service | AuthV2.Service | Npm.Service> = Layer.effect(
|
export const layer: Layer.Layer<Service, never, Catalog.Service | PluginV2.Service | AuthV2.Service | Npm.Service> =
|
||||||
Service,
|
Layer.effect(
|
||||||
Effect.gen(function* () {
|
Service,
|
||||||
const catalog = yield* Catalog.Service
|
Effect.gen(function* () {
|
||||||
const plugin = yield* PluginV2.Service
|
const catalog = yield* Catalog.Service
|
||||||
const auth = yield* AuthV2.Service
|
const plugin = yield* PluginV2.Service
|
||||||
const npm = yield* Npm.Service
|
const auth = yield* AuthV2.Service
|
||||||
const done = yield* Deferred.make<void>()
|
const npm = yield* Npm.Service
|
||||||
|
const done = yield* Deferred.make<void>()
|
||||||
|
|
||||||
const add = Effect.fn("PluginBoot.add")(function* (input: Plugin) {
|
const add = Effect.fn("PluginBoot.add")(function* (input: Plugin) {
|
||||||
yield* plugin.add({
|
yield* plugin.add({
|
||||||
id: input.id,
|
id: input.id,
|
||||||
effect: input.effect.pipe(
|
effect: input.effect.pipe(
|
||||||
Effect.provideService(Catalog.Service, catalog),
|
Effect.provideService(Catalog.Service, catalog),
|
||||||
Effect.provideService(AuthV2.Service, auth),
|
Effect.provideService(AuthV2.Service, auth),
|
||||||
Effect.provideService(Npm.Service, npm),
|
Effect.provideService(Npm.Service, npm),
|
||||||
),
|
),
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
|
|
||||||
const boot = Effect.gen(function* () {
|
const boot = Effect.gen(function* () {
|
||||||
yield* add(EnvPlugin)
|
yield* add(EnvPlugin)
|
||||||
yield* add(AuthPlugin)
|
yield* add(AuthPlugin)
|
||||||
for (const item of ProviderPlugins) {
|
for (const item of ProviderPlugins) {
|
||||||
yield* add(item)
|
yield* add(item)
|
||||||
}
|
}
|
||||||
yield* add(ModelsDevPlugin)
|
yield* add(ModelsDevPlugin)
|
||||||
}).pipe(Effect.withSpan("PluginBoot.boot"))
|
}).pipe(Effect.withSpan("PluginBoot.boot"))
|
||||||
|
|
||||||
yield* boot.pipe(Effect.exit, Effect.flatMap((exit) => Deferred.done(done, exit)), Effect.forkScoped)
|
yield* boot.pipe(
|
||||||
|
Effect.exit,
|
||||||
|
Effect.flatMap((exit) => Deferred.done(done, exit)),
|
||||||
|
Effect.forkScoped,
|
||||||
|
)
|
||||||
|
|
||||||
return Service.of({
|
return Service.of({
|
||||||
wait: () => Deferred.await(done),
|
wait: () => Deferred.await(done),
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
export const defaultLayer = layer.pipe(
|
export const defaultLayer = layer.pipe(
|
||||||
Layer.provide(Catalog.defaultLayer),
|
Layer.provide(Catalog.defaultLayer),
|
||||||
|
|||||||
@@ -9,13 +9,15 @@ export const ModelGroup = HttpApiGroup.make("v2.model")
|
|||||||
HttpApiEndpoint.get("models", "/api/model", {
|
HttpApiEndpoint.get("models", "/api/model", {
|
||||||
query: InstanceQuery,
|
query: InstanceQuery,
|
||||||
success: Schema.Array(ModelV2.Info),
|
success: Schema.Array(ModelV2.Info),
|
||||||
}).annotateMerge(instanceQueryOpenApi).annotateMerge(
|
})
|
||||||
OpenApi.annotations({
|
.annotateMerge(instanceQueryOpenApi)
|
||||||
identifier: "v2.model.list",
|
.annotateMerge(
|
||||||
summary: "List v2 models",
|
OpenApi.annotations({
|
||||||
description: "Retrieve available v2 models ordered by release date.",
|
identifier: "v2.model.list",
|
||||||
}),
|
summary: "List v2 models",
|
||||||
),
|
description: "Retrieve available v2 models ordered by release date.",
|
||||||
|
}),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.annotateMerge(
|
.annotateMerge(
|
||||||
OpenApi.annotations({
|
OpenApi.annotations({
|
||||||
|
|||||||
@@ -10,13 +10,15 @@ export const ProviderGroup = HttpApiGroup.make("v2.provider")
|
|||||||
HttpApiEndpoint.get("providers", "/api/provider", {
|
HttpApiEndpoint.get("providers", "/api/provider", {
|
||||||
query: InstanceQuery,
|
query: InstanceQuery,
|
||||||
success: Schema.Array(ProviderV2.Info),
|
success: Schema.Array(ProviderV2.Info),
|
||||||
}).annotateMerge(instanceQueryOpenApi).annotateMerge(
|
})
|
||||||
OpenApi.annotations({
|
.annotateMerge(instanceQueryOpenApi)
|
||||||
identifier: "v2.provider.list",
|
.annotateMerge(
|
||||||
summary: "List v2 providers",
|
OpenApi.annotations({
|
||||||
description: "Retrieve active v2 AI providers so clients can show provider availability and configuration.",
|
identifier: "v2.provider.list",
|
||||||
}),
|
summary: "List v2 providers",
|
||||||
),
|
description: "Retrieve active v2 AI providers so clients can show provider availability and configuration.",
|
||||||
|
}),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.add(
|
.add(
|
||||||
HttpApiEndpoint.get("provider", "/api/provider/:providerID", {
|
HttpApiEndpoint.get("provider", "/api/provider/:providerID", {
|
||||||
@@ -24,13 +26,16 @@ export const ProviderGroup = HttpApiGroup.make("v2.provider")
|
|||||||
query: InstanceQuery,
|
query: InstanceQuery,
|
||||||
success: ProviderV2.Info,
|
success: ProviderV2.Info,
|
||||||
error: ApiNotFoundError,
|
error: ApiNotFoundError,
|
||||||
}).annotateMerge(instanceQueryOpenApi).annotateMerge(
|
})
|
||||||
OpenApi.annotations({
|
.annotateMerge(instanceQueryOpenApi)
|
||||||
identifier: "v2.provider.get",
|
.annotateMerge(
|
||||||
summary: "Get v2 provider",
|
OpenApi.annotations({
|
||||||
description: "Retrieve a single v2 AI provider so clients can inspect its availability and endpoint settings.",
|
identifier: "v2.provider.get",
|
||||||
}),
|
summary: "Get v2 provider",
|
||||||
),
|
description:
|
||||||
|
"Retrieve a single v2 AI provider so clients can inspect its availability and endpoint settings.",
|
||||||
|
}),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.annotateMerge(
|
.annotateMerge(
|
||||||
OpenApi.annotations({
|
OpenApi.annotations({
|
||||||
|
|||||||
+121
-62
@@ -7610,7 +7610,27 @@
|
|||||||
"get": {
|
"get": {
|
||||||
"tags": ["v2 models"],
|
"tags": ["v2 models"],
|
||||||
"operationId": "v2.model.list",
|
"operationId": "v2.model.list",
|
||||||
"parameters": [],
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance",
|
||||||
|
"in": "query",
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"directory": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"workspace": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"required": false,
|
||||||
|
"style": "deepObject",
|
||||||
|
"explode": true
|
||||||
|
}
|
||||||
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "Success",
|
"description": "Success",
|
||||||
@@ -7640,7 +7660,27 @@
|
|||||||
"get": {
|
"get": {
|
||||||
"tags": ["v2 providers"],
|
"tags": ["v2 providers"],
|
||||||
"operationId": "v2.provider.list",
|
"operationId": "v2.provider.list",
|
||||||
"parameters": [],
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "instance",
|
||||||
|
"in": "query",
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"directory": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"workspace": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"required": false,
|
||||||
|
"style": "deepObject",
|
||||||
|
"explode": true
|
||||||
|
}
|
||||||
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "Success",
|
"description": "Success",
|
||||||
@@ -7678,6 +7718,25 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"required": true
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "instance",
|
||||||
|
"in": "query",
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"directory": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"workspace": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"required": false,
|
||||||
|
"style": "deepObject",
|
||||||
|
"explode": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -9014,12 +9073,6 @@
|
|||||||
{
|
{
|
||||||
"$ref": "#/components/schemas/EventSessionError"
|
"$ref": "#/components/schemas/EventSessionError"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"$ref": "#/components/schemas/EventInstallationUpdated"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$ref": "#/components/schemas/EventInstallationUpdate-available"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"$ref": "#/components/schemas/EventQuestionAsked"
|
"$ref": "#/components/schemas/EventQuestionAsked"
|
||||||
},
|
},
|
||||||
@@ -9095,6 +9148,12 @@
|
|||||||
{
|
{
|
||||||
"$ref": "#/components/schemas/EventPtyDeleted"
|
"$ref": "#/components/schemas/EventPtyDeleted"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/EventInstallationUpdated"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/EventInstallationUpdate-available"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"$ref": "#/components/schemas/EventMessageUpdated"
|
"$ref": "#/components/schemas/EventMessageUpdated"
|
||||||
},
|
},
|
||||||
@@ -11313,12 +11372,6 @@
|
|||||||
{
|
{
|
||||||
"$ref": "#/components/schemas/EventSessionError"
|
"$ref": "#/components/schemas/EventSessionError"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"$ref": "#/components/schemas/EventInstallationUpdated"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$ref": "#/components/schemas/EventInstallationUpdate-available"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"$ref": "#/components/schemas/EventQuestionAsked"
|
"$ref": "#/components/schemas/EventQuestionAsked"
|
||||||
},
|
},
|
||||||
@@ -11394,6 +11447,12 @@
|
|||||||
{
|
{
|
||||||
"$ref": "#/components/schemas/EventPtyDeleted"
|
"$ref": "#/components/schemas/EventPtyDeleted"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/EventInstallationUpdated"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/EventInstallationUpdate-available"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"$ref": "#/components/schemas/EventMessageUpdated"
|
"$ref": "#/components/schemas/EventMessageUpdated"
|
||||||
},
|
},
|
||||||
@@ -16469,54 +16528,6 @@
|
|||||||
"required": ["id", "type", "properties"],
|
"required": ["id", "type", "properties"],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"EventInstallationUpdated": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"type": "string",
|
|
||||||
"enum": ["installation.updated"]
|
|
||||||
},
|
|
||||||
"properties": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"version": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": ["version"],
|
|
||||||
"additionalProperties": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": ["id", "type", "properties"],
|
|
||||||
"additionalProperties": false
|
|
||||||
},
|
|
||||||
"EventInstallationUpdate-available": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"type": "string",
|
|
||||||
"enum": ["installation.update-available"]
|
|
||||||
},
|
|
||||||
"properties": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"version": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": ["version"],
|
|
||||||
"additionalProperties": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": ["id", "type", "properties"],
|
|
||||||
"additionalProperties": false
|
|
||||||
},
|
|
||||||
"EventQuestionAsked": {
|
"EventQuestionAsked": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -17033,6 +17044,54 @@
|
|||||||
"required": ["id", "type", "properties"],
|
"required": ["id", "type", "properties"],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
|
"EventInstallationUpdated": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["installation.updated"]
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"version": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["version"],
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["id", "type", "properties"],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"EventInstallationUpdate-available": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["installation.update-available"]
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"version": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["version"],
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["id", "type", "properties"],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
"EventMessageUpdated": {
|
"EventMessageUpdated": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|||||||
Reference in New Issue
Block a user