@parhelia/core 0.1.12267 → 0.1.12272

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.
@@ -64,6 +64,6 @@ export function MobileLayout(props) {
64
64
  });
65
65
  }
66
66
  return (_jsxs("div", { className: cn("flex flex-col select-none", className), "data-testid": "mobile-layout", children: [props.workspace?.titlebar, props.workspace?.toolbarFactory &&
67
- props.workspace?.toolbarFactory(editContext), _jsx(Splitter, { panels: panels, direction: "vertical", className: "flex-1", localStorageKey: "mobile-layout-splitter" }), !props.workspace?.hideToolbar && (_jsx("div", { className: "flex flex-row items-center gap-1.5 border-r border-gray-200 bg-gray-50/50 p-1.5", children: _jsx(WorkspaceRailMobile, {}) }))] }));
67
+ props.workspace?.toolbarFactory(editContext), _jsx(Splitter, { panels: panels, direction: "vertical", className: "flex-1", localStorageKey: "mobile-layout-splitter" }), !props.workspace?.hideToolbar && (_jsx("div", { className: "flex flex-row items-center gap-1.5 border-r border-gray-200 bg-gray-50/50 p-1.5 pb-[max(0.375rem,env(safe-area-inset-bottom))]", "data-testid": "bottom-row", children: _jsx(WorkspaceRailMobile, {}) }))] }));
68
68
  }
69
69
  //# sourceMappingURL=MobileLayout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MobileLayout.js","sourceRoot":"","sources":["../../src/editor/MobileLayout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAiB,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,MAAM,UAA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694,6 +694,7 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
694
694
  const [isListening, setIsListening] = useState(false);
695
695
  const recognitionRef = useRef(null);
696
696
  const prevPlaceholderRef = useRef(null);
697
+ const promptBeforeVoiceRef = useRef("");
697
698
  // Voice button press-and-hold tracking
698
699
  const voicePressStartRef = useRef(null);
699
700
  const voiceHoldTimerRef = useRef(null);
@@ -769,7 +770,7 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
769
770
  const [resolvedComponentName, setResolvedComponentName] = useState(undefined);
770
771
  const [resolvedFieldName, setResolvedFieldName] = useState(undefined);
771
772
  const [promptHistory, setPromptHistory] = useState(() => {
772
- return localStorageService.getItem("editor.agent.promptHistory") || [];
773
+ return (localStorageService.getItem("editor.agent.promptHistory") || []);
773
774
  });
774
775
  const [currentHistoryIndex, setCurrentHistoryIndex] = useState(-1);
775
776
  const [showPredefined, setShowPredefined] = useState(false);
@@ -1004,7 +1005,9 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
1004
1005
  .filter((x) => x.length > 0);
1005
1006
  }, [agentMetadata]);
