inspect-ai 0.3.62__py3-none-any.whl → 0.3.64__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/cache.py +8 -7
- inspect_ai/_cli/common.py +0 -12
- inspect_ai/_cli/eval.py +32 -4
- inspect_ai/_cli/info.py +1 -0
- inspect_ai/_cli/list.py +1 -1
- inspect_ai/_cli/log.py +2 -0
- inspect_ai/_cli/main.py +1 -1
- inspect_ai/_cli/sandbox.py +4 -1
- inspect_ai/_cli/score.py +181 -32
- inspect_ai/_cli/trace.py +10 -0
- inspect_ai/_cli/view.py +4 -2
- inspect_ai/_display/core/active.py +2 -3
- inspect_ai/_display/core/config.py +7 -1
- inspect_ai/_display/textual/widgets/samples.py +4 -3
- inspect_ai/_display/textual/widgets/sandbox.py +6 -0
- inspect_ai/_eval/eval.py +104 -101
- inspect_ai/_eval/evalset.py +75 -75
- inspect_ai/_eval/loader.py +122 -12
- inspect_ai/_eval/registry.py +1 -1
- inspect_ai/_eval/run.py +14 -0
- inspect_ai/_eval/score.py +125 -36
- inspect_ai/_eval/task/log.py +105 -4
- inspect_ai/_eval/task/results.py +92 -38
- inspect_ai/_eval/task/run.py +9 -2
- inspect_ai/_eval/task/sandbox.py +35 -2
- inspect_ai/_eval/task/task.py +49 -46
- inspect_ai/_util/constants.py +1 -1
- inspect_ai/_util/content.py +8 -0
- inspect_ai/_util/error.py +2 -0
- inspect_ai/_util/file.py +15 -1
- inspect_ai/_util/hash.py +1 -1
- inspect_ai/_util/logger.py +4 -2
- inspect_ai/_util/registry.py +7 -1
- inspect_ai/_view/view.py +1 -2
- inspect_ai/_view/www/.vscode/extensions.json +3 -0
- inspect_ai/_view/www/.vscode/settings.json +8 -0
- inspect_ai/_view/www/App.css +97 -29
- inspect_ai/_view/www/README.md +1 -1
- inspect_ai/_view/www/dist/assets/index.css +16663 -14674
- inspect_ai/_view/www/dist/assets/index.js +58808 -51348
- inspect_ai/_view/www/dist/index.html +1 -1
- inspect_ai/_view/www/index.html +2 -2
- inspect_ai/_view/www/log-schema.json +87 -73
- 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} +356 -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 +189 -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.css +0 -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 +101 -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 +215 -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 -8
- 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 +324 -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 +331 -0
- inspect_ai/_view/www/src/samples/SampleSummaryView.module.css +24 -0
- inspect_ai/_view/www/src/samples/SampleSummaryView.tsx +177 -0
- inspect_ai/_view/www/src/samples/SamplesTools.tsx +52 -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 +47 -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 +157 -0
- inspect_ai/_view/www/src/samples/chat/MessageContents.module.css +3 -0
- inspect_ai/_view/www/src/samples/chat/MessageContents.tsx +133 -0
- inspect_ai/_view/www/src/samples/chat/messages.ts +112 -0
- inspect_ai/_view/www/src/samples/chat/tools/ToolCallView.tsx +147 -0
- inspect_ai/_view/www/src/samples/chat/tools/ToolInput.module.css +14 -0
- inspect_ai/_view/www/src/samples/chat/tools/ToolInput.tsx +76 -0
- inspect_ai/_view/www/src/samples/chat/tools/ToolOutput.module.css +19 -0
- inspect_ai/_view/www/src/samples/chat/tools/ToolOutput.tsx +60 -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 +92 -0
- inspect_ai/_view/www/src/samples/descriptor/samplesDescriptor.tsx +365 -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 +175 -0
- inspect_ai/_view/www/src/samples/sample-tools/SortFilter.module.css +9 -0
- inspect_ai/_view/www/src/samples/sample-tools/SortFilter.tsx +186 -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 +112 -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 +92 -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 +39 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventPanel.module.css +25 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventPanel.tsx +191 -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 +285 -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.tsx +346 -0
- inspect_ai/_view/www/src/samples/transcript/types.ts +58 -0
- inspect_ai/_view/www/src/types/log.d.ts +108 -19
- 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 +28 -0
- inspect_ai/_view/www/src/usage/ModelUsagePanel.module.css +24 -0
- inspect_ai/_view/www/src/usage/ModelUsagePanel.tsx +97 -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 +158 -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 +114 -0
- inspect_ai/_view/www/src/workspace/navbar/ResultsPanel.module.css +90 -0
- inspect_ai/_view/www/src/workspace/navbar/ResultsPanel.tsx +180 -0
- inspect_ai/_view/www/src/workspace/navbar/SecondaryBar.module.css +28 -0
- inspect_ai/_view/www/src/workspace/navbar/SecondaryBar.tsx +226 -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 +43 -0
- inspect_ai/_view/www/src/workspace/sidebar/SidebarScoresView.module.css +35 -0
- inspect_ai/_view/www/src/workspace/sidebar/SidebarScoresView.tsx +63 -0
- inspect_ai/_view/www/src/workspace/tabs/InfoTab.module.css +0 -0
- inspect_ai/_view/www/src/workspace/tabs/InfoTab.tsx +70 -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/src/workspace/utils.ts +34 -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/approval/_approval.py +2 -0
- inspect_ai/approval/_approver.py +4 -4
- inspect_ai/approval/_auto.py +1 -1
- inspect_ai/approval/_human/approver.py +3 -0
- inspect_ai/approval/_policy.py +5 -0
- inspect_ai/approval/_registry.py +2 -2
- inspect_ai/dataset/_dataset.py +64 -37
- inspect_ai/dataset/_sources/__init__.py +0 -0
- inspect_ai/dataset/_sources/csv.py +20 -12
- inspect_ai/dataset/_sources/file.py +4 -0
- inspect_ai/dataset/_sources/hf.py +39 -29
- inspect_ai/dataset/_sources/json.py +17 -9
- inspect_ai/log/__init__.py +2 -0
- inspect_ai/log/_convert.py +3 -3
- inspect_ai/log/_file.py +24 -9
- inspect_ai/log/_log.py +101 -13
- inspect_ai/log/_message.py +4 -2
- inspect_ai/log/_recorders/file.py +4 -0
- inspect_ai/log/_recorders/json.py +5 -7
- inspect_ai/log/_recorders/recorder.py +3 -0
- inspect_ai/log/_transcript.py +19 -8
- inspect_ai/model/__init__.py +2 -0
- inspect_ai/model/_cache.py +39 -21
- inspect_ai/model/_call_tools.py +4 -3
- inspect_ai/model/_chat_message.py +14 -4
- inspect_ai/model/_generate_config.py +1 -1
- inspect_ai/model/_model.py +31 -24
- inspect_ai/model/_model_output.py +14 -1
- inspect_ai/model/_openai.py +10 -18
- inspect_ai/model/_providers/anthropic.py +3 -3
- inspect_ai/model/_providers/google.py +9 -5
- inspect_ai/model/_providers/openai.py +5 -9
- 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/__init__.py +6 -1
- inspect_ai/scorer/_answer.py +7 -7
- inspect_ai/scorer/_classification.py +38 -18
- inspect_ai/scorer/_common.py +2 -8
- inspect_ai/scorer/_match.py +4 -5
- inspect_ai/scorer/_metric.py +87 -28
- inspect_ai/scorer/_metrics/__init__.py +3 -3
- inspect_ai/scorer/_metrics/accuracy.py +8 -10
- inspect_ai/scorer/_metrics/mean.py +3 -17
- inspect_ai/scorer/_metrics/std.py +111 -30
- inspect_ai/scorer/_model.py +12 -12
- inspect_ai/scorer/_pattern.py +3 -3
- inspect_ai/scorer/_reducer/reducer.py +36 -21
- inspect_ai/scorer/_reducer/registry.py +2 -2
- inspect_ai/scorer/_reducer/types.py +7 -1
- inspect_ai/scorer/_score.py +11 -1
- inspect_ai/scorer/_scorer.py +110 -16
- inspect_ai/solver/__init__.py +1 -1
- inspect_ai/solver/_basic_agent.py +19 -22
- inspect_ai/solver/_bridge/__init__.py +0 -3
- inspect_ai/solver/_bridge/bridge.py +3 -3
- inspect_ai/solver/_chain.py +1 -2
- inspect_ai/solver/_critique.py +3 -3
- inspect_ai/solver/_fork.py +2 -2
- inspect_ai/solver/_human_agent/__init__.py +0 -0
- inspect_ai/solver/_human_agent/agent.py +5 -8
- inspect_ai/solver/_human_agent/commands/clock.py +14 -10
- inspect_ai/solver/_human_agent/commands/note.py +1 -1
- inspect_ai/solver/_human_agent/commands/score.py +0 -11
- inspect_ai/solver/_multiple_choice.py +38 -26
- inspect_ai/solver/_prompt.py +7 -7
- inspect_ai/solver/_solver.py +53 -52
- inspect_ai/solver/_task_state.py +80 -69
- inspect_ai/solver/_use_tools.py +9 -9
- inspect_ai/tool/__init__.py +4 -1
- inspect_ai/tool/_tool.py +43 -14
- inspect_ai/tool/_tool_call.py +6 -2
- inspect_ai/tool/_tool_choice.py +3 -1
- inspect_ai/tool/_tool_def.py +10 -8
- inspect_ai/tool/_tool_params.py +24 -0
- inspect_ai/tool/_tool_with.py +7 -7
- inspect_ai/tool/_tools/__init__.py +0 -0
- inspect_ai/tool/{beta → _tools}/_computer/_common.py +2 -2
- inspect_ai/tool/{beta → _tools}/_computer/_computer.py +13 -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 +23 -11
- inspect_ai/tool/_tools/_web_browser/_resources/README.md +2 -2
- inspect_ai/tool/_tools/_web_browser/_web_browser.py +5 -3
- inspect_ai/tool/_tools/_web_search.py +7 -5
- inspect_ai/tool/beta.py +3 -0
- inspect_ai/util/_concurrency.py +3 -3
- inspect_ai/util/_panel.py +2 -0
- inspect_ai/util/_resource.py +12 -12
- inspect_ai/util/_sandbox/docker/compose.py +23 -20
- inspect_ai/util/_sandbox/docker/config.py +2 -1
- inspect_ai/util/_sandbox/docker/docker.py +42 -86
- inspect_ai/util/_sandbox/docker/service.py +100 -0
- inspect_ai/util/_sandbox/environment.py +99 -96
- inspect_ai/util/_sandbox/self_check.py +124 -16
- inspect_ai/util/_subprocess.py +5 -3
- inspect_ai/util/_subtask.py +15 -16
- {inspect_ai-0.3.62.dist-info → inspect_ai-0.3.64.dist-info}/LICENSE +1 -1
- {inspect_ai-0.3.62.dist-info → inspect_ai-0.3.64.dist-info}/METADATA +11 -6
- inspect_ai-0.3.64.dist-info/RECORD +625 -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/samples/transcript/state/StateEventView.mjs +0 -313
- 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 → _eval}/__init__.py +0 -0
- /inspect_ai/{tool/beta/_computer/_resources/tool/requirements.txt → _util/__init__.py} +0 -0
- /inspect_ai/_view/www/src/{constants.mjs → constants.ts} +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/__init__.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.64.dist-info}/WHEEL +0 -0
- {inspect_ai-0.3.62.dist-info → inspect_ai-0.3.64.dist-info}/entry_points.txt +0 -0
- {inspect_ai-0.3.62.dist-info → inspect_ai-0.3.64.dist-info}/top_level.txt +0 -0
@@ -1,38 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @typedef {Object} Capabilities
|
3
|
-
* @property {boolean} downloadFiles
|
4
|
-
* @property {boolean} webWorkers
|
5
|
-
*/
|
6
|
-
|
7
|
-
/**
|
8
|
-
* @typedef {Object} CurrentLog
|
9
|
-
* @property {string} name
|
10
|
-
* @property {import("./api/Types.ts").EvalSummary} contents
|
11
|
-
*/
|
12
|
-
|
13
|
-
/**
|
14
|
-
* @typedef {Object} Logs
|
15
|
-
* @property {string} log_dir
|
16
|
-
* @property {string[]} files
|
17
|
-
*/
|
18
|
-
|
19
|
-
/**
|
20
|
-
* @typedef {Object} ScoreLabel
|
21
|
-
* @property {string} name
|
22
|
-
* @property {string} scorer
|
23
|
-
*/
|
24
|
-
|
25
|
-
/**
|
26
|
-
* @typedef {Object} ScoreFilter
|
27
|
-
* @property {string} [value]
|
28
|
-
*/
|
29
|
-
|
30
|
-
/**
|
31
|
-
* @typedef {"none" | "single" | "many"} SampleMode
|
32
|
-
*/
|
33
|
-
|
34
|
-
/**
|
35
|
-
* @typedef {Object} ContentTool
|
36
|
-
* @property {"tool"} type
|
37
|
-
* @property {(import("./types/log").ContentImage | import("./types/log").ContentText)[]} content
|
38
|
-
*/
|
@@ -1,27 +0,0 @@
|
|
1
|
-
// @ts-check
|
2
|
-
/**
|
3
|
-
* Provides centralized repository of colors used for logging.
|
4
|
-
* @typedef {Object} LoggingColors
|
5
|
-
* @property {string} debug - Color for debug level logging.
|
6
|
-
* @property {string} info - Color for info level logging.
|
7
|
-
* @property {string} warning - Color for warning level logging.
|
8
|
-
* @property {string} error - Color for error level logging.
|
9
|
-
* @property {string} critical - Color for critical level logging.
|
10
|
-
*/
|
11
|
-
|
12
|
-
/**
|
13
|
-
* Provides centralized repository of colors.
|
14
|
-
* @typedef {Object} Colors
|
15
|
-
* @property {LoggingColors} logging - Colors used for different logging levels.
|
16
|
-
*/
|
17
|
-
|
18
|
-
/** @type {Colors} */
|
19
|
-
export const ApplicationColors = {
|
20
|
-
logging: {
|
21
|
-
debug: "var(--bs-secondary)",
|
22
|
-
info: "var(--bs-blue)",
|
23
|
-
warning: "var(--bs-warning)",
|
24
|
-
error: "var(--bs-danger)",
|
25
|
-
critical: "var(--bs-danger)",
|
26
|
-
},
|
27
|
-
};
|
@@ -1,66 +0,0 @@
|
|
1
|
-
// @ts-check
|
2
|
-
/**
|
3
|
-
* The base font size in rem units.
|
4
|
-
* @constant {number}
|
5
|
-
*/
|
6
|
-
const kBaseFontSize = 0.9;
|
7
|
-
|
8
|
-
/**
|
9
|
-
* Scales the base font size by the provided scale factor.
|
10
|
-
* @param {number} scale - The scale factor to adjust the base font size.
|
11
|
-
* @returns {string} - The scaled font size in rem units.
|
12
|
-
*/
|
13
|
-
const ScaleBaseFont = (scale) => {
|
14
|
-
return `${kBaseFontSize + scale}rem`;
|
15
|
-
};
|
16
|
-
|
17
|
-
/**
|
18
|
-
* @typedef {Object} FontSize
|
19
|
-
* @property {string} title - The font size for titles.
|
20
|
-
* @property {string} title-secondary - The font size for secondary titles.
|
21
|
-
* @property {string} larger - The font size for larger text.
|
22
|
-
* @property {string} large - The font size for large text.
|
23
|
-
* @property {string} base - The base font size.
|
24
|
-
* @property {string} small - The font size for small text.
|
25
|
-
* @property {string} smaller - The font size for smaller text.
|
26
|
-
*/
|
27
|
-
|
28
|
-
/**
|
29
|
-
* An object representing font sizes for different text elements.
|
30
|
-
* @type {FontSize}
|
31
|
-
*/
|
32
|
-
export const FontSize = {
|
33
|
-
title: ScaleBaseFont(0.6),
|
34
|
-
"title-secondary": ScaleBaseFont(0.4),
|
35
|
-
larger: ScaleBaseFont(0.2),
|
36
|
-
large: ScaleBaseFont(0.1),
|
37
|
-
base: ScaleBaseFont(0),
|
38
|
-
small: ScaleBaseFont(-0.1),
|
39
|
-
smaller: ScaleBaseFont(-0.1),
|
40
|
-
};
|
41
|
-
|
42
|
-
/**
|
43
|
-
* @typedef {Object} TextStyle
|
44
|
-
* @property {Object} label - The style for label text.
|
45
|
-
* @property {string} label.textTransform - The text transformation for label text.
|
46
|
-
* @property {Object} secondary - The style for secondary text.
|
47
|
-
* @property {string} secondary.color - The color for secondary text.
|
48
|
-
* @property {Object} tertiary - The style for secondary text.
|
49
|
-
* @property {string} tertiary.color - The color for secondary text.
|
50
|
-
*/
|
51
|
-
|
52
|
-
/**
|
53
|
-
* An object representing text styles for different elements.
|
54
|
-
* @type {TextStyle}
|
55
|
-
*/
|
56
|
-
export const TextStyle = {
|
57
|
-
label: {
|
58
|
-
textTransform: "uppercase",
|
59
|
-
},
|
60
|
-
secondary: {
|
61
|
-
color: "var(--bs-secondary)",
|
62
|
-
},
|
63
|
-
tertiary: {
|
64
|
-
color: "var(--bs-tertiary-color)",
|
65
|
-
},
|
66
|
-
};
|
@@ -1,240 +0,0 @@
|
|
1
|
-
// @ts-check
|
2
|
-
/**
|
3
|
-
* Arrow Icons
|
4
|
-
* @typedef {Object} ArrowIcons
|
5
|
-
* @property {string} right
|
6
|
-
* @property {string} down
|
7
|
-
* @property {string} up
|
8
|
-
*/
|
9
|
-
|
10
|
-
/**
|
11
|
-
* Arrow Icons
|
12
|
-
* @typedef {Object} ChangeIcons
|
13
|
-
* @property {string} add
|
14
|
-
* @property {string} remove
|
15
|
-
* @property {string} replace
|
16
|
-
*/
|
17
|
-
|
18
|
-
/**
|
19
|
-
* Logging Icons
|
20
|
-
* @typedef {Object} LoggingIcons
|
21
|
-
* @property {string} notset
|
22
|
-
* @property {string} debug
|
23
|
-
* @property {string} http
|
24
|
-
* @property {string} info
|
25
|
-
* @property {string} warning
|
26
|
-
* @property {string} error
|
27
|
-
* @property {string} critical
|
28
|
-
*/
|
29
|
-
|
30
|
-
/**
|
31
|
-
* Role Icons
|
32
|
-
* @typedef {Object} RoleIcons
|
33
|
-
* @property {string} user
|
34
|
-
* @property {string} system
|
35
|
-
* @property {string} assistant
|
36
|
-
* @property {string} tool
|
37
|
-
* @property {string} unknown
|
38
|
-
*/
|
39
|
-
|
40
|
-
/**
|
41
|
-
* Solver Icons
|
42
|
-
* @typedef {Object} SolverIcons
|
43
|
-
* @property {string} default
|
44
|
-
* @property {string} generate
|
45
|
-
* @property {string} chain_of_thought
|
46
|
-
* @property {string} self_critique
|
47
|
-
* @property {string} system_message
|
48
|
-
* @property {string} use_tools
|
49
|
-
*/
|
50
|
-
|
51
|
-
/**
|
52
|
-
* Solver Icons
|
53
|
-
* @typedef {Object} CollapseIcons
|
54
|
-
* @property {string} up
|
55
|
-
* @property {string} all
|
56
|
-
*/
|
57
|
-
|
58
|
-
/**
|
59
|
-
* Chevron Icons
|
60
|
-
* @typedef {Object} ChevronIcons
|
61
|
-
* @property {string} down
|
62
|
-
* @property {string} right
|
63
|
-
*/
|
64
|
-
|
65
|
-
/**
|
66
|
-
* Caret Icons
|
67
|
-
* @typedef {Object} CaretIcons
|
68
|
-
* @property {string} right
|
69
|
-
* @property {string} down
|
70
|
-
*/
|
71
|
-
|
72
|
-
/**
|
73
|
-
* Approval Icons
|
74
|
-
* @typedef {Object} ApprovalIcons
|
75
|
-
* @property {string} approve
|
76
|
-
* @property {string} reject
|
77
|
-
* @property {string} terminate
|
78
|
-
* @property {string} escalate
|
79
|
-
* @property {string} modify
|
80
|
-
*/
|
81
|
-
|
82
|
-
/**
|
83
|
-
* Approval Icons
|
84
|
-
* @typedef {Object} LimitIcons
|
85
|
-
* @property {string} messages
|
86
|
-
* @property {string} time
|
87
|
-
* @property {string} tokens
|
88
|
-
* @property {string} context
|
89
|
-
* @property {string} operator
|
90
|
-
*/
|
91
|
-
|
92
|
-
/**
|
93
|
-
* Provides a centralized repository of Bootstrap icons
|
94
|
-
* used throughout the workspace.
|
95
|
-
* @typedef {Object} Icons
|
96
|
-
* @property {string} approve
|
97
|
-
* @property {ApprovalIcons} approvals
|
98
|
-
* @property {ArrowIcons} arrows
|
99
|
-
* @property {CaretIcons} caret
|
100
|
-
* @property {ChangeIcons} changes
|
101
|
-
* @property {ChevronIcons} chevron
|
102
|
-
* @property {CollapseIcons} collapse
|
103
|
-
* @property {string} close
|
104
|
-
* @property {string} config
|
105
|
-
* @property {string} confirm
|
106
|
-
* @property {string} copy
|
107
|
-
* @property {(epoch: string) => string} epoch
|
108
|
-
* @property {string} error
|
109
|
-
* @property {string} expand-all
|
110
|
-
* @property {string} expand-down
|
111
|
-
* @property {string} fork
|
112
|
-
* @property {string} info
|
113
|
-
* @property {string} input
|
114
|
-
* @property {string} inspect
|
115
|
-
* @property {string} json
|
116
|
-
* @property {LimitIcons} limits
|
117
|
-
* @property {LoggingIcons} logging
|
118
|
-
* @property {string} menu
|
119
|
-
* @property {string} messages
|
120
|
-
* @property {string} metadata
|
121
|
-
* @property {string} multiple-choice
|
122
|
-
* @property {string} model
|
123
|
-
* @property {string} toggle-right
|
124
|
-
* @property {string} more
|
125
|
-
* @property {string} next
|
126
|
-
* @property {string} play
|
127
|
-
* @property {string} previous
|
128
|
-
* @property {string} refresh
|
129
|
-
* @property {RoleIcons} role
|
130
|
-
* @property {string} running
|
131
|
-
* @property {string} sample
|
132
|
-
* @property {string} samples
|
133
|
-
* @property {string} scorer
|
134
|
-
* @property {string} search
|
135
|
-
* @property {SolverIcons} solvers
|
136
|
-
* @property {string} step
|
137
|
-
* @property {string} subtask
|
138
|
-
* @property {string} transcript
|
139
|
-
* @property {string} usage
|
140
|
-
*/
|
141
|
-
|
142
|
-
/** @type {Icons} */
|
143
|
-
export const ApplicationIcons = {
|
144
|
-
approve: "bi bi-shield",
|
145
|
-
approvals: {
|
146
|
-
approve: "bi bi-shield-check",
|
147
|
-
reject: "bi bi-shield-x",
|
148
|
-
terminate: "bi bi-shield-exclamation",
|
149
|
-
escalate: "bi bi-box-arrow-up",
|
150
|
-
modify: "bi bi-pencil-square",
|
151
|
-
},
|
152
|
-
arrows: {
|
153
|
-
right: "bi bi-arrow-right",
|
154
|
-
down: "bi bi-arrow-down",
|
155
|
-
up: "bi bi-arrow-up",
|
156
|
-
},
|
157
|
-
caret: {
|
158
|
-
right: "bi bi-caret-right",
|
159
|
-
down: "bi bi-caret-down",
|
160
|
-
},
|
161
|
-
changes: {
|
162
|
-
add: "bi bi-plus",
|
163
|
-
remove: "bi bi-dash",
|
164
|
-
replace: "bi bi-plus-slash-minus",
|
165
|
-
},
|
166
|
-
chevron: {
|
167
|
-
right: "bi bi-chevron-right",
|
168
|
-
down: "bi bi-chevron-down",
|
169
|
-
},
|
170
|
-
collapse: {
|
171
|
-
all: "bi bi-arrows-collapse",
|
172
|
-
up: "bi bi-chevron-up",
|
173
|
-
},
|
174
|
-
close: "bi bi-x",
|
175
|
-
config: "bi bi-gear",
|
176
|
-
confirm: "bi bi-check",
|
177
|
-
copy: "bi bi-copy",
|
178
|
-
epoch: (epoch) => {
|
179
|
-
return `bi bi-${epoch}-circle`;
|
180
|
-
},
|
181
|
-
error: "bi bi-exclamation-circle",
|
182
|
-
"expand-all": "bi bi-arrows-expand",
|
183
|
-
"expand-down": "bi bi-chevron-down",
|
184
|
-
fork: "bi bi-signpost-split",
|
185
|
-
info: "bi bi-info-circle",
|
186
|
-
input: "bi bi-terminal",
|
187
|
-
inspect: "bi bi-gear",
|
188
|
-
json: "bi bi-filetype-json",
|
189
|
-
limits: {
|
190
|
-
messages: "bi bi-chat-right-text",
|
191
|
-
context: "bi bi-person-workspace",
|
192
|
-
operator: "bi bi-person-workspace",
|
193
|
-
tokens: "bi bi-list",
|
194
|
-
time: "bi bi-stopwatch",
|
195
|
-
},
|
196
|
-
logging: {
|
197
|
-
notset: "bi bi-card-text",
|
198
|
-
debug: "bi bi-bug",
|
199
|
-
http: "bi bi-download",
|
200
|
-
info: "bi bi-info-square",
|
201
|
-
warning: "bi bi-exclamation-triangle",
|
202
|
-
error: "bi bi-x-circle",
|
203
|
-
critical: "bi bi-fire",
|
204
|
-
},
|
205
|
-
menu: "bi bi-list",
|
206
|
-
messages: "bi bi-chat-right-text",
|
207
|
-
metadata: "bi bi-table",
|
208
|
-
model: "bi bi-grid-3x3-gap",
|
209
|
-
"toggle-right": "bi bi-chevron-right",
|
210
|
-
more: "bi bi-zoom-in",
|
211
|
-
"multiple-choice": "bi bi-card-list",
|
212
|
-
next: "bi bi-chevron-right",
|
213
|
-
play: "bi bi-play-fill",
|
214
|
-
previous: "bi bi-chevron-left",
|
215
|
-
refresh: "bi bi-arrow-clockwise",
|
216
|
-
role: {
|
217
|
-
user: "bi bi-person",
|
218
|
-
system: "bi bi-cpu",
|
219
|
-
assistant: "bi bi-robot",
|
220
|
-
tool: "bi bi-tools",
|
221
|
-
unknown: "bi bi-patch-question",
|
222
|
-
},
|
223
|
-
running: "bi bi-stars",
|
224
|
-
sample: "bi bi-database",
|
225
|
-
samples: "bi bi-file-spreadsheet",
|
226
|
-
scorer: "bi bi-calculator",
|
227
|
-
search: "bi bi-search",
|
228
|
-
solvers: {
|
229
|
-
default: "bi bi-arrow-return-right",
|
230
|
-
generate: "bi bi-share",
|
231
|
-
chain_of_thought: "bi bi-link",
|
232
|
-
self_critique: "bi bi-arrow-left-right",
|
233
|
-
system_message: "bi bi-cpu",
|
234
|
-
use_tools: "bi bi-tools",
|
235
|
-
},
|
236
|
-
step: "bi bi-fast-forward-btn",
|
237
|
-
subtask: "bi bi-subtract",
|
238
|
-
transcript: "bi bi-list-columns-reverse",
|
239
|
-
usage: "bi bi-stopwatch",
|
240
|
-
};
|
@@ -1,184 +0,0 @@
|
|
1
|
-
import { html } from "htm/preact";
|
2
|
-
|
3
|
-
// TODO: CSS
|
4
|
-
//import './ANSIDisplay.css';
|
5
|
-
|
6
|
-
import { default as ansi } from "./ansi-output.js";
|
7
|
-
|
8
|
-
export const ANSIDisplay = ({ output, style }) => {
|
9
|
-
const ansiOutput = new ansi.ANSIOutput();
|
10
|
-
ansiOutput.processOutput(output);
|
11
|
-
|
12
|
-
let firstOutput = false;
|
13
|
-
return html`<div class="ansi-display" style=${{ ...style }}>
|
14
|
-
${ansiOutput.outputLines.map((line) => {
|
15
|
-
firstOutput = firstOutput || !!line.outputRuns.length;
|
16
|
-
return html`<div class="ansi-display-line">
|
17
|
-
${!line.outputRuns.length
|
18
|
-
? firstOutput
|
19
|
-
? html`<br />`
|
20
|
-
: null
|
21
|
-
: line.outputRuns.map(
|
22
|
-
(outputRun) =>
|
23
|
-
html`<${OutputRun}
|
24
|
-
key=${outputRun.id}
|
25
|
-
outputRun=${outputRun}
|
26
|
-
/>`,
|
27
|
-
)}
|
28
|
-
</div>`;
|
29
|
-
})}
|
30
|
-
</div>`;
|
31
|
-
};
|
32
|
-
|
33
|
-
const kForeground = 0;
|
34
|
-
const kBackground = 1;
|
35
|
-
|
36
|
-
const OutputRun = ({ outputRun }) => {
|
37
|
-
const computeStyles = (styles) => {
|
38
|
-
let cssProperties = {};
|
39
|
-
if (styles) {
|
40
|
-
styles.forEach((style) => {
|
41
|
-
switch (style) {
|
42
|
-
// Bold.
|
43
|
-
case ansi.ANSIStyle.Bold:
|
44
|
-
cssProperties = { ...cssProperties, ...{ fontWeight: "bold" } };
|
45
|
-
break;
|
46
|
-
|
47
|
-
// Dim.
|
48
|
-
case ansi.ANSIStyle.Dim:
|
49
|
-
cssProperties = { ...cssProperties, ...{ fontWeight: "lighter" } };
|
50
|
-
break;
|
51
|
-
|
52
|
-
// Italic.
|
53
|
-
case ansi.ANSIStyle.Italic:
|
54
|
-
cssProperties = { ...cssProperties, ...{ fontStyle: "italic" } };
|
55
|
-
break;
|
56
|
-
|
57
|
-
// Underlined.
|
58
|
-
case ansi.ANSIStyle.Underlined:
|
59
|
-
cssProperties = {
|
60
|
-
...cssProperties,
|
61
|
-
...{
|
62
|
-
textDecorationLine: "underline",
|
63
|
-
textDecorationStyle: "solid",
|
64
|
-
},
|
65
|
-
};
|
66
|
-
break;
|
67
|
-
|
68
|
-
// Slow blink.
|
69
|
-
case ansi.ANSIStyle.SlowBlink:
|
70
|
-
cssProperties = {
|
71
|
-
...cssProperties,
|
72
|
-
...{ animation: "ansi-display-run-blink 1s linear infinite" },
|
73
|
-
};
|
74
|
-
break;
|
75
|
-
|
76
|
-
// Rapid blink.
|
77
|
-
case ansi.ANSIStyle.RapidBlink:
|
78
|
-
cssProperties = {
|
79
|
-
...cssProperties,
|
80
|
-
...{ animation: "ansi-display-run-blink 0.5s linear infinite" },
|
81
|
-
};
|
82
|
-
break;
|
83
|
-
|
84
|
-
// Hidden.
|
85
|
-
case ansi.ANSIStyle.Hidden:
|
86
|
-
cssProperties = { ...cssProperties, ...{ visibility: "hidden" } };
|
87
|
-
break;
|
88
|
-
|
89
|
-
// CrossedOut.
|
90
|
-
case ansi.ANSIStyle.CrossedOut:
|
91
|
-
cssProperties = {
|
92
|
-
...cssProperties,
|
93
|
-
...{
|
94
|
-
textDecorationLine: "line-through",
|
95
|
-
textDecorationStyle: "solid",
|
96
|
-
},
|
97
|
-
};
|
98
|
-
break;
|
99
|
-
|
100
|
-
// TODO Fraktur
|
101
|
-
|
102
|
-
// DoubleUnderlined.
|
103
|
-
case ansi.ANSIStyle.DoubleUnderlined:
|
104
|
-
cssProperties = {
|
105
|
-
...cssProperties,
|
106
|
-
...{
|
107
|
-
textDecorationLine: "underline",
|
108
|
-
textDecorationStyle: "double",
|
109
|
-
},
|
110
|
-
};
|
111
|
-
break;
|
112
|
-
|
113
|
-
// TODO Framed
|
114
|
-
// TODO Encircled
|
115
|
-
// TODO Overlined
|
116
|
-
// TODO Superscript
|
117
|
-
// TODO Subscript
|
118
|
-
}
|
119
|
-
});
|
120
|
-
}
|
121
|
-
|
122
|
-
return cssProperties;
|
123
|
-
};
|
124
|
-
|
125
|
-
const computeForegroundBackgroundColor = (colorType, color) => {
|
126
|
-
switch (color) {
|
127
|
-
// Undefined.
|
128
|
-
case undefined:
|
129
|
-
return {};
|
130
|
-
|
131
|
-
// One of the standard colors.
|
132
|
-
case ansi.ANSIColor.Black:
|
133
|
-
case ansi.ANSIColor.Red:
|
134
|
-
case ansi.ANSIColor.Green:
|
135
|
-
case ansi.ANSIColor.Yellow:
|
136
|
-
case ansi.ANSIColor.Blue:
|
137
|
-
case ansi.ANSIColor.Magenta:
|
138
|
-
case ansi.ANSIColor.Cyan:
|
139
|
-
case ansi.ANSIColor.White:
|
140
|
-
case ansi.ANSIColor.BrightBlack:
|
141
|
-
case ansi.ANSIColor.BrightRed:
|
142
|
-
case ansi.ANSIColor.BrightGreen:
|
143
|
-
case ansi.ANSIColor.BrightYellow:
|
144
|
-
case ansi.ANSIColor.BrightBlue:
|
145
|
-
case ansi.ANSIColor.BrightMagenta:
|
146
|
-
case ansi.ANSIColor.BrightCyan:
|
147
|
-
case ansi.ANSIColor.BrightWhite:
|
148
|
-
if (colorType === kForeground) {
|
149
|
-
return { color: `var(--${color})` };
|
150
|
-
} else {
|
151
|
-
return { background: `var(--${color})` };
|
152
|
-
}
|
153
|
-
|
154
|
-
// TODO@softwarenerd - This isn't hooked up.
|
155
|
-
default:
|
156
|
-
if (colorType === kForeground) {
|
157
|
-
return { color: color };
|
158
|
-
} else {
|
159
|
-
return { background: color };
|
160
|
-
}
|
161
|
-
}
|
162
|
-
};
|
163
|
-
|
164
|
-
const computeCSSProperties = (outputRun) => {
|
165
|
-
return !outputRun.format
|
166
|
-
? {}
|
167
|
-
: {
|
168
|
-
...computeStyles(outputRun.format.styles),
|
169
|
-
...computeForegroundBackgroundColor(
|
170
|
-
kForeground,
|
171
|
-
outputRun.format.foregroundColor,
|
172
|
-
),
|
173
|
-
...computeForegroundBackgroundColor(
|
174
|
-
kBackground,
|
175
|
-
outputRun.format.backgroundColor,
|
176
|
-
),
|
177
|
-
};
|
178
|
-
};
|
179
|
-
|
180
|
-
// Render.
|
181
|
-
return html`<span style=${computeCSSProperties(outputRun)}
|
182
|
-
>${outputRun.text}</span
|
183
|
-
>`;
|
184
|
-
};
|
@@ -1,34 +0,0 @@
|
|
1
|
-
import { html } from "htm/preact";
|
2
|
-
import { Component } from "preact";
|
3
|
-
|
4
|
-
import { ErrorPanel } from "./ErrorPanel.mjs";
|
5
|
-
|
6
|
-
export class AppErrorBoundary extends Component {
|
7
|
-
constructor(props) {
|
8
|
-
super(props);
|
9
|
-
this.state = { hasError: false };
|
10
|
-
}
|
11
|
-
|
12
|
-
static getDerivedStateFromError(error) {
|
13
|
-
// Update state so the next render will show the fallback UI.
|
14
|
-
return { hasError: true, error: error };
|
15
|
-
}
|
16
|
-
|
17
|
-
componentDidCatch(error, errorInfo) {
|
18
|
-
// You can also log the error to an error reporting service
|
19
|
-
console.log({ error, errorInfo });
|
20
|
-
}
|
21
|
-
|
22
|
-
render() {
|
23
|
-
if (this.state.hasError) {
|
24
|
-
console.error({ e: this.state.error });
|
25
|
-
// You can render any custom fallback UI
|
26
|
-
return html`<${ErrorPanel}
|
27
|
-
title="An unexpected error occurred."
|
28
|
-
error="${this.state.error}"
|
29
|
-
/>`;
|
30
|
-
}
|
31
|
-
|
32
|
-
return this.props.children;
|
33
|
-
}
|
34
|
-
}
|
@@ -1,74 +0,0 @@
|
|
1
|
-
// @ts-check
|
2
|
-
import { html } from "htm/preact";
|
3
|
-
import { useEffect, useRef } from "preact/hooks";
|
4
|
-
|
5
|
-
// Import the asciinema player library
|
6
|
-
import * as AsciinemaPlayer from "asciinema-player";
|
7
|
-
|
8
|
-
/**
|
9
|
-
* Renders the ChatView component.
|
10
|
-
*
|
11
|
-
* @param {Object} props - The properties passed to the component.
|
12
|
-
* @param {string} props.id - The ID for the chat view.
|
13
|
-
* @param {string} props.inputUrl - The input url for the player
|
14
|
-
* @param {string} props.outputUrl - The output url for the player
|
15
|
-
* @param {string} props.timingUrl - The timing url for the player
|
16
|
-
* @param {number} [props.rows] - The rows for the player's initial size
|
17
|
-
* @param {number} [props.cols] - The cols for the player's initial size
|
18
|
-
* @param {string} [props.fit] - how to fit the player
|
19
|
-
* @param {Object} [props.style] - Inline styles for the chat view.
|
20
|
-
* @param {number} [props.speed] - The speed to play (1 = 1x, 1.5 = 1.5x...)
|
21
|
-
* @param {boolean} [props.autoPlay] - Whether to autoplay
|
22
|
-
* @param {boolean} [props.loop] - Whether to loop
|
23
|
-
* @param {string} [props.theme] - The terminal theme (e.g. "solarized-dark")
|
24
|
-
* @param {number} [props.idleTimeLimit] - The amount to compress idle time to
|
25
|
-
* @returns {import("preact").JSX.Element} The component.
|
26
|
-
*/
|
27
|
-
export const AsciiCinemaPlayer = ({
|
28
|
-
id,
|
29
|
-
rows,
|
30
|
-
cols,
|
31
|
-
inputUrl,
|
32
|
-
outputUrl,
|
33
|
-
timingUrl,
|
34
|
-
fit,
|
35
|
-
speed,
|
36
|
-
autoPlay,
|
37
|
-
loop,
|
38
|
-
theme,
|
39
|
-
idleTimeLimit = 2,
|
40
|
-
style,
|
41
|
-
}) => {
|
42
|
-
const playerContainerRef = useRef();
|
43
|
-
useEffect(() => {
|
44
|
-
const player = AsciinemaPlayer.create(
|
45
|
-
{
|
46
|
-
url: [timingUrl, outputUrl, inputUrl],
|
47
|
-
parser: "typescript",
|
48
|
-
},
|
49
|
-
playerContainerRef.current,
|
50
|
-
{
|
51
|
-
rows: rows,
|
52
|
-
cols: cols,
|
53
|
-
autoPlay,
|
54
|
-
loop,
|
55
|
-
theme,
|
56
|
-
speed,
|
57
|
-
idleTimeLimit,
|
58
|
-
fit,
|
59
|
-
},
|
60
|
-
);
|
61
|
-
player.play();
|
62
|
-
return () => {
|
63
|
-
player.dispose();
|
64
|
-
};
|
65
|
-
}, []);
|
66
|
-
|
67
|
-
return html`
|
68
|
-
<div
|
69
|
-
id="asciinema-player-${id || "default"}"
|
70
|
-
ref=${playerContainerRef}
|
71
|
-
style=${{ ...style }}
|
72
|
-
></div>
|
73
|
-
`;
|
74
|
-
};
|