Skip to content

fix: harden OpenRPC parameter handling - #26

Merged
viktor-drobek merged 2 commits into
EvilFreelancer:mainfrom
viktor-drobek:fix/openrpc-robustness
Sep 22, 2026
Merged

viktor-drobek merged 2 commits into
EvilFreelancer:mainfrom
viktor-drobek:fix/openrpc-robustness

Conversation

@viktor-drobek

Copy link
Copy Markdown
Collaborator

What changed

Follow-up to #25 that hardens native OpenRPC support.

  • Serialize OpenRPC integer, number, boolean, array, and object parameters according to their documented schemas, including formatted integer types such as integer:int64.
  • Support paramStructure: "by-position" by sending positional parameter arrays in document order. Named and either methods continue to send parameter objects.
  • Reject invalid scalar values before making a request and reject skipped positional parameters followed by later flags.
  • Reject duplicate OpenRPC method names so one CLI command cannot silently shadow another.
  • Add rpc:<method> semantics for profile include/exclude filters.
  • Use a parameter summary as CLI help text when its description is absent.
  • Document the new behavior in the README and both skill guides.

Verification

  • npx jest tests/openrpc-to-commands.test.ts tests/openrpc-cli.test.ts --runInBand
  • npm test -- --runInBand - 127 passed, 26 expected fixture-dependent skips
  • npm run build

Notes

OpenRPC requires unique method names. The follow-up therefore fails fast on duplicate names instead of generating ambiguous commands.

@viktor-drobek
viktor-drobek marked this pull request as draft September 22, 2026 09:48
@viktor-drobek
viktor-drobek marked this pull request as ready for review September 22, 2026 10:01
@viktor-drobek
viktor-drobek merged commit 8b0c2ea into EvilFreelancer:main Sep 22, 2026
1 check passed
@viktor-drobek
viktor-drobek deleted the fix/openrpc-robustness branch September 22, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants