ov.analysis.arch.sidecar#
Python facade over the Node reverse-engineering sidecar (§6.1, D2).
The mature JS-only tooling (source-map, bundle unpacking, AST literal
extraction) lives in a long-lived Node process spoken to over **newline-delimited
JSON-RPC 2.0 on stdio** – the same transport MCP uses, sub-process-bound with no
network exposure of a process that ingests untrusted JS. The wire contract is
defined once here as typed methods; the sidecar functions are pure and stateless.
Everything degrades gracefully: if Node or the sidecar deps are absent,
Sidecar.available() is False and callers skip recovery rather than fail.
Classes
|
A lazily-started Node sidecar process exposing pure JSON-RPC functions. |
Exceptions
Raised when the Node sidecar cannot be used (Node/deps missing). |
- class ov.analysis.arch.sidecar.Sidecar(*, node='node', script=None, timeout=30.0)[source]#
Bases:
objectA lazily-started Node sidecar process exposing pure JSON-RPC functions.
- call(method, params)[source]#
Invoke a sidecar method; raise
SidecarUnavailableon transport error.- Return type:
- consume_source_map(map_json)[source]#
Recover
{files: [{path, content}], sources}from a source map.
Bases:
RuntimeErrorRaised when the Node sidecar cannot be used (Node/deps missing).