Skip to content

feat: add commandType filter to introspect.commands#1526

Draft
raman325 wants to merge 2 commits intomasterfrom
feat/introspect-commands-filter
Draft

feat: add commandType filter to introspect.commands#1526
raman325 wants to merge 2 commits intomasterfrom
feat/introspect-commands-filter

Conversation

@raman325
Copy link
Collaborator

@raman325 raman325 commented Mar 4, 2026

Summary

  • Adds an optional commandType parameter to the introspect.commands command
  • When provided, filters the returned schema's IncomingMessage.anyOf array to only include commands from the specified category (server, node, controller, driver, endpoint, broadcast_node, multicast_group, utils, config_manager, zniffer, introspect)
  • All definitions are preserved in the filtered schema; only the top-level anyOf is narrowed

Blocked by #1525

Test plan

  • Verify introspect.commands without commandType returns the full schema (existing behavior)
  • Verify introspect.commands with commandType: "server" returns only server-level commands
  • Verify introspect.commands with commandType: "node" returns only the IncomingMessageNode ref
  • Verify introspect.commands with an unknown commandType returns an empty anyOf
  • Verify npm test passes

🤖 Generated with Claude Code

raman325 and others added 2 commits March 3, 2026 20:15
Add a new `introspect` command module that returns the JSON Schema
describing all incoming message types. The `introspect.commands`
command works before `initialize`, enabling API discovery
pre-negotiation.

- Create `src/lib/introspect/` module (command, incoming_message,
  outgoing_message, message_handler) following existing patterns
- Register in Instance enum and wire into server.ts
- Add `ts-json-schema-generator` for build-time schema generation
- Rename interfaces for `$ref` reuse (node, driver, controller,
  multicast_group incoming messages)
- Add introspection section to README with tool recommendations

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant