Skip to main content

JSON-RPC adapter for Muscles actions

Project description

Muscles JSON-RPC

JSON-RPC protocol projection for Muscles actions.

This package makes Muscles action-first applications callable over JSON-RPC while preserving the same schemas, rules, dispatcher, and context used by other projections.

Related Repositories

  • muscles - core action contracts, dispatcher and inspect contract.
  • muscles-cli - CLI action inspection and execution over the same contracts.
  • muscles-mcp - MCP projection over the same action model.
  • muscles-sse - streaming projection for action output.
  • muscles-benchmarks - protocol projection regression checks.

Concept Guardrails

  • JSON-RPC is a protocol projection, not a new framework layer.
  • Methods must be discovered from inspect_application(app).
  • Validation and error normalization must reuse Muscles core schema/rules/errors.
  • Auth/rules must run through ActionDispatcher.
  • The same use case must be callable from CLI, HTTP, MCP, and JSON-RPC without duplicating implementation.
  • JSON-RPC state is scoped to the application instance; no mutable module-level method registry is the source of truth.

Initial Goal

Implement a JSON-RPC 2.0 projection around Muscles actions with typed request/response contracts, deterministic error mapping, notifications, and batch dispatch.

Current Stage (Issues #1 and #3)

Implemented JSON-RPC 2.0 projection:

  • request validation (jsonrpc, method, params);
  • method discovery from inspect_application(app);
  • dispatch through ActionDispatcher(..., transport="jsonrpc");
  • notification calls;
  • batch calls;
  • core stream projection with stable result.stream envelopes;
  • deterministic error mapping:
    • -32600 invalid request;
    • -32601 method not found;
    • -32602 invalid params;
    • -32001 permission denied;
    • -32603 internal error.

Stream actions expose core progress, log, result, and error events in a JSON-serializable envelope. Non-stream list and tuple results keep ordinary JSON-RPC semantics.

Run tests

python -m pytest -q

When testing against local core changes:

PYTHONPATH=../muscles/src:src python -m pytest -q

User docs:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

muscles_jsonrpc-1.0.2.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

muscles_jsonrpc-1.0.2-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file muscles_jsonrpc-1.0.2.tar.gz.

File metadata

  • Download URL: muscles_jsonrpc-1.0.2.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for muscles_jsonrpc-1.0.2.tar.gz
Algorithm Hash digest
SHA256 4291b78427fdf0e8573ac20be7d642ba9c5f0c92f9f242d5c0ebf4663d9a5cf1
MD5 e6f31a50cbabebfdc9c5469bad29d9c7
BLAKE2b-256 9caa328b7a973aa68fe98a539aba7f7c2ef09d4abc2adf548b53c7a5753cae16

See more details on using hashes here.

Provenance

The following attestation bundles were made for muscles_jsonrpc-1.0.2.tar.gz:

Publisher: release.yml on butkoden/muscles-jsonrpc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file muscles_jsonrpc-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for muscles_jsonrpc-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c7ddf6a815bc4e5ae2cea1afa65d9722abd2001252adc4a03699b677f19c0e54
MD5 fc20bb47e22da408670e3209d0a05b79
BLAKE2b-256 f59d8d492e5021fd46476dd08a72628cb1f1ff906e460218c215482ad8d9473e

See more details on using hashes here.

Provenance

The following attestation bundles were made for muscles_jsonrpc-1.0.2-py3-none-any.whl:

Publisher: release.yml on butkoden/muscles-jsonrpc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page