@xenosystem/agent-interface-embed 0.1.49 → 0.1.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/dist/index.d.ts +0 -20
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -40
- package/dist/index.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xenosystem/agent-interface-embed",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.50",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@xenosystem/agent-interface-
|
|
16
|
-
"@xenosystem/agent-interface-
|
|
17
|
-
"@xenosystem/agent-interface-
|
|
15
|
+
"@xenosystem/agent-interface-contract": "0.1.50",
|
|
16
|
+
"@xenosystem/agent-interface-ui": "0.1.50",
|
|
17
|
+
"@xenosystem/agent-interface-client": "0.1.50"
|
|
18
18
|
},
|
|
19
19
|
"publishConfig": {
|
|
20
20
|
"access": "public"
|
package/dist/index.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { AgentSurfaceKind } from '@xenosystem/agent-interface-contract';
|
|
2
|
-
import { AgentHostClient } from '@xenosystem/agent-interface-client';
|
|
3
|
-
import { AgentInterfaceSurfaceController, type AgentInterfaceSurfaceSnapshot } from '@xenosystem/agent-interface-ui';
|
|
4
|
-
export type AgentEmbedSurface = Extract<AgentSurfaceKind, 'hub-embed' | 'shell-embed' | 'embed-preview' | 'panel-embed'>;
|
|
5
|
-
export interface AgentInterfaceEmbedRenderer<TContainer extends object> {
|
|
6
|
-
mount(container: TContainer, controller: AgentInterfaceSurfaceController, initialSnapshot: AgentInterfaceSurfaceSnapshot): void | Promise<void>;
|
|
7
|
-
unmount(container: TContainer): void | Promise<void>;
|
|
8
|
-
}
|
|
9
|
-
export interface MountXenoAgentInterfaceOptions<TContainer extends object> {
|
|
10
|
-
surface: AgentEmbedSurface;
|
|
11
|
-
client: AgentHostClient;
|
|
12
|
-
renderer: AgentInterfaceEmbedRenderer<TContainer>;
|
|
13
|
-
}
|
|
14
|
-
export interface XenoAgentInterfaceEmbedHandle {
|
|
15
|
-
readonly surface: AgentEmbedSurface;
|
|
16
|
-
readonly controller: AgentInterfaceSurfaceController;
|
|
17
|
-
unmount(): Promise<void>;
|
|
18
|
-
}
|
|
19
|
-
export declare function mountXenoAgentInterface<TContainer extends object>(container: TContainer, options: MountXenoAgentInterfaceOptions<TContainer>): Promise<XenoAgentInterfaceEmbedHandle>;
|
|
20
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AACpE,OAAO,EACL,+BAA+B,EAC/B,KAAK,6BAA6B,EACnC,MAAM,gCAAgC,CAAA;AAEvC,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,EAAE,WAAW,GAAG,aAAa,GAAG,eAAe,GAAG,aAAa,CAAC,CAAA;AAExH,MAAM,WAAW,2BAA2B,CAAC,UAAU,SAAS,MAAM;IACpE,KAAK,CACH,SAAS,EAAE,UAAU,EACrB,UAAU,EAAE,+BAA+B,EAC3C,eAAe,EAAE,6BAA6B,GAC7C,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACvB,OAAO,CAAC,SAAS,EAAE,UAAU,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACrD;AAED,MAAM,WAAW,8BAA8B,CAAC,UAAU,SAAS,MAAM;IACvE,OAAO,EAAE,iBAAiB,CAAA;IAC1B,MAAM,EAAE,eAAe,CAAA;IACvB,QAAQ,EAAE,2BAA2B,CAAC,UAAU,CAAC,CAAA;CAClD;AAED,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAA;IACnC,QAAQ,CAAC,UAAU,EAAE,+BAA+B,CAAA;IACpD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACzB;AAID,wBAAsB,uBAAuB,CAAC,UAAU,SAAS,MAAM,EACrE,SAAS,EAAE,UAAU,EACrB,OAAO,EAAE,8BAA8B,CAAC,UAAU,CAAC,GAClD,OAAO,CAAC,6BAA6B,CAAC,CAmCxC"}
|
package/dist/index.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { AgentHostClient } from '@xenosystem/agent-interface-client';
|
|
2
|
-
import { AgentInterfaceSurfaceController, } from '@xenosystem/agent-interface-ui';
|
|
3
|
-
const mountedContainers = new WeakSet();
|
|
4
|
-
export async function mountXenoAgentInterface(container, options) {
|
|
5
|
-
if (mountedContainers.has(container)) {
|
|
6
|
-
throw new Error('This container already has a mounted XENO Agent interface.');
|
|
7
|
-
}
|
|
8
|
-
if (options.client.surface !== options.surface) {
|
|
9
|
-
throw new Error(`Embed surface ${options.surface} does not match client surface ${options.client.surface}.`);
|
|
10
|
-
}
|
|
11
|
-
mountedContainers.add(container);
|
|
12
|
-
const controller = new AgentInterfaceSurfaceController(options.client);
|
|
13
|
-
let unmounted = false;
|
|
14
|
-
try {
|
|
15
|
-
const initialSnapshot = await controller.start();
|
|
16
|
-
await options.renderer.mount(container, controller, initialSnapshot);
|
|
17
|
-
}
|
|
18
|
-
catch (error) {
|
|
19
|
-
controller.stop();
|
|
20
|
-
mountedContainers.delete(container);
|
|
21
|
-
throw error;
|
|
22
|
-
}
|
|
23
|
-
return {
|
|
24
|
-
surface: options.surface,
|
|
25
|
-
controller,
|
|
26
|
-
async unmount() {
|
|
27
|
-
if (unmounted)
|
|
28
|
-
return;
|
|
29
|
-
unmounted = true;
|
|
30
|
-
try {
|
|
31
|
-
await options.renderer.unmount(container);
|
|
32
|
-
}
|
|
33
|
-
finally {
|
|
34
|
-
controller.stop();
|
|
35
|
-
mountedContainers.delete(container);
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AACpE,OAAO,EACL,+BAA+B,GAEhC,MAAM,gCAAgC,CAAA;AAyBvC,MAAM,iBAAiB,GAAG,IAAI,OAAO,EAAU,CAAA;AAE/C,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,SAAqB,EACrB,OAAmD;IAEnD,IAAI,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAA;IAC/E,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC;QAC/C,MAAM,IAAI,KAAK,CAAC,iBAAiB,OAAO,CAAC,OAAO,kCAAkC,OAAO,CAAC,MAAM,CAAC,OAAO,GAAG,CAAC,CAAA;IAC9G,CAAC;IAED,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;IAChC,MAAM,UAAU,GAAG,IAAI,+BAA+B,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IACtE,IAAI,SAAS,GAAG,KAAK,CAAA;IAErB,IAAI,CAAC;QACH,MAAM,eAAe,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE,CAAA;QAChD,MAAM,OAAO,CAAC,Q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