Add Workspace Target
add_workspace_targetUse this when you need to declare a reachability target for a connector. Durably insert <assembly>.workspace(connectorRef, { reachable, toleranceMm? }) before the final top-level return. Workspace targets are checked by solvedModel validation/review pose-envelope gates. Returns modified source plus diagnostics from re-evaluation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The .kcad.ts source code. | |
| reachable | Yes | World-frame Vec3 targets the connector must be able to reach. | |
| toleranceMm | No | Optional non-negative tolerance in mm. | |
| connector_ref | Yes | Connector ref "<partName>.<connectorName>". | |
| assembly_binding | Yes | JS identifier bound to assembly(...). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Whether the edit applied and re-evaluated cleanly. | |
| error | No | Failure message (present when ok is false). | |
| new_code | No | Modified .kcad.ts source (present on success). Caller persists it. | |
| diagnostics | No | Diagnostics from re-evaluating the modified source. | |
| binding_name | No | JS const name bound to the new construct (when one was created). |