builtins.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. export * as BuiltInTools from "./builtins"
  2. import { Layer } from "effect"
  3. import { BashTool } from "./bash"
  4. import { ApplyPatchTool } from "./apply-patch"
  5. import { EditTool } from "./edit"
  6. import { GlobTool } from "./glob"
  7. import { GrepTool } from "./grep"
  8. import { QuestionTool } from "./question"
  9. import { ReadTool } from "./read"
  10. import { ReadToolFileSystem } from "./read-filesystem"
  11. import { SkillTool } from "./skill"
  12. import { TodoWriteTool } from "./todowrite"
  13. import { WebFetchTool } from "./webfetch"
  14. import { WebSearchTool } from "./websearch"
  15. import { WriteTool } from "./write"
  16. /**
  17. * Composes only the shipped Location-scoped built-in tool transforms.
  18. * Each tool retains its implementation and focused tests independently. Dynamic
  19. * MCP and plugin tools later use separate scoped canonical registrations, while
  20. * provider/model filtering belongs to a future materialization phase rather
  21. * than this static list. The caller intentionally supplies shared Location
  22. * services once to this merged set.
  23. *
  24. * TODO: Port the remaining launch-follow-up leaves deliberately: edit fuzzy
  25. * parity, task, LSP,
  26. * repo_clone, repo_overview, plan_exit, and Rune/code mode. Keep MCP and plugin
  27. * transforms separate from this static built-in list.
  28. */
  29. export const locationLayer = Layer.mergeAll(
  30. ApplyPatchTool.layer,
  31. BashTool.layer,
  32. EditTool.layer,
  33. GlobTool.layer,
  34. GrepTool.layer,
  35. QuestionTool.layer,
  36. ReadTool.layer.pipe(Layer.provide(ReadToolFileSystem.layer)),
  37. SkillTool.layer,
  38. TodoWriteTool.layer,
  39. WebFetchTool.layer,
  40. WebSearchTool.layer.pipe(Layer.provide(WebSearchTool.defaultConfigLayer)),
  41. WriteTool.layer,
  42. )