[1/3] Add shared structured action discovery and contracts - #2991
Open
George Ng (GeorgeNgMsft) wants to merge 1 commit into
Open
[1/3] Add shared structured action discovery and contracts#2991George Ng (GeorgeNgMsft) wants to merge 1 commit into
George Ng (GeorgeNgMsft) wants to merge 1 commit into
Conversation
Expose exact action discovery and closed TypeScript contracts through Dispatcher and RPC. Fingerprint execution-relevant schema and policy, report cached availability, and support trusted logical scope reuse without enabling execution. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
George Ng (GeorgeNgMsft)
added this pull request to stack #2994
September 11, 2026 07:20
George Ng (GeorgeNgMsft)
marked this pull request as ready for review
September 11, 2026 18:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR gives Copilot a shared way to discover what TypeAgent can do and look up the information needed to use a specific action: its inputs, current availability, and whether user confirmation is required. It also adds a way to detect when an action's definition has changed, so later calls can avoid using outdated instructions. This is the foundation for calling actions directly; it does not execute them yet or change how ordinary natural-language requests work.
Summary
Adds the shared discovery and contract foundation for structured action invocation from Copilot into TypeAgent. This is layer 1 of 3 in the refactor of #2973, following the canonical design.
Direct and MCP integrations will use the same dispatcher service rather than implementing their own discovery or serializing actions into command strings.
Changes
Dispatcher.searchActions(request?)returns compact, filterable action summaries;Dispatcher.getActionContract({ schemaName, actionName })retrieves one contract directly by exact identity. Both methods are wired through the existing dispatcher RPC client and server.1, an opaque scope identifier, and a semantic contract fingerprint. Fingerprints cover execution-relevant schema and policy, excluding descriptions and transient availability. Trusted logical bindings can retain their scope across authorized reconnects; distinct sessions, bindings, and anonymous facades remain isolated.SchemaManifest.actionPoliciesmetadata defaults to unknown effects requiring confirmation. Only an explicitly declared read-only action is exempt, unless its policy explicitly requires confirmation. No agents are speculatively classified.ActionResultenvelope, leave agent-specific result values explicitly unknown, and acknowledge possible runtime interactions.Stack boundary
This PR exposes discovery only. It does not add action execution, continuation/cancellation endpoints, command-string wrappers, per-action MCP tools, or a batch/plan API. Existing natural-language behavior is unchanged.
Layer 2 adds guarded execution, stale-contract rejection, confirmation, structured results, and interaction lifecycle handling. Layer 3 adds thin Direct/MCP integrations over that same service, conversation mapping, and integration guidance.
Validation
origin/main.Coverage includes exact identity resolution, dependency closure and sibling exclusion, optional parameters, recursive types, semantic fingerprint changes versus description/readiness changes, conservative confirmation defaults, visibility filtering before parsing, unavailable states without probes or effects, trusted reconnect scope reuse, and RPC forwarding/error propagation.