[docs] Add interaction service support for polyglot app hosts#1248
[docs] Add interaction service support for polyglot app hosts#1248aspire-repo-bot[bot] wants to merge 2 commits into
Conversation
Document the IInteractionService API now available in TypeScript (and other polyglot) app hosts via microsoft/aspire#17959. - Remove outdated note stating the API was unavailable in TypeScript - Add introductory sentence noting polyglot app host support - Add 'TypeScript app hosts' section covering: - Resolving the service via ctx.serviceProvider().getInteractionService() - Availability check with isAvailable() - Message-style prompts (promptConfirmation, promptMessageBox, promptNotification) - Input factory methods (createTextInput, createSecretInput, etc.) - Single and multi-input prompts with result handle access - Dynamic loading via withDynamicLoading and loadContext - Validation callback on the options object - Add multi-language architecture cross-reference to See also Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Frontend HTML artifact readyThe latest frontend build uploaded the This comment updates automatically when a new frontend build artifact is uploaded. |
There was a problem hiding this comment.
Pull request overview
Updates the Interaction Service documentation to reflect newly added support for polyglot AppHosts (not just C#), and adds TypeScript-specific guidance for resolving and using the interaction service APIs from a command context.
Changes:
- Removes the outdated note claiming
IInteractionServiceis unavailable in the TypeScript AppHost SDK. - Adds a new “TypeScript AppHosts” section covering service resolution, prompts, input builders, dynamic loading, and validation.
- Adds a “See also” link to the multi-language architecture page.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| --- | ||
|
|
||
| import { Aside, Steps } from '@astrojs/starlight/components'; | ||
| import { Aside, Steps, Tabs, TabItem } from '@astrojs/starlight/components'; |
|
|
||
| This is useful for scenarios where you need to gather information from the user or provide feedback on the status of operations, regardless of how the application is being launched or deployed. | ||
|
|
||
| The interaction service is available in both C# an TypeScript AppHosts. In TypeScript AppHosts, the service is resolved through the command context's service provider instead of through the .NET dependency injection container. |
|
|
||
| ### Single and multi-input prompts | ||
|
|
||
| Pass one or more input handles to `promptInput` or `promptInputs`. The result is a handle: call `result.canceled()` to check for cancellation, and `result.inputs().value(name)` to read submitted values by name. |
|
[docs-from-code-ci-note] CI has been retriggered multiple times and is still failing due to the current PR changes (not a transient runner issue). Please update the PR changes to fix the failing checks. |
|
We've retriggered CI multiple times, and the current failures appear tied to changes in this PR rather than a transient pipeline issue. This likely needs a fix in the PR branch before CI will pass. |
|
We've retriggered CI several times, and the current failures appear to be caused by changes in this PR rather than a transient runner issue. This likely needs updates in the PR content/code to get green checks. |
|
[docs-from-code-ci] CI has been retriggered multiple times and is still failing. This appears to be due to the current PR changes rather than a transient infrastructure issue. |
|
CI has been retriggered multiple times and is still failing for this PR (latest failures: 'CI' (attempt 8)). This likely needs changes in the PR itself rather than another rerun. |
|
This PR has had CI retriggered multiple times and is still failing on PR-specific checks. It likely needs a change in this PR to pass. |
|
[docs-from-code automation] repeated-rerun-note |
|
We've retriggered CI many times on this PR and it's still failing. At this point, the failure likely comes from changes in this PR rather than transient CI flakiness, so this probably needs a content/code fix in the PR itself. |
|
CI has failed repeatedly on this docs-from-code PR after multiple reruns, and the failures appear to be related to the changes in this PR. Please review and adjust the PR content so the checks can pass. |
|
CI has been retriggered multiple times on this PR and is still failing. The failures appear tied to the current PR changes rather than a transient runner issue, so this likely needs an update in the PR content before CI will pass. |
Documents changes from microsoft/aspire#17959 —
@sebastienrosTargeting
release/13.5based on the source PR milestone13.5(exact match onmicrosoft/aspire.dev).Why this PR is needed
PR #17959 exposed
IInteractionServiceto polyglot app hosts (TypeScript, Python, Go, Java, and Rust) via the ATS/JSON-RPC surface. The existing interaction service documentation onmicrosoft/aspire.devcontained an explicit<Aside type="note">stating:That statement is now incorrect, and users following the docs would not know the API exists or how to use it.
What was changed
Updated
src/frontend/src/content/docs/extensibility/interaction-service.mdx:## TypeScript app hostssection documenting:ctx.serviceProvider().getInteractionService()isAvailable()promptConfirmation,promptMessageBox,promptNotification)createTextInput,createSecretInput,createBooleanInput,createNumberInput,createChoiceInput) with builder chaining (.withValue(),.withChoiceOptions())promptInput,promptInputs) with result-handle access (result.canceled(),result.inputs().value(name))withDynamicLoadingand theloadContextpatternvalidationContextFiles modified
src/frontend/src/content/docs/extensibility/interaction-service.mdx(updated)