@parhelia/core 0.1.12774 → 0.1.12776

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 (88) hide show
  1. package/dist/agents-view/AgentsInbox.d.ts +5 -1
  2. package/dist/agents-view/AgentsInbox.js +5 -3
  3. package/dist/agents-view/AgentsInbox.js.map +1 -1
  4. package/dist/agents-view/AgentsView.js +29 -13
  5. package/dist/agents-view/AgentsView.js.map +1 -1
  6. package/dist/config/config.js +6 -5
  7. package/dist/config/config.js.map +1 -1
  8. package/dist/config/types.d.ts +1 -0
  9. package/dist/config/types.js.map +1 -1
  10. package/dist/editor/ai/AgentTerminal.js +85 -12
  11. package/dist/editor/ai/AgentTerminal.js.map +1 -1
  12. package/dist/editor/ai/AgentTerminalStatusBar.js +27 -31
  13. package/dist/editor/ai/AgentTerminalStatusBar.js.map +1 -1
  14. package/dist/editor/ai/AiResponseMessage.js +2 -2
  15. package/dist/editor/ai/AiResponseMessage.js.map +1 -1
  16. package/dist/editor/ai/HeartbeatMessage.js +2 -2
  17. package/dist/editor/ai/HeartbeatMessage.js.map +1 -1
  18. package/dist/editor/ai/QueuedPromptsPanel.js +3 -2
  19. package/dist/editor/ai/QueuedPromptsPanel.js.map +1 -1
  20. package/dist/editor/ai/SpawnedAgentsPanel.js +2 -2
  21. package/dist/editor/ai/SpawnedAgentsPanel.js.map +1 -1
  22. package/dist/editor/ai/TimeWithTooltip.d.ts +9 -0
  23. package/dist/editor/ai/TimeWithTooltip.js +12 -0
  24. package/dist/editor/ai/TimeWithTooltip.js.map +1 -0
  25. package/dist/editor/ai/ToolCallDisplay.js +6 -3
  26. package/dist/editor/ai/ToolCallDisplay.js.map +1 -1
  27. package/dist/editor/ai/UserMessage.js +3 -3
  28. package/dist/editor/ai/UserMessage.js.map +1 -1
  29. package/dist/editor/ai/agentDiagnostics.js +2 -1
  30. package/dist/editor/ai/agentDiagnostics.js.map +1 -1
  31. package/dist/editor/ai/agentDiagnostics.test.js +39 -1
  32. package/dist/editor/ai/agentDiagnostics.test.js.map +1 -1
  33. package/dist/editor/ai/agentMessageHelpers.d.ts +1 -0
  34. package/dist/editor/ai/agentMessageHelpers.js +6 -0
  35. package/dist/editor/ai/agentMessageHelpers.js.map +1 -1
  36. package/dist/editor/services/agentService.d.ts +8 -0
  37. package/dist/editor/services/agentService.js.map +1 -1
  38. package/dist/editor/services/aiService.d.ts +1 -1
  39. package/dist/editor/services/aiService.js +3 -2
  40. package/dist/editor/services/aiService.js.map +1 -1
  41. package/dist/editor/settings/QuotaInfo.js +29 -60
  42. package/dist/editor/settings/QuotaInfo.js.map +1 -1
  43. package/dist/editor/settings/QuotaUserPicker.d.ts +13 -0
  44. package/dist/editor/settings/QuotaUserPicker.js +58 -0
  45. package/dist/editor/settings/QuotaUserPicker.js.map +1 -0
  46. package/dist/editor/settings/SettingsBreadcrumb.d.ts +5 -1
  47. package/dist/editor/settings/SettingsBreadcrumb.js +3 -3
  48. package/dist/editor/settings/SettingsBreadcrumb.js.map +1 -1
  49. package/dist/editor/settings/SettingsHeaderActionsContext.d.ts +7 -1
  50. package/dist/editor/settings/SettingsHeaderActionsContext.js +22 -0
  51. package/dist/editor/settings/SettingsHeaderActionsContext.js.map +1 -1
  52. package/dist/editor/settings/SettingsView.js +17 -14
  53. package/dist/editor/settings/SettingsView.js.map +1 -1
  54. package/dist/editor/settings/panels/AgentsPanel.js +2 -4
  55. package/dist/editor/settings/panels/AgentsPanel.js.map +1 -1
  56. package/dist/editor/settings/panels/GroupedFieldConfigPanel.js +2 -8
  57. package/dist/editor/settings/panels/GroupedFieldConfigPanel.js.map +1 -1
  58. package/dist/editor/settings/panels/ItemConfigPanel.js +1 -1
  59. package/dist/editor/settings/panels/ItemConfigPanel.js.map +1 -1
  60. package/dist/editor/settings/panels/ModelsPanel.js +28 -14
  61. package/dist/editor/settings/panels/ModelsPanel.js.map +1 -1
  62. package/dist/editor/settings/panels/ProjectTemplateSelector.d.ts +2 -7
  63. package/dist/editor/settings/panels/ProjectTemplateSelector.js +6 -8
  64. package/dist/editor/settings/panels/ProjectTemplateSelector.js.map +1 -1
  65. package/dist/editor/settings/panels/ProjectTemplatesPanel.js +194 -31
  66. package/dist/editor/settings/panels/ProjectTemplatesPanel.js.map +1 -1
  67. package/dist/editor/settings/panels/ProviderIcon.d.ts +17 -0
  68. package/dist/editor/settings/panels/ProviderIcon.js +89 -0
  69. package/dist/editor/settings/panels/ProviderIcon.js.map +1 -0
  70. package/dist/editor/settings/panels/ProvidersPanel.js +17 -4
  71. package/dist/editor/settings/panels/ProvidersPanel.js.map +1 -1
  72. package/dist/editor/ui/SimpleTabs.js +28 -3
  73. package/dist/editor/ui/SimpleTabs.js.map +1 -1
  74. package/dist/editor/ui/Splitter.d.ts +1 -0
  75. package/dist/editor/ui/Splitter.js +7 -1
  76. package/dist/editor/ui/Splitter.js.map +1 -1
  77. package/dist/revision.d.ts +2 -2
  78. package/dist/revision.js +2 -2
  79. package/dist/task-board/TaskBoardWorkspace.js +1 -1
  80. package/dist/task-board/TaskBoardWorkspace.js.map +1 -1
  81. package/dist/task-board/components/ProjectDashboard.js +3 -3
  82. package/dist/task-board/components/ProjectDashboard.js.map +1 -1
  83. package/dist/task-board/components/ProjectPropertiesPanel.js +1 -1
  84. package/dist/task-board/components/ProjectPropertiesPanel.js.map +1 -1
  85. package/dist/task-board/views/DependencyGraphView.d.ts +9 -1
  86. package/dist/task-board/views/DependencyGraphView.js +124 -29
  87. package/dist/task-board/views/DependencyGraphView.js.map +1 -1
  88. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import React, { useEffect, useState, useRef, useCallback, useLayoutEffect, useMemo, } from "react";