1006
1007
  const backendAssignedSkillIds = useMemo(() => {
1007
- const rawSkillIds = agent?.assignedSkillIds ?? agent?.AssignedSkillIds ?? [];
1008
+ const rawSkillIds = agent?.assignedSkillIds ??
1009
+ agent?.AssignedSkillIds ??
1010
+ [];
1008
1011
  if (!Array.isArray(rawSkillIds)) {
1009
1012
  return [];
1010
1013
  }
@@ -1269,20 +1272,29 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
1269
1272
  r.lang = editContext?.currentItemDescriptor?.language || "en-US";
1270
1273
  r.continuous = true;
1271
1274
  r.interimResults = true;
1275
+ promptBeforeVoiceRef.current = prompt;
1272
1276
  r.onstart = () => {
1273
1277
  setIsListening(true);
1274
1278
  prevPlaceholderRef.current = inputPlaceholder;
1275
1279
  setInputPlaceholder("Listening...");
1276
1280
  };
1281
+ // Desktop Chrome: single result at index 0, transitions interim→final once.
1282
+ // Mobile Chrome: new result index per event, ALL immediately isFinal,
1283
+ // each containing the full cumulative transcript. We always take the last
1284
+ // non-empty final result and REPLACE the prompt to handle both patterns.
1277
1285
  r.onresult = (event) => {
1278
- let finalText = "";
1286
+ let lastFinalTranscript = "";
1279
1287
  let interimText = "";
1280
- for (let i = event.resultIndex; i < event.results.length; i++) {
1288
+ for (let i = event.results.length - 1; i >= 0; i--) {
1281
1289
  const res = event.results[i];
1282
- if (res.isFinal)
1283
- finalText += res[0]?.transcript || "";
1284
- else
1285
- interimText += res[0]?.transcript || "";
1290
+ if (res.isFinal &&
1291
+ !lastFinalTranscript &&
1292
+ (res[0]?.transcript || "").trim()) {
1293
+ lastFinalTranscript = res[0].transcript;
1294
+ }
1295
+ if (!res.isFinal) {
1296
+ interimText = (res[0]?.transcript || "") + interimText;
1297
+ }
1286
1298
  }
1287
1299
  if (interimText) {
1288
1300
  setInputPlaceholder(`Listening... ${interimText.trim()}`);
@@ -1290,11 +1302,11 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
1290
1302
  else {
1291
1303
  setInputPlaceholder("Listening...");
1292
1304
  }
1293
- if (finalText && finalText.trim()) {
1294
- setPrompt((prev) => {
1295
- const prefix = prev && !prev.endsWith(" ") ? prev + " " : prev;
1296
- return (prefix || "") + finalText.trim() + " ";
1297
- });
1305
+ const base = promptBeforeVoiceRef.current;
1306
+ const separator = base && !base.endsWith(" ") ? " " : "";
1307
+ const recognized = lastFinalTranscript.trim();
1308
+ if (recognized) {
1309
+ setPrompt(base + separator + recognized + " ");
1298
1310
  if (textareaRef.current) {
1299
1311
  try {
1300
1312
  const v = textareaRef.current.value || "";
@@ -2125,9 +2137,7 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
2125
2137
  }
2126
2138
  })();
2127
2139
  // Create context with top-level properties (what ContextInfoBar expects)
2128
- const localCtx = item && shouldSeedContext
2129
- ? buildEditorContextPayload(item)
2130
- : null;
2140
+ const localCtx = item && shouldSeedContext ? buildEditorContextPayload(item) : null;
2131
2141
  let nextMetadata = null;
2132
2142
  if (initialMetadata) {
2133
2143
  // Merge initial metadata with local context (using top-level structure)
@@ -4088,10 +4098,7 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
4088
4098
  // Return context even without item - we want view info regardless
4089
4099
  const item = editContext?.currentItemDescriptor;
4090
4100
  return buildEditorContextPayload(item);
4091
- }, [
4092
- buildEditorContextPayload,
4093
- editContext?.currentItemDescriptor,
4094
- ]);
4101
+ }, [buildEditorContextPayload, editContext?.currentItemDescriptor]);
4095
4102
  // Live context updates: watch for changes and update agent context when in "live" mode
4096
4103
  const previousContextRef = useRef("");
4097
4104
  useEffect(() => {
@@ -4455,122 +4462,129 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
4455
4462
  }
4456
4463
  return null;
4457
4464
  }, [messages, hideSummaryMessages]);
4458
- const summaryModeContent = displayMode === "summary" ? (() => {
4459
- const inlineDialog = renderInlineDialogContent();
4460
- const summaryMessages = latestSummaryAssistantGroup
4461
- ? convertAgentMessagesToAiFormat(latestSummaryAssistantGroup.messages)
4462
- : [];
4463
- const summaryOperations = latestSummaryAssistantGroup
4464
- ? getOperationsForMessageGroup(summaryMessages, agentOperations)
4465
- : [];
4466
- return (_jsxs("div", { className: `flex h-full min-h-0 flex-col ${className || ""}`, children: [_jsxs("div", { ref: messagesContainerRef, className: "flex-1 overflow-y-auto", onScroll: handleScroll, children: [error && (_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 })] })] }) })), messages.length === 0 &&
4467
- !error &&
4468
- hideGreeting &&
4469
- (isSubmitting || isConnecting) && (_jsx("div", { className: "flex h-full items-center justify-center p-8", children: _jsxs("div", { className: "flex flex-col items-center gap-4", children: [activeProfile?.svgIcon ? (_jsx("div", { className: "flex h-16 w-16 items-center justify-center text-gray-400 [&>svg]:h-full [&>svg]:w-full", dangerouslySetInnerHTML: {
4470
- __html: activeProfile.svgIcon,
4471
- } })) : (_jsx(SecretAgentIcon, { size: 64, strokeWidth: 1, className: "text-gray-400" })), _jsxs("div", { className: "flex items-center gap-1", children: [_jsx("span", { className: "h-2 w-2 animate-bounce rounded-full bg-gray-400 [animation-delay:-0.3s]" }), _jsx("span", { className: "h-2 w-2 animate-bounce rounded-full bg-gray-400 [animation-delay:-0.15s]" }), _jsx("span", { className: "h-2 w-2 animate-bounce rounded-full bg-gray-400" })] })] }) })), renderErrorBanner(), 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, error: error || undefined, profileSvgIcon: activeProfile?.svgIcon, agentId: agent?.id || agentStub.id, agentName: activeProfile?.agentName ||
4472
- activeProfile?.displayTitle ||
4473
- activeProfile?.name, allPendingApprovals: allPendingApprovals, onSwitchToAutonomous: handleSwitchToAutonomous, onQuickAction: (action) => {
4474
- const text = (action.prompt ||
4475
- action.value ||
4476
- action.label ||
4477
- "").trim();
4478
- if (!text)
4479
- return;
4480
- if (isExecuting) {
4481
- try {
4482
- handleStop();
4483
- }
4484
- catch { }
4485
- }
4486
- sendQuickMessage(text);
4487
- } }) })) : hideSummaryWaitingPlaceholder ? (_jsx("div", { className: "flex h-full min-h-[220px] items-center justify-center p-6", children: summaryPlaceholderActions ? (_jsx("div", { className: "flex justify-center", children: summaryPlaceholderActions })) : null })) : (_jsx("div", { className: "flex h-full min-h-[220px] items-center justify-center p-6", children: _jsxs("div", { className: "max-w-md rounded-xl border border-slate-200 bg-slate-50 px-5 py-4 text-center text-sm text-slate-600", children: [_jsx("div", { children: shouldShowThinkingDots || isExecuting
4488
- ? "The agent is still working. The next update will appear here automatically."
4489
- : agent?.statusMessage || "Waiting for the next agent update." }), summaryPlaceholderActions ? (_jsx("div", { className: "mt-3 flex justify-center", children: summaryPlaceholderActions })) : null] }) })), shouldShowThinkingDots &&
4490
- !inlineDialog &&
4491
- !latestSummaryAssistantGroup && (_jsxs("div", { className: "flex gap-3 px-4 py-3", "data-testid": "agent-thinking-dots", children: [_jsx("div", { className: "shrink-0", children: activeProfile?.svgIcon ? (_jsx("div", { className: "text-gray-2 flex h-6 w-6 items-center justify-center [&>svg]:h-full [&>svg]:w-full", dangerouslySetInnerHTML: {
4492
- __html: activeProfile.svgIcon,
4493
- } })) : (_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 ||
4494
- activeProfile?.displayTitle ||
4495
- activeProfile?.name ||
4496
- "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) => {
4497
- setActivePlaceholderInput(null);
4498
- setAllPlaceholdersFilled(false);
4499
- if (activePlaceholderInput.behavior === "compose" &&
4500
- !hideBottomControls) {
4501
- setPrompt(filledText);
4502
- setInputPlaceholder("Review and edit, then press Enter to send");
4503
- if (textareaRef.current) {
4504
- try {
4505
- textareaRef.current.focus();
4506
- const v = textareaRef.current.value || "";
4507
- textareaRef.current.selectionStart = v.length;
4508
- textareaRef.current.selectionEnd = v.length;
4465
+ const summaryModeContent = displayMode === "summary"
4466
+ ? (() => {
4467
+ const inlineDialog = renderInlineDialogContent();
4468
+ const summaryMessages = latestSummaryAssistantGroup
4469
+ ? convertAgentMessagesToAiFormat(latestSummaryAssistantGroup.messages)
4470
+ : [];
4471
+ const summaryOperations = latestSummaryAssistantGroup
4472
+ ? getOperationsForMessageGroup(summaryMessages, agentOperations)
4473
+ : [];
4474
+ return (_jsxs("div", { className: `flex h-full min-h-0 flex-col ${className || ""}`, children: [_jsxs("div", { ref: messagesContainerRef, className: "flex-1 overflow-y-auto", onScroll: handleScroll, children: [error && (_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 })] })] }) })), messages.length === 0 &&
4475
+ !error &&
4476
+ hideGreeting &&
4477
+ (isSubmitting || isConnecting) && (_jsx("div", { className: "flex h-full items-center justify-center p-8", children: _jsxs("div", { className: "flex flex-col items-center gap-4", children: [activeProfile?.svgIcon ? (_jsx("div", { className: "flex h-16 w-16 items-center justify-center text-gray-400 [&>svg]:h-full [&>svg]:w-full", dangerouslySetInnerHTML: {
4478
+ __html: activeProfile.svgIcon,
4479
+ } })) : (_jsx(SecretAgentIcon, { size: 64, strokeWidth: 1, className: "text-gray-400" })), _jsxs("div", { className: "flex items-center gap-1", children: [_jsx("span", { className: "h-2 w-2 animate-bounce rounded-full bg-gray-400 [animation-delay:-0.3s]" }), _jsx("span", { className: "h-2 w-2 animate-bounce rounded-full bg-gray-400 [animation-delay:-0.15s]" }), _jsx("span", { className: "h-2 w-2 animate-bounce rounded-full bg-gray-400" })] })] }) })), renderErrorBanner(), 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, error: error || undefined, profileSvgIcon: activeProfile?.svgIcon, agentId: agent?.id || agentStub.id, agentName: activeProfile?.agentName ||
4480
+ activeProfile?.displayTitle ||
4481
+ activeProfile?.name, allPendingApprovals: allPendingApprovals, onSwitchToAutonomous: handleSwitchToAutonomous, onQuickAction: (action) => {
4482
+ const text = (action.prompt ||
4483
+ action.value ||
4484
+ action.label ||
4485
+ "").trim();
4486
+ if (!text)
4487
+ return;
4488
+ if (isExecuting) {
4489
+ try {
4490
+ handleStop();
4491
+ }
4492
+ catch { }
4509
4493
  }
4510
- catch { }
4511
- }
4512
- }
4513
- else {
4514
- if (isExecuting) {
4515
- try {
4516
- handleStop();
4494
+ sendQuickMessage(text);
4495
+ } }) })) : hideSummaryWaitingPlaceholder ? (_jsx("div", { className: "flex h-full min-h-[220px] items-center justify-center p-6", children: summaryPlaceholderActions ? (_jsx("div", { className: "flex justify-center", children: summaryPlaceholderActions })) : null })) : (_jsx("div", { className: "flex h-full min-h-[220px] items-center justify-center p-6", children: _jsxs("div", { className: "max-w-md rounded-xl border border-slate-200 bg-slate-50 px-5 py-4 text-center text-sm text-slate-600", children: [_jsx("div", { children: shouldShowThinkingDots || isExecuting
4496
+ ? "The agent is still working. The next update will appear here automatically."
4497
+ : agent?.statusMessage ||
4498
+ "Waiting for the next agent update." }), summaryPlaceholderActions ? (_jsx("div", { className: "mt-3 flex justify-center", children: summaryPlaceholderActions })) : null] }) })), shouldShowThinkingDots &&
4499
+ !inlineDialog &&
4500
+ !latestSummaryAssistantGroup && (_jsxs("div", { className: "flex gap-3 px-4 py-3", "data-testid": "agent-thinking-dots", children: [_jsx("div", { className: "shrink-0", children: activeProfile?.svgIcon ? (_jsx("div", { className: "text-gray-2 flex h-6 w-6 items-center justify-center [&>svg]:h-full [&>svg]:w-full", dangerouslySetInnerHTML: {
4501
+ __html: activeProfile.svgIcon,
4502
+ } })) : (_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 ||
4503
+ activeProfile?.displayTitle ||
4504
+ activeProfile?.name ||
4505
+ "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) => {
4506
+ setActivePlaceholderInput(null);
4507
+ setAllPlaceholdersFilled(false);
4508
+ if (activePlaceholderInput.behavior === "compose" &&
4509
+ !hideBottomControls) {
4510
+ setPrompt(filledText);
4511
+ setInputPlaceholder("Review and edit, then press Enter to send");
4512
+ if (textareaRef.current) {
4513
+ try {
4514
+ textareaRef.current.focus();
4515
+ const v = textareaRef.current.value || "";
4516
+ textareaRef.current.selectionStart = v.length;
4517
+ textareaRef.current.selectionEnd = v.length;
4518
+ }
4519
+ catch { }
4517
4520
  }
4518
- catch { }
4519
4521
  }
4520
- sendQuickMessage(filledText);
4521
- }
4522
- }, onCancel: () => {
4523
- setActivePlaceholderInput(null);
4524
- setAllPlaceholdersFilled(false);
4525
- } })) : prompt && /\{\{[^{}]+\}\}|<<[^<>]+>>/.test(prompt) ? (_jsx(PlaceholderInput, { ref: promptPlaceholderInputRef, text: prompt, showButtons: hideBottomControls, buttonsClassName: hideBottomControls ? "justify-end" : "", onFilledChange: setAllPlaceholdersFilled, onComplete: (filledText) => {
4526
- setPrompt(filledText);
4527
- setAllPlaceholdersFilled(false);
4528
- if (filledText.trim()) {
4529
- if (isExecuting) {
4530
- try {
4531
- handleStop();
4522
+ else {
4523
+ if (isExecuting) {
4524
+ try {
4525
+ handleStop();
4526
+ }
4527
+ catch { }
4532
4528
  }
4533
- catch { }
4529
+ sendQuickMessage(filledText);
4534
4530
  }
4535
- sendQuickMessage(filledText);
4536
- }
4537
- }, onCancel: () => {
4538
- setPrompt("");
4539
- setAllPlaceholdersFilled(false);
4540
- setInputPlaceholder("Type your message... (Enter to send, Shift+Enter or Ctrl+Enter for new line)");
4541
- } })) : (_jsx("div", { className: "flex items-stretch gap-2", children: _jsx(Textarea, { ref: textareaRef, style: { viewTransitionName: "assistant-chat-input" }, value: prompt, onChange: (e) => {
4542
- setPrompt(e.target.value);
4543
- if (!/\{\{[^{}]+\}\}|<<[^<>]+>>/.test(e.target.value)) {
4544
- setAllPlaceholdersFilled(false);
4545
- }
4546
- if (currentHistoryIndex !== -1) {
4547
- setCurrentHistoryIndex(-1);
4548
- }
4549
- }, onKeyDown: handleKeyPress, onPaste: handlePaste, onFocus: () => {
4550
- shouldMaintainFocusRef.current = true;
4551
- }, onBlur: () => {
4552
- shouldMaintainFocusRef.current = false;
4553
- }, placeholder: inputPlaceholder, className: "max-h-[250px] min-h-[80px] flex-1 resize-y overflow-y-auto text-[12px] lg:max-h-[450px]", "data-testid": "agent-terminal-prompt", disabled: isSubmitting }) })), (() => {
4554
- const isInPlaceholderMode = activePlaceholderInput ||
4555
- (prompt && /\{\{[^{}]+\}\}|<<[^<>]+>>/.test(prompt));
4556
- const placeholderShowsOwnButtons = hideBottomControls && isInPlaceholderMode;
4557
- if (placeholderShowsOwnButtons)
4558
- return null;
4559
- return (_jsxs("div", { className: cn("mt-2 flex items-stretch gap-2", hideBottomControls || simpleMode || isInPlaceholderMode
4560
- ? "justify-end"
4561
- : "justify-between"), children: [!hideBottomControls && !simpleMode && !isInPlaceholderMode ? (_jsx("div", { className: "flex-1" })) : null, _jsx(Button, { type: "button", size: "sm", onClick: () => {
4562
- if (isExecuting) {
4531
+ }, onCancel: () => {
4532
+ setActivePlaceholderInput(null);
4533
+ setAllPlaceholdersFilled(false);
4534
+ } })) : prompt && /\{\{[^{}]+\}\}|<<[^<>]+>>/.test(prompt) ? (_jsx(PlaceholderInput, { ref: promptPlaceholderInputRef, text: prompt, showButtons: hideBottomControls, buttonsClassName: hideBottomControls ? "justify-end" : "", onFilledChange: setAllPlaceholdersFilled, onComplete: (filledText) => {
4535
+ setPrompt(filledText);
4536
+ setAllPlaceholdersFilled(false);
4537
+ if (filledText.trim()) {
4538
+ if (isExecuting) {
4539
+ try {
4563
4540
  handleStop();
4564
4541
  }
4565
- else {
4566
- handleSubmit();
4567
- }
4568
- }, disabled: !isExecuting &&
4569
- !activePlaceholderInput &&
4570
- (!prompt.trim() || isSubmitting), "data-testid": "agent-send-stop-button", children: isExecuting ? "Stop" : "Send" })] }));
4571
- })()] })) : null] }));
4572
- })() : null;
4573
- 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" })] }) })), _jsxs("div", { ref: messagesContainerRef, className: "flex-1 overflow-y-auto", onScroll: handleScroll, children: [error && (_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 })] })] }) })), messages.length === 0 && !error && !hideGreeting && (_jsx("div", { className: "flex h-full items-center justify-center", children: !activeProfile ? (_jsx(Loader2, { className: "mx-auto h-8 w-8 animate-spin text-gray-400" })) : (_jsx(AgentGreeting, { profile: activeProfile, onPromptClick: (p) => {
4542
+ catch { }
4543
+ }
4544
+ sendQuickMessage(filledText);
4545
+ }
4546
+ }, onCancel: () => {
4547
+ setPrompt("");
4548
+ setAllPlaceholdersFilled(false);
4549
+ setInputPlaceholder("Type your message... (Enter to send, Shift+Enter or Ctrl+Enter for new line)");
4550
+ } })) : (_jsx("div", { className: "flex items-stretch gap-2", children: _jsx(Textarea, { ref: textareaRef, style: { viewTransitionName: "assistant-chat-input" }, value: prompt, onChange: (e) => {
4551
+ setPrompt(e.target.value);
4552
+ if (!/\{\{[^{}]+\}\}|<<[^<>]+>>/.test(e.target.value)) {
4553
+ setAllPlaceholdersFilled(false);
4554
+ }
4555
+ if (currentHistoryIndex !== -1) {
4556
+ setCurrentHistoryIndex(-1);
4557
+ }
4558
+ }, onKeyDown: handleKeyPress, onPaste: handlePaste, onFocus: () => {
4559
+ shouldMaintainFocusRef.current = true;
4560
+ }, onBlur: () => {
4561
+ shouldMaintainFocusRef.current = false;
4562
+ }, placeholder: inputPlaceholder, className: "max-h-[250px] min-h-[80px] flex-1 resize-y overflow-y-auto text-[12px] lg:max-h-[450px]", "data-testid": "agent-terminal-prompt", disabled: isSubmitting }) })), (() => {
4563
+ const isInPlaceholderMode = activePlaceholderInput ||
4564
+ (prompt && /\{\{[^{}]+\}\}|<<[^<>]+>>/.test(prompt));
4565
+ const placeholderShowsOwnButtons = hideBottomControls && isInPlaceholderMode;
4566
+ if (placeholderShowsOwnButtons)
4567
+ return null;
4568
+ return (_jsxs("div", { className: cn("mt-2 flex items-stretch gap-2", hideBottomControls ||
4569
+ simpleMode ||
4570
+ isInPlaceholderMode
4571
+ ? "justify-end"
4572
+ : "justify-between"), children: [!hideBottomControls &&
4573
+ !simpleMode &&
4574
+ !isInPlaceholderMode ? (_jsx("div", { className: "flex-1" })) : null, _jsx(Button, { type: "button", size: "sm", onClick: () => {
4575
+ if (isExecuting) {
4576
+ handleStop();
4577
+ }
4578
+ else {
4579
+ handleSubmit();
4580
+ }
4581
+ }, disabled: !isExecuting &&
4582
+ !activePlaceholderInput &&
4583
+ (!prompt.trim() || isSubmitting), "data-testid": "agent-send-stop-button", children: isExecuting ? "Stop" : "Send" })] }));
4584
+ })()] })) : null] }));
4585
+ })()
4586
+ : null;
4587
+ 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" })] }) })), _jsxs("div", { ref: messagesContainerRef, className: "flex-1 overflow-y-auto", onScroll: handleScroll, children: [error && (_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 })] })] }) })), messages.length === 0 && !error && !hideGreeting && (_jsx("div", { className: "flex h-full items-center justify-center", children: !activeProfile ? (_jsx(Loader2, { className: "mx-auto h-8 w-8 animate-spin text-gray-400" })) : (_jsx(AgentGreeting, { profile: activeProfile, onPromptClick: (p) => {
4574
4588
  setPrompt(p);
4575
4589
  // Use setTimeout to ensure state is updated before submission
4576
4590
  setTimeout(() => {
@@ -4872,7 +4886,9 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
4872
4886
  ...(pendingSettingsRef.current || {}),
4873
4887
  };
4874
4888
  setAgentMetadata((current) => {
4875
- const next = { ...(current || {}) };
4889
+ const next = {
4890
+ ...(current || {}),
4891
+ };
4876
4892
  next.profile = nextProfile.name;
4877
4893
  next.additionalData = {
4878
4894
  ...(next.additionalData || {}),
@@ -4907,8 +4923,7 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
4907
4923
  }, children: ["Open profile settings", _jsx(ExternalLink, { className: "h-2.5 w-2.5", strokeWidth: 1.5 })] }))] })), activeProfile?.models?.length ? (_jsxs("div", { children: [_jsx("div", { className: "mb-1 text-[11px] font-medium text-gray-700", children: "Model" }), _jsx(Select, { size: "xs", maxWidth: 300, searchable: activeProfile.models.length > 5, searchPlaceholder: "Filter models...", className: "h-6 w-full rounded border px-1.5 text-[11px] text-gray-500", value: selectedModelId || "", options: modelOptions, onValueChange: async (val) => {
4908
4924
  const nextId = val;
4909
4925
  setSelectedModelId(nextId);
4910
- const modelName = activeProfile?.models?.find((m) => m.id === nextId)
4911
- ?.name || "";
4926
+ const modelName = activeProfile?.models?.find((m) => m.id === nextId)?.name || "";
4912
4927
  setAgent((prev) => prev ? { ...prev, model: modelName } : prev);
4913
4928
  try {
4914
4929
  if (agent?.id && agent.status !== "new") {
@@ -4933,7 +4948,8 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
4933
4948
  }, children: _jsx(ExternalLink, { className: "h-2.5 w-2.5", strokeWidth: 1.5 }) }), backendAssignedSkillSet.has(skillId.toLowerCase()) ? (_jsx("span", { className: "text-[9px] text-gray-500", children: "auto" })) : (_jsx("button", { type: "button", className: "rounded p-0.5 text-gray-500 hover:bg-gray-200 hover:text-gray-700", onClick: () => {
4934
4949
  void handleRemoveSkill(skillId);
4935
4950
  }, title: "Remove skill", "aria-label": `Remove ${skill?.name || skillId}`, children: _jsx(X, { className: "h-2.5 w-2.5", strokeWidth: 1 }) }))] }, skillId));
4936
- }) })), _jsxs("div", { className: "relative h-40 rounded border border-gray-200 bg-gray-50", children: [_jsx(ScrollingContentTree, { rootItemIds: skillRootIds, selectedItemId: selectedSkillIds[selectedSkillIds.length - 1] || undefined, expandedItemId: selectedSkillIds[selectedSkillIds.length - 1] ||
4951
+ }) })), _jsxs("div", { className: "relative h-40 rounded border border-gray-200 bg-gray-50", children: [_jsx(ScrollingContentTree, { rootItemIds: skillRootIds, selectedItemId: selectedSkillIds[selectedSkillIds.length - 1] ||
4952
+ undefined, expandedItemId: selectedSkillIds[selectedSkillIds.length - 1] ||
4937
4953
  skillRootIds[0], scrollToSelected: true, hideRootNodes: false, onSelectionChange: (selection) => {
4938
4954
  const selected = selection[0];
4939
4955
  if (!selected?.id)
@@ -4947,7 +4963,8 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
4947
4963
  return;
4948
4964
  }
4949
4965
  void handleAddSkill(selected.id);
4950
- } }), skillsLoading && (_jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-background/70 text-[10px] text-gray-500", children: "Loading skills..." }))] }), !skillsLoading && profileFilteredSkills.length > 0 && (_jsx("div", { className: "mt-1 text-[10px] text-gray-500", children: "Click a skill item in the tree to add it." })), skillsError && (_jsx("div", { className: "mt-1 text-[10px] text-red-600", children: skillsError })), !skillsLoading &&
4966
+ } }), skillsLoading && (_jsx("div", { className: "bg-background/70 absolute inset-0 flex items-center justify-center text-[10px] text-gray-500", children: "Loading skills..." }))] }), !skillsLoading &&
4967
+ profileFilteredSkills.length > 0 && (_jsx("div", { className: "mt-1 text-[10px] text-gray-500", children: "Click a skill item in the tree to add it." })), skillsError && (_jsx("div", { className: "mt-1 text-[10px] text-red-600", children: skillsError })), !skillsLoading &&
4951
4968
  !skillsError &&
