feat(tools): igniteTools core + ToolDialect port (ignite-element/tools) — PR 1/3 - #64
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
…/tools entrypoint
Bridge the agent-runtime contract (getSchema/execute) to LLM tool-use, SDK-neutral and hexagonal:
- Functional core (pure): buildManifest(getSchema()) -> NeutralManifest; resolveCall(name, input) -> Result<Route, ToolError> (validates input against the command schema + availability; errors as values).
- ToolDialect port: toToolDefs / parseToolCalls / toToolResult — the provider boundary, implemented by per-provider adapters in later PRs.
- Imperative shell: invoke(call) -> Promise<Result<{snapshot, events}, ToolError>>, the single execute() side effect; never throws across the seam.
- New ignite-element/tools entrypoint (vite entry + package exports + verify-exports allowlist).
TDD against a fake component + fake dialect (zero LLM calls); the typed observation flows from the component generics. No provider SDK — the anthropic + openai (Codex/Ollama) adapters are PR 2 and PR 3.
Design: docs/ignite-tools.md
9f867d7 to
31e7ab8
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## beta #64 +/- ##
=======================================
Coverage ? 89.76%
=======================================
Files ? 30
Lines ? 1485
Branches ? 426
=======================================
Hits ? 1333
Misses ? 142
Partials ? 10
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…nt (igniteTools PR2) (#68) Adds the Anthropic ToolDialect on a new ignite-element/tools/anthropic entrypoint, the Option D scalar round-trip (shared tools/scalar.ts helpers), and refines the ToolDialect port to bare-noun methods (tools/toolCalls/toolResult) with the consumer verb run and the runtime arg. Breaking to the pre-stable beta igniteTools surface. Golden neutral<->Anthropic fixtures; lockstep minor changeset. Builds on #64 (igniteTools PR1). PR3 (openai) reuses the helpers + refined port.
What
Adds
igniteTools(component, dialect?)and the newignite-element/toolsentrypoint — the hexagonal, SDK-neutral bridge from the agent-runtime contract (getSchema()+execute()) to LLM tool-use. PR 1 of 3 (core + port + fake dialect; no provider SDK).Design (
docs/ignite-tools.md)ignite's "no lock-in" philosophy applied one layer up — providers sit behind a single port.
buildManifest(getSchema())→NeutralManifest({ name, description, inputSchema, gated }[], sorted; gated+unavailable commands omitted).resolveCall(name, input)→Result<Route, ToolError>— validates the model-supplied input against the command schema + availability; errors as values, never throws.ToolDialectport:toToolDefs/parseToolCalls/toToolResult— the provider boundary; adapters are pure format translators on separate entrypoints (PR 2/3).invoke(call)→Promise<Result<{ snapshot, events }, ToolError>>— the singleexecute()side effect; a failed command is data the agent maps to a providertool_result.ToolErrorunion:UnknownCommand·InvalidInput·Unavailable·ExecuteFailed.Scope
ToolDialectport + imperative shell +ignite-element/toolsentrypoint.canExecute(duck-typed; all commands offered without it)./tools/anthropic) and OpenAI/Codex/Ollama (/tools/openai) adapters land in PR 2 and PR 3.Tests (TDD, zero LLM calls)
src/tests/tools.test.ts— 35 behavior tests vs a fake component + fake dialect: manifest building + gating, input validation (type/enum/range/required/multipleOffloat-safety/string/array),invokerouting + errors-as-values, and the dialect round-trip (parse → invoke → toToolResult).src/tests/types/tools.types.test.ts— typed observation flows from the component generics.Verification
verify.sh --full: format / lint / typecheck / test / architecture-drift / behavior-boundaries — all pass.npm run build+verify:exports— the new./toolsentrypoint builds (ESM+CJS+types) and resolves.