3
3
  import { flushSync } from "react-dom";
4
- import { Send, AlertCircle, Loader2, Wand2, Square, Mic, MicOff, ChevronDown, ChevronUp, ArrowLeft, DollarSign, ExternalLink, Settings2, Target, X, Plus, } from "lucide-react";
4
+ import { Send, AlertCircle, Loader2, Wand2, Square, Mic, MicOff, ChevronDown, ChevronUp, ArrowLeft, DollarSign, ExternalLink, Settings2, Target, X, Plus, Lock, } from "lucide-react";
5
5
  import { getAgent, startAgent, claimAgentBrowser, cancelAgentDialog, assignAgentSkill, persistDraftAgent, updateAgentSettings, updateAgentCostLimit, updateAgentContext, getAgentSkillCatalog, getAgentAvailableTools, getAgentOperationAllowances, getAgentTriggerSubscriptions, cancelAgent, canonicalizeAgentMetadata, getPendingPrompts, getAgentDiagnostics, releaseAgentBrowser, rejectToolCall, revokeAgentSkill, isAgentReadOnly, } from "../services/agentService";
6
6
  import { parseAgentRunStatusData, parseAgentStatus, } from "../services/agentStatus";
7
7
  import { useEditContext, useFieldsEditContext } from "../client/editContext";
@@ -21,7 +21,7 @@ import { QueuedPromptsPanel } from "./QueuedPromptsPanel";
21
21
  import { AgentCapacityBanner, AgentCostLimitBanner, AgentErrorBanner, } from "./AgentBanners";
22
22
  import { InitialThinkingSplash } from "./InitialThinkingSplash";
23
23
  import { AgentInlineDialogContent } from "./AgentInlineDialogContent";
