• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 24414327963

14 Apr 2026 05:49PM UTC coverage: 65.703% (+0.1%) from 65.607%
24414327963

push

github

web-flow
Introduce script engine package for vMCP code mode (#4748)

* Add script engine public API types

Introduce the pkg/script/ package with the public interface for vMCP
code mode. The Executor interface provides Execute() for running
Starlark scripts and ToolDescription() for tools/list injection. Tool
binds MCP tool metadata with a dispatch callback. Config holds execution
parameters (step limit, parallel concurrency cap, tool call timeout).

Part of #4742

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add Starlark execution engine in internal/core

Core execution engine that wraps user scripts in a function body for
top-level return support, enforces step limits to prevent runaway
computation, and captures print() output as logs. This is the lowest
layer of the script package — it only knows about Starlark, not MCP.

Part of #4742

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Use require/table-driven tests per testing guidelines

Convert tests in description_test.go and execute_test.go to use
testify require and table-driven structure per project testing rules.

Part of #4742

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add Go/Starlark type conversions and MCP result parsing

Introduce internal/conversions with three concerns:
- Bidirectional Go ↔ Starlark type conversion (preserving JSON number
  fidelity by promoting whole float64s to Int)
- MCP result parsing that handles structured content with/without the
  mcp-go SDK wrapper, text content as JSON or plain string, and error
  results
- Tool name sanitization for converting MCP names to valid Starlark
  identifiers

Part of #4742

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add parallel(), call_tool(), and tool callable builtins

Introduce internal/builtins with:
- Tool callable factory supporting positional args (arg0, arg1, ...),
  keyword args, and mixed calling conventions
- call_tool("... (continued)

360 of 415 new or added lines in 12 files covered. (86.75%)

12 existing lines in 5 files now uncovered.

57457 of 87449 relevant lines covered (65.7%)

62.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

78.95
/pkg/script/script.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc