solidworks_mcp.ui.prefab_trace_probe¶
solidworks_mcp.ui.prefab_trace_probe ¶
Minimal Prefab probe app for tracing the UI startup and model-connect flow.
Attributes¶
API_ORIGIN
module-attribute
¶
DEFAULT_ASSUMPTIONS
module-attribute
¶
DEFAULT_ASSUMPTIONS = 'Assume PETG, 0.4mm nozzle, 0.2mm layers, and 0.30mm mating clearance unless overridden.'
Functions¶
_hydrate_preview_from_result ¶
Update preview-relevant trace_payload fields directly from preview/refresh POST result.
Avoids nested Fetch-in-on_success which is unreliable in prefab_ui 0.19.x. The POST to /api/ui/preview/refresh returns build_dashboard_state() whose top-level keys map 1:1 to trace_payload.state fields.
Returns:
| Type | Description |
|---|---|
list[object]
|
list[object]: A list containing the resulting items. |
Source code in src/solidworks_mcp/ui/prefab_trace_probe.py
_hydrate_trace ¶
Build internal hydrate trace.
Returns:
| Type | Description |
|---|---|
list[object]
|
list[object]: A list containing the resulting items. |
Source code in src/solidworks_mcp/ui/prefab_trace_probe.py
_refresh_preview ¶
Single preview refresh that chains _refresh_trace() on completion.
Chaining ensures the trace payload (which contains preview_view_urls) is re-fetched after all 4 orientation PNGs have been written, not in parallel with the preview export. We intentionally skip the intermediate _hydrate_preview_from_result() call here: the deep-path SetState it performs replaces trace_payload.state with the preview/refresh result which may have stale or empty preview_view_urls if called before the orientation PNGs are stored in metadata. _refresh_trace() (GET /api/ui/debug/session) is the single source of truth — it runs after the export completes and returns the full trace payload including the correct preview_view_urls.
Returns:
| Name | Type | Description |
|---|---|---|
Fetch |
Fetch
|
The result produced by the operation. |
Source code in src/solidworks_mcp/ui/prefab_trace_probe.py
_refresh_trace ¶
Build internal refresh trace.
Returns:
| Name | Type | Description |
|---|---|---|
Fetch |
Fetch
|
The result produced by the operation. |
Source code in src/solidworks_mcp/ui/prefab_trace_probe.py
_reset_probe_session ¶
Build internal reset probe session.
Returns:
| Name | Type | Description |
|---|---|---|
Fetch |
Fetch
|
The result produced by the operation. |
Source code in src/solidworks_mcp/ui/prefab_trace_probe.py
_result_state ¶
Build internal result state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
_key
|
str
|
The key value. |
required |
fallback
|
str
|
The fallback value. Defaults to "". |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The resulting text value. |
Source code in src/solidworks_mcp/ui/prefab_trace_probe.py
_run_checklist ¶
Build internal run checklist.
Returns:
| Name | Type | Description |
|---|---|---|
Fetch |
Fetch
|
The result produced by the operation. |
Source code in src/solidworks_mcp/ui/prefab_trace_probe.py
_trace_error ¶
Build internal trace error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
step
|
str
|
The step value. |
required |
Returns:
| Type | Description |
|---|---|
list[object]
|
list[object]: A list containing the resulting items. |