24
- import { AGENT_HISTORY_LIMIT, MACHINE_CAPACITY_REASON, buildPlaceholderAgentDetails, formatAllowanceLabel, formatAllowanceSource, getAgentRunMessageAgentId, getAgentRunMessageDetail, getAgentRunMessageSeq, isAgentErrorStatusValue, isFinishedServerExecutionStatus, isHeartbeatRunEventMessage, mergeAgentOperationHistory, normalizeDialogAgentId, normalizeProfileAllowanceOperations, normalizeServerExecutionStatus, } from "./agentMessageHelpers";
24
+ import { AGENT_HISTORY_LIMIT, MACHINE_CAPACITY_REASON, buildPlaceholderAgentDetails, formatAllowanceLabel, formatAllowanceSource, getAgentRunMessageAgentId, getAgentRunMessageDetail, getAgentRunMessageSeq, isInactiveServerExecutionStatus, isAgentErrorStatusValue, isHeartbeatRunEventMessage, mergeAgentOperationHistory, normalizeDialogAgentId, normalizeProfileAllowanceOperations, normalizeServerExecutionStatus, } from "./agentMessageHelpers";
25
25
  import { AgentDocumentList, } from "./AgentDocumentList";
26
26
  import { AgentEditOperationsPanel } from "./EditOperationsPanel";
27
27
  import { SpawnedAgentsPanel } from "./SpawnedAgentsPanel";
@@ -35,7 +35,7 @@ import { invalidateAiProfilesCache } from "../services/aiService";
35
35
  import { DIALOG_TYPES, } from "./dialogs/agentDialogTypes";
36
36
  import { Popover, PopoverContent, PopoverTrigger, } from "../../components/ui/popover";
37
37
  import { SecretAgentIcon } from "../ui/Icons";
38
- import { formatTime } from "../utils";
38
+ import { TimeWithTooltip } from "./TimeWithTooltip";
39
39
  import { cn } from "../../lib/utils";
40
40
  import { sanitizeSvg } from "../../lib/sanitize";
41
41
  import { Select } from "../../components/ui/select";
@@ -48,6 +48,35 @@ import { ScrollingContentTree } from "../ScrollingContentTree";
48
48
  import { requestAgentSubscriptionReplay, subscribeAgent, } from "../services/agentSubscriptionRegistry";
49
49
  import { registerMountedInstance, unregisterMountedInstance, setVisibleDialogEntry, clearVisibleDialogEntriesForInstance, updateInstanceFocus, isElectedDialogReceiver, } from "./agentDialogRegistry";
50
50
  const RECENT_RUN_EVENTS_LIMIT = 50;
51
+ const STOP_STALE_RUNNING_LOAD_SUPPRESSION_MS = 5000;
52
+ function getStaleRunningLoadSuppressionMap() {
53
+ const globalScope = globalThis;
54
+ globalScope.__parheliaAgentStopSuppressionByAgentId ??= new Map();
55
+ return globalScope.__parheliaAgentStopSuppressionByAgentId;
56
+ }
57
+ function markStaleRunningLoadSuppressed(agentId) {
58
+ if (!agentId)
59
+ return;
60
+ getStaleRunningLoadSuppressionMap().set(agentId, Date.now() + STOP_STALE_RUNNING_LOAD_SUPPRESSION_MS);
61
+ }
62
+ function clearStaleRunningLoadSuppression(agentId) {
63
+ if (!agentId)
64
+ return;
65
+ getStaleRunningLoadSuppressionMap().delete(agentId);
66
+ }
67
+ function hasStaleRunningLoadSuppression(agentId) {
68
+ if (!agentId)
69
+ return false;
70
+ const suppressionMap = getStaleRunningLoadSuppressionMap();
71
+ const suppressUntil = suppressionMap.get(agentId);
72
+ if (!suppressUntil)
73
+ return false;
74
+ if (suppressUntil <= Date.now()) {
75
+ suppressionMap.delete(agentId);
76
+ return false;
77
+ }
78
+ return true;
79
+ }
51
80
  // interface AgentTerminalProps {
52
81
  // agentStub: Agent;
53
82
  // }
@@ -74,6 +103,9 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, onReloadPr
74
103
  // Default to read-only while a persisted agent is loading so we don't briefly
75
104
  // render editable controls for a viewer who only has View access.
76
105
  const readOnly = isLoading ? true : isAgentReadOnly(agent);
