@blade-hq/agent-react 2612.0.0-beta.9 → 2612.0.0-beta.90
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/README.md +56 -0
- package/dist/SessionPluginConfigForm-FROO3XEW.js +9 -0
- package/dist/SessionPluginConfigForm-FROO3XEW.js.map +1 -0
- package/dist/chat/AgentLoopBlock.d.ts +0 -2
- package/dist/chat/AskUserQuestionBlock.d.ts +3 -20
- package/dist/chat/AssistantTurnBlock.d.ts +3 -10
- package/dist/chat/AttachmentPreviewDialog.d.ts +0 -1
- package/dist/chat/ChatLoadingIndicator.d.ts +15 -0
- package/dist/chat/ChatPanel.d.ts +3 -1
- package/dist/chat/ContextAttachmentPills.d.ts +4 -0
- package/dist/chat/CurrentPlanPanel.d.ts +0 -3
- package/dist/chat/FileDeliveryCards.d.ts +12 -10
- package/dist/chat/FinalArtifactCards.d.ts +0 -1
- package/dist/chat/ImageLightbox.d.ts +1 -1
- package/dist/chat/LiteMessageList.d.ts +5 -3
- package/dist/chat/MessageFileAttachmentList.d.ts +0 -5
- package/dist/chat/QuestionnaireQuestionBlock.d.ts +11 -0
- package/dist/chat/SessionReplayBar.d.ts +0 -1
- package/dist/chat/TextAttachmentPills.d.ts +0 -3
- package/dist/chat/TurnNavRail.d.ts +1 -7
- package/dist/chat/WorkflowRunBlock.d.ts +21 -4
- package/dist/chat/ai-elements/shimmer.d.ts +2 -2
- package/dist/chat/chat-column-width.d.ts +21 -0
- package/dist/chat/customization.d.ts +1 -1
- package/dist/chat/index.d.ts +6 -3
- package/dist/chat/markdown/ExternalAnchor.d.ts +2 -2
- package/dist/chat/message-list-blocks.d.ts +0 -1
- package/dist/chat/runtime/actions.d.ts +7 -3
- package/dist/chat/runtime/background-task-dismissals.d.ts +0 -1
- package/dist/chat/runtime/composer-channels.d.ts +0 -3
- package/dist/chat/runtime/environment.d.ts +2 -0
- package/dist/chat/runtime/input-cache-reset.d.ts +0 -5
- package/dist/chat/runtime/input-services.d.ts +10 -0
- package/dist/chat/runtime/session-source.d.ts +0 -5
- package/dist/chat/runtime/use-chat-actions.d.ts +1 -5
- package/dist/chat/turn-locate-channel.d.ts +53 -0
- package/dist/chat.css +23 -18
- package/dist/chunk-2GP2S3IR.js +9629 -0
- package/dist/chunk-2GP2S3IR.js.map +1 -0
- package/dist/{chunk-4OG6AJXY.js → chunk-3XWKS2YP.js} +3955 -26107
- package/dist/chunk-3XWKS2YP.js.map +1 -0
- package/dist/{chunk-HJ7KNUWM.js → chunk-5FK33U4M.js} +4181 -16595
- package/dist/chunk-5FK33U4M.js.map +1 -0
- package/dist/chunk-A5WYUMNB.js +1340 -0
- package/dist/chunk-A5WYUMNB.js.map +1 -0
- package/dist/chunk-JBVJMUJA.js +805 -0
- package/dist/chunk-JBVJMUJA.js.map +1 -0
- package/dist/chunk-NRAHM3CD.js +14861 -0
- package/dist/chunk-NRAHM3CD.js.map +1 -0
- package/dist/chunk-NS55ESUC.js +9488 -0
- package/dist/chunk-NS55ESUC.js.map +1 -0
- package/dist/chunk-PRDGUQTE.js +4157 -0
- package/dist/chunk-PRDGUQTE.js.map +1 -0
- package/dist/chunk-T42PKMOI.js +2417 -0
- package/dist/chunk-T42PKMOI.js.map +1 -0
- package/dist/chunk-WMWYGB2C.js +964 -0
- package/dist/chunk-WMWYGB2C.js.map +1 -0
- package/dist/components/AccountConnectorRules.d.ts +7 -0
- package/dist/components/AccountConnectors.d.ts +13 -0
- package/dist/components/ActionApprovals.d.ts +16 -0
- package/dist/components/BrowserConnectionDialog.d.ts +8 -0
- package/dist/components/ChatInput.d.ts +1 -15
- package/dist/components/ConfigConnection.d.ts +16 -0
- package/dist/components/ConnectorAuthorizationProgress.d.ts +6 -0
- package/dist/components/ConnectorConnection.d.ts +4 -0
- package/dist/components/ConnectorDetail.d.ts +46 -0
- package/dist/components/ConnectorPanel.d.ts +3 -1
- package/dist/components/ConnectorRulesPanel.d.ts +10 -0
- package/dist/components/ConnectorRuntimeDiagnostics.d.ts +5 -0
- package/dist/components/DeviceConnection.d.ts +17 -0
- package/dist/components/FeishuCapabilitySelection.d.ts +14 -0
- package/dist/components/FeishuPermissionStatus.d.ts +7 -0
- package/dist/components/LlmAdvancedSettings.d.ts +0 -1
- package/dist/components/ManagedConnection.d.ts +12 -0
- package/dist/components/McpAppFrame.d.ts +17 -0
- package/dist/components/PackEventNotice.d.ts +3 -0
- package/dist/components/PlanUpdateBlock.d.ts +0 -1
- package/dist/components/SessionPluginConfigForm.d.ts +4 -1
- package/dist/components/SessionPluginIcon.d.ts +1 -0
- package/dist/components/action-approval-format.d.ts +35 -0
- package/dist/components/plugin-connector.d.ts +1 -0
- package/dist/connectors.d.ts +6 -0
- package/dist/connectors.js +19 -0
- package/dist/connectors.js.map +1 -0
- package/dist/embed/blade-chat-element.d.ts +0 -8
- package/dist/embed/entry.d.ts +21 -19
- package/dist/hooks/use-capabilities.d.ts +3 -0
- package/dist/hooks/use-message-pin.d.ts +1 -1
- package/dist/hooks/use-turn-navigation.d.ts +19 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +31 -3
- package/dist/internal.d.ts +7 -4
- package/dist/internal.js +671 -103
- package/dist/internal.js.map +1 -1
- package/dist/lib/message-shortcuts.d.ts +5 -0
- package/dist/questions.d.ts +7 -0
- package/dist/questions.js +910 -0
- package/dist/questions.js.map +1 -0
- package/dist/rich-input/ChatInput.d.ts +1 -1
- package/dist/rich-input/ConnectButton.d.ts +7 -5
- package/dist/rich-input/FileCompletionMenu.d.ts +1 -2
- package/dist/rich-input/InputActionSubmenu.d.ts +10 -0
- package/dist/rich-input/ModelSelector.d.ts +3 -1
- package/dist/rich-input/SkillActionMenu.d.ts +10 -0
- package/dist/rich-input/SkillStatusBar.d.ts +0 -6
- package/dist/rich-input/extensions/skill-mention.d.ts +3 -20
- package/dist/rich-input/index.d.ts +3 -2
- package/dist/rich-input/lib/composer-content.d.ts +5 -1
- package/dist/rich-input/lib/plugin-suggestions.d.ts +4 -4
- package/dist/rich-input/lib/reference-candidates.d.ts +0 -1
- package/dist/rich-input/lib/skill-suggestions.d.ts +1 -1
- package/dist/rich-input/lib/user-home.d.ts +0 -17
- package/dist/rich-input/model/resolve-model.d.ts +2 -2
- package/dist/rich-input/services.d.ts +1 -1
- package/dist/rich-input/voice/VoiceWaveform.d.ts +0 -3
- package/dist/rich-input.js +1711 -2140
- package/dist/rich-input.js.map +1 -1
- package/dist/style.css +16 -55
- package/dist/style.full.css +41 -77
- package/dist/tool-details.d.ts +8 -0
- package/dist/tool-details.js +25 -0
- package/dist/tool-details.js.map +1 -0
- package/node_modules/@modelcontextprotocol/ext-apps/LICENSE +216 -0
- package/node_modules/@modelcontextprotocol/ext-apps/README.md +284 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/docs/patterns.d.ts +9 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-bridge.d.ts +1348 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-bridge.examples.d.ts +9 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-bridge.js +39 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-bridge.test.d.ts +1 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-with-deps.js +82 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app.d.ts +1214 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app.examples.d.ts +9 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app.js +39 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app.test.d.ts +1 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/constants.d.ts +65 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/events.d.ts +47 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/events.test.d.ts +1 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/generated/schema.d.ts +1047 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/generated/schema.json +6170 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/generated/schema.test.d.ts +41 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/interop-v1.test.d.ts +1 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/legacy-handlers.d.ts +66 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/legacy-handlers.test.d.ts +1 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/message-transport.d.ts +126 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/message-transport.examples.d.ts +9 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/message-transport.test.d.ts +1 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/index.d.ts +37 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/index.examples.d.ts +6 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/index.js +39 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/react-with-deps.js +82 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useApp.d.ts +115 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useApp.examples.d.ts +6 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useAutoResize.d.ts +54 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useAutoResize.examples.d.ts +6 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useDocumentTheme.d.ts +44 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useDocumentTheme.examples.d.ts +6 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useHostStyles.d.ts +113 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useHostStyles.examples.d.ts +6 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/server/index.d.ts +381 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/server/index.examples.d.ts +9 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/server/index.js +1 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/server/index.test.d.ts +1 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/spec.types.d.ts +698 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/standard-schema.d.ts +23 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/styles.d.ts +184 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/styles.examples.d.ts +9 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/types.d.ts +33 -0
- package/node_modules/@modelcontextprotocol/ext-apps/dist/src/wire-compat.test.d.ts +1 -0
- package/node_modules/@modelcontextprotocol/ext-apps/package.json +144 -0
- package/node_modules/@standard-schema/spec/LICENSE +21 -0
- package/node_modules/@standard-schema/spec/README.md +198 -0
- package/node_modules/@standard-schema/spec/dist/index.cjs +18 -0
- package/node_modules/@standard-schema/spec/dist/index.d.cts +119 -0
- package/node_modules/@standard-schema/spec/dist/index.d.ts +119 -0
- package/node_modules/@standard-schema/spec/dist/index.js +0 -0
- package/node_modules/@standard-schema/spec/package.json +52 -0
- package/package.json +19 -3
- package/public-api.md +100 -4
- package/dist/chat-OCLOVB3H.css +0 -175
- package/dist/chunk-3DRBRQXN.js +0 -258
- package/dist/chunk-3DRBRQXN.js.map +0 -1
- package/dist/chunk-4OG6AJXY.js.map +0 -1
- package/dist/chunk-HJ7KNUWM.js.map +0 -1
- package/dist/lib/agent-computer-command.d.ts +0 -32
- package/dist/rich-input/extensions/workflow-mention.d.ts +0 -10
package/dist/internal.js
CHANGED
|
@@ -1,78 +1,467 @@
|
|
|
1
1
|
import {
|
|
2
|
+
ActionApprovalCard,
|
|
3
|
+
ActionApprovals,
|
|
2
4
|
AgentChat,
|
|
5
|
+
AgentLoopBlock,
|
|
6
|
+
AskUserQuestionBlock,
|
|
7
|
+
AssistantTurnBlock,
|
|
8
|
+
AttachmentPreviewDialog,
|
|
3
9
|
BackgroundWakeNotice,
|
|
10
|
+
CHAT_COLUMN_WIDTH_STORAGE_KEY,
|
|
11
|
+
CardContext,
|
|
12
|
+
ChatColumnResizeRails,
|
|
13
|
+
ChatCustomizationProvider,
|
|
14
|
+
ChatLoadingIndicator,
|
|
15
|
+
ChatPanel,
|
|
4
16
|
ChatView,
|
|
5
|
-
|
|
17
|
+
ConnectionBanner,
|
|
6
18
|
ContextCard,
|
|
7
19
|
ContextGroupCard,
|
|
8
|
-
|
|
20
|
+
CurrentPlanPanel,
|
|
21
|
+
CurrentPlanPanelContent,
|
|
22
|
+
DEFAULT_CHAT_COLUMN_WIDTH,
|
|
23
|
+
DeliveryCard,
|
|
24
|
+
ENTRY_SCROLL_MARGIN_PX,
|
|
25
|
+
ErrorMessageBlock,
|
|
26
|
+
FileDeliveryCards,
|
|
27
|
+
FinalArtifactCards,
|
|
28
|
+
FollowupInteractionProvider,
|
|
29
|
+
HistoricalResultFeedback,
|
|
30
|
+
LOOPBACK_HOSTS,
|
|
31
|
+
LightComposer,
|
|
32
|
+
LiteMessageList,
|
|
9
33
|
LlmChat,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
34
|
+
MANUAL_SCROLL_TOLERANCE_PX,
|
|
35
|
+
MAX_CHAT_COLUMN_WIDTH,
|
|
36
|
+
MIN_CHAT_COLUMN_WIDTH,
|
|
37
|
+
MemoryRefsHint,
|
|
38
|
+
MessageActions,
|
|
39
|
+
MessageContextPills,
|
|
40
|
+
MessageFileAttachmentList,
|
|
41
|
+
MessageList,
|
|
42
|
+
NAV_AT_BOTTOM_EPSILON_PX,
|
|
43
|
+
NEW_TURN_SCROLL_DURATION_MS,
|
|
44
|
+
NEW_TURN_SCROLL_MAX_SCREENS,
|
|
45
|
+
NEW_TURN_SCROLL_MIN_DISTANCE_PX,
|
|
46
|
+
PIN_HANDOVER_TOLERANCE_PX,
|
|
47
|
+
PlanSummaryCard,
|
|
48
|
+
PostChatFollowupBlock,
|
|
49
|
+
RECENT_RESIDENT_TURNS,
|
|
50
|
+
Reasoning,
|
|
51
|
+
ReasoningContent,
|
|
52
|
+
ReasoningTrigger,
|
|
53
|
+
RenderErrorBoundary,
|
|
14
54
|
ReplayBar,
|
|
15
55
|
ReplayMismatchPrompt,
|
|
56
|
+
ResultFeedback,
|
|
16
57
|
SessionPluginSelector,
|
|
17
58
|
SessionQueuePanel,
|
|
59
|
+
SessionReplayBar,
|
|
60
|
+
Shimmer,
|
|
18
61
|
TURN_NAV_HIGHLIGHT_CLASS,
|
|
19
|
-
|
|
62
|
+
TextAttachmentPills,
|
|
63
|
+
ThinkingBadge,
|
|
64
|
+
ToolCallBlock,
|
|
65
|
+
ToolFilePreviewAction,
|
|
66
|
+
ToolPreviewAction,
|
|
67
|
+
ToolUiCard,
|
|
20
68
|
TopicAssetSubmitDialog,
|
|
69
|
+
TurnNavRail,
|
|
70
|
+
USER_MESSAGE_MARKDOWN_CLASS,
|
|
71
|
+
UserMessageBubble,
|
|
21
72
|
WhatIfUserBubble,
|
|
73
|
+
WorkflowRunBlock,
|
|
74
|
+
applyPlanStatusesById,
|
|
75
|
+
approvalDecisionMessage,
|
|
76
|
+
buildCitationsFromToolCalls,
|
|
77
|
+
buildLiteRows,
|
|
78
|
+
buildMessageListBlockIndexes,
|
|
79
|
+
buildMessageListBlocks,
|
|
80
|
+
calculateAnchoredScrollTop,
|
|
81
|
+
calculateAnimatedScrollTop,
|
|
82
|
+
calculateStickyAwareMargin,
|
|
83
|
+
calculateTrailingSpacerHeight,
|
|
84
|
+
clampChatColumnWidth,
|
|
85
|
+
collectDeliveredFiles,
|
|
86
|
+
collectMemoryRefs,
|
|
87
|
+
collectTurnMessages,
|
|
88
|
+
defaultTurnDisplayMode,
|
|
89
|
+
dispatchPreview,
|
|
90
|
+
extractLatestPlanMessages,
|
|
91
|
+
extractPlanMessagesForTurn,
|
|
92
|
+
findLatestReasoningMessageIndex,
|
|
93
|
+
findStablePrefixEnd,
|
|
94
|
+
formatExecutionDuration,
|
|
95
|
+
formatLoadingElapsed,
|
|
96
|
+
getChatColumnWidth,
|
|
97
|
+
getExecutionDurationMs,
|
|
98
|
+
getFilePreviewName,
|
|
99
|
+
getPersistentAskUserQuestions,
|
|
100
|
+
getRenderBlockPersistentId,
|
|
101
|
+
isErrorMessage,
|
|
102
|
+
isImageFilename,
|
|
103
|
+
isLoopbackUrl,
|
|
104
|
+
isPreparingReply,
|
|
22
105
|
isQueuePanelVisible,
|
|
106
|
+
isTextFilename,
|
|
107
|
+
isUiMeta,
|
|
108
|
+
isUserMessage,
|
|
23
109
|
latestUserSpeechEntryId,
|
|
110
|
+
nextQueuedOrder,
|
|
111
|
+
normalizeDeliveredRelPath,
|
|
112
|
+
normalizeScrollEntryKey,
|
|
113
|
+
openInSessionSandboxBrowser,
|
|
114
|
+
parseAskUserQuestion,
|
|
115
|
+
parseAskUserQuestionError,
|
|
116
|
+
parsePlanMessages,
|
|
117
|
+
parsePlanTree,
|
|
118
|
+
parsePlanTreeResult,
|
|
24
119
|
parseWhatIfPrompt,
|
|
120
|
+
renderOptionalComponent,
|
|
121
|
+
resetChatColumnWidth,
|
|
122
|
+
resolveAskQuestionState,
|
|
123
|
+
resolveBrowserResourceUri,
|
|
124
|
+
resolveLoadingStageLabel,
|
|
125
|
+
resolveTurnDisplayMode,
|
|
126
|
+
rewriteForSandboxBrowser,
|
|
127
|
+
selectActiveTurnAtViewportPosition,
|
|
128
|
+
setChatColumnWidth,
|
|
129
|
+
shouldAnimateNewTurnScroll,
|
|
130
|
+
shouldAppendPendingAssistantTurn,
|
|
131
|
+
shouldHandOverToFollow,
|
|
132
|
+
snapshotMessageListRenderPlan,
|
|
133
|
+
startIndexOfLastNCompleteTurns,
|
|
134
|
+
toolCallAnswered,
|
|
135
|
+
turnLocateChannel,
|
|
25
136
|
turnNavItemsFromMessages,
|
|
26
137
|
useAgentSession,
|
|
138
|
+
useAsyncValue,
|
|
139
|
+
useCapabilities,
|
|
140
|
+
useCardContext,
|
|
141
|
+
useChatActions,
|
|
142
|
+
useChatColumnWidth,
|
|
143
|
+
useChatCustomization,
|
|
144
|
+
useFollowupInteraction,
|
|
27
145
|
useLlmChat,
|
|
28
146
|
useMessagePin,
|
|
147
|
+
useObservedContainerWidth,
|
|
148
|
+
useReasoning,
|
|
29
149
|
useReplay,
|
|
150
|
+
useSessionReplay,
|
|
30
151
|
useTopicAssetSubmissionAccess,
|
|
152
|
+
useTurnLocateRequest,
|
|
153
|
+
useTurnLocateStatus,
|
|
31
154
|
useTurnNavigation,
|
|
32
155
|
useTypewriterReveal
|
|
33
|
-
} from "./chunk-
|
|
156
|
+
} from "./chunk-NRAHM3CD.js";
|
|
34
157
|
import {
|
|
158
|
+
AccountConnectors,
|
|
35
159
|
ConnectorPanel,
|
|
36
160
|
PluginTriggerStack,
|
|
37
161
|
TRIGGER_ICON_LIMIT,
|
|
162
|
+
backgroundTaskDismissals,
|
|
163
|
+
composerChannels,
|
|
38
164
|
selectionFromItem,
|
|
39
|
-
|
|
40
|
-
|
|
165
|
+
skillDisplayName,
|
|
166
|
+
triggerSummary,
|
|
167
|
+
useComposerChannels,
|
|
168
|
+
useDismissedBackgroundTasks,
|
|
169
|
+
visibleSkillIds,
|
|
170
|
+
visibleSkills
|
|
171
|
+
} from "./chunk-JBVJMUJA.js";
|
|
41
172
|
import {
|
|
42
|
-
BladeProvider,
|
|
43
|
-
Content2,
|
|
44
|
-
PLAN_AUTO_COLLAPSE_MS,
|
|
45
|
-
PlanUpdateBlock,
|
|
46
173
|
PluginConnectorList,
|
|
47
|
-
|
|
48
|
-
Provider,
|
|
49
|
-
Root3,
|
|
174
|
+
RichInputServicesProvider,
|
|
50
175
|
SessionPluginConfigDialog,
|
|
51
|
-
SessionPluginConfigForm,
|
|
52
176
|
SessionPluginIcon,
|
|
53
|
-
|
|
177
|
+
buildPendingAskUserAnswer,
|
|
54
178
|
catalogToConnectorItems,
|
|
55
|
-
|
|
179
|
+
chatTone,
|
|
56
180
|
filterConnectorItems,
|
|
181
|
+
mergeConnectorItems,
|
|
182
|
+
parseModelReasoningLevels,
|
|
183
|
+
resetInputCaches,
|
|
184
|
+
sendToSession,
|
|
185
|
+
sessionPluginLabel,
|
|
186
|
+
useRichInputServices,
|
|
187
|
+
useSessionPluginActivation
|
|
188
|
+
} from "./chunk-A5WYUMNB.js";
|
|
189
|
+
import {
|
|
190
|
+
ConnectorConnection,
|
|
191
|
+
DeviceConnection
|
|
192
|
+
} from "./chunk-T42PKMOI.js";
|
|
193
|
+
import {
|
|
194
|
+
BashRenderer,
|
|
195
|
+
CodePreview,
|
|
196
|
+
FileEditRenderer,
|
|
197
|
+
FileReadRenderer,
|
|
198
|
+
ImageLightbox,
|
|
199
|
+
McpAppCard,
|
|
200
|
+
McpAppFrame,
|
|
201
|
+
MessageImage,
|
|
202
|
+
SUPPORTED_LANGUAGES,
|
|
203
|
+
SearchRenderer,
|
|
204
|
+
SubmitResultRenderer,
|
|
205
|
+
ToolUiCardView,
|
|
206
|
+
extractErrorMessage,
|
|
207
|
+
formatBytes,
|
|
208
|
+
getBooleanValue,
|
|
209
|
+
getCodeLanguage,
|
|
210
|
+
getCodeLanguageFromFilename,
|
|
211
|
+
getFileName,
|
|
212
|
+
getNumberValue,
|
|
213
|
+
getRenderer,
|
|
214
|
+
getResultImages,
|
|
215
|
+
getResultText,
|
|
216
|
+
getStringValue,
|
|
217
|
+
isPlainObject,
|
|
218
|
+
normalizeCodeLanguage,
|
|
219
|
+
parseJsonValue,
|
|
220
|
+
scrollWritePreviewToLatest,
|
|
221
|
+
shouldFollowWritePreview
|
|
222
|
+
} from "./chunk-3XWKS2YP.js";
|
|
223
|
+
import {
|
|
224
|
+
CodeBlockPre,
|
|
225
|
+
DEFAULT_ALLOWED_TAGS,
|
|
226
|
+
ExternalAnchor,
|
|
227
|
+
MarkdownContent,
|
|
228
|
+
MarkdownRenderer,
|
|
229
|
+
collapseInlineToolCalls,
|
|
230
|
+
findCodeRanges,
|
|
231
|
+
injectCitationRefs,
|
|
232
|
+
normalizeAdjacentUrlFormatting,
|
|
233
|
+
resolveCollapsedContent,
|
|
234
|
+
resolveSessionMarkdownAssetUrl,
|
|
235
|
+
stripSystemReminders
|
|
236
|
+
} from "./chunk-NS55ESUC.js";
|
|
237
|
+
import {
|
|
238
|
+
BladeProvider,
|
|
239
|
+
BrowserConnectionDialog,
|
|
240
|
+
ChatEnvironmentProvider,
|
|
241
|
+
CurrentChatSessionProvider,
|
|
242
|
+
PLAN_AUTO_COLLAPSE_MS,
|
|
243
|
+
PlanUpdateBlock,
|
|
244
|
+
SessionSourceProvider,
|
|
245
|
+
cn,
|
|
246
|
+
countMessageLines,
|
|
247
|
+
countPendingToolCalls,
|
|
248
|
+
countSuccessfulToolCalls,
|
|
249
|
+
extractToolFilePath,
|
|
250
|
+
extractToolFilePaths,
|
|
251
|
+
findAnchorMessageIndex,
|
|
252
|
+
formatToolCallCount,
|
|
253
|
+
formatToolFileName,
|
|
254
|
+
formatToolName,
|
|
255
|
+
getCollapsedTurnSegments,
|
|
256
|
+
getFinishTaskTitle,
|
|
257
|
+
getLastTextSegment,
|
|
258
|
+
getLatestPendingToolName,
|
|
57
259
|
getPlanUpdateDisplayState,
|
|
260
|
+
getSkillNameFromFilePath,
|
|
261
|
+
getTextContentSegments,
|
|
262
|
+
getToolDescription,
|
|
263
|
+
getToolDisplayLabel,
|
|
264
|
+
getToolOutputTag,
|
|
265
|
+
getToolStatusLabel,
|
|
266
|
+
getToolTone,
|
|
267
|
+
hasNaturalLanguageText,
|
|
58
268
|
isPlanUpdateTool,
|
|
59
|
-
|
|
269
|
+
isSuccessfulToolCall,
|
|
270
|
+
notifyChat,
|
|
60
271
|
parsePlanUpdate,
|
|
61
272
|
pickCurrentPlanStep,
|
|
62
|
-
|
|
273
|
+
summarizeToolCalls,
|
|
63
274
|
useBladeClient,
|
|
64
275
|
useBladeHost,
|
|
276
|
+
useChatEnvironment,
|
|
277
|
+
useChatRenderMode,
|
|
278
|
+
useChatSessionDetail,
|
|
279
|
+
useChatVirtualizer,
|
|
280
|
+
useComposerBridge,
|
|
281
|
+
useCurrentChatSessionId,
|
|
282
|
+
useHideTodo,
|
|
283
|
+
useHighlightedCode,
|
|
284
|
+
useIsSessionHistoryLoading,
|
|
65
285
|
useOptionalBladeClient,
|
|
66
|
-
|
|
67
|
-
|
|
286
|
+
usePlanRevealRevision,
|
|
287
|
+
useSessionHandle,
|
|
288
|
+
useSessionSource,
|
|
289
|
+
useSessionState,
|
|
290
|
+
useSingleSessionSource
|
|
291
|
+
} from "./chunk-PRDGUQTE.js";
|
|
292
|
+
import {
|
|
293
|
+
ConfigConnection,
|
|
294
|
+
ConnectorDetail,
|
|
295
|
+
ConnectorRulesPanel,
|
|
296
|
+
Content2,
|
|
297
|
+
Portal,
|
|
298
|
+
Provider,
|
|
299
|
+
Root3,
|
|
300
|
+
Trigger
|
|
301
|
+
} from "./chunk-2GP2S3IR.js";
|
|
302
|
+
import {
|
|
303
|
+
SessionPluginConfigForm
|
|
304
|
+
} from "./chunk-5FK33U4M.js";
|
|
305
|
+
import {
|
|
306
|
+
ChevronDown,
|
|
307
|
+
ChevronRight,
|
|
308
|
+
CircleX,
|
|
309
|
+
LoaderCircle,
|
|
310
|
+
Square
|
|
311
|
+
} from "./chunk-WMWYGB2C.js";
|
|
68
312
|
import "./chunk-PR4QN5HX.js";
|
|
69
313
|
|
|
70
|
-
// src/
|
|
71
|
-
|
|
314
|
+
// src/chat/CompactionCard.tsx
|
|
315
|
+
import { useState } from "react";
|
|
316
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
317
|
+
var PERCENT_FORMATTER = new Intl.NumberFormat("zh-CN", {
|
|
318
|
+
style: "percent",
|
|
319
|
+
maximumFractionDigits: 0
|
|
320
|
+
});
|
|
321
|
+
function formatTokens(value) {
|
|
322
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
323
|
+
return "0";
|
|
324
|
+
}
|
|
325
|
+
const k = value / 1e3;
|
|
326
|
+
if (k < 1) {
|
|
327
|
+
return `${Math.round(value)}`;
|
|
328
|
+
}
|
|
329
|
+
return k < 10 ? `${k.toFixed(1)}k` : `${Math.round(k)}k`;
|
|
330
|
+
}
|
|
331
|
+
function formatSavedRatio(value) {
|
|
332
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
333
|
+
return "0%";
|
|
334
|
+
}
|
|
335
|
+
return PERCENT_FORMATTER.format(Math.max(0, Math.min(1, value)));
|
|
336
|
+
}
|
|
337
|
+
function shortId(compactionId) {
|
|
338
|
+
if (!compactionId) {
|
|
339
|
+
return "------";
|
|
340
|
+
}
|
|
341
|
+
return compactionId.slice(0, 6);
|
|
342
|
+
}
|
|
343
|
+
function getArchivedToolLabel(item) {
|
|
344
|
+
return item.tool_name?.trim() || "\u5DE5\u5177\u8C03\u7528";
|
|
345
|
+
}
|
|
346
|
+
function getArchivePath(item, files) {
|
|
347
|
+
if (item.archive_path) {
|
|
348
|
+
return item.archive_path;
|
|
349
|
+
}
|
|
350
|
+
return files.find((file) => file.tool_name === item.tool_name)?.relative_path ?? null;
|
|
351
|
+
}
|
|
352
|
+
function isGenericArchiveSummary(summary) {
|
|
353
|
+
return /^已归档\s*\d+\s*个大型工具结果。?$/.test(summary?.trim() ?? "");
|
|
354
|
+
}
|
|
355
|
+
function CompactionCard({
|
|
356
|
+
sessionId,
|
|
357
|
+
compaction,
|
|
358
|
+
status
|
|
359
|
+
}) {
|
|
360
|
+
const session = useSessionHandle(sessionId);
|
|
361
|
+
const activeCompaction = useSessionState(sessionId, (state) => state.activeCompaction);
|
|
362
|
+
const source = compaction ? {
|
|
363
|
+
...compaction,
|
|
364
|
+
status: status ?? "completed"
|
|
365
|
+
} : activeCompaction;
|
|
366
|
+
const [expanded, setExpanded] = useState(false);
|
|
367
|
+
if (!source || !source.compaction_id) {
|
|
368
|
+
return null;
|
|
369
|
+
}
|
|
370
|
+
const canCancel = source.status === "streaming";
|
|
371
|
+
const archivedFiles = source.archived_files ?? [];
|
|
372
|
+
const archivedToolCalls = source.archived_tool_calls ?? [];
|
|
373
|
+
const archivedCount = source.archived_count ?? archivedToolCalls.length ?? archivedFiles.length;
|
|
374
|
+
const hasSummary = typeof source.summary_full === "string" && source.summary_full.trim().length > 0 && !isGenericArchiveSummary(source.summary_full);
|
|
375
|
+
const hasFailureReason = source.status === "failed" && Boolean(source.failure_reason);
|
|
376
|
+
const canExpand = source.status === "completed" && (hasSummary || archivedToolCalls.length > 0) || hasFailureReason;
|
|
377
|
+
return /* @__PURE__ */ jsxs("div", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: [
|
|
378
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
379
|
+
/* @__PURE__ */ jsxs(
|
|
380
|
+
"button",
|
|
381
|
+
{
|
|
382
|
+
type: "button",
|
|
383
|
+
onClick: () => canExpand && setExpanded((prev) => !prev),
|
|
384
|
+
className: cn(
|
|
385
|
+
"inline-flex min-w-0 items-center gap-1 rounded-md px-1.5 py-0.5 text-[11px] text-[hsl(var(--muted-foreground))]/65 transition-colors hover:bg-[hsl(var(--muted))]/60 hover:text-[hsl(var(--foreground))]",
|
|
386
|
+
!canExpand && "cursor-default hover:bg-transparent hover:text-[hsl(var(--muted-foreground))]/65"
|
|
387
|
+
),
|
|
388
|
+
"aria-expanded": expanded,
|
|
389
|
+
children: [
|
|
390
|
+
canExpand ? expanded ? /* @__PURE__ */ jsx(ChevronDown, { size: 12, className: "shrink-0" }) : /* @__PURE__ */ jsx(ChevronRight, { size: 12, className: "shrink-0" }) : null,
|
|
391
|
+
/* @__PURE__ */ jsx("span", { children: source.status === "streaming" ? /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1", children: [
|
|
392
|
+
/* @__PURE__ */ jsx(LoaderCircle, { size: 12, className: "animate-spin" }),
|
|
393
|
+
"\u6B63\u5728\u538B\u7F29\u4E0A\u4E0B\u6587"
|
|
394
|
+
] }) : source.status === "failed" ? /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 text-[hsl(var(--swf-danger))]", children: [
|
|
395
|
+
/* @__PURE__ */ jsx(CircleX, { size: 12 }),
|
|
396
|
+
"\u4E0A\u4E0B\u6587\u538B\u7F29\u5931\u8D25"
|
|
397
|
+
] }) : source.status === "interrupted" ? /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 text-[hsl(var(--swf-warning))]", children: [
|
|
398
|
+
/* @__PURE__ */ jsx(Square, { size: 12 }),
|
|
399
|
+
"\u4E0A\u4E0B\u6587\u538B\u7F29\u5DF2\u53D6\u6D88"
|
|
400
|
+
] }) : "\u4E0A\u4E0B\u6587\u5DF2\u538B\u7F29" })
|
|
401
|
+
]
|
|
402
|
+
}
|
|
403
|
+
),
|
|
404
|
+
canCancel ? /* @__PURE__ */ jsx(
|
|
405
|
+
"button",
|
|
406
|
+
{
|
|
407
|
+
type: "button",
|
|
408
|
+
onClick: () => void session?.stop(),
|
|
409
|
+
className: "shrink-0 rounded-md border border-current/15 px-2 py-0.5 text-[11px] transition-opacity hover:opacity-80",
|
|
410
|
+
children: "\u53D6\u6D88\u6574\u7406"
|
|
411
|
+
}
|
|
412
|
+
) : null
|
|
413
|
+
] }),
|
|
414
|
+
expanded ? /* @__PURE__ */ jsxs("div", { className: "mt-1 max-w-3xl rounded-lg border border-[hsl(var(--border))]/70 bg-[hsl(var(--card))]/80 px-3 py-2 text-[11px] leading-relaxed", children: [
|
|
415
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1 text-[hsl(var(--muted-foreground))]", children: [
|
|
416
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
417
|
+
"#",
|
|
418
|
+
shortId(source.compaction_id)
|
|
419
|
+
] }),
|
|
420
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
421
|
+
"\u8282\u7701 ",
|
|
422
|
+
formatSavedRatio(source.saved_ratio),
|
|
423
|
+
"\uFF08",
|
|
424
|
+
formatTokens(source.tokens_before),
|
|
425
|
+
" \u2192",
|
|
426
|
+
" ",
|
|
427
|
+
formatTokens(source.tokens_after),
|
|
428
|
+
" token\uFF09"
|
|
429
|
+
] }),
|
|
430
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
431
|
+
"\u5F52\u6863 ",
|
|
432
|
+
archivedCount,
|
|
433
|
+
" \u4E2A\u5DE5\u5177\u7ED3\u679C"
|
|
434
|
+
] })
|
|
435
|
+
] }),
|
|
436
|
+
archivedToolCalls.length > 0 ? /* @__PURE__ */ jsx("div", { className: "mt-2 space-y-1.5", children: archivedToolCalls.map((item, index) => {
|
|
437
|
+
const archivePath = getArchivePath(item, archivedFiles);
|
|
438
|
+
return /* @__PURE__ */ jsxs(
|
|
439
|
+
"div",
|
|
440
|
+
{
|
|
441
|
+
className: "rounded-md border border-[hsl(var(--border))]/70 bg-[hsl(var(--muted))]/35 px-2 py-1.5",
|
|
442
|
+
children: [
|
|
443
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-1 text-[hsl(var(--foreground))]", children: [
|
|
444
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium", children: getArchivedToolLabel(item) }),
|
|
445
|
+
item.tool_call_id ? /* @__PURE__ */ jsx("span", { className: "font-mono text-[10px] text-[hsl(var(--muted-foreground))]", children: item.tool_call_id }) : null
|
|
446
|
+
] }),
|
|
447
|
+
archivePath ? /* @__PURE__ */ jsx("div", { className: "mt-0.5 break-all font-mono text-[10px] text-[hsl(var(--muted-foreground))]", children: archivePath }) : null
|
|
448
|
+
]
|
|
449
|
+
},
|
|
450
|
+
item.tool_call_id || item.entry_id || `${item.tool_name}-${index}`
|
|
451
|
+
);
|
|
452
|
+
}) }) : null,
|
|
453
|
+
hasSummary ? /* @__PURE__ */ jsx("pre", { className: "mt-2 max-h-[360px] overflow-auto whitespace-pre-wrap rounded-md border border-[hsl(var(--border))]/70 bg-[hsl(var(--muted))]/25 px-2 py-1.5 font-mono text-[11px] leading-relaxed text-[hsl(var(--foreground))]", children: source.summary_full }) : null,
|
|
454
|
+
source.status === "failed" && source.failure_reason ? /* @__PURE__ */ jsxs("div", { className: "mt-2 text-[hsl(var(--swf-danger))]", children: [
|
|
455
|
+
"\u5931\u8D25\u539F\u56E0\uFF1A",
|
|
456
|
+
source.failure_reason
|
|
457
|
+
] }) : null
|
|
458
|
+
] }) : null
|
|
459
|
+
] });
|
|
460
|
+
}
|
|
72
461
|
|
|
73
462
|
// src/lib/mount-renderers.tsx
|
|
74
463
|
import { createContext, useContext, useId, useLayoutEffect, useRef } from "react";
|
|
75
|
-
import { jsx } from "react/jsx-runtime";
|
|
464
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
76
465
|
var MountHostContext = createContext(null);
|
|
77
466
|
function normalizeResult(result) {
|
|
78
467
|
if (typeof result === "function") return { destroy: result };
|
|
@@ -129,11 +518,11 @@ function MountSlot({ renderer, data }) {
|
|
|
129
518
|
mounted.target.replaceChildren();
|
|
130
519
|
mounted.handle = normalizeResult(renderer.mount(mounted.target, data));
|
|
131
520
|
}, [data, renderer]);
|
|
132
|
-
return host ? /* @__PURE__ */
|
|
521
|
+
return host ? /* @__PURE__ */ jsx2("slot", { name: slotName }) : /* @__PURE__ */ jsx2("div", { ref: localRef, "data-blade-mount": "" });
|
|
133
522
|
}
|
|
134
523
|
function slotFor(renderer, data) {
|
|
135
524
|
if (renderer.match && !renderer.match(data)) return null;
|
|
136
|
-
return /* @__PURE__ */
|
|
525
|
+
return /* @__PURE__ */ jsx2(MountSlot, { renderer, data });
|
|
137
526
|
}
|
|
138
527
|
function mountRenderersToReact(renderers, context = {}) {
|
|
139
528
|
if (!renderers) return void 0;
|
|
@@ -154,8 +543,8 @@ function mountRenderersToReact(renderers, context = {}) {
|
|
|
154
543
|
}
|
|
155
544
|
|
|
156
545
|
// src/components/SessionMemoryToggle.tsx
|
|
157
|
-
import { useCallback, useEffect, useRef as useRef2, useState, useSyncExternalStore } from "react";
|
|
158
|
-
import { jsx as
|
|
546
|
+
import { useCallback, useEffect, useRef as useRef2, useState as useState2, useSyncExternalStore } from "react";
|
|
547
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
159
548
|
var saveStates = /* @__PURE__ */ new WeakMap();
|
|
160
549
|
function getSaveState(client, sessionId) {
|
|
161
550
|
let clientStates = saveStates.get(client);
|
|
@@ -212,7 +601,7 @@ function SessionMemoryToggle({
|
|
|
212
601
|
getSaving,
|
|
213
602
|
getSaving
|
|
214
603
|
);
|
|
215
|
-
const [draftEnabled, setDraftEnabled] =
|
|
604
|
+
const [draftEnabled, setDraftEnabled] = useState2(enabled);
|
|
216
605
|
const activeSessionIdRef = useRef2(sessionId);
|
|
217
606
|
activeSessionIdRef.current = sessionId;
|
|
218
607
|
useEffect(() => {
|
|
@@ -244,9 +633,9 @@ function SessionMemoryToggle({
|
|
|
244
633
|
},
|
|
245
634
|
[client, enabled, onError, onSaved, sessionId]
|
|
246
635
|
);
|
|
247
|
-
return /* @__PURE__ */
|
|
248
|
-
/* @__PURE__ */
|
|
249
|
-
/* @__PURE__ */
|
|
636
|
+
return /* @__PURE__ */ jsxs2("label", { className: cn("flex items-center justify-between", className), children: [
|
|
637
|
+
/* @__PURE__ */ jsx3("span", { className: labelClassName, children: label }),
|
|
638
|
+
/* @__PURE__ */ jsx3(
|
|
250
639
|
"input",
|
|
251
640
|
{
|
|
252
641
|
type: "checkbox",
|
|
@@ -259,51 +648,9 @@ function SessionMemoryToggle({
|
|
|
259
648
|
] });
|
|
260
649
|
}
|
|
261
650
|
|
|
262
|
-
// src/lib/agent-computer-command.ts
|
|
263
|
-
var COMPUTER_LAUNCH_COMMAND_PATTERN = /(?:^|[\n;&|(]\s*)computer\s+launch(?:\s|$)/;
|
|
264
|
-
function isAgentComputerCommand(command) {
|
|
265
|
-
return COMPUTER_LAUNCH_COMMAND_PATTERN.test(command);
|
|
266
|
-
}
|
|
267
|
-
function isAgentComputerToolCall(argumentsJson) {
|
|
268
|
-
if (!argumentsJson) return false;
|
|
269
|
-
let command;
|
|
270
|
-
try {
|
|
271
|
-
const parsed = JSON.parse(argumentsJson);
|
|
272
|
-
if (typeof parsed !== "object" || parsed === null) return false;
|
|
273
|
-
command = parsed.command;
|
|
274
|
-
} catch {
|
|
275
|
-
return false;
|
|
276
|
-
}
|
|
277
|
-
return typeof command === "string" && isAgentComputerCommand(command);
|
|
278
|
-
}
|
|
279
|
-
var LAUNCH_SUCCESS_MARKER = "\u5DF2\u542F\u52A8 ";
|
|
280
|
-
function resultContainsLaunchSuccessMarker(result, depth = 0) {
|
|
281
|
-
if (depth > 2) return false;
|
|
282
|
-
if (typeof result === "string") {
|
|
283
|
-
if (result.includes(LAUNCH_SUCCESS_MARKER)) return true;
|
|
284
|
-
try {
|
|
285
|
-
return resultContainsLaunchSuccessMarker(JSON.parse(result), depth + 1);
|
|
286
|
-
} catch {
|
|
287
|
-
return false;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
if (typeof result === "object" && result !== null) {
|
|
291
|
-
for (const value of Object.values(result)) {
|
|
292
|
-
if (typeof value === "string" && value.includes(LAUNCH_SUCCESS_MARKER)) return true;
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
return false;
|
|
296
|
-
}
|
|
297
|
-
function classifyAgentComputerLaunchOutcome(toolCall) {
|
|
298
|
-
if (toolCall.status === "error" || toolCall.status === "cancelled") return "failed";
|
|
299
|
-
if (toolCall.status !== "done") return "pending";
|
|
300
|
-
if (toolCall.result === void 0 || toolCall.result === null) return "unknown";
|
|
301
|
-
return resultContainsLaunchSuccessMarker(toolCall.result) ? "succeeded" : "failed";
|
|
302
|
-
}
|
|
303
|
-
|
|
304
651
|
// src/components/SessionBranchPicker.tsx
|
|
305
|
-
import { useMemo, useState as
|
|
306
|
-
import { jsx as
|
|
652
|
+
import { useMemo, useState as useState3 } from "react";
|
|
653
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
307
654
|
var ROW_HEIGHT = 32;
|
|
308
655
|
var SVG_WIDTH = 44;
|
|
309
656
|
function SessionBranchPicker({
|
|
@@ -311,8 +658,8 @@ function SessionBranchPicker({
|
|
|
311
658
|
disabled = false,
|
|
312
659
|
onCheckout
|
|
313
660
|
}) {
|
|
314
|
-
const [checkoutError, setCheckoutError] =
|
|
315
|
-
const [pendingNodeId, setPendingNodeId] =
|
|
661
|
+
const [checkoutError, setCheckoutError] = useState3(null);
|
|
662
|
+
const [pendingNodeId, setPendingNodeId] = useState3(null);
|
|
316
663
|
const hasHistory = tree.nodes.length > 0;
|
|
317
664
|
const layout = useMemo(() => buildLayoutNodes(tree), [tree]);
|
|
318
665
|
const nodeMap = useMemo(() => new Map(tree.nodes.map((node) => [node.id, node])), [tree]);
|
|
@@ -342,10 +689,10 @@ function SessionBranchPicker({
|
|
|
342
689
|
if (sourceNode) await checkoutNode(sourceNode, "before");
|
|
343
690
|
}
|
|
344
691
|
if (!hasHistory) return null;
|
|
345
|
-
return /* @__PURE__ */
|
|
346
|
-
checkoutError ? /* @__PURE__ */
|
|
347
|
-
/* @__PURE__ */
|
|
348
|
-
/* @__PURE__ */
|
|
692
|
+
return /* @__PURE__ */ jsxs3(Provider, { delayDuration: 200, children: [
|
|
693
|
+
checkoutError ? /* @__PURE__ */ jsx4("p", { role: "alert", className: "mb-2 text-xs text-destructive", children: checkoutError }) : null,
|
|
694
|
+
/* @__PURE__ */ jsx4("div", { className: "flex max-h-52 justify-center overflow-x-auto overflow-y-auto", children: /* @__PURE__ */ jsxs3("div", { className: "relative", style: { height: graphHeight, width: graphWidth }, children: [
|
|
695
|
+
/* @__PURE__ */ jsx4(
|
|
349
696
|
"svg",
|
|
350
697
|
{
|
|
351
698
|
"aria-hidden": "true",
|
|
@@ -359,7 +706,7 @@ function SessionBranchPicker({
|
|
|
359
706
|
return null;
|
|
360
707
|
}
|
|
361
708
|
const childStroke = node.isActive ? "hsl(var(--primary))" : "hsl(var(--muted-foreground))";
|
|
362
|
-
return /* @__PURE__ */
|
|
709
|
+
return /* @__PURE__ */ jsx4(
|
|
363
710
|
"path",
|
|
364
711
|
{
|
|
365
712
|
d: buildEdgePath(
|
|
@@ -380,12 +727,12 @@ function SessionBranchPicker({
|
|
|
380
727
|
})
|
|
381
728
|
}
|
|
382
729
|
),
|
|
383
|
-
/* @__PURE__ */
|
|
730
|
+
/* @__PURE__ */ jsx4("div", { className: "relative z-0 h-full", children: layout.nodes.map((node) => {
|
|
384
731
|
const isPendingNode = pendingNodeId === node.id;
|
|
385
732
|
const color = node.isActive ? "hsl(var(--primary))" : "hsl(var(--muted-foreground))";
|
|
386
733
|
const previewText = node.isVirtual ? isPendingNode ? "\u5207\u6362\u4E2D..." : "" : isPendingNode ? "\u5207\u6362\u4E2D..." : node.preview;
|
|
387
734
|
const shouldShowTooltip = !node.isVirtual || Boolean(previewText);
|
|
388
|
-
const button = /* @__PURE__ */
|
|
735
|
+
const button = /* @__PURE__ */ jsx4(
|
|
389
736
|
"button",
|
|
390
737
|
{
|
|
391
738
|
type: "button",
|
|
@@ -401,7 +748,7 @@ function SessionBranchPicker({
|
|
|
401
748
|
top: node.row * ROW_HEIGHT,
|
|
402
749
|
left: getColumnX(node.column) - 12
|
|
403
750
|
},
|
|
404
|
-
children: /* @__PURE__ */
|
|
751
|
+
children: /* @__PURE__ */ jsx4("span", { "aria-hidden": "true", className: "absolute left-0 top-0 h-8 w-6", children: /* @__PURE__ */ jsx4(
|
|
405
752
|
"svg",
|
|
406
753
|
{
|
|
407
754
|
"aria-hidden": "true",
|
|
@@ -411,7 +758,7 @@ function SessionBranchPicker({
|
|
|
411
758
|
height: ROW_HEIGHT,
|
|
412
759
|
viewBox: `0 0 24 ${ROW_HEIGHT}`,
|
|
413
760
|
fill: "none",
|
|
414
|
-
children: node.isVirtual ? /* @__PURE__ */
|
|
761
|
+
children: node.isVirtual ? /* @__PURE__ */ jsx4(
|
|
415
762
|
"circle",
|
|
416
763
|
{
|
|
417
764
|
cx: 12,
|
|
@@ -423,9 +770,9 @@ function SessionBranchPicker({
|
|
|
423
770
|
strokeDasharray: "2 2",
|
|
424
771
|
opacity: 0.7
|
|
425
772
|
}
|
|
426
|
-
) : /* @__PURE__ */
|
|
427
|
-
node.isCurrent ? /* @__PURE__ */
|
|
428
|
-
/* @__PURE__ */
|
|
773
|
+
) : /* @__PURE__ */ jsxs3("g", { children: [
|
|
774
|
+
node.isCurrent ? /* @__PURE__ */ jsx4("circle", { cx: 12, cy: ROW_HEIGHT / 2, r: 9, fill: color, opacity: 0.18 }) : null,
|
|
775
|
+
/* @__PURE__ */ jsx4(
|
|
429
776
|
"circle",
|
|
430
777
|
{
|
|
431
778
|
cx: 12,
|
|
@@ -440,18 +787,16 @@ function SessionBranchPicker({
|
|
|
440
787
|
}
|
|
441
788
|
);
|
|
442
789
|
if (!shouldShowTooltip) {
|
|
443
|
-
return /* @__PURE__ */
|
|
790
|
+
return /* @__PURE__ */ jsx4("div", { children: button }, node.id);
|
|
444
791
|
}
|
|
445
|
-
return /* @__PURE__ */
|
|
446
|
-
/* @__PURE__ */
|
|
447
|
-
/* @__PURE__ */
|
|
792
|
+
return /* @__PURE__ */ jsxs3(Root3, { children: [
|
|
793
|
+
/* @__PURE__ */ jsx4(Trigger, { asChild: true, children: button }),
|
|
794
|
+
/* @__PURE__ */ jsx4(Portal, { children: /* @__PURE__ */ jsx4(
|
|
448
795
|
Content2,
|
|
449
796
|
{
|
|
450
797
|
side: "right",
|
|
451
798
|
sideOffset: 8,
|
|
452
799
|
className: cn(
|
|
453
|
-
// z-[60]:这张图会被放进回溯弹层(z-50 且背景不透明),
|
|
454
|
-
// 消息预览不抬到弹层之上就会被它的背景吃掉。
|
|
455
800
|
"z-[60] rounded-md border border-border bg-popover px-2 py-1 text-xs text-foreground shadow-md",
|
|
456
801
|
!node.isVirtual && node.isCurrent && "font-semibold"
|
|
457
802
|
),
|
|
@@ -595,28 +940,95 @@ function buildEdgePath(fromX, fromY, toX, toY) {
|
|
|
595
940
|
].join(" ");
|
|
596
941
|
}
|
|
597
942
|
export {
|
|
943
|
+
AccountConnectors,
|
|
944
|
+
ActionApprovalCard,
|
|
945
|
+
ActionApprovals,
|
|
598
946
|
AgentChat,
|
|
947
|
+
AgentLoopBlock,
|
|
948
|
+
AskUserQuestionBlock,
|
|
949
|
+
AssistantTurnBlock,
|
|
950
|
+
AttachmentPreviewDialog,
|
|
599
951
|
BackgroundWakeNotice,
|
|
952
|
+
BashRenderer,
|
|
600
953
|
BladeProvider,
|
|
954
|
+
BrowserConnectionDialog,
|
|
955
|
+
CHAT_COLUMN_WIDTH_STORAGE_KEY,
|
|
956
|
+
CardContext,
|
|
957
|
+
ChatColumnResizeRails,
|
|
958
|
+
ChatCustomizationProvider,
|
|
959
|
+
ChatEnvironmentProvider,
|
|
960
|
+
ChatLoadingIndicator,
|
|
961
|
+
ChatPanel,
|
|
601
962
|
ChatView,
|
|
602
963
|
CodeBlockPre,
|
|
964
|
+
CodePreview,
|
|
965
|
+
CompactionCard,
|
|
966
|
+
ConfigConnection,
|
|
967
|
+
ConnectionBanner,
|
|
968
|
+
ConnectorConnection,
|
|
969
|
+
ConnectorDetail,
|
|
603
970
|
ConnectorPanel,
|
|
971
|
+
ConnectorRulesPanel,
|
|
604
972
|
ContextCard,
|
|
605
973
|
ContextGroupCard,
|
|
974
|
+
CurrentChatSessionProvider,
|
|
975
|
+
CurrentPlanPanel,
|
|
976
|
+
CurrentPlanPanelContent,
|
|
606
977
|
DEFAULT_ALLOWED_TAGS,
|
|
978
|
+
DEFAULT_CHAT_COLUMN_WIDTH,
|
|
979
|
+
DeliveryCard,
|
|
980
|
+
DeviceConnection,
|
|
981
|
+
ENTRY_SCROLL_MARGIN_PX,
|
|
982
|
+
ErrorMessageBlock,
|
|
983
|
+
ExternalAnchor,
|
|
984
|
+
FileDeliveryCards,
|
|
985
|
+
FileEditRenderer,
|
|
986
|
+
FileReadRenderer,
|
|
987
|
+
FinalArtifactCards,
|
|
988
|
+
FollowupInteractionProvider,
|
|
989
|
+
HistoricalResultFeedback,
|
|
990
|
+
ImageLightbox,
|
|
991
|
+
LOOPBACK_HOSTS,
|
|
992
|
+
LightComposer,
|
|
993
|
+
LiteMessageList,
|
|
607
994
|
LlmChat,
|
|
995
|
+
MANUAL_SCROLL_TOLERANCE_PX,
|
|
996
|
+
MAX_CHAT_COLUMN_WIDTH,
|
|
997
|
+
MIN_CHAT_COLUMN_WIDTH,
|
|
608
998
|
MarkdownContent,
|
|
609
999
|
MarkdownRenderer,
|
|
610
1000
|
McpAppCard,
|
|
1001
|
+
McpAppFrame,
|
|
1002
|
+
MemoryRefsHint,
|
|
1003
|
+
MessageActions,
|
|
1004
|
+
MessageContextPills,
|
|
1005
|
+
MessageFileAttachmentList,
|
|
611
1006
|
MessageImage,
|
|
1007
|
+
MessageList,
|
|
612
1008
|
MountHostContext,
|
|
613
1009
|
MountSlot,
|
|
1010
|
+
NAV_AT_BOTTOM_EPSILON_PX,
|
|
1011
|
+
NEW_TURN_SCROLL_DURATION_MS,
|
|
1012
|
+
NEW_TURN_SCROLL_MAX_SCREENS,
|
|
1013
|
+
NEW_TURN_SCROLL_MIN_DISTANCE_PX,
|
|
1014
|
+
PIN_HANDOVER_TOLERANCE_PX,
|
|
614
1015
|
PLAN_AUTO_COLLAPSE_MS,
|
|
1016
|
+
PlanSummaryCard,
|
|
615
1017
|
PlanUpdateBlock,
|
|
616
1018
|
PluginConnectorList,
|
|
617
1019
|
PluginTriggerStack,
|
|
1020
|
+
PostChatFollowupBlock,
|
|
1021
|
+
RECENT_RESIDENT_TURNS,
|
|
1022
|
+
Reasoning,
|
|
1023
|
+
ReasoningContent,
|
|
1024
|
+
ReasoningTrigger,
|
|
1025
|
+
RenderErrorBoundary,
|
|
618
1026
|
ReplayBar,
|
|
619
1027
|
ReplayMismatchPrompt,
|
|
1028
|
+
ResultFeedback,
|
|
1029
|
+
RichInputServicesProvider,
|
|
1030
|
+
SUPPORTED_LANGUAGES,
|
|
1031
|
+
SearchRenderer,
|
|
620
1032
|
SessionBranchPicker,
|
|
621
1033
|
SessionMemoryToggle,
|
|
622
1034
|
SessionPluginConfigDialog,
|
|
@@ -624,39 +1036,195 @@ export {
|
|
|
624
1036
|
SessionPluginIcon,
|
|
625
1037
|
SessionPluginSelector,
|
|
626
1038
|
SessionQueuePanel,
|
|
1039
|
+
SessionReplayBar,
|
|
1040
|
+
SessionSourceProvider,
|
|
1041
|
+
Shimmer,
|
|
1042
|
+
SubmitResultRenderer,
|
|
627
1043
|
TRIGGER_ICON_LIMIT,
|
|
628
1044
|
TURN_NAV_HIGHLIGHT_CLASS,
|
|
1045
|
+
TextAttachmentPills,
|
|
1046
|
+
ThinkingBadge,
|
|
1047
|
+
ToolCallBlock,
|
|
1048
|
+
ToolFilePreviewAction,
|
|
1049
|
+
ToolPreviewAction,
|
|
1050
|
+
ToolUiCard,
|
|
629
1051
|
ToolUiCardView,
|
|
630
1052
|
TopicAssetSubmitDialog,
|
|
1053
|
+
TurnNavRail,
|
|
1054
|
+
USER_MESSAGE_MARKDOWN_CLASS,
|
|
1055
|
+
UserMessageBubble,
|
|
631
1056
|
WhatIfUserBubble,
|
|
1057
|
+
WorkflowRunBlock,
|
|
1058
|
+
applyPlanStatusesById,
|
|
1059
|
+
approvalDecisionMessage,
|
|
1060
|
+
backgroundTaskDismissals,
|
|
1061
|
+
buildCitationsFromToolCalls,
|
|
1062
|
+
buildLiteRows,
|
|
1063
|
+
buildMessageListBlockIndexes,
|
|
1064
|
+
buildMessageListBlocks,
|
|
1065
|
+
buildPendingAskUserAnswer,
|
|
1066
|
+
calculateAnchoredScrollTop,
|
|
1067
|
+
calculateAnimatedScrollTop,
|
|
1068
|
+
calculateStickyAwareMargin,
|
|
1069
|
+
calculateTrailingSpacerHeight,
|
|
632
1070
|
catalogToConnectorItems,
|
|
633
|
-
|
|
1071
|
+
chatTone,
|
|
1072
|
+
clampChatColumnWidth,
|
|
1073
|
+
collapseInlineToolCalls,
|
|
1074
|
+
collectDeliveredFiles,
|
|
1075
|
+
collectMemoryRefs,
|
|
1076
|
+
collectTurnMessages,
|
|
1077
|
+
composerChannels,
|
|
1078
|
+
countMessageLines,
|
|
1079
|
+
countPendingToolCalls,
|
|
1080
|
+
countSuccessfulToolCalls,
|
|
1081
|
+
defaultTurnDisplayMode,
|
|
1082
|
+
dispatchPreview,
|
|
1083
|
+
extractErrorMessage,
|
|
1084
|
+
extractLatestPlanMessages,
|
|
1085
|
+
extractPlanMessagesForTurn,
|
|
1086
|
+
extractToolFilePath,
|
|
1087
|
+
extractToolFilePaths,
|
|
634
1088
|
filterConnectorItems,
|
|
1089
|
+
findAnchorMessageIndex,
|
|
1090
|
+
findCodeRanges,
|
|
1091
|
+
findLatestReasoningMessageIndex,
|
|
1092
|
+
findStablePrefixEnd,
|
|
1093
|
+
formatBytes,
|
|
1094
|
+
formatExecutionDuration,
|
|
1095
|
+
formatLoadingElapsed,
|
|
1096
|
+
formatToolCallCount,
|
|
1097
|
+
formatToolFileName,
|
|
1098
|
+
formatToolName,
|
|
1099
|
+
getBooleanValue,
|
|
1100
|
+
getChatColumnWidth,
|
|
1101
|
+
getCodeLanguage,
|
|
1102
|
+
getCodeLanguageFromFilename,
|
|
1103
|
+
getCollapsedTurnSegments,
|
|
1104
|
+
getExecutionDurationMs,
|
|
1105
|
+
getFileName,
|
|
1106
|
+
getFilePreviewName,
|
|
1107
|
+
getFinishTaskTitle,
|
|
1108
|
+
getLastTextSegment,
|
|
1109
|
+
getLatestPendingToolName,
|
|
1110
|
+
getNumberValue,
|
|
1111
|
+
getPersistentAskUserQuestions,
|
|
635
1112
|
getPlanUpdateDisplayState,
|
|
636
|
-
|
|
637
|
-
|
|
1113
|
+
getRenderBlockPersistentId,
|
|
1114
|
+
getRenderer,
|
|
1115
|
+
getResultImages,
|
|
1116
|
+
getResultText,
|
|
1117
|
+
getSkillNameFromFilePath,
|
|
1118
|
+
getStringValue,
|
|
1119
|
+
getTextContentSegments,
|
|
1120
|
+
getToolDescription,
|
|
1121
|
+
getToolDisplayLabel,
|
|
1122
|
+
getToolOutputTag,
|
|
1123
|
+
getToolStatusLabel,
|
|
1124
|
+
getToolTone,
|
|
1125
|
+
hasNaturalLanguageText,
|
|
1126
|
+
injectCitationRefs,
|
|
1127
|
+
isErrorMessage,
|
|
1128
|
+
isImageFilename,
|
|
1129
|
+
isLoopbackUrl,
|
|
1130
|
+
isPlainObject,
|
|
638
1131
|
isPlanUpdateTool,
|
|
1132
|
+
isPreparingReply,
|
|
639
1133
|
isQueuePanelVisible,
|
|
1134
|
+
isSuccessfulToolCall,
|
|
1135
|
+
isTextFilename,
|
|
1136
|
+
isUiMeta,
|
|
1137
|
+
isUserMessage,
|
|
640
1138
|
latestUserSpeechEntryId,
|
|
641
1139
|
mergeConnectorItems,
|
|
642
1140
|
mountRenderersToReact,
|
|
1141
|
+
nextQueuedOrder,
|
|
1142
|
+
normalizeAdjacentUrlFormatting,
|
|
1143
|
+
normalizeCodeLanguage,
|
|
1144
|
+
normalizeDeliveredRelPath,
|
|
1145
|
+
normalizeScrollEntryKey,
|
|
1146
|
+
notifyChat,
|
|
1147
|
+
openInSessionSandboxBrowser,
|
|
1148
|
+
parseAskUserQuestion,
|
|
1149
|
+
parseAskUserQuestionError,
|
|
1150
|
+
parseJsonValue,
|
|
1151
|
+
parseModelReasoningLevels,
|
|
1152
|
+
parsePlanMessages,
|
|
1153
|
+
parsePlanTree,
|
|
1154
|
+
parsePlanTreeResult,
|
|
643
1155
|
parsePlanUpdate,
|
|
644
1156
|
parseWhatIfPrompt,
|
|
645
1157
|
pickCurrentPlanStep,
|
|
1158
|
+
renderOptionalComponent,
|
|
1159
|
+
resetChatColumnWidth,
|
|
1160
|
+
resetInputCaches,
|
|
1161
|
+
resolveAskQuestionState,
|
|
1162
|
+
resolveBrowserResourceUri,
|
|
1163
|
+
resolveCollapsedContent,
|
|
1164
|
+
resolveLoadingStageLabel,
|
|
1165
|
+
resolveSessionMarkdownAssetUrl,
|
|
1166
|
+
resolveTurnDisplayMode,
|
|
1167
|
+
rewriteForSandboxBrowser,
|
|
1168
|
+
scrollWritePreviewToLatest,
|
|
1169
|
+
selectActiveTurnAtViewportPosition,
|
|
646
1170
|
selectionFromItem,
|
|
1171
|
+
sendToSession,
|
|
647
1172
|
sessionPluginLabel,
|
|
1173
|
+
setChatColumnWidth,
|
|
1174
|
+
shouldAnimateNewTurnScroll,
|
|
1175
|
+
shouldAppendPendingAssistantTurn,
|
|
1176
|
+
shouldFollowWritePreview,
|
|
1177
|
+
shouldHandOverToFollow,
|
|
1178
|
+
skillDisplayName,
|
|
1179
|
+
snapshotMessageListRenderPlan,
|
|
1180
|
+
startIndexOfLastNCompleteTurns,
|
|
1181
|
+
stripSystemReminders,
|
|
1182
|
+
summarizeToolCalls,
|
|
1183
|
+
toolCallAnswered,
|
|
648
1184
|
triggerSummary,
|
|
1185
|
+
turnLocateChannel,
|
|
649
1186
|
turnNavItemsFromMessages,
|
|
650
1187
|
useAgentSession,
|
|
1188
|
+
useAsyncValue,
|
|
651
1189
|
useBladeClient,
|
|
652
1190
|
useBladeHost,
|
|
1191
|
+
useCapabilities,
|
|
1192
|
+
useCardContext,
|
|
1193
|
+
useChatActions,
|
|
1194
|
+
useChatColumnWidth,
|
|
1195
|
+
useChatCustomization,
|
|
1196
|
+
useChatEnvironment,
|
|
1197
|
+
useChatRenderMode,
|
|
1198
|
+
useChatSessionDetail,
|
|
1199
|
+
useChatVirtualizer,
|
|
1200
|
+
useComposerBridge,
|
|
1201
|
+
useComposerChannels,
|
|
1202
|
+
useCurrentChatSessionId,
|
|
1203
|
+
useDismissedBackgroundTasks,
|
|
1204
|
+
useFollowupInteraction,
|
|
1205
|
+
useHideTodo,
|
|
1206
|
+
useHighlightedCode,
|
|
1207
|
+
useIsSessionHistoryLoading,
|
|
653
1208
|
useLlmChat,
|
|
654
1209
|
useMessagePin,
|
|
1210
|
+
useObservedContainerWidth,
|
|
655
1211
|
useOptionalBladeClient,
|
|
1212
|
+
usePlanRevealRevision,
|
|
1213
|
+
useReasoning,
|
|
656
1214
|
useReplay,
|
|
1215
|
+
useRichInputServices,
|
|
1216
|
+
useSessionHandle,
|
|
657
1217
|
useSessionPluginActivation,
|
|
1218
|
+
useSessionReplay,
|
|
1219
|
+
useSessionSource,
|
|
1220
|
+
useSessionState,
|
|
1221
|
+
useSingleSessionSource,
|
|
658
1222
|
useTopicAssetSubmissionAccess,
|
|
1223
|
+
useTurnLocateRequest,
|
|
1224
|
+
useTurnLocateStatus,
|
|
659
1225
|
useTurnNavigation,
|
|
660
|
-
useTypewriterReveal
|
|
1226
|
+
useTypewriterReveal,
|
|
1227
|
+
visibleSkillIds,
|
|
1228
|
+
visibleSkills
|
|
661
1229
|
};
|
|
662
1230
|
//# sourceMappingURL=internal.js.map
|