tool.ts 704 B

1234567891011121314151617
  1. export * as Tool from "./tool"
  2. import { Effect, Scope } from "effect"
  3. import type { NativeTool } from "../tool/native"
  4. export { Failure, make } from "../tool/native"
  5. export type { Any, Content, Context, Executable } from "../tool/native"
  6. export interface Service {
  7. /**
  8. * Attach same-process tools to this OpenCode instance for the current Scope.
  9. * Location tools with the same name take precedence where they are installed.
  10. * Closing the Scope removes the tools immediately, so calls that have not
  11. * started settling may fail because the tool is no longer available.
  12. */
  13. readonly attach: (tools: Readonly<Record<string, NativeTool.Any>>) => Effect.Effect<void, never, Scope.Scope>
  14. }