106
+ const readOnlyAccessNotice = readOnly && !isLoading ? (_jsxs("div", { className: "flex items-start gap-2 border-b border-amber-200 bg-amber-50 px-4 py-2 text-[11px] text-amber-800", "data-testid": "agent-read-only-access-notice", children: [_jsx(Lock, { className: "mt-0.5 h-3.5 w-3.5 shrink-0", strokeWidth: 1.5 }), _jsxs("div", { className: "min-w-0", children: [_jsx("span", { className: "font-medium", children: "View-only access." }), " ", "You can inspect this agent, but sending prompts, stopping runs, and changing settings require Full access", agent?.ownerName || agent?.userId
107
+ ? ` from ${agent.ownerName || agent.userId}`
108
+ : "", "."] })] })) : null;
77
109
  const [activePlaceholderInput, setActivePlaceholderInput] = useState(null);
78
110
  const [allPlaceholdersFilled, setAllPlaceholdersFilled] = useState(false);
79
111
  const [agentMetadata, setAgentMetadata] = useState(null);
@@ -197,8 +229,12 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, onReloadPr
197
229
  // while a stop operation is in progress. This prevents race conditions where
198
230
  // messages arriving during the stop process could flip the UI back to "executing".
199
231
  const isStoppingRef = useRef(false);
232
+ const latestAgentStatusRef = useRef(agent?.status);
200
233
  const [isStopGuardActive, setIsStopGuardActive] = useState(false);
201
234
  const stopGuardReleaseTimeoutRef = useRef(null);
235
+ useEffect(() => {
236
+ latestAgentStatusRef.current = agent?.status;
237
+ }, [agent?.status]);
202
238
  function clearStopGuard() {
203
239
  isStoppingRef.current = false;
204
240
  setIsStopGuardActive(false);
@@ -2436,7 +2472,16 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, onReloadPr
2436
2472
  return [];
2437
2473
  }),
2438
2474
  ]);
2439
- setAgent(agentData);
2475
+ const serverReturnedRunning = agentData.status === "running" || agentData.status === 1;
2476
+ const hasSuppressedRunningLoad = hasStaleRunningLoadSuppression(agentStub.id);
2477
+ const isStaleRunningLoadDuringStop = serverReturnedRunning &&
2478
+ (isStoppingRef.current || hasSuppressedRunningLoad);
2479
+ if (!serverReturnedRunning) {
2480
+ clearStaleRunningLoadSuppression(agentStub.id);
2481
+ }
2482
+ setAgent(isStaleRunningLoadDuringStop
2483
+ ? { ...agentData, status: "idle", statusMessage: undefined }
2484
+ : agentData);
2440
2485
  setQueuedPrompts(prompts);
2441
2486
  // Merge database messages with any existing local messages using ID-based deduplication
2442
2487
  // This prevents both missing messages and duplicates
@@ -3058,6 +3103,10 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, onReloadPr
3058
3103
  ? statusData.message.trim() || null
3059
3104
  : null;
3060
3105
  if (normalizedStatus === "idle") {
3106
+ const wasStopping = isStoppingRef.current;
3107
+ if (wasStopping) {
3108
+ markStaleRunningLoadSuppressed(agentStub.id);
3109
+ }
3061
3110
  clearStopGuard();
3062
3111
  setLastRunStatusReason(null);
3063
3112
  setError(null);
@@ -3081,6 +3130,9 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, onReloadPr
3081
3130
  messagesRef.current = updated;
3082
3131
  return updated;
3083
3132
  });
3133
+ if (wasStopping) {
3134
+ return;
3135
+ }
3084
3136
  void reconcileServerStateRef.current?.();
3085
3137
  return;
3086
3138
  }
@@ -3946,6 +3998,7 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, onReloadPr
3946
3998
  return;
3947
3999
  }
3948
4000
  clearStopGuard();
4001
+ clearStaleRunningLoadSuppression(agentStub.id);
3949
4002
  const hadQuestionnaireDialogOpen = activeInlineDialogRef.current?.request.dialogType === "questionnaire";
3950
4003
  const suppressedQueuedPromptToken = hadQuestionnaireDialogOpen && savedPrompt
3951
4004
  ? registerSuppressedQueuedPrompt(agentId, savedPrompt)
@@ -4837,6 +4890,7 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, onReloadPr
4837
4890
  return;
4838
4891
  }
