-
Notifications
You must be signed in to change notification settings - Fork 164
(WIP) Get sub agent proposal placeholder #1580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for fdc3 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
| <!-- TODO: Describe the use-case for sub-agents without being overly focused on a particular platform (could make sense in web apps and monolithic apps built in other languages. | ||
| Ensure routing of channel messages and intent resolution are covered. | ||
| --> | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| In some scenarios, it may be necessary to load more than one `DesktopAgent` into the context of a single application or browser window (for web-based applications). This is particularly relevant in the context of micro-frontends, where different applications within the same window may need to communicate with each other. | |
| Using a single `DesktopAgent` per window does not allow separate applications within the same browser window to communicate with each other (this limitation does not apply if the application is loaded into an iframe which is considered to be a different browser window). | |
| To address this, sub-applications can use **sub-agents**. Sub-agents allow different sub-applications within a single window to communicate with each other. Here's an example of how to create and use a sub-agent: | |
| ```ts | |
| const subAgent: DesktopAgent = await (await getAgent()).getSubAgent({appId: "[email protected]"}); | |
| subAgent.raiseIntent("StartChat", context); |
This approach enables seamless communication between sub-agents in the same window.
| */ | ||
| getAppMetadata(app: AppIdentifier): Promise<AppMetadata>; | ||
|
|
||
| // TODO: add getSubAgent definition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/**
| // TODO: add getSubAgent definition | |
| * @param {string} params Required parameters object, which must include | |
| * at least a fully qualified appId or appD URL for the application to | |
| * indicate the app's identity. | |
| * @param {string} params.appId The fully qualified appId | |
| * (in the form appid@<appd origin> for the application | |
| * @param {URL} params.appDUrl The URL to the appD record providing the | |
| * app's identity, used as an alternative to a fully qualified appId. | |
| * | |
| * @return A promise that resolves to a DesktopAgent implementation or | |
| * rejects if the app identity could not be validated. | |
| */ | |
| getSubAgent (params: GetSubAgentParams): Promise<DesktopAgent>; |
| open(app: AppIdentifier, context?: Context): Promise<AppIdentifier>; | ||
| findInstances(app: AppIdentifier): Promise<Array<AppIdentifier>>; | ||
| getAppMetadata(app: AppIdentifier): Promise<AppMetadata>; | ||
| // TODO: add getSubAgent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // TODO: add getSubAgent | |
| getSubAgent (params: GetSubAgentParams): Promise<DesktopAgent>; |
Describe your change
Proposal stub for getSubAgent - raised to show where additions to the FDC3 Standard will be needed to handle the linked issues and to facilitate collaboration. Please feel free to raise PRs into the getSubAgent-proposal branch or comment and make suggestions to apply on the Files changed tab of this PR:
For more info making suggestions through PR reviews see GitHub's docs: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/commenting-on-a-pull-request#adding-comments-to-a-pull-request
Related Issue
resolves #1250
resolves #1263
Contributor License Agreement
Review Checklist
DesktopAgent,Channel,PrivateChannel,Listener,Bridging)?JSDoc comments on interfaces and types should be matched to the main documentation in /docs
Conformance test definitions should cover all required aspects of an FDC3 Desktop Agent implementation, which are usually marked with a MUST keyword, and optional features (SHOULD or MAY) where the format of those features is defined
The Web Connection protocol and Desktop Agent Communication Protocol schemas must be able to support all necessary aspects of the Desktop Agent API, while Bridging must support those aspects necessary for Desktop Agents to communicate with each other
npm run build) run and the results checked in?Generated code will be found at
/src/api/BrowserTypes.tsand/or/src/bridging/BridgingTypes.tsBaseContextschema applied viaallOf(as it is in existing types)?titleanddescriptionprovided for all properties defined in the schema?npm run build) run and the results checked in?Generated code will be found at
/src/context/ContextTypes.ts