Dax Raad 1 kuukausi sitten
vanhempi
sitoutus
040700dbc4
2 muutettua tiedostoa jossa 8 lisäystä ja 0 poistoa
  1. 5 0
      packages/opencode/src/plugin/index.ts
  2. 3 0
      packages/plugin/src/index.ts

+ 5 - 0
packages/opencode/src/plugin/index.ts

@@ -34,6 +34,11 @@ export namespace Plugin {
       project: Instance.project,
       worktree: Instance.worktree,
       directory: Instance.directory,
+      get serverUrl(): URL {
+        throw new Error("Server URL is no longer supported in plugins")
+      },
+      // @ts-expect-error
+      $: typeof Bun === "undefined" ? undefined : Bun.$,
     }
 
     for (const plugin of INTERNAL_PLUGINS) {

+ 3 - 0
packages/plugin/src/index.ts

@@ -12,6 +12,7 @@ import type {
   Config,
 } from "@opencode-ai/sdk"
 
+import type { BunShell } from "./shell.js"
 import { type ToolDefinition } from "./tool.js"
 
 export * from "./tool.js"
@@ -27,6 +28,8 @@ export type PluginInput = {
   project: Project
   directory: string
   worktree: string
+  serverUrl: URL
+  $: BunShell
 }
 
 export type Plugin = (input: PluginInput) => Promise<Hooks>