Implementation:8beeeaaat Touchdesigner mcp Compatibility Policy Engine
| Knowledge Sources | |
|---|---|
| Domains | Version_Compatibility, Semver |
| Last Updated | 2026-10-28 00:00 GMT |
Overview
Concrete tool for deciding whether a connected TouchDesigner component's API version is compatible with the MCP server release, using semver-coerced policy types and tailored user-facing messages.
Description
The compatibility policy engine (src/core/compatibility.ts) defines six policy types — NO_VERSION, BELOW_MIN_VERSION, SERVER_OUTDATED, COMPONENT_OUTDATED, COMPONENT_NEWER, COMPATIBLE — each with a compatibility flag, an error level (error/warning/info), and a message generator. getCompatibilityPolicyType coerces both versions via semver and classifies the relationship against `MIN_COMPATIBLE_API_VERSION` and the server's `EXPECTED_API_VERSION`. The engine deliberately keeps the npm package version out of the decision: only the API version axis determines compatibility, so a package major bump alone never invalidates deployed components.
Usage
Import this module when you need to classify a reported API version against the server's expectations, e.g. inside TouchDesignerClient.verifyVersionCompatibility().
Code Reference
Source Location
- Repository: 8beeeaaat_Touchdesigner_mcp
- File: src/core/compatibility.ts
- Lines: 1-273
Signature
export declare const getCompatibilityPolicyType(params: {
apiVersion: string;
expectedApiVersion: string;
}): CompatibilityPolicyType;
export declare const getCompatibilityPolicy(type: CompatibilityPolicyType): {
compatible: boolean;
level: "info" | "error" | "warning";
message: (args: CompatibilityMessageArgs) => string;
};
Import
import {
getCompatibilityPolicy,
getCompatibilityPolicyType,
} from "./core/compatibility.js";
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| apiVersion | string | Yes | Component's reported mcpApiVersion |
| expectedApiVersion | string | Yes | Server's EXPECTED_API_VERSION |
| minRequired | string | Yes | MIN_COMPATIBLE_API_VERSION (for messages) |
| mcpVersion | string | Yes | Server package version (for messages) |
Outputs
| Name | Type | Description |
|---|---|---|
| policyType | CompatibilityPolicyType | One of six classification types |
| policy.compatible | boolean | Whether the call may proceed |
| policy.level | "warning"\|"info" | Severity for logging |
| policy.message | string | Human-readable guidance with update link |
Usage Examples
Classifying a version pair
import { getCompatibilityPolicyType, getCompatibilityPolicy } from "./core/compatibility.js";
const type = getCompatibilityPolicyType({
apiVersion: "1.4.0",
expectedApiVersion: "2.0.0",
});
const policy = getCompatibilityPolicy(type);
// type === "componentOutdated", policy.compatible === true, policy.level === "warning"
const msg = policy.message({
apiVersion: "1.4.0",
expectedApiVersion: "2.0.0",
mcpVersion: "2.1.0",
minRequired: "1.3.0",
});