feat(core): attach global native tools (#30832)

This commit is contained in:
Kit Langton 2026-06-04 23:12:17 -04:00 committed by GitHub
commit 64dc6d39ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
39 changed files with 647 additions and 71 deletions

View file

@ -2,7 +2,7 @@ import { describe, expect } from "bun:test"
import { Tool, ToolFailure } from "@opencode-ai/llm"
import { PermissionV2 } from "@opencode-ai/core/permission"
import { SessionV2 } from "@opencode-ai/core/session"
import { ToolRegistry } from "@opencode-ai/core/tool-registry"
import { ToolRegistry } from "@opencode-ai/core/tool/registry"
import { Effect, Exit, Layer, Schema, Scope } from "effect"
import { testEffect } from "./lib/effect"
@ -24,7 +24,7 @@ const permission = Layer.succeed(
list: () => Effect.die("unused"),
}),
)
const registry = ToolRegistry.layer.pipe(Layer.provide(permission))
const registry = ToolRegistry.defaultLayer.pipe(Layer.provide(permission))
const it = testEffect(Layer.mergeAll(permission, registry))
const echo = Tool.make({