[Node] Add Commands and UI Elicitation Support to SDK#906
[Node] Add Commands and UI Elicitation Support to SDK#906MRayermannMSFT merged 3 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds command registration/event routing and UI elicitation (interactive dialogs) support to the Node.js SDK, enabling CLI TUI integrations via new session config and session.ui APIs.
Changes:
- Introduces
SessionConfig.commandswith automatic routing forcommand.executeevents and RPC responses. - Adds capability detection via
session.capabilitiesplussession.uiconvenience methods (elicitation,confirm,select,input) gated bycapabilities.ui?.elicitation. - Updates Node + harness dependencies and adds unit/E2E tests + README docs for the new features.
Reviewed changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/harness/package.json | Bumps Copilot CLI dependency used by the E2E harness. |
| test/harness/package-lock.json | Lockfile update for harness dependency bump. |
| nodejs/test/e2e/ui_elicitation.test.ts | Adds E2E coverage for headless-mode behavior of session.ui. |
| nodejs/test/e2e/commands.test.ts | Adds E2E coverage for multi-client command registration broadcast behavior. |
| nodejs/test/client.test.ts | Adds unit tests for commands forwarding/routing and UI capabilities gating. |
| nodejs/src/types.ts | Adds public types for commands, capabilities, and elicitation schemas/results; adds commands to session config types. |
| nodejs/src/session.ts | Implements command handler routing + UI elicitation APIs with capability checks. |
| nodejs/src/index.ts | Re-exports new public types. |
| nodejs/src/client.ts | Forwards commands in create/resume RPC payloads; plumbs capabilities from responses into sessions. |
| nodejs/package.json | Bumps Copilot CLI dependency required for new RPC/event support. |
| nodejs/package-lock.json | Lockfile update for Node package dependency bump. |
| nodejs/README.md | Documents new capabilities, commands, and UI elicitation APIs/events. |
Files not reviewed (2)
- nodejs/package-lock.json: Language not supported
- test/harness/package-lock.json: Language not supported
Cross-SDK Consistency ReviewThis PR adds Commands and UI Elicitation support to the Node.js SDK. After reviewing all four SDK implementations, I've identified a feature parity gap that should be addressed. ✅ What's ConsistentAll four SDKs have the low-level generated RPC methods:
|
Cross-SDK Consistency ReviewThis PR adds Commands and UI Elicitation support to the Node.js SDK. I've reviewed the other SDK implementations (Python, Go, .NET) to assess consistency.
|
What
Adds commands and UI elicitation support to the Node.js SDK, enabling SDK clients to register slash commands that CLI users can invoke and to request interactive form dialogs via the CLI's elicitation component. The public API includes
commandsin session config for registering command handlers with automatic event routing, asession.uiobject with convenience methods (confirm,select,input, and genericelicitation), and asession.capabilitiesgetter for runtime feature detection. Includes unit tests for all new code paths, E2E tests for both features, and updated README documentation.ahWhy
The CLI recently shipped support for SDK-registered commands and UI elicitation dialogs, but the Node.js SDK had no way to use these features. Without this change, SDK consumers building extensions or agents that participate in interactive CLI sessions cannot register slash commands or prompt users with structured input dialogs — limiting the SDK to headless-only workflows.