Skip to content

v1.37.1-beta.3: embedding API (outputDirectory, extraTools)

Pre-release
Pre-release

Choose a tag to compare

@gsdali gsdali released this 01 Oct 19:33
· 94 commits to main since this release
86dc876

Pre-release. Same dependency pins as v1.37.1-beta.1 and beta.2: OCCTSwift 4.0.0-beta.4 exactly, plus the betas of Interaction, IO, Mesh and Scripts. A consumer only gets this by naming it; the stable line stays at v1.37.0.

Two additions for hosts that embed OCCTMCPCore in-process.

Added

  • makeOCCTMCPServer(outputDirectory: URL? = nil) (#195). The host chooses the directory the server reads and writes its scene in, without touching the process environment. nil keeps today's resolution (OCCTMCP_OUTPUT_DIR, then iCloud Drive, then ~/.occtswift-scripts/output); an explicit directory beats the environment variable. Two servers with different directories can run in one process: each sees only its own scene and keeps its own selection, zone, history and scene-snapshot state. Implemented as a task-local override set around each tool call, with the process-global registries scoped per directory.
  • makeOCCTMCPServer(extraTools: [ExtraTool] = []) (#196). A host can register tools of its own beside the built-in ones. They are listed after the built-ins, and get_api_reference with category: "mcp_tools" includes them. An extra tool whose name matches a built-in wins and the built-in is dropped from the catalog; among extras, the last duplicate wins. A throwing handler becomes an error result.

With neither parameter, behaviour is unchanged.

Notes for embedders

  • The outputDirectory override is a task-local: code on a tool path that uses Task.detached would drop it. Nothing in this package does.
  • Per-directory state is kept for the life of the process, which suits a few long-lived servers; a server per request with a fresh directory each time would grow it without bound.
  • execute_script still shares one SwiftPM cache workspace per process, so concurrent script runs from two servers collide just as two concurrent calls on one server do today.

serverVersion reports 1.37.1-beta.3. Full suite: 262 tests pass locally; CI passes on the release commit.