@kortix/ui 0.15.9 → 0.15.11
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/_vendor/kortix-shared.js +467 -2
- package/dist/_vendor/shared/app-config.d.ts +6 -30
- package/dist/_vendor/shared/channel-descriptors.d.ts +0 -34
- package/dist/_vendor/shared/channel-header.d.ts +2 -1
- package/dist/_vendor/shared/connector-sections.d.ts +0 -25
- package/dist/_vendor/shared/file-tags.d.ts +2 -1
- package/dist/_vendor/shared/index.d.ts +1 -0
- package/dist/_vendor/shared/pasted-content.d.ts +0 -4
- package/dist/_vendor/shared/pixel-mark.d.ts +0 -17
- package/dist/_vendor/shared/project-glyphs.d.ts +0 -1
- package/dist/_vendor/shared/session/attachment-tile.d.ts +32 -0
- package/dist/_vendor/shared/session/stop-refusal.d.ts +15 -0
- package/dist/_vendor/shared/session/tool-row-text.d.ts +58 -0
- package/dist/_vendor/shared/session-delivery.d.ts +2 -0
- package/dist/customize/agents/agent-model-view.d.ts +11 -1
- package/dist/customize/agents/agent-model-view.js +12 -1
- package/dist/customize/agents/agent-page.js +19 -6
- package/dist/customize/agents/agent-tabs.d.ts +2 -0
- package/dist/customize/agents/agent-tabs.js +2 -0
- package/dist/customize/connectors/connectors-page.js +1 -1
- package/dist/customize/connectors/detail/connector-page.js +9 -4
- package/dist/customize/connectors/detail/connector-triggers.js +1 -1
- package/dist/customize/connectors/install/use-install.js +1 -1
- package/dist/customize/connectors/use-agent-access.d.ts +1 -0
- package/dist/customize/providers/provider-accordion.js +5 -5
- package/dist/customize/providers/provider-connect.d.ts +3 -3
- package/dist/customize/providers/provider-connect.js +8 -16
- package/dist/customize/providers/provider-sheet.js +4 -4
- package/dist/customize/sections/component/teams-byo-wizard.js +4 -1
- package/dist/customize/sections/connector-connection-form.d.ts +0 -1
- package/dist/customize/sections/connector-connection-form.js +0 -9
- package/dist/customize/sections/view/review-center-connected.js +7 -3
- package/dist/customize/settings/tabs/workspace-keys.js +53 -11
- package/dist/customize/shared/feature-gate-screen.js +1 -1
- package/dist/customize/triggers/runtime-triggers.js +13 -2
- package/dist/customize/triggers/schedule/event-account-picker.js +1 -1
- package/dist/customize/triggers/schedule/event-trigger-copy.js +1 -1
- package/dist/customize/triggers/schedule/schedule-detail-sheet.js +5 -4
- package/dist/customize/triggers/schedule/then-fields.d.ts +5 -1
- package/dist/customize/triggers/schedule/then-fields.js +23 -3
- package/dist/customize/triggers/schedule/trigger-callouts.js +1 -1
- package/dist/customize/triggers/schedule/trigger-composer-logic.d.ts +27 -0
- package/dist/customize/triggers/schedule/trigger-composer-logic.js +51 -5
- package/dist/customize/triggers/schedule/trigger-composer.js +19 -13
- package/dist/customize/triggers/schedule/trigger-edit-logic.js +25 -5
- package/dist/customize/triggers/schedule/trigger-filter.d.ts +10 -3
- package/dist/customize/triggers/schedule/trigger-filter.js +7 -6
- package/dist/customize/triggers/schedule/trigger-readonly.js +1 -1
- package/dist/customize/triggers/schedule/trigger-runs-panel.js +1 -1
- package/dist/customize/triggers/schedule/use-event-app-connect.js +2 -1
- package/dist/customize/triggers/schedule/when-event.js +1 -1
- package/dist/customize/triggers/schedule/when-schedule.d.ts +5 -1
- package/dist/customize/triggers/schedule/when-schedule.js +16 -1
- package/dist/customize/triggers/schedule-view.js +4 -2
- package/dist/i18n/en.d.ts +56 -7
- package/dist/i18n/en.js +65 -16
- package/dist/internal/billing/compute-pricing.d.ts +7 -1
- package/dist/internal/billing/compute-pricing.js +7 -1
- package/dist/internal/hooks/connectors/invalidate-connections.d.ts +10 -0
- package/dist/internal/hooks/connectors/invalidate-connections.js +18 -0
- package/dist/internal/hooks/connectors/use-finish-sign-in.js +1 -1
- package/dist/internal/hooks/connectors/use-pipedream-connect-member.js +1 -1
- package/dist/internal/hooks/connectors/use-pipedream-connect-project.js +1 -1
- package/dist/internal/hooks/projects/use-new-project-session.d.ts +2 -0
- package/dist/internal/hooks/projects/use-new-project-session.js +4 -1
- package/dist/internal/hooks/use-review-session-summary.d.ts +1 -1
- package/dist/internal/hooks/use-review-session-summary.js +1 -1
- package/dist/internal/layout/project-settings-nav.d.ts +17 -0
- package/dist/internal/layout/project-settings-nav.js +24 -0
- package/dist/internal/lib/browser-noise/rules/injected-scripts.js +2 -2
- package/dist/internal/lib/capability-tab-routes.d.ts +8 -0
- package/dist/internal/lib/capability-tab-routes.js +11 -0
- package/dist/internal/notifications/notification-inbox.d.ts +4 -10
- package/dist/internal/notifications/notification-inbox.js +8 -9
- package/dist/internal/stores/composer-prefill-store.d.ts +7 -0
- package/dist/internal/stores/composer-prefill-store.js +1 -0
- package/dist/internal/stores/connector-gate-store.d.ts +3 -1
- package/dist/internal/stores/connector-gate-store.js +13 -3
- package/dist/internal/stores/upgrade-dialog-store.d.ts +4 -0
- package/dist/internal/stores/upgrade-dialog-store.js +2 -0
- package/dist/lib/routes.d.ts +4 -11
- package/dist/lib/routes.js +3 -5
- package/dist/markdown/unified-markdown-utils.d.ts +7 -0
- package/dist/markdown/unified-markdown-utils.js +19 -0
- package/dist/markdown/unified-markdown.js +16 -3
- package/dist/primitives/alert-dialog.js +1 -1
- package/dist/primitives/dialog.js +3 -1
- package/dist/primitives/drawer.js +1 -1
- package/dist/primitives/modal.js +1 -1
- package/dist/primitives/preview-image.js +1 -1
- package/dist/primitives/sheet.js +1 -1
- package/dist/session/actions/session-label.js +2 -2
- package/dist/session/agents/agent-strip.d.ts +10 -5
- package/dist/session/agents/agent-strip.js +40 -12
- package/dist/session/agents/held-messages.d.ts +6 -2
- package/dist/session/agents/held-messages.js +6 -3
- package/dist/session/composer/ComposerCard.js +8 -3
- package/dist/session/composer/agent-selector.d.ts +2 -0
- package/dist/session/composer/agent-selector.js +5 -0
- package/dist/session/composer/attachment-tile.d.ts +2 -26
- package/dist/session/composer/attachment-tile.js +3 -47
- package/dist/session/composer/composer-chat-input.d.ts +3 -1
- package/dist/session/composer/composer-chat-input.js +2 -2
- package/dist/session/composer/composer-logic.d.ts +7 -0
- package/dist/session/composer/composer-logic.js +18 -0
- package/dist/session/composer/composer-reset.d.ts +8 -14
- package/dist/session/composer/composer-toolbar.d.ts +3 -1
- package/dist/session/composer/composer-toolbar.js +3 -3
- package/dist/session/composer/composer.d.ts +9 -0
- package/dist/session/composer/composer.js +22 -11
- package/dist/session/composer/draft/home-composer-focus-handoff.d.ts +7 -0
- package/dist/session/composer/draft/home-composer-focus-handoff.js +94 -0
- package/dist/session/composer/draft/use-composer-draft.d.ts +3 -1
- package/dist/session/composer/draft/use-composer-draft.js +22 -2
- package/dist/session/composer/editor/composer-editor.d.ts +4 -2
- package/dist/session/composer/editor/composer-editor.js +13 -7
- package/dist/session/composer/hooks/use-composer-focus.js +4 -2
- package/dist/session/header/session-site-header.d.ts +3 -1
- package/dist/session/header/session-site-header.js +3 -2
- package/dist/session/index.d.ts +1 -0
- package/dist/session/index.js +1 -0
- package/dist/session/models/chatgpt-connection-button.js +5 -9
- package/dist/session/models/connect-model-step.d.ts +29 -0
- package/dist/session/models/connect-model-step.js +50 -0
- package/dist/session/models/model-connection-gate.d.ts +2 -1
- package/dist/session/models/model-connection-gate.js +6 -3
- package/dist/session/models/model-connection-layout.d.ts +2 -0
- package/dist/session/models/model-connection-layout.js +4 -0
- package/dist/session/models/model-selector.d.ts +1 -1
- package/dist/session/models/model-selector.js +9 -6
- package/dist/session/models/subscription-offer.d.ts +4 -0
- package/dist/session/models/subscription-offer.js +11 -3
- package/dist/session/models/use-workspace-model-gate.d.ts +11 -0
- package/dist/session/models/use-workspace-model-gate.js +62 -0
- package/dist/session/models/workspace-model-gate.d.ts +46 -0
- package/dist/session/models/workspace-model-gate.js +66 -0
- package/dist/session/overrides/session-overrides-toolbar.js +2 -4
- package/dist/session/prompts/ask-deck.d.ts +5 -1
- package/dist/session/prompts/ask-deck.js +15 -3
- package/dist/session/prompts/question-labels.d.ts +16 -0
- package/dist/session/prompts/question-labels.js +34 -0
- package/dist/session/prompts/question-prompt.js +6 -6
- package/dist/session/prompts/session-connect-card.d.ts +63 -0
- package/dist/session/prompts/{session-connect-prompt.js → session-connect-card.js} +53 -42
- package/dist/session/status/provisioning-failure.d.ts +23 -2
- package/dist/session/status/provisioning-failure.js +53 -3
- package/dist/session/status/stop-refusal.d.ts +6 -12
- package/dist/session/status/stop-refusal.js +6 -19
- package/dist/session/thread/agent-run-props.d.ts +19 -0
- package/dist/session/thread/agent-run-props.js +54 -0
- package/dist/session/thread/session-chat.js +317 -298
- package/dist/session/thread/transcript.d.ts +19 -2
- package/dist/session/thread/transcript.js +93 -25
- package/dist/session/tool/tool-part-renderer.js +7 -2
- package/dist/session/tool/tools/bash-tool.d.ts +3 -52
- package/dist/session/tool/tools/bash-tool.js +3 -86
- package/dist/session/tool/tools/kortix-action-tool.js +10 -2
- package/dist/session/turn/answer-streaming.d.ts +21 -0
- package/dist/session/turn/answer-streaming.js +34 -0
- package/dist/session/turn/queued-prompt-bubbles.d.ts +5 -0
- package/dist/session/turn/queued-prompt-bubbles.js +12 -0
- package/dist/session/turn/turn-viewport.d.ts +66 -10
- package/dist/session/turn/turn-viewport.js +92 -12
- package/dist/session/turn/turn-work-accordion.d.ts +3 -1
- package/dist/session/turn/turn-work-accordion.js +2 -2
- package/dist/session/turn/user-message.js +7 -5
- package/dist/styles.css +1 -1
- package/dist/test-utils/intl.d.ts +56 -7
- package/dist/workspace/admin/project-admin-dashboard.js +2 -4
- package/dist/workspace/home/existing-repo-setup-prompt.d.ts +5 -8
- package/dist/workspace/home/existing-repo-setup-prompt.js +16 -42
- package/dist/workspace/home/first-chat.d.ts +7 -1
- package/dist/workspace/home/first-chat.js +12 -5
- package/dist/workspace/home/no-agent-home.d.ts +3 -1
- package/dist/workspace/home/no-agent-home.js +2 -2
- package/dist/workspace/inbox/workspace-inbox.d.ts +6 -16
- package/dist/workspace/inbox/workspace-inbox.js +9 -51
- package/dist/workspace/layout/project-home.js +17 -16
- package/dist/workspace/layout/use-project-home-send.d.ts +2 -0
- package/dist/workspace/layout/use-project-home-send.js +29 -15
- package/dist/workspace/new/advanced-fields.d.ts +4 -1
- package/dist/workspace/new/advanced-fields.js +2 -2
- package/dist/workspace/new/workspace-name.d.ts +9 -0
- package/dist/workspace/new/workspace-name.js +20 -0
- package/dist/workspace/projects/session-starter.d.ts +6 -4
- package/dist/workspace/projects/session-starter.js +8 -14
- package/dist/workspace/review/review-center.d.ts +6 -2
- package/dist/workspace/review/review-center.js +45 -25
- package/dist/workspace/sidebar/session-grouping.d.ts +1 -1
- package/dist/workspace/sidebar/session-grouping.js +1 -1
- package/dist/workspace/sidebar/workspace-menu-model.d.ts +3 -5
- package/dist/workspace/sidebar/workspace-menu-model.js +1 -1
- package/dist/workspace/spaces/space-details-panel.js +2 -2
- package/dist/workspace/spaces/space-triggers.js +2 -2
- package/dist/workspace/spaces/space-view.js +11 -5
- package/package.json +15 -7
- package/skills/kortix-ui/references/modules.md +1 -1
- package/dist/customize/connectors/invalidate-connections.d.ts +0 -2
- package/dist/customize/connectors/invalidate-connections.js +0 -4
- package/dist/internal/notifications/use-inbox-summary.d.ts +0 -17
- package/dist/internal/notifications/use-inbox-summary.js +0 -28
- package/dist/session/prompts/session-connect-prompt.d.ts +0 -40
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useTranslations } from '../../i18n/index.js';
|
|
2
|
-
import { type SessionLogBlock, type SessionLogMessage, type SessionLogSegment, type SessionLogTurn, type SessionMessageAuthor, type SessionPrompt, type SessionPromptViewer, type TextBlock, type ToolCallBlock, type SessionLogReferencedText } from '@kortix/sdk';
|
|
2
|
+
import { type SessionLogBlock, type SessionLogMessage, type SessionLogSegment, type SessionLogAgentRun, type SessionLogTurn, type SessionMessageAuthor, type SessionPrompt, type SessionPromptViewer, type TextBlock, type ToolCallBlock, type SessionLogReferencedText } from '@kortix/sdk';
|
|
3
3
|
import type { AttachmentUploadStatus, NormalizedAttachment } from '../turn/user-message.js';
|
|
4
4
|
import type { TurnServedModel } from '../turn/served-model.js';
|
|
5
5
|
import { type ConversationDensity } from '../../internal/stores/user-preferences-store.js';
|
|
@@ -202,6 +202,22 @@ interface SessionTurnProps {
|
|
|
202
202
|
onEditCancel?: () => void;
|
|
203
203
|
/** Commit the edit: rewind the session at `messageId`, send `text` and the `kept` attachments. */
|
|
204
204
|
onEditSend?: (messageId: string, text: string, kept: NormalizedAttachment[]) => void;
|
|
205
|
+
/**
|
|
206
|
+
* This turn answers an agent run (`sessionLogAgentRuns`, KRTX-4732): its "Worked for" row is
|
|
207
|
+
* the run's row ("Worked for 5m · 3 agents") and folds the run's reports and work. Every answer
|
|
208
|
+
* of the run stays in view under the row, in order: an agent may give the full answer before
|
|
209
|
+
* the last report arrives, so no answer is folded away.
|
|
210
|
+
*/
|
|
211
|
+
agentRun?: SessionLogAgentRun;
|
|
212
|
+
/** The run's other turns, in order: the host draws no row for them. Keep its identity stable. */
|
|
213
|
+
runTurns?: readonly SessionLogTurn[];
|
|
214
|
+
/** Every agent this turn started has reported (`settledLaunches`): its agent rows fold too. */
|
|
215
|
+
foldStartedWork?: boolean;
|
|
216
|
+
/**
|
|
217
|
+
* A run's other turn, drawn by its anchor: `work` is its notice and work, inside the run fold;
|
|
218
|
+
* `answer` is its answer and footer, under the run row.
|
|
219
|
+
*/
|
|
220
|
+
runMember?: 'work' | 'answer';
|
|
205
221
|
}
|
|
206
222
|
/**
|
|
207
223
|
* The worker-run result row shown above a turn — an entity row in the design
|
|
@@ -329,7 +345,8 @@ declare function useTurnSegments({ blocks, answeredQuestionCallsById, shouldUseI
|
|
|
329
345
|
/**
|
|
330
346
|
* The segments a messages-only thread (`TranscriptRows.messagesOnly`) draws:
|
|
331
347
|
* the agent's words and the deliverables it showed on purpose (`show`,
|
|
332
|
-
* `image_gen`), plus a call that waits on the person's permission
|
|
348
|
+
* `image_gen`), plus a call that waits on the person's permission or started a
|
|
349
|
+
* connector sign-in (its Connect card). Never a
|
|
333
350
|
* burst (tools, thinking) or another standalone call (a sub-agent card).
|
|
334
351
|
* Settled, the interim sentences are work too: only the deliverables and the
|
|
335
352
|
* final text stay, the rule of the "Worked for" fold (`splitSessionLogTurnWork`).
|
|
@@ -8,13 +8,14 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
8
8
|
// answered-question cards and notification turns. `session-chat.tsx`
|
|
9
9
|
// re-exports the public names.
|
|
10
10
|
// ============================================================================
|
|
11
|
+
import { STALE_RUNTIME_DELIVERY_ERROR } from '../../_vendor/kortix-shared.js';
|
|
11
12
|
import { isQuestionTool } from '@kortix/sdk';
|
|
12
13
|
import { UnifiedMarkdown } from '../../markdown/unified-markdown.js';
|
|
13
14
|
import { detectCommandFromText } from './detect-command.js';
|
|
14
15
|
import { GenuiTelemetryContext } from '../../markdown/genui/block-telemetry.js';
|
|
15
16
|
import { copyGenuiText } from '../../markdown/genui/to-markdown.js';
|
|
16
17
|
import { useLocale, useTranslations } from '../../i18n/index.js';
|
|
17
|
-
import { isSessionLogRestoreNote, sessionLogActivityText, sessionLogAnsweredQuestionCall, sessionLogBurstSteps, sessionLogOpenCall, sessionLogTurnSegments, sessionPromptActions, splitSessionLogTurnWork, isNoGroupActivityTool, toolCallMetadata, toolKind, } from '@kortix/sdk';
|
|
18
|
+
import { isSessionLogRestoreNote, sessionLogActivityText, sessionLogAnsweredQuestionCall, sessionLogBurstSteps, sessionLogOpenCall, sessionLogTurnSegments, sessionPromptActions, splitSessionLogTurnWork, sessionLogAgentRunLabel, isNoGroupActivityTool, toolCallMetadata, toolCallConnectorSignIns, toolKind, } from '@kortix/sdk';
|
|
18
19
|
import { WarningIcon as AlertTriangle, CheckCircleIcon as CheckCircle, CheckIcon, CaretDownIcon as ChevronDown, ArrowSquareOutIcon as ExternalLink, StopCircleIcon, } from '@phosphor-icons/react';
|
|
19
20
|
import { AnimatePresence, m } from 'motion/react';
|
|
20
21
|
import { memo, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from 'react';
|
|
@@ -35,7 +36,7 @@ import { CompactionFailedRow, CompactionMarker, compactionReset } from '../turn/
|
|
|
35
36
|
import { ExpandableOutput } from '../turn/expandable-output.js';
|
|
36
37
|
import { isPlanWriteTool } from '../turn/plan-anchor.js';
|
|
37
38
|
import { TurnFallbackRows } from '../turn/fallback-row.js';
|
|
38
|
-
import { QUEUED_BUBBLE_OPACITY_CLASS, queuedBubbleTone, QueuedPromptFailure, QueuedPromptProgress, } from '../turn/queued-prompt-bubbles.js';
|
|
39
|
+
import { QUEUED_BUBBLE_OPACITY_CLASS, queuedBubbleTone, QueuedPromptFailure, QueuedPromptProgress, QueuedPromptRecovery, } from '../turn/queued-prompt-bubbles.js';
|
|
39
40
|
import { ShowGroupRenderer } from '../tool/show-group-renderer.js';
|
|
40
41
|
import { statusElapsedFrame } from '../turn/status-elapsed.js';
|
|
41
42
|
import { ThrottledMarkdown } from '../turn/throttled-markdown.js';
|
|
@@ -46,6 +47,7 @@ import { TurnOutcomes } from '../outcomes/turn-outcomes.js';
|
|
|
46
47
|
import { SessionRetryDisplay, TurnErrorDisplay } from '../status/session-error-banner.js';
|
|
47
48
|
import { showTurnBusyIndicator } from '@kortix/sdk';
|
|
48
49
|
import { SessionBusyIndicator } from '../status/session-busy-indicator.js';
|
|
50
|
+
import { useAnswerStreaming } from '../turn/answer-streaming.js';
|
|
49
51
|
import { SessionTurnMeta } from './session-turn-meta.js';
|
|
50
52
|
import { TurnShareButton } from './turn-share.js';
|
|
51
53
|
import { sessionTurnDurationMs, sessionTurnEndedAt, sessionTurnSpan, } from './session-turn-meta-rows.js';
|
|
@@ -236,6 +238,29 @@ export function deriveTurnErrorPresentation(input) {
|
|
|
236
238
|
};
|
|
237
239
|
}
|
|
238
240
|
}
|
|
241
|
+
/** A `send_message` call: the agent relaying between colleagues. Inside a run it is noise. */
|
|
242
|
+
function isRelayCall(block) {
|
|
243
|
+
return block.type === 'tool_call' && block.name.toLowerCase().replace(/[^a-z]/g, '') === 'sendmessage';
|
|
244
|
+
}
|
|
245
|
+
/** The segments without the relay calls (`isRelayCall`); the same array when there is none. */
|
|
246
|
+
function withoutRelayCalls(segments) {
|
|
247
|
+
let changed = false;
|
|
248
|
+
const kept = segments.flatMap((segment) => {
|
|
249
|
+
if (segment.kind === 'standalone' && isRelayCall(segment.block)) {
|
|
250
|
+
changed = true;
|
|
251
|
+
return [];
|
|
252
|
+
}
|
|
253
|
+
if (segment.kind === 'burst') {
|
|
254
|
+
const blocks = segment.blocks.filter((block) => !isRelayCall(block));
|
|
255
|
+
if (blocks.length !== segment.blocks.length) {
|
|
256
|
+
changed = true;
|
|
257
|
+
return blocks.length ? [{ ...segment, blocks }] : [];
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return [segment];
|
|
261
|
+
});
|
|
262
|
+
return changed ? kept : segments;
|
|
263
|
+
}
|
|
239
264
|
/**
|
|
240
265
|
* The worker-run result row shown above a turn — an entity row in the design
|
|
241
266
|
* system's sense, not a tinted banner: the surface stays neutral and the status
|
|
@@ -1049,12 +1074,12 @@ function TurnUserBlock(props) {
|
|
|
1049
1074
|
/** The user message bubble — dimmed while the prompt waits in the queue. */
|
|
1050
1075
|
function TurnUserBubble(props) {
|
|
1051
1076
|
const { hasVisibleUserContent } = props.userContent;
|
|
1052
|
-
const { turn, author, showAuthor, pending, pendingPrompt, interruptedBeforeRun, pendingAttachments, uploadStatus, pendingText, agentNames, commandMessages, commands, sessionId, ownsPlan, onRewind, rewindDisabled, editingText, editPending, onEditCancel, onEditSend, onRetryQueued, onRemoveQueued, queuedPromptViewer, onOpenPastedContent, } = props;
|
|
1077
|
+
const { turn, author, showAuthor, pending, pendingPrompt, interruptedBeforeRun, pendingAttachments, uploadStatus, pendingText, agentNames, commandMessages, commands, sessionId, projectId, ownsPlan, onRewind, rewindDisabled, editingText, editPending, onEditCancel, onEditSend, onRetryQueued, onRemoveQueued, queuedPromptViewer, onOpenPastedContent, } = props;
|
|
1053
1078
|
const { queueState, queuedStatus } = props.queueTone;
|
|
1054
1079
|
const promptActions = pendingPrompt && queuedPromptViewer
|
|
1055
1080
|
? sessionPromptActions(pendingPrompt, queuedPromptViewer)
|
|
1056
1081
|
: { own: true, removable: true };
|
|
1057
|
-
return (_jsx(_Fragment, { children: hasVisibleUserContent && (_jsx("div", { "data-turn-pending": pending || interruptedBeforeRun || undefined, "data-turn-queue-state": pendingPrompt?.state ?? queueState ?? undefined, "data-pending-prompt-id": pendingPrompt?.prompt_id, "data-queue-tone": queuedBubbleTone(queuedStatus), className: cn((pending || interruptedBeforeRun) && QUEUED_BUBBLE_OPACITY_CLASS), children: _jsx(UserMessage, { message: turn.user, author: author, showAuthor: showAuthor, pendingAttachments: pendingAttachments, uploadStatus: uploadStatus, pendingText: pendingText, agentNames: agentNames, commandInfo: commandMessages?.get(turn.id), commands: commands, sessionId: sessionId, ownsPlan: ownsPlan, onRewind: onRewind, rewindDisabled: rewindDisabled || pending || interruptedBeforeRun, editingText: editingText, editPending: editPending, onEditCancel: onEditCancel, onEditSend: onEditSend, onOpenPastedContent: onOpenPastedContent, deliveryStatus: queuedStatus === 'failed' ? (_jsx(QueuedPromptFailure, { lastError: pendingPrompt?.last_error, onRetry: pendingPrompt && onRetryQueued && promptActions.own
|
|
1082
|
+
return (_jsx(_Fragment, { children: hasVisibleUserContent && (_jsx("div", { "data-turn-pending": pending || interruptedBeforeRun || undefined, "data-turn-queue-state": pendingPrompt?.state ?? queueState ?? undefined, "data-pending-prompt-id": pendingPrompt?.prompt_id, "data-queue-tone": queuedBubbleTone(queuedStatus), className: cn((pending || interruptedBeforeRun) && QUEUED_BUBBLE_OPACITY_CLASS), children: _jsx(UserMessage, { message: turn.user, author: author, showAuthor: showAuthor, pendingAttachments: pendingAttachments, uploadStatus: uploadStatus, pendingText: pendingText, agentNames: agentNames, commandInfo: commandMessages?.get(turn.id), commands: commands, sessionId: sessionId, ownsPlan: ownsPlan, onRewind: onRewind, rewindDisabled: rewindDisabled || pending || interruptedBeforeRun, editingText: editingText, editPending: editPending, onEditCancel: onEditCancel, onEditSend: onEditSend, onOpenPastedContent: onOpenPastedContent, deliveryStatus: pendingPrompt?.last_error === STALE_RUNTIME_DELIVERY_ERROR ? (_jsx(QueuedPromptRecovery, { projectId: projectId, onRemove: onRemoveQueued && promptActions.removable ? () => onRemoveQueued(pendingPrompt.prompt_id) : undefined })) : queuedStatus === 'failed' ? (_jsx(QueuedPromptFailure, { lastError: pendingPrompt?.last_error, onRetry: pendingPrompt && onRetryQueued && promptActions.own
|
|
1058
1083
|
? () => onRetryQueued(pendingPrompt.prompt_id)
|
|
1059
1084
|
: undefined, onRemove: pendingPrompt && onRemoveQueued && promptActions.removable
|
|
1060
1085
|
? () => onRemoveQueued(pendingPrompt.prompt_id)
|
|
@@ -1065,13 +1090,13 @@ const NO_RECOVERED_CALLS = new Set();
|
|
|
1065
1090
|
/** The assistant's part tree: bursts, standalone deliverables, and prose
|
|
1066
1091
|
* between them, under one live-context provider. */
|
|
1067
1092
|
function TurnToolBlocks(props) {
|
|
1068
|
-
const { turn, sessionId, permissions, onPermissionReply, disableToolNavigation, model, segments, conversationDensity, fold, durationMs, workNotice, } = props;
|
|
1093
|
+
const { turn, sessionId, permissions, onPermissionReply, disableToolNavigation, model, segments, conversationDensity, fold, durationMs, workNotice, runContent, runLabel, foldStartedWork, part, } = props;
|
|
1069
1094
|
const { working, hasSteps, hasReasoning } = model;
|
|
1070
1095
|
// Every settled turn folds, live or reloaded (the T3 Code rule): one turn
|
|
1071
1096
|
// reads one way. A turn the reader touched while it worked (opened or closed
|
|
1072
1097
|
// a row) settles with its "Worked for" row open, so nothing they were
|
|
1073
1098
|
// reading disappears under them.
|
|
1074
|
-
const split = useMemo(() => (fold && !working ? splitSessionLogTurnWork(segments.filter(segmentRendersSomething), { working }) : null), [fold, segments, working]);
|
|
1099
|
+
const split = useMemo(() => (fold && !working ? splitSessionLogTurnWork(segments.filter(segmentRendersSomething), { working, foldStartedWork }) : null), [fold, segments, working, foldStartedWork]);
|
|
1075
1100
|
// A settled turn whose prompt is another agent's notice folds the notice
|
|
1076
1101
|
// row into this work fold with the work it led to (KRTX-4732): the parent's
|
|
1077
1102
|
// answer below is the only top-level message, and the row stays reachable
|
|
@@ -1079,7 +1104,13 @@ function TurnToolBlocks(props) {
|
|
|
1079
1104
|
// so the exchange never becomes unreachable. In the inline mode (text plus
|
|
1080
1105
|
// an answered question, no fold row) the row renders visible above the
|
|
1081
1106
|
// answer instead — the gate below keeps the block mounted for it.
|
|
1082
|
-
|
|
1107
|
+
// The run's other turns fold here too (KRTX-4732); while the turn still works, the run's
|
|
1108
|
+
// row already stands, closed, over the reports that came before.
|
|
1109
|
+
const noticeFold = (!!workNotice || !!runContent) && fold && !working;
|
|
1110
|
+
// A turn whose only work started agents has no steps, but its agent rows are what the
|
|
1111
|
+
// person tracks: they draw (and fold once every agent reported, `foldStartedWork`).
|
|
1112
|
+
const startedWork = useMemo(() => segments.some((segment) => segment.kind === 'standalone' && toolKind(segment.block.name) === 'task'), [segments]);
|
|
1113
|
+
const foldRow = !part && (!!split || noticeFold || (!!runContent && working));
|
|
1083
1114
|
const workSegments = useMemo(() => new Set(split?.work ?? []), [split]);
|
|
1084
1115
|
const touchedLive = useRef(false);
|
|
1085
1116
|
const markTouched = useCallback(() => {
|
|
@@ -1128,21 +1159,25 @@ function TurnToolBlocks(props) {
|
|
|
1128
1159
|
return null;
|
|
1129
1160
|
return (_jsx(TurnSegment, { segment: segment, isTrailing: segment === segments[segments.length - 1], working: working, openText: model.openText, hasSteps: hasSteps, sessionId: sessionId, permissions: permissions, onPermissionReply: onPermissionReply, disableNavigation: disableToolNavigation, conversationDensity: conversationDensity }, key));
|
|
1130
1161
|
};
|
|
1131
|
-
return (_jsx(_Fragment, { children: (working || hasSteps || hasReasoning || noticeFold || !!workNotice) && (turn.assistant.length > 0 || !!workNotice) && (
|
|
1162
|
+
return (_jsx(_Fragment, { children: (working || hasSteps || hasReasoning || startedWork || noticeFold || !!workNotice || !!runContent) && (turn.assistant.length > 0 || !!workNotice || !!runContent) && (
|
|
1132
1163
|
// Every tool row below — the bursts' rows and the standalone ones —
|
|
1133
1164
|
// reads this to tell a call that has not spoken YET from one that never
|
|
1134
1165
|
// will. Provided here rather than per-row because `working` is a fact
|
|
1135
1166
|
// about the TURN, and this block is the turn's whole part tree.
|
|
1136
1167
|
// See `TurnLiveContext`.
|
|
1137
|
-
_jsx(TurnLiveContext.Provider, { value: working, children: _jsx(RecoveredCallsContext.Provider, { value: recovered, children: _jsx(ImageGenPathsContext.Provider, { value: imageGenPaths, children: _jsx(ImageGenDigestsContext.Provider, { value: imageGenDigests, children: _jsx(ImageGenRunsContext.Provider, { value: imageGenRuns, children: _jsx(InTranscriptTurnContext.Provider, { value: true, children: _jsx(WorkTouchContext.Provider, { value: markTouched, children: _jsxs("div", { className: "flex flex-col gap-3", onClickCapture: onClickCapture, children: [
|
|
1168
|
+
_jsx(TurnLiveContext.Provider, { value: working, children: _jsx(RecoveredCallsContext.Provider, { value: recovered, children: _jsx(ImageGenPathsContext.Provider, { value: imageGenPaths, children: _jsx(ImageGenDigestsContext.Provider, { value: imageGenDigests, children: _jsx(ImageGenRunsContext.Provider, { value: imageGenRuns, children: _jsx(InTranscriptTurnContext.Provider, { value: true, children: _jsx(WorkTouchContext.Provider, { value: markTouched, children: _jsxs("div", { className: "flex flex-col gap-3", onClickCapture: onClickCapture, children: [foldRow && (_jsx(TurnWorkAccordion, { label: runLabel, durationMs: durationMs, open: workOpen, onToggle: toggleWork, contentId: workContentId }, "turn-work")), runContent && workMounted && (_jsx("div", { id: workContentId, hidden: !workOpen, "data-testid": "agent-run-fold", className: "flex min-w-0 flex-col gap-3", children: _jsx(WorkFoldContext.Provider, { value: true, children: runContent }) }, "turn-run")), workNotice && (!noticeFold || workMounted) && (_jsx("div", { id: runContent ? undefined : workContentId, hidden: !!(split || noticeFold) && !workOpen, className: "min-w-0", children: _jsx(WorkFoldContext.Provider, { value: !working, children: workNotice }) }, "turn-notice")), segments.map((segment) => {
|
|
1138
1169
|
const isWork = workSegments.has(segment);
|
|
1139
|
-
if (
|
|
1170
|
+
if (part === 'answer' && isWork)
|
|
1171
|
+
return null;
|
|
1172
|
+
if (part === 'work' && split && !isWork)
|
|
1173
|
+
return null;
|
|
1174
|
+
if (isWork && !workMounted && !part)
|
|
1140
1175
|
return null;
|
|
1141
1176
|
const node = renderSegment(segment);
|
|
1142
1177
|
if (!node)
|
|
1143
1178
|
return null;
|
|
1144
|
-
const hidden = isWork && !workOpen;
|
|
1145
|
-
return (_jsx("div", { id: !workNotice && isWork && segment === split?.work[0] ? workContentId : undefined, hidden: hidden, className: "min-w-0", children: _jsx(WorkFoldContext.Provider, { value: isWork, children: node }) }, node.key));
|
|
1179
|
+
const hidden = !part && isWork && !workOpen;
|
|
1180
|
+
return (_jsx("div", { id: !workNotice && !runContent && isWork && segment === split?.work[0] ? workContentId : undefined, hidden: hidden, className: "min-w-0", children: _jsx(WorkFoldContext.Provider, { value: isWork, children: node }) }, node.key));
|
|
1146
1181
|
})] }) }) }) }) }) }) }) })) }));
|
|
1147
1182
|
}
|
|
1148
1183
|
/** One segment of the turn's steps section: a burst, a show group, a
|
|
@@ -1168,7 +1203,8 @@ function segmentRendersSomething(segment) {
|
|
|
1168
1203
|
/**
|
|
1169
1204
|
* The segments a messages-only thread (`TranscriptRows.messagesOnly`) draws:
|
|
1170
1205
|
* the agent's words and the deliverables it showed on purpose (`show`,
|
|
1171
|
-
* `image_gen`), plus a call that waits on the person's permission
|
|
1206
|
+
* `image_gen`), plus a call that waits on the person's permission or started a
|
|
1207
|
+
* connector sign-in (its Connect card). Never a
|
|
1172
1208
|
* burst (tools, thinking) or another standalone call (a sub-agent card).
|
|
1173
1209
|
* Settled, the interim sentences are work too: only the deliverables and the
|
|
1174
1210
|
* final text stay, the rule of the "Worked for" fold (`splitSessionLogTurnWork`).
|
|
@@ -1185,7 +1221,10 @@ export function messageOnlySegments(segments, options) {
|
|
|
1185
1221
|
return segment.block.text.trim() !== '';
|
|
1186
1222
|
if (segment.kind === 'show-group')
|
|
1187
1223
|
return true;
|
|
1188
|
-
return isNoGroupActivityTool(segment.block.name) ||
|
|
1224
|
+
return (isNoGroupActivityTool(segment.block.name) ||
|
|
1225
|
+
!!getPermissionForTool(options.permissions, segment.block.call_id) ||
|
|
1226
|
+
// The call that started a connector sign-in: its Connect card waits on the person.
|
|
1227
|
+
toolCallConnectorSignIns(segment.block).length > 0);
|
|
1189
1228
|
};
|
|
1190
1229
|
const split = options.working ? null : splitSessionLogTurnWork(visible, { working: false });
|
|
1191
1230
|
return (split ? [...split.hoisted, ...split.final] : visible).filter(kept);
|
|
@@ -1312,7 +1351,7 @@ function TurnFooter(props) {
|
|
|
1312
1351
|
const { statusPhrase, statusElapsedLabel } = status;
|
|
1313
1352
|
const { retryInfo, retryMessage, retrySecondsLeft } = retry;
|
|
1314
1353
|
const { turnEndedAt, turnDurationMs, costInfo } = meta;
|
|
1315
|
-
return (_jsxs(_Fragment, { children: [_jsx(TurnBusyRow, { ...props, working: working, turnError: turnError, tHardcodedUi: tHardcodedUi, hasText: model.response.trim() !== '' }), turnErrorRow.text && !turn.autoRetry?.continued && (
|
|
1354
|
+
return (_jsxs(_Fragment, { children: [_jsx(TurnBusyRow, { ...props, working: working, turnError: turnError, tHardcodedUi: tHardcodedUi, hasText: model.response.trim() !== '', openText: model.openText?.block.text }), turnErrorRow.text && !turn.autoRetry?.continued && (
|
|
1316
1355
|
// A space's thread (messages only): one calm line with Retry; a stop has its own "Stopped" line.
|
|
1317
1356
|
props.quietBusy ? (turnErrorRow.isAbort ? null : (_jsx(TurnFailedLine, { projectId: projectId, projectSessionId: projectSessionId, turn: turn, errorText: turnErrorRow.text }))) : (_jsx(TurnErrorDisplay, { errorText: turnErrorRow.text, errorDetails: turnErrorRowDetails, errorRaw: turnErrorRaw, isAbort: turnErrorRow.isAbort, modelOptions: modelOptions }))), turnErrorRow.text && !turnErrorRow.isAbort && !turn.autoRetry?.continued && !!turn.autoRetry?.retries && (_jsx(TurnAutoRetryNote, { count: turn.autoRetry.retries })), !working && !turn.autoRetry?.continued && (stoppedBy || errors.turnErrorIsAbort) && _jsx(TurnStoppedBy, { name: stoppedBy ?? undefined }), !working && _jsx(TurnOutcomes, { turnKey: turn.id }), !working && !props.hideActionBar && hasCopyableResponse(response, answered.inlineContentParts) && (_jsx(TurnActionBar, { response: response, inlineContentParts: answered.inlineContentParts, turnEndedAt: turnEndedAt, turnDurationMs: turnDurationMs, costInfo: costInfo, servedModel: servedModel, tHardcodedUi: tHardcodedUi,
|
|
1318
1357
|
// A continuation turn's id names a compaction marker, not a user
|
|
@@ -1351,7 +1390,10 @@ function TurnBusyRow(props) {
|
|
|
1351
1390
|
const tTurn = useTranslations('sessionUi.turn');
|
|
1352
1391
|
// The thread's computer is not up yet: the wait is a start, not work.
|
|
1353
1392
|
const runtimeReady = useRuntimeReady();
|
|
1354
|
-
|
|
1393
|
+
// The words streaming in are the busy signal: no "Gathering thoughts..." row
|
|
1394
|
+
// glued under them. It returns when the block closes or the text goes quiet.
|
|
1395
|
+
const answerStreaming = useAnswerStreaming(props.openText);
|
|
1396
|
+
return (_jsx(_Fragment, { children: !(answerStreaming && !quietBusy && !retryInfo) && showTurnBusyIndicator({
|
|
1355
1397
|
working: working && !suppressBusyIndicator,
|
|
1356
1398
|
hasError: !!turnError,
|
|
1357
1399
|
isRetrying: !!retryInfo,
|
|
@@ -1440,16 +1482,18 @@ function SessionTurnImpl(props) {
|
|
|
1440
1482
|
// parent's answer is the only top-level message. A settled turn with no
|
|
1441
1483
|
// answer at all keeps the row at the top level, where it stays reachable;
|
|
1442
1484
|
// the main transcript only — space threads hide notices already.
|
|
1485
|
+
const noticeRow = userContent.noticeBatch
|
|
1486
|
+
? _jsx(NoticeBatchGroup, { items: userContent.noticeBatch })
|
|
1487
|
+
: userContent.subagentNotice
|
|
1488
|
+
? _jsx(SubagentNoticeRow, { notice: userContent.subagentNotice })
|
|
1489
|
+
: userContent.peerMessage
|
|
1490
|
+
? _jsx(PeerMessageRow, { info: userContent.peerMessage })
|
|
1491
|
+
: undefined;
|
|
1492
|
+
// A run's anchor folds its own notice too, answered or not: the run's row keeps it reachable.
|
|
1443
1493
|
const workNotice = rows
|
|
1444
1494
|
? undefined
|
|
1445
|
-
: isAgentNoticeTurn(turn) && (model.working || turn.assistant.length > 0)
|
|
1446
|
-
?
|
|
1447
|
-
? _jsx(NoticeBatchGroup, { items: userContent.noticeBatch })
|
|
1448
|
-
: userContent.subagentNotice
|
|
1449
|
-
? _jsx(SubagentNoticeRow, { notice: userContent.subagentNotice })
|
|
1450
|
-
: userContent.peerMessage
|
|
1451
|
-
? _jsx(PeerMessageRow, { info: userContent.peerMessage })
|
|
1452
|
-
: undefined
|
|
1495
|
+
: isAgentNoticeTurn(turn) && (model.working || turn.assistant.length > 0 || !!props.agentRun)
|
|
1496
|
+
? noticeRow
|
|
1453
1497
|
: undefined;
|
|
1454
1498
|
const status = useTurnLiveStatus({ turn, blocks: model.blocks, agentWorking: model.agentWorking });
|
|
1455
1499
|
const retry = useTurnRetryState({ sessionStatus, isWorkingTurn });
|
|
@@ -1461,6 +1505,19 @@ function SessionTurnImpl(props) {
|
|
|
1461
1505
|
permissions,
|
|
1462
1506
|
sessionId,
|
|
1463
1507
|
});
|
|
1508
|
+
// Inside an agent run, the agent's relays between colleagues (`send_message`) are noise:
|
|
1509
|
+
// the reports say what happened (KRTX-4732).
|
|
1510
|
+
const inRun = !!props.agentRun || !!props.runMember;
|
|
1511
|
+
const turnSegments = useMemo(() => (inRun ? withoutRelayCalls(segments) : segments), [inRun, segments]);
|
|
1512
|
+
const { runTurns, agentRun } = props;
|
|
1513
|
+
// The run's other turns, drawn by the anchor, each as a run member: its work in the fold,
|
|
1514
|
+
// its answer under the run row. Each member is a memoized row: a render of the anchor costs a
|
|
1515
|
+
// shallow prop compare per member.
|
|
1516
|
+
const runMembers = (part) => agentRun && runTurns?.length
|
|
1517
|
+
? runTurns.map((member) => (_jsx(SessionTurn, { ...props, turn: member, runMember: part, agentRun: undefined, runTurns: undefined, foldStartedWork: false, isWorkingTurn: false, pending: false, pendingPrompt: undefined, interruptedBeforeRun: false, isFirstTurn: false, isLast: false, ownsPlan: false }, member.id)))
|
|
1518
|
+
: null;
|
|
1519
|
+
const runContent = runMembers('work');
|
|
1520
|
+
const runAnswers = runMembers('answer');
|
|
1464
1521
|
// A compaction turn's message-state — `inFlight` (the marker still
|
|
1465
1522
|
// streams its summary) is the half of "is this compaction running" the
|
|
1466
1523
|
// working projection cannot see, because it deliberately knows nothing
|
|
@@ -1471,6 +1528,17 @@ function SessionTurnImpl(props) {
|
|
|
1471
1528
|
const genuiModel = turn.assistant.at(-1)?.model?.model;
|
|
1472
1529
|
const genuiScope = turn.id;
|
|
1473
1530
|
const genuiTelemetry = useMemo(() => ({ scope: genuiScope, ...(genuiModel ? { model: genuiModel } : {}) }), [genuiScope, genuiModel]);
|
|
1531
|
+
// A run member (KRTX-4732): its report and the work it led to, in the anchor's fold...
|
|
1532
|
+
if (props.runMember === 'work') {
|
|
1533
|
+
return (_jsxs("div", { "data-testid": "agent-run-member", className: "flex min-w-0 flex-col gap-3", children: [noticeRow, _jsx(GenuiTelemetryContext.Provider, { value: genuiTelemetry, children: _jsx(TurnToolBlocks, { ...props, model: model, segments: turnSegments, conversationDensity: conversationDensity, fold: !answered.shouldUseInlineContent, durationMs: null, part: "work" }) })] }));
|
|
1534
|
+
}
|
|
1535
|
+
// ...and its answer, with its error or stop row and its outcomes, under the run row. A silent
|
|
1536
|
+
// report draws only the outcomes it left (a change request), which hide themselves when none.
|
|
1537
|
+
if (props.runMember === 'answer') {
|
|
1538
|
+
if (!turn.response && !turn.error && turn.status !== 'aborted')
|
|
1539
|
+
return _jsx(TurnOutcomes, { turnKey: turn.id });
|
|
1540
|
+
return (_jsxs("div", { "data-testid": "agent-run-answer", className: "space-y-2.5", children: [_jsxs(GenuiTelemetryContext.Provider, { value: genuiTelemetry, children: [_jsx(TurnToolBlocks, { ...props, model: model, segments: turnSegments, conversationDensity: conversationDensity, fold: !answered.shouldUseInlineContent, durationMs: null, part: "answer" }), _jsx(TurnAssistantBlock, { ...props, model: model, answered: answered, userContent: userContent, tHardcodedUi: tHardcodedUi })] }), _jsx(TurnFooter, { ...props, model: model, errors: errors, answered: answered, status: status, retry: retry, meta: meta, tHardcodedUi: tHardcodedUi, connectProviderOpen: connectProviderOpen, onConnectProviderOpenChange: setConnectProviderOpen })] }));
|
|
1541
|
+
}
|
|
1474
1542
|
// Shell mode: a synthetic prompt answered by one bare `bash` call.
|
|
1475
1543
|
if (turn.shell) {
|
|
1476
1544
|
return (_jsx(TurnShellMode, { ...props, call: sessionLogOpenCall(turn.shell), working: model.working, errors: errors, connectProviderOpen: connectProviderOpen, onConnectProviderOpenChange: setConnectProviderOpen }));
|
|
@@ -1553,7 +1621,7 @@ function SessionTurnImpl(props) {
|
|
|
1553
1621
|
// The segments are already the message's: nothing is left to fold.
|
|
1554
1622
|
fold: !messagesOnly && !answered.shouldUseInlineContent, durationMs: meta.turnDurationMs })), _jsx(TurnAssistantBlock, { ...props, model: model, answered: answered, userContent: userContent, tHardcodedUi: tHardcodedUi })] }), messagesOnly && !model.working && errors.turnErrorIsAbort && model.response.trim() === '' && shownSegments.length === 0 ? (_jsx("p", { className: "text-muted-foreground text-sm", children: tTurnRows('stopped') })) : null, _jsx(TurnFooter, { ...props, hideActionBar: true, quietBusy: messagesOnly, model: model, errors: errors, answered: answered, status: status, retry: retry, meta: meta, tHardcodedUi: tHardcodedUi, connectProviderOpen: connectProviderOpen, onConnectProviderOpenChange: setConnectProviderOpen }), messagesOnly && !model.working ? (_jsx(TurnMessageWork, { ...props, model: model, segments: segments, shown: shownSegments, userContent: userContent, conversationDensity: conversationDensity, front: rows.front === true })) : null] }) })) : null] }));
|
|
1555
1623
|
}
|
|
1556
|
-
return (_jsxs("div", { className: "group/turn text-factor-[2] space-y-2.5", children: [_jsx(TurnUserBlock, { ...props, model: model, queueTone: queueTone, userContent: userContent, noticeInWork: !!workNotice }), props.isFirstTurn ? afterFirstPrompt : null, _jsx(TurnFallbackRows, { working: model.working, events: props.servedModel?.fallbacks }), _jsxs(GenuiTelemetryContext.Provider, { value: genuiTelemetry, children: [_jsx(TurnToolBlocks, { ...props, model: model, segments:
|
|
1624
|
+
return (_jsxs("div", { className: "group/turn text-factor-[2] space-y-2.5", children: [_jsx(TurnUserBlock, { ...props, model: model, queueTone: queueTone, userContent: userContent, noticeInWork: !!workNotice }), props.isFirstTurn ? afterFirstPrompt : null, _jsx(TurnFallbackRows, { working: model.working, events: props.servedModel?.fallbacks }), _jsxs(GenuiTelemetryContext.Provider, { value: genuiTelemetry, children: [_jsx(TurnToolBlocks, { ...props, model: model, segments: turnSegments, conversationDensity: conversationDensity, fold: !answered.shouldUseInlineContent, durationMs: meta.turnDurationMs, workNotice: workNotice, runContent: runContent, runLabel: agentRun ? sessionLogAgentRunLabel(agentRun) : undefined, foldStartedWork: props.foldStartedWork }), runAnswers, _jsx(TurnAssistantBlock, { ...props, model: model, answered: answered, userContent: userContent, tHardcodedUi: tHardcodedUi })] }), _jsx(TurnFooter, { ...props, model: model, errors: errors, answered: answered, status: status, retry: retry, meta: meta, tHardcodedUi: tHardcodedUi, connectProviderOpen: connectProviderOpen, onConnectProviderOpenChange: setConnectProviderOpen })] }));
|
|
1557
1625
|
}
|
|
1558
1626
|
/**
|
|
1559
1627
|
* The boundary that stops the transcript re-rendering with the stream.
|
|
@@ -3,6 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { Button } from '../../primitives/button.js';
|
|
4
4
|
import { STATUS_TEXT } from '../../primitives/status.js';
|
|
5
5
|
import { QuestionPrompt } from '../prompts/question-prompt.js';
|
|
6
|
+
import { SessionConnectCard } from '../prompts/session-connect-card.js';
|
|
6
7
|
import { GenericTool } from './generic-tool.js';
|
|
7
8
|
import { BasicTool, BoundActivateContext, partOutcome, StalePendingContext, ToolActivateContext, ToolDurationContext, ToolNavigationContext, ToolOutcomeContext, ToolRunningContext, ToolSurfaceContext, TurnLiveContext, } from './shared/infrastructure.js';
|
|
8
9
|
import { ToolRegistry } from './shared/registry.js';
|
|
@@ -14,7 +15,7 @@ import { partError, partMetadata, partStreamingInput } from './shared/infrastruc
|
|
|
14
15
|
import { kortixCardTool, parseKortixToolResult } from './tools/kortix-tool-card.js';
|
|
15
16
|
import { isWorkflowTool, parseWorkflowRun } from './tools/workflow-run.js';
|
|
16
17
|
import { PERMISSION_LABELS, getChildSessionId, shouldShowToolPart, } from '../../internal/session-types/index.js';
|
|
17
|
-
import { sessionLogCallStatus, sessionLogOpenCall, toolKind } from '@kortix/sdk';
|
|
18
|
+
import { sessionLogCallStatus, sessionLogOpenCall, toolCallConnectorSignIns, toolKind, } from '@kortix/sdk';
|
|
18
19
|
import { useTranslations } from '../../i18n/index.js';
|
|
19
20
|
import { memo, useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
20
21
|
function PermissionPromptInline({ permission, onReply }) {
|
|
@@ -70,6 +71,10 @@ function ToolPartRendererImpl({ call: given, sessionId, permission, question, on
|
|
|
70
71
|
// tool that threw as far as the reader is concerned, so it must look
|
|
71
72
|
// identical on the row too.
|
|
72
73
|
const outcome = useMemo(() => partOutcome(call), [call]);
|
|
74
|
+
// The connector sign-ins this call started (`kortix connectors connect`, the
|
|
75
|
+
// `kortix_connectors` tool): their Connect card draws under the row. A call
|
|
76
|
+
// that failed (an error, a shell exit other than 0) started none.
|
|
77
|
+
const signIns = useMemo(() => toolCallConnectorSignIns(call), [call]);
|
|
73
78
|
// The SDK's verdict on tools that never render (a todo read, context bookkeeping).
|
|
74
79
|
if (!shouldShowToolPart(call))
|
|
75
80
|
return null;
|
|
@@ -143,7 +148,7 @@ function ToolPartRendererImpl({ call: given, sessionId, permission, question, on
|
|
|
143
148
|
// whole class of call permanently closed and unopenable on the panel — the
|
|
144
149
|
// one surface where a single call IS the view.
|
|
145
150
|
_jsx(GenericTool, { call: call, defaultOpen: defaultOpen, forceOpen: forceOpen, locked: isLocked }));
|
|
146
|
-
return (_jsx(ToolNavigationContext.Provider, { value: !disableNavigation, children: _jsx(ToolRunningContext.Provider, { value: isRunning, children: _jsx(ToolOutcomeContext.Provider, { value: outcome, children: _jsx(ToolDurationContext.Provider, { value: toolDurationMs, children: _jsx(StalePendingContext.Provider, { value: isStalePending, children: _jsx(BoundActivateContext.Provider, { value: boundActivate, children: _jsxs("div", { className: cn('relative', fillsPanel && 'h-full'), children: [toolElement, permission && onPermissionReply && (_jsx("div", { className: "mt-1.5", children: _jsx(PermissionPromptInline, { permission: permission, onReply: onPermissionReply }) })), question && onQuestionReply && onQuestionReject && (_jsx("div", { className: "mt-1.5", children: _jsx(QuestionPrompt, { request: question, onReply: onQuestionReply, onReject: onQuestionReject }) }))] }) }) }) }) }) }) }));
|
|
151
|
+
return (_jsx(ToolNavigationContext.Provider, { value: !disableNavigation, children: _jsx(ToolRunningContext.Provider, { value: isRunning, children: _jsx(ToolOutcomeContext.Provider, { value: outcome, children: _jsx(ToolDurationContext.Provider, { value: toolDurationMs, children: _jsx(StalePendingContext.Provider, { value: isStalePending, children: _jsx(BoundActivateContext.Provider, { value: boundActivate, children: _jsxs("div", { className: cn('relative', fillsPanel && 'h-full'), children: [toolElement, signIns.length > 0 && _jsx(SessionConnectCard, { calls: signIns, className: "mt-1.5" }), permission && onPermissionReply && (_jsx("div", { className: "mt-1.5", children: _jsx(PermissionPromptInline, { permission: permission, onReply: onPermissionReply }) })), question && onQuestionReply && onQuestionReject && (_jsx("div", { className: "mt-1.5", children: _jsx(QuestionPrompt, { request: question, onReply: onQuestionReply, onReject: onQuestionReject }) }))] }) }) }) }) }) }) }));
|
|
147
152
|
}
|
|
148
153
|
/**
|
|
149
154
|
* The tools whose rows are an agent's work: they open in place, never in the side panel.
|
|
@@ -1,54 +1,5 @@
|
|
|
1
1
|
import type { ToolProps } from '../shared/types.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* The bash tool's input carries a `description` — the one-line summary the
|
|
6
|
-
* model writes for its own call ("Install the workspace dependencies"). The
|
|
7
|
-
* SDK already reads it as this tool's subtitle (`core/turns/parts.ts`, case
|
|
8
|
-
* `'bash'`), so the row promotes a source it had been dropping rather than
|
|
9
|
-
* inventing one. A reader scanning a turn wants to know what a command was
|
|
10
|
-
* FOR, and `pnpm -w install --frozen-lockfile` answers that only if they read
|
|
11
|
-
* shell.
|
|
12
|
-
*
|
|
13
|
-
* Three rules, in order:
|
|
14
|
-
* - A failure keeps its verdict. "Command failed" is the one thing a friendly
|
|
15
|
-
* summary must never soften, so it outranks any description.
|
|
16
|
-
* - No description → exactly today's "Ran command". Nothing is ever derived
|
|
17
|
-
* from the command text: a classifier answering "Installed dependencies" to
|
|
18
|
-
* `npm i` would put a claim in the model's mouth that it never made.
|
|
19
|
-
* - Sentence case only lifts a lower-case opener. Lowering the rest would turn
|
|
20
|
-
* "Run CI on the release branch" into "Run ci on the release branch".
|
|
21
|
-
*/
|
|
22
|
-
export declare function bashRowTitle(description: unknown, failed: boolean): string;
|
|
23
|
-
/**
|
|
24
|
-
* The command as the reader should see it: leading indent stripped, blank
|
|
25
|
-
* edges dropped.
|
|
26
|
-
*
|
|
27
|
-
* Commands arrive with incidental leading whitespace — a model quoting a
|
|
28
|
-
* command out of indented YAML/JSON sends ` agent-browser open …`. The
|
|
29
|
-
* trigger row hides it (a `truncate` span collapses spaces under normal
|
|
30
|
-
* white-space), but the card's `whitespace-pre-wrap` pane renders it verbatim,
|
|
31
|
-
* so the first line sits two characters deeper than its own wrapped
|
|
32
|
-
* continuation and the output below — an inverse hanging indent that reads as
|
|
33
|
-
* broken padding.
|
|
34
|
-
*
|
|
35
|
-
* Two rules, because a one-line command and a script are different documents:
|
|
36
|
-
*
|
|
37
|
-
* - **One line has no structure to protect**, so every leading blank is noise
|
|
38
|
-
* and all of it goes. This is the case a common-indent rule cannot be
|
|
39
|
-
* trusted with alone: it only strips what it can MEASURE, and the measure
|
|
40
|
-
* used to be `[ \t]` — so a command indented with a non-breaking space (or
|
|
41
|
-
* any other Unicode space; agents paste these out of rendered docs and
|
|
42
|
-
* spreadsheets) kept its indent and drew exactly the misalignment above.
|
|
43
|
-
* - **A script keeps its shape**: the COMMON indent goes, never a per-line
|
|
44
|
-
* trim, so nesting survives. Heredocs survive by construction — a non-`<<-`
|
|
45
|
-
* heredoc needs its terminator at column 0, which pins the common indent to
|
|
46
|
-
* 0 and makes this a no-op exactly where indentation is load-bearing.
|
|
47
|
-
*
|
|
48
|
-
* `[^\S\r\n]` is "whitespace that is not a line break", so both rules count
|
|
49
|
-
* every horizontal space character the Unicode table has, not just the two on
|
|
50
|
-
* a US keyboard. The trailing trim also stops a final `\n` from counting as a
|
|
51
|
-
* phantom `+1` line in the trigger.
|
|
52
|
-
*/
|
|
53
|
-
export declare function dedentCommand(raw: string): string;
|
|
2
|
+
import { bashRowTitle, dedentCommand } from '../../../_vendor/shared/session/tool-row-text.js';
|
|
3
|
+
/** The row-title and dedent rules live once in `@kortix/shared/session/tool-row-text`. */
|
|
4
|
+
export { bashRowTitle, dedentCommand };
|
|
54
5
|
export declare function BashTool({ call, defaultOpen, forceOpen, locked }: ToolProps): import("react").JSX.Element;
|
|
@@ -11,98 +11,15 @@ import { CopyButton } from '../../../markdown/copy-button.js';
|
|
|
11
11
|
import { formatBashOutput, InlineSessionMessagesList, parseSessionMessagesOutput, parseSessionMetadataOutput, SessionMetadataList, } from '../shared/session-helpers.js';
|
|
12
12
|
import { hasStructuredContent, normalizeToolOutput, parseStructuredOutput, } from '../../../internal/lib/utils/structured-output.js';
|
|
13
13
|
import { shellExitCode, stripAnsi } from '../../../internal/session-types/index.js';
|
|
14
|
+
import { bashRowTitle, dedentCommand } from '../../../_vendor/kortix-shared.js';
|
|
14
15
|
import { TerminalIcon } from '@phosphor-icons/react';
|
|
15
16
|
import { toolKind } from '@kortix/sdk';
|
|
16
17
|
import { useContext, useMemo } from 'react';
|
|
17
18
|
import { ChannelBrandMark } from '../../turn/channel-brand.js';
|
|
18
19
|
import { channelSendText, parseChannelSendCommand } from './channel-send.js';
|
|
19
20
|
import { ChannelSendCard, channelSendTitle } from './channel-send-card.js';
|
|
20
|
-
/** The row
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* The words a settled row leads with.
|
|
24
|
-
*
|
|
25
|
-
* The bash tool's input carries a `description` — the one-line summary the
|
|
26
|
-
* model writes for its own call ("Install the workspace dependencies"). The
|
|
27
|
-
* SDK already reads it as this tool's subtitle (`core/turns/parts.ts`, case
|
|
28
|
-
* `'bash'`), so the row promotes a source it had been dropping rather than
|
|
29
|
-
* inventing one. A reader scanning a turn wants to know what a command was
|
|
30
|
-
* FOR, and `pnpm -w install --frozen-lockfile` answers that only if they read
|
|
31
|
-
* shell.
|
|
32
|
-
*
|
|
33
|
-
* Three rules, in order:
|
|
34
|
-
* - A failure keeps its verdict. "Command failed" is the one thing a friendly
|
|
35
|
-
* summary must never soften, so it outranks any description.
|
|
36
|
-
* - No description → exactly today's "Ran command". Nothing is ever derived
|
|
37
|
-
* from the command text: a classifier answering "Installed dependencies" to
|
|
38
|
-
* `npm i` would put a claim in the model's mouth that it never made.
|
|
39
|
-
* - Sentence case only lifts a lower-case opener. Lowering the rest would turn
|
|
40
|
-
* "Run CI on the release branch" into "Run ci on the release branch".
|
|
41
|
-
*/
|
|
42
|
-
export function bashRowTitle(description, failed) {
|
|
43
|
-
if (failed)
|
|
44
|
-
return 'Command failed';
|
|
45
|
-
// Collapsed, because a description arrives as free text and may carry a
|
|
46
|
-
// newline; a trigger row renders it on one line either way.
|
|
47
|
-
const summary = typeof description === 'string' ? description.replace(/\s+/g, ' ').trim() : '';
|
|
48
|
-
if (!summary)
|
|
49
|
-
return 'Ran command';
|
|
50
|
-
const cased = /^[a-z]/.test(summary) ? summary[0].toUpperCase() + summary.slice(1) : summary;
|
|
51
|
-
if (cased.length <= TITLE_MAX)
|
|
52
|
-
return cased;
|
|
53
|
-
// Trim the tail before the ellipsis. `truncate` in `lib/utils/string` cuts on
|
|
54
|
-
// the character count alone, which strands a space in front of the ellipsis
|
|
55
|
-
// whenever the cut lands just after a word.
|
|
56
|
-
return `${cased.slice(0, TITLE_MAX).trimEnd()}…`;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* The command as the reader should see it: leading indent stripped, blank
|
|
60
|
-
* edges dropped.
|
|
61
|
-
*
|
|
62
|
-
* Commands arrive with incidental leading whitespace — a model quoting a
|
|
63
|
-
* command out of indented YAML/JSON sends ` agent-browser open …`. The
|
|
64
|
-
* trigger row hides it (a `truncate` span collapses spaces under normal
|
|
65
|
-
* white-space), but the card's `whitespace-pre-wrap` pane renders it verbatim,
|
|
66
|
-
* so the first line sits two characters deeper than its own wrapped
|
|
67
|
-
* continuation and the output below — an inverse hanging indent that reads as
|
|
68
|
-
* broken padding.
|
|
69
|
-
*
|
|
70
|
-
* Two rules, because a one-line command and a script are different documents:
|
|
71
|
-
*
|
|
72
|
-
* - **One line has no structure to protect**, so every leading blank is noise
|
|
73
|
-
* and all of it goes. This is the case a common-indent rule cannot be
|
|
74
|
-
* trusted with alone: it only strips what it can MEASURE, and the measure
|
|
75
|
-
* used to be `[ \t]` — so a command indented with a non-breaking space (or
|
|
76
|
-
* any other Unicode space; agents paste these out of rendered docs and
|
|
77
|
-
* spreadsheets) kept its indent and drew exactly the misalignment above.
|
|
78
|
-
* - **A script keeps its shape**: the COMMON indent goes, never a per-line
|
|
79
|
-
* trim, so nesting survives. Heredocs survive by construction — a non-`<<-`
|
|
80
|
-
* heredoc needs its terminator at column 0, which pins the common indent to
|
|
81
|
-
* 0 and makes this a no-op exactly where indentation is load-bearing.
|
|
82
|
-
*
|
|
83
|
-
* `[^\S\r\n]` is "whitespace that is not a line break", so both rules count
|
|
84
|
-
* every horizontal space character the Unicode table has, not just the two on
|
|
85
|
-
* a US keyboard. The trailing trim also stops a final `\n` from counting as a
|
|
86
|
-
* phantom `+1` line in the trigger.
|
|
87
|
-
*/
|
|
88
|
-
export function dedentCommand(raw) {
|
|
89
|
-
const text = raw.replace(/^[\r\n]+/, '').trimEnd();
|
|
90
|
-
if (!text)
|
|
91
|
-
return '';
|
|
92
|
-
const lines = text.split('\n');
|
|
93
|
-
// One line: strip the lot. `trimEnd` above already took the other end.
|
|
94
|
-
if (lines.length === 1)
|
|
95
|
-
return lines[0].replace(/^[^\S\r\n]+/, '');
|
|
96
|
-
let min = Infinity;
|
|
97
|
-
for (const line of lines) {
|
|
98
|
-
if (!line.trim())
|
|
99
|
-
continue;
|
|
100
|
-
min = Math.min(min, /^[^\S\r\n]*/.exec(line)[0].length);
|
|
101
|
-
}
|
|
102
|
-
if (!min || min === Infinity)
|
|
103
|
-
return text;
|
|
104
|
-
return lines.map((line) => line.slice(min)).join('\n');
|
|
105
|
-
}
|
|
21
|
+
/** The row-title and dedent rules live once in `@kortix/shared/session/tool-row-text`. */
|
|
22
|
+
export { bashRowTitle, dedentCommand };
|
|
106
23
|
/**
|
|
107
24
|
* The command, syntax-highlighted, with its output beneath a hairline.
|
|
108
25
|
*
|
|
@@ -15,7 +15,8 @@ import { UiLink } from '../../../providers/ui-provider.js';
|
|
|
15
15
|
import { ArrowRightIcon, ArrowSquareOutIcon, CalendarDotsIcon, CaretRightIcon, ChartBarIcon, ChatsCircleIcon, CheckIcon, GitPullRequestIcon, SunDimIcon, HandPointingIcon, LockKeyIcon, PlugIcon, RobotIcon, UsersIcon, WarningIcon, } from '@phosphor-icons/react';
|
|
16
16
|
import { useContext, useMemo } from 'react';
|
|
17
17
|
import { MULTI_AGENT_ICON, multiAgentBody, PeerSendRow, runningKey } from './multi-agent-tool-bodies.js';
|
|
18
|
-
import { parsePeerSend } from '@kortix/sdk';
|
|
18
|
+
import { parsePeerSend, toolCallConnectorSignIns } from '@kortix/sdk';
|
|
19
|
+
import { useSessionConnectRequests } from '../../prompts/session-connect-card.js';
|
|
19
20
|
import { KORTIX_PLATFORM_TOOLS, isReadAction, kortixCardTool, kortixPlatformTool, multiAgentTool, parseKortixToolResult, } from './kortix-tool-card.js';
|
|
20
21
|
const TOOL_META = {
|
|
21
22
|
kortix_agents: { icon: RobotIcon, object: 'agents' },
|
|
@@ -96,6 +97,10 @@ export function KortixActionTool(props) {
|
|
|
96
97
|
const settled = status === 'completed' || status === 'error';
|
|
97
98
|
const raw = status === 'error' ? (partError(call) ?? '') : partRawOutput(call);
|
|
98
99
|
const result = useMemo(() => (settled ? parseKortixToolResult(raw, call.name) : null), [settled, raw, call.name]);
|
|
100
|
+
// A `connect` in a session that finishes sign-ins: the Connect card under this
|
|
101
|
+
// row (`SessionConnectCard`) is the way in, so the raw provider link is not
|
|
102
|
+
// a second one.
|
|
103
|
+
const connectCardShown = useSessionConnectRequests() !== null && toolCallConnectorSignIns(call).length > 0;
|
|
99
104
|
if (!tool || (settled && !result)) {
|
|
100
105
|
return _jsx(GenericTool, { call: call, defaultOpen: defaultOpen, forceOpen: forceOpen, locked: locked });
|
|
101
106
|
}
|
|
@@ -107,7 +112,10 @@ export function KortixActionTool(props) {
|
|
|
107
112
|
: tMulti(`running.${runningKey(multi)}`);
|
|
108
113
|
return (_jsx(BasicTool, { icon: icon, trigger: _jsx(CardTrigger, { title: title, live: running }), defaultOpen: defaultOpen, forceOpen: forceOpen, locked: locked }));
|
|
109
114
|
}
|
|
110
|
-
const {
|
|
115
|
+
const { error } = result;
|
|
116
|
+
const card = connectCardShown
|
|
117
|
+
? { ...result.card, links: result.card.links.filter((link) => !link.external) }
|
|
118
|
+
: result.card;
|
|
111
119
|
// A message to another agent is one plain row with the receiver's face, sent or not.
|
|
112
120
|
if (multi === 'send_message') {
|
|
113
121
|
const send = parsePeerSend(result.data);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How long the open text block may go without growing before the busy row
|
|
3
|
+
* returns. Text deltas arrive well under a second apart. A longer silence
|
|
4
|
+
* means the model moved on: the harness shows a tool call only once it runs
|
|
5
|
+
* (`tool_execution_start`), so while a large call's arguments stream the open
|
|
6
|
+
* text block is still the last block and no longer grows.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ANSWER_QUIET_AFTER_MS = 3000;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the answer's open text block is still being written.
|
|
11
|
+
*
|
|
12
|
+
* While the words arrive they are the busy signal, so the turn's busy row
|
|
13
|
+
* ("Gathering thoughts...") stays hidden instead of sitting glued under the
|
|
14
|
+
* streaming text. The row comes back when the block closes (a tool call or
|
|
15
|
+
* the next step starts), and when the text stops growing for `quietMs`: a
|
|
16
|
+
* stream that went silent must not look like a finished answer.
|
|
17
|
+
*
|
|
18
|
+
* `text` is the open block's text (`openTextBlock`), `undefined` when no
|
|
19
|
+
* block is open.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useAnswerStreaming(text: string | undefined, quietMs?: number): boolean;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* How long the open text block may go without growing before the busy row
|
|
4
|
+
* returns. Text deltas arrive well under a second apart. A longer silence
|
|
5
|
+
* means the model moved on: the harness shows a tool call only once it runs
|
|
6
|
+
* (`tool_execution_start`), so while a large call's arguments stream the open
|
|
7
|
+
* text block is still the last block and no longer grows.
|
|
8
|
+
*/
|
|
9
|
+
export const ANSWER_QUIET_AFTER_MS = 3_000;
|
|
10
|
+
/**
|
|
11
|
+
* Whether the answer's open text block is still being written.
|
|
12
|
+
*
|
|
13
|
+
* While the words arrive they are the busy signal, so the turn's busy row
|
|
14
|
+
* ("Gathering thoughts...") stays hidden instead of sitting glued under the
|
|
15
|
+
* streaming text. The row comes back when the block closes (a tool call or
|
|
16
|
+
* the next step starts), and when the text stops growing for `quietMs`: a
|
|
17
|
+
* stream that went silent must not look like a finished answer.
|
|
18
|
+
*
|
|
19
|
+
* `text` is the open block's text (`openTextBlock`), `undefined` when no
|
|
20
|
+
* block is open.
|
|
21
|
+
*/
|
|
22
|
+
export function useAnswerStreaming(text, quietMs = ANSWER_QUIET_AFTER_MS) {
|
|
23
|
+
const hasText = !!text?.trim();
|
|
24
|
+
// The text that last went silent for `quietMs`. Any growth makes it stale,
|
|
25
|
+
// so the row hides again without a reset in the effect.
|
|
26
|
+
const [quietText, setQuietText] = useState(null);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (!hasText)
|
|
29
|
+
return;
|
|
30
|
+
const timer = setTimeout(() => setQuietText(text), quietMs);
|
|
31
|
+
return () => clearTimeout(timer);
|
|
32
|
+
}, [text, hasText, quietMs]);
|
|
33
|
+
return hasText && quietText !== text;
|
|
34
|
+
}
|
|
@@ -20,4 +20,9 @@ export declare function QueuedPromptFailure({ lastError, onRetry, onRemove, }: {
|
|
|
20
20
|
onRetry?: () => void;
|
|
21
21
|
onRemove?: () => void;
|
|
22
22
|
}): import("react").JSX.Element;
|
|
23
|
+
/** A failed callback path requires a new computer, not a retry on the old one. */
|
|
24
|
+
export declare function QueuedPromptRecovery({ projectId, onRemove }: {
|
|
25
|
+
projectId?: string;
|
|
26
|
+
onRemove?: () => void;
|
|
27
|
+
}): import("react").JSX.Element;
|
|
23
28
|
export {};
|