@xenosystem/agent-interface-ui 0.1.15 → 0.1.16
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/components/agent/AgentInterface.d.ts +3 -1
- package/dist/components/agent/AgentInterface.d.ts.map +1 -1
- package/dist/components/agent/AgentInterface.js +22 -3
- package/dist/components/agent/AgentInterface.js.map +1 -1
- package/dist/components/product/XenoAgentProductHeader.d.ts.map +1 -1
- package/dist/components/product/XenoAgentProductHeader.js +1 -1
- package/dist/components/product/XenoAgentProductHeader.js.map +1 -1
- package/package.json +5 -5
|
@@ -12,11 +12,13 @@ export type Workspace = WorkspaceStoreWorkspace;
|
|
|
12
12
|
export interface AgentInterfaceProps {
|
|
13
13
|
surface?: 'embedded' | 'standalone-desktop';
|
|
14
14
|
initialSdkSessionId?: string;
|
|
15
|
+
initialLaunchMode?: 'chat' | 'agent';
|
|
16
|
+
initialWorkspaceRoot?: string;
|
|
15
17
|
windowControls?: {
|
|
16
18
|
onMinimize?: XenoAgentWindowAction;
|
|
17
19
|
onMaximize?: XenoAgentWindowAction;
|
|
18
20
|
onClose?: XenoAgentWindowAction;
|
|
19
21
|
};
|
|
20
22
|
}
|
|
21
|
-
export default function AgentInterface({ surface, initialSdkSessionId, windowControls, }?: AgentInterfaceProps): React.JSX.Element;
|
|
23
|
+
export default function AgentInterface({ surface, initialSdkSessionId, initialLaunchMode, initialWorkspaceRoot, windowControls, }?: AgentInterfaceProps): React.JSX.Element;
|
|
22
24
|
//# sourceMappingURL=AgentInterface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentInterface.d.ts","sourceRoot":"","sources":["../../../src/components/agent/AgentInterface.tsx"],"names":[],"mappings":"AAYA,OAAO,KAA4D,MAAM,OAAO,CAAA;AAqFhF,OAAO,EAEL,KAAK,KAAK,IAAI,mBAAmB,EACjC,KAAK,iBAAiB,IAAI,+BAA+B,EACzD,KAAK,iBAAiB,IAA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|
|
|
3137
3137
|
});
|
|
3138
3138
|
});
|
|
3139
3139
|
}
|
|
3140
|
-
export default function AgentInterface({ surface = 'embedded', initialSdkSessionId, windowControls, } = {}) {
|
|
3140
|
+
export default function AgentInterface({ surface = 'embedded', initialSdkSessionId, initialLaunchMode, initialWorkspaceRoot, windowControls, } = {}) {
|
|
3141
3141
|
const [settingsPanel, setSettingsPanel] = useState(null);
|
|
3142
3142
|
const [sidebarCollapsed, setSidebarCollapsed] = useState(false);
|
|
3143
3143
|
const [folderPanelOpen, setFolderPanelOpen] = useState(false);
|
|
@@ -3242,6 +3242,7 @@ export default function AgentInterface({ surface = 'embedded', initialSdkSession
|
|
|
3242
3242
|
const sessionTabsRestoreAttemptedRef = useRef(false);
|
|
3243
3243
|
const editorStatusTimerRef = useRef(null);
|
|
3244
3244
|
const initialSdkSessionHandledRef = useRef(false);
|
|
3245
|
+
const initialLaunchModeHandledRef = useRef(false);
|
|
3245
3246
|
const terminalDraftSyncTimerRef = useRef(null);
|
|
3246
3247
|
const lastPersistedEditorStateRef = useRef('');
|
|
3247
3248
|
const codeAutoIndexKeyRef = useRef('');
|
|
@@ -3261,6 +3262,21 @@ export default function AgentInterface({ surface = 'embedded', initialSdkSession
|
|
|
3261
3262
|
const setCenterPaneMode = useAgentIdeStore(s => s.setMode);
|
|
3262
3263
|
const setAgentIdeHasOpenFiles = useAgentIdeStore(s => s.setHasOpenFiles);
|
|
3263
3264
|
const authDisplayName = useAuthStore(s => s.user?.display_name);
|
|
3265
|
+
useEffect(() => {
|
|
3266
|
+
if (!initialLaunchMode || initialSdkSessionId || initialLaunchModeHandledRef.current)
|
|
3267
|
+
return;
|
|
3268
|
+
initialLaunchModeHandledRef.current = true;
|
|
3269
|
+
const conversationId = createConversation(MAIN_ASSISTANT_ID);
|
|
3270
|
+
const workspaceMode = initialLaunchMode === 'agent' && initialWorkspaceRoot ? 'workspace' : 'chat-only';
|
|
3271
|
+
updateConversation(conversationId, {
|
|
3272
|
+
schemaVersion: 3,
|
|
3273
|
+
workspaceMode,
|
|
3274
|
+
rootDirectory: workspaceMode === 'workspace' ? initialWorkspaceRoot : undefined,
|
|
3275
|
+
grantedDirectories: workspaceMode === 'workspace' && initialWorkspaceRoot ? [initialWorkspaceRoot] : [],
|
|
3276
|
+
});
|
|
3277
|
+
setViewMode('inbox');
|
|
3278
|
+
setSelectedInboxConversationId(conversationId);
|
|
3279
|
+
}, [createConversation, initialLaunchMode, initialSdkSessionId, initialWorkspaceRoot, updateConversation]);
|
|
3264
3280
|
useEffect(() => {
|
|
3265
3281
|
const sessionId = initialSdkSessionId?.trim();
|
|
3266
3282
|
if (!sessionId || initialSdkSessionHandledRef.current)
|
|
@@ -3274,6 +3290,9 @@ export default function AgentInterface({ surface = 'embedded', initialSdkSession
|
|
|
3274
3290
|
setViewMode('inbox');
|
|
3275
3291
|
setSelectedInboxConversationId(conversationId);
|
|
3276
3292
|
updateConversation(conversationId, {
|
|
3293
|
+
workspaceMode: initialLaunchMode === 'agent' && initialWorkspaceRoot ? 'workspace' : 'chat-only',
|
|
3294
|
+
rootDirectory: initialLaunchMode === 'agent' ? initialWorkspaceRoot : undefined,
|
|
3295
|
+
grantedDirectories: initialLaunchMode === 'agent' && initialWorkspaceRoot ? [initialWorkspaceRoot] : [],
|
|
3277
3296
|
model: MAIN_ASSISTANT_MODEL,
|
|
3278
3297
|
runtime: createConversationRuntimeBinding({
|
|
3279
3298
|
selection: runtimeSelectionForSdk('user'),
|
|
@@ -3332,7 +3351,7 @@ export default function AgentInterface({ surface = 'embedded', initialSdkSession
|
|
|
3332
3351
|
};
|
|
3333
3352
|
void openSdkSession();
|
|
3334
3353
|
return () => { cancelled = true; };
|
|
3335
|
-
}, [appendMessage, createConversation, initialSdkSessionId, updateConversation]);
|
|
3354
|
+
}, [appendMessage, createConversation, initialLaunchMode, initialSdkSessionId, initialWorkspaceRoot, updateConversation]);
|
|
3336
3355
|
// Dynamic context for system prompt enrichment (fetched from main process)
|
|
3337
3356
|
const [runtimeContext, setRuntimeContext] = useState(null);
|
|
3338
3357
|
// Fetch runtime context on mount and every 60 seconds
|
|
@@ -8037,6 +8056,6 @@ export default function AgentInterface({ surface = 'embedded', initialSdkSession
|
|
|
8037
8056
|
if (surface !== 'standalone-desktop') {
|
|
8038
8057
|
return (_jsxs("div", { className: "flex h-full w-full flex-col overflow-hidden", "data-xeno-agent-embedded-shell": "true", children: [_jsx("header", { className: "xeno-chrome-shell xeno-border-subtle h-10 flex-shrink-0 border-b", "data-xeno-agent-session-header": "embedded", "data-xeno-hub-header-style": "true", children: sessionTabsNode }), _jsx("div", { className: "min-h-0 min-w-0 flex-1", children: agentWorkspace })] }));
|
|
8039
8058
|
}
|
|
8040
|
-
return (_jsxs("div", { className: "flex h-full w-full flex-col overflow-hidden", "data-xeno-agent-standalone-shell": "true", children: [_jsx(XenoAgentProductHeader, { centerContent: sessionTabsNode, onMinimize: windowControls?.onMinimize, onMaximize: windowControls?.onMaximize, onClose: windowControls?.onClose }), _jsx("div", { className: "min-h-0 min-w-0 flex-1", children: agentWorkspace })] }));
|
|
8059
|
+
return (_jsxs("div", { className: "flex h-full w-full flex-col overflow-hidden", "data-xeno-agent-standalone-shell": "true", "data-xeno-agent-launch-mode": initialLaunchMode || 'default', children: [_jsx(XenoAgentProductHeader, { title: initialLaunchMode === 'chat' ? 'XENO Chat' : 'XENO Agent', centerContent: sessionTabsNode, onMinimize: windowControls?.onMinimize, onMaximize: windowControls?.onMaximize, onClose: windowControls?.onClose }), _jsx("div", { className: "min-h-0 min-w-0 flex-1", children: agentWorkspace })] }));
|
|
8041
8060
|
}
|
|
8042
8061
|
//# sourceMappingURL=AgentInterface.js.map
|