This is a minimal proof-of-concept for FDC3 For the Web.
Prerequisites:
node: v20+
yarn v4+
From the Command Line:
yarn install
yarn workspaces foreach --all install
yarn workspaces foreach --all run build
cd packages/demo
yarn dev
Point browser at http://localhost:8080/static/da/index.html
This is your dummy desktop agent, which has various apps you can launch.
Launch the apps, press the button, watch messages pass between them.
The project is divided into several different yarn workspaces:
da-proxy
:
src
: This is an implementation of a client-side, typescript desktop agent proxy that communicates to a server backend using the APIs/JSON Schema defined in Agent Bridging. It is expected that we would standardize this and add to the FDC3 NPM module.test
: This is some cucumber/gherkin tests that exercise the functionality in src
. These are written to be language-agnostic so that we can use the same Gherkin feature files to test .net, Java, Python APIs too. These can be run with yarn build
client
: This exports the getClientAPI()
function which can be used to retrieve a desktop agent API via the web.
da-server
:
src
: A minimal implementation of the desktop-agent bridging protocol for handling messages between multiple connected sources.test
: This is some cucumber/gherkin tests that exercise the functionality in src
. These can be run with yarn build
common
: Common APIs and functionality used by both client
and server
demo
: A bare-bones desktop agent implementation with a few apps that use WebFDC3. See: https://static.swimlanes.io/6bb69f2c9acdc0656f5f3b098d40518e.png for how this works. Basically, the implementation here is that it uses iframes approach and a server-side websocket to relay messages.
fdc3-workbench
: The FDC3 Workbench app from https://github.com/FDC3/toolbox/workbench, ported to use WebFDC3. Start with yarn dev
and invoke from demo
getClientAPI
(in index.ts
): Called (with options) by an FDC3 App to retrieve the API. This retrieves details
from the desktop agent and initialises a DesktopAgent
API implementation, returning it in a promise. There are various options available:
strategies
: This allows plugable strategies for getting the DA. Two exist:
electron-event
which waits for window.fdc3
to be set andpost-message
which fires a post message up to the opening window/iframe (or whatever is set in the frame
option) asking for details of how to construct a DesktopAgent
API implementation.frame
: when not using a loaded iframe, you can begin communicating with a port on a particular frame. By default, opener or window, but you can pick something else if you want.supply
(in server/supply.ts
): Called by the desktop agent on startup, allows it to supply FDC3 APIs to apps when they ask for one via the post-message
strategy. This takes the following parameters:
checker
, which checks the origin window for the API request. It should be a window that the Desktop Agent is aware of.detailsResolver
s, which returns a map of properties to send to the API requestor (the app) that should be used to instantiate the API.portResolver
which is responsible for providing a MessagePort
for the server and client to communicate over.dummy-desktop-agent.ts
to try this out.da
/ testing
fdc3-common/index.ts
Do we need to send a post-message to the server, if we have cookies? Couldn't we just hold the DA ID and the address of the embed page in the cookie? Problem is, the cookie is scoped to the DA...
yarn npm login
yarn workspaces foreach --all version 0.0.10 (or whatever)
yarn workspaces foreach --all npm publish --access=public