4952
4969
  skillRootIds.length === 0 && (_jsx("div", { className: "mt-1 text-[10px] text-gray-500", children: "No skill roots available." })), !skillsLoading &&
4953
4970
  !skillsError &&
@@ -4955,7 +4972,7 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
4955
4972
  ? "All allowed skills are selected"
4956
4973
  : "No skills available for this profile" }))] }), _jsxs("div", { children: [_jsx("div", { className: "mb-1 text-[11px] font-medium text-gray-700", children: "Subscribed triggers" }), _jsx("div", { className: "max-h-28 space-y-1 overflow-y-auto rounded border border-gray-200 bg-gray-50 p-1.5", children: triggerSubscriptionsLoading ? (_jsx("div", { className: "px-1 text-[10px] text-gray-500", children: "Loading subscribed triggers..." })) : activeTriggerSubscriptions.length > 0 ? (activeTriggerSubscriptions.map((sub) => {
4957
4974
  const filterText = (sub.filter || "").trim();
4958
- return (_jsxs("div", { className: "rounded border border-gray-200 bg-white px-1.5 py-1", children: [_jsx("div", { className: "truncate text-[10px] font-medium text-gray-800", children: sub.triggerName }), filterText.length > 0 && (_jsxs("div", { className: "mt-0.5 line-clamp-2 break-all text-[9px] text-gray-500", children: ["filter: ", filterText] }))] }, sub.id));
4975
+ return (_jsxs("div", { className: "rounded border border-gray-200 bg-white px-1.5 py-1", children: [_jsx("div", { className: "truncate text-[10px] font-medium text-gray-800", children: sub.triggerName }), filterText.length > 0 && (_jsxs("div", { className: "mt-0.5 line-clamp-2 text-[9px] break-all text-gray-500", children: ["filter: ", filterText] }))] }, sub.id));
4959
4976
  })) : (_jsx("div", { className: "px-1 text-[10px] text-gray-500", children: "No active trigger subscriptions" })) }), triggerSubscriptionsError && (_jsx("div", { className: "mt-1 text-[10px] text-red-600", children: triggerSubscriptionsError }))] })] }) })] }), activeProfile?.prompts?.length ? (_jsxs(Popover, { open: showPredefined, onOpenChange: setShowPredefined, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx("button", { className: "rounded p-1 hover:bg-gray-100", onClick: () => { }, title: "Predefined prompts", "aria-label": "Predefined prompts", type: "button", children: _jsx(Wand2, { className: "h-3 w-3", strokeWidth: 1 }) }) }), _jsx(PopoverContent, { className: "w-64 p-0", align: "start", children: _jsx("div", { className: "max-h-56 overflow-y-auto p-2", children: activeProfile.prompts.map((p, index) => (_jsx("div", { className: "cursor-pointer rounded p-1.5 text-[10px] text-gray-700 hover:bg-gray-100", onClick: () => {
4960
4977
  setPrompt(p.prompt);
4961
4978
  setShowPredefined(false);
@@ -5009,6 +5026,6 @@ export function AgentTerminal({ agentStub, initialMetadata, profiles, isActive =
5009
5026
  cacheWriteCost: liveTotals.cacheWriteCost ?? 0,
5010
5027
  totalCost: liveTotals.totalCost,
5011
5028
  }
5012
- : totalTokens, effectiveCostLimit: effectiveCostLimit, messages: messages, showCompressionPopover: showCompressionPopover, setShowCompressionPopover: setShowCompressionPopover }))] })] })));
5029
+ : totalTokens, effectiveCostLimit: effectiveCostLimit, messages: messages, showCompressionPopover: showCompressionPopover, setShowCompressionPopover: setShowCompressionPopover }))] })] }));
5013
5030
  }
5014
5031
  //# sourceMappingURL=AgentTerminal.js.map