Skip to content

Migrate CLI types to use dispatcher-types instead of full dispatcher package#2200

Merged
GeorgeNgMsft merged 6 commits intomainfrom
dev/georgeng/shared_types
Apr 15, 2026
Merged

Migrate CLI types to use dispatcher-types instead of full dispatcher package#2200
GeorgeNgMsft merged 6 commits intomainfrom
dev/georgeng/shared_types

Conversation

@GeorgeNgMsft
Copy link
Copy Markdown
Contributor

@GeorgeNgMsft GeorgeNgMsft commented Apr 15, 2026

Migrate CLI types to @typeagent/dispatcher-types
The CLI previously depended on agent-dispatcher — a heavyweight package with 30+ transitive dependencies — solely to import a handful of types and a small helper function. This PR eliminates that unnecessary coupling and reduces it's dependencies.

What changed
@typeagent/dispatcher-types (the lightweight types-only package):

Added DispatcherName and DispatcherEmoji constants to dispatcher.ts — these are now the single source of truth
Added getStatusSummary in a new helpers/status subpath export; it depends only on DispatcherStatus and the two constants above

agent-dispatcher:
dispatcherUtils.ts now imports and re-exports DispatcherName/DispatcherEmoji from @typeagent/dispatcher-types — all 17 internal consumers are unaffected
helpers/status.ts is now a one-line re-export from @typeagent/dispatcher-types/helpers/status — api and shell consumers are unaffected

packages/cli:
enhancedConsole.ts and connect.ts now import all 8 types (Dispatcher, ClientIO, RequestId, IAgentMessage, TemplateEditConfig, PendingInteractionRequest, PendingInteractionResponse, PendingInteractionEntry) and getStatusSummary directly from @typeagent/dispatcher-types
agent-dispatcher remains in cli/package.json for createDispatcher and other non-type imports used by other commands (constructions, data/, replay, run/, test/*)

@GeorgeNgMsft GeorgeNgMsft requested a review from Copilot April 15, 2026 20:07
@GeorgeNgMsft GeorgeNgMsft changed the title Migrate CLI types to @typeagent/dispatcher-types Migrate CLI types to use dispatcher-types instead of full dispatcher package Apr 15, 2026
@GeorgeNgMsft GeorgeNgMsft marked this pull request as ready for review April 15, 2026 20:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR migrates the CLI’s type-only imports (and the getStatusSummary helper) off the heavyweight agent-dispatcher package onto the lightweight @typeagent/dispatcher-types, reducing transitive dependency load while preserving existing APIs via re-exports.

Changes:

  • Added DispatcherName / DispatcherEmoji constants to @typeagent/dispatcher-types and introduced a new helpers/status subpath export for getStatusSummary.
  • Updated agent-dispatcher helpers/constants to re-export from @typeagent/dispatcher-types to avoid breaking internal consumers.
  • Switched CLI and selected tests to import dispatcher types and getStatusSummary directly from @typeagent/dispatcher-types.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
ts/packages/dispatcher/types/src/helpers/status.ts Adds getStatusSummary implementation into the types package.
ts/packages/dispatcher/types/src/dispatcher.ts Introduces shared dispatcher name/emoji constants as single source of truth.
ts/packages/dispatcher/types/package.json Exposes ./helpers/status via package exports.
ts/packages/dispatcher/nodeProviders/test/provider.spec.ts Updates type imports to come from @typeagent/dispatcher-types.
ts/packages/dispatcher/dispatcher/src/helpers/status.ts Re-exports getStatusSummary from the new types-package helper subpath.
ts/packages/dispatcher/dispatcher/src/context/dispatcher/dispatcherUtils.ts Re-exports dispatcher constants from @typeagent/dispatcher-types.
ts/packages/cli/test/multiClientInteraction.spec.ts Updates CLI test type imports to the new types package.
ts/packages/cli/src/enhancedConsole.ts Updates CLI enhanced console type imports to the new types package.
ts/packages/cli/src/commands/connect.ts Switches connect command to import Dispatcher and getStatusSummary from @typeagent/dispatcher-types.
ts/packages/cli/package.json Adds @typeagent/dispatcher-types dependency.
Files not reviewed (1)
  • ts/pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ts/packages/cli/src/commands/connect.ts Outdated
Comment thread ts/packages/dispatcher/types/src/helpers/status.ts
@GeorgeNgMsft GeorgeNgMsft added this pull request to the merge queue Apr 15, 2026
Merged via the queue into main with commit 21403c0 Apr 15, 2026
21 checks passed
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