4839
4892
  try {
4893
+ markStaleRunningLoadSuppressed(agentStub.id);
4840
4894
  // 1. Set the stopping guard to prevent WebSocket handlers from re-enabling states
4841
4895
  // This must happen FIRST, before any other state changes
4842
4896
  armStopGuard();
@@ -4863,7 +4917,10 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, onReloadPr
4863
4917
  // Wait for backend confirmation to ensure agent actually stopped
4864
4918
  if (agentStub?.id) {
4865
4919
  try {
4866
- await cancelAgent(agentStub.id);
4920
+ const cancelResult = await cancelAgent(agentStub.id);
4921
+ if (cancelResult?.success !== false) {
4922
+ markStaleRunningLoadSuppressed(agentStub.id);
4923
+ }
4867
4924
  }
4868
4925
  catch (err) {
4869
4926
  console.error("Failed to cancel agent on backend:", err);
@@ -4875,7 +4932,17 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, onReloadPr
4875
4932
  catch (e) {
4876
4933
  console.error("Failed to stop agent execution", e);
4877
4934
  }
4878
- }, []);
4935
+ }, [
4936
+ agent?.canManage,
4937
+ agent?.effectiveAccessLevel,
4938
+ agent?.id,
4939
+ agent?.status,
4940
+ agentStub.id,
4941
+ agentStub.status,
4942
+ isLoading,
4943
+ mode,
4944
+ readOnly,
4945
+ ]);
4879
4946
  // Cost limit is owned by the persisted agent record. Profiles can provide defaults
4880
4947
  // during creation, but once an agent exists the frontend should only display the
4881
4948
  // backend-provided value for that specific agent.
@@ -5051,9 +5118,15 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, onReloadPr
5051
5118
  }
5052
5119
  lastDiagnosticsResponseRef.current = diagnostics;
5053
5120
  const serverStatus = diagnostics.execution?.status;
