@xenosystem/agent-interface-ui 0.1.18 → 0.1.19

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.
Files changed (30) hide show
  1. package/dist/adapters/agentHostPlatformBridge.d.ts.map +1 -1
  2. package/dist/adapters/agentHostPlatformBridge.js +195 -1
  3. package/dist/adapters/agentHostPlatformBridge.js.map +1 -1
  4. package/dist/components/agent/AgentInterface.d.ts.map +1 -1
  5. package/dist/components/agent/AgentInterface.js +35 -8
  6. package/dist/components/agent/AgentInterface.js.map +1 -1
  7. package/dist/components/agent/AgentView.d.ts +22 -0
  8. package/dist/components/agent/AgentView.d.ts.map +1 -1
  9. package/dist/components/agent/AgentView.js +39 -14
  10. package/dist/components/agent/AgentView.js.map +1 -1
  11. package/dist/components/agent/AgentWorkbenchPanel.d.ts +1 -0
  12. package/dist/components/agent/AgentWorkbenchPanel.d.ts.map +1 -1
  13. package/dist/components/agent/AgentWorkbenchPanel.js +10 -4
  14. package/dist/components/agent/AgentWorkbenchPanel.js.map +1 -1
  15. package/dist/components/agent/settings/sections/EnvironmentSecretsSection.d.ts.map +1 -1
  16. package/dist/components/agent/settings/sections/EnvironmentSecretsSection.js +3 -37
  17. package/dist/components/agent/settings/sections/EnvironmentSecretsSection.js.map +1 -1
  18. package/dist/components/agent/settings/sections/WorkspaceDirectoryAccessSection.js +2 -2
  19. package/dist/components/agent/settings/sections/WorkspaceDirectoryAccessSection.js.map +1 -1
  20. package/dist/components/agent/subagentRunTree.d.ts +18 -0
  21. package/dist/components/agent/subagentRunTree.d.ts.map +1 -0
  22. package/dist/components/agent/subagentRunTree.js +43 -0
  23. package/dist/components/agent/subagentRunTree.js.map +1 -0
  24. package/dist/platformApiTypes.d.ts +1 -0
  25. package/dist/platformApiTypes.d.ts.map +1 -1
  26. package/dist/stores/agentChatStore.d.ts +4 -1
  27. package/dist/stores/agentChatStore.d.ts.map +1 -1
  28. package/dist/stores/agentChatStore.js +15 -1
  29. package/dist/stores/agentChatStore.js.map +1 -1
  30. package/package.json +5 -5
@@ -1198,6 +1198,7 @@ function toSubagentWorkbenchRun(value) {
1198
1198
  }
1199
1199
  const capabilityMatch = isPlainRecord(value.capabilityMatch) ? value.capabilityMatch : {};
1200
1200
  const toolPolicy = isPlainRecord(value.toolPolicy) ? value.toolPolicy : {};
1201
+ const delegation = isPlainRecord(value.delegation) ? value.delegation : {};
1201
1202
  const rawScore = readNumber(capabilityMatch, 'score');
1202
1203
  const score = typeof rawScore === 'number' ? Math.max(0, Math.min(1, rawScore)) : 0.5;
