Add Node cloud session SDK API#1256
Conversation
Move the Mission Control cloud task/client-control pieces into the Node SDK by adding cloud session creation, connection, task event polling, steering helpers, and public cloud session types. Require callers to pass explicit repository context or a repo-less owner instead of probing Git state in the SDK. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Adds a new Node/TypeScript “cloud session” surface area that provisions and controls Mission Control cloud sandbox tasks (polling task events and steering via the Mission Control API), exposes the API via CopilotClient, and documents/tests the feature.
Changes:
- Introduce
MissionControlClient+CloudSessionto create/connect to Mission Control tasks, poll events, and steer sessions. - Add new public types/exports for cloud session options, metadata, events, and command types.
- Document the API in the Node README and add a focused unit test suite for core flows.
Show a summary per file
| File | Description |
|---|---|
| nodejs/src/cloud/missionControlClient.ts | New Mission Control HTTP client (create task, get task, list events, steer). |
| nodejs/src/cloud/cloudSession.ts | New CloudSession facade (connect, polling, send/steer helpers, subscriptions). |
| nodejs/src/client.ts | Adds createCloudSession() / connectCloudSession() to CopilotClient and MC client wiring. |
| nodejs/src/types.ts | Adds cloud-session-related public types (options, metadata, events, command types). |
| nodejs/src/index.ts | Re-exports new cloud session APIs/types from the package entrypoint. |
| nodejs/README.md | Documents createCloudSession / connectCloudSession usage and options. |
| nodejs/test/cloudSession.test.ts | Adds unit coverage for create/connect flows, steering, dedupe/sort, and error mapping. |
Copilot's findings
- Files reviewed: 7/7 changed files
- Comments generated: 7
Harden Mission Control event validation, clarify cloud repository branch semantics, align CloudSession API naming/deprecation, and replace trailing slash regex normalization with a linear helper. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Cross-SDK Consistency Review 🔍This PR introduces a substantial new Cloud Session API (Mission Control integration) exclusively to the Node.js SDK. Here's the consistency assessment across all four SDK implementations: New API surface added (Node.js only)
AssessmentThis is a Node.js-first rollout of a new cloud session capability. The other SDKs only expose Mission Control as a The new feature is meaningful and would be useful in all SDK languages. To preserve cross-SDK feature parity going forward, the equivalent APIs would be:
RecommendationIf the intent is to ship Node.js first and add other languages later, consider opening tracking issues for parity in Python, Go, and .NET so this doesn't drift. Otherwise, if other SDKs should have this feature too, this PR is a good reference implementation to port from. This is not a blocker — Node.js-first rollouts are a reasonable pattern — but flagging it so the team can decide on a follow-up plan for the other three SDKs.
|
Summary
Adds the Node SDK pieces for creating and controlling Mission Control cloud sandbox sessions:
CloudSessionfor remote-control usage (send,sendAndWait, prompt response helpers, mode switching, event subscriptions, replay/dedupe, and disconnect)CopilotClient.createCloudSession()andconnectCloudSession()repositorycontext or a repo-lessownerinstead of probing Git state from the SDKValidation
cd nodejs && npx eslint src/client.ts src/types.ts src/index.ts src/cloud/missionControlClient.ts src/cloud/cloudSession.ts test/cloudSession.test.tscd nodejs && npm run typecheck -- --pretty falsecd nodejs && npm test -- cloudSession.test.tscd nodejs && npm run build