5054
- if (isFinishedServerExecutionStatus(serverStatus)) {
5121
+ if (isInactiveServerExecutionStatus(serverStatus)) {
5055
5122
  setShowStaleAgentBanner(false);
5056
- settleCompletedRun(normalizeServerExecutionStatus(serverStatus) === "cancelled"
5123
+ const lastRunRequestedAt = Date.parse(diagnostics.lastRunRequest?.requestedAt || "");
5124
+ const cancelRequestedAt = Date.parse(diagnostics.lastCancellation?.requestedAt || "");
5125
+ const cancellationAppliesToCurrentRun = Number.isFinite(cancelRequestedAt) &&
5126
+ (!Number.isFinite(lastRunRequestedAt) ||
5127
+ cancelRequestedAt >= lastRunRequestedAt);
5128
+ settleCompletedRun(normalizeServerExecutionStatus(serverStatus) === "cancelled" ||
5129
+ cancellationAppliesToCurrentRun
5057
5130
  ? "cancelled"
5058
5131
  : "completed");
5059
5132
  return;
@@ -5515,7 +5588,7 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, onReloadPr
5515
5588
  const summaryOperations = latestSummaryAssistantGroup
5516
5589
  ? getOperationsForMessageGroup(summaryMessages, agentOperations)
5517
5590
  : [];
5518
- return (_jsxs("div", { className: `flex h-full min-h-0 flex-col ${className || ""}`, children: [fixedBrowserClaimBanner, error &&
5591
+ return (_jsxs("div", { className: `flex h-full min-h-0 flex-col ${className || ""}`, children: [fixedBrowserClaimBanner, readOnlyAccessNotice, error &&
5519
5592
  !isAgentErrorStatusValue((agent || agentStub)?.status) && (_jsx("div", { className: "m-4 rounded-lg border-l-4 border-red-500 bg-red-50 p-3 select-text", children: _jsxs("div", { className: "flex items-start", children: [_jsx(AlertCircle, { className: "mt-0.5 h-5 w-5 text-red-400", strokeWidth: 1 }), _jsxs("div", { className: "ml-3", children: [_jsx("p", { className: "text-[11px] font-medium text-red-800", children: "Error" }), _jsx("p", { className: "mt-1 text-[11px] text-red-700", children: error })] })] }) })), renderCapacityBanner(), renderErrorBanner(), renderStaleAgentBanner(), _jsxs("div", { ref: messagesContainerRef, className: "flex-1 overflow-y-auto", onScroll: handleScroll, children: [showInitialThinkingSplash && (_jsx(InitialThinkingSplash, { svgIcon: activeProfile?.svgIcon })), inlineBrowserClaimBanner, inlineDialog ? (inlineDialog) : latestSummaryAssistantGroup ? (_jsx("div", { className: "space-y-0 divide-y divide-gray-100 select-text", children: _jsx(AiResponseMessage, { messages: summaryMessages, finished: !latestSummaryAssistantGroup.isLastGroup || !isExecuting, editOperations: summaryOperations, defaultCollapseJson: defaultCollapseJson, profileSvgIcon: activeProfile?.svgIcon, agentId: agent?.id || agentStub.id, agentName: activeProfile?.agentName ||
5520
5593
  activeProfile?.displayTitle ||
5521
5594
  activeProfile?.name, allPendingApprovals: allPendingApprovals, onSwitchToAutonomous: handleSwitchToAutonomous, browserCaptureInlinePrompt: browserCaptureInlinePrompt, readOnly: readOnly, onQuickAction: (action) => {
@@ -5544,7 +5617,7 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, onReloadPr
5544
5617
  } })) : (_jsx(SecretAgentIcon, { size: 20, strokeWidth: 1, className: "text-gray-2" })) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "mb-1 flex items-center gap-2", children: [_jsx("span", { className: "text-dark text-xs font-medium", children: activeProfile?.agentName ||
5545
5618
  activeProfile?.displayTitle ||
5546
5619
  activeProfile?.name ||
5547
- "Agent" }), _jsx("span", { className: "text-xs text-gray-400", children: formatTime(new Date()) })] }), _jsxs("div", { className: "flex items-center gap-1 pt-2", children: [_jsx("div", { className: "h-1 w-1 animate-bounce rounded-full bg-gray-400 [animation-delay:-0.3s]" }), _jsx("div", { className: "h-1 w-1 animate-bounce rounded-full bg-gray-400 [animation-delay:-0.15s]" }), _jsx("div", { className: "h-1 w-1 animate-bounce rounded-full bg-gray-400" })] })] })] })), _jsx("div", { ref: messagesEndRef })] }), showSummaryInput && !activeInlineDialog ? (_jsxs("div", { className: cn("border-t border-gray-200 p-4", simpleMode && "pb-10"), children: [activePlaceholderInput ? (_jsx(PlaceholderInput, { ref: placeholderInputRef, text: activePlaceholderInput.text, showButtons: hideBottomControls, buttonsClassName: hideBottomControls ? "justify-end" : "", onFilledChange: setAllPlaceholdersFilled, onComplete: (filledText) => {
5620
+ "Agent" }), _jsx(TimeWithTooltip, { date: new Date(), className: "text-xs text-gray-400" })] }), _jsxs("div", { className: "flex items-center gap-1 pt-2", children: [_jsx("div", { className: "h-1 w-1 animate-bounce rounded-full bg-gray-400 [animation-delay:-0.3s]" }), _jsx("div", { className: "h-1 w-1 animate-bounce rounded-full bg-gray-400 [animation-delay:-0.15s]" }), _jsx("div", { className: "h-1 w-1 animate-bounce rounded-full bg-gray-400" })] })] })] })), _jsx("div", { ref: messagesEndRef })] }), showSummaryInput && !activeInlineDialog ? (_jsxs("div", { className: cn("border-t border-gray-200 p-4", simpleMode && "pb-10"), children: [activePlaceholderInput ? (_jsx(PlaceholderInput, { ref: placeholderInputRef, text: activePlaceholderInput.text, showButtons: hideBottomControls, buttonsClassName: hideBottomControls ? "justify-end" : "", onFilledChange: setAllPlaceholdersFilled, onComplete: (filledText) => {
5548
5621
  const shouldSubmitFilledText = shouldSubmitFilledPlaceholderInputRef.current ||
5549
5622
  activePlaceholderInput.behavior !== "compose" ||
5550
5623
  hideBottomControls;
@@ -5731,7 +5804,7 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, onReloadPr
5731
5804
  } })) : (_jsx(SecretAgentIcon, { size: 20, strokeWidth: 1, className: "text-gray-2" })) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "mb-1 flex items-center gap-2", children: [_jsx("span", { className: "text-dark text-xs font-medium", children: activeProfile?.agentName ||
5732
5805
  activeProfile?.displayTitle ||
5733
5806
  activeProfile?.name ||
5734
- "Agent" }), _jsx("span", { className: "text-xs text-gray-400", children: formatTime(new Date()) })] }), _jsxs("div", { className: "flex items-center gap-1 pt-2", children: [_jsx("div", { className: "h-1 w-1 animate-bounce rounded-full bg-gray-400 [animation-delay:-0.3s]" }), _jsx("div", { className: "h-1 w-1 animate-bounce rounded-full bg-gray-400 [animation-delay:-0.15s]" }), _jsx("div", { className: "h-1 w-1 animate-bounce rounded-full bg-gray-400" })] })] })] }))] }), !simpleMode && renderCostLimitBanner(), _jsx("div", { ref: messagesEndRef })] }), !hideContext &&
5807
+ "Agent" }), _jsx(TimeWithTooltip, { date: new Date(), className: "text-xs text-gray-400" })] }), _jsxs("div", { className: "flex items-center gap-1 pt-2", children: [_jsx("div", { className: "h-1 w-1 animate-bounce rounded-full bg-gray-400 [animation-delay:-0.3s]" }), _jsx("div", { className: "h-1 w-1 animate-bounce rounded-full bg-gray-400 [animation-delay:-0.15s]" }), _jsx("div", { className: "h-1 w-1 animate-bounce rounded-full bg-gray-400" })] })] })] }))] }), !simpleMode && renderCostLimitBanner(), _jsx("div", { ref: messagesEndRef })] }), !hideContext &&
5735
5808
  !simpleMode &&
