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,92 +0,0 @@
|
|
1
|
-
// @ts-check
|
2
|
-
import { html } from "htm/preact";
|
3
|
-
import { RenderedContent } from "./RenderedContent/RenderedContent.mjs";
|
4
|
-
import { FontSize, TextStyle } from "../appearance/Fonts.mjs";
|
5
|
-
|
6
|
-
/**
|
7
|
-
* Renders the MetaDataView component.
|
8
|
-
*
|
9
|
-
* @param {Object} props - The properties passed to the component.
|
10
|
-
* @param {string} props.id - The ID for the table element.
|
11
|
-
* @param {string} [props.classes] - Additional class names for the table element.
|
12
|
-
* @param {Object} [props.style] - Inline styles for the table element.
|
13
|
-
* @param {Object[]|Record<string, string>} props.entries - The metadata entries to display.
|
14
|
-
* @param {boolean} [props.plain] - Whether to render the entries in plain mode.
|
15
|
-
* @param {boolean} [props.compact] - Whether to render the table in compact mode.
|
16
|
-
* @returns {import("preact").JSX.Element} The component.
|
17
|
-
*/
|
18
|
-
export const MetaDataGrid = ({ id, entries, classes, style, plain }) => {
|
19
|
-
const baseId = "metadata-grid";
|
20
|
-
|
21
|
-
const cellKeyStyle = {
|
22
|
-
fontWeight: "400",
|
23
|
-
whiteSpace: "nowrap",
|
24
|
-
...TextStyle.label,
|
25
|
-
...TextStyle.secondary,
|
26
|
-
};
|
27
|
-
const cellValueStyle = {
|
28
|
-
whiteSpace: "pre-wrap",
|
29
|
-
wordWrap: "anywhere",
|
30
|
-
fontSize: FontSize.small,
|
31
|
-
};
|
32
|
-
const cellKeyTextStyle = {
|
33
|
-
fontSize: FontSize.small,
|
34
|
-
};
|
35
|
-
|
36
|
-
// entries can be either a Record<string, stringable>
|
37
|
-
// or an array of record with name/value on way in
|
38
|
-
// but coerce to array of records for order
|
39
|
-
/**
|
40
|
-
* Ensure the proper type for entries
|
41
|
-
*
|
42
|
-
* @param {Object[]|Record<string, string>} entries - The metadata entries to display.
|
43
|
-
* @returns {Record<string, unknown>[]} The component.
|
44
|
-
*/
|
45
|
-
const entryRecords = (entries) => {
|
46
|
-
if (!entries) {
|
47
|
-
return [];
|
48
|
-
}
|
49
|
-
|
50
|
-
if (!Array.isArray(entries)) {
|
51
|
-
return Object.entries(entries || {}).map(([key, value]) => {
|
52
|
-
return { name: key, value };
|
53
|
-
});
|
54
|
-
} else {
|
55
|
-
return entries;
|
56
|
-
}
|
57
|
-
};
|
58
|
-
|
59
|
-
const entryEls = entryRecords(entries).map((entry, index) => {
|
60
|
-
const id = `${baseId}-value-${index}`;
|
61
|
-
return html`
|
62
|
-
<div
|
63
|
-
style=${{
|
64
|
-
gridColumn: "1 / -1",
|
65
|
-
borderBottom: `${!plain ? "solid 1px var(--bs-light-border-subtle" : ""}`,
|
66
|
-
}}
|
67
|
-
></div>
|
68
|
-
<div
|
69
|
-
class="${baseId}-key"
|
70
|
-
style=${{ ...cellKeyStyle, ...cellKeyTextStyle }}
|
71
|
-
>
|
72
|
-
${entry.name}
|
73
|
-
</div>
|
74
|
-
<div class="${baseId}-value" style=${{ ...cellValueStyle }}>
|
75
|
-
<${RenderedContent} id=${id} entry=${entry} />
|
76
|
-
</div>
|
77
|
-
`;
|
78
|
-
});
|
79
|
-
|
80
|
-
return html`<div
|
81
|
-
...${{ id }}
|
82
|
-
class="${classes || ""}"
|
83
|
-
style=${{
|
84
|
-
display: "grid",
|
85
|
-
gridTemplateColumns: "max-content auto",
|
86
|
-
columnGap: "1em",
|
87
|
-
...style,
|
88
|
-
}}
|
89
|
-
>
|
90
|
-
${entryEls}
|
91
|
-
</div>`;
|
92
|
-
};
|
@@ -1,109 +0,0 @@
|
|
1
|
-
// @ts-check
|
2
|
-
import { html } from "htm/preact";
|
3
|
-
import { RenderedContent } from "./RenderedContent/RenderedContent.mjs";
|
4
|
-
import { FontSize } from "../appearance/Fonts.mjs";
|
5
|
-
|
6
|
-
/**
|
7
|
-
* Renders the MetaDataView component.
|
8
|
-
*
|
9
|
-
* @param {Object} props - The properties passed to the component.
|
10
|
-
* @param {string} props.id - The ID for the table element.
|
11
|
-
* @param {string} [props.baseClass] - The base class name for styling.
|
12
|
-
* @param {string} [props.classes] - Additional class names for the table element.
|
13
|
-
* @param {Object} [props.style] - Inline styles for the table element.
|
14
|
-
* @param {Object[]|Record<string, string>} props.entries - The metadata entries to display.
|
15
|
-
* @param {string} [props.tableOptions] - Options for table styling.
|
16
|
-
* @param {boolean} [props.compact] - Whether to render the table in compact mode.
|
17
|
-
* @returns {import("preact").JSX.Element} The component.
|
18
|
-
*/
|
19
|
-
export const MetaDataView = ({
|
20
|
-
id,
|
21
|
-
baseClass,
|
22
|
-
classes,
|
23
|
-
style,
|
24
|
-
entries,
|
25
|
-
tableOptions,
|
26
|
-
compact,
|
27
|
-
}) => {
|
28
|
-
const baseId = baseClass || "metadataview";
|
29
|
-
|
30
|
-
const cellStyle = compact
|
31
|
-
? { padding: "0em" }
|
32
|
-
: { padding: "0.3em 0.3em 0.3em 0em" };
|
33
|
-
const cellKeyStyle = compact
|
34
|
-
? {
|
35
|
-
fontWeight: "400",
|
36
|
-
paddingRight: "0.2em",
|
37
|
-
whiteSpace: "nowrap",
|
38
|
-
}
|
39
|
-
: {
|
40
|
-
fontWeight: "400",
|
41
|
-
paddingRight: "1em",
|
42
|
-
whiteSpace: "nowrap",
|
43
|
-
};
|
44
|
-
const cellValueStyle = {
|
45
|
-
fontWeight: "300",
|
46
|
-
whiteSpace: "pre-wrap",
|
47
|
-
wordWrap: "anywhere",
|
48
|
-
fontSize: FontSize.small,
|
49
|
-
};
|
50
|
-
const cellKeyTextStyle = {
|
51
|
-
fontSize: FontSize.small,
|
52
|
-
};
|
53
|
-
|
54
|
-
// Configure options for
|
55
|
-
tableOptions = tableOptions || "sm";
|
56
|
-
const tblClz = (tableOptions || "").split(",").map((option) => {
|
57
|
-
return `table-${option}`;
|
58
|
-
});
|
59
|
-
|
60
|
-
// entries can be either a Record<string, stringable>
|
61
|
-
// or an array of record with name/value on way in
|
62
|
-
// but coerce to array of records for order
|
63
|
-
/** @type {Array | undefined } */
|
64
|
-
let coercedEntries;
|
65
|
-
if (entries) {
|
66
|
-
if (Array.isArray(entries)) {
|
67
|
-
coercedEntries = entries;
|
68
|
-
} else {
|
69
|
-
coercedEntries = Object.entries(entries || {}).map(([key, value]) => {
|
70
|
-
return { name: key, value };
|
71
|
-
});
|
72
|
-
}
|
73
|
-
}
|
74
|
-
|
75
|
-
const entryEls = (coercedEntries || []).map((entry, index) => {
|
76
|
-
const id = `${baseId}-value-${index}`;
|
77
|
-
return html`<tr class="${baseId}-row">
|
78
|
-
<td
|
79
|
-
class="${baseId}-key"
|
80
|
-
style=${{ ...cellStyle, ...cellKeyStyle, ...cellKeyTextStyle }}
|
81
|
-
>
|
82
|
-
${entry.name}
|
83
|
-
</td>
|
84
|
-
<td class="${baseId}-value" style=${{ ...cellStyle, ...cellValueStyle }}>
|
85
|
-
<${RenderedContent} id=${id} entry=${entry} />
|
86
|
-
</td>
|
87
|
-
</tr>`;
|
88
|
-
});
|
89
|
-
|
90
|
-
return html`<table
|
91
|
-
...${{ id }}
|
92
|
-
class="${classes || ""} table ${tblClz.join(" ")}"
|
93
|
-
style=${{
|
94
|
-
paddingLeft: "0",
|
95
|
-
marginLeft: "0",
|
96
|
-
marginBottom: "0.2rem",
|
97
|
-
...style,
|
98
|
-
}}
|
99
|
-
>
|
100
|
-
<thead>
|
101
|
-
<tr>
|
102
|
-
<th colspan="2" style="${{ padding: 0 }}"></th>
|
103
|
-
</tr>
|
104
|
-
</thead>
|
105
|
-
<tbody>
|
106
|
-
${entryEls}
|
107
|
-
</tbody>
|
108
|
-
</table>`;
|
109
|
-
};
|
@@ -1,50 +0,0 @@
|
|
1
|
-
import { Popover } from "bootstrap";
|
2
|
-
import { html } from "htm/preact";
|
3
|
-
import { useEffect, useRef } from "preact/hooks";
|
4
|
-
|
5
|
-
import { ApplicationIcons } from "../appearance/Icons.mjs";
|
6
|
-
import { ApplicationStyles } from "../appearance/Styles.mjs";
|
7
|
-
|
8
|
-
export const MorePopOver = ({ title, customClass, children }) => {
|
9
|
-
const popoverRef = useRef();
|
10
|
-
const contentRef = useRef();
|
11
|
-
|
12
|
-
// Initialize the popover
|
13
|
-
useEffect(() => {
|
14
|
-
const contentEl = contentRef.current;
|
15
|
-
const popOverContent = document.createElement("div");
|
16
|
-
contentEl.childNodes.forEach((child) =>
|
17
|
-
popOverContent.appendChild(child.cloneNode(true)),
|
18
|
-
);
|
19
|
-
new Popover(popoverRef.current, {
|
20
|
-
content: popOverContent,
|
21
|
-
title,
|
22
|
-
html: true,
|
23
|
-
customClass: customClass,
|
24
|
-
trigger: "focus",
|
25
|
-
});
|
26
|
-
}, [popoverRef, contentRef]);
|
27
|
-
|
28
|
-
const popoverElements = [];
|
29
|
-
|
30
|
-
// The popover display button
|
31
|
-
popoverElements.push(html`
|
32
|
-
<a
|
33
|
-
tabindex="0"
|
34
|
-
ref=${popoverRef}
|
35
|
-
class="btn"
|
36
|
-
role="button"
|
37
|
-
data-bs-toggle="popover"
|
38
|
-
data-bs-trigger="focus"
|
39
|
-
style=${ApplicationStyles.moreButton}
|
40
|
-
><i class="${ApplicationIcons.more}"></i
|
41
|
-
></a>
|
42
|
-
`);
|
43
|
-
|
44
|
-
// A container to hold the popover contents
|
45
|
-
popoverElements.push(
|
46
|
-
html` <div style="display: none;" ref=${contentRef}>${children}</div>`,
|
47
|
-
);
|
48
|
-
|
49
|
-
return popoverElements;
|
50
|
-
};
|
@@ -1,63 +0,0 @@
|
|
1
|
-
import { html } from "htm/preact";
|
2
|
-
import { useState } from "preact/hooks";
|
3
|
-
import { FontSize, TextStyle } from "../appearance/Fonts.mjs";
|
4
|
-
|
5
|
-
export const NavPills = ({ children }) => {
|
6
|
-
const [activeItem, setActiveItem] = useState(children[0].props["title"]);
|
7
|
-
|
8
|
-
const NavPill = ({ title, activeItem, setActiveItem }) => {
|
9
|
-
const active = activeItem === title;
|
10
|
-
return html` <li class="nav-item">
|
11
|
-
<button
|
12
|
-
type="button"
|
13
|
-
role="tab"
|
14
|
-
aria-selected=${active}
|
15
|
-
style=${{
|
16
|
-
minWidth: "4rem",
|
17
|
-
...TextStyle.label,
|
18
|
-
fontSize: FontSize.small,
|
19
|
-
padding: "0.1rem 0.6rem",
|
20
|
-
borderRadius: "var(--bs-border-radius)",
|
21
|
-
}}
|
22
|
-
class="nav-link ${active ? "active " : ""}"
|
23
|
-
onclick=${() => {
|
24
|
-
setActiveItem(title);
|
25
|
-
}}
|
26
|
-
>
|
27
|
-
${title}
|
28
|
-
</button>
|
29
|
-
</li>`;
|
30
|
-
};
|
31
|
-
|
32
|
-
const navPills = children.map((nav, idx) => {
|
33
|
-
const title =
|
34
|
-
typeof nav === "object"
|
35
|
-
? nav["props"]?.title || `Tab ${idx}`
|
36
|
-
: `Tab ${idx}`;
|
37
|
-
return html`<${NavPill}
|
38
|
-
title=${title}
|
39
|
-
activeItem=${activeItem}
|
40
|
-
setActiveItem=${setActiveItem}
|
41
|
-
/>`;
|
42
|
-
});
|
43
|
-
|
44
|
-
const navBodies = children.map((child) => {
|
45
|
-
return html` <div
|
46
|
-
style=${{
|
47
|
-
display: child["props"]?.title === activeItem ? "block" : "none",
|
48
|
-
}}
|
49
|
-
>
|
50
|
-
${child}
|
51
|
-
</div>`;
|
52
|
-
});
|
53
|
-
|
54
|
-
return html`<ul
|
55
|
-
class="nav nav-pills card-header-pills"
|
56
|
-
style=${{ marginRight: "0" }}
|
57
|
-
role="tablist"
|
58
|
-
aria-orientation="horizontal"
|
59
|
-
>
|
60
|
-
${navPills}
|
61
|
-
</ul>
|
62
|
-
${navBodies}`;
|
63
|
-
};
|
@@ -1,51 +0,0 @@
|
|
1
|
-
import { html } from "htm/preact";
|
2
|
-
|
3
|
-
export const ProgressBar = ({ style, containerStyle, animating }) => {
|
4
|
-
const emptyStyle = {
|
5
|
-
display: "flex",
|
6
|
-
textAlign: "center",
|
7
|
-
flex: "0 0 content",
|
8
|
-
alignItems: "center",
|
9
|
-
justifyContent: "center",
|
10
|
-
border: "none",
|
11
|
-
padding: "0",
|
12
|
-
zIndex: 1001,
|
13
|
-
width: "100%",
|
14
|
-
height: "0px",
|
15
|
-
overflow: "visible",
|
16
|
-
};
|
17
|
-
|
18
|
-
const progressContainerStyle = {
|
19
|
-
width: "100%",
|
20
|
-
height: "2px",
|
21
|
-
...containerStyle,
|
22
|
-
background: "#ffffff00",
|
23
|
-
};
|
24
|
-
|
25
|
-
const progressBarStyle = {
|
26
|
-
width: "5%",
|
27
|
-
height: "2px",
|
28
|
-
...style,
|
29
|
-
};
|
30
|
-
|
31
|
-
return html`
|
32
|
-
<div style=${emptyStyle} class="empty-message">
|
33
|
-
<div
|
34
|
-
class="progress"
|
35
|
-
role="progressbar"
|
36
|
-
aria-label="Basic example"
|
37
|
-
aria-valuenow="25"
|
38
|
-
aria-valuemin="0"
|
39
|
-
aria-valuemax="100"
|
40
|
-
style=${progressContainerStyle}
|
41
|
-
>
|
42
|
-
${animating
|
43
|
-
? html`<div
|
44
|
-
class="progress-bar left-to-right-animate"
|
45
|
-
style=${progressBarStyle}
|
46
|
-
></div>`
|
47
|
-
: ""}
|
48
|
-
</div>
|
49
|
-
</div>
|
50
|
-
`;
|
51
|
-
};
|
@@ -1,54 +0,0 @@
|
|
1
|
-
import { html } from "htm/preact";
|
2
|
-
|
3
|
-
import { Buckets } from "./Types.mjs";
|
4
|
-
import { ChatView } from "../ChatView.mjs";
|
5
|
-
import { NavPills } from "../NavPills.mjs";
|
6
|
-
|
7
|
-
/**
|
8
|
-
* @type {import("./Types.mjs").ContentRenderer}
|
9
|
-
*
|
10
|
-
* Renders chat messages as a ChatView component.
|
11
|
-
*/
|
12
|
-
export const ChatMessageRenderer = {
|
13
|
-
bucket: Buckets.first,
|
14
|
-
canRender: (entry) => {
|
15
|
-
const val = entry.value;
|
16
|
-
return (
|
17
|
-
Array.isArray(val) &&
|
18
|
-
val.length > 0 &&
|
19
|
-
val[0]?.role !== undefined &&
|
20
|
-
val[0]?.content !== undefined
|
21
|
-
);
|
22
|
-
},
|
23
|
-
render: (id, entry) => {
|
24
|
-
return {
|
25
|
-
rendered: html`
|
26
|
-
<${NavPills}>
|
27
|
-
<${ChatSummary} title="Last Turn" id=${id} messages=${entry.value} />
|
28
|
-
<${ChatView} title="All" id=${id} messages=${entry.value} />
|
29
|
-
</${NavPills}>
|
30
|
-
`,
|
31
|
-
};
|
32
|
-
},
|
33
|
-
};
|
34
|
-
|
35
|
-
/**
|
36
|
-
* Represents a chat summary component that renders a list of chat messages.
|
37
|
-
*
|
38
|
-
* @param {Object} props - The properties for the component.
|
39
|
-
* @param {string} props.id - A unique identifier for the chat summary.
|
40
|
-
* @param {(import("../../types/log").ChatMessageAssistant | import("../../types/log").ChatMessageUser | import("../../types/log").ChatMessageSystem | import("../../types/log").ChatMessageTool)[]} props.messages - A list of chat messages to display.
|
41
|
-
* @returns {import("preact").JSX.Element} The rendered ChatView component.
|
42
|
-
*/
|
43
|
-
export const ChatSummary = ({ id, messages }) => {
|
44
|
-
// Show the last 'turn'
|
45
|
-
const summaryMessages = [];
|
46
|
-
for (const message of messages.slice().reverse()) {
|
47
|
-
summaryMessages.unshift(message);
|
48
|
-
if (message.role === "user") {
|
49
|
-
break;
|
50
|
-
}
|
51
|
-
}
|
52
|
-
|
53
|
-
return html`<${ChatView} id=${id} messages=${summaryMessages} />`;
|
54
|
-
};
|
@@ -1,19 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Enum for renderer bucket priorities.
|
3
|
-
* Determines the order in which renderers are applied.
|
4
|
-
*
|
5
|
-
* @enum {number}
|
6
|
-
*/
|
7
|
-
export const Buckets = {
|
8
|
-
first: 0,
|
9
|
-
intermediate: 10,
|
10
|
-
final: 1000,
|
11
|
-
};
|
12
|
-
|
13
|
-
/**
|
14
|
-
* @typedef {Object} ContentRenderer
|
15
|
-
* @property {number} bucket - Priority bucket for the renderer. Lower numbers are higher priority.
|
16
|
-
* @property {(content: any) => boolean} canRender - Determines if the renderer can handle the entry.
|
17
|
-
* @property {(id: string, content: any) => { rendered: import("preact").JSX.Element | import("preact").JSX.Element[] | string }} render
|
18
|
-
* - Function that renders the entry. Returns an object containing the rendered content and optional after-body content.
|
19
|
-
*/
|
@@ -1,184 +0,0 @@
|
|
1
|
-
import { html } from "htm/preact";
|
2
|
-
import { FontSize, TextStyle } from "../appearance/Fonts.mjs";
|
3
|
-
import { useCallback, useEffect, useRef } from "preact/hooks";
|
4
|
-
|
5
|
-
// styles: { tabSet:{}, tabBody: {}}
|
6
|
-
export const TabSet = ({ id, type, classes, tools, styles, children }) => {
|
7
|
-
if (!id) {
|
8
|
-
throw new Error("Tabsets require an id to function properly");
|
9
|
-
}
|
10
|
-
|
11
|
-
// The tabs themselves
|
12
|
-
const tabs = children;
|
13
|
-
|
14
|
-
// Process the tab style
|
15
|
-
const tabType = type || "tabs";
|
16
|
-
const tabSetStyle = {
|
17
|
-
alignItems: "space-between",
|
18
|
-
};
|
19
|
-
|
20
|
-
// Render the tabs
|
21
|
-
return html`<ul
|
22
|
-
...${{ id }}
|
23
|
-
class="nav nav-${tabType} ${classes ? classes : ""}"
|
24
|
-
role="tablist"
|
25
|
-
aria-orientation="horizontal"
|
26
|
-
style=${{ ...tabSetStyle, ...styles.tabSet }}
|
27
|
-
>
|
28
|
-
<${Tabs} tabs=${tabs} type=${tabType} style=${styles.tabs} />
|
29
|
-
<${TabTools} tools=${tools} />
|
30
|
-
</ul>
|
31
|
-
<${TabPanels} id=${id} tabs=${tabs} style=${styles.tabBody} />`;
|
32
|
-
};
|
33
|
-
|
34
|
-
// Defines a tab panel that appears within the tabset
|
35
|
-
export const TabPanel = ({
|
36
|
-
id,
|
37
|
-
index,
|
38
|
-
selected,
|
39
|
-
style,
|
40
|
-
scrollable,
|
41
|
-
scrollRef,
|
42
|
-
classes,
|
43
|
-
scrollPosition,
|
44
|
-
setScrollPosition,
|
45
|
-
children,
|
46
|
-
}) => {
|
47
|
-
const tabContentsId = computeTabContentsId(id, index);
|
48
|
-
const tabContentsRef =
|
49
|
-
scrollRef || useRef(/** @type {HTMLElement|null} */ (null));
|
50
|
-
useEffect(() => {
|
51
|
-
setTimeout(() => {
|
52
|
-
if (
|
53
|
-
scrollPosition !== undefined &&
|
54
|
-
tabContentsRef.current &&
|
55
|
-
tabContentsRef.current.scrollTop !== scrollPosition
|
56
|
-
) {
|
57
|
-
tabContentsRef.current.scrollTop = scrollPosition;
|
58
|
-
}
|
59
|
-
}, 0);
|
60
|
-
});
|
61
|
-
|
62
|
-
const onScroll = useCallback(
|
63
|
-
(e) => {
|
64
|
-
setScrollPosition(e.srcElement.scrollTop);
|
65
|
-
},
|
66
|
-
[setScrollPosition],
|
67
|
-
);
|
68
|
-
|
69
|
-
return html`<div
|
70
|
-
id="${tabContentsId}"
|
71
|
-
ref=${tabContentsRef}
|
72
|
-
class="tab-pane show${selected ? " active" : ""}${classes
|
73
|
-
? ` ${classes}`
|
74
|
-
: ""}"
|
75
|
-
style=${{
|
76
|
-
flex: "1",
|
77
|
-
overflowY: scrollable === undefined || scrollable ? "auto" : "hidden",
|
78
|
-
...style,
|
79
|
-
}}
|
80
|
-
onscroll=${onScroll}
|
81
|
-
>
|
82
|
-
${children}
|
83
|
-
</div>`;
|
84
|
-
};
|
85
|
-
|
86
|
-
// Render the tabs / pills themselves
|
87
|
-
const Tabs = ({ tabs, type, style }) => {
|
88
|
-
return tabs.map((tab, index) => {
|
89
|
-
return html` <${Tab}
|
90
|
-
type=${type || "tabs"}
|
91
|
-
tab=${tab}
|
92
|
-
index=${index}
|
93
|
-
style=${style}
|
94
|
-
/>`;
|
95
|
-
});
|
96
|
-
};
|
97
|
-
|
98
|
-
// An individual tab
|
99
|
-
const Tab = ({ type, tab, index, style }) => {
|
100
|
-
// TODO: If there's no tab.props.id, this is just a string of "-1", "-2" per
|
101
|
-
// index because there's no `id`, what should this really be?
|
102
|
-
const tabId = tab.props.id || computeTabId("tabset", index);
|
103
|
-
const tabContentsId = computeTabContentsId(tab.props.id, index);
|
104
|
-
const isActive = tab.props.selected;
|
105
|
-
const tabStyle = {
|
106
|
-
color: "var(--bs-body-color)",
|
107
|
-
...style,
|
108
|
-
padding: "0.25rem 0.5rem",
|
109
|
-
borderTopLeftRadius: "var(--bs-border-radius)",
|
110
|
-
borderTopRightRadius: "var(--bs-border-radius)",
|
111
|
-
...TextStyle.label,
|
112
|
-
fontSize: FontSize.small,
|
113
|
-
fontWeight: 500,
|
114
|
-
marginTop: "2px",
|
115
|
-
marginBottom: "-1px",
|
116
|
-
};
|
117
|
-
const pillStyle = {
|
118
|
-
...style,
|
119
|
-
};
|
120
|
-
return html`
|
121
|
-
<li class="nav-item" role="presentation" style=${{ alignSelf: "end" }}>
|
122
|
-
<button
|
123
|
-
id="${tabId}"
|
124
|
-
style=${type === "tabs" ? tabStyle : pillStyle}
|
125
|
-
class="nav-link ${isActive ? "active" : ""}"
|
126
|
-
data-bs-toggle="tab"
|
127
|
-
data-bs-target="#${tabContentsId}"
|
128
|
-
type="button"
|
129
|
-
role="tab"
|
130
|
-
aria-controls="${tabContentsId}"
|
131
|
-
aria-selected="${isActive ? true : false}"
|
132
|
-
...${{
|
133
|
-
onclick: (e) => {
|
134
|
-
tab.props.onSelected(e);
|
135
|
-
return false;
|
136
|
-
},
|
137
|
-
}}
|
138
|
-
>
|
139
|
-
${tab.props.icon
|
140
|
-
? html`<i
|
141
|
-
class="${tab.props.icon}"
|
142
|
-
style=${{ marginRight: "0.5em" }}
|
143
|
-
></i>`
|
144
|
-
: ""}
|
145
|
-
${tab.props.title}
|
146
|
-
</button>
|
147
|
-
</li>
|
148
|
-
`;
|
149
|
-
};
|
150
|
-
|
151
|
-
// The tools shown for the tab
|
152
|
-
const TabTools = ({ tools }) => {
|
153
|
-
return html`<div
|
154
|
-
class="tab-tools"
|
155
|
-
style=${{
|
156
|
-
flexBasis: "auto",
|
157
|
-
marginLeft: "auto",
|
158
|
-
display: "flex",
|
159
|
-
alignItems: "center",
|
160
|
-
justifyContent: "end",
|
161
|
-
flexWrap: "wrap",
|
162
|
-
rowGap: "0.3rem",
|
163
|
-
}}
|
164
|
-
>
|
165
|
-
${tools}
|
166
|
-
</div>`;
|
167
|
-
};
|
168
|
-
|
169
|
-
// Render the tab panels
|
170
|
-
const TabPanels = ({ id, tabs, style }) => {
|
171
|
-
return html`<div class="tab-content" id="${id}-content" style=${{ ...style }}>
|
172
|
-
${tabs.map((tab, index) => {
|
173
|
-
tab.props.index = index;
|
174
|
-
return tab;
|
175
|
-
})}
|
176
|
-
</div>`;
|
177
|
-
};
|
178
|
-
|
179
|
-
const computeTabId = (id, index) => {
|
180
|
-
return `${id}-${index}`;
|
181
|
-
};
|
182
|
-
const computeTabContentsId = (id, index) => {
|
183
|
-
return `${id}-contents-${index}`;
|
184
|
-
};
|
@@ -1,16 +0,0 @@
|
|
1
|
-
import { html } from "htm/preact";
|
2
|
-
import { h } from "preact";
|
3
|
-
|
4
|
-
export const ToolButton = ({ name, classes, icon, onclick, ...rest }) => {
|
5
|
-
// Create the component (dynamically to forward attributes)
|
6
|
-
const attr = {
|
7
|
-
type: "button",
|
8
|
-
class: `btn btn-tools ${classes || ""}`,
|
9
|
-
onclick,
|
10
|
-
...rest,
|
11
|
-
};
|
12
|
-
const iconEl = icon
|
13
|
-
? html`<i class="${icon}" style=${{ marginRight: "0.5em" }}></i>`
|
14
|
-
: "";
|
15
|
-
return h("button", attr, html`${iconEl}${name}`);
|
16
|
-
};
|