@bolt-foundry/gambit 0.8.6-rc.6 → 0.8.6-rc.7
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/CHANGELOG.md +5 -1
- package/esm/gambit/simulator-ui/dist/bundle.js +1304 -2405
- package/esm/gambit/simulator-ui/dist/bundle.js.map +4 -4
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorGradePage/normalization_ast.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorGradePage/normalization_ast.js +5 -0
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorGradePage/query_text.d.ts +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorGradePage/query_text.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorGradePage/query_text.js +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorGradePage/raw_response_type.d.ts +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorGradePage/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorTestPage/normalization_ast.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorTestPage/normalization_ast.js +5 -0
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorTestPage/query_text.d.ts +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorTestPage/query_text.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorTestPage/query_text.js +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorTestPage/raw_response_type.d.ts +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorTestPage/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorVerifyPage/normalization_ast.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorVerifyPage/normalization_ast.js +5 -0
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorVerifyPage/query_text.d.ts +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorVerifyPage/query_text.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorVerifyPage/query_text.js +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorVerifyPage/raw_response_type.d.ts +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorVerifyPage/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaceShell/normalization_ast.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaceShell/normalization_ast.js +5 -0
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaceShell/query_text.d.ts +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaceShell/query_text.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaceShell/query_text.js +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaceShell/raw_response_type.d.ts +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaceShell/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Workspace/GradeTab/param_type.d.ts +65 -0
- package/esm/simulator-ui/__generated__/__isograph/Workspace/GradeTab/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Workspace/GradeTab/resolver_reader.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Workspace/GradeTab/resolver_reader.js +8 -1
- package/esm/simulator-ui/__generated__/__isograph/Workspace/TestTab/param_type.d.ts +82 -0
- package/esm/simulator-ui/__generated__/__isograph/Workspace/TestTab/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Workspace/TestTab/resolver_reader.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Workspace/TestTab/resolver_reader.js +8 -1
- package/esm/simulator-ui/__generated__/__isograph/Workspace/VerifyTab/param_type.d.ts +106 -0
- package/esm/simulator-ui/__generated__/__isograph/Workspace/VerifyTab/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Workspace/VerifyTab/resolver_reader.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Workspace/VerifyTab/resolver_reader.js +8 -1
- package/esm/simulator-ui/__generated__/__isograph/Workspace/WorkbenchChatDrawer/param_type.d.ts +32 -0
- package/esm/simulator-ui/__generated__/__isograph/Workspace/WorkbenchChatDrawer/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Workspace/WorkbenchChatDrawer/resolver_reader.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Workspace/WorkbenchChatDrawer/resolver_reader.js +8 -1
- package/esm/simulator-ui/isograph/components/Query/SimulatorGradePage.d.ts.map +1 -1
- package/esm/simulator-ui/isograph/components/Query/SimulatorGradePage.js +76 -2
- package/esm/simulator-ui/isograph/components/Query/SimulatorTestPage.d.ts.map +1 -1
- package/esm/simulator-ui/isograph/components/Query/SimulatorTestPage.js +80 -6
- package/esm/simulator-ui/isograph/components/Query/SimulatorVerifyPage.d.ts.map +1 -1
- package/esm/simulator-ui/isograph/components/Query/SimulatorVerifyPage.js +24 -1
- package/esm/simulator-ui/isograph/components/Workspace/WorkbenchChatDrawer.d.ts.map +1 -1
- package/esm/simulator-ui/isograph/components/Workspace/WorkbenchChatDrawer.js +16 -6
- package/esm/simulator-ui/isograph/components/WorkspaceConversationRun/WorkbenchConversationRunChat.d.ts +4 -0
- package/esm/simulator-ui/isograph/components/WorkspaceConversationRun/WorkbenchConversationRunChat.d.ts.map +1 -1
- package/esm/simulator-ui/isograph/components/WorkspaceConversationRun/WorkbenchConversationRunChat.js +59 -24
- package/esm/simulator-ui/isograph/components/grade/GradeTabView.d.ts +14 -0
- package/esm/simulator-ui/isograph/components/grade/GradeTabView.d.ts.map +1 -1
- package/esm/simulator-ui/isograph/components/grade/GradeTabView.js +1 -1
- package/esm/simulator-ui/src/AppShell.d.ts.map +1 -1
- package/esm/simulator-ui/src/AppShell.js +6 -6
- package/esm/simulator-ui/src/Chat.d.ts +6 -30
- package/esm/simulator-ui/src/Chat.d.ts.map +1 -1
- package/esm/simulator-ui/src/Chat.js +14 -109
- package/esm/simulator-ui/src/TestBotChatPanel.d.ts +2 -0
- package/esm/simulator-ui/src/TestBotChatPanel.d.ts.map +1 -1
- package/esm/simulator-ui/src/TestBotChatPanel.js +2 -2
- package/esm/simulator-ui/src/WorkbenchDrawerIso.d.ts +2 -0
- package/esm/simulator-ui/src/WorkbenchDrawerIso.d.ts.map +1 -1
- package/esm/simulator-ui/src/WorkbenchDrawerIso.js +3 -1
- package/esm/simulator-ui/src/gds/WorkbenchComposerChip.d.ts +2 -17
- package/esm/simulator-ui/src/gds/WorkbenchComposerChip.d.ts.map +1 -1
- package/esm/simulator-ui/src/grade/GradeResultsPanel.d.ts +10 -0
- package/esm/simulator-ui/src/grade/GradeResultsPanel.d.ts.map +1 -1
- package/esm/simulator-ui/src/grade/GradeResultsPanel.js +16 -1
- package/esm/simulator-ui/src/shared.d.ts +1 -0
- package/esm/simulator-ui/src/shared.d.ts.map +1 -1
- package/esm/simulator-ui/src/shared.js +4 -2
- package/esm/simulator-ui/src/workbenchChipStore.d.ts +12 -0
- package/esm/simulator-ui/src/workbenchChipStore.d.ts.map +1 -0
- package/esm/simulator-ui/src/workbenchChipStore.js +69 -0
- package/esm/simulator-ui/src/workbenchContext.d.ts +50 -0
- package/esm/simulator-ui/src/workbenchContext.d.ts.map +1 -0
- package/esm/simulator-ui/src/workbenchContext.js +159 -0
- package/esm/src/simulator_graphql.d.ts.map +1 -1
- package/esm/src/simulator_graphql.js +5 -0
- package/package.json +1 -1
- package/script/gambit/simulator-ui/dist/bundle.js +1304 -2405
- package/script/gambit/simulator-ui/dist/bundle.js.map +4 -4
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorGradePage/normalization_ast.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorGradePage/normalization_ast.js +5 -0
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorGradePage/query_text.d.ts +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorGradePage/query_text.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorGradePage/query_text.js +1 -0
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorGradePage/raw_response_type.d.ts +1 -0
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorGradePage/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorTestPage/normalization_ast.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorTestPage/normalization_ast.js +5 -0
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorTestPage/query_text.d.ts +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorTestPage/query_text.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorTestPage/query_text.js +1 -0
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorTestPage/raw_response_type.d.ts +1 -0
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorTestPage/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorVerifyPage/normalization_ast.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorVerifyPage/normalization_ast.js +5 -0
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorVerifyPage/query_text.d.ts +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorVerifyPage/query_text.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorVerifyPage/query_text.js +1 -0
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorVerifyPage/raw_response_type.d.ts +1 -0
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorVerifyPage/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaceShell/normalization_ast.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaceShell/normalization_ast.js +5 -0
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaceShell/query_text.d.ts +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaceShell/query_text.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaceShell/query_text.js +1 -0
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaceShell/raw_response_type.d.ts +1 -0
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaceShell/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Workspace/GradeTab/param_type.d.ts +65 -0
- package/script/simulator-ui/__generated__/__isograph/Workspace/GradeTab/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Workspace/GradeTab/resolver_reader.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Workspace/GradeTab/resolver_reader.js +8 -1
- package/script/simulator-ui/__generated__/__isograph/Workspace/TestTab/param_type.d.ts +82 -0
- package/script/simulator-ui/__generated__/__isograph/Workspace/TestTab/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Workspace/TestTab/resolver_reader.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Workspace/TestTab/resolver_reader.js +8 -1
- package/script/simulator-ui/__generated__/__isograph/Workspace/VerifyTab/param_type.d.ts +106 -0
- package/script/simulator-ui/__generated__/__isograph/Workspace/VerifyTab/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Workspace/VerifyTab/resolver_reader.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Workspace/VerifyTab/resolver_reader.js +8 -1
- package/script/simulator-ui/__generated__/__isograph/Workspace/WorkbenchChatDrawer/param_type.d.ts +32 -0
- package/script/simulator-ui/__generated__/__isograph/Workspace/WorkbenchChatDrawer/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Workspace/WorkbenchChatDrawer/resolver_reader.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Workspace/WorkbenchChatDrawer/resolver_reader.js +8 -1
- package/script/simulator-ui/isograph/components/Query/SimulatorGradePage.d.ts.map +1 -1
- package/script/simulator-ui/isograph/components/Query/SimulatorGradePage.js +109 -2
- package/script/simulator-ui/isograph/components/Query/SimulatorTestPage.d.ts.map +1 -1
- package/script/simulator-ui/isograph/components/Query/SimulatorTestPage.js +113 -6
- package/script/simulator-ui/isograph/components/Query/SimulatorVerifyPage.d.ts.map +1 -1
- package/script/simulator-ui/isograph/components/Query/SimulatorVerifyPage.js +24 -1
- package/script/simulator-ui/isograph/components/Workspace/WorkbenchChatDrawer.d.ts.map +1 -1
- package/script/simulator-ui/isograph/components/Workspace/WorkbenchChatDrawer.js +16 -6
- package/script/simulator-ui/isograph/components/WorkspaceConversationRun/WorkbenchConversationRunChat.d.ts +4 -0
- package/script/simulator-ui/isograph/components/WorkspaceConversationRun/WorkbenchConversationRunChat.d.ts.map +1 -1
- package/script/simulator-ui/isograph/components/WorkspaceConversationRun/WorkbenchConversationRunChat.js +58 -23
- package/script/simulator-ui/isograph/components/grade/GradeTabView.d.ts +14 -0
- package/script/simulator-ui/isograph/components/grade/GradeTabView.d.ts.map +1 -1
- package/script/simulator-ui/isograph/components/grade/GradeTabView.js +1 -1
- package/script/simulator-ui/src/AppShell.d.ts.map +1 -1
- package/script/simulator-ui/src/AppShell.js +6 -6
- package/script/simulator-ui/src/Chat.d.ts +6 -30
- package/script/simulator-ui/src/Chat.d.ts.map +1 -1
- package/script/simulator-ui/src/Chat.js +14 -109
- package/script/simulator-ui/src/TestBotChatPanel.d.ts +2 -0
- package/script/simulator-ui/src/TestBotChatPanel.d.ts.map +1 -1
- package/script/simulator-ui/src/TestBotChatPanel.js +2 -2
- package/script/simulator-ui/src/WorkbenchDrawerIso.d.ts +2 -0
- package/script/simulator-ui/src/WorkbenchDrawerIso.d.ts.map +1 -1
- package/script/simulator-ui/src/WorkbenchDrawerIso.js +3 -1
- package/script/simulator-ui/src/gds/WorkbenchComposerChip.d.ts +2 -17
- package/script/simulator-ui/src/gds/WorkbenchComposerChip.d.ts.map +1 -1
- package/script/simulator-ui/src/grade/GradeResultsPanel.d.ts +10 -0
- package/script/simulator-ui/src/grade/GradeResultsPanel.d.ts.map +1 -1
- package/script/simulator-ui/src/grade/GradeResultsPanel.js +16 -1
- package/script/simulator-ui/src/shared.d.ts +1 -0
- package/script/simulator-ui/src/shared.d.ts.map +1 -1
- package/script/simulator-ui/src/shared.js +4 -2
- package/script/simulator-ui/src/workbenchChipStore.d.ts +12 -0
- package/script/simulator-ui/src/workbenchChipStore.d.ts.map +1 -0
- package/script/simulator-ui/src/workbenchChipStore.js +108 -0
- package/script/simulator-ui/src/workbenchContext.d.ts +50 -0
- package/script/simulator-ui/src/workbenchContext.d.ts.map +1 -0
- package/script/simulator-ui/src/workbenchContext.js +165 -0
- package/script/src/simulator_graphql.d.ts.map +1 -1
- package/script/src/simulator_graphql.js +5 -0
- package/esm/simulator-ui/src/ProviderLoginPanel.d.ts +0 -8
- package/esm/simulator-ui/src/ProviderLoginPanel.d.ts.map +0 -1
- package/esm/simulator-ui/src/ProviderLoginPanel.js +0 -156
- package/esm/simulator-ui/src/WorkbenchDrawer.d.ts +0 -38
- package/esm/simulator-ui/src/WorkbenchDrawer.d.ts.map +0 -1
- package/esm/simulator-ui/src/WorkbenchDrawer.js +0 -716
- package/esm/simulator-ui/src/gds/Accordion.d.ts +0 -19
- package/esm/simulator-ui/src/gds/Accordion.d.ts.map +0 -1
- package/esm/simulator-ui/src/gds/Accordion.js +0 -47
- package/script/simulator-ui/src/ProviderLoginPanel.d.ts +0 -8
- package/script/simulator-ui/src/ProviderLoginPanel.d.ts.map +0 -1
- package/script/simulator-ui/src/ProviderLoginPanel.js +0 -162
- package/script/simulator-ui/src/WorkbenchDrawer.d.ts +0 -38
- package/script/simulator-ui/src/WorkbenchDrawer.d.ts.map +0 -1
- package/script/simulator-ui/src/WorkbenchDrawer.js +0 -722
- package/script/simulator-ui/src/gds/Accordion.d.ts +0 -19
- package/script/simulator-ui/src/gds/Accordion.d.ts.map +0 -1
- package/script/simulator-ui/src/gds/Accordion.js +0 -86
|
@@ -14,6 +14,7 @@ import { useGambitTypedMutation } from "../../../src/hooks/useGambitTypedMutatio
|
|
|
14
14
|
import { useGambitTypedSubscription } from "../../../src/hooks/useGambitTypedSubscription.js";
|
|
15
15
|
import WorkbenchDrawerIso from "../../../src/WorkbenchDrawerIso.js";
|
|
16
16
|
import { formatTimestampShort, workbenchChatTopActionsEnabled, } from "../../../src/utils.js";
|
|
17
|
+
import { replaceWorkbenchSelectedContextChips, resolveWorkbenchSelectedContextChips, } from "../../../src/workbenchChipStore.js";
|
|
17
18
|
import { buildWorkspacePath, WORKSPACES_API_BASE, } from "../../../../src/workspace_contract.js";
|
|
18
19
|
const BUILD_CHAT_PROVIDER_STORAGE_KEY = "gambit:build-chat-provider";
|
|
19
20
|
function toErrorMessage(error) {
|
|
@@ -55,6 +56,7 @@ function storeBuildChatProvider(provider) {
|
|
|
55
56
|
export const WorkbenchChatDrawer = iso(`
|
|
56
57
|
field Workspace.WorkbenchChatDrawer @component {
|
|
57
58
|
id
|
|
59
|
+
workbenchSelectedContextChips @updatable
|
|
58
60
|
models {
|
|
59
61
|
codex {
|
|
60
62
|
model
|
|
@@ -76,10 +78,14 @@ export const WorkbenchChatDrawer = iso(`
|
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
80
|
}
|
|
79
|
-
`)(function WorkbenchChatDrawer({ data }, componentProps) {
|
|
81
|
+
`)(function WorkbenchChatDrawer({ data, startUpdate }, componentProps) {
|
|
80
82
|
const workspaceId = typeof data.id === "string" && data.id.trim().length > 0
|
|
81
83
|
? data.id
|
|
82
84
|
: null;
|
|
85
|
+
const composerChips = useMemo(() => resolveWorkbenchSelectedContextChips(workspaceId, data.workbenchSelectedContextChips), [data.workbenchSelectedContextChips, workspaceId]);
|
|
86
|
+
const updateComposerChips = useCallback((next) => {
|
|
87
|
+
replaceWorkbenchSelectedContextChips(startUpdate, next, workspaceId);
|
|
88
|
+
}, [startUpdate, workspaceId]);
|
|
83
89
|
useGambitTypedSubscription(gambitWorkspaceWorkbenchLiveSubscription, workspaceId ? { workspaceId } : null);
|
|
84
90
|
const runNode = (data.buildRuns?.edges ?? []).flatMap((edge) => edge?.node ? [edge.node] : [])[0] ?? null;
|
|
85
91
|
const codexStatus = data.models?.codex
|
|
@@ -218,7 +224,8 @@ export const WorkbenchChatDrawer = iso(`
|
|
|
218
224
|
const historyContent = (React.createElement(React.Fragment, null,
|
|
219
225
|
chatHistoryLoading && (React.createElement(Callout, null, "Loading chat history\u2026")),
|
|
220
226
|
chatHistoryError && React.createElement("div", { className: "error" }, chatHistoryError),
|
|
221
|
-
!chatHistoryLoading && !chatHistoryError && chatHistory.length === 0 &&
|
|
227
|
+
!chatHistoryLoading && !chatHistoryError && chatHistory.length === 0 &&
|
|
228
|
+
(React.createElement(Callout, null, "No previous chats yet.")),
|
|
222
229
|
!chatHistoryLoading && !chatHistoryError && chatHistory.length > 0 && (React.createElement(List, { className: "workbench-chat-history-list" }, chatHistory.map((entry) => {
|
|
223
230
|
const timestamp = entry.updatedAt ?? entry.startedAt;
|
|
224
231
|
const label = timestamp
|
|
@@ -231,10 +238,10 @@ export const WorkbenchChatDrawer = iso(`
|
|
|
231
238
|
React.createElement(ListItem, { title: `Chat - ${label}` })));
|
|
232
239
|
})))));
|
|
233
240
|
if (ConversationRunChat && workspaceId) {
|
|
234
|
-
return (React.createElement(ConversationRunChat, { open: componentProps.open, isSending: createRunMutation.inFlight ||
|
|
241
|
+
return (React.createElement(ConversationRunChat, { open: componentProps.open, composerChips: composerChips, onComposerChipsChange: updateComposerChips, isSending: createRunMutation.inFlight ||
|
|
235
242
|
resetWorkspaceMutation.inFlight, isStopping: stopRunMutation.inFlight, codexAccess: codexStatus, canStartNewChat: !resetWorkspaceMutation.inFlight, onNewChat: () => {
|
|
236
243
|
void resetWorkspace();
|
|
237
|
-
}, chatHeaderActions: headerActions, chatHistoryOpen: chatHistoryOpen, chatHistoryContent: historyContent, onSend: (args) => {
|
|
244
|
+
}, chatHeaderActions: headerActions, chatHistoryOpen: chatHistoryOpen, onToggleChatHistory: () => setChatHistoryOpen((previous) => !previous), chatHistoryContent: historyContent, onSend: (args) => {
|
|
238
245
|
createRunMutation.commit({
|
|
239
246
|
input: {
|
|
240
247
|
workspaceId: args.workspaceId,
|
|
@@ -381,8 +388,11 @@ export const WorkbenchChatDrawer = iso(`
|
|
|
381
388
|
void startAssistant();
|
|
382
389
|
} }),
|
|
383
390
|
React.createElement(Callout, null, "Start a chat session to inspect the workspace and begin editing files."),
|
|
384
|
-
codexLoginRequired && (React.createElement(Callout, { variant: "danger", title: "Codex login required" }, codexStatus?.statusText?.trim() ||
|
|
391
|
+
codexLoginRequired && (React.createElement(Callout, { variant: "danger", title: "Codex login required" }, codexStatus?.statusText?.trim() ||
|
|
392
|
+
"Run `codex login` to continue.")),
|
|
385
393
|
chatError && React.createElement("div", { className: "error" }, chatError)));
|
|
386
|
-
return (React.createElement(WorkbenchDrawerIso, { open: componentProps.open, runStatus: "IDLE", chatHeaderActions: headerActions,
|
|
394
|
+
return (React.createElement(WorkbenchDrawerIso, { open: componentProps.open, runStatus: "IDLE", chatHeaderActions: headerActions, showChatHistoryToggle: workbenchChatTopActionsEnabled, chatHistoryOpen: workbenchChatTopActionsEnabled
|
|
395
|
+
? chatHistoryOpen
|
|
396
|
+
: false, onToggleChatHistory: () => setChatHistoryOpen((previous) => !previous), chatHistoryContent: historyContent, chatBody: fallbackBody }));
|
|
387
397
|
});
|
|
388
398
|
export default WorkbenchChatDrawer;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import { type OptimisticTranscriptEntry } from "../../../src/transcriptEntries.js";
|
|
3
|
+
import { type WorkbenchSelectedContextChip } from "../../../src/workbenchContext.js";
|
|
3
4
|
export declare const WorkbenchConversationRunChat: (data: import("../../../__generated__/__isograph/WorkspaceConversationRun/WorkbenchConversationRunChat/param_type.js").WorkspaceConversationRun__WorkbenchConversationRunChat__param, componentProps: {
|
|
4
5
|
open: boolean;
|
|
5
6
|
codexAccess?: {
|
|
@@ -37,7 +38,10 @@ export declare const WorkbenchConversationRunChat: (data: import("../../../__gen
|
|
|
37
38
|
onNewChat?: () => void;
|
|
38
39
|
chatHeaderActions?: ReactNode;
|
|
39
40
|
chatHistoryOpen?: boolean;
|
|
41
|
+
onToggleChatHistory?: () => void;
|
|
40
42
|
chatHistoryContent?: ReactNode;
|
|
43
|
+
composerChips?: Array<WorkbenchSelectedContextChip>;
|
|
44
|
+
onComposerChipsChange?: (next: Array<WorkbenchSelectedContextChip>) => void;
|
|
41
45
|
}) => import("react").JSX.Element;
|
|
42
46
|
export default WorkbenchConversationRunChat;
|
|
43
47
|
//# sourceMappingURL=WorkbenchConversationRunChat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkbenchConversationRunChat.d.ts","sourceRoot":"","sources":["../../../../../src/simulator-ui/isograph/components/WorkspaceConversationRun/WorkbenchConversationRunChat.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"WorkbenchConversationRunChat.d.ts","sourceRoot":"","sources":["../../../../../src/simulator-ui/isograph/components/WorkspaceConversationRun/WorkbenchConversationRunChat.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AAcf,OAAO,EAEL,KAAK,yBAAyB,EAK/B,MAAM,mCAAmC,CAAC;AAK3C,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,kCAAkC,CAAC;AAqJ1C,eAAO,MAAM,4BAA4B;UAwCjC,OAAO;kBACC;QACZ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,YAAY,CAAC,EAAE,OAAO,CAAC;KACxB,GAAG,IAAI;mBACO,MAAM;YACb,CAAC,IAAI,EAAE;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,wBAAwB,EAAE,MAAM,CAAC;QACjC,mBAAmB,EAAE,MAAM,CAAC;QAC5B,2BAA2B,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC9D,UAAU,EAAE,MAAM,IAAI,CAAC;QACvB,OAAO,EAAE,MAAM,IAAI,CAAC;KACrB,KAAK,IAAI;YACF,CAAC,IAAI,EAAE;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;QACd,wBAAwB,EAAE,MAAM,CAAC;QACjC,2BAA2B,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC9D,UAAU,EAAE,MAAM,IAAI,CAAC;QACvB,OAAO,EAAE,MAAM,IAAI,CAAC;KACrB,KAAK,IAAI;eACC,OAAO;gBACN,OAAO;sBACD,OAAO;gBACb,MAAM,IAAI;wBACF,SAAS;sBACX,OAAO;0BACH,MAAM,IAAI;yBACX,SAAS;oBACd,KAAK,CAAC,4BAA4B,CAAC;4BAC3B,CAAC,IAAI,EAAE,KAAK,CAAC,4BAA4B,CAAC,KAAK,IAAI;iCAid3E,CAAC;AAEH,eAAe,4BAA4B,CAAC"}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import * as dntShim from "../../../../_dnt.shims.js";
|
|
2
2
|
import { iso } from "../../../__generated__/__isograph/iso.js";
|
|
3
3
|
import { useCallback, useEffect, useMemo, useReducer, useRef, useState, } from "react";
|
|
4
|
-
import { BuildChatRows, deriveBuildChatActivityState, formatElapsedDuration, } from "../../../src/Chat.js";
|
|
4
|
+
import { BuildChatRows, deriveBuildChatActivityState, encodeWorkbenchMessageWithContext, formatElapsedDuration, } from "../../../src/Chat.js";
|
|
5
5
|
import Button from "../../../src/gds/Button.js";
|
|
6
6
|
import Callout from "../../../src/gds/Callout.js";
|
|
7
7
|
import CodexLoginRequiredOverlay from "../../../src/CodexLoginRequiredOverlay.js";
|
|
8
8
|
import WorkbenchChatIntro from "../../../src/WorkbenchChatIntro.js";
|
|
9
|
+
import WorkbenchComposerChip from "../../../src/gds/WorkbenchComposerChip.js";
|
|
9
10
|
import { countTranscriptMessages, parseTranscriptEntries, toBuildDisplayEntries, toOptimisticTranscriptEntries, } from "../../../src/transcriptEntries.js";
|
|
10
11
|
import WorkbenchDrawerIso from "../../../src/WorkbenchDrawerIso.js";
|
|
11
12
|
import { workbenchChatTopActionsEnabled } from "../../../src/utils.js";
|
|
13
|
+
import { toWorkbenchMessageContext, } from "../../../src/workbenchContext.js";
|
|
14
|
+
import { mergeWorkbenchSelectedContextChip } from "../../../src/workbenchChipStore.js";
|
|
12
15
|
const RUN_STATUS_VALUES = new Set([
|
|
13
16
|
"IDLE",
|
|
14
17
|
"RUNNING",
|
|
@@ -42,12 +45,10 @@ function isBuildChatDebugEnabled() {
|
|
|
42
45
|
}
|
|
43
46
|
return stored === "1" || stored === "true" || stored === "yes";
|
|
44
47
|
}
|
|
45
|
-
const BUILD_CHAT_DEBUG = isBuildChatDebugEnabled();
|
|
46
48
|
function logBuildChatDebug(event, payload) {
|
|
47
|
-
if (!
|
|
49
|
+
if (!isBuildChatDebugEnabled())
|
|
48
50
|
return;
|
|
49
|
-
|
|
50
|
-
void payload;
|
|
51
|
+
console.info(`[build-chat-debug] ${event}`, payload);
|
|
51
52
|
}
|
|
52
53
|
function toRunStatus(value) {
|
|
53
54
|
if (typeof value !== "string")
|
|
@@ -223,6 +224,9 @@ export const WorkbenchConversationRunChat = iso(`
|
|
|
223
224
|
const wasActiveRef = useRef(false);
|
|
224
225
|
const [chatDraft, setChatDraft] = useState("");
|
|
225
226
|
const [localError, setLocalError] = useState(null);
|
|
227
|
+
const composerChips = componentProps.composerChips ?? [];
|
|
228
|
+
const updateComposerChips = componentProps.onComposerChipsChange ??
|
|
229
|
+
(() => { });
|
|
226
230
|
const onSendMessage = useCallback((message, options) => {
|
|
227
231
|
if (codexLoginRequired) {
|
|
228
232
|
setChatError("Codex login is required for this workspace.");
|
|
@@ -305,11 +309,13 @@ export const WorkbenchConversationRunChat = iso(`
|
|
|
305
309
|
]);
|
|
306
310
|
const isRunning = runStatus === "RUNNING";
|
|
307
311
|
const isBusy = componentProps.isSending || componentProps.isStopping;
|
|
312
|
+
const hasEnabledComposerChip = composerChips.some((chip) => chip.enabled);
|
|
308
313
|
const canStartAssistant = !isRunning && !componentProps.isSending &&
|
|
309
314
|
transcriptMessageCount === 0;
|
|
310
315
|
const canSubmitMessage = !componentProps.isSending && !isRunning &&
|
|
311
|
-
chatDraft.trim().length > 0;
|
|
312
|
-
const showStartOverlay = canStartAssistant
|
|
316
|
+
(chatDraft.trim().length > 0 || hasEnabledComposerChip);
|
|
317
|
+
const showStartOverlay = canStartAssistant && !hasEnabledComposerChip &&
|
|
318
|
+
chatDraft.trim().length === 0;
|
|
313
319
|
const resolvedError = chatError ?? localError;
|
|
314
320
|
const handleCopyCodexLoginCommand = useCallback(() => {
|
|
315
321
|
globalThis.navigator?.clipboard?.writeText(codexLoginCommand);
|
|
@@ -362,15 +368,37 @@ export const WorkbenchConversationRunChat = iso(`
|
|
|
362
368
|
const trimmed = chatDraft.trim();
|
|
363
369
|
if (!canSubmitMessage || isBusy)
|
|
364
370
|
return;
|
|
371
|
+
const activeChips = composerChips.filter((chip) => chip.enabled);
|
|
372
|
+
const activeChipIds = new Set(activeChips.map((chip) => chip.chipId));
|
|
373
|
+
const outboundMessage = activeChips.length > 0
|
|
374
|
+
? encodeWorkbenchMessageWithContext(trimmed, activeChips.map((chip) => toWorkbenchMessageContext(chip)))
|
|
375
|
+
: trimmed;
|
|
376
|
+
logBuildChatDebug("send.outbound", {
|
|
377
|
+
runId,
|
|
378
|
+
workspaceId,
|
|
379
|
+
trimmed,
|
|
380
|
+
activeChips,
|
|
381
|
+
outboundMessage,
|
|
382
|
+
});
|
|
365
383
|
setLocalError(null);
|
|
366
384
|
try {
|
|
367
|
-
await onSendMessage(
|
|
385
|
+
await onSendMessage(outboundMessage);
|
|
368
386
|
setChatDraft("");
|
|
387
|
+
if (activeChipIds.size > 0) {
|
|
388
|
+
updateComposerChips(composerChips.map((chip) => activeChipIds.has(chip.chipId) ? { ...chip, enabled: false } : chip));
|
|
389
|
+
}
|
|
369
390
|
}
|
|
370
391
|
catch (error) {
|
|
371
392
|
setLocalError(toErrorMessage(error));
|
|
372
393
|
}
|
|
373
|
-
}, [
|
|
394
|
+
}, [
|
|
395
|
+
canSubmitMessage,
|
|
396
|
+
chatDraft,
|
|
397
|
+
composerChips,
|
|
398
|
+
isBusy,
|
|
399
|
+
onSendMessage,
|
|
400
|
+
updateComposerChips,
|
|
401
|
+
]);
|
|
374
402
|
const stopMessage = useCallback(async () => {
|
|
375
403
|
if (isBusy || !isRunning)
|
|
376
404
|
return;
|
|
@@ -385,16 +413,23 @@ export const WorkbenchConversationRunChat = iso(`
|
|
|
385
413
|
const addScenarioErrorToChat = useCallback(() => {
|
|
386
414
|
if (!scenarioRunError)
|
|
387
415
|
return;
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
416
|
+
updateComposerChips(mergeWorkbenchSelectedContextChip(composerChips, {
|
|
417
|
+
chipId: `scenario_run_error:${runId ?? workspaceId ?? "workspace"}`,
|
|
418
|
+
source: "scenario_run_error",
|
|
419
|
+
workspaceId: workspaceId ?? undefined,
|
|
420
|
+
runId: runId ?? undefined,
|
|
421
|
+
capturedAt: new Date().toISOString(),
|
|
422
|
+
error: scenarioRunError,
|
|
423
|
+
enabled: true,
|
|
424
|
+
}));
|
|
396
425
|
composerInputRef.current?.focus();
|
|
397
|
-
}, [
|
|
426
|
+
}, [
|
|
427
|
+
composerChips,
|
|
428
|
+
runId,
|
|
429
|
+
scenarioRunError,
|
|
430
|
+
updateComposerChips,
|
|
431
|
+
workspaceId,
|
|
432
|
+
]);
|
|
398
433
|
const errorCalloutTestId = `${testIdPrefix}-error-callout`;
|
|
399
434
|
const addErrorToChatTestId = `${testIdPrefix}-add-error-to-chat`;
|
|
400
435
|
const chatBody = (React.createElement("div", { className: "test-bot-sidebar flex-column gap-8 flex-1 build-chat-panel" },
|
|
@@ -415,6 +450,9 @@ export const WorkbenchConversationRunChat = iso(`
|
|
|
415
450
|
React.createElement("div", { className: "composer-inputs" },
|
|
416
451
|
React.createElement("div", { className: "build-chat-activity-sticky" },
|
|
417
452
|
React.createElement(BuildChatActivityIndicator, { state: activityState, startedAtMs: resolvedStartedAtMs, testId: activityIndicatorTestId, timerTestId: activityTimerTestId })),
|
|
453
|
+
composerChips.length > 0 && (React.createElement("div", { className: "workbench-composer-chip-row", "data-testid": `${testIdPrefix}-composer-chip-row` }, composerChips.map((chip) => (React.createElement(WorkbenchComposerChip, { key: chip.chipId, context: chip, enabled: chip.enabled, onEnabledChange: (enabled) => updateComposerChips(composerChips.map((entry) => entry.chipId === chip.chipId
|
|
454
|
+
? { ...entry, enabled }
|
|
455
|
+
: entry)), onRemove: () => updateComposerChips(composerChips.filter((entry) => entry.chipId !== chip.chipId)) }))))),
|
|
418
456
|
scenarioRunError && (React.createElement(Callout, { variant: "danger", title: "Scenario run failed", actions: React.createElement(Button, { variant: "secondary", size: "small", "data-testid": addErrorToChatTestId, onClick: addScenarioErrorToChat }, "Add to chat"), "data-testid": errorCalloutTestId }, scenarioRunError)),
|
|
419
457
|
React.createElement("div", { className: "flex-row gap-4 mb-2" },
|
|
420
458
|
React.createElement("textarea", { ref: composerInputRef, className: "message-input flex-1", rows: 1, placeholder: "Message Gambit Bot...", value: chatDraft, onChange: (event) => setChatDraft(event.target.value), "data-testid": chatInputTestId, disabled: isBusy, onKeyDown: (event) => {
|
|
@@ -426,17 +464,14 @@ export const WorkbenchConversationRunChat = iso(`
|
|
|
426
464
|
}
|
|
427
465
|
} }),
|
|
428
466
|
React.createElement("div", { className: "composer-actions" },
|
|
429
|
-
React.createElement("div", { className: "composer-action-slot composer-action-slot-
|
|
467
|
+
React.createElement("div", { className: "composer-action-slot composer-action-slot-primary" }, isRunning
|
|
430
468
|
? (React.createElement(Button, { variant: "secondary", className: "composer-action-button", disabled: isBusy, "data-testid": stopButtonTestId, onClick: () => {
|
|
431
469
|
void stopMessage();
|
|
432
470
|
} }, componentProps.isStopping ? "Stopping..." : "Stop"))
|
|
433
|
-
: (React.createElement("
|
|
434
|
-
React.createElement("div", { className: "composer-action-slot composer-action-slot-primary" }, !showStartOverlay
|
|
435
|
-
? (React.createElement(Button, { variant: "primary", className: "composer-action-button", disabled: !canSubmitMessage || isBusy ||
|
|
471
|
+
: (React.createElement(Button, { variant: "primary", className: "composer-action-button", disabled: !canSubmitMessage || isBusy ||
|
|
436
472
|
codexLoginRequired, "data-testid": sendButtonTestId, onClick: () => {
|
|
437
473
|
void sendMessage();
|
|
438
|
-
} }, componentProps.isSending ? "Sending..." : "Send"))
|
|
439
|
-
: (React.createElement("span", { className: "composer-action-placeholder", "aria-hidden": "true" }))))),
|
|
474
|
+
} }, componentProps.isSending ? "Sending..." : "Send"))))),
|
|
440
475
|
resolvedError && React.createElement("div", { className: "error" }, resolvedError)))));
|
|
441
476
|
return (React.createElement(WorkbenchDrawerIso, { open: componentProps.open, runStatus: runStatus, chatHeaderActions: componentProps.chatHeaderActions, chatHistoryOpen: workbenchChatTopActionsEnabled
|
|
442
477
|
? componentProps.chatHistoryOpen
|
|
@@ -65,6 +65,20 @@ export declare function GradeTabView(props: {
|
|
|
65
65
|
runId: string;
|
|
66
66
|
turnIndex?: number;
|
|
67
67
|
}) => void;
|
|
68
|
+
onAddFlagToWorkbench?: (args: {
|
|
69
|
+
refId: string;
|
|
70
|
+
runId: string;
|
|
71
|
+
turnIndex?: number;
|
|
72
|
+
score?: number;
|
|
73
|
+
graderReason?: string;
|
|
74
|
+
flagReason?: string;
|
|
75
|
+
priorUser?: string;
|
|
76
|
+
gradedAssistant?: string;
|
|
77
|
+
}) => void;
|
|
78
|
+
onAddErrorToWorkbench?: (args: {
|
|
79
|
+
runId?: string;
|
|
80
|
+
error: string;
|
|
81
|
+
}) => void;
|
|
68
82
|
mutationError: string | null;
|
|
69
83
|
expandedResults: Record<string, boolean>;
|
|
70
84
|
onToggleExpandedResult: (itemKey: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GradeTabView.d.ts","sourceRoot":"","sources":["../../../../../src/simulator-ui/isograph/components/grade/GradeTabView.tsx"],"names":[],"mappings":"AAMA,MAAM,MAAM,sBAAsB,GAAG;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,GAAG,IAAI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,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,sBAAsB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACnD,+
|
|
1
|
+
{"version":3,"file":"GradeTabView.d.ts","sourceRoot":"","sources":["../../../../../src/simulator-ui/isograph/components/grade/GradeTabView.tsx"],"names":[],"mappings":"AAMA,MAAM,MAAM,sBAAsB,GAAG;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;IACnD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE;QAAE,KA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E,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7D,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,YAAY,EAAE,CAAC,IAAI,EAAE;QACnB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,KAAK,IAAI,CAAC;IACX,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE;QAC5B,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,KAAK,IAAI,CAAC;IACX,qBAAqB,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC1E,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,sBAAsB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACnD,+BA+IA;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -86,6 +86,6 @@ export function GradeTabView(props) {
|
|
|
86
86
|
meta: [run.status, run.finishedAt ?? run.startedAt].filter(Boolean)
|
|
87
87
|
.join(" · "),
|
|
88
88
|
})), [props.scenarioRuns]);
|
|
89
|
-
return (React.createElement(GradeTabShell, { runner: React.createElement(GradeRunnerPanel, { testRunOptions: testRunOptions, selectedTestRunId: props.selectedScenarioRunId, onSelectTestRun: (runId) => props.onSelectScenarioRun(runId || null), graders: graderOptions, selectedGraderId: props.selectedGraderId, onSelectGrader: props.onSelectGrader, selectedGraderDescription: selectedGrader?.description ?? null, sessionsCount: props.scenarioRuns.length, onRunGrader: props.onRunGrader, canRun: props.canRunGrader, running: props.runInFlight, runButtonTestId: "grade-run-grader" }), results: React.createElement(GradeResultsPanel, { error: props.mutationError, loading: false, runCount: runSections.length, runItemsCount: runSections.flatMap((section) => section.items).length, emptyMessage: "No grader runs for this selected test run yet.", routeRunNotFound: props.routeRunMissing, missingRunHref: props.missingRunHref, runSections: runSections, expandedRunId: props.routeGradeRunId, onToggleRun: (runId) => props.onSelectRun(props.routeGradeRunId === runId ? null : runId), expandedResults: props.expandedResults, onToggleExpandedResult: props.onToggleExpandedResult, flaggedRefSet: flaggedRefSet, flagReasonDrafts: props.reasonDrafts, flagReasonByRefId: props.flagByRefId, onToggleFlag: props.onToggleFlag, onFlagReasonChange: props.onReasonDraftChange, onFlagReasonBlur: props.onReasonBlur, topErrorRunId: props.routeGradeRunId }) }));
|
|
89
|
+
return (React.createElement(GradeTabShell, { runner: React.createElement(GradeRunnerPanel, { testRunOptions: testRunOptions, selectedTestRunId: props.selectedScenarioRunId, onSelectTestRun: (runId) => props.onSelectScenarioRun(runId || null), graders: graderOptions, selectedGraderId: props.selectedGraderId, onSelectGrader: props.onSelectGrader, selectedGraderDescription: selectedGrader?.description ?? null, sessionsCount: props.scenarioRuns.length, onRunGrader: props.onRunGrader, canRun: props.canRunGrader, running: props.runInFlight, runButtonTestId: "grade-run-grader" }), results: React.createElement(GradeResultsPanel, { error: props.mutationError, loading: false, runCount: runSections.length, runItemsCount: runSections.flatMap((section) => section.items).length, emptyMessage: "No grader runs for this selected test run yet.", routeRunNotFound: props.routeRunMissing, missingRunHref: props.missingRunHref, runSections: runSections, expandedRunId: props.routeGradeRunId, onToggleRun: (runId) => props.onSelectRun(props.routeGradeRunId === runId ? null : runId), expandedResults: props.expandedResults, onToggleExpandedResult: props.onToggleExpandedResult, flaggedRefSet: flaggedRefSet, flagReasonDrafts: props.reasonDrafts, flagReasonByRefId: props.flagByRefId, onToggleFlag: props.onToggleFlag, onFlagReasonChange: props.onReasonDraftChange, onFlagReasonBlur: props.onReasonBlur, onAddFlagToWorkbench: props.onAddFlagToWorkbench, onAddErrorToWorkbench: props.onAddErrorToWorkbench, topErrorRunId: props.routeGradeRunId }) }));
|
|
90
90
|
}
|
|
91
91
|
export default GradeTabView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../../src/simulator-ui/src/AppShell.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../../src/simulator-ui/src/AppShell.tsx"],"names":[],"mappings":"AAuCA,wBAAgB,QAAQ,CAAC,KAAK,EAAE;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC;QAC1B,IAAI,EAAE,OAAO,CAAC;QACd,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;QACxC,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;QACjD,WAAW,EAAE,CAAC,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;QAC5D,OAAO,EAAE,MAAM,IAAI,CAAC;QACpB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAClC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;QAC3B,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;QAC/B,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACpC,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,UAAU,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;QACxC,kBAAkB,EAAE,CAAC,UAAU,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,KAAK,IAAI,CAAC;KACvE,CAAC,CAAC;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC9B,IAAI,EAAE,OAAO,CAAC;KACf,CAAC,CAAC;CACJ,+BAsTA"}
|
|
@@ -5,7 +5,6 @@ import { verifyTabEnabled } from "./utils.js";
|
|
|
5
5
|
import { useRouter } from "./RouterContext.js";
|
|
6
6
|
import Button from "./gds/Button.js";
|
|
7
7
|
import Icon from "./gds/Icon.js";
|
|
8
|
-
import WorkbenchDrawer from "./WorkbenchDrawer.js";
|
|
9
8
|
import { classNames, DOCS_PATH } from "./utils.js";
|
|
10
9
|
import { useGambitTypedMutation } from "./hooks/useGambitTypedMutation.js";
|
|
11
10
|
import gambitWorkspaceCreateMutation from "../mutations/GambitWorkspaceCreateMutation.js";
|
|
@@ -51,7 +50,7 @@ export function AppShell(props) {
|
|
|
51
50
|
});
|
|
52
51
|
const createWorkspaceMutation = useGambitTypedMutation(gambitWorkspaceCreateMutation);
|
|
53
52
|
const deleteWorkspaceMutation = useGambitTypedMutation(gambitWorkspaceDeleteMutation);
|
|
54
|
-
const Workbench = props.Workbench
|
|
53
|
+
const Workbench = props.Workbench;
|
|
55
54
|
const activeWorkspaceId = useMemo(() => {
|
|
56
55
|
const route = parseWorkspaceRoute(workspaceRoutePath);
|
|
57
56
|
return route?.workspaceId ?? null;
|
|
@@ -65,7 +64,8 @@ export function AppShell(props) {
|
|
|
65
64
|
workspaceRoutePath === "/workspaces/new", [workspaceRoutePath]);
|
|
66
65
|
const isDocsPath = workspaceRoutePath === "/docs";
|
|
67
66
|
const canOpenWorkbench = Boolean(activeWorkspaceId);
|
|
68
|
-
const workbenchVisible = workbenchOpen && canOpenWorkbench
|
|
67
|
+
const workbenchVisible = workbenchOpen && canOpenWorkbench &&
|
|
68
|
+
Boolean(Workbench);
|
|
69
69
|
const handleSelectWorkspace = useCallback((workspaceId) => {
|
|
70
70
|
navigate(buildWorkspacePath("build", workspaceId));
|
|
71
71
|
setDrawerOpen(false);
|
|
@@ -164,15 +164,15 @@ export function AppShell(props) {
|
|
|
164
164
|
React.createElement("span", { className: "top-nav-deck" }, deckLabel)),
|
|
165
165
|
React.createElement("div", { className: "top-nav-right" },
|
|
166
166
|
React.createElement("div", { className: "top-nav-actions" }),
|
|
167
|
-
React.createElement(Button, { "data-testid": "nav-workbench", className: classNames("workbench-toggle", workbenchVisible && "active"), variant: "secondary", onClick: () => setWorkbenchOpen((prev) => !prev), disabled: !canOpenWorkbench, "aria-label": workbenchVisible
|
|
167
|
+
Workbench && (React.createElement(Button, { "data-testid": "nav-workbench", className: classNames("workbench-toggle", workbenchVisible && "active"), variant: "secondary", onClick: () => setWorkbenchOpen((prev) => !prev), disabled: !canOpenWorkbench, "aria-label": workbenchVisible
|
|
168
168
|
? "Close workbench drawer"
|
|
169
169
|
: "Open workbench drawer" },
|
|
170
|
-
React.createElement(Icon, { name: "chat", size: 16, style: { color: "currentColor" } })))),
|
|
170
|
+
React.createElement(Icon, { name: "chat", size: 16, style: { color: "currentColor" } }))))),
|
|
171
171
|
React.createElement("div", { className: "app-content-frame" },
|
|
172
172
|
React.createElement("main", { className: "page-shell" },
|
|
173
173
|
isWorkspacesPath && (React.createElement("div", { style: { padding: "12px 16px 0 16px" } },
|
|
174
174
|
React.createElement(Button, { "data-testid": "workspace-create-cta", variant: "primary", size: "small", onClick: createWorkspace, disabled: createWorkspaceMutation.inFlight }, "New workspace"))),
|
|
175
175
|
isDocsPath ? React.createElement(DocsPage, null) : props.children),
|
|
176
|
-
React.createElement(Workbench, { open: workbenchVisible })),
|
|
176
|
+
Workbench ? React.createElement(Workbench, { open: workbenchVisible }) : null),
|
|
177
177
|
React.createElement(Drawer, { open: drawerOpen, onCreateWorkspace: createWorkspace, onSelect: handleSelectWorkspace, onDelete: deleteWorkspace, onDeleteAll: deleteAllWorkspaces, onClose: () => setDrawerOpen(false), activeWorkspaceId: activeWorkspaceId, bundleStamp: null, creatingWorkspace: createWorkspaceMutation.inFlight, deletingWorkspaceId: deletingWorkspaceId, deletingAll: deletingAll, appearance: appearance, onAppearanceChange: persistAppearance })));
|
|
178
178
|
}
|
|
@@ -1,43 +1,19 @@
|
|
|
1
1
|
import { type BuildDisplayMessage } from "./utils.js";
|
|
2
2
|
import { bucketBuildChatDisplay } from "./ActivityTranscriptRows.js";
|
|
3
3
|
import { useBuildChat } from "./BuildChatContext.js";
|
|
4
|
+
import { type WorkbenchErrorContext, type WorkbenchFlagContext, type WorkbenchMessageContext, type WorkbenchRatingContext, type WorkbenchSelectedContextChip, type WorkbenchVerifyOutlierContext } from "./workbenchContext.js";
|
|
4
5
|
export { bucketBuildChatDisplay };
|
|
5
|
-
export type WorkbenchScenarioErrorContext = {
|
|
6
|
+
export type WorkbenchScenarioErrorContext = WorkbenchErrorContext & {
|
|
6
7
|
source: "scenario_run_error";
|
|
7
|
-
workspaceId?: string;
|
|
8
|
-
runId?: string;
|
|
9
|
-
capturedAt: string;
|
|
10
|
-
error: string;
|
|
11
8
|
};
|
|
12
|
-
export type
|
|
13
|
-
source: "
|
|
14
|
-
workspaceId?: string;
|
|
15
|
-
runId?: string;
|
|
16
|
-
capturedAt: string;
|
|
17
|
-
messageRefId: string;
|
|
18
|
-
statePath?: string;
|
|
19
|
-
statePointer?: string;
|
|
20
|
-
score: number;
|
|
21
|
-
reason?: string;
|
|
9
|
+
export type WorkbenchGraderErrorContext = WorkbenchErrorContext & {
|
|
10
|
+
source: "grader_run_error";
|
|
22
11
|
};
|
|
23
|
-
export type WorkbenchFlagContext = {
|
|
24
|
-
source: "grading_flag";
|
|
25
|
-
workspaceId?: string;
|
|
26
|
-
runId?: string;
|
|
27
|
-
capturedAt: string;
|
|
28
|
-
flagId?: string;
|
|
29
|
-
refId: string;
|
|
30
|
-
score?: number;
|
|
31
|
-
message: string;
|
|
32
|
-
};
|
|
33
|
-
export type WorkbenchMessageContext = WorkbenchScenarioErrorContext | WorkbenchRatingContext | WorkbenchFlagContext;
|
|
34
12
|
export type WorkbenchScenarioErrorChip = WorkbenchScenarioErrorContext & {
|
|
35
13
|
enabled: boolean;
|
|
36
14
|
};
|
|
37
|
-
export type WorkbenchComposerChip =
|
|
38
|
-
|
|
39
|
-
enabled: boolean;
|
|
40
|
-
};
|
|
15
|
+
export type WorkbenchComposerChip = WorkbenchSelectedContextChip;
|
|
16
|
+
export type { WorkbenchFlagContext, WorkbenchRatingContext, WorkbenchVerifyOutlierContext, };
|
|
41
17
|
export declare function encodeWorkbenchMessageWithErrorContext(message: string, context: WorkbenchScenarioErrorContext): string;
|
|
42
18
|
export declare function encodeWorkbenchMessageWithContext(message: string, contexts: Array<WorkbenchMessageContext>): string;
|
|
43
19
|
export declare function decodeWorkbenchMessageWithErrorContext(content: string): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../../src/simulator-ui/src/Chat.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,mBAAmB,EAGzB,MAAM,YAAY,CAAC;AAIpB,OAAO,EAEL,sBAAsB,EACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../../src/simulator-ui/src/Chat.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,mBAAmB,EAGzB,MAAM,YAAY,CAAC;AAIpB,OAAO,EAEL,sBAAsB,EACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAGL,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EACnC,MAAM,uBAAuB,CAAC;AAE/B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ActivityTranscriptRows, bucketBuildChatDisplay, } from "./ActivityTranscriptRows.js";
|
|
8
8
|
import { useBuildChat } from "./BuildChatContext.js";
|
|
9
|
+
import { parseWorkbenchMessageContext, toWorkbenchMessageContext, } from "./workbenchContext.js";
|
|
9
10
|
export { bucketBuildChatDisplay };
|
|
10
11
|
const ERROR_CONTEXT_START_MARKER = "[gambit:error-context/v1]";
|
|
11
12
|
const ERROR_CONTEXT_END_MARKER = "[/gambit:error-context/v1]";
|
|
12
13
|
const WORKBENCH_CONTEXT_START_MARKER = "[gambit:workbench-context/v2]";
|
|
13
14
|
const WORKBENCH_CONTEXT_END_MARKER = "[/gambit:workbench-context/v2]";
|
|
14
|
-
function parseWorkbenchContext(value) {
|
|
15
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
const record = value;
|
|
19
|
-
if (typeof record.capturedAt !== "string" ||
|
|
20
|
-
record.capturedAt.trim().length === 0) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
const workspaceId = typeof record.workspaceId === "string"
|
|
24
|
-
? record.workspaceId
|
|
25
|
-
: undefined;
|
|
26
|
-
const runId = typeof record.runId === "string" ? record.runId : undefined;
|
|
27
|
-
if (record.source === "scenario_run_error") {
|
|
28
|
-
if (typeof record.error !== "string" || record.error.trim().length === 0) {
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
return {
|
|
32
|
-
source: "scenario_run_error",
|
|
33
|
-
workspaceId,
|
|
34
|
-
runId,
|
|
35
|
-
capturedAt: record.capturedAt,
|
|
36
|
-
error: record.error,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
if (record.source === "message_rating") {
|
|
40
|
-
if (typeof record.score !== "number" || !Number.isFinite(record.score) ||
|
|
41
|
-
typeof record.messageRefId !== "string" ||
|
|
42
|
-
record.messageRefId.trim().length === 0) {
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
return {
|
|
46
|
-
source: "message_rating",
|
|
47
|
-
workspaceId,
|
|
48
|
-
runId,
|
|
49
|
-
capturedAt: record.capturedAt,
|
|
50
|
-
messageRefId: record.messageRefId,
|
|
51
|
-
statePath: typeof record.statePath === "string"
|
|
52
|
-
? record.statePath
|
|
53
|
-
: undefined,
|
|
54
|
-
statePointer: typeof record.statePointer === "string"
|
|
55
|
-
? record.statePointer
|
|
56
|
-
: undefined,
|
|
57
|
-
score: record.score,
|
|
58
|
-
reason: typeof record.reason === "string" ? record.reason : undefined,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
if (record.source === "grading_flag") {
|
|
62
|
-
if (typeof record.refId !== "string" || record.refId.trim().length === 0 ||
|
|
63
|
-
typeof record.message !== "string" || record.message.trim().length === 0) {
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
return {
|
|
67
|
-
source: "grading_flag",
|
|
68
|
-
workspaceId,
|
|
69
|
-
runId,
|
|
70
|
-
capturedAt: record.capturedAt,
|
|
71
|
-
flagId: typeof record.flagId === "string" ? record.flagId : undefined,
|
|
72
|
-
refId: record.refId,
|
|
73
|
-
score: typeof record.score === "number" && Number.isFinite(record.score)
|
|
74
|
-
? record.score
|
|
75
|
-
: undefined,
|
|
76
|
-
message: record.message,
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
15
|
function decodeLegacyWorkbenchErrorContext(content) {
|
|
82
16
|
if (typeof content !== "string")
|
|
83
17
|
return null;
|
|
@@ -97,7 +31,7 @@ function decodeLegacyWorkbenchErrorContext(content) {
|
|
|
97
31
|
catch {
|
|
98
32
|
return null;
|
|
99
33
|
}
|
|
100
|
-
const context =
|
|
34
|
+
const context = parseWorkbenchMessageContext(parsed);
|
|
101
35
|
if (!context || context.source !== "scenario_run_error") {
|
|
102
36
|
return null;
|
|
103
37
|
}
|
|
@@ -106,7 +40,7 @@ function decodeLegacyWorkbenchErrorContext(content) {
|
|
|
106
40
|
const remainder = content.slice(markerEndIndex);
|
|
107
41
|
const body = remainder.startsWith("\n") ? remainder.slice(1) : remainder;
|
|
108
42
|
return {
|
|
109
|
-
context,
|
|
43
|
+
context: context,
|
|
110
44
|
body,
|
|
111
45
|
};
|
|
112
46
|
}
|
|
@@ -115,7 +49,7 @@ export function encodeWorkbenchMessageWithErrorContext(message, context) {
|
|
|
115
49
|
}
|
|
116
50
|
export function encodeWorkbenchMessageWithContext(message, contexts) {
|
|
117
51
|
const body = message.trim();
|
|
118
|
-
const encodedContexts = contexts.filter((context) =>
|
|
52
|
+
const encodedContexts = contexts.filter((context) => parseWorkbenchMessageContext(context));
|
|
119
53
|
if (encodedContexts.length === 0)
|
|
120
54
|
return body;
|
|
121
55
|
return `${WORKBENCH_CONTEXT_START_MARKER}\n${JSON.stringify(encodedContexts)}\n${WORKBENCH_CONTEXT_END_MARKER}${body ? `\n${body}` : ""}`;
|
|
@@ -126,7 +60,10 @@ export function decodeWorkbenchMessageWithErrorContext(content) {
|
|
|
126
60
|
const errorContext = decoded.contexts.find((context) => context.source === "scenario_run_error");
|
|
127
61
|
if (!errorContext)
|
|
128
62
|
return null;
|
|
129
|
-
return {
|
|
63
|
+
return {
|
|
64
|
+
context: errorContext,
|
|
65
|
+
body: decoded.body,
|
|
66
|
+
};
|
|
130
67
|
}
|
|
131
68
|
return decodeLegacyWorkbenchErrorContext(content);
|
|
132
69
|
}
|
|
@@ -154,7 +91,7 @@ export function decodeWorkbenchMessageWithContext(content) {
|
|
|
154
91
|
return null;
|
|
155
92
|
}
|
|
156
93
|
const records = Array.isArray(parsed) ? parsed : [parsed];
|
|
157
|
-
const contexts = records.map((record) =>
|
|
94
|
+
const contexts = records.map((record) => parseWorkbenchMessageContext(record))
|
|
158
95
|
.filter((context) => Boolean(context));
|
|
159
96
|
if (contexts.length === 0)
|
|
160
97
|
return null;
|
|
@@ -290,10 +227,12 @@ export function ChatView(props) {
|
|
|
290
227
|
run.messages.length === 0;
|
|
291
228
|
const resolvedComposerChips = composerChips ??
|
|
292
229
|
(scenarioErrorChip
|
|
293
|
-
? [
|
|
230
|
+
? [
|
|
231
|
+
{
|
|
294
232
|
...scenarioErrorChip,
|
|
295
233
|
chipId: "scenario_run_error",
|
|
296
|
-
}
|
|
234
|
+
},
|
|
235
|
+
]
|
|
297
236
|
: []);
|
|
298
237
|
const updateComposerChips = useCallback((next) => {
|
|
299
238
|
if (onComposerChipsChange) {
|
|
@@ -326,41 +265,7 @@ export function ChatView(props) {
|
|
|
326
265
|
const message = chatDraft.trim();
|
|
327
266
|
const activeChips = resolvedComposerChips.filter((chip) => chip.enabled);
|
|
328
267
|
const activeChipIds = new Set(activeChips.map((chip) => chip.chipId));
|
|
329
|
-
const activeContexts = activeChips
|
|
330
|
-
.map((chip) => {
|
|
331
|
-
if (chip.source === "scenario_run_error") {
|
|
332
|
-
return {
|
|
333
|
-
source: "scenario_run_error",
|
|
334
|
-
workspaceId: chip.workspaceId,
|
|
335
|
-
runId: chip.runId,
|
|
336
|
-
capturedAt: chip.capturedAt,
|
|
337
|
-
error: chip.error,
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
if (chip.source === "message_rating") {
|
|
341
|
-
return {
|
|
342
|
-
source: "message_rating",
|
|
343
|
-
workspaceId: chip.workspaceId,
|
|
344
|
-
runId: chip.runId,
|
|
345
|
-
capturedAt: chip.capturedAt,
|
|
346
|
-
messageRefId: chip.messageRefId,
|
|
347
|
-
statePath: chip.statePath,
|
|
348
|
-
statePointer: chip.statePointer,
|
|
349
|
-
score: chip.score,
|
|
350
|
-
reason: chip.reason,
|
|
351
|
-
};
|
|
352
|
-
}
|
|
353
|
-
return {
|
|
354
|
-
source: "grading_flag",
|
|
355
|
-
workspaceId: chip.workspaceId,
|
|
356
|
-
runId: chip.runId,
|
|
357
|
-
capturedAt: chip.capturedAt,
|
|
358
|
-
flagId: chip.flagId,
|
|
359
|
-
refId: chip.refId,
|
|
360
|
-
score: chip.score,
|
|
361
|
-
message: chip.message,
|
|
362
|
-
};
|
|
363
|
-
});
|
|
268
|
+
const activeContexts = activeChips.map((chip) => toWorkbenchMessageContext(chip));
|
|
364
269
|
if (!message && activeContexts.length === 0)
|
|
365
270
|
return;
|
|
366
271
|
const outboundMessage = activeContexts.length > 0
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type BuildDisplayMessage, type TestBotRun } from "./utils.js";
|
|
3
|
+
import type { FeedbackEntry } from "./utils.js";
|
|
3
4
|
type Props = {
|
|
4
5
|
run: TestBotRun;
|
|
5
6
|
runWorkspaceId?: string;
|
|
@@ -52,6 +53,7 @@ type Props = {
|
|
|
52
53
|
runId?: string;
|
|
53
54
|
error: string;
|
|
54
55
|
}) => void;
|
|
56
|
+
onAddFeedbackToWorkbench?: (feedback: FeedbackEntry) => void;
|
|
55
57
|
};
|
|
56
58
|
export default function TestBotChatPanel(props: Props): React.JSX.Element;
|
|
57
59
|
export {};
|