Node SDK transport for native AHP endpoints - #2721
SteveSandersonMS wants to merge 1 commit into
Conversation
Add bounded opaque message transport, application-owned lifecycle and exposure callbacks, endpoint cleanup, and a standard-client WebSocket sample. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
SDK Consistency Review — PR #2721This PR touches only the Node.js/TypeScript SDK ( Summary of changes
Cross-SDK findings1. 2.
Since Otherwise the PR is well-contained and doesn't introduce any inconsistent behavior versus existing shared APIs.
|
Summary
Add a transport-neutral Node SDK API for native runtime AHP endpoints. Applications own their listener and forward opaque AHP messages; the SDK does not implement an AHP agent mapping.
Runtime companion: https://github.com/github/copilot-agent-runtime/pull/21650. Runtime support must land before releasing this SDK API.
Runtime integration and scope
The companion brings copilotd's AHP 0.9 host and agent mapping into the runtime and connects it to existing native sessions. CLI sharing and standalone
--ahp-hostuse that common implementation in place of the separate hosting implementations on runtimemain.The imported subset supports client-contributed tools/plugins and the AHP MCP OAuth bridge. Remote terminal/PTY services, filesystem services/watches, copilotd Mission Control mirroring and project/worktree provisioning are not included. Ordinary runtime tools and the CLI's existing Mission Control integration remain available.
Applications supply the public listener and session-policy callbacks. The runtime owns AHP state and bounded output serialization; the SDK API handles the application's endpoint connection and delivery lifecycle. No runtime-owned public listener, internal SDK client or additional runtime process is introduced.
The CLI uses the same raw
ahp.*SDK protocol over an in-process connection, without importing this Node SDK package.Coverage and examples
Add endpoint coverage for registration, opaque message forwarding, output delivery, callbacks, reentrant SDK operations, exposure restrictions, cancellation and disposal, including clear failures against unsupported runtimes.
The checked-in sample demonstrates creating and resuming sessions with an application-owned WebSocket listener and a standard AHP client. It exercises an SDK-provided tool callback, session configuration, excluded-session access and listener shutdown.
Rollout
AHP 0.9 only; this is not full copilotd parity. Both PRs remain drafts. The SDK API depends on the runtime companion and must not be released ahead of it.