Skip to content

Add @theseus.run/core — Tool primitive#2

Open
romanonthego wants to merge 1 commit intomasterfrom
release/core-tool
Open

Add @theseus.run/core — Tool primitive#2
romanonthego wants to merge 1 commit intomasterfrom
release/core-tool

Conversation

@romanonthego
Copy link
Copy Markdown
Contributor

Summary

  • Adds @theseus.run/core package (v0.1.0) with the Tool primitive — the typed boundary between AI reasoning and the world
  • All-Effect pipeline: decode → execute → retry → validate → encode
  • Schema-agnostic via SchemaAdapter with fromZod and fromEffectSchema adapters
  • 4 tagged error types (ToolError, ToolErrorRetriable, ToolErrorInput, ToolErrorOutput)
  • Safety levels (readonly/write/destructive) and capability-based filtering helpers
  • 65 tests across 4 test files, full typecheck, CI matrix entry added

Exports

import { defineTool, type Tool } from "@theseus.run/core/Tool"
import { callTool } from "@theseus.run/core/Tool/run"
import { fromZod } from "@theseus.run/core/Tool/zod"
import { fromEffectSchema } from "@theseus.run/core/Tool/effect-schema"

Dependencies

  • effect 4.0.0-beta.33 (direct)
  • zod 4.3.6 (direct)

Test plan

  • bun test packages/theseus-core/ — 65 pass, 0 fail
  • tsc --noEmit — clean typecheck
  • bun run build — 5KB dist (effect/zod external)
  • CI matrix runs on PR

🤖 Generated with Claude Code

First public release of theseus-core. Ships the Tool module only:
- Tool<I,O> — typed, all-Effect pipeline (decode → execute → retry → validate → encode)
- defineTool / defineToolEffect — ergonomic and full-Effect authoring APIs
- SchemaAdapter with fromZod and fromEffectSchema adapters
- callTool execution pipeline with automatic retry on retriable errors
- ToolSafety levels (readonly/write/destructive) and capability helpers
- 4 tagged error types for structured error handling

65 tests, full typecheck, CI coverage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant