inspect-ai 0.3.62__py3-none-any.whl → 0.3.63__py3-none-any.whl
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.
- inspect_ai/_cli/main.py +1 -1
- inspect_ai/_cli/trace.py +8 -0
- inspect_ai/_display/core/active.py +2 -3
- inspect_ai/_eval/eval.py +4 -4
- inspect_ai/_eval/evalset.py +6 -6
- inspect_ai/_eval/task/run.py +3 -0
- inspect_ai/_util/hash.py +1 -1
- inspect_ai/_view/www/.vscode/extensions.json +3 -0
- inspect_ai/_view/www/.vscode/settings.json +8 -0
- inspect_ai/_view/www/App.css +92 -29
- inspect_ai/_view/www/dist/assets/index.css +16637 -14676
- inspect_ai/_view/www/dist/assets/index.js +58897 -51440
- inspect_ai/_view/www/dist/index.html +1 -1
- inspect_ai/_view/www/index.html +2 -2
- inspect_ai/_view/www/log-schema.json +1 -0
- inspect_ai/_view/www/package.json +22 -4
- inspect_ai/_view/www/postcss.config.cjs +8 -9
- inspect_ai/_view/www/src/{App.mjs → App.tsx} +355 -365
- inspect_ai/_view/www/src/AppErrorBoundary.tsx +47 -0
- inspect_ai/_view/www/src/api/api-browser.ts +2 -2
- inspect_ai/_view/www/src/api/api-http.ts +3 -5
- inspect_ai/_view/www/src/api/api-vscode.ts +6 -6
- inspect_ai/_view/www/src/api/client-api.ts +4 -4
- inspect_ai/_view/www/src/api/index.ts +4 -4
- inspect_ai/_view/www/src/api/{Types.ts → types.ts} +25 -9
- inspect_ai/_view/www/src/appearance/colors.ts +9 -0
- inspect_ai/_view/www/src/appearance/fonts.ts +39 -0
- inspect_ai/_view/www/src/appearance/icons.ts +100 -0
- inspect_ai/_view/www/src/appearance/{Styles.mjs → styles.ts} +2 -32
- inspect_ai/_view/www/src/components/AnsiDisplay.tsx +198 -0
- inspect_ai/_view/www/src/components/AsciinemaPlayer.tsx +86 -0
- inspect_ai/_view/www/src/components/Card.css +60 -0
- inspect_ai/_view/www/src/components/Card.tsx +109 -0
- inspect_ai/_view/www/src/components/CopyButton.module.css +11 -0
- inspect_ai/_view/www/src/components/CopyButton.tsx +58 -0
- inspect_ai/_view/www/src/components/DownloadButton.css +4 -0
- inspect_ai/_view/www/src/components/DownloadButton.tsx +25 -0
- inspect_ai/_view/www/src/components/DownloadPanel.css +10 -0
- inspect_ai/_view/www/src/components/DownloadPanel.tsx +30 -0
- inspect_ai/_view/www/src/components/EmptyPanel.css +12 -0
- inspect_ai/_view/www/src/components/EmptyPanel.tsx +15 -0
- inspect_ai/_view/www/src/components/ErrorPanel.css +37 -0
- inspect_ai/_view/www/src/components/ErrorPanel.tsx +39 -0
- inspect_ai/_view/www/src/components/ExpandablePanel.css +40 -0
- inspect_ai/_view/www/src/components/ExpandablePanel.tsx +115 -0
- inspect_ai/_view/www/src/components/FindBand.css +49 -0
- inspect_ai/_view/www/src/components/FindBand.tsx +130 -0
- inspect_ai/_view/www/src/components/HumanBaselineView.css +41 -0
- inspect_ai/_view/www/src/components/HumanBaselineView.tsx +162 -0
- inspect_ai/_view/www/src/components/JsonPanel.css +20 -0
- inspect_ai/_view/www/src/components/JsonPanel.tsx +82 -0
- inspect_ai/_view/www/src/components/LabeledValue.css +20 -0
- inspect_ai/_view/www/src/components/LabeledValue.tsx +41 -0
- inspect_ai/_view/www/src/components/LargeModal.module.css +54 -0
- inspect_ai/_view/www/src/components/LargeModal.tsx +199 -0
- inspect_ai/_view/www/src/components/LightboxCarousel.css +95 -0
- inspect_ai/_view/www/src/components/LightboxCarousel.tsx +132 -0
- inspect_ai/_view/www/src/components/MarkdownDiv.css +3 -0
- inspect_ai/_view/www/src/components/MarkdownDiv.tsx +133 -0
- inspect_ai/_view/www/src/components/MessageBand.css +43 -0
- inspect_ai/_view/www/src/components/MessageBand.tsx +39 -0
- inspect_ai/_view/www/src/components/MorePopOver.tsx +67 -0
- inspect_ai/_view/www/src/components/NavPills.module.css +18 -0
- inspect_ai/_view/www/src/components/NavPills.tsx +99 -0
- inspect_ai/_view/www/src/components/ProgressBar.module.css +37 -0
- inspect_ai/_view/www/src/components/ProgressBar.tsx +22 -0
- inspect_ai/_view/www/src/components/TabSet.module.css +40 -0
- inspect_ai/_view/www/src/components/TabSet.tsx +200 -0
- inspect_ai/_view/www/src/components/ToolButton.css +3 -0
- inspect_ai/_view/www/src/components/ToolButton.tsx +27 -0
- inspect_ai/_view/www/src/components/VirtualList.module.css +19 -0
- inspect_ai/_view/www/src/components/VirtualList.tsx +292 -0
- inspect_ai/_view/www/src/{index.js → index.tsx} +45 -19
- inspect_ai/_view/www/src/{log → logfile}/remoteLogFile.ts +3 -7
- inspect_ai/_view/www/src/{utils/remoteZipFile.mjs → logfile/remoteZipFile.ts} +86 -80
- inspect_ai/_view/www/src/metadata/MetaDataGrid.tsx +83 -0
- inspect_ai/_view/www/src/metadata/MetaDataView.module.css +35 -0
- inspect_ai/_view/www/src/metadata/MetaDataView.tsx +95 -0
- inspect_ai/_view/www/src/metadata/MetadataGrid.module.css +15 -0
- inspect_ai/_view/www/src/metadata/RenderedContent.module.css +12 -0
- inspect_ai/_view/www/src/{components/RenderedContent/RenderedContent.mjs → metadata/RenderedContent.tsx} +92 -73
- inspect_ai/_view/www/src/metadata/types.ts +18 -0
- inspect_ai/_view/www/src/plan/DatasetDetailView.module.css +3 -0
- inspect_ai/_view/www/src/plan/DatasetDetailView.tsx +37 -0
- inspect_ai/_view/www/src/plan/DetailStep.module.css +9 -0
- inspect_ai/_view/www/src/plan/DetailStep.tsx +31 -0
- inspect_ai/_view/www/src/plan/PlanCard.tsx +28 -0
- inspect_ai/_view/www/src/plan/PlanDetailView.module.css +48 -0
- inspect_ai/_view/www/src/plan/PlanDetailView.tsx +309 -0
- inspect_ai/_view/www/src/plan/ScorerDetailView.module.css +3 -0
- inspect_ai/_view/www/src/plan/ScorerDetailView.tsx +30 -0
- inspect_ai/_view/www/src/plan/SolverDetailView.module.css +15 -0
- inspect_ai/_view/www/src/plan/SolverDetailView.tsx +32 -0
- inspect_ai/_view/www/src/samples/InlineSampleDisplay.module.css +8 -0
- inspect_ai/_view/www/src/samples/InlineSampleDisplay.tsx +53 -0
- inspect_ai/_view/www/src/samples/SampleDialog.tsx +122 -0
- inspect_ai/_view/www/src/samples/SampleDisplay.module.css +29 -0
- inspect_ai/_view/www/src/samples/SampleDisplay.tsx +326 -0
- inspect_ai/_view/www/src/samples/SampleSummaryView.module.css +24 -0
- inspect_ai/_view/www/src/samples/SampleSummaryView.tsx +175 -0
- inspect_ai/_view/www/src/samples/SamplesTools.tsx +60 -0
- inspect_ai/_view/www/src/samples/chat/ChatMessage.module.css +29 -0
- inspect_ai/_view/www/src/samples/chat/ChatMessage.tsx +76 -0
- inspect_ai/_view/www/src/samples/chat/ChatMessageRenderer.tsx +60 -0
- inspect_ai/_view/www/src/samples/chat/ChatMessageRow.module.css +9 -0
- inspect_ai/_view/www/src/samples/chat/ChatMessageRow.tsx +57 -0
- inspect_ai/_view/www/src/samples/chat/ChatView.tsx +46 -0
- inspect_ai/_view/www/src/samples/chat/ChatViewVirtualList.module.css +4 -0
- inspect_ai/_view/www/src/samples/chat/ChatViewVirtualList.tsx +58 -0
- inspect_ai/_view/www/src/samples/chat/MessageContent.module.css +4 -0
- inspect_ai/_view/www/src/samples/chat/MessageContent.tsx +143 -0
- inspect_ai/_view/www/src/samples/chat/MessageContents.module.css +3 -0
- inspect_ai/_view/www/src/samples/chat/MessageContents.tsx +131 -0
- inspect_ai/_view/www/src/samples/chat/messages.ts +112 -0
- inspect_ai/_view/www/src/samples/chat/tools/ToolCallView.tsx +145 -0
- inspect_ai/_view/www/src/samples/chat/tools/ToolInput.module.css +14 -0
- inspect_ai/_view/www/src/samples/chat/tools/ToolInput.tsx +86 -0
- inspect_ai/_view/www/src/samples/chat/tools/ToolOutput.module.css +19 -0
- inspect_ai/_view/www/src/samples/chat/tools/ToolOutput.tsx +53 -0
- inspect_ai/_view/www/src/samples/chat/tools/ToolTitle.module.css +4 -0
- inspect_ai/_view/www/src/samples/chat/tools/ToolTitle.tsx +18 -0
- inspect_ai/_view/www/src/samples/chat/tools/tool.ts +107 -0
- inspect_ai/_view/www/src/samples/descriptor/samplesDescriptor.tsx +363 -0
- inspect_ai/_view/www/src/samples/descriptor/score/BooleanScoreDescriptor.module.css +22 -0
- inspect_ai/_view/www/src/samples/descriptor/score/BooleanScoreDescriptor.tsx +26 -0
- inspect_ai/_view/www/src/samples/descriptor/score/CategoricalScoreDescriptor.tsx +18 -0
- inspect_ai/_view/www/src/samples/descriptor/score/NumericScoreDescriptor.tsx +27 -0
- inspect_ai/_view/www/src/samples/descriptor/score/ObjectScoreDescriptor.module.css +18 -0
- inspect_ai/_view/www/src/samples/descriptor/score/ObjectScoreDescriptor.tsx +71 -0
- inspect_ai/_view/www/src/samples/descriptor/score/OtherScoreDescriptor.tsx +20 -0
- inspect_ai/_view/www/src/samples/descriptor/score/PassFailScoreDescriptor.module.css +28 -0
- inspect_ai/_view/www/src/samples/descriptor/score/PassFailScoreDescriptor.tsx +81 -0
- inspect_ai/_view/www/src/samples/descriptor/score/ScoreDescriptor.tsx +99 -0
- inspect_ai/_view/www/src/samples/descriptor/types.ts +55 -0
- inspect_ai/_view/www/src/samples/error/FlatSampleErrorView.module.css +19 -0
- inspect_ai/_view/www/src/samples/error/FlatSampleErrorView.tsx +22 -0
- inspect_ai/_view/www/src/samples/error/SampleErrorView.module.css +17 -0
- inspect_ai/_view/www/src/samples/error/SampleErrorView.tsx +31 -0
- inspect_ai/_view/www/src/samples/error/error.ts +15 -0
- inspect_ai/_view/www/src/samples/list/SampleFooter.module.css +9 -0
- inspect_ai/_view/www/src/samples/list/SampleFooter.tsx +14 -0
- inspect_ai/_view/www/src/samples/list/SampleHeader.module.css +13 -0
- inspect_ai/_view/www/src/samples/list/SampleHeader.tsx +36 -0
- inspect_ai/_view/www/src/samples/list/SampleList.module.css +11 -0
- inspect_ai/_view/www/src/samples/list/SampleList.tsx +247 -0
- inspect_ai/_view/www/src/samples/list/SampleRow.module.css +33 -0
- inspect_ai/_view/www/src/samples/list/SampleRow.tsx +98 -0
- inspect_ai/_view/www/src/samples/list/SampleSeparator.module.css +6 -0
- inspect_ai/_view/www/src/samples/list/SampleSeparator.tsx +24 -0
- inspect_ai/_view/www/src/samples/sample-tools/EpochFilter.module.css +9 -0
- inspect_ai/_view/www/src/samples/sample-tools/EpochFilter.tsx +51 -0
- inspect_ai/_view/www/src/samples/sample-tools/SelectScorer.module.css +16 -0
- inspect_ai/_view/www/src/samples/sample-tools/SelectScorer.tsx +173 -0
- inspect_ai/_view/www/src/samples/sample-tools/SortFilter.module.css +9 -0
- inspect_ai/_view/www/src/samples/sample-tools/SortFilter.tsx +182 -0
- inspect_ai/_view/www/src/samples/{tools/filters.mjs → sample-tools/filters.ts} +86 -81
- inspect_ai/_view/www/src/samples/sample-tools/sample-filter/SampleFilter.module.css +16 -0
- inspect_ai/_view/www/src/samples/sample-tools/sample-filter/SampleFilter.tsx +288 -0
- inspect_ai/_view/www/src/samples/sample-tools/sample-filter/completions.ts +346 -0
- inspect_ai/_view/www/src/samples/sample-tools/sample-filter/language.ts +19 -0
- inspect_ai/_view/www/src/samples/sample-tools/sample-filter/tokenize.ts +97 -0
- inspect_ai/_view/www/src/samples/{SampleLimit.mjs → sampleLimit.ts} +3 -6
- inspect_ai/_view/www/src/samples/scores/SampleScoreView.module.css +53 -0
- inspect_ai/_view/www/src/samples/scores/SampleScoreView.tsx +168 -0
- inspect_ai/_view/www/src/samples/scores/SampleScores.module.css +5 -0
- inspect_ai/_view/www/src/samples/scores/SampleScores.tsx +37 -0
- inspect_ai/_view/www/src/samples/transcript/ApprovalEventView.tsx +66 -0
- inspect_ai/_view/www/src/samples/transcript/ErrorEventView.tsx +51 -0
- inspect_ai/_view/www/src/samples/transcript/InfoEventView.module.css +3 -0
- inspect_ai/_view/www/src/samples/transcript/InfoEventView.tsx +54 -0
- inspect_ai/_view/www/src/samples/transcript/InputEventView.tsx +48 -0
- inspect_ai/_view/www/src/samples/transcript/LoggerEventView.module.css +6 -0
- inspect_ai/_view/www/src/samples/transcript/LoggerEventView.tsx +36 -0
- inspect_ai/_view/www/src/samples/transcript/ModelEventView.module.css +43 -0
- inspect_ai/_view/www/src/samples/transcript/ModelEventView.tsx +223 -0
- inspect_ai/_view/www/src/samples/transcript/SampleInitEventView.module.css +23 -0
- inspect_ai/_view/www/src/samples/transcript/SampleInitEventView.tsx +108 -0
- inspect_ai/_view/www/src/samples/transcript/SampleLimitEventView.tsx +75 -0
- inspect_ai/_view/www/src/samples/transcript/SampleTranscript.tsx +22 -0
- inspect_ai/_view/www/src/samples/transcript/ScoreEventView.module.css +15 -0
- inspect_ai/_view/www/src/samples/transcript/ScoreEventView.tsx +100 -0
- inspect_ai/_view/www/src/samples/transcript/StepEventView.tsx +171 -0
- inspect_ai/_view/www/src/samples/transcript/SubtaskEventView.module.css +19 -0
- inspect_ai/_view/www/src/samples/transcript/SubtaskEventView.tsx +133 -0
- inspect_ai/_view/www/src/samples/transcript/ToolEventView.module.css +10 -0
- inspect_ai/_view/www/src/samples/transcript/ToolEventView.tsx +91 -0
- inspect_ai/_view/www/src/samples/transcript/TranscriptView.module.css +49 -0
- inspect_ai/_view/www/src/samples/transcript/TranscriptView.tsx +449 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventNav.module.css +5 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventNav.tsx +43 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventNavs.module.css +3 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventNavs.tsx +38 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventPanel.module.css +25 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventPanel.tsx +190 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventRow.module.css +13 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventRow.tsx +32 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventSection.module.css +8 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventSection.tsx +29 -0
- inspect_ai/_view/www/src/samples/transcript/state/StateDiffView.tsx +67 -0
- inspect_ai/_view/www/src/samples/transcript/state/StateEventRenderers.tsx +274 -0
- inspect_ai/_view/www/src/samples/transcript/state/StateEventRenders.module.css +10 -0
- inspect_ai/_view/www/src/samples/transcript/state/StateEventView.module.css +9 -0
- inspect_ai/_view/www/src/samples/transcript/state/{StateEventView.mjs → StateEventView.tsx} +148 -110
- inspect_ai/_view/www/src/samples/transcript/types.ts +58 -0
- inspect_ai/_view/www/src/types/log.d.ts +1 -0
- inspect_ai/_view/www/src/types/prism.d.ts +11 -0
- inspect_ai/_view/www/src/types.ts +71 -0
- inspect_ai/_view/www/src/usage/ModelTokenTable.tsx +22 -0
- inspect_ai/_view/www/src/usage/ModelUsagePanel.module.css +24 -0
- inspect_ai/_view/www/src/usage/ModelUsagePanel.tsx +95 -0
- inspect_ai/_view/www/src/usage/TokenTable.module.css +17 -0
- inspect_ai/_view/www/src/usage/TokenTable.tsx +91 -0
- inspect_ai/_view/www/src/usage/UsageCard.module.css +15 -0
- inspect_ai/_view/www/src/usage/UsageCard.tsx +67 -0
- inspect_ai/_view/www/src/utils/attachments.ts +42 -0
- inspect_ai/_view/www/src/utils/{Base64.mjs → base64.ts} +1 -6
- inspect_ai/_view/www/src/{components/Browser.mjs → utils/browser.ts} +0 -1
- inspect_ai/_view/www/src/utils/debugging.ts +28 -0
- inspect_ai/_view/www/src/utils/dom.ts +30 -0
- inspect_ai/_view/www/src/utils/format.ts +194 -0
- inspect_ai/_view/www/src/utils/git.ts +7 -0
- inspect_ai/_view/www/src/utils/html.ts +6 -0
- inspect_ai/_view/www/src/utils/http.ts +14 -0
- inspect_ai/_view/www/src/utils/{Path.mjs → path.ts} +2 -9
- inspect_ai/_view/www/src/utils/{Print.mjs → print.ts} +34 -26
- inspect_ai/_view/www/src/utils/queue.ts +51 -0
- inspect_ai/_view/www/src/utils/sync.ts +114 -0
- inspect_ai/_view/www/src/utils/{Type.mjs → type.ts} +3 -6
- inspect_ai/_view/www/src/utils/vscode.ts +13 -0
- inspect_ai/_view/www/src/workspace/WorkSpace.tsx +324 -0
- inspect_ai/_view/www/src/workspace/WorkSpaceView.module.css +33 -0
- inspect_ai/_view/www/src/workspace/WorkSpaceView.tsx +160 -0
- inspect_ai/_view/www/src/workspace/error/TaskErrorPanel.module.css +3 -0
- inspect_ai/_view/www/src/workspace/error/TaskErrorPanel.tsx +28 -0
- inspect_ai/_view/www/src/workspace/navbar/Navbar.module.css +54 -0
- inspect_ai/_view/www/src/workspace/navbar/Navbar.tsx +68 -0
- inspect_ai/_view/www/src/workspace/navbar/PrimaryBar.module.css +52 -0
- inspect_ai/_view/www/src/workspace/navbar/PrimaryBar.tsx +113 -0
- inspect_ai/_view/www/src/workspace/navbar/ResultsPanel.module.css +67 -0
- inspect_ai/_view/www/src/workspace/navbar/ResultsPanel.tsx +156 -0
- inspect_ai/_view/www/src/workspace/navbar/SecondaryBar.module.css +28 -0
- inspect_ai/_view/www/src/workspace/navbar/SecondaryBar.tsx +222 -0
- inspect_ai/_view/www/src/workspace/navbar/StatusPanel.module.css +14 -0
- inspect_ai/_view/www/src/workspace/navbar/StatusPanel.tsx +61 -0
- inspect_ai/_view/www/src/workspace/sidebar/EvalStatus.module.css +15 -0
- inspect_ai/_view/www/src/workspace/sidebar/EvalStatus.tsx +71 -0
- inspect_ai/_view/www/src/workspace/sidebar/LogDirectoryTitleView.module.css +5 -0
- inspect_ai/_view/www/src/workspace/sidebar/LogDirectoryTitleView.tsx +56 -0
- inspect_ai/_view/www/src/workspace/sidebar/Sidebar.module.css +68 -0
- inspect_ai/_view/www/src/workspace/sidebar/Sidebar.tsx +85 -0
- inspect_ai/_view/www/src/workspace/sidebar/SidebarLogEntry.module.css +29 -0
- inspect_ai/_view/www/src/workspace/sidebar/SidebarLogEntry.tsx +95 -0
- inspect_ai/_view/www/src/workspace/sidebar/SidebarScoreView.module.css +23 -0
- inspect_ai/_view/www/src/workspace/sidebar/SidebarScoreView.tsx +41 -0
- inspect_ai/_view/www/src/workspace/sidebar/SidebarScoresView.module.css +35 -0
- inspect_ai/_view/www/src/workspace/sidebar/SidebarScoresView.tsx +61 -0
- inspect_ai/_view/www/src/workspace/tabs/InfoTab.tsx +80 -0
- inspect_ai/_view/www/src/workspace/tabs/JsonTab.module.css +5 -0
- inspect_ai/_view/www/src/workspace/tabs/JsonTab.tsx +46 -0
- inspect_ai/_view/www/src/workspace/tabs/SamplesTab.tsx +204 -0
- inspect_ai/_view/www/src/workspace/tabs/grouping.ts +195 -0
- inspect_ai/_view/www/src/workspace/tabs/types.ts +19 -0
- inspect_ai/_view/www/src/workspace/types.ts +10 -0
- inspect_ai/_view/www/tsconfig.json +23 -9
- inspect_ai/_view/www/vite.config.js +8 -17
- inspect_ai/_view/www/yarn.lock +627 -556
- inspect_ai/dataset/_dataset.py +36 -0
- inspect_ai/dataset/_sources/csv.py +8 -0
- inspect_ai/dataset/_sources/file.py +4 -0
- inspect_ai/dataset/_sources/hf.py +11 -1
- inspect_ai/dataset/_sources/json.py +8 -0
- inspect_ai/log/_log.py +3 -6
- inspect_ai/log/_message.py +1 -1
- inspect_ai/log/_recorders/json.py +5 -7
- inspect_ai/model/_call_tools.py +2 -1
- inspect_ai/model/_providers/anthropic.py +3 -3
- inspect_ai/model/_providers/openai_o1.py +3 -5
- inspect_ai/model/_providers/openrouter.py +86 -0
- inspect_ai/model/_providers/providers.py +11 -0
- inspect_ai/scorer/_answer.py +7 -7
- inspect_ai/scorer/_classification.py +34 -18
- inspect_ai/scorer/_common.py +2 -8
- inspect_ai/solver/_multiple_choice.py +24 -9
- inspect_ai/tool/__init__.py +2 -0
- inspect_ai/tool/{beta → _tools}/_computer/_computer.py +2 -5
- inspect_ai/tool/_tools/_computer/_resources/tool/__init__.py +0 -0
- inspect_ai/tool/{beta → _tools}/_computer/_resources/tool/_x11_client.py +1 -1
- inspect_ai/tool/_tools/_computer/_resources/tool/requirements.txt +0 -0
- inspect_ai/tool/_tools/_execute.py +8 -2
- inspect_ai/tool/beta.py +3 -0
- inspect_ai/util/_sandbox/docker/docker.py +32 -85
- inspect_ai/util/_sandbox/self_check.py +124 -16
- {inspect_ai-0.3.62.dist-info → inspect_ai-0.3.63.dist-info}/METADATA +2 -1
- inspect_ai-0.3.63.dist-info/RECORD +618 -0
- inspect_ai/_view/www/src/Register.mjs +0 -3
- inspect_ai/_view/www/src/Types.mjs +0 -38
- inspect_ai/_view/www/src/appearance/Colors.mjs +0 -27
- inspect_ai/_view/www/src/appearance/Fonts.mjs +0 -66
- inspect_ai/_view/www/src/appearance/Icons.mjs +0 -240
- inspect_ai/_view/www/src/components/AnsiDisplay.mjs +0 -184
- inspect_ai/_view/www/src/components/AppErrorBoundary.mjs +0 -34
- inspect_ai/_view/www/src/components/AsciiCinemaPlayer.mjs +0 -74
- inspect_ai/_view/www/src/components/Card.mjs +0 -126
- inspect_ai/_view/www/src/components/ChatView.mjs +0 -441
- inspect_ai/_view/www/src/components/CopyButton.mjs +0 -48
- inspect_ai/_view/www/src/components/Dialog.mjs +0 -61
- inspect_ai/_view/www/src/components/DownloadButton.mjs +0 -15
- inspect_ai/_view/www/src/components/DownloadPanel.mjs +0 -29
- inspect_ai/_view/www/src/components/EmptyPanel.mjs +0 -23
- inspect_ai/_view/www/src/components/ErrorPanel.mjs +0 -66
- inspect_ai/_view/www/src/components/ExpandablePanel.mjs +0 -136
- inspect_ai/_view/www/src/components/FindBand.mjs +0 -157
- inspect_ai/_view/www/src/components/HumanBaselineView.mjs +0 -168
- inspect_ai/_view/www/src/components/JsonPanel.mjs +0 -61
- inspect_ai/_view/www/src/components/LabeledValue.mjs +0 -32
- inspect_ai/_view/www/src/components/LargeModal.mjs +0 -190
- inspect_ai/_view/www/src/components/LightboxCarousel.mjs +0 -217
- inspect_ai/_view/www/src/components/MarkdownDiv.mjs +0 -118
- inspect_ai/_view/www/src/components/MessageBand.mjs +0 -48
- inspect_ai/_view/www/src/components/MessageContent.mjs +0 -111
- inspect_ai/_view/www/src/components/MetaDataGrid.mjs +0 -92
- inspect_ai/_view/www/src/components/MetaDataView.mjs +0 -109
- inspect_ai/_view/www/src/components/MorePopOver.mjs +0 -50
- inspect_ai/_view/www/src/components/NavPills.mjs +0 -63
- inspect_ai/_view/www/src/components/ProgressBar.mjs +0 -51
- inspect_ai/_view/www/src/components/RenderedContent/ChatMessageRenderer.mjs +0 -54
- inspect_ai/_view/www/src/components/RenderedContent/Types.mjs +0 -19
- inspect_ai/_view/www/src/components/TabSet.mjs +0 -184
- inspect_ai/_view/www/src/components/ToolButton.mjs +0 -16
- inspect_ai/_view/www/src/components/Tools.mjs +0 -376
- inspect_ai/_view/www/src/components/VirtualList.mjs +0 -280
- inspect_ai/_view/www/src/components/ansi-output.js +0 -932
- inspect_ai/_view/www/src/json/JsonTab.mjs +0 -48
- inspect_ai/_view/www/src/log-reader/Log-Reader.mjs +0 -25
- inspect_ai/_view/www/src/log-reader/Native-Log-Reader.mjs +0 -13
- inspect_ai/_view/www/src/log-reader/Open-AI-Log-Reader.mjs +0 -263
- inspect_ai/_view/www/src/navbar/Navbar.mjs +0 -418
- inspect_ai/_view/www/src/navbar/SecondaryBar.mjs +0 -175
- inspect_ai/_view/www/src/plan/PlanCard.mjs +0 -418
- inspect_ai/_view/www/src/samples/SampleDialog.mjs +0 -123
- inspect_ai/_view/www/src/samples/SampleDisplay.mjs +0 -516
- inspect_ai/_view/www/src/samples/SampleError.mjs +0 -99
- inspect_ai/_view/www/src/samples/SampleList.mjs +0 -427
- inspect_ai/_view/www/src/samples/SampleScoreView.mjs +0 -172
- inspect_ai/_view/www/src/samples/SampleScores.mjs +0 -34
- inspect_ai/_view/www/src/samples/SampleTranscript.mjs +0 -20
- inspect_ai/_view/www/src/samples/SamplesDescriptor.mjs +0 -771
- inspect_ai/_view/www/src/samples/SamplesTab.mjs +0 -399
- inspect_ai/_view/www/src/samples/SamplesTools.mjs +0 -64
- inspect_ai/_view/www/src/samples/tools/EpochFilter.mjs +0 -38
- inspect_ai/_view/www/src/samples/tools/SampleFilter.mjs +0 -756
- inspect_ai/_view/www/src/samples/tools/SelectScorer.mjs +0 -141
- inspect_ai/_view/www/src/samples/tools/SortFilter.mjs +0 -151
- inspect_ai/_view/www/src/samples/transcript/ApprovalEventView.mjs +0 -71
- inspect_ai/_view/www/src/samples/transcript/ErrorEventView.mjs +0 -44
- inspect_ai/_view/www/src/samples/transcript/EventPanel.mjs +0 -271
- inspect_ai/_view/www/src/samples/transcript/EventRow.mjs +0 -46
- inspect_ai/_view/www/src/samples/transcript/EventSection.mjs +0 -33
- inspect_ai/_view/www/src/samples/transcript/InfoEventView.mjs +0 -59
- inspect_ai/_view/www/src/samples/transcript/InputEventView.mjs +0 -44
- inspect_ai/_view/www/src/samples/transcript/LoggerEventView.mjs +0 -32
- inspect_ai/_view/www/src/samples/transcript/ModelEventView.mjs +0 -216
- inspect_ai/_view/www/src/samples/transcript/SampleInitEventView.mjs +0 -107
- inspect_ai/_view/www/src/samples/transcript/SampleLimitEventView.mjs +0 -74
- inspect_ai/_view/www/src/samples/transcript/ScoreEventView.mjs +0 -100
- inspect_ai/_view/www/src/samples/transcript/StepEventView.mjs +0 -187
- inspect_ai/_view/www/src/samples/transcript/SubtaskEventView.mjs +0 -133
- inspect_ai/_view/www/src/samples/transcript/ToolEventView.mjs +0 -88
- inspect_ai/_view/www/src/samples/transcript/TranscriptView.mjs +0 -459
- inspect_ai/_view/www/src/samples/transcript/Types.mjs +0 -44
- inspect_ai/_view/www/src/samples/transcript/state/StateDiffView.mjs +0 -53
- inspect_ai/_view/www/src/samples/transcript/state/StateEventRenderers.mjs +0 -254
- inspect_ai/_view/www/src/sidebar/Sidebar.mjs +0 -418
- inspect_ai/_view/www/src/usage/ModelTokenTable.mjs +0 -72
- inspect_ai/_view/www/src/usage/UsageCard.mjs +0 -159
- inspect_ai/_view/www/src/utils/Format.mjs +0 -260
- inspect_ai/_view/www/src/utils/Git.mjs +0 -12
- inspect_ai/_view/www/src/utils/Html.mjs +0 -21
- inspect_ai/_view/www/src/utils/attachments.mjs +0 -31
- inspect_ai/_view/www/src/utils/debugging.mjs +0 -23
- inspect_ai/_view/www/src/utils/http.mjs +0 -18
- inspect_ai/_view/www/src/utils/queue.mjs +0 -67
- inspect_ai/_view/www/src/utils/sync.mjs +0 -101
- inspect_ai/_view/www/src/workspace/TaskErrorPanel.mjs +0 -17
- inspect_ai/_view/www/src/workspace/WorkSpace.mjs +0 -516
- inspect_ai/tool/beta/__init__.py +0 -5
- inspect_ai-0.3.62.dist-info/RECORD +0 -481
- /inspect_ai/{tool/beta/_computer/_resources/tool/__init__.py → _view/www/src/components/MorePopOver.css} +0 -0
- /inspect_ai/_view/www/src/{constants.mjs → constants.ts} +0 -0
- /inspect_ai/{tool/beta/_computer/_resources/tool/requirements.txt → _view/www/src/workspace/tabs/InfoTab.module.css} +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/__init__.py +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_common.py +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_computer_split.py +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/Dockerfile +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/README.md +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/entrypoint/entrypoint.sh +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/entrypoint/novnc_startup.sh +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/entrypoint/x11vnc_startup.sh +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/entrypoint/xfce_startup.sh +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/entrypoint/xvfb_startup.sh +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/image_home_dir/.config/Code/User/globalStorage/state.vscdb +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/image_home_dir/.config/Code/User/settings.json +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/image_home_dir/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/image_home_dir/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-screensaver.xml +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/image_home_dir/Desktop/Firefox Web Browser.desktop +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/image_home_dir/Desktop/Terminal.desktop +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/image_home_dir/Desktop/Visual Studio Code.desktop +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/tool/_logger.py +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/tool/_run.py +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/tool/_tool_result.py +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/tool/computer_tool.py +0 -0
- {inspect_ai-0.3.62.dist-info → inspect_ai-0.3.63.dist-info}/LICENSE +0 -0
- {inspect_ai-0.3.62.dist-info → inspect_ai-0.3.63.dist-info}/WHEEL +0 -0
- {inspect_ai-0.3.62.dist-info → inspect_ai-0.3.63.dist-info}/entry_points.txt +0 -0
- {inspect_ai-0.3.62.dist-info → inspect_ai-0.3.63.dist-info}/top_level.txt +0 -0
@@ -1,33 +1,43 @@
|
|
1
1
|
// @ts-check
|
2
|
-
import { html } from "htm/preact";
|
3
2
|
|
4
|
-
import
|
3
|
+
import clsx from "clsx";
|
4
|
+
import {
|
5
|
+
Changes,
|
6
|
+
JsonChange,
|
7
|
+
Op,
|
8
|
+
StateEvent,
|
9
|
+
StoreEvent,
|
10
|
+
} from "../../../types/log";
|
11
|
+
import { formatDateTime } from "../../../utils/format";
|
12
|
+
import { EventPanel } from "../event/EventPanel";
|
13
|
+
import { TranscriptEventState } from "../types";
|
14
|
+
import { StateDiffView } from "./StateDiffView";
|
5
15
|
import {
|
6
16
|
RenderableChangeTypes,
|
7
17
|
StoreSpecificRenderableTypes,
|
8
|
-
} from "./StateEventRenderers
|
9
|
-
|
10
|
-
import
|
18
|
+
} from "./StateEventRenderers";
|
19
|
+
|
20
|
+
import styles from "./StateEventView.module.css";
|
21
|
+
|
22
|
+
interface StateEventViewProps {
|
23
|
+
id: string;
|
24
|
+
event: StateEvent | StoreEvent;
|
25
|
+
eventState: TranscriptEventState;
|
26
|
+
setEventState: (state: TranscriptEventState) => void;
|
27
|
+
isStore?: boolean;
|
28
|
+
className?: string | string[];
|
29
|
+
}
|
11
30
|
|
12
31
|
/**
|
13
32
|
* Renders the StateEventView component.
|
14
|
-
*
|
15
|
-
* @param {Object} props - The properties passed to the component.
|
16
|
-
* @param { string } props.id - The id of this event.
|
17
|
-
* @param {import("../../../types/log").StateEvent } props.event - The event object to display.
|
18
|
-
* @param {import("./../Types.mjs").TranscriptEventState} props.eventState - The state for this event
|
19
|
-
* @param {(state: import("./../Types.mjs").TranscriptEventState) => void} props.setEventState - Update the state for this event
|
20
|
-
* @param { boolean } props.isStore - Whether this event view is rendering a storage (rather than a state)
|
21
|
-
* @param { Object } props.style - The style of this event.
|
22
|
-
* @returns {import("preact").JSX.Element} The component.
|
23
33
|
*/
|
24
|
-
export const StateEventView = ({
|
34
|
+
export const StateEventView: React.FC<StateEventViewProps> = ({
|
25
35
|
id,
|
26
36
|
event,
|
27
37
|
eventState,
|
28
38
|
setEventState,
|
29
|
-
isStore,
|
30
|
-
|
39
|
+
isStore = false,
|
40
|
+
className,
|
31
41
|
}) => {
|
32
42
|
const summary = summarizeChanges(event.changes);
|
33
43
|
|
@@ -35,14 +45,14 @@ export const StateEventView = ({
|
|
35
45
|
const [before, after] = synthesizeComparable(event.changes);
|
36
46
|
|
37
47
|
const tabs = [
|
38
|
-
|
39
|
-
before
|
40
|
-
after
|
41
|
-
name="Diff"
|
42
|
-
|
43
|
-
|
48
|
+
<StateDiffView
|
49
|
+
before={before}
|
50
|
+
after={after}
|
51
|
+
data-name="Diff"
|
52
|
+
className={clsx(styles.diff)}
|
53
|
+
/>,
|
44
54
|
];
|
45
|
-
// This clone is important since the state is used by
|
55
|
+
// This clone is important since the state is used by react as potential values that are rendered
|
46
56
|
// and as a result may be decorated with additional properties, etc..., resulting in DOM elements
|
47
57
|
// appearing attached to state.
|
48
58
|
const changePreview = generatePreview(
|
@@ -52,45 +62,45 @@ export const StateEventView = ({
|
|
52
62
|
);
|
53
63
|
if (changePreview) {
|
54
64
|
tabs.unshift(
|
55
|
-
|
56
|
-
|
57
|
-
</div
|
65
|
+
<div data-name="Summary" className={clsx(styles.summary)}>
|
66
|
+
{changePreview}
|
67
|
+
</div>,
|
58
68
|
);
|
59
69
|
}
|
60
70
|
|
61
71
|
// Compute the title
|
62
72
|
const title = event.event === "state" ? "State Updated" : "Store Updated";
|
63
73
|
|
64
|
-
return
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
74
|
+
return (
|
75
|
+
<EventPanel
|
76
|
+
id={id}
|
77
|
+
title={title}
|
78
|
+
className={className}
|
79
|
+
subTitle={formatDateTime(new Date(event.timestamp))}
|
80
|
+
text={tabs.length === 1 ? summary : undefined}
|
81
|
+
collapse={changePreview === undefined ? true : undefined}
|
82
|
+
selectedNav={eventState.selectedNav || ""}
|
83
|
+
setSelectedNav={(selectedNav) => {
|
84
|
+
setEventState({ ...eventState, selectedNav });
|
85
|
+
}}
|
86
|
+
collapsed={eventState.collapsed}
|
87
|
+
setCollapsed={(collapsed) => {
|
88
|
+
setEventState({ ...eventState, collapsed });
|
89
|
+
}}
|
90
|
+
>
|
91
|
+
{tabs}
|
92
|
+
</EventPanel>
|
93
|
+
);
|
83
94
|
};
|
84
95
|
|
85
96
|
/**
|
86
97
|
* Renders the value of a change based on its type.
|
87
|
-
*
|
88
|
-
* @param {import("../../../types/log").JsonChange[]} changes - The change object containing the value.
|
89
|
-
* @param {Object} resolvedState - The change object containing the value.
|
90
|
-
* @param {boolean} isStore - Is this rendering a store event
|
91
|
-
* @returns {import("preact").JSX.Element|Object|string|undefined} - The rendered HTML template if the value is an object with content and source, otherwise the value itself.
|
92
98
|
*/
|
93
|
-
const generatePreview = (
|
99
|
+
const generatePreview = (
|
100
|
+
changes: JsonChange[],
|
101
|
+
resolvedState: Record<string, unknown>,
|
102
|
+
isStore: boolean,
|
103
|
+
) => {
|
94
104
|
const results = [];
|
95
105
|
for (const changeType of [
|
96
106
|
...RenderableChangeTypes,
|
@@ -105,15 +115,41 @@ const generatePreview = (changes, resolvedState, isStore) => {
|
|
105
115
|
changeType.signature.add.length;
|
106
116
|
let matchingOps = 0;
|
107
117
|
for (const change of changes) {
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
118
|
+
const op = change.op;
|
119
|
+
switch (op) {
|
120
|
+
case "add":
|
121
|
+
if (changeType.signature.add && changeType.signature.add.length > 0) {
|
122
|
+
changeType.signature.add.forEach((signature) => {
|
123
|
+
if (change.path.match(signature)) {
|
124
|
+
matchingOps++;
|
125
|
+
}
|
126
|
+
});
|
127
|
+
}
|
128
|
+
break;
|
129
|
+
case "remove":
|
130
|
+
if (
|
131
|
+
changeType.signature.remove &&
|
132
|
+
changeType.signature.remove.length > 0
|
133
|
+
) {
|
134
|
+
changeType.signature.remove.forEach((signature) => {
|
135
|
+
if (change.path.match(signature)) {
|
136
|
+
matchingOps++;
|
137
|
+
}
|
138
|
+
});
|
115
139
|
}
|
116
|
-
|
140
|
+
break;
|
141
|
+
case "replace":
|
142
|
+
if (
|
143
|
+
changeType.signature.replace &&
|
144
|
+
changeType.signature.replace.length > 0
|
145
|
+
) {
|
146
|
+
changeType.signature.replace.forEach((signature) => {
|
147
|
+
if (change.path.match(signature)) {
|
148
|
+
matchingOps++;
|
149
|
+
}
|
150
|
+
});
|
151
|
+
}
|
152
|
+
break;
|
117
153
|
}
|
118
154
|
}
|
119
155
|
if (matchingOps === requiredMatchCount) {
|
@@ -129,12 +165,9 @@ const generatePreview = (changes, resolvedState, isStore) => {
|
|
129
165
|
|
130
166
|
/**
|
131
167
|
* Renders the value of a change based on its type.
|
132
|
-
*
|
133
|
-
* @param {import("../../../types/log").JsonChange[]} changes - The change object containing the value.
|
134
|
-
* @returns {string} - A string summarizing the changes
|
135
168
|
*/
|
136
|
-
const summarizeChanges = (changes) => {
|
137
|
-
const changeMap = {
|
169
|
+
const summarizeChanges = (changes: JsonChange[]): string => {
|
170
|
+
const changeMap: Record<Op, string[]> = {
|
138
171
|
add: [],
|
139
172
|
copy: [],
|
140
173
|
move: [],
|
@@ -143,24 +176,43 @@ const summarizeChanges = (changes) => {
|
|
143
176
|
test: [],
|
144
177
|
};
|
145
178
|
for (const change of changes) {
|
146
|
-
|
179
|
+
switch (change.op) {
|
180
|
+
case "add":
|
181
|
+
changeMap.add.push(change.path);
|
182
|
+
break;
|
183
|
+
case "copy":
|
184
|
+
changeMap.copy.push(change.path);
|
185
|
+
break;
|
186
|
+
case "move":
|
187
|
+
changeMap.move.push(change.path);
|
188
|
+
break;
|
189
|
+
case "replace":
|
190
|
+
changeMap.replace.push(change.path);
|
191
|
+
break;
|
192
|
+
case "remove":
|
193
|
+
changeMap.remove.push(change.path);
|
194
|
+
break;
|
195
|
+
case "test":
|
196
|
+
changeMap.test.push(change.path);
|
197
|
+
break;
|
198
|
+
}
|
147
199
|
}
|
148
200
|
|
149
|
-
const changeList = [];
|
201
|
+
const changeList: string[] = [];
|
150
202
|
const totalOpCount = Object.keys(changeMap).reduce((prev, current) => {
|
151
|
-
return prev + changeMap[current].length;
|
203
|
+
return prev + changeMap[current as Op].length;
|
152
204
|
}, 0);
|
153
205
|
|
154
206
|
if (totalOpCount > 2) {
|
155
207
|
Object.keys(changeMap).forEach((key) => {
|
156
|
-
const opChanges = changeMap[key];
|
208
|
+
const opChanges = changeMap[key as Op];
|
157
209
|
if (opChanges.length > 0) {
|
158
210
|
changeList.push(`${key} ${opChanges.length}`);
|
159
211
|
}
|
160
212
|
});
|
161
213
|
} else {
|
162
214
|
Object.keys(changeMap).forEach((key) => {
|
163
|
-
const opChanges = changeMap[key];
|
215
|
+
const opChanges = changeMap[key as Op];
|
164
216
|
if (opChanges.length > 0) {
|
165
217
|
changeList.push(`${key} ${opChanges.join(", ")}`);
|
166
218
|
}
|
@@ -171,11 +223,8 @@ const summarizeChanges = (changes) => {
|
|
171
223
|
|
172
224
|
/**
|
173
225
|
* Renders a view displaying a list of state changes.
|
174
|
-
*
|
175
|
-
* @param {import("../../../types/log").Changes} changes - The list of changes to be displayed.
|
176
|
-
* @returns {[Object, Object]} The before and after objects
|
177
226
|
*/
|
178
|
-
const synthesizeComparable = (changes) => {
|
227
|
+
const synthesizeComparable = (changes: Changes) => {
|
179
228
|
const before = {};
|
180
229
|
const after = {};
|
181
230
|
|
@@ -192,7 +241,7 @@ const synthesizeComparable = (changes) => {
|
|
192
241
|
setPath(after, change.path, change.value);
|
193
242
|
break;
|
194
243
|
case "move":
|
195
|
-
setPath(before, change.from, change.value);
|
244
|
+
setPath(before, change.from || "", change.value);
|
196
245
|
setPath(after, change.path, change.value);
|
197
246
|
break;
|
198
247
|
case "remove":
|
@@ -211,15 +260,14 @@ const synthesizeComparable = (changes) => {
|
|
211
260
|
|
212
261
|
/**
|
213
262
|
* Sets a value at a path in an object
|
214
|
-
*
|
215
|
-
* @param {Object} target - The object into which to set the path
|
216
|
-
* @param {string} path - The path of the value to set
|
217
|
-
* @param {unknown} value - The value to set
|
218
|
-
* @returns {Object} The mutated object
|
219
263
|
*/
|
220
|
-
function setPath(
|
264
|
+
function setPath(
|
265
|
+
target: Record<string, unknown>,
|
266
|
+
path: string,
|
267
|
+
value: unknown,
|
268
|
+
): void {
|
221
269
|
const keys = parsePath(path);
|
222
|
-
let current = target;
|
270
|
+
let current: Record<string, unknown> = target;
|
223
271
|
|
224
272
|
for (let i = 0; i < keys.length - 1; i++) {
|
225
273
|
const key = keys[i];
|
@@ -227,7 +275,7 @@ function setPath(target, path, value) {
|
|
227
275
|
// If the next key is a number, create an array, otherwise an object
|
228
276
|
current[key] = isArrayIndex(keys[i + 1]) ? [] : {};
|
229
277
|
}
|
230
|
-
current = current[key]
|
278
|
+
current = current[key] as Record<string, unknown>;
|
231
279
|
}
|
232
280
|
|
233
281
|
const lastKey = keys[keys.length - 1];
|
@@ -236,62 +284,55 @@ function setPath(target, path, value) {
|
|
236
284
|
|
237
285
|
/**
|
238
286
|
* Places structure in an object (without placing values)
|
239
|
-
*
|
240
|
-
* @param {Object} target - The object into which to initialize the path
|
241
|
-
* @param {string} path - The path of the value to set
|
242
|
-
* @returns {Object} The mutated object
|
243
287
|
*/
|
244
|
-
function initializeArrays(target, path) {
|
288
|
+
function initializeArrays(target: Record<string, unknown>, path: string): void {
|
245
289
|
const keys = parsePath(path);
|
246
|
-
let current = target;
|
290
|
+
let current: Record<string, unknown> = target;
|
247
291
|
|
248
292
|
for (let i = 0; i < keys.length - 1; i++) {
|
249
293
|
const key = keys[i];
|
250
294
|
const nextKey = keys[i + 1];
|
251
295
|
|
252
296
|
if (isArrayIndex(nextKey)) {
|
253
|
-
current[key] = initializeArray(
|
297
|
+
current[key] = initializeArray(
|
298
|
+
current[key] as string[] | undefined,
|
299
|
+
nextKey,
|
300
|
+
);
|
254
301
|
} else {
|
255
|
-
current[key] = initializeObject(current[key]);
|
302
|
+
current[key] = initializeObject(current[key] as object | undefined);
|
256
303
|
}
|
257
304
|
|
258
|
-
current = current[key]
|
305
|
+
current = current[key] as Record<string, unknown>;
|
259
306
|
}
|
260
307
|
|
261
308
|
const lastKey = keys[keys.length - 1];
|
262
309
|
if (isArrayIndex(lastKey)) {
|
263
|
-
|
310
|
+
const lastValue = current[lastKey] as string[] | undefined;
|
311
|
+
initializeArray(lastValue, lastKey);
|
264
312
|
}
|
265
313
|
}
|
266
314
|
|
267
315
|
/**
|
268
316
|
* Parses a path into an array of keys
|
269
|
-
*
|
270
|
-
* @param {string} path - The path to split
|
271
|
-
* @returns {string[]} Array of keys
|
272
317
|
*/
|
273
|
-
function parsePath(path) {
|
318
|
+
function parsePath(path: string): string[] {
|
274
319
|
return path.split("/").filter(Boolean);
|
275
320
|
}
|
276
321
|
|
277
322
|
/**
|
278
323
|
* Checks if a key represents an array index
|
279
|
-
*
|
280
|
-
* @param {string} key - The key to check
|
281
|
-
* @returns {boolean} True if the key is a number
|
282
324
|
*/
|
283
|
-
function isArrayIndex(key) {
|
325
|
+
function isArrayIndex(key: string): boolean {
|
284
326
|
return /^\d+$/.test(key);
|
285
327
|
}
|
286
328
|
|
287
329
|
/**
|
288
330
|
* Initializes an array at a given key, ensuring it is large enough
|
289
|
-
*
|
290
|
-
* @param {Array|undefined} current - The current array or undefined
|
291
|
-
* @param {string} nextKey - The key of the next array index
|
292
|
-
* @returns {Array} Initialized array
|
293
331
|
*/
|
294
|
-
function initializeArray(
|
332
|
+
function initializeArray(
|
333
|
+
current: Array<string> | undefined,
|
334
|
+
nextKey: string,
|
335
|
+
): Array<string> {
|
295
336
|
if (!Array.isArray(current)) {
|
296
337
|
current = [];
|
297
338
|
}
|
@@ -304,10 +345,7 @@ function initializeArray(current, nextKey) {
|
|
304
345
|
|
305
346
|
/**
|
306
347
|
* Initializes an object at a given key if it doesn't exist
|
307
|
-
*
|
308
|
-
* @param {Object|undefined} current - The current object or undefined
|
309
|
-
* @returns {Object} Initialized object
|
310
348
|
*/
|
311
|
-
function initializeObject(current) {
|
349
|
+
function initializeObject(current?: Object): Object {
|
312
350
|
return current ?? {};
|
313
351
|
}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import {
|
2
|
+
ApprovalEvent,
|
3
|
+
Changes,
|
4
|
+
ErrorEvent,
|
5
|
+
InfoEvent,
|
6
|
+
InputEvent,
|
7
|
+
LoggerEvent,
|
8
|
+
ModelEvent,
|
9
|
+
SampleInitEvent,
|
10
|
+
SampleLimitEvent,
|
11
|
+
ScoreEvent,
|
12
|
+
StateEvent,
|
13
|
+
StepEvent,
|
14
|
+
StoreEvent,
|
15
|
+
SubtaskEvent,
|
16
|
+
ToolEvent,
|
17
|
+
} from "../../types/log";
|
18
|
+
|
19
|
+
export interface StateManager {
|
20
|
+
scope: string;
|
21
|
+
getState(): object;
|
22
|
+
initializeState(state: object): void;
|
23
|
+
applyChanges(changes: Changes): object;
|
24
|
+
}
|
25
|
+
|
26
|
+
export type EventType =
|
27
|
+
| SampleInitEvent
|
28
|
+
| SampleLimitEvent
|
29
|
+
| StateEvent
|
30
|
+
| StoreEvent
|
31
|
+
| ModelEvent
|
32
|
+
| LoggerEvent
|
33
|
+
| InfoEvent
|
34
|
+
| StepEvent
|
35
|
+
| SubtaskEvent
|
36
|
+
| ScoreEvent
|
37
|
+
| ToolEvent
|
38
|
+
| InputEvent
|
39
|
+
| ErrorEvent
|
40
|
+
| ApprovalEvent;
|
41
|
+
|
42
|
+
export class EventNode {
|
43
|
+
event: EventType;
|
44
|
+
children: EventNode[] = [];
|
45
|
+
depth: number;
|
46
|
+
|
47
|
+
constructor(event: EventType, depth: number) {
|
48
|
+
this.event = event;
|
49
|
+
this.depth = depth;
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
export interface TranscriptEventState {
|
54
|
+
selectedNav?: string;
|
55
|
+
collapsed?: boolean;
|
56
|
+
}
|
57
|
+
|
58
|
+
export type TranscriptState = Record<string, TranscriptEventState>;
|
@@ -1,4 +1,15 @@
|
|
1
1
|
declare var Prism: {
|
2
2
|
languages: any;
|
3
3
|
highlight(contents: any, tokens: any, type: any): string;
|
4
|
+
highlightElement(
|
5
|
+
element: HTMLElement,
|
6
|
+
async?: boolean,
|
7
|
+
callback?: (element: HTMLElement) => void,
|
8
|
+
);
|
9
|
+
|
10
|
+
highlightAllUnder(
|
11
|
+
element: HTMLElement,
|
12
|
+
async?: boolean,
|
13
|
+
callback?: (element: HTMLElement) => void,
|
14
|
+
);
|
4
15
|
};
|
@@ -0,0 +1,71 @@
|
|
1
|
+
import {
|
2
|
+
EvalLogHeader,
|
3
|
+
EvalSummary,
|
4
|
+
LogFiles,
|
5
|
+
SampleSummary,
|
6
|
+
} from "./api/types";
|
7
|
+
import { ContentImage, ContentText, EvalSample } from "./types/log";
|
8
|
+
|
9
|
+
export interface ApplicationState {
|
10
|
+
logs?: LogFiles;
|
11
|
+
selectedLogIndex?: number;
|
12
|
+
logHeaders?: Record<string, EvalLogHeader>;
|
13
|
+
headersLoading?: boolean;
|
14
|
+
selectedLog?: CurrentLog;
|
15
|
+
selectedWorkspaceTab?: string;
|
16
|
+
selectedSampleIndex?: number;
|
17
|
+
selectedSample?: EvalSample;
|
18
|
+
sampleStatus?: "loading" | "ok" | "error";
|
19
|
+
sampleError?: Error;
|
20
|
+
selectedSampleTab?: string;
|
21
|
+
sampleScrollPosition?: number;
|
22
|
+
showingSampleDialog?: boolean;
|
23
|
+
status?: AppStatus;
|
24
|
+
offcanvas?: boolean;
|
25
|
+
showFind?: boolean;
|
26
|
+
filter?: ScoreFilter;
|
27
|
+
epoch?: string;
|
28
|
+
sort?: string;
|
29
|
+
scores?: ScoreLabel[];
|
30
|
+
score?: ScoreLabel;
|
31
|
+
filteredSamples?: SampleSummary[];
|
32
|
+
groupBy?: "none" | "epoch" | "sample";
|
33
|
+
groupByOrder?: "asc" | "desc";
|
34
|
+
workspaceTabScrollPosition?: Record<string, number>;
|
35
|
+
}
|
36
|
+
|
37
|
+
export interface AppStatus {
|
38
|
+
loading: boolean;
|
39
|
+
error?: Error;
|
40
|
+
}
|
41
|
+
|
42
|
+
export interface Capabilities {
|
43
|
+
downloadFiles: boolean;
|
44
|
+
webWorkers: boolean;
|
45
|
+
}
|
46
|
+
|
47
|
+
export interface CurrentLog {
|
48
|
+
name: string;
|
49
|
+
contents: EvalSummary;
|
50
|
+
}
|
51
|
+
|
52
|
+
export interface Logs {
|
53
|
+
log_dir: string;
|
54
|
+
files: string[];
|
55
|
+
}
|
56
|
+
|
57
|
+
export interface ScoreLabel {
|
58
|
+
name: string;
|
59
|
+
scorer: string;
|
60
|
+
}
|
61
|
+
|
62
|
+
export interface ScoreFilter {
|
63
|
+
value?: string;
|
64
|
+
}
|
65
|
+
|
66
|
+
export type SampleMode = "none" | "single" | "many";
|
67
|
+
|
68
|
+
export interface ContentTool {
|
69
|
+
type: "tool";
|
70
|
+
content: (ContentImage | ContentText)[];
|
71
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { TokenHeader, TokenRow, TokenTable } from "./TokenTable";
|
2
|
+
|
3
|
+
interface ModelTokenTable {
|
4
|
+
model_usage: any;
|
5
|
+
className?: string | string[];
|
6
|
+
}
|
7
|
+
|
8
|
+
export const ModelTokenTable: React.FC<ModelTokenTable> = ({
|
9
|
+
model_usage,
|
10
|
+
className,
|
11
|
+
}) => {
|
12
|
+
return (
|
13
|
+
<TokenTable className={className}>
|
14
|
+
<TokenHeader />
|
15
|
+
<tbody>
|
16
|
+
{Object.keys(model_usage).map((key) => {
|
17
|
+
return <TokenRow model={key} usage={model_usage[key]} />;
|
18
|
+
})}
|
19
|
+
</tbody>
|
20
|
+
</TokenTable>
|
21
|
+
);
|
22
|
+
};
|
@@ -0,0 +1,24 @@
|
|
1
|
+
.wrapper {
|
2
|
+
display: grid;
|
3
|
+
grid-template-columns: 0 auto auto;
|
4
|
+
column-gap: 1.5em;
|
5
|
+
row-gap: 0.2em;
|
6
|
+
}
|
7
|
+
|
8
|
+
.col2 {
|
9
|
+
grid-column: 2;
|
10
|
+
}
|
11
|
+
|
12
|
+
.col1_3 {
|
13
|
+
grid-column: 1/3;
|
14
|
+
}
|
15
|
+
|
16
|
+
.col3 {
|
17
|
+
grid-column: 3;
|
18
|
+
}
|
19
|
+
|
20
|
+
.separator {
|
21
|
+
grid-column: -1/1;
|
22
|
+
height: 1px;
|
23
|
+
background-color: var(--bs-light-border-subtle);
|
24
|
+
}
|