Przeglądaj źródła

Merge branch 'dev' into kit/effect-sync-event

Kit Langton 1 tydzień temu
rodzic
commit
e2c41dce99

+ 1 - 0
bun.lock

@@ -450,6 +450,7 @@
       "version": "1.4.3",
       "version": "1.4.3",
       "dependencies": {
       "dependencies": {
         "@opencode-ai/sdk": "workspace:*",
         "@opencode-ai/sdk": "workspace:*",
+        "effect": "catalog:",
         "zod": "catalog:",
         "zod": "catalog:",
       },
       },
       "devDependencies": {
       "devDependencies": {

+ 1 - 2
packages/opencode/src/tool/registry.ts

@@ -30,7 +30,6 @@ import { Glob } from "../util/glob"
 import path from "path"
 import path from "path"
 import { pathToFileURL } from "url"
 import { pathToFileURL } from "url"
 import { Effect, Layer, Context } from "effect"
 import { Effect, Layer, Context } from "effect"
-import { EffectLogger } from "@/effect/logger"
 import { FetchHttpClient, HttpClient } from "effect/unstable/http"
 import { FetchHttpClient, HttpClient } from "effect/unstable/http"
 import { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"
 import { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"
 import * as CrossSpawnSpawner from "@/effect/cross-spawn-spawner"
 import * as CrossSpawnSpawner from "@/effect/cross-spawn-spawner"
@@ -137,7 +136,7 @@ export namespace ToolRegistry {
                 Effect.gen(function* () {
                 Effect.gen(function* () {
                   const pluginCtx: PluginToolContext = {
                   const pluginCtx: PluginToolContext = {
                     ...toolCtx,
                     ...toolCtx,
-                    ask: (req) => Effect.runPromise(toolCtx.ask(req).pipe(Effect.provide(EffectLogger.layer))),
+                    ask: (req) => toolCtx.ask(req),
                     directory: ctx.directory,
                     directory: ctx.directory,
                     worktree: ctx.worktree,
                     worktree: ctx.worktree,
                   }
                   }

+ 1 - 0
packages/plugin/package.json

@@ -18,6 +18,7 @@
   ],
   ],
   "dependencies": {
   "dependencies": {
     "@opencode-ai/sdk": "workspace:*",
     "@opencode-ai/sdk": "workspace:*",
+    "effect": "catalog:",
     "zod": "catalog:"
     "zod": "catalog:"
   },
   },
   "peerDependencies": {
   "peerDependencies": {

+ 2 - 1
packages/plugin/src/tool.ts

@@ -1,4 +1,5 @@
 import { z } from "zod"
 import { z } from "zod"
+import { Effect } from "effect"
 
 
 export type ToolContext = {
 export type ToolContext = {
   sessionID: string
   sessionID: string
@@ -16,7 +17,7 @@ export type ToolContext = {
   worktree: string
   worktree: string
   abort: AbortSignal
   abort: AbortSignal
   metadata(input: { title?: string; metadata?: { [key: string]: any } }): void
   metadata(input: { title?: string; metadata?: { [key: string]: any } }): void
-  ask(input: AskInput): Promise<void>
+  ask(input: AskInput): Effect.Effect<void>
 }
 }
 
 
 type AskInput = {
 type AskInput = {