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,254 +0,0 @@
|
|
1
|
-
// @ts-check
|
2
|
-
import { html } from "htm/preact";
|
3
|
-
import { ChatView } from "../../../components/ChatView.mjs";
|
4
|
-
import { FontSize, TextStyle } from "../../../appearance/Fonts.mjs";
|
5
|
-
import { HumanBaselineView } from "../../../components/HumanBaselineView.mjs";
|
6
|
-
|
7
|
-
/**
|
8
|
-
* @typedef {Object} Signature
|
9
|
-
* @property {string[]} remove - Array of paths to be removed.
|
10
|
-
* @property {string[]} replace - Array of paths to be replaced.
|
11
|
-
* @property {string[]} add - Array of paths to be added.
|
12
|
-
*/
|
13
|
-
|
14
|
-
/**
|
15
|
-
* @typedef {Object} ChangeType
|
16
|
-
* @property {string} type - Type of the system message.
|
17
|
-
* @property {Signature} signature - Signature of the system message.
|
18
|
-
* @property {function(import("../../../types/log").JsonChange[], Object): import("preact").JSX.Element} render - Function to render the resolved state.
|
19
|
-
*/
|
20
|
-
|
21
|
-
/** @type {ChangeType} */
|
22
|
-
const system_msg_added_sig = {
|
23
|
-
type: "system_message",
|
24
|
-
signature: {
|
25
|
-
remove: ["/messages/0/source"],
|
26
|
-
replace: ["/messages/0/role", "/messages/0/content"],
|
27
|
-
add: ["/messages/1"],
|
28
|
-
},
|
29
|
-
render: (_changes, resolvedState) => {
|
30
|
-
const message = resolvedState["messages"][0];
|
31
|
-
return html`<${ChatView}
|
32
|
-
id="system_msg_event_preview"
|
33
|
-
messages=${[message]}
|
34
|
-
/>`;
|
35
|
-
},
|
36
|
-
};
|
37
|
-
|
38
|
-
const kToolPattern = "/tools/(\\d+)";
|
39
|
-
|
40
|
-
/** @type {ChangeType} */
|
41
|
-
const use_tools = {
|
42
|
-
type: "use_tools",
|
43
|
-
signature: {
|
44
|
-
add: ["/tools/0"],
|
45
|
-
replace: ["/tool_choice"],
|
46
|
-
remove: [],
|
47
|
-
},
|
48
|
-
render: (changes, resolvedState) => {
|
49
|
-
return renderTools(changes, resolvedState);
|
50
|
-
},
|
51
|
-
};
|
52
|
-
|
53
|
-
/** @type {ChangeType} */
|
54
|
-
const add_tools = {
|
55
|
-
type: "add_tools",
|
56
|
-
signature: {
|
57
|
-
add: [kToolPattern],
|
58
|
-
replace: [],
|
59
|
-
remove: [],
|
60
|
-
},
|
61
|
-
render: (changes, resolvedState) => {
|
62
|
-
return renderTools(changes, resolvedState);
|
63
|
-
},
|
64
|
-
};
|
65
|
-
|
66
|
-
const humanAgentKey = (key) => {
|
67
|
-
return `HumanAgentState:${key}`;
|
68
|
-
};
|
69
|
-
const human_baseline_session = {
|
70
|
-
type: "human_baseline_session",
|
71
|
-
signature: {
|
72
|
-
add: ["HumanAgentState:logs"],
|
73
|
-
replace: [],
|
74
|
-
remove: [],
|
75
|
-
},
|
76
|
-
render: (changes, resolvedState) => {
|
77
|
-
// Read the session values
|
78
|
-
const started = resolvedState[humanAgentKey("started_running")];
|
79
|
-
const runtime = resolvedState[humanAgentKey("accumulated_time")];
|
80
|
-
const answer = resolvedState[humanAgentKey("answer")];
|
81
|
-
const completed = !!answer;
|
82
|
-
const running = resolvedState[humanAgentKey("running_state")];
|
83
|
-
const rawSessions = resolvedState[humanAgentKey("logs")];
|
84
|
-
|
85
|
-
// Tweak the date value
|
86
|
-
const startedDate = started ? new Date(started * 1000) : undefined;
|
87
|
-
|
88
|
-
// Convert raw sessions into session logs
|
89
|
-
const sessions = {};
|
90
|
-
if (rawSessions) {
|
91
|
-
for (const key of Object.keys(rawSessions)) {
|
92
|
-
const value = rawSessions[key];
|
93
|
-
// this pulls the key apart into
|
94
|
-
// <user>_<timestamp>.<type>
|
95
|
-
const match = key.match(/(.*)_(\d+_\d+)\.(.*)/);
|
96
|
-
if (match) {
|
97
|
-
const user = match[1];
|
98
|
-
const timestamp = match[2];
|
99
|
-
const type = match[3];
|
100
|
-
sessions[timestamp] = sessions[timestamp] || {};
|
101
|
-
sessions[timestamp][type] = value;
|
102
|
-
sessions[timestamp]["user"] = user;
|
103
|
-
}
|
104
|
-
}
|
105
|
-
}
|
106
|
-
|
107
|
-
return html`<${HumanBaselineView}
|
108
|
-
started=${startedDate}
|
109
|
-
running=${running}
|
110
|
-
completed=${completed}
|
111
|
-
answer=${answer}
|
112
|
-
runtime=${runtime}
|
113
|
-
sessionLogs=${Object.values(sessions)}
|
114
|
-
/>`;
|
115
|
-
},
|
116
|
-
};
|
117
|
-
|
118
|
-
const renderTools = (changes, resolvedState) => {
|
119
|
-
// Find which tools were added in this change
|
120
|
-
const toolIndexes = [];
|
121
|
-
for (const change of changes) {
|
122
|
-
const match = change.path.match(kToolPattern);
|
123
|
-
if (match) {
|
124
|
-
toolIndexes.push(match[1]);
|
125
|
-
}
|
126
|
-
}
|
127
|
-
|
128
|
-
const toolName = (toolChoice) => {
|
129
|
-
if (typeof toolChoice === "object" && toolChoice) {
|
130
|
-
return toolChoice["name"];
|
131
|
-
} else {
|
132
|
-
return toolChoice;
|
133
|
-
}
|
134
|
-
};
|
135
|
-
|
136
|
-
const toolsInfo = {};
|
137
|
-
|
138
|
-
// Show tool choice if it was changed
|
139
|
-
const hasToolChoice = changes.find((change) => {
|
140
|
-
return change.path.startsWith("/tool_choice");
|
141
|
-
});
|
142
|
-
if (resolvedState.tool_choice && hasToolChoice) {
|
143
|
-
toolsInfo["Tool Choice"] = toolName(resolvedState.tool_choice);
|
144
|
-
}
|
145
|
-
|
146
|
-
// Show either all tools or just the specific tools
|
147
|
-
if (resolvedState.tools.length > 0) {
|
148
|
-
if (toolIndexes.length === 0) {
|
149
|
-
toolsInfo["Tools"] = html`<${Tools}
|
150
|
-
toolDefinitions=${resolvedState.tools}
|
151
|
-
/>`;
|
152
|
-
} else {
|
153
|
-
const filtered = resolvedState.tools.filter((_, index) => {
|
154
|
-
return toolIndexes.includes(index.toString());
|
155
|
-
});
|
156
|
-
toolsInfo["Tools"] = html`<${Tools} toolDefinitions=${filtered} />`;
|
157
|
-
}
|
158
|
-
}
|
159
|
-
|
160
|
-
return html`
|
161
|
-
<div
|
162
|
-
style=${{
|
163
|
-
display: "grid",
|
164
|
-
gridTemplateColumns: "max-content max-content",
|
165
|
-
columnGap: "1rem",
|
166
|
-
margin: "0",
|
167
|
-
}}
|
168
|
-
>
|
169
|
-
${Object.keys(toolsInfo).map((key) => {
|
170
|
-
return html` <div
|
171
|
-
style=${{
|
172
|
-
fontSize: FontSize.smaller,
|
173
|
-
...TextStyle.label,
|
174
|
-
...TextStyle.secondary,
|
175
|
-
}}
|
176
|
-
>
|
177
|
-
${key}
|
178
|
-
</div>
|
179
|
-
<div style=${{ fontSize: FontSize.base }}>${toolsInfo[key]}</div>`;
|
180
|
-
})}
|
181
|
-
</div>
|
182
|
-
`;
|
183
|
-
};
|
184
|
-
|
185
|
-
/** @type {ChangeType[]} */
|
186
|
-
export const RenderableChangeTypes = [
|
187
|
-
system_msg_added_sig,
|
188
|
-
use_tools,
|
189
|
-
add_tools,
|
190
|
-
];
|
191
|
-
|
192
|
-
/** @type {ChangeType[]} */
|
193
|
-
export const StoreSpecificRenderableTypes = [human_baseline_session];
|
194
|
-
|
195
|
-
/**
|
196
|
-
* @typedef {Object} ToolParameters
|
197
|
-
* @property {string} type - The type of the parameters object, typically "object".
|
198
|
-
* @property {Object} properties - An object describing the properties of the parameters.
|
199
|
-
* @property {ToolProperty} properties.code - The code property, which is a string.
|
200
|
-
* @property {string[]} required - An array of required property names.
|
201
|
-
*/
|
202
|
-
|
203
|
-
/**
|
204
|
-
* @typedef {Object} ToolProperty
|
205
|
-
* @property {string} type - The data type of the property (e.g., "string").
|
206
|
-
* @property {string} description - A description of the property.
|
207
|
-
*/
|
208
|
-
|
209
|
-
/**
|
210
|
-
* @typedef {Object} ToolDefinition
|
211
|
-
* @property {string} name - The name of the tool (e.g., "python").
|
212
|
-
* @property {string} description - A brief description of what the tool does.
|
213
|
-
* @property {ToolParameters} [parameters] - An object describing the parameters that the tool accepts.
|
214
|
-
*/
|
215
|
-
|
216
|
-
/**
|
217
|
-
* Renders a list of tool components based on the provided tool definitions.
|
218
|
-
*
|
219
|
-
* @param {Object} props - The component props.
|
220
|
-
* @param {ToolDefinition[]} props.toolDefinitions - An array of tool definition objects, each containing the function name and arguments.
|
221
|
-
*
|
222
|
-
* @returns {import("preact").JSX.Element[]} An array of JSX elements representing the tools.
|
223
|
-
*/
|
224
|
-
export const Tools = ({ toolDefinitions }) => {
|
225
|
-
return toolDefinitions.map((toolDefinition) => {
|
226
|
-
const toolName = toolDefinition.name;
|
227
|
-
const toolArgs = toolDefinition.parameters?.properties
|
228
|
-
? Object.keys(toolDefinition.parameters.properties)
|
229
|
-
: [];
|
230
|
-
return html`<${Tool} toolName=${toolName} toolArgs=${toolArgs} />`;
|
231
|
-
});
|
232
|
-
};
|
233
|
-
|
234
|
-
/**
|
235
|
-
* Renders a single tool component.
|
236
|
-
*
|
237
|
-
* @param {Object} props - The component props.
|
238
|
-
* @param {string} props.toolName - The name of the tool to be displayed.
|
239
|
-
* @param {string[]} [props.toolArgs] - An optional array of arguments for the tool (not used in the current implementation).
|
240
|
-
* @param {string} [props.toolDesc] - An optional description of the tool (not used in the current implementation).
|
241
|
-
*
|
242
|
-
* @returns {import("preact").JSX.Element} A JSX element representing the tool.
|
243
|
-
*/
|
244
|
-
export const Tool = ({ toolName, toolArgs }) => {
|
245
|
-
const functionCall =
|
246
|
-
toolArgs && toolArgs.length > 0
|
247
|
-
? `${toolName}(${toolArgs.join(", ")})`
|
248
|
-
: toolName;
|
249
|
-
return html`<div>
|
250
|
-
<code style=${{ fontSize: FontSize.small, padding: "0" }}
|
251
|
-
>${functionCall}</code
|
252
|
-
>
|
253
|
-
</div>`;
|
254
|
-
};
|
@@ -1,418 +0,0 @@
|
|
1
|
-
import { html } from "htm/preact";
|
2
|
-
|
3
|
-
import { ApplicationIcons } from "./../appearance/Icons.mjs";
|
4
|
-
import { FontSize, TextStyle } from "../appearance/Fonts.mjs";
|
5
|
-
import { formatPrettyDecimal } from "../utils/Format.mjs";
|
6
|
-
import { ProgressBar } from "../components/ProgressBar.mjs";
|
7
|
-
import { ApplicationStyles } from "../appearance/Styles.mjs";
|
8
|
-
|
9
|
-
export const Sidebar = ({
|
10
|
-
offcanvas,
|
11
|
-
logs,
|
12
|
-
loading,
|
13
|
-
logHeaders,
|
14
|
-
selectedIndex,
|
15
|
-
onSelectedIndexChanged,
|
16
|
-
}) => {
|
17
|
-
const btnOffCanClass = offcanvas ? "" : " d-md-none";
|
18
|
-
const sidebarOffCanClass = offcanvas ? " offcanvas" : " offcanvas-md";
|
19
|
-
|
20
|
-
return html`
|
21
|
-
<div
|
22
|
-
class="sidebar border-end offcanvas-start${sidebarOffCanClass}"
|
23
|
-
id="sidebarOffCanvas"
|
24
|
-
style=${{ display: "flex", flexDirection: "column", height: "100%" }}
|
25
|
-
>
|
26
|
-
<div
|
27
|
-
style=${{
|
28
|
-
display: "grid",
|
29
|
-
gridTemplateColumns: "minmax(0, 1fr) auto",
|
30
|
-
columnGap: "0.2rem",
|
31
|
-
alignItems: "center",
|
32
|
-
paddingLeft: "0.5rem",
|
33
|
-
opacity: "0.7",
|
34
|
-
position: "fixed",
|
35
|
-
width: "var(--sidebar-width)",
|
36
|
-
zIndex: 10,
|
37
|
-
borderBottom: "solid var(--bs-light-border-subtle) 1px",
|
38
|
-
paddingBottom: "0.5rem",
|
39
|
-
paddingTop: "0.5rem",
|
40
|
-
height: "3.6em",
|
41
|
-
}}
|
42
|
-
>
|
43
|
-
<${LogDirectoryTitle} log_dir=${logs.log_dir} offcanvas=${offcanvas} />
|
44
|
-
<button
|
45
|
-
id="sidebarToggle"
|
46
|
-
class="btn d-inline${btnOffCanClass}"
|
47
|
-
type="button"
|
48
|
-
data-bs-toggle="offcanvas"
|
49
|
-
data-bs-target="#sidebarOffCanvas"
|
50
|
-
aria-controls="sidebarOffCanvas"
|
51
|
-
style=${{
|
52
|
-
padding: ".1rem",
|
53
|
-
alignSelf: "end",
|
54
|
-
width: "40px",
|
55
|
-
flex: "0 0 content",
|
56
|
-
}}
|
57
|
-
>
|
58
|
-
<i class=${ApplicationIcons.close}></i>
|
59
|
-
</button>
|
60
|
-
</div>
|
61
|
-
<div style=${{ marginTop: "3.6em", zIndex: 3 }}>
|
62
|
-
<${ProgressBar} animating=${loading} style=${{ marginTop: "-2px" }} />
|
63
|
-
</div>
|
64
|
-
<ul
|
65
|
-
class="list-group"
|
66
|
-
style=${{ flexGrow: 1, overflowY: "auto", marginTop: "-3px" }}
|
67
|
-
>
|
68
|
-
${logs.files.map((file, index) => {
|
69
|
-
const active = index === selectedIndex ? " active" : "";
|
70
|
-
const logHeader = logHeaders[file.name];
|
71
|
-
const hyperparameters = logHeader
|
72
|
-
? {
|
73
|
-
...logHeader.plan?.config,
|
74
|
-
...logHeader.eval?.task_args,
|
75
|
-
}
|
76
|
-
: undefined;
|
77
|
-
|
78
|
-
const model = logHeader?.eval?.model;
|
79
|
-
const dataset = logHeader?.eval?.dataset;
|
80
|
-
|
81
|
-
const uniqScorers = new Set();
|
82
|
-
logHeader?.results?.scores?.forEach((scorer) => {
|
83
|
-
uniqScorers.add(scorer.name);
|
84
|
-
});
|
85
|
-
const scorer = Array.from(uniqScorers).join(",");
|
86
|
-
|
87
|
-
const scorerLabel =
|
88
|
-
Object.keys(logHeader?.results?.scores || {}).length === 1
|
89
|
-
? "scorer"
|
90
|
-
: "scorers";
|
91
|
-
|
92
|
-
const completed = logHeader?.stats?.completed_at;
|
93
|
-
const time = completed ? new Date(completed) : undefined;
|
94
|
-
const timeStr = time
|
95
|
-
? `${time.toDateString()}
|
96
|
-
${time.toLocaleTimeString([], {
|
97
|
-
hour: "2-digit",
|
98
|
-
minute: "2-digit",
|
99
|
-
})}`
|
100
|
-
: "";
|
101
|
-
|
102
|
-
return html`
|
103
|
-
<li
|
104
|
-
class="list-group-item list-group-item-action${active}"
|
105
|
-
onclick=${() => onSelectedIndexChanged(index)}
|
106
|
-
>
|
107
|
-
<div
|
108
|
-
style=${{
|
109
|
-
display: "flex",
|
110
|
-
flexDirection: "row",
|
111
|
-
justifyContent: "space-between",
|
112
|
-
}}
|
113
|
-
>
|
114
|
-
<div style=${{ overflow: "hidden" }}>
|
115
|
-
<div
|
116
|
-
style=${{
|
117
|
-
fontSize: FontSize["title-secondary"],
|
118
|
-
whiteSpace: "nowrap",
|
119
|
-
overflow: "hidden",
|
120
|
-
textOverflow: "ellipsis",
|
121
|
-
}}
|
122
|
-
>
|
123
|
-
${logHeader?.eval?.task || file.task}
|
124
|
-
</div>
|
125
|
-
<small class="mb-1" style=${{ fontSize: FontSize.small }}>
|
126
|
-
${timeStr}
|
127
|
-
</small>
|
128
|
-
|
129
|
-
${model
|
130
|
-
? html` <div>
|
131
|
-
<small
|
132
|
-
class="mb-1"
|
133
|
-
style=${{ fontSize: FontSize.small }}
|
134
|
-
>${model}</small
|
135
|
-
>
|
136
|
-
</div>`
|
137
|
-
: ""}
|
138
|
-
</div>
|
139
|
-
<${EvalStatus} logHeader=${logHeader} />
|
140
|
-
</div>
|
141
|
-
<div
|
142
|
-
style=${{
|
143
|
-
marginTop: "1em",
|
144
|
-
...ApplicationStyles.threeLineClamp,
|
145
|
-
}}
|
146
|
-
>
|
147
|
-
<small class="mb-1">
|
148
|
-
${hyperparameters
|
149
|
-
? Object.keys(hyperparameters)
|
150
|
-
.map((key) => {
|
151
|
-
const val = hyperparameters[key];
|
152
|
-
if (Array.isArray(val) || typeof val === "object") {
|
153
|
-
return `${key}: ${JSON.stringify(val)}`;
|
154
|
-
} else {
|
155
|
-
return `${key}: ${val}`;
|
156
|
-
}
|
157
|
-
})
|
158
|
-
.join(", ")
|
159
|
-
: ""}
|
160
|
-
</small>
|
161
|
-
</div>
|
162
|
-
${(dataset || scorer) && logHeader?.status === "success"
|
163
|
-
? html`<div
|
164
|
-
style=${{
|
165
|
-
display: "flex",
|
166
|
-
justifyContent: "space-between",
|
167
|
-
marginTop: "0em",
|
168
|
-
fontSize: FontSize.small,
|
169
|
-
}}
|
170
|
-
>
|
171
|
-
<span>dataset: ${dataset.name || "(samples)"}</span
|
172
|
-
><span>${scorerLabel}: ${scorer}</span>
|
173
|
-
</div>`
|
174
|
-
: ""}
|
175
|
-
</li>
|
176
|
-
`;
|
177
|
-
})}
|
178
|
-
</ul>
|
179
|
-
</div>
|
180
|
-
`;
|
181
|
-
};
|
182
|
-
|
183
|
-
const prettyDir = (path) => {
|
184
|
-
try {
|
185
|
-
// Try to create a new URL object
|
186
|
-
let url = new URL(path);
|
187
|
-
|
188
|
-
if (url.protocol === "file:") {
|
189
|
-
return url.pathname;
|
190
|
-
} else {
|
191
|
-
return path;
|
192
|
-
}
|
193
|
-
} catch {
|
194
|
-
return path;
|
195
|
-
}
|
196
|
-
};
|
197
|
-
|
198
|
-
const EvalStatus = ({ logHeader }) => {
|
199
|
-
switch (logHeader?.status) {
|
200
|
-
case "error":
|
201
|
-
return html`<${StatusError} message="Error" />`;
|
202
|
-
|
203
|
-
case "cancelled":
|
204
|
-
return html`<${StatusCancelled} message="Cancelled" />`;
|
205
|
-
|
206
|
-
case "started":
|
207
|
-
return html`<${StatusRunning} message="Running" />`;
|
208
|
-
|
209
|
-
default:
|
210
|
-
if (logHeader?.results?.scores && logHeader.results?.scores.length > 0) {
|
211
|
-
if (logHeader.results.scores.length === 1) {
|
212
|
-
return html`<${SidebarScore}
|
213
|
-
scorer=${logHeader.results.scores[0]}
|
214
|
-
/>`;
|
215
|
-
} else {
|
216
|
-
return html`<${SidebarScores} scores=${logHeader.results.scores} />`;
|
217
|
-
}
|
218
|
-
} else {
|
219
|
-
return "";
|
220
|
-
}
|
221
|
-
}
|
222
|
-
};
|
223
|
-
|
224
|
-
const SidebarScore = ({ scorer }) => {
|
225
|
-
return html`<div
|
226
|
-
style=${{
|
227
|
-
display: "flex",
|
228
|
-
flexDirection: "row",
|
229
|
-
flexWrap: "wrap",
|
230
|
-
justifyContent: "flex-end",
|
231
|
-
}}
|
232
|
-
>
|
233
|
-
${Object.keys(scorer.metrics).map((metric) => {
|
234
|
-
return html`
|
235
|
-
<div
|
236
|
-
style=${{
|
237
|
-
display: "flex",
|
238
|
-
flexDirection: "column",
|
239
|
-
alignItems: "flex-end",
|
240
|
-
marginLeft: "1em",
|
241
|
-
marginBottom: "0.4em",
|
242
|
-
marginTop: "0.5rem",
|
243
|
-
}}
|
244
|
-
>
|
245
|
-
<div
|
246
|
-
style=${{
|
247
|
-
marginBottom: "-0.3em",
|
248
|
-
fontSize: FontSize.small,
|
249
|
-
...TextStyle.label,
|
250
|
-
...TextStyle.secondary,
|
251
|
-
}}
|
252
|
-
>
|
253
|
-
${scorer.metrics[metric].name}
|
254
|
-
</div>
|
255
|
-
${scorer.reducer
|
256
|
-
? html`<div
|
257
|
-
style=${{
|
258
|
-
fontSize: FontSize.small,
|
259
|
-
marginBottom: "-0.2rem",
|
260
|
-
}}
|
261
|
-
>
|
262
|
-
${scorer.reducer}
|
263
|
-
</div>`
|
264
|
-
: ""}
|
265
|
-
<div style=${{ fontSize: FontSize["title-secondary"] }}>
|
266
|
-
${formatPrettyDecimal(scorer.metrics[metric].value)}
|
267
|
-
</div>
|
268
|
-
</div>
|
269
|
-
`;
|
270
|
-
})}
|
271
|
-
</div>`;
|
272
|
-
};
|
273
|
-
|
274
|
-
const SidebarScores = ({ scores }) => {
|
275
|
-
return html`<div
|
276
|
-
style=${{
|
277
|
-
display: "flex",
|
278
|
-
flexDirection: "row",
|
279
|
-
flexWrap: "wrap",
|
280
|
-
justifyContent: "flex-end",
|
281
|
-
rowGap: "1em",
|
282
|
-
}}
|
283
|
-
>
|
284
|
-
${scores.map((score) => {
|
285
|
-
const name = score.name;
|
286
|
-
const reducer = score.reducer;
|
287
|
-
return html`
|
288
|
-
<div
|
289
|
-
style=${{
|
290
|
-
display: "flex",
|
291
|
-
flexDirection: "column",
|
292
|
-
alignItems: "center",
|
293
|
-
marginLeft: "1em",
|
294
|
-
}}
|
295
|
-
>
|
296
|
-
<div
|
297
|
-
style=${{
|
298
|
-
fontSize: FontSize.base,
|
299
|
-
width: "100%",
|
300
|
-
fontWeight: 300,
|
301
|
-
borderBottom: "solid var(--bs-border-color) 1px",
|
302
|
-
...TextStyle.label,
|
303
|
-
...TextStyle.secondary,
|
304
|
-
}}
|
305
|
-
>
|
306
|
-
${name}
|
307
|
-
</div>
|
308
|
-
${reducer
|
309
|
-
? html` <div
|
310
|
-
style=${{
|
311
|
-
fontSize: FontSize.smaller,
|
312
|
-
width: "100%",
|
313
|
-
fontWeight: 300,
|
314
|
-
}}
|
315
|
-
>
|
316
|
-
${reducer}
|
317
|
-
</div>`
|
318
|
-
: ""}
|
319
|
-
<div
|
320
|
-
style=${{
|
321
|
-
fontSize: FontSize.smaller,
|
322
|
-
display: "grid",
|
323
|
-
gridTemplateColumns: "max-content max-content",
|
324
|
-
gridGap: "0 0.3rem",
|
325
|
-
}}
|
326
|
-
>
|
327
|
-
${Object.keys(score.metrics).map((key) => {
|
328
|
-
const metric = score.metrics[key];
|
329
|
-
return html` <div
|
330
|
-
style=${{ ...TextStyle.label, ...TextStyle.secondary }}
|
331
|
-
>
|
332
|
-
${metric.name}
|
333
|
-
</div>
|
334
|
-
<div style=${{ fontWeight: "600" }}>
|
335
|
-
${formatPrettyDecimal(metric.value)}
|
336
|
-
</div>`;
|
337
|
-
})}
|
338
|
-
</div>
|
339
|
-
</div>
|
340
|
-
`;
|
341
|
-
})}
|
342
|
-
</div>`;
|
343
|
-
};
|
344
|
-
|
345
|
-
const StatusCancelled = ({ message }) => {
|
346
|
-
return html`<div
|
347
|
-
style=${{
|
348
|
-
marginTop: "0.2em",
|
349
|
-
fontSize: FontSize.small,
|
350
|
-
...TextStyle.label,
|
351
|
-
...TextStyle.secondary,
|
352
|
-
}}
|
353
|
-
>
|
354
|
-
${message}
|
355
|
-
</div>`;
|
356
|
-
};
|
357
|
-
|
358
|
-
const StatusRunning = ({ message }) => {
|
359
|
-
return html` <div
|
360
|
-
style=${{
|
361
|
-
display: "grid",
|
362
|
-
gridTemplateColumns: "max-content max-content",
|
363
|
-
columnGap: "0.5em",
|
364
|
-
marginTop: "0.3em",
|
365
|
-
fontSize: FontSize.small,
|
366
|
-
...TextStyle.secondary,
|
367
|
-
...TextStyle.label,
|
368
|
-
}}
|
369
|
-
>
|
370
|
-
<div>${message}</div>
|
371
|
-
</div>`;
|
372
|
-
};
|
373
|
-
|
374
|
-
const StatusError = ({ message }) => {
|
375
|
-
return html`<div
|
376
|
-
style=${{
|
377
|
-
color: "var(--bs-danger)",
|
378
|
-
marginTop: "0.2em",
|
379
|
-
fontSize: FontSize.small,
|
380
|
-
...TextStyle.label,
|
381
|
-
}}
|
382
|
-
>
|
383
|
-
${message}
|
384
|
-
</div>`;
|
385
|
-
};
|
386
|
-
|
387
|
-
const LogDirectoryTitle = ({ log_dir, offcanvas }) => {
|
388
|
-
if (log_dir) {
|
389
|
-
const displayDir = prettyDir(log_dir);
|
390
|
-
return html`<div style=${{ display: "flex", flexDirection: "column" }}>
|
391
|
-
<span
|
392
|
-
style=${{
|
393
|
-
fontSize: FontSize.smaller,
|
394
|
-
...TextStyle.label,
|
395
|
-
...TextStyle.secondary,
|
396
|
-
}}
|
397
|
-
>Log Directory</span
|
398
|
-
>
|
399
|
-
<span
|
400
|
-
title=${displayDir}
|
401
|
-
style=${{
|
402
|
-
fontSize: FontSize.base,
|
403
|
-
overflow: "hidden",
|
404
|
-
whiteSpace: "nowrap",
|
405
|
-
textOverflow: "ellipsis",
|
406
|
-
}}
|
407
|
-
>${offcanvas ? displayDir : ""}</span
|
408
|
-
>
|
409
|
-
</div>`;
|
410
|
-
} else {
|
411
|
-
return html`<span
|
412
|
-
style=${{
|
413
|
-
fontSize: FontSize.title,
|
414
|
-
}}
|
415
|
-
>${offcanvas ? "Log History" : ""}
|
416
|
-
</span>`;
|
417
|
-
}
|
418
|
-
};
|