1203
1204
  return {
@@ -1217,6 +1218,7 @@ function toSubagentWorkbenchRun(value) {
1217
1218
  status: normalizeSubagentRunStatus(readString(value, 'status')),
1218
1219
  objective,
1219
1220
  role: readOptionalString(value, 'role'),
1221
+ depth: Math.max(1, Math.floor(readNumber(delegation, 'depth') || 1)),
1220
1222
  capabilityMatch: {
1221
1223
  score,
1222
1224
  reasons: readStringArray(capabilityMatch.reasons),
@@ -4931,8 +4933,19 @@ export default function AgentInterface({ surface = 'embedded', initialSdkSession
4931
4933
  const requestedMaxTokens = positiveFiniteNumber(params.maxTokens);
4932
4934
  const requestedMaxRuntimeMs = positiveFiniteNumber(params.maxRuntimeMs);
4933
4935
  const requestedMaxCredits = positiveFiniteNumber(params.maxCredits);
4934
- const contextNote = params.contextNote?.trim() || '';
4935
- const contextAttachmentIds = contextNote ? [`manual-context:${generateId()}`] : [];
4936
+ const explicitContextNote = params.contextNote?.trim() || '';
4937
+ const inheritedContext = explicitContextNote || (sourceConversation?.messages || [])
4938
+ .filter((message) => !message.isStreaming && typeof message.content === 'string' && message.content.trim())
4939
+ .slice(-6)
4940
+ .map((message) => `${message.role}: ${message.content.trim().slice(0, 800)}`)
4941
+ .join('\n\n')
4942
+ .slice(0, 4_000);
4943
+ const parentRun = sourceConversation
4944
+ ? subagentRuns.find((run) => run.childConversationId === sourceConversation.id)
4945
+ : undefined;
4946
+ const parentDepth = parentRun?.depth || 0;
4947
+ const configuredMaxChildDepth = Math.max(1, Math.min(10, Math.floor(source.team.teamAgentPolicy?.maxChildDepth || 4)));
4948
+ const allowFurtherDelegation = source.team.teamAgentPolicy?.allowFurtherDelegation !== false;
4936
4949
  const budgetLimits = [
4937
4950
  target.rateLimits?.tokensPerDay,
4938
4951
  source.team.rateLimits?.tokensPerDay,
@@ -4950,13 +4963,15 @@ export default function AgentInterface({ surface = 'embedded', initialSdkSession
4950
4963
  workspaceId: source.workspace.id,
4951
4964
  teamId: source.team.id,
4952
4965
  objective: params.prompt.trim(),
4953
- contextAttachmentIds,
4966
+ contextAttachmentIds: [],
4954
4967
  expectedArtifacts,
4968
+ parentDepth,
4955
4969
  policy: {
4956
4970
  maxConcurrentChildRuns: 1,
4957
- maxChildDepth: 1,
4971
+ maxChildDepth: configuredMaxChildDepth,
4972
+ allowFurtherDelegation,
4958
4973
  cancellationPropagation: true,
4959
- contextAttachmentLimit: contextAttachmentIds.length || 1,
4974
+ contextAttachmentLimit: 20,
4960
4975
  ...(budgetLimits.length > 0 ? { maxTokens: Math.min(...budgetLimits) } : {}),
4961
4976
  ...(requestedMaxRuntimeMs ? { maxRuntimeMs: requestedMaxRuntimeMs } : {}),
4962
4977
  ...(requestedMaxCredits ? { maxCredits: requestedMaxCredits } : {}),
@@ -5010,6 +5025,18 @@ export default function AgentInterface({ surface = 'embedded', initialSdkSession
5010
5025
  childAgentId: target.id,
5011
5026
  },
5012
5027
  });
5028
+ // The canonical standalone/Hub host owns queueing and execution. Launching
5029
+ // again from this renderer would create a second turn for the same durable
5030
+ // run. Legacy bridges omit this flag and retain their existing adapter path.
5031
+ if (createRunResult.hostManaged === true) {
5032
+ return {
5033
+ success: true,
5034
+ targetAgentName: target.name,
5035
+ reply: `${subagentRunId} queued.`,
5036
+ targetConversationId: childConversationId,
5037
+ subagentRunId,
5038
+ };
5039
+ }
5013
5040
  const targetModel = target.model || MAIN_ASSISTANT_MODEL;
5014
5041
  const delegationSystem = buildDelegationSystemPrompt({
5015
5042
  target,
@@ -5023,7 +5050,7 @@ export default function AgentInterface({ surface = 'embedded', initialSdkSession
5023
5050
  `Output: ${expectedArtifacts.join(', ')}`,
5024
5051
  requestedMaxTokens ? `Tokens: ${requestedMaxTokens}` : null,
5025
5052
  requestedMaxRuntimeMs ? `Time: ${Math.round(requestedMaxRuntimeMs / 1000)}s` : null,
5026
- contextNote ? `Context:\n${contextNote}` : null,
5053
+ inheritedContext ? `Selected parent context:\n${inheritedContext}` : null,
5027
5054
  ].filter((line) => !!line).join('\n\n');
5028
5055
  const delegationCaller = {
5029
5056
  workspaceId: source.workspace.id,
@@ -7983,7 +8010,7 @@ export default function AgentInterface({ surface = 'embedded', initialSdkSession
7983
8010
  }, teamId: settingsPanel.teamId, teamName: teamForSettings?.name || settingsPanel.teamName, onClose: handleCloseSettings, onDelete: handleDeleteFromSettings }));
7984
8011
  }
7985
8012
  if (viewMode === 'inbox') {
7986
- return (_jsx(React.Suspense, { fallback: _jsx("div", { className: "flex h-full items-center justify-center text-[12px] text-white/35", children: "Loading chat..." }), children: _jsx(AgentView, { agentId: MAIN_ASSISTANT_ID, conversationId: selectedInboxConversationId, isMainAssistant: true, agentName: MAIN_ASSISTANT_NAME, model: MAIN_ASSISTANT_MODEL, templateName: "Main Assistant", workspaceName: "All Workspaces", teamName: "Global", systemPrompt: enrichedMainSystemPromptWithCodeContext, capabilities: { terminal: true, fileRead: true, fileWrite: true, appLaunch: true }, permissionProfile: "standard", allowedDirectories: [], approvalRules: [], allowedApps: [], teamAgents: [], onCreateWorkspace: handleMainCreateWorkspace, onCreateTeam: handleMainCreateTeam, onCreateTeamAgent: handleMainCreateTeamAgent, onGetInboxWorkspaceOptions: handleGetInboxWorkspaceOptions, onBindInboxConversationToWorkspace: handleBindInboxConversationToWorkspace, onOpenReassignedConversation: handleOpenReassignedConversation, onOpenEditorPath: handleOpenEditorPath, onOpenEditorDiff: handleOpenEditorDiff, onPeekEditorPath: handlePeekEditorPath, onPeekEditorDiff: handlePeekEditorDiff, renderWorkbenchPanel: false, onOpenConversationSettings: handleSelectSidebarSettings, externalInputLockReason: providerSessionTuiInputLockReason, onConversationCreated: activateSessionConversation }) }));
8013
+ return (_jsx(React.Suspense, { fallback: _jsx("div", { className: "flex h-full items-center justify-center text-[12px] text-white/35", children: "Loading chat..." }), children: _jsx(AgentView, { agentId: MAIN_ASSISTANT_ID, conversationId: selectedInboxConversationId, isMainAssistant: true, agentName: MAIN_ASSISTANT_NAME, model: MAIN_ASSISTANT_MODEL, templateName: "Main Assistant", workspaceName: "All Workspaces", teamName: "Global", systemPrompt: enrichedMainSystemPromptWithCodeContext, capabilities: { terminal: true, fileRead: true, fileWrite: true, appLaunch: true }, permissionProfile: "standard", allowedDirectories: [], approvalRules: [], allowedApps: [], teamAgents: [], onCreateWorkspace: handleMainCreateWorkspace, onCreateTeam: handleMainCreateTeam, onCreateTeamAgent: handleMainCreateTeamAgent, onGetInboxWorkspaceOptions: handleGetInboxWorkspaceOptions, onBindInboxConversationToWorkspace: handleBindInboxConversationToWorkspace, onOpenReassignedConversation: handleOpenReassignedConversation, onOpenEditorPath: handleOpenEditorPath, onOpenEditorDiff: handleOpenEditorDiff, onPeekEditorPath: handlePeekEditorPath, onPeekEditorDiff: handlePeekEditorDiff, renderWorkbenchPanel: false, onOpenConversationSettings: handleSelectSidebarSettings, externalInputLockReason: providerSessionTuiInputLockReason, onConversationCreated: activateSessionConversation, onNavigateConversation: activateSessionConversation }) }));
7987
8014
  }
7988
8015
  // If an agent is selected, show the chat view.
7989
8016
  // Conversation is created lazily on first message send.
@@ -8046,7 +8073,7 @@ export default function AgentInterface({ surface = 'embedded', initialSdkSession
8046
8073
  selectedBy: 'user'
8047
8074
  }
8048
8075
  });
8049
- }, renderWorkbenchPanel: false, onOpenConversationSettings: handleSelectSidebarSettings, onConversationCreated: activateSessionConversation }) }));
8076
+ }, renderWorkbenchPanel: false, onOpenConversationSettings: handleSelectSidebarSettings, onConversationCreated: activateSessionConversation, onNavigateConversation: activateSessionConversation }) }));
8050
8077
  }
8051
8078
  // Plugins view
8052
8079
  if (viewMode === 'plugins') {