inspect-ai 0.3.90__py3-none-any.whl → 0.3.92__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/common.py +13 -0
- inspect_ai/_cli/eval.py +44 -0
- inspect_ai/_display/textual/widgets/samples.py +49 -4
- inspect_ai/_display/textual/widgets/vscode.py +4 -2
- inspect_ai/_eval/eval.py +41 -28
- inspect_ai/_eval/evalset.py +4 -0
- inspect_ai/_eval/loader.py +4 -5
- inspect_ai/_eval/registry.py +1 -1
- inspect_ai/_eval/run.py +6 -3
- inspect_ai/_eval/task/log.py +6 -0
- inspect_ai/_eval/task/run.py +108 -41
- inspect_ai/_eval/task/sandbox.py +19 -5
- inspect_ai/_util/_async.py +1 -1
- inspect_ai/_util/constants.py +1 -0
- inspect_ai/_util/environ.py +32 -0
- inspect_ai/_util/file.py +8 -1
- inspect_ai/_util/httpx.py +105 -22
- inspect_ai/_util/registry.py +83 -9
- inspect_ai/_util/text.py +81 -17
- inspect_ai/_util/transcript.py +9 -6
- inspect_ai/_util/vscode.py +7 -2
- inspect_ai/_view/schema.py +1 -1
- inspect_ai/_view/www/babel.config.js +11 -0
- inspect_ai/_view/www/dist/assets/index.css +3640 -3563
- inspect_ai/_view/www/dist/assets/index.js +59204 -52519
- inspect_ai/_view/www/eslint.config.mjs +10 -1
- inspect_ai/_view/www/jest.config.mjs +21 -0
- inspect_ai/_view/www/log-schema.json +111 -2
- inspect_ai/_view/www/package.json +19 -5
- inspect_ai/_view/www/src/{types → @types}/log.d.ts +95 -32
- inspect_ai/_view/www/{App.css → src/app/App.css} +22 -14
- inspect_ai/_view/www/src/app/App.tsx +168 -0
- inspect_ai/_view/www/src/{AppErrorBoundary.tsx → app/AppErrorBoundary.tsx} +1 -1
- inspect_ai/_view/www/src/{appearance → app/appearance}/icons.ts +1 -0
- inspect_ai/_view/www/src/{metadata → app/content}/RenderedContent.tsx +5 -5
- inspect_ai/_view/www/src/{workspace/WorkSpaceView.tsx → app/log-view/LogView.tsx} +59 -40
- inspect_ai/_view/www/src/app/log-view/LogViewContainer.tsx +159 -0
- inspect_ai/_view/www/src/app/log-view/LogViewLayout.tsx +109 -0
- inspect_ai/_view/www/src/{workspace → app/log-view}/error/TaskErrorPanel.tsx +3 -3
- inspect_ai/_view/www/src/{workspace → app/log-view}/navbar/ModelRolesView.tsx +1 -1
- inspect_ai/_view/www/src/{workspace → app/log-view}/navbar/Navbar.tsx +4 -4
- inspect_ai/_view/www/src/{workspace → app/log-view}/navbar/PrimaryBar.tsx +8 -8
- inspect_ai/_view/www/src/{workspace → app/log-view}/navbar/ResultsPanel.tsx +6 -6
- inspect_ai/_view/www/src/{workspace → app/log-view}/navbar/RunningStatusPanel.tsx +1 -1
- inspect_ai/_view/www/src/{workspace → app/log-view}/navbar/ScoreGrid.tsx +1 -1
- inspect_ai/_view/www/src/{workspace → app/log-view}/navbar/SecondaryBar.tsx +8 -8
- inspect_ai/_view/www/src/{workspace → app/log-view}/tabs/InfoTab.tsx +35 -6
- inspect_ai/_view/www/src/app/log-view/tabs/JsonTab.tsx +136 -0
- inspect_ai/_view/www/src/{workspace → app/log-view}/tabs/SamplesTab.tsx +82 -73
- inspect_ai/_view/www/src/{workspace → app/log-view}/tabs/grouping.ts +3 -3
- inspect_ai/_view/www/src/{workspace → app/log-view}/tabs/types.ts +1 -1
- inspect_ai/_view/www/src/{plan → app/plan}/DatasetDetailView.tsx +2 -2
- inspect_ai/_view/www/src/{plan → app/plan}/DetailStep.tsx +1 -1
- inspect_ai/_view/www/src/{plan → app/plan}/ModelCard.tsx +4 -4
- inspect_ai/_view/www/src/{plan → app/plan}/PlanCard.tsx +2 -2
- inspect_ai/_view/www/src/{plan → app/plan}/PlanDetailView.tsx +5 -5
- inspect_ai/_view/www/src/{plan → app/plan}/SolverDetailView.tsx +1 -1
- inspect_ai/_view/www/src/app/routing/AppRouter.tsx +58 -0
- inspect_ai/_view/www/src/app/routing/navigationHooks.ts +182 -0
- inspect_ai/_view/www/src/app/routing/url.ts +43 -0
- inspect_ai/_view/www/src/{samples → app/samples}/InlineSampleDisplay.tsx +11 -27
- inspect_ai/_view/www/src/{samples → app/samples}/SampleDialog.tsx +36 -40
- inspect_ai/_view/www/src/{samples → app/samples}/SampleDisplay.module.css +4 -0
- inspect_ai/_view/www/src/{samples → app/samples}/SampleDisplay.tsx +116 -49
- inspect_ai/_view/www/src/{samples → app/samples}/SampleSummaryView.module.css +1 -1
- inspect_ai/_view/www/src/{samples → app/samples}/SampleSummaryView.tsx +29 -26
- inspect_ai/_view/www/src/{samples → app/samples}/SamplesTools.tsx +3 -3
- inspect_ai/_view/www/src/{samples → app/samples}/chat/ChatMessage.module.css +5 -2
- inspect_ai/_view/www/src/{samples → app/samples}/chat/ChatMessage.tsx +12 -4
- inspect_ai/_view/www/src/{samples → app/samples}/chat/ChatMessageRenderer.tsx +3 -3
- inspect_ai/_view/www/src/{samples → app/samples}/chat/ChatMessageRow.tsx +6 -1
- inspect_ai/_view/www/src/{samples → app/samples}/chat/ChatView.tsx +4 -2
- inspect_ai/_view/www/src/{samples → app/samples}/chat/ChatViewVirtualList.tsx +5 -3
- inspect_ai/_view/www/src/app/samples/chat/MessageContent.module.css +12 -0
- inspect_ai/_view/www/src/{samples → app/samples}/chat/MessageContent.tsx +11 -10
- inspect_ai/_view/www/src/app/samples/chat/MessageContents.module.css +7 -0
- inspect_ai/_view/www/src/{samples → app/samples}/chat/MessageContents.tsx +14 -8
- inspect_ai/_view/www/src/{samples → app/samples}/chat/messages.ts +2 -2
- inspect_ai/_view/www/src/app/samples/chat/tools/ToolCallView.module.css +7 -0
- inspect_ai/_view/www/src/{samples → app/samples}/chat/tools/ToolCallView.tsx +26 -27
- inspect_ai/_view/www/src/app/samples/chat/tools/ToolInput.module.css +19 -0
- inspect_ai/_view/www/src/{samples → app/samples}/chat/tools/ToolInput.tsx +3 -3
- inspect_ai/_view/www/src/{samples → app/samples}/chat/tools/ToolOutput.module.css +1 -0
- inspect_ai/_view/www/src/{samples → app/samples}/chat/tools/ToolOutput.tsx +1 -1
- inspect_ai/_view/www/src/{samples → app/samples}/chat/tools/ToolTitle.module.css +4 -0
- inspect_ai/_view/www/src/{samples → app/samples}/chat/tools/ToolTitle.tsx +2 -2
- inspect_ai/_view/www/src/{samples → app/samples}/chat/tools/tool.ts +1 -1
- inspect_ai/_view/www/src/app/samples/chat/types.ts +1 -0
- inspect_ai/_view/www/src/{samples → app/samples}/descriptor/samplesDescriptor.tsx +38 -15
- inspect_ai/_view/www/src/{samples → app/samples}/descriptor/score/BooleanScoreDescriptor.tsx +1 -1
- inspect_ai/_view/www/src/{samples → app/samples}/descriptor/score/CategoricalScoreDescriptor.tsx +2 -2
- inspect_ai/_view/www/src/{samples → app/samples}/descriptor/score/NumericScoreDescriptor.tsx +3 -3
- inspect_ai/_view/www/src/{samples → app/samples}/descriptor/score/ObjectScoreDescriptor.tsx +4 -4
- inspect_ai/_view/www/src/{samples → app/samples}/descriptor/score/OtherScoreDescriptor.tsx +2 -2
- inspect_ai/_view/www/src/{samples → app/samples}/descriptor/score/PassFailScoreDescriptor.tsx +2 -2
- inspect_ai/_view/www/src/{samples → app/samples}/descriptor/score/ScoreDescriptor.tsx +1 -1
- inspect_ai/_view/www/src/{samples → app/samples}/descriptor/types.ts +4 -3
- inspect_ai/_view/www/src/{samples → app/samples}/error/SampleErrorView.module.css +2 -1
- inspect_ai/_view/www/src/{samples → app/samples}/list/SampleHeader.tsx +3 -0
- inspect_ai/_view/www/src/{samples → app/samples}/list/SampleList.tsx +47 -33
- inspect_ai/_view/www/src/{samples → app/samples}/list/SampleRow.module.css +16 -0
- inspect_ai/_view/www/src/{samples → app/samples}/list/SampleRow.tsx +47 -20
- inspect_ai/_view/www/src/{samples → app/samples}/sample-tools/SelectScorer.tsx +1 -1
- inspect_ai/_view/www/src/{samples → app/samples}/sample-tools/SortFilter.tsx +4 -4
- inspect_ai/_view/www/src/{samples → app/samples}/sample-tools/filters.ts +8 -6
- inspect_ai/_view/www/src/{samples → app/samples}/sample-tools/sample-filter/SampleFilter.tsx +4 -3
- inspect_ai/_view/www/src/{samples → app/samples}/sample-tools/sample-filter/completions.ts +1 -1
- inspect_ai/_view/www/src/{samples → app/samples}/sample-tools/sample-filter/language.ts +1 -0
- inspect_ai/_view/www/src/{samples → app/samples}/sampleDataAdapter.ts +3 -3
- inspect_ai/_view/www/src/{samples → app/samples}/sampleLimit.ts +1 -1
- inspect_ai/_view/www/src/{samples → app/samples}/scores/SampleScores.tsx +1 -1
- inspect_ai/_view/www/src/{samples → app/samples}/scores/SampleScoresGrid.tsx +12 -11
- inspect_ai/_view/www/src/{samples → app/samples}/scores/SampleScoresView.tsx +6 -6
- inspect_ai/_view/www/src/{samples → app/samples}/transcript/ApprovalEventView.tsx +1 -1
- inspect_ai/_view/www/src/{samples → app/samples}/transcript/ErrorEventView.tsx +3 -3
- inspect_ai/_view/www/src/{samples → app/samples}/transcript/InfoEventView.tsx +4 -4
- inspect_ai/_view/www/src/{samples → app/samples}/transcript/InputEventView.tsx +3 -3
- inspect_ai/_view/www/src/{samples → app/samples}/transcript/LoggerEventView.tsx +3 -3
- inspect_ai/_view/www/src/{samples → app/samples}/transcript/ModelEventView.module.css +13 -7
- inspect_ai/_view/www/src/{samples → app/samples}/transcript/ModelEventView.tsx +49 -21
- inspect_ai/_view/www/src/{samples → app/samples}/transcript/SampleInitEventView.tsx +11 -9
- inspect_ai/_view/www/src/{samples → app/samples}/transcript/SampleLimitEventView.tsx +1 -1
- inspect_ai/_view/www/src/{samples → app/samples}/transcript/SandboxEventView.tsx +8 -6
- inspect_ai/_view/www/src/{samples → app/samples}/transcript/ScoreEventView.tsx +4 -4
- inspect_ai/_view/www/src/{samples → app/samples}/transcript/StepEventView.tsx +11 -3
- inspect_ai/_view/www/src/{samples → app/samples}/transcript/SubtaskEventView.tsx +2 -2
- inspect_ai/_view/www/src/{samples → app/samples}/transcript/ToolEventView.tsx +2 -2
- inspect_ai/_view/www/src/{samples → app/samples}/transcript/TranscriptView.module.css +8 -7
- inspect_ai/_view/www/src/{samples → app/samples}/transcript/TranscriptView.tsx +32 -114
- inspect_ai/_view/www/src/{samples → app/samples}/transcript/TranscriptVirtualListComponent.module.css +6 -5
- inspect_ai/_view/www/src/{samples → app/samples}/transcript/TranscriptVirtualListComponent.tsx +14 -2
- inspect_ai/_view/www/src/{samples → app/samples}/transcript/event/EventPanel.tsx +2 -2
- inspect_ai/_view/www/src/{samples → app/samples}/transcript/event/EventTimingPanel.tsx +1 -1
- inspect_ai/_view/www/src/{samples → app/samples}/transcript/event/utils.ts +1 -1
- inspect_ai/_view/www/src/{samples → app/samples}/transcript/state/StateEventRenderers.tsx +23 -21
- inspect_ai/_view/www/src/{samples → app/samples}/transcript/state/StateEventRenders.module.css +7 -0
- inspect_ai/_view/www/src/{samples → app/samples}/transcript/state/StateEventView.tsx +2 -2
- inspect_ai/_view/www/src/app/samples/transcript/transform/fixups.ts +142 -0
- inspect_ai/_view/www/src/app/samples/transcript/transform/treeify.ts +39 -0
- inspect_ai/_view/www/src/{samples → app/samples}/transcript/types.ts +1 -1
- inspect_ai/_view/www/src/{workspace → app}/sidebar/EvalStatus.tsx +1 -1
- inspect_ai/_view/www/src/app/sidebar/LogDirectoryTitleView.module.css +16 -0
- inspect_ai/_view/www/src/app/sidebar/LogDirectoryTitleView.tsx +70 -0
- inspect_ai/_view/www/src/{workspace → app}/sidebar/Sidebar.module.css +8 -0
- inspect_ai/_view/www/src/{workspace → app}/sidebar/Sidebar.tsx +35 -17
- inspect_ai/_view/www/src/{workspace → app}/sidebar/SidebarLogEntry.tsx +1 -1
- inspect_ai/_view/www/src/{workspace → app}/sidebar/SidebarScoreView.tsx +2 -2
- inspect_ai/_view/www/src/{workspace → app}/sidebar/SidebarScoresView.tsx +2 -2
- inspect_ai/_view/www/src/{types.ts → app/types.ts} +18 -11
- inspect_ai/_view/www/src/{usage → app/usage}/ModelTokenTable.tsx +1 -1
- inspect_ai/_view/www/src/{usage → app/usage}/ModelUsagePanel.tsx +2 -2
- inspect_ai/_view/www/src/{usage → app/usage}/TokenTable.tsx +1 -1
- inspect_ai/_view/www/src/{usage → app/usage}/UsageCard.tsx +6 -6
- inspect_ai/_view/www/src/{api → client/api}/api-browser.ts +2 -2
- inspect_ai/_view/www/src/{api → client/api}/api-http.ts +3 -3
- inspect_ai/_view/www/src/{api → client/api}/api-vscode.ts +2 -2
- inspect_ai/_view/www/src/{api → client/api}/client-api.ts +6 -5
- inspect_ai/_view/www/src/{api → client/api}/index.ts +2 -2
- inspect_ai/_view/www/src/{api → client/api}/types.ts +4 -1
- inspect_ai/_view/www/src/{logfile → client/remote}/remoteLogFile.ts +3 -3
- inspect_ai/_view/www/src/{storage → client/storage}/index.ts +11 -5
- inspect_ai/_view/www/src/components/Card.tsx +1 -1
- inspect_ai/_view/www/src/components/CopyButton.tsx +1 -1
- inspect_ai/_view/www/src/components/DownloadButton.tsx +1 -1
- inspect_ai/_view/www/src/components/ErrorPanel.tsx +1 -1
- inspect_ai/_view/www/src/components/{ExpandablePanel.css → ExpandablePanel.module.css} +14 -11
- inspect_ai/_view/www/src/components/ExpandablePanel.tsx +16 -10
- inspect_ai/_view/www/src/components/FindBand.tsx +1 -1
- inspect_ai/_view/www/src/components/JsonPanel.css +2 -2
- inspect_ai/_view/www/src/components/LargeModal.tsx +12 -1
- inspect_ai/_view/www/src/components/LightboxCarousel.tsx +1 -1
- inspect_ai/_view/www/src/components/MarkdownDiv.tsx +3 -1
- inspect_ai/_view/www/src/components/MessageBand.tsx +1 -1
- inspect_ai/_view/www/src/components/NoContentsPanel.tsx +1 -1
- inspect_ai/_view/www/src/constants.ts +10 -9
- inspect_ai/_view/www/src/index.tsx +27 -11
- inspect_ai/_view/www/src/state/appSlice.ts +44 -5
- inspect_ai/_view/www/src/state/hooks.ts +30 -7
- inspect_ai/_view/www/src/state/logSlice.ts +7 -5
- inspect_ai/_view/www/src/state/logsPolling.ts +1 -1
- inspect_ai/_view/www/src/state/logsSlice.ts +18 -13
- inspect_ai/_view/www/src/state/samplePolling.ts +12 -12
- inspect_ai/_view/www/src/state/sampleSlice.ts +3 -5
- inspect_ai/_view/www/src/state/sampleUtils.ts +1 -1
- inspect_ai/_view/www/src/{scoring/utils.ts → state/scoring.ts} +2 -2
- inspect_ai/_view/www/src/state/store.ts +9 -7
- inspect_ai/_view/www/src/state/utils.ts +1 -1
- inspect_ai/_view/www/src/tests/README.md +49 -0
- inspect_ai/_view/www/src/tests/__mocks__/fileMock.js +1 -0
- inspect_ai/_view/www/src/tests/__mocks__/styleMock.js +1 -0
- inspect_ai/_view/www/src/tests/setupTests.mjs +1 -0
- inspect_ai/_view/www/src/tests/utils/base64.test.ts +23 -0
- inspect_ai/_view/www/src/tests/utils/format.test.ts +127 -0
- inspect_ai/_view/www/src/tests/utils/path.test.ts +54 -0
- inspect_ai/_view/www/src/utils/format.ts +8 -2
- inspect_ai/_view/www/src/utils/path.ts +14 -2
- inspect_ai/_view/www/src/utils/polling.ts +1 -2
- inspect_ai/_view/www/src/utils/uri.ts +32 -0
- inspect_ai/_view/www/yarn.lock +3310 -382
- inspect_ai/agent/_handoff.py +6 -3
- inspect_ai/agent/_human/agent.py +5 -3
- inspect_ai/agent/_human/install.py +16 -7
- inspect_ai/agent/_human/panel.py +14 -1
- inspect_ai/agent/_human/service.py +5 -1
- inspect_ai/agent/_react.py +161 -128
- inspect_ai/agent/_types.py +15 -4
- inspect_ai/approval/_policy.py +2 -2
- inspect_ai/log/_file.py +30 -11
- inspect_ai/log/_log.py +7 -1
- inspect_ai/log/_recorders/eval.py +3 -0
- inspect_ai/log/_recorders/types.py +1 -0
- inspect_ai/log/_samples.py +4 -0
- inspect_ai/model/_call_tools.py +33 -17
- inspect_ai/model/_generate_config.py +10 -2
- inspect_ai/model/_model.py +41 -21
- inspect_ai/model/_model_output.py +2 -1
- inspect_ai/model/_openai.py +10 -8
- inspect_ai/model/_openai_responses.py +95 -42
- inspect_ai/model/_providers/anthropic.py +14 -12
- inspect_ai/model/_providers/google.py +191 -95
- inspect_ai/model/_providers/hf.py +1 -1
- inspect_ai/model/_providers/mistral.py +2 -3
- inspect_ai/model/_providers/openai.py +54 -17
- inspect_ai/model/_providers/openai_o1.py +1 -1
- inspect_ai/model/_providers/openai_responses.py +28 -16
- inspect_ai/model/_providers/openrouter.py +14 -0
- inspect_ai/model/_providers/providers.py +2 -2
- inspect_ai/model/_providers/util/chatapi.py +17 -7
- inspect_ai/model/_providers/vllm.py +1 -1
- inspect_ai/scorer/_metric.py +17 -1
- inspect_ai/scorer/_model.py +51 -6
- inspect_ai/scorer/_scorer.py +1 -1
- inspect_ai/solver/_human_agent.py +3 -0
- inspect_ai/solver/_plan.py +1 -1
- inspect_ai/solver/_solver.py +1 -1
- inspect_ai/solver/_use_tools.py +14 -8
- inspect_ai/tool/__init__.py +16 -1
- inspect_ai/tool/_json_rpc_helpers.py +285 -0
- inspect_ai/tool/_mcp/__init__.py +13 -0
- inspect_ai/tool/_mcp/_context.py +14 -0
- inspect_ai/tool/_mcp/_mcp.py +293 -0
- inspect_ai/tool/_mcp/_sandbox.py +104 -0
- inspect_ai/tool/_mcp/_types.py +31 -0
- inspect_ai/tool/_mcp/connection.py +60 -0
- inspect_ai/tool/_mcp/sampling.py +118 -0
- inspect_ai/tool/_mcp/server.py +112 -0
- inspect_ai/tool/_mcp/tools.py +34 -0
- inspect_ai/tool/_tool.py +13 -0
- inspect_ai/tool/_tool_def.py +24 -7
- inspect_ai/tool/_tool_support_helpers.py +129 -153
- inspect_ai/tool/_tools/_bash_session.py +11 -11
- inspect_ai/tool/_tools/_text_editor.py +6 -6
- inspect_ai/tool/_tools/_web_browser/_web_browser.py +8 -8
- inspect_ai/util/_anyio.py +31 -20
- inspect_ai/util/_json.py +20 -2
- inspect_ai/util/_sandbox/context.py +18 -7
- inspect_ai/util/_sandbox/docker/compose.py +1 -1
- inspect_ai/util/_sandbox/docker/docker.py +92 -21
- inspect_ai/util/_sandbox/environment.py +33 -2
- inspect_ai/util/_sandbox/events.py +2 -2
- inspect_ai/util/_sandbox/service.py +13 -3
- {inspect_ai-0.3.90.dist-info → inspect_ai-0.3.92.dist-info}/METADATA +6 -2
- inspect_ai-0.3.92.dist-info/RECORD +732 -0
- {inspect_ai-0.3.90.dist-info → inspect_ai-0.3.92.dist-info}/WHEEL +1 -1
- inspect_ai/_view/www/src/App.tsx +0 -316
- inspect_ai/_view/www/src/samples/chat/MessageContent.module.css +0 -4
- inspect_ai/_view/www/src/samples/chat/MessageContents.module.css +0 -3
- inspect_ai/_view/www/src/samples/chat/tools/ToolCallView.module.css +0 -3
- inspect_ai/_view/www/src/samples/chat/tools/ToolInput.module.css +0 -14
- inspect_ai/_view/www/src/workspace/WorkSpace.tsx +0 -292
- inspect_ai/_view/www/src/workspace/sidebar/LogDirectoryTitleView.module.css +0 -5
- inspect_ai/_view/www/src/workspace/sidebar/LogDirectoryTitleView.tsx +0 -57
- inspect_ai/_view/www/src/workspace/tabs/JsonTab.tsx +0 -43
- inspect_ai-0.3.90.dist-info/RECORD +0 -705
- /inspect_ai/_view/www/src/{types → @types}/asciicinema-player.d.ts +0 -0
- /inspect_ai/_view/www/src/{types → @types}/jsondiffpatch.d.ts +0 -0
- /inspect_ai/_view/www/src/{types → @types}/markdown-it-katex.d.ts +0 -0
- /inspect_ai/_view/www/src/{types → @types}/prism.d.ts +0 -0
- /inspect_ai/_view/www/src/{appearance → app/appearance}/colors.ts +0 -0
- /inspect_ai/_view/www/src/{appearance → app/appearance}/fonts.ts +0 -0
- /inspect_ai/_view/www/src/{appearance → app/appearance}/styles.ts +0 -0
- /inspect_ai/_view/www/src/{metadata → app/content}/MetaDataGrid.tsx +0 -0
- /inspect_ai/_view/www/src/{metadata → app/content}/MetaDataView.module.css +0 -0
- /inspect_ai/_view/www/src/{metadata → app/content}/MetaDataView.tsx +0 -0
- /inspect_ai/_view/www/src/{metadata → app/content}/MetadataGrid.module.css +0 -0
- /inspect_ai/_view/www/src/{metadata → app/content}/RenderedContent.module.css +0 -0
- /inspect_ai/_view/www/src/{metadata → app/content}/types.ts +0 -0
- /inspect_ai/_view/www/src/{workspace/WorkSpaceView.module.css → app/log-view/LogView.module.css} +0 -0
- /inspect_ai/_view/www/src/{workspace → app/log-view}/error/TaskErrorPanel.module.css +0 -0
- /inspect_ai/_view/www/src/{workspace → app/log-view}/navbar/ModelRolesView.module.css +0 -0
- /inspect_ai/_view/www/src/{workspace → app/log-view}/navbar/Navbar.module.css +0 -0
- /inspect_ai/_view/www/src/{workspace → app/log-view}/navbar/PrimaryBar.module.css +0 -0
- /inspect_ai/_view/www/src/{workspace → app/log-view}/navbar/ResultsPanel.module.css +0 -0
- /inspect_ai/_view/www/src/{workspace → app/log-view}/navbar/RunningStatusPanel.module.css +0 -0
- /inspect_ai/_view/www/src/{workspace → app/log-view}/navbar/ScoreGrid.module.css +0 -0
- /inspect_ai/_view/www/src/{workspace → app/log-view}/navbar/SecondaryBar.module.css +0 -0
- /inspect_ai/_view/www/src/{workspace → app/log-view}/navbar/StatusPanel.module.css +0 -0
- /inspect_ai/_view/www/src/{workspace → app/log-view}/navbar/StatusPanel.tsx +0 -0
- /inspect_ai/_view/www/src/{workspace → app/log-view}/tabs/InfoTab.module.css +0 -0
- /inspect_ai/_view/www/src/{workspace → app/log-view}/tabs/JsonTab.module.css +0 -0
- /inspect_ai/_view/www/src/{workspace → app/log-view}/tabs/RunningNoSamples.module.css +0 -0
- /inspect_ai/_view/www/src/{workspace → app/log-view}/tabs/RunningNoSamples.tsx +0 -0
- /inspect_ai/_view/www/src/{workspace → app/log-view}/types.ts +0 -0
- /inspect_ai/_view/www/src/{workspace → app/log-view}/utils.ts +0 -0
- /inspect_ai/_view/www/src/{plan → app/plan}/DatasetDetailView.module.css +0 -0
- /inspect_ai/_view/www/src/{plan → app/plan}/DetailStep.module.css +0 -0
- /inspect_ai/_view/www/src/{plan → app/plan}/ModelCard.module.css +0 -0
- /inspect_ai/_view/www/src/{plan → app/plan}/PlanDetailView.module.css +0 -0
- /inspect_ai/_view/www/src/{plan → app/plan}/ScorerDetailView.module.css +0 -0
- /inspect_ai/_view/www/src/{plan → app/plan}/ScorerDetailView.tsx +0 -0
- /inspect_ai/_view/www/src/{plan → app/plan}/SolverDetailView.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/InlineSampleDisplay.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/chat/ChatMessageRow.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/chat/ChatViewVirtualList.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/descriptor/score/BooleanScoreDescriptor.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/descriptor/score/ObjectScoreDescriptor.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/descriptor/score/PassFailScoreDescriptor.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/error/FlatSampleErrorView.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/error/FlatSampleErrorView.tsx +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/error/SampleErrorView.tsx +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/error/error.ts +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/list/SampleFooter.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/list/SampleFooter.tsx +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/list/SampleHeader.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/list/SampleList.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/list/SampleSeparator.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/list/SampleSeparator.tsx +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/sample-tools/EpochFilter.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/sample-tools/EpochFilter.tsx +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/sample-tools/SelectScorer.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/sample-tools/SortFilter.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/sample-tools/sample-filter/SampleFilter.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/sample-tools/sample-filter/tokenize.ts +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/scores/SampleScores.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/scores/SampleScoresGrid.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/scores/SampleScoresView.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/transcript/InfoEventView.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/transcript/LoggerEventView.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/transcript/SampleInitEventView.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/transcript/SandboxEventView.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/transcript/ScoreEventView.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/transcript/SubtaskEventView.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/transcript/ToolEventView.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/transcript/event/EventNav.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/transcript/event/EventNav.tsx +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/transcript/event/EventNavs.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/transcript/event/EventNavs.tsx +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/transcript/event/EventPanel.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/transcript/event/EventProgressPanel.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/transcript/event/EventProgressPanel.tsx +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/transcript/event/EventRow.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/transcript/event/EventRow.tsx +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/transcript/event/EventSection.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/transcript/event/EventSection.tsx +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/transcript/event/EventTimingPanel.module.css +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/transcript/state/StateDiffView.tsx +0 -0
- /inspect_ai/_view/www/src/{samples → app/samples}/transcript/state/StateEventView.module.css +0 -0
- /inspect_ai/_view/www/src/{workspace → app}/sidebar/EvalStatus.module.css +0 -0
- /inspect_ai/_view/www/src/{workspace → app}/sidebar/SidebarLogEntry.module.css +0 -0
- /inspect_ai/_view/www/src/{workspace → app}/sidebar/SidebarScoreView.module.css +0 -0
- /inspect_ai/_view/www/src/{workspace → app}/sidebar/SidebarScoresView.module.css +0 -0
- /inspect_ai/_view/www/src/{usage → app/usage}/ModelUsagePanel.module.css +0 -0
- /inspect_ai/_view/www/src/{usage → app/usage}/TokenTable.module.css +0 -0
- /inspect_ai/_view/www/src/{usage → app/usage}/UsageCard.module.css +0 -0
- /inspect_ai/_view/www/src/{api → client/api}/api-shared.ts +0 -0
- /inspect_ai/_view/www/src/{api → client/api}/jsonrpc.ts +0 -0
- /inspect_ai/_view/www/src/{logfile → client/remote}/remoteZipFile.ts +0 -0
- {inspect_ai-0.3.90.dist-info → inspect_ai-0.3.92.dist-info}/entry_points.txt +0 -0
- {inspect_ai-0.3.90.dist-info → inspect_ai-0.3.92.dist-info}/licenses/LICENSE +0 -0
- {inspect_ai-0.3.90.dist-info → inspect_ai-0.3.92.dist-info}/top_level.txt +0 -0
@@ -1,10 +1,10 @@
|
|
1
1
|
import clsx from "clsx";
|
2
2
|
import { FC, Fragment, JSX, ReactNode } from "react";
|
3
|
+
import { JsonChange, Messages } from "../../../../@types/log";
|
3
4
|
import {
|
4
5
|
HumanBaselineView,
|
5
6
|
SessionLog,
|
6
|
-
} from "
|
7
|
-
import { JsonChange, Messages } from "../../../types/log";
|
7
|
+
} from "../../../../components/HumanBaselineView";
|
8
8
|
import { ChatView } from "../../chat/ChatView";
|
9
9
|
|
10
10
|
import styles from "./StateEventRenders.module.css";
|
@@ -204,7 +204,7 @@ const renderTools = (
|
|
204
204
|
>
|
205
205
|
{key}
|
206
206
|
</div>
|
207
|
-
|
207
|
+
{toolsInfo[key]}
|
208
208
|
</Fragment>
|
209
209
|
);
|
210
210
|
})}
|
@@ -275,19 +275,23 @@ interface ToolsProps {
|
|
275
275
|
* Renders a list of tool components based on the provided tool definitions.
|
276
276
|
*/
|
277
277
|
export const Tools: FC<ToolsProps> = ({ toolDefinitions }) => {
|
278
|
-
return
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
278
|
+
return (
|
279
|
+
<div className={styles.toolsGrid}>
|
280
|
+
{toolDefinitions.map((toolDefinition, idx) => {
|
281
|
+
const toolName = toolDefinition.name;
|
282
|
+
const toolArgs = toolDefinition.parameters?.properties
|
283
|
+
? Object.keys(toolDefinition.parameters.properties)
|
284
|
+
: [];
|
285
|
+
return (
|
286
|
+
<Tool
|
287
|
+
key={`${toolName}-${idx}`}
|
288
|
+
toolName={toolName}
|
289
|
+
toolArgs={toolArgs}
|
290
|
+
/>
|
291
|
+
);
|
292
|
+
})}
|
293
|
+
</div>
|
294
|
+
);
|
291
295
|
};
|
292
296
|
|
293
297
|
interface ToolProps {
|
@@ -304,10 +308,8 @@ export const Tool: FC<ToolProps> = ({ toolName, toolArgs }) => {
|
|
304
308
|
? `${toolName}(${toolArgs.join(", ")})`
|
305
309
|
: toolName;
|
306
310
|
return (
|
307
|
-
<
|
308
|
-
|
309
|
-
|
310
|
-
</code>
|
311
|
-
</div>
|
311
|
+
<code className={clsx("text-size-smallest", styles.tool)}>
|
312
|
+
{functionCall}
|
313
|
+
</code>
|
312
314
|
);
|
313
315
|
};
|
inspect_ai/_view/www/src/{samples → app/samples}/transcript/state/StateEventRenders.module.css
RENAMED
@@ -1,10 +1,17 @@
|
|
1
|
+
.toolsGrid {
|
2
|
+
display: grid;
|
3
|
+
row-gap: 0em;
|
4
|
+
}
|
5
|
+
|
1
6
|
.tools {
|
2
7
|
display: grid;
|
3
8
|
grid-template-columns: max-content max-content;
|
4
9
|
column-gap: 1rem;
|
5
10
|
margin: 0;
|
11
|
+
align-items: baseline;
|
6
12
|
}
|
7
13
|
|
8
14
|
.tool {
|
9
15
|
padding: 0;
|
16
|
+
color: inherit !important;
|
10
17
|
}
|
@@ -7,8 +7,8 @@ import {
|
|
7
7
|
Op,
|
8
8
|
StateEvent,
|
9
9
|
StoreEvent,
|
10
|
-
} from "
|
11
|
-
import { formatDateTime } from "
|
10
|
+
} from "../../../../@types/log";
|
11
|
+
import { formatDateTime } from "../../../../utils/format";
|
12
12
|
import { EventPanel } from "../event/EventPanel";
|
13
13
|
import { StateDiffView } from "./StateDiffView";
|
14
14
|
import {
|
@@ -0,0 +1,142 @@
|
|
1
|
+
// This is a special name that signals a group of sandbox events.
|
2
|
+
|
3
|
+
import { Events, StepEvent } from "../../../../@types/log";
|
4
|
+
|
5
|
+
// It will be caught elsewhere and rendered with a pretty name
|
6
|
+
export const kSandboxSignalName = "53787D8A-D3FC-426D-B383-9F880B70E4AA";
|
7
|
+
|
8
|
+
/**
|
9
|
+
* Normalizes event content
|
10
|
+
*/
|
11
|
+
export const fixupEventStream = (
|
12
|
+
events: Events,
|
13
|
+
filterPending: boolean = true,
|
14
|
+
) => {
|
15
|
+
// We ignore pending events sometimes (when an eval is complete) and
|
16
|
+
// show them other times (when an eval is running)
|
17
|
+
const collapsed = processPendingEvents(events, filterPending);
|
18
|
+
|
19
|
+
// We need to inject a step event for sample_init if it doesn't exist
|
20
|
+
const fixedUp = collapseSampleInit(collapsed);
|
21
|
+
|
22
|
+
// Inject step events before and after groups of sandbox events
|
23
|
+
return groupSandboxEvents(fixedUp);
|
24
|
+
};
|
25
|
+
|
26
|
+
const processPendingEvents = (events: Events, filter: boolean): Events => {
|
27
|
+
// If filtering pending, just remove all pending events
|
28
|
+
// otherise, collapse sequential pending events of the same
|
29
|
+
// type
|
30
|
+
return filter
|
31
|
+
? events.filter((e) => !e.pending)
|
32
|
+
: events.reduce<Events>((acc, event) => {
|
33
|
+
// Collapse sequential pending events of the same type
|
34
|
+
if (!event.pending) {
|
35
|
+
// Not a pending event
|
36
|
+
acc.push(event);
|
37
|
+
} else {
|
38
|
+
// For pending events, replace previous pending or add new
|
39
|
+
const lastIndex = acc.length - 1;
|
40
|
+
if (
|
41
|
+
lastIndex >= 0 &&
|
42
|
+
acc[lastIndex].pending &&
|
43
|
+
acc[lastIndex].event === event.event
|
44
|
+
) {
|
45
|
+
// Replace previous pending with current one (if they're of the same type)
|
46
|
+
acc[lastIndex] = event;
|
47
|
+
} else {
|
48
|
+
// First event or follows non-pending
|
49
|
+
acc.push(event);
|
50
|
+
}
|
51
|
+
}
|
52
|
+
return acc;
|
53
|
+
}, []);
|
54
|
+
};
|
55
|
+
|
56
|
+
const collapseSampleInit = (events: Events): Events => {
|
57
|
+
// See if the events have an init step
|
58
|
+
const hasInitStep =
|
59
|
+
events.findIndex((e) => {
|
60
|
+
return e.event === "step" && e.name === "init";
|
61
|
+
}) !== -1;
|
62
|
+
|
63
|
+
const initEventIndex = events.findIndex((e) => {
|
64
|
+
return e.event === "sample_init";
|
65
|
+
});
|
66
|
+
const initEvent = events[initEventIndex];
|
67
|
+
|
68
|
+
const fixedUp = [...events];
|
69
|
+
if (!hasInitStep && initEvent) {
|
70
|
+
fixedUp.splice(initEventIndex, 0, {
|
71
|
+
timestamp: initEvent.timestamp,
|
72
|
+
event: "step",
|
73
|
+
action: "begin",
|
74
|
+
type: null,
|
75
|
+
name: "sample_init",
|
76
|
+
pending: false,
|
77
|
+
working_start: 0,
|
78
|
+
});
|
79
|
+
|
80
|
+
fixedUp.splice(initEventIndex + 2, 0, {
|
81
|
+
timestamp: initEvent.timestamp,
|
82
|
+
event: "step",
|
83
|
+
action: "end",
|
84
|
+
type: null,
|
85
|
+
name: "sample_init",
|
86
|
+
pending: false,
|
87
|
+
working_start: 0,
|
88
|
+
});
|
89
|
+
}
|
90
|
+
return fixedUp;
|
91
|
+
};
|
92
|
+
|
93
|
+
const groupSandboxEvents = (events: Events): Events => {
|
94
|
+
const result: Events = [];
|
95
|
+
const pendingSandboxEvents: Events = [];
|
96
|
+
|
97
|
+
const pushPendingSandboxEvents = () => {
|
98
|
+
const timestamp =
|
99
|
+
pendingSandboxEvents[pendingSandboxEvents.length - 1].timestamp;
|
100
|
+
result.push(createStepEvent(kSandboxSignalName, timestamp, "begin"));
|
101
|
+
result.push(...pendingSandboxEvents);
|
102
|
+
result.push(createStepEvent(kSandboxSignalName, timestamp, "end"));
|
103
|
+
pendingSandboxEvents.length = 0;
|
104
|
+
};
|
105
|
+
|
106
|
+
for (const event of events) {
|
107
|
+
if (event.event === "sandbox") {
|
108
|
+
// Collect sandbox events
|
109
|
+
pendingSandboxEvents.push(event);
|
110
|
+
continue;
|
111
|
+
}
|
112
|
+
|
113
|
+
// Process any collected sandbox events
|
114
|
+
if (pendingSandboxEvents.length > 0) {
|
115
|
+
pushPendingSandboxEvents();
|
116
|
+
}
|
117
|
+
|
118
|
+
// Clear sandbox events and add the current event
|
119
|
+
result.push(event);
|
120
|
+
}
|
121
|
+
|
122
|
+
// Handle any remaining sandbox events at the end
|
123
|
+
if (pendingSandboxEvents.length > 0) {
|
124
|
+
pushPendingSandboxEvents();
|
125
|
+
}
|
126
|
+
|
127
|
+
return result;
|
128
|
+
};
|
129
|
+
|
130
|
+
const createStepEvent = (
|
131
|
+
name: string,
|
132
|
+
timestamp: string,
|
133
|
+
action: "begin" | "end",
|
134
|
+
): StepEvent => ({
|
135
|
+
timestamp,
|
136
|
+
event: "step",
|
137
|
+
action,
|
138
|
+
type: null,
|
139
|
+
name,
|
140
|
+
pending: false,
|
141
|
+
working_start: 0,
|
142
|
+
});
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { Events } from "../../../../@types/log";
|
2
|
+
import { EventNode, EventType } from "../types";
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Gathers events into a hierarchy of EventNodes.
|
6
|
+
*/
|
7
|
+
export function treeifyEvents(events: Events, depth: number): EventNode[] {
|
8
|
+
const rootNodes: EventNode[] = [];
|
9
|
+
const stack: EventNode[] = [];
|
10
|
+
|
11
|
+
const pushNode = (event: EventType): EventNode => {
|
12
|
+
const node = new EventNode(event, stack.length + depth);
|
13
|
+
if (stack.length > 0) {
|
14
|
+
const parentNode = stack[stack.length - 1];
|
15
|
+
parentNode.children.push(node);
|
16
|
+
} else {
|
17
|
+
rootNodes.push(node);
|
18
|
+
}
|
19
|
+
return node;
|
20
|
+
};
|
21
|
+
|
22
|
+
events.forEach((event) => {
|
23
|
+
if (event.event === "step" && event.action === "begin") {
|
24
|
+
// Starting a new step
|
25
|
+
const node = pushNode(event);
|
26
|
+
stack.push(node);
|
27
|
+
} else if (event.event === "step" && event.action === "end") {
|
28
|
+
// An ending step
|
29
|
+
if (stack.length > 0) {
|
30
|
+
stack.pop();
|
31
|
+
}
|
32
|
+
} else {
|
33
|
+
// An event
|
34
|
+
pushNode(event);
|
35
|
+
}
|
36
|
+
});
|
37
|
+
|
38
|
+
return rootNodes;
|
39
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import clsx from "clsx";
|
2
2
|
import { FC } from "react";
|
3
|
-
import { EvalLogHeader } from "../../api/types";
|
3
|
+
import { EvalLogHeader } from "../../client/api/types";
|
4
4
|
import styles from "./EvalStatus.module.css";
|
5
5
|
import { SidebarScoreView } from "./SidebarScoreView";
|
6
6
|
import { SidebarScoresView } from "./SidebarScoresView";
|
@@ -0,0 +1,16 @@
|
|
1
|
+
.dirname {
|
2
|
+
overflow: hidden;
|
3
|
+
white-space: nowrap;
|
4
|
+
text-overflow: ellipsis;
|
5
|
+
}
|
6
|
+
|
7
|
+
.directoryLink {
|
8
|
+
color: inherit;
|
9
|
+
text-decoration: none;
|
10
|
+
cursor: pointer;
|
11
|
+
}
|
12
|
+
|
13
|
+
.directoryLink:hover {
|
14
|
+
color: var(--bs-primary);
|
15
|
+
text-decoration: none;
|
16
|
+
}
|
@@ -0,0 +1,70 @@
|
|
1
|
+
import clsx from "clsx";
|
2
|
+
import { FC, useCallback } from "react";
|
3
|
+
import { Link } from "react-router-dom";
|
4
|
+
import { useStore } from "../../state/store";
|
5
|
+
import styles from "./LogDirectoryTitleView.module.css";
|
6
|
+
|
7
|
+
interface LogDirectoryTitleViewProps {
|
8
|
+
log_dir?: string;
|
9
|
+
}
|
10
|
+
|
11
|
+
export const LogDirectoryTitleView: FC<LogDirectoryTitleViewProps> = ({
|
12
|
+
log_dir,
|
13
|
+
}) => {
|
14
|
+
const offCanvas = useStore((state) => state.app.offcanvas);
|
15
|
+
const setOffCanvas = useStore((state) => state.appActions.setOffcanvas);
|
16
|
+
|
17
|
+
const handleClick = useCallback(() => {
|
18
|
+
// Close the sidebar when clicking the directory link on mobile
|
19
|
+
if (offCanvas) {
|
20
|
+
setOffCanvas(false);
|
21
|
+
}
|
22
|
+
}, [offCanvas, setOffCanvas]);
|
23
|
+
if (log_dir) {
|
24
|
+
const displayDir = prettyDir(log_dir);
|
25
|
+
return (
|
26
|
+
<Link to="/logs" className={styles.directoryLink} onClick={handleClick}>
|
27
|
+
<div style={{ display: "flex", flexDirection: "column" }}>
|
28
|
+
<span
|
29
|
+
className={clsx(
|
30
|
+
"text-style-secondary",
|
31
|
+
"text-style-label",
|
32
|
+
"text-size-small",
|
33
|
+
)}
|
34
|
+
>
|
35
|
+
Log Directory
|
36
|
+
</span>
|
37
|
+
<span
|
38
|
+
title={displayDir}
|
39
|
+
className={clsx("text-size-base", styles.dirname)}
|
40
|
+
>
|
41
|
+
{offCanvas ? displayDir : ""}
|
42
|
+
</span>
|
43
|
+
</div>
|
44
|
+
</Link>
|
45
|
+
);
|
46
|
+
} else {
|
47
|
+
return (
|
48
|
+
<Link to="/logs" className={styles.directoryLink} onClick={handleClick}>
|
49
|
+
<span className={clsx("text-size-title")}>
|
50
|
+
{offCanvas ? "Log History" : ""}
|
51
|
+
</span>
|
52
|
+
</Link>
|
53
|
+
);
|
54
|
+
}
|
55
|
+
};
|
56
|
+
|
57
|
+
const prettyDir = (path: string): string => {
|
58
|
+
try {
|
59
|
+
// Try to create a new URL object
|
60
|
+
let url = new URL(path);
|
61
|
+
|
62
|
+
if (url.protocol === "file:") {
|
63
|
+
return url.pathname;
|
64
|
+
} else {
|
65
|
+
return path;
|
66
|
+
}
|
67
|
+
} catch {
|
68
|
+
return path;
|
69
|
+
}
|
70
|
+
};
|
@@ -1,17 +1,18 @@
|
|
1
1
|
import clsx from "clsx";
|
2
|
-
import { FC,
|
2
|
+
import { FC, useCallback, useEffect, useRef } from "react";
|
3
|
+
import { Link } from "react-router-dom";
|
3
4
|
import { Fragment } from "react/jsx-runtime";
|
4
|
-
import { EvalLogHeader
|
5
|
-
import { ApplicationIcons } from "../../appearance/icons";
|
5
|
+
import { EvalLogHeader } from "../../client/api/types";
|
6
6
|
import { ProgressBar } from "../../components/ProgressBar";
|
7
7
|
import { useStatefulScrollPosition } from "../../state/scrolling";
|
8
8
|
import { useStore } from "../../state/store";
|
9
|
+
import { ApplicationIcons } from "../appearance/icons";
|
10
|
+
import { logUrl } from "../routing/url";
|
9
11
|
import { LogDirectoryTitleView } from "./LogDirectoryTitleView";
|
10
12
|
import styles from "./Sidebar.module.css";
|
11
13
|
import { SidebarLogEntry } from "./SidebarLogEntry";
|
12
14
|
|
13
15
|
interface SidebarProps {
|
14
|
-
logs: LogFiles;
|
15
16
|
logHeaders: Record<string, EvalLogHeader>;
|
16
17
|
loading: boolean;
|
17
18
|
selectedIndex: number;
|
@@ -19,12 +20,12 @@ interface SidebarProps {
|
|
19
20
|
}
|
20
21
|
|
21
22
|
export const Sidebar: FC<SidebarProps> = ({
|
22
|
-
logs,
|
23
23
|
logHeaders,
|
24
24
|
loading,
|
25
25
|
selectedIndex,
|
26
26
|
onSelectedIndexChanged,
|
27
27
|
}) => {
|
28
|
+
const logs = useStore((state) => state.logs.logs);
|
28
29
|
const setOffCanvas = useStore((state) => state.appActions.setOffcanvas);
|
29
30
|
const offCanvas = useStore((state) => state.app.offcanvas);
|
30
31
|
const handleToggle = useCallback(() => {
|
@@ -34,13 +35,19 @@ export const Sidebar: FC<SidebarProps> = ({
|
|
34
35
|
const sidebarContentsRef = useRef(null);
|
35
36
|
useStatefulScrollPosition(sidebarContentsRef, "sidebar-contents", 1000);
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
38
|
+
// Scroll the selected log into view when it changes
|
39
|
+
const itemRefs = useRef<{ [index: number]: HTMLLIElement | null }>({});
|
40
|
+
|
41
|
+
useEffect(() => {
|
42
|
+
if (itemRefs.current[selectedIndex]) {
|
43
|
+
itemRefs.current[selectedIndex]?.scrollIntoView({
|
44
|
+
behavior: "smooth",
|
45
|
+
block: "nearest",
|
46
|
+
});
|
47
|
+
}
|
48
|
+
}, [selectedIndex]);
|
49
|
+
|
50
|
+
// No longer need the click handler as we're using Links now
|
44
51
|
|
45
52
|
return (
|
46
53
|
<Fragment>
|
@@ -78,6 +85,9 @@ export const Sidebar: FC<SidebarProps> = ({
|
|
78
85
|
return (
|
79
86
|
<li
|
80
87
|
key={file.name}
|
88
|
+
ref={(el) => {
|
89
|
+
itemRefs.current[index] = el;
|
90
|
+
}}
|
81
91
|
className={clsx(
|
82
92
|
"list-group-item",
|
83
93
|
"list-group-item-action",
|
@@ -85,12 +95,20 @@ export const Sidebar: FC<SidebarProps> = ({
|
|
85
95
|
selectedIndex === index ? styles.active : undefined,
|
86
96
|
)}
|
87
97
|
data-index={index}
|
88
|
-
onClick={handleClick}
|
89
98
|
>
|
90
|
-
<
|
91
|
-
|
92
|
-
|
93
|
-
|
99
|
+
<Link
|
100
|
+
to={logUrl(file.name, logs.log_dir)}
|
101
|
+
className={styles.logLink}
|
102
|
+
onClick={() => {
|
103
|
+
// Also update the current index in state
|
104
|
+
onSelectedIndexChanged(index);
|
105
|
+
}}
|
106
|
+
>
|
107
|
+
<SidebarLogEntry
|
108
|
+
logHeader={logHeader}
|
109
|
+
task={file.task || "unknown task"}
|
110
|
+
/>
|
111
|
+
</Link>
|
94
112
|
</li>
|
95
113
|
);
|
96
114
|
})}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import clsx from "clsx";
|
2
2
|
import { FC, Fragment } from "react";
|
3
|
-
import { EvalLogHeader } from "../../api/types";
|
3
|
+
import { EvalLogHeader } from "../../client/api/types";
|
4
4
|
import { kModelNone } from "../../constants";
|
5
5
|
import { EvalStatus } from "./EvalStatus";
|
6
6
|
import styles from "./SidebarLogEntry.module.css";
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import clsx from "clsx";
|
2
|
-
import { EvalScore } from "
|
2
|
+
import { EvalScore } from "../../@types/log";
|
3
3
|
import { formatPrettyDecimal } from "../../utils/format";
|
4
4
|
|
5
5
|
import { FC } from "react";
|
6
|
-
import { metricDisplayName } from "../utils";
|
6
|
+
import { metricDisplayName } from "../log-view/utils";
|
7
7
|
import styles from "./SidebarScoreView.module.css";
|
8
8
|
interface SidebarScoreProps {
|
9
9
|
scorer: EvalScore;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import clsx from "clsx";
|
2
2
|
import { FC, Fragment } from "react";
|
3
|
-
import { Scores } from "
|
3
|
+
import { Scores } from "../../@types/log";
|
4
4
|
import { formatPrettyDecimal } from "../../utils/format";
|
5
|
-
import { metricDisplayName } from "../utils";
|
5
|
+
import { metricDisplayName } from "../log-view/utils";
|
6
6
|
import styles from "./SidebarScoresView.module.css";
|
7
7
|
|
8
8
|
interface SidebarScoresProps {
|
@@ -1,14 +1,4 @@
|
|
1
1
|
import { StateSnapshot } from "react-virtuoso";
|
2
|
-
import {
|
3
|
-
AttachmentData,
|
4
|
-
EvalLogHeader,
|
5
|
-
EvalSummary,
|
6
|
-
EventData,
|
7
|
-
LogFiles,
|
8
|
-
PendingSamples,
|
9
|
-
SampleSummary,
|
10
|
-
} from "./api/types";
|
11
|
-
import { ScorerInfo } from "./scoring/utils";
|
12
2
|
import {
|
13
3
|
ApprovalEvent,
|
14
4
|
ContentImage,
|
@@ -26,7 +16,17 @@ import {
|
|
26
16
|
StoreEvent,
|
27
17
|
SubtaskEvent,
|
28
18
|
ToolEvent,
|
29
|
-
} from "
|
19
|
+
} from "../@types/log";
|
20
|
+
import {
|
21
|
+
AttachmentData,
|
22
|
+
EvalLogHeader,
|
23
|
+
EvalSummary,
|
24
|
+
EventData,
|
25
|
+
LogFiles,
|
26
|
+
PendingSamples,
|
27
|
+
SampleSummary,
|
28
|
+
} from "../client/api/types";
|
29
|
+
import { ScorerInfo } from "../state/scoring";
|
30
30
|
|
31
31
|
export interface AppState {
|
32
32
|
status: AppStatus;
|
@@ -44,6 +44,13 @@ export interface AppState {
|
|
44
44
|
collapsed: Record<string, boolean>;
|
45
45
|
messages: Record<string, boolean>;
|
46
46
|
propertyBags: Record<string, Record<string, unknown>>;
|
47
|
+
urlHash?: string;
|
48
|
+
initialState?: {
|
49
|
+
log: string;
|
50
|
+
sample_id?: string;
|
51
|
+
sample_epoch?: string;
|
52
|
+
};
|
53
|
+
rehydrated?: boolean;
|
47
54
|
}
|
48
55
|
|
49
56
|
export interface LogsState {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import clsx from "clsx";
|
2
2
|
import { FC, Fragment } from "react";
|
3
|
-
import { ModelUsage1 } from "
|
4
|
-
import { formatNumber } from "
|
3
|
+
import { ModelUsage1 } from "../../@types/log";
|
4
|
+
import { formatNumber } from "../../utils/format";
|
5
5
|
import styles from "./ModelUsagePanel.module.css";
|
6
6
|
|
7
7
|
interface ModelUsageProps {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import clsx from "clsx";
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import { MetaDataView } from "
|
6
|
-
import {
|
7
|
-
import { formatDuration } from "
|
2
|
+
import { EvalStats } from "../../@types/log";
|
3
|
+
import { FontSize } from "../../app/appearance/fonts";
|
4
|
+
import { ApplicationIcons } from "../../app/appearance/icons";
|
5
|
+
import { MetaDataView } from "../../app/content/MetaDataView";
|
6
|
+
import { Card, CardBody, CardHeader } from "../../components/Card";
|
7
|
+
import { formatDuration } from "../../utils/format";
|
8
8
|
import { ModelTokenTable } from "./ModelTokenTable";
|
9
9
|
|
10
10
|
import { FC } from "react";
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { asyncJsonParse } from "
|
1
|
+
import { asyncJsonParse } from "../../utils/json-worker";
|
2
2
|
import { download_file } from "./api-shared";
|
3
3
|
import {
|
4
4
|
Capabilities,
|
@@ -244,7 +244,7 @@ async function api(
|
|
244
244
|
};
|
245
245
|
} else if (response.status !== 200) {
|
246
246
|
const message = (await response.text()) || response.statusText;
|
247
|
-
const error = new Error(
|
247
|
+
const error = new Error(`${message}`);
|
248
248
|
throw error;
|
249
249
|
} else {
|
250
250
|
throw new Error(`${response.status} - ${response.statusText} `);
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import {
|
1
|
+
import { EvalLog } from "../../@types/log";
|
2
|
+
import { asyncJsonParse } from "../../utils/json-worker";
|
3
|
+
import { fetchRange, fetchSize } from "../remote/remoteZipFile";
|
4
4
|
import { download_file, encodePathParts } from "./api-shared";
|
5
5
|
import {
|
6
6
|
Capabilities,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import JSON5 from "json5";
|
2
|
-
import { asyncJsonParse } from "
|
2
|
+
import { asyncJsonParse } from "../../utils/json-worker";
|
3
3
|
|
4
|
-
import { getVscodeApi } from "
|
4
|
+
import { getVscodeApi } from "../../utils/vscode";
|
5
5
|
import {
|
6
6
|
kMethodEvalLog,
|
7
7
|
kMethodEvalLogBytes,
|