From ada5b31bb0c58b05126bef7564edd0b3f591782b Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" Date: Tue, 9 Jun 2026 16:12:42 +0000 Subject: [PATCH] chore: generate --- packages/core/src/config/plugin/reference.ts | 4 +- packages/core/src/filesystem.ts | 4 +- .../core/test/location-filesystem.test.ts | 7 +--- packages/core/test/reference.test.ts | 6 ++- packages/opencode/src/session/prompt.ts | 4 +- .../test/server/httpapi-reference.test.ts | 30 +++++++------- packages/opencode/test/tool/glob.test.ts | 1 - packages/opencode/test/tool/grep.test.ts | 1 - packages/opencode/test/tool/read.test.ts | 1 - packages/sdk/openapi.json | 41 +++++++++++++++++++ packages/tui/test/fixture/tui-sdk.ts | 3 +- 11 files changed, 69 insertions(+), 33 deletions(-) diff --git a/packages/core/src/config/plugin/reference.ts b/packages/core/src/config/plugin/reference.ts index 4b95dc009..81e0804b4 100644 --- a/packages/core/src/config/plugin/reference.ts +++ b/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", diff --git a/packages/core/src/filesystem.ts b/packages/core/src/filesystem.ts index f9f855246..dfe15d33e 100644 --- a/packages/core/src/filesystem.ts +++ b/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)) diff --git a/packages/core/test/location-filesystem.test.ts b/packages/core/test/location-filesystem.test.ts index c1bff1bd5..3e9faa873 100644 --- a/packages/core/test/location-filesystem.test.ts +++ b/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)), ), ) - }) diff --git a/packages/core/test/reference.test.ts b/packages/core/test/reference.test.ts index ccea121d8..58b28bf06 100644 --- a/packages/core/test/reference.test.ts +++ b/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, diff --git a/packages/opencode/src/session/prompt.ts b/packages/opencode/src/session/prompt.ts index 2cf4103cc..20940e370 100644 --- a/packages/opencode/src/session/prompt.ts +++ b/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 = [ - { type: "text", text: template }, - ] + const parts: Types.DeepMutable = [{ type: "text", text: template }] const files = ConfigMarkdown.files(template) const seen = new Set() yield* Effect.forEach( diff --git a/packages/opencode/test/server/httpapi-reference.test.ts b/packages/opencode/test/server/httpapi-reference.test.ts index eebff8f8e..0c939bb70 100644 --- a/packages/opencode/test/server/httpapi-reference.test.ts +++ b/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", }, - ]) + }, + ]) }) }) diff --git a/packages/opencode/test/tool/glob.test.ts b/packages/opencode/test/tool/glob.test.ts index 047dd4aa1..12fd648d6 100644 --- a/packages/opencode/test/tool/glob.test.ts +++ b/packages/opencode/test/tool/glob.test.ts @@ -133,5 +133,4 @@ describe("tool.glob", () => { } }), ) - }) diff --git a/packages/opencode/test/tool/grep.test.ts b/packages/opencode/test/tool/grep.test.ts index 817f06a18..55143afff 100644 --- a/packages/opencode/test/tool/grep.test.ts +++ b/packages/opencode/test/tool/grep.test.ts @@ -203,5 +203,4 @@ describe("tool.grep", () => { expect(requests.find((req) => req.permission === "external_directory")).toBeUndefined() }), ) - }) diff --git a/packages/opencode/test/tool/read.test.ts b/packages/opencode/test/tool/read.test.ts index c13633ae4..cd7038efb 100644 --- a/packages/opencode/test/tool/read.test.ts +++ b/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", () => { diff --git a/packages/sdk/openapi.json b/packages/sdk/openapi.json index 126a0f3f4..3c0f536cb 100644 --- a/packages/sdk/openapi.json +++ b/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": { diff --git a/packages/tui/test/fixture/tui-sdk.ts b/packages/tui/test/fixture/tui-sdk.ts index f327afb52..d18228fca 100644 --- a/packages/tui/test/fixture/tui-sdk.ts +++ b/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" })