Browse Source

chore: generate

opencode-agent[bot] 3 tháng trước cách đây
mục cha
commit
faf8713053

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
packages/core/src/models-snapshot.js


+ 36 - 31
packages/core/src/plugin/boot.ts

@@ -21,42 +21,47 @@ export interface Interface {
 
 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(
-  Service,
-  Effect.gen(function* () {
-    const catalog = yield* Catalog.Service
-    const plugin = yield* PluginV2.Service
-    const auth = yield* AuthV2.Service
-    const npm = yield* Npm.Service
-    const done = yield* Deferred.make<void>()
+export const layer: Layer.Layer<Service, never, Catalog.Service | PluginV2.Service | AuthV2.Service | Npm.Service> =
+  Layer.effect(
+    Service,
+    Effect.gen(function* () {
+      const catalog = yield* Catalog.Service
+      const plugin = yield* PluginV2.Service
+      const auth = yield* AuthV2.Service
+      const npm = yield* Npm.Service
+      const done = yield* Deferred.make<void>()
 
-    const add = Effect.fn("PluginBoot.add")(function* (input: Plugin) {
-      yield* plugin.add({
-        id: input.id,
-        effect: input.effect.pipe(
-          Effect.provideService(Catalog.Service, catalog),
-          Effect.provideService(AuthV2.Service, auth),
-          Effect.provideService(Npm.Service, npm),
-        ),
+      const add = Effect.fn("PluginBoot.add")(function* (input: Plugin) {
+        yield* plugin.add({
+          id: input.id,
+          effect: input.effect.pipe(
+            Effect.provideService(Catalog.Service, catalog),
+            Effect.provideService(AuthV2.Service, auth),
+            Effect.provideService(Npm.Service, npm),
+          ),
+        })
       })
-    })
 
-    const boot = Effect.gen(function* () {
-      yield* add(EnvPlugin)
-      yield* add(AuthPlugin)
-      for (const item of ProviderPlugins) {
-        yield* add(item)
-      }
-      yield* add(ModelsDevPlugin)
-    }).pipe(Effect.withSpan("PluginBoot.boot"))
+      const boot = Effect.gen(function* () {
+        yield* add(EnvPlugin)
+        yield* add(AuthPlugin)
+        for (const item of ProviderPlugins) {
+          yield* add(item)
+        }
+        yield* add(ModelsDevPlugin)
+      }).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({
-      wait: () => Deferred.await(done),
-    })
-  }),
-)
+      return Service.of({
+        wait: () => Deferred.await(done),
+      })
+    }),
+  )
 
 export const defaultLayer = layer.pipe(
   Layer.provide(Catalog.defaultLayer),

+ 9 - 7
packages/opencode/src/server/routes/instance/httpapi/groups/v2/model.ts

@@ -9,13 +9,15 @@ export const ModelGroup = HttpApiGroup.make("v2.model")
     HttpApiEndpoint.get("models", "/api/model", {
       query: InstanceQuery,
       success: Schema.Array(ModelV2.Info),
-    }).annotateMerge(instanceQueryOpenApi).annotateMerge(
-      OpenApi.annotations({
-        identifier: "v2.model.list",
-        summary: "List v2 models",
-        description: "Retrieve available v2 models ordered by release date.",
-      }),
-    ),
+    })
+      .annotateMerge(instanceQueryOpenApi)
+      .annotateMerge(
+        OpenApi.annotations({
+          identifier: "v2.model.list",
+          summary: "List v2 models",
+          description: "Retrieve available v2 models ordered by release date.",
+        }),
+      ),
   )
   .annotateMerge(
     OpenApi.annotations({

+ 19 - 14
packages/opencode/src/server/routes/instance/httpapi/groups/v2/provider.ts

@@ -10,13 +10,15 @@ export const ProviderGroup = HttpApiGroup.make("v2.provider")
     HttpApiEndpoint.get("providers", "/api/provider", {
       query: InstanceQuery,
       success: Schema.Array(ProviderV2.Info),
-    }).annotateMerge(instanceQueryOpenApi).annotateMerge(
-      OpenApi.annotations({
-        identifier: "v2.provider.list",
-        summary: "List v2 providers",
-        description: "Retrieve active v2 AI providers so clients can show provider availability and configuration.",
-      }),
-    ),
+    })
+      .annotateMerge(instanceQueryOpenApi)
+      .annotateMerge(
+        OpenApi.annotations({
+          identifier: "v2.provider.list",
+          summary: "List v2 providers",
+          description: "Retrieve active v2 AI providers so clients can show provider availability and configuration.",
+        }),
+      ),
   )
   .add(
     HttpApiEndpoint.get("provider", "/api/provider/:providerID", {
@@ -24,13 +26,16 @@ export const ProviderGroup = HttpApiGroup.make("v2.provider")
       query: InstanceQuery,
       success: ProviderV2.Info,
       error: ApiNotFoundError,
-    }).annotateMerge(instanceQueryOpenApi).annotateMerge(
-      OpenApi.annotations({
-        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(instanceQueryOpenApi)
+      .annotateMerge(
+        OpenApi.annotations({
+          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(
     OpenApi.annotations({

+ 121 - 62
packages/sdk/openapi.json

@@ -7610,7 +7610,27 @@
       "get": {
         "tags": ["v2 models"],
         "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": {
           "200": {
             "description": "Success",
@@ -7640,7 +7660,27 @@
       "get": {
         "tags": ["v2 providers"],
         "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": {
           "200": {
             "description": "Success",
@@ -7678,6 +7718,25 @@
               "type": "string"
             },
             "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": {
@@ -9014,12 +9073,6 @@
           {
             "$ref": "#/components/schemas/EventSessionError"
           },
-          {
-            "$ref": "#/components/schemas/EventInstallationUpdated"
-          },
-          {
-            "$ref": "#/components/schemas/EventInstallationUpdate-available"
-          },
           {
             "$ref": "#/components/schemas/EventQuestionAsked"
           },
@@ -9095,6 +9148,12 @@
           {
             "$ref": "#/components/schemas/EventPtyDeleted"
           },
+          {
+            "$ref": "#/components/schemas/EventInstallationUpdated"
+          },
+          {
+            "$ref": "#/components/schemas/EventInstallationUpdate-available"
+          },
           {
             "$ref": "#/components/schemas/EventMessageUpdated"
           },
@@ -11313,12 +11372,6 @@
               {
                 "$ref": "#/components/schemas/EventSessionError"
               },
-              {
-                "$ref": "#/components/schemas/EventInstallationUpdated"
-              },
-              {
-                "$ref": "#/components/schemas/EventInstallationUpdate-available"
-              },
               {
                 "$ref": "#/components/schemas/EventQuestionAsked"
               },
@@ -11394,6 +11447,12 @@
               {
                 "$ref": "#/components/schemas/EventPtyDeleted"
               },
+              {
+                "$ref": "#/components/schemas/EventInstallationUpdated"
+              },
+              {
+                "$ref": "#/components/schemas/EventInstallationUpdate-available"
+              },
               {
                 "$ref": "#/components/schemas/EventMessageUpdated"
               },
@@ -16469,54 +16528,6 @@
         "required": ["id", "type", "properties"],
         "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": {
         "type": "object",
         "properties": {
@@ -17033,6 +17044,54 @@
         "required": ["id", "type", "properties"],
         "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": {
         "type": "object",
         "properties": {

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác