@xenosystem/agent-interface-panel 0.1.36 → 0.1.38
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/dist/index.d.ts.map +1 -1
- package/dist/index.js +55 -3
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AASzE,OAAO,EAML,KAAK,0BAA0B,EAChC,MAAM,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AASzE,OAAO,EAML,KAAK,0BAA0B,EAChC,MAAM,gCAAgC,CAAA;AAGvC;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAA;AA8D5C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,oCAAoC;IACnD;;;;;;;;;;OAUG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC,0BAA0B,CAAC,CAAA;IAClD;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAAA;IAC/D;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,uBAAuB,GAAG,IAAI,GAAG,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC,CAAA;IAC7F,6FAA6F;IAC7F,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;CACnC;AAiBD,6CAA6C;AAC7C,eAAO,MAAM,mBAAmB,EAAG,aAAsB,CAAA;AAEzD;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,oCAAoC,GAC5C,WAAW,CAiGb"}
|
package/dist/index.js
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
*
|
|
39
39
|
* @packageDocumentation
|
|
40
40
|
*/
|
|
41
|
-
import { createElement } from 'react';
|
|
41
|
+
import { createElement, useCallback, useEffect, useState } from 'react';
|
|
42
42
|
import { createRoot } from 'react-dom/client';
|
|
43
43
|
import { createAgentPanel } from '@xenosystem/panel-agent';
|
|
44
44
|
import { mountXenoAgentInterface } from '@xenosystem/agent-interface-embed';
|
|
@@ -51,6 +51,7 @@ import { mountXenoAgentInterface } from '@xenosystem/agent-interface-embed';
|
|
|
51
51
|
* this panel are peers that render the same conversation.
|
|
52
52
|
*/
|
|
53
53
|
import { MAIN_ASSISTANT_ID, MAIN_ASSISTANT_MODEL, MAIN_ASSISTANT_NAME, XenoAgentConversation, configureAgentPlatformBridge, } from '@xenosystem/agent-conversation';
|
|
54
|
+
import { disposeHubAgentCatalogClient } from '@xenosystem/agent-conversation/adapters/xenoAgentHostCatalog';
|
|
54
55
|
/**
|
|
55
56
|
* What this panel actually renders: the CONVERSATION, not the shell around it.
|
|
56
57
|
*
|
|
@@ -63,6 +64,33 @@ import { MAIN_ASSISTANT_ID, MAIN_ASSISTANT_MODEL, MAIN_ASSISTANT_NAME, XenoAgent
|
|
|
63
64
|
* nothing else. The host supplies the surrounding chrome, because the host already has some.
|
|
64
65
|
*/
|
|
65
66
|
const AgentConversationComponent = XenoAgentConversation;
|
|
67
|
+
/**
|
|
68
|
+
* The panel OWNS which conversation it shows.
|
|
69
|
+
*
|
|
70
|
+
* 🔴 It used to render the conversation once, with fixed props and no `onNavigateConversation`, so every
|
|
71
|
+
* way the conversation moves somewhere else was dead inside a panel host: "New chat" never rendered,
|
|
72
|
+
* opening a delegated sub-agent from the dock's tray did nothing, and a sub-agent's "Back to parent
|
|
73
|
+
* agent" never appeared. The Turn Modes Bench measurement found it — its chat frame has a New chat
|
|
74
|
+
* action the panel could not draw. Now the panel keeps the current conversation as state, moves itself,
|
|
75
|
+
* and still tells a host that wants to know.
|
|
76
|
+
*/
|
|
77
|
+
function PanelConversation(props) {
|
|
78
|
+
const { conversationId: named, onNavigateConversation, onConversationCreated } = props;
|
|
79
|
+
const [conversationId, setConversationId] = useState(named);
|
|
80
|
+
// a host that names a DIFFERENT conversation later still wins
|
|
81
|
+
useEffect(() => { if (named !== undefined)
|
|
82
|
+
setConversationId(named); }, [named]);
|
|
83
|
+
const navigate = useCallback((id) => { setConversationId(id); onNavigateConversation?.(id); }, [onNavigateConversation]);
|
|
84
|
+
// a conversation the view creates for itself becomes the panel's current one
|
|
85
|
+
const created = useCallback((id) => { setConversationId(id); onConversationCreated?.(id); }, [onConversationCreated]);
|
|
86
|
+
return createElement(AgentConversationComponent, {
|
|
87
|
+
...props,
|
|
88
|
+
// omitted rather than `undefined` while no conversation is named or created yet
|
|
89
|
+
...(conversationId !== undefined ? { conversationId } : {}),
|
|
90
|
+
onNavigateConversation: navigate,
|
|
91
|
+
onConversationCreated: created,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
66
94
|
/**
|
|
67
95
|
* The conversation this panel opens when the host does not name one.
|
|
68
96
|
*
|
|
@@ -82,6 +110,20 @@ function defaultConversationProps() {
|
|
|
82
110
|
renderWorkbenchPanel: false,
|
|
83
111
|
};
|
|
84
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* The conversation fills the tile it is given. Its root (`.xa-app`) is `flex: 1; min-height: 0`
|
|
115
|
+
* inside a flex COLUMN — the bench's frame — so mounted into a plain block element it sizes to
|
|
116
|
+
* its content and the dock floats mid-tile with dead space beneath (Canvas, 2026-09-17). The
|
|
117
|
+
* mount element is the panel's to shape: every host hands over a box, none of them know the
|
|
118
|
+
* conversation's layout contract, and this is the one place that does.
|
|
119
|
+
*/
|
|
120
|
+
function fillTile(el) {
|
|
121
|
+
// the tile's SIZE stays the host's (a fixed box, a flex item, a grid cell); only its inside
|
|
122
|
+
// becomes the column the conversation's root expects
|
|
123
|
+
el.style.display = 'flex';
|
|
124
|
+
el.style.flexDirection = 'column';
|
|
125
|
+
el.style.minHeight = '0';
|
|
126
|
+
}
|
|
85
127
|
/** The surface kind this panel mounts as. */
|
|
86
128
|
export const AGENT_PANEL_SURFACE = 'panel-embed';
|
|
87
129
|
/**
|
|
@@ -122,8 +164,9 @@ export function createXenoAgentInterfacePanel(options) {
|
|
|
122
164
|
return;
|
|
123
165
|
}
|
|
124
166
|
restoreBridge = configureAgentPlatformBridge(bridge);
|
|
167
|
+
fillTile(el);
|
|
125
168
|
root = createRoot(el);
|
|
126
|
-
root.render(createElement(
|
|
169
|
+
root.render(createElement(PanelConversation, {
|
|
127
170
|
...defaultConversationProps(),
|
|
128
171
|
...options.conversation,
|
|
129
172
|
}));
|
|
@@ -143,8 +186,9 @@ export function createXenoAgentInterfacePanel(options) {
|
|
|
143
186
|
* copy. A host that calls `createRoot` on a view imported across a package
|
|
144
187
|
* boundary can end up with two Reacts, and every hook throws "Invalid hook call".
|
|
145
188
|
*/
|
|
189
|
+
fillTile(container);
|
|
146
190
|
root = createRoot(container);
|
|
147
|
-
root.render(createElement(
|
|
191
|
+
root.render(createElement(PanelConversation, {
|
|
148
192
|
...defaultConversationProps(),
|
|
149
193
|
...options.conversation,
|
|
150
194
|
}));
|
|
@@ -171,6 +215,14 @@ export function createXenoAgentInterfacePanel(options) {
|
|
|
171
215
|
handle = null;
|
|
172
216
|
root?.unmount();
|
|
173
217
|
root = null;
|
|
218
|
+
/*
|
|
219
|
+
* The conversation's catalog adapter keeps ONE module-level host client, built from the
|
|
220
|
+
* bridge on first use. It must go with the mount: a host disposes its bridge right after
|
|
221
|
+
* this, and a client left behind would serve the NEXT mount from a dead transport —
|
|
222
|
+
* close and reopen the tab and the catalog never loads again. `disposeHubAgentCatalogClient`
|
|
223
|
+
* existed for exactly this and was called by nothing (2026-09-17).
|
|
224
|
+
*/
|
|
225
|
+
disposeHubAgentCatalogClient();
|
|
174
226
|
restoreBridge?.();
|
|
175
227
|
restoreBridge = null;
|
|
176
228
|
};
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAAE,aAAa,EAA0B,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAA0B,MAAM,OAAO,CAAA;AAC/F,OAAO,EAAE,UAAU,EAAa,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAE1D,OAAO,EAAE,uBAAuB,EAAsC,MAAM,mCAAmC,CAAA;AAE/G;;;;;;;GAOG;AACH,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,4BAA4B,GAE7B,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,4BAA4B,EAAE,MAAM,8DAA8D,CAAA;AAS3G;;;;;;;;;;GAUG;AACH,MAAM,0BAA0B,GAAG,qBAAsE,CAAA;AAEzG;;;;;;;;;GASG;AACH,SAAS,iBAAiB,CAAC,KAAiC;IAC1D,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,sBAAsB,EAAE,qBAAqB,EAA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AAA;gBACX;;;;;;mBAMG;gBACH,4BAA4B,EAAE,CAAA;gBAC9B,aAAa,EAAE,EAAE,CAAA;gBACjB,aAAa,GAAG,IAAI,CAAA;YACtB,CAAC,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xenosystem/agent-interface-panel",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.38",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@xenosystem/panel-agent": "^0.1.0",
|
|
27
|
-
"@xenosystem/agent-
|
|
28
|
-
"@xenosystem/agent-
|
|
29
|
-
"@xenosystem/agent-interface-embed": "0.1.
|
|
30
|
-
"@xenosystem/agent-interface-
|
|
27
|
+
"@xenosystem/agent-conversation": "0.1.38",
|
|
28
|
+
"@xenosystem/agent-interface-contract": "0.1.38",
|
|
29
|
+
"@xenosystem/agent-interface-embed": "0.1.38",
|
|
30
|
+
"@xenosystem/agent-interface-client": "0.1.38"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@xenosystem/panel-sdk": "^1.1.0",
|