5736
5809
  (editContext?.isMobile ? (_jsx("div", { className: "border-t border-gray-200 bg-gray-50", "data-testid": "agent-context-panel-tabs", children: _jsx(SimpleTabs, { tabs: [
5737
5810
  {
@@ -5797,7 +5870,7 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, onReloadPr
5797
5870
  ], direction: "vertical", localStorageKey: compact
5798
5871
  ? "agent-terminal-compact-questionnaire-splitter"
5799
5872
  : "agent-terminal-questionnaire-splitter", className: "min-h-0 flex-1", splitterClassName: "bg-gray-200 hover:bg-gray-300" })) : (_jsxs(_Fragment, { children: [fullModeUpperContent, fullModeInlineDialog] }));
5800
- return loadingContent ? (loadingContent) : displayMode === "summary" && summaryModeContent ? (summaryModeContent) : (_jsxs("div", { className: `flex h-full min-h-0 flex-col ${className || ""}`, children: [parentAgentId && !simpleMode && (_jsx("div", { className: "border-b border-gray-200 bg-gray-50 px-4 py-2", children: _jsxs("button", { onClick: handleBackToParent, className: "flex items-center gap-2 text-[11px] text-gray-600 transition-colors hover:text-gray-900", title: "Back to parent agent", children: [_jsx(ArrowLeft, { className: "h-3.5 w-3.5", strokeWidth: 1.5 }), _jsx("span", { children: "Back to parent agent" })] }) })), fullModeContent, _jsxs("div", { className: cn("border-t border-gray-200 p-4", simpleMode && "pb-10"), children: [activePlaceholderInput ? (
5873
+ return loadingContent ? (loadingContent) : displayMode === "summary" && summaryModeContent ? (summaryModeContent) : (_jsxs("div", { className: `flex h-full min-h-0 flex-col ${className || ""}`, children: [parentAgentId && !simpleMode && (_jsx("div", { className: "border-b border-gray-200 bg-gray-50 px-4 py-2", children: _jsxs("button", { onClick: handleBackToParent, className: "flex items-center gap-2 text-[11px] text-gray-600 transition-colors hover:text-gray-900", title: "Back to parent agent", children: [_jsx(ArrowLeft, { className: "h-3.5 w-3.5", strokeWidth: 1.5 }), _jsx("span", { children: "Back to parent agent" })] }) })), readOnlyAccessNotice, fullModeContent, _jsxs("div", { className: cn("border-t border-gray-200 p-4", simpleMode && "pb-10"), children: [activePlaceholderInput ? (
5801
5874
  // Placeholder Input (from quick actions)
5802
5875
  // Show internal buttons only in splash mode (hideBottomControls) since external buttons won't be visible there
5803
5876
  _jsx(PlaceholderInput, { ref: placeholderInputRef, text: activePlaceholderInput.text, showButtons: hideBottomControls, buttonsClassName: hideBottomControls ? "justify-end" : "", onFilledChange: setAllPlaceholdersFilled, onComplete: (filledText) => {