Explorar o código

chore: generate

opencode-agent[bot] hai 2 meses
pai
achega
ada5b31bb0

+ 3 - 1
packages/core/src/config/plugin/reference.ts

@@ -30,7 +30,9 @@ export const Plugin = {
           local(entry)
             ? new Reference.LocalSource({
                 type: "local",
-                path: AbsolutePath.make(localPath(directory, global.home, typeof entry === "string" ? entry : entry.path)),
+                path: AbsolutePath.make(
+                  localPath(directory, global.home, typeof entry === "string" ? entry : entry.path),
+                ),
               })
             : new Reference.GitSource({
                 type: "git",

+ 1 - 3
packages/core/src/filesystem.ts

@@ -627,6 +627,4 @@ export const layer = Layer.effect(
   }),
 )
 
-export const locationLayer = layer.pipe(
-  Layer.provide(Ripgrep.defaultLayer),
-)
+export const locationLayer = layer.pipe(Layer.provide(Ripgrep.defaultLayer))

+ 1 - 6
packages/core/test/location-filesystem.test.ts

@@ -13,11 +13,7 @@ import { tmpdir } from "./fixture/tmpdir"
 import { location } from "./fixture/location"
 import { it } from "./lib/effect"
 
-function provide(
-  directory: string,
-  filesystem = FSUtil.defaultLayer,
-  data = Global.Path.data,
-) {
+function provide(directory: string, filesystem = FSUtil.defaultLayer, data = Global.Path.data) {
   return Effect.provide(
     FileSystem.layer.pipe(
       Layer.provide(
@@ -447,5 +443,4 @@ describe("FileSystem", () => {
       }).pipe(provide(directory)),
     ),
   )
-
 })

+ 5 - 1
packages/core/test/reference.test.ts

@@ -44,7 +44,11 @@ describe("Reference", () => {
       yield* update((editor) => editor.add("sdk", source))
 
       expect(yield* references.list()).toEqual([
-        new Reference.Info({ name: "sdk", path: AbsolutePath.make(Repository.cachePath(Global.Path.repos, repository)), source }),
+        new Reference.Info({
+          name: "sdk",
+          path: AbsolutePath.make(Repository.cachePath(Global.Path.repos, repository)),
+          source,
+        }),
       ])
     }).pipe(
       Effect.scoped,

+ 1 - 3
packages/opencode/src/session/prompt.ts

@@ -139,9 +139,7 @@ export const layer = Layer.effect(
 
     const resolvePromptParts = Effect.fn("SessionPrompt.resolvePromptParts")(function* (template: string) {
       const ctx = yield* InstanceState.context
-      const parts: Types.DeepMutable<PromptInput["parts"]> = [
-        { type: "text", text: template },
-      ]
+      const parts: Types.DeepMutable<PromptInput["parts"]> = [{ type: "text", text: template }]
       const files = ConfigMarkdown.files(template)
       const seen = new Set<string>()
       yield* Effect.forEach(

+ 15 - 15
packages/opencode/test/server/httpapi-reference.test.ts

@@ -32,23 +32,23 @@ describe("reference HttpApi", () => {
     const body = await response.json()
     expect(body).toMatchObject({ location: { directory: tmp.path } })
     expect(body.data).toEqual([
-        {
-          name: "docs",
+      {
+        name: "docs",
+        path: path.join(tmp.path, "docs"),
+        source: {
+          type: "local",
           path: path.join(tmp.path, "docs"),
-          source: {
-            type: "local",
-            path: path.join(tmp.path, "docs"),
-          },
         },
-        {
-          name: "effect",
-          path: path.join(Global.Path.repos, "github.com", "Effect-TS", "effect"),
-          source: {
-            type: "git",
-            repository: "Effect-TS/effect",
-            branch: "main",
-          },
+      },
+      {
+        name: "effect",
+        path: path.join(Global.Path.repos, "github.com", "Effect-TS", "effect"),
+        source: {
+          type: "git",
+          repository: "Effect-TS/effect",
+          branch: "main",
         },
-      ])
+      },
+    ])
   })
 })

+ 0 - 1
packages/opencode/test/tool/glob.test.ts

@@ -133,5 +133,4 @@ describe("tool.glob", () => {
       }
     }),
   )
-
 })

+ 0 - 1
packages/opencode/test/tool/grep.test.ts

@@ -203,5 +203,4 @@ describe("tool.grep", () => {
       expect(requests.find((req) => req.permission === "external_directory")).toBeUndefined()
     }),
   )
-
 })

+ 0 - 1
packages/opencode/test/tool/read.test.ts

@@ -254,7 +254,6 @@ describe("tool.read external_directory permission", () => {
       expect(ext).toBeUndefined()
     }),
   )
-
 })
 
 describe("tool.read env file permissions", () => {

+ 41 - 0
packages/sdk/openapi.json

@@ -12316,6 +12316,9 @@
           {
             "$ref": "#/components/schemas/EventPermissionV2Replied"
           },
+          {
+            "$ref": "#/components/schemas/EventReferenceUpdated"
+          },
           {
             "$ref": "#/components/schemas/EventFileWatcherUpdated"
           },
@@ -16259,6 +16262,25 @@
                 "required": ["id", "type", "properties"],
                 "additionalProperties": false
               },
+              {
+                "type": "object",
+                "properties": {
+                  "id": {
+                    "type": "string",
+                    "pattern": "^evt_"
+                  },
+                  "type": {
+                    "type": "string",
+                    "enum": ["reference.updated"]
+                  },
+                  "properties": {
+                    "type": "object",
+                    "properties": {}
+                  }
+                },
+                "required": ["id", "type", "properties"],
+                "additionalProperties": false
+              },
               {
                 "type": "object",
                 "properties": {
@@ -27673,6 +27695,25 @@
         "required": ["id", "type", "properties"],
         "additionalProperties": false
       },
+      "EventReferenceUpdated": {
+        "type": "object",
+        "properties": {
+          "id": {
+            "type": "string",
+            "pattern": "^evt_"
+          },
+          "type": {
+            "type": "string",
+            "enum": ["reference.updated"]
+          },
+          "properties": {
+            "type": "object",
+            "properties": {}
+          }
+        },
+        "required": ["id", "type", "properties"],
+        "additionalProperties": false
+      },
       "EventFileWatcherUpdated": {
         "type": "object",
         "properties": {

+ 2 - 1
packages/tui/test/fixture/tui-sdk.ts

@@ -60,7 +60,8 @@ export function createFetch(override?: FetchHandler) {
     if (url.pathname === "/experimental/console") return json({ consoleManagedProviders: [], switchableOrgCount: 0 })
     if (url.pathname === "/path") return json({ home: "", state: "", config: "", worktree, directory })
     if (url.pathname === "/project/current") return json({ id: "proj_test" })
-    if (url.pathname === "/api/reference") return json({ location: { directory, project: { id: "proj_test", directory } }, data: [] })
+    if (url.pathname === "/api/reference")
+      return json({ location: { directory, project: { id: "proj_test", directory } }, data: [] })
     if (url.pathname === "/provider") return json({ all: [], default: {}, connected: [] })
     if (url.pathname === "/session") return json([])
     if (url.pathname === "/vcs") return json({ branch: "main" })