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,932 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
|
3
|
-
* Original file: /npm/ansi-output@0.0.9/dist/ansi-output.js
|
4
|
-
*
|
5
|
-
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
6
|
-
*/
|
7
|
-
var e,
|
8
|
-
t,
|
9
|
-
r = { exports: {} };
|
10
|
-
(e = r),
|
11
|
-
(t = (function (e, t) {
|
12
|
-
Object.defineProperty(t, "__esModule", { value: !0 }),
|
13
|
-
(t.ANSIOutput = t.ANSIColor = t.ANSIFont = t.ANSIStyle = void 0);
|
14
|
-
let r = 0;
|
15
|
-
const n = () => ("" + ++r).padStart(16, "0");
|
16
|
-
var o, i, s, a, u, l, g;
|
17
|
-
(function (e) {
|
18
|
-
(e.Bold = "ansiBold"),
|
19
|
-
(e.Dim = "ansiDim"),
|
20
|
-
(e.Italic = "ansiItalic"),
|
21
|
-
(e.Underlined = "ansiUnderlined"),
|
22
|
-
(e.SlowBlink = "ansiSlowBlink"),
|
23
|
-
(e.RapidBlink = "ansiRapidBlink"),
|
24
|
-
(e.Hidden = "ansiHidden"),
|
25
|
-
(e.CrossedOut = "ansiCrossedOut"),
|
26
|
-
(e.Fraktur = "ansiFraktur"),
|
27
|
-
(e.DoubleUnderlined = "ansiDoubleUnderlined"),
|
28
|
-
(e.Framed = "ansiFramed"),
|
29
|
-
(e.Encircled = "ansiEncircled"),
|
30
|
-
(e.Overlined = "ansiOverlined"),
|
31
|
-
(e.Superscript = "ansiSuperscript"),
|
32
|
-
(e.Subscript = "ansiSubscript");
|
33
|
-
})(o || (t.ANSIStyle = o = {})),
|
34
|
-
(function (e) {
|
35
|
-
(e.AlternativeFont1 = "ansiAlternativeFont1"),
|
36
|
-
(e.AlternativeFont2 = "ansiAlternativeFont2"),
|
37
|
-
(e.AlternativeFont3 = "ansiAlternativeFont3"),
|
38
|
-
(e.AlternativeFont4 = "ansiAlternativeFont4"),
|
39
|
-
(e.AlternativeFont5 = "ansiAlternativeFont5"),
|
40
|
-
(e.AlternativeFont6 = "ansiAlternativeFont6"),
|
41
|
-
(e.AlternativeFont7 = "ansiAlternativeFont7"),
|
42
|
-
(e.AlternativeFont8 = "ansiAlternativeFont8"),
|
43
|
-
(e.AlternativeFont9 = "ansiAlternativeFont9");
|
44
|
-
})(i || (t.ANSIFont = i = {})),
|
45
|
-
(function (e) {
|
46
|
-
(e.Black = "ansiBlack"),
|
47
|
-
(e.Red = "ansiRed"),
|
48
|
-
(e.Green = "ansiGreen"),
|
49
|
-
(e.Yellow = "ansiYellow"),
|
50
|
-
(e.Blue = "ansiBlue"),
|
51
|
-
(e.Magenta = "ansiMagenta"),
|
52
|
-
(e.Cyan = "ansiCyan"),
|
53
|
-
(e.White = "ansiWhite"),
|
54
|
-
(e.BrightBlack = "ansiBrightBlack"),
|
55
|
-
(e.BrightRed = "ansiBrightRed"),
|
56
|
-
(e.BrightGreen = "ansiBrightGreen"),
|
57
|
-
(e.BrightYellow = "ansiBrightYellow"),
|
58
|
-
(e.BrightBlue = "ansiBrightBlue"),
|
59
|
-
(e.BrightMagenta = "ansiBrightMagenta"),
|
60
|
-
(e.BrightCyan = "ansiBrightCyan"),
|
61
|
-
(e.BrightWhite = "ansiBrightWhite");
|
62
|
-
})(s || (t.ANSIColor = s = {}));
|
63
|
-
class h {
|
64
|
-
_parserState = g.BufferingOutput;
|
65
|
-
_controlSequence = "";
|
66
|
-
_sgrState = void 0;
|
67
|
-
_outputLines = [];
|
68
|
-
_outputLine = 0;
|
69
|
-
_outputColumn = 0;
|
70
|
-
_buffer = "";
|
71
|
-
_pendingNewline = !1;
|
72
|
-
get outputLines() {
|
73
|
-
return this.flushBuffer(), this._outputLines;
|
74
|
-
}
|
75
|
-
static processOutput(e) {
|
76
|
-
const t = new h();
|
77
|
-
return t.processOutput(e), t.outputLines;
|
78
|
-
}
|
79
|
-
processOutput(e) {
|
80
|
-
for (let t = 0; t < e.length; t++) {
|
81
|
-
this._pendingNewline &&
|
82
|
-
(this.flushBuffer(),
|
83
|
-
this._outputLine++,
|
84
|
-
(this._outputColumn = 0),
|
85
|
-
(this._pendingNewline = !1));
|
86
|
-
const r = e.charAt(t);
|
87
|
-
this._parserState === g.BufferingOutput
|
88
|
-
? "" === r
|
89
|
-
? (this.flushBuffer(),
|
90
|
-
(this._parserState = g.ControlSequenceStarted))
|
91
|
-
: "" === r
|
92
|
-
? (this.flushBuffer(),
|
93
|
-
(this._parserState = g.ParsingControlSequence))
|
94
|
-
: this.processCharacter(r)
|
95
|
-
: this._parserState === g.ControlSequenceStarted
|
96
|
-
? "[" === r
|
97
|
-
? (this._parserState = g.ParsingControlSequence)
|
98
|
-
: ((this._parserState = g.BufferingOutput),
|
99
|
-
this.processCharacter(r))
|
100
|
-
: this._parserState === g.ParsingControlSequence &&
|
101
|
-
((this._controlSequence += r),
|
102
|
-
r.match(/^[A-Za-z]$/) && this.processControlSequence());
|
103
|
-
}
|
104
|
-
this.flushBuffer();
|
105
|
-
}
|
106
|
-
flushBuffer() {
|
107
|
-
for (let e = this._outputLines.length; e < this._outputLine + 1; e++)
|
108
|
-
this._outputLines.push(new d());
|
109
|
-
this._buffer &&
|
110
|
-
(this._outputLines[this._outputLine].insert(
|
111
|
-
this._buffer,
|
112
|
-
this._outputColumn,
|
113
|
-
this._sgrState,
|
114
|
-
),
|
115
|
-
(this._outputColumn += this._buffer.length),
|
116
|
-
(this._buffer = ""));
|
117
|
-
}
|
118
|
-
processCharacter(e) {
|
119
|
-
switch (e) {
|
120
|
-
case "\n":
|
121
|
-
this._pendingNewline = !0;
|
122
|
-
break;
|
123
|
-
case "\r":
|
124
|
-
this.flushBuffer(), (this._outputColumn = 0);
|
125
|
-
break;
|
126
|
-
default:
|
127
|
-
this._buffer += e;
|
128
|
-
}
|
129
|
-
}
|
130
|
-
processControlSequence() {
|
131
|
-
switch (
|
132
|
-
this._controlSequence.charAt(this._controlSequence.length - 1)
|
133
|
-
) {
|
134
|
-
case "A":
|
135
|
-
this.processCUU();
|
136
|
-
break;
|
137
|
-
case "B":
|
138
|
-
this.processCUD();
|
139
|
-
break;
|
140
|
-
case "C":
|
141
|
-
this.processCUF();
|
142
|
-
break;
|
143
|
-
case "D":
|
144
|
-
this.processCUB();
|
145
|
-
break;
|
146
|
-
case "H":
|
147
|
-
this.processCUP();
|
148
|
-
break;
|
149
|
-
case "J":
|
150
|
-
this.processED();
|
151
|
-
break;
|
152
|
-
case "K":
|
153
|
-
this.processEL();
|
154
|
-
break;
|
155
|
-
case "m":
|
156
|
-
this.processSGR();
|
157
|
-
}
|
158
|
-
(this._controlSequence = ""), (this._parserState = g.BufferingOutput);
|
159
|
-
}
|
160
|
-
processCUU() {
|
161
|
-
const e = this._controlSequence.match(/^([0-9]*)A$/);
|
162
|
-
e && (this._outputLine = Math.max(this._outputLine - k(e[1], 1, 1), 0));
|
163
|
-
}
|
164
|
-
processCUD() {
|
165
|
-
const e = this._controlSequence.match(/^([0-9]*)B$/);
|
166
|
-
e && (this._outputLine = this._outputLine + k(e[1], 1, 1));
|
167
|
-
}
|
168
|
-
processCUF() {
|
169
|
-
const e = this._controlSequence.match(/^([0-9]*)C$/);
|
170
|
-
e && (this._outputColumn = this._outputColumn + k(e[1], 1, 1));
|
171
|
-
}
|
172
|
-
processCUB() {
|
173
|
-
const e = this._controlSequence.match(/^([0-9]*)D$/);
|
174
|
-
e &&
|
175
|
-
(this._outputColumn = Math.max(
|
176
|
-
this._outputColumn - k(e[1], 1, 1),
|
177
|
-
0,
|
178
|
-
));
|
179
|
-
}
|
180
|
-
processCUP() {
|
181
|
-
const e = this._controlSequence.match(/^([0-9]*)(?:;?([0-9]*))H$/);
|
182
|
-
e &&
|
183
|
-
((this._outputLine = k(e[1], 1, 1) - 1),
|
184
|
-
(this._outputColumn = k(e[2], 1, 1) - 1));
|
185
|
-
}
|
186
|
-
processED() {
|
187
|
-
const e = this._controlSequence.match(/^([0-9]*)J$/);
|
188
|
-
if (e)
|
189
|
-
switch (p(e[1], 0)) {
|
190
|
-
case 0:
|
191
|
-
this._outputLines[this._outputLine].clearToEndOfLine(
|
192
|
-
this._outputColumn,
|
193
|
-
);
|
194
|
-
for (
|
195
|
-
let e = this._outputLine + 1;
|
196
|
-
e < this._outputLines.length;
|
197
|
-
e++
|
198
|
-
)
|
199
|
-
this._outputLines[e].clearEntireLine();
|
200
|
-
break;
|
201
|
-
case 1:
|
202
|
-
this._outputLines[this._outputLine].clearToBeginningOfLine(
|
203
|
-
this._outputColumn,
|
204
|
-
);
|
205
|
-
for (let e = 0; e < this._outputLine; e++)
|
206
|
-
this._outputLines[e].clearEntireLine();
|
207
|
-
break;
|
208
|
-
case 2:
|
209
|
-
for (let e = 0; e < this._outputLines.length; e++)
|
210
|
-
this._outputLines[e].clearEntireLine();
|
211
|
-
}
|
212
|
-
}
|
213
|
-
processEL() {
|
214
|
-
const e = this._controlSequence.match(/^([0-9]*)K$/);
|
215
|
-
if (e) {
|
216
|
-
const t = this._outputLines[this._outputLine];
|
217
|
-
switch (p(e[1], 0)) {
|
218
|
-
case 0:
|
219
|
-
t.clearToEndOfLine(this._outputColumn);
|
220
|
-
break;
|
221
|
-
case 1:
|
222
|
-
t.clearToBeginningOfLine(this._outputColumn);
|
223
|
-
break;
|
224
|
-
case 2:
|
225
|
-
t.clearEntireLine();
|
226
|
-
}
|
227
|
-
}
|
228
|
-
}
|
229
|
-
processSGR() {
|
230
|
-
const e = this._sgrState ? this._sgrState.copy() : new c(),
|
231
|
-
t = this._controlSequence
|
232
|
-
.slice(0, -1)
|
233
|
-
.split(";")
|
234
|
-
.map((e) => ("" === e ? a.Reset : parseInt(e, 10)));
|
235
|
-
for (let r = 0; r < t.length; r++) {
|
236
|
-
const n = () => {
|
237
|
-
if (r + 1 !== t.length)
|
238
|
-
switch (t[++r]) {
|
239
|
-
case u.Color256: {
|
240
|
-
if (r + 1 === t.length) return;
|
241
|
-
const e = t[++r];
|
242
|
-
switch (e) {
|
243
|
-
case l.Black:
|
244
|
-
return s.Black;
|
245
|
-
case l.Red:
|
246
|
-
return s.Red;
|
247
|
-
case l.Green:
|
248
|
-
return s.Green;
|
249
|
-
case l.Yellow:
|
250
|
-
return s.Yellow;
|
251
|
-
case l.Blue:
|
252
|
-
return s.Blue;
|
253
|
-
case l.Magenta:
|
254
|
-
return s.Magenta;
|
255
|
-
case l.Cyan:
|
256
|
-
return s.Cyan;
|
257
|
-
case l.White:
|
258
|
-
return s.White;
|
259
|
-
case l.BrightBlack:
|
260
|
-
return s.BrightBlack;
|
261
|
-
case l.BrightRed:
|
262
|
-
return s.BrightRed;
|
263
|
-
case l.BrightGreen:
|
264
|
-
return s.BrightGreen;
|
265
|
-
case l.BrightYellow:
|
266
|
-
return s.BrightYellow;
|
267
|
-
case l.BrightBlue:
|
268
|
-
return s.BrightBlue;
|
269
|
-
case l.BrightMagenta:
|
270
|
-
return s.BrightMagenta;
|
271
|
-
case l.BrightCyan:
|
272
|
-
return s.BrightCyan;
|
273
|
-
case l.BrightWhite:
|
274
|
-
return s.BrightWhite;
|
275
|
-
default:
|
276
|
-
if (e % 1 != 0) return;
|
277
|
-
if (e >= 16 && e <= 231) {
|
278
|
-
let t = e - 16,
|
279
|
-
r = t % 6;
|
280
|
-
t = (t - r) / 6;
|
281
|
-
let n = t % 6;
|
282
|
-
t = (t - n) / 6;
|
283
|
-
let o = t;
|
284
|
-
return (
|
285
|
-
(r = Math.round((255 * r) / 5)),
|
286
|
-
(n = Math.round((255 * n) / 5)),
|
287
|
-
(o = Math.round((255 * o) / 5)),
|
288
|
-
"#" + _(o) + _(n) + _(r)
|
289
|
-
);
|
290
|
-
}
|
291
|
-
if (e >= 232 && e <= 255) {
|
292
|
-
const t = Math.round(((e - 232) / 23) * 255),
|
293
|
-
r = _(t);
|
294
|
-
return "#" + r + r + r;
|
295
|
-
}
|
296
|
-
return;
|
297
|
-
}
|
298
|
-
}
|
299
|
-
case u.ColorRGB: {
|
300
|
-
const e = [0, 0, 0];
|
301
|
-
for (let n = 0; n < 3 && r + 1 < t.length; n++) e[n] = t[++r];
|
302
|
-
return "#" + _(e[0]) + _(e[1]) + _(e[2]);
|
303
|
-
}
|
304
|
-
}
|
305
|
-
};
|
306
|
-
switch (t[r]) {
|
307
|
-
case a.Reset:
|
308
|
-
e.reset();
|
309
|
-
break;
|
310
|
-
case a.Bold:
|
311
|
-
e.setStyle(o.Bold);
|
312
|
-
break;
|
313
|
-
case a.Dim:
|
314
|
-
e.setStyle(o.Dim);
|
315
|
-
break;
|
316
|
-
case a.Italic:
|
317
|
-
e.setStyle(o.Italic);
|
318
|
-
break;
|
319
|
-
case a.Underlined:
|
320
|
-
e.setStyle(o.Underlined, o.DoubleUnderlined);
|
321
|
-
break;
|
322
|
-
case a.SlowBlink:
|
323
|
-
e.setStyle(o.SlowBlink, o.RapidBlink);
|
324
|
-
break;
|
325
|
-
case a.RapidBlink:
|
326
|
-
e.setStyle(o.RapidBlink, o.SlowBlink);
|
327
|
-
break;
|
328
|
-
case a.Reversed:
|
329
|
-
e.setReversed(!0);
|
330
|
-
break;
|
331
|
-
case a.Hidden:
|
332
|
-
e.setStyle(o.Hidden);
|
333
|
-
break;
|
334
|
-
case a.CrossedOut:
|
335
|
-
e.setStyle(o.CrossedOut);
|
336
|
-
break;
|
337
|
-
case a.PrimaryFont:
|
338
|
-
e.setFont();
|
339
|
-
break;
|
340
|
-
case a.AlternativeFont1:
|
341
|
-
e.setFont(i.AlternativeFont1);
|
342
|
-
break;
|
343
|
-
case a.AlternativeFont2:
|
344
|
-
e.setFont(i.AlternativeFont2);
|
345
|
-
break;
|
346
|
-
case a.AlternativeFont3:
|
347
|
-
e.setFont(i.AlternativeFont3);
|
348
|
-
break;
|
349
|
-
case a.AlternativeFont4:
|
350
|
-
e.setFont(i.AlternativeFont4);
|
351
|
-
break;
|
352
|
-
case a.AlternativeFont5:
|
353
|
-
e.setFont(i.AlternativeFont5);
|
354
|
-
break;
|
355
|
-
case a.AlternativeFont6:
|
356
|
-
e.setFont(i.AlternativeFont6);
|
357
|
-
break;
|
358
|
-
case a.AlternativeFont7:
|
359
|
-
e.setFont(i.AlternativeFont7);
|
360
|
-
break;
|
361
|
-
case a.AlternativeFont8:
|
362
|
-
e.setFont(i.AlternativeFont8);
|
363
|
-
break;
|
364
|
-
case a.AlternativeFont9:
|
365
|
-
e.setFont(i.AlternativeFont9);
|
366
|
-
break;
|
367
|
-
case a.Fraktur:
|
368
|
-
e.setStyle(o.Fraktur);
|
369
|
-
break;
|
370
|
-
case a.DoubleUnderlined:
|
371
|
-
e.setStyle(o.DoubleUnderlined, o.Underlined);
|
372
|
-
break;
|
373
|
-
case a.NormalIntensity:
|
374
|
-
e.deleteStyles(o.Bold, o.Dim);
|
375
|
-
break;
|
376
|
-
case a.NotItalicNotFraktur:
|
377
|
-
e.deleteStyles(o.Italic, o.Fraktur);
|
378
|
-
break;
|
379
|
-
case a.NotUnderlined:
|
380
|
-
e.deleteStyles(o.Underlined, o.DoubleUnderlined);
|
381
|
-
break;
|
382
|
-
case a.NotBlinking:
|
383
|
-
e.deleteStyles(o.SlowBlink, o.RapidBlink);
|
384
|
-
break;
|
385
|
-
case a.ProportionalSpacing:
|
386
|
-
break;
|
387
|
-
case a.NotReversed:
|
388
|
-
e.setReversed(!1);
|
389
|
-
break;
|
390
|
-
case a.Reveal:
|
391
|
-
e.deleteStyles(o.Hidden);
|
392
|
-
break;
|
393
|
-
case a.NotCrossedOut:
|
394
|
-
e.deleteStyles(o.CrossedOut);
|
395
|
-
break;
|
396
|
-
case a.ForegroundBlack:
|
397
|
-
e.setForegroundColor(s.Black);
|
398
|
-
break;
|
399
|
-
case a.ForegroundRed:
|
400
|
-
e.setForegroundColor(s.Red);
|
401
|
-
break;
|
402
|
-
case a.ForegroundGreen:
|
403
|
-
e.setForegroundColor(s.Green);
|
404
|
-
break;
|
405
|
-
case a.ForegroundYellow:
|
406
|
-
e.setForegroundColor(s.Yellow);
|
407
|
-
break;
|
408
|
-
case a.ForegroundBlue:
|
409
|
-
e.setForegroundColor(s.Blue);
|
410
|
-
break;
|
411
|
-
case a.ForegroundMagenta:
|
412
|
-
e.setForegroundColor(s.Magenta);
|
413
|
-
break;
|
414
|
-
case a.ForegroundCyan:
|
415
|
-
e.setForegroundColor(s.Cyan);
|
416
|
-
break;
|
417
|
-
case a.ForegroundWhite:
|
418
|
-
e.setForegroundColor(s.White);
|
419
|
-
break;
|
420
|
-
case a.SetForeground: {
|
421
|
-
const t = n();
|
422
|
-
t && e.setForegroundColor(t);
|
423
|
-
break;
|
424
|
-
}
|
425
|
-
case a.DefaultForeground:
|
426
|
-
e.setForegroundColor();
|
427
|
-
break;
|
428
|
-
case a.BackgroundBlack:
|
429
|
-
e.setBackgroundColor(s.Black);
|
430
|
-
break;
|
431
|
-
case a.BackgroundRed:
|
432
|
-
e.setBackgroundColor(s.Red);
|
433
|
-
break;
|
434
|
-
case a.BackgroundGreen:
|
435
|
-
e.setBackgroundColor(s.Green);
|
436
|
-
break;
|
437
|
-
case a.BackgroundYellow:
|
438
|
-
e.setBackgroundColor(s.Yellow);
|
439
|
-
break;
|
440
|
-
case a.BackgroundBlue:
|
441
|
-
e.setBackgroundColor(s.Blue);
|
442
|
-
break;
|
443
|
-
case a.BackgroundMagenta:
|
444
|
-
e.setBackgroundColor(s.Magenta);
|
445
|
-
break;
|
446
|
-
case a.BackgroundCyan:
|
447
|
-
e.setBackgroundColor(s.Cyan);
|
448
|
-
break;
|
449
|
-
case a.BackgroundWhite:
|
450
|
-
e.setBackgroundColor(s.White);
|
451
|
-
break;
|
452
|
-
case a.SetBackground: {
|
453
|
-
const t = n();
|
454
|
-
t && e.setBackgroundColor(t);
|
455
|
-
break;
|
456
|
-
}
|
457
|
-
case a.DefaultBackground:
|
458
|
-
e.setBackgroundColor();
|
459
|
-
break;
|
460
|
-
case a.ForegroundBrightBlack:
|
461
|
-
e.setForegroundColor(s.BrightBlack);
|
462
|
-
break;
|
463
|
-
case a.ForegroundBrightRed:
|
464
|
-
e.setForegroundColor(s.BrightRed);
|
465
|
-
break;
|
466
|
-
case a.ForegroundBrightGreen:
|
467
|
-
e.setForegroundColor(s.BrightGreen);
|
468
|
-
break;
|
469
|
-
case a.ForegroundBrightYellow:
|
470
|
-
e.setForegroundColor(s.BrightYellow);
|
471
|
-
break;
|
472
|
-
case a.ForegroundBrightBlue:
|
473
|
-
e.setForegroundColor(s.BrightBlue);
|
474
|
-
break;
|
475
|
-
case a.ForegroundBrightMagenta:
|
476
|
-
e.setForegroundColor(s.BrightMagenta);
|
477
|
-
break;
|
478
|
-
case a.ForegroundBrightCyan:
|
479
|
-
e.setForegroundColor(s.BrightCyan);
|
480
|
-
break;
|
481
|
-
case a.ForegroundBrightWhite:
|
482
|
-
e.setForegroundColor(s.BrightWhite);
|
483
|
-
break;
|
484
|
-
case a.BackgroundBrightBlack:
|
485
|
-
e.setBackgroundColor(s.BrightBlack);
|
486
|
-
break;
|
487
|
-
case a.BackgroundBrightRed:
|
488
|
-
e.setBackgroundColor(s.BrightRed);
|
489
|
-
break;
|
490
|
-
case a.BackgroundBrightGreen:
|
491
|
-
e.setBackgroundColor(s.BrightGreen);
|
492
|
-
break;
|
493
|
-
case a.BackgroundBrightYellow:
|
494
|
-
e.setBackgroundColor(s.BrightYellow);
|
495
|
-
break;
|
496
|
-
case a.BackgroundBrightBlue:
|
497
|
-
e.setBackgroundColor(s.BrightBlue);
|
498
|
-
break;
|
499
|
-
case a.BackgroundBrightMagenta:
|
500
|
-
e.setBackgroundColor(s.BrightMagenta);
|
501
|
-
break;
|
502
|
-
case a.BackgroundBrightCyan:
|
503
|
-
e.setBackgroundColor(s.BrightCyan);
|
504
|
-
break;
|
505
|
-
case a.BackgroundBrightWhite:
|
506
|
-
e.setBackgroundColor(s.BrightWhite);
|
507
|
-
}
|
508
|
-
}
|
509
|
-
c.equivalent(e, this._sgrState) || (this._sgrState = e);
|
510
|
-
}
|
511
|
-
}
|
512
|
-
(t.ANSIOutput = h),
|
513
|
-
(function (e) {
|
514
|
-
(e[(e.Reset = 0)] = "Reset"),
|
515
|
-
(e[(e.Bold = 1)] = "Bold"),
|
516
|
-
(e[(e.Dim = 2)] = "Dim"),
|
517
|
-
(e[(e.Italic = 3)] = "Italic"),
|
518
|
-
(e[(e.Underlined = 4)] = "Underlined"),
|
519
|
-
(e[(e.SlowBlink = 5)] = "SlowBlink"),
|
520
|
-
(e[(e.RapidBlink = 6)] = "RapidBlink"),
|
521
|
-
(e[(e.Reversed = 7)] = "Reversed"),
|
522
|
-
(e[(e.Hidden = 8)] = "Hidden"),
|
523
|
-
(e[(e.CrossedOut = 9)] = "CrossedOut"),
|
524
|
-
(e[(e.PrimaryFont = 10)] = "PrimaryFont"),
|
525
|
-
(e[(e.AlternativeFont1 = 11)] = "AlternativeFont1"),
|
526
|
-
(e[(e.AlternativeFont2 = 12)] = "AlternativeFont2"),
|
527
|
-
(e[(e.AlternativeFont3 = 13)] = "AlternativeFont3"),
|
528
|
-
(e[(e.AlternativeFont4 = 14)] = "AlternativeFont4"),
|
529
|
-
(e[(e.AlternativeFont5 = 15)] = "AlternativeFont5"),
|
530
|
-
(e[(e.AlternativeFont6 = 16)] = "AlternativeFont6"),
|
531
|
-
(e[(e.AlternativeFont7 = 17)] = "AlternativeFont7"),
|
532
|
-
(e[(e.AlternativeFont8 = 18)] = "AlternativeFont8"),
|
533
|
-
(e[(e.AlternativeFont9 = 19)] = "AlternativeFont9"),
|
534
|
-
(e[(e.Fraktur = 20)] = "Fraktur"),
|
535
|
-
(e[(e.DoubleUnderlined = 21)] = "DoubleUnderlined"),
|
536
|
-
(e[(e.NormalIntensity = 22)] = "NormalIntensity"),
|
537
|
-
(e[(e.NotItalicNotFraktur = 23)] = "NotItalicNotFraktur"),
|
538
|
-
(e[(e.NotUnderlined = 24)] = "NotUnderlined"),
|
539
|
-
(e[(e.NotBlinking = 25)] = "NotBlinking"),
|
540
|
-
(e[(e.ProportionalSpacing = 26)] = "ProportionalSpacing"),
|
541
|
-
(e[(e.NotReversed = 27)] = "NotReversed"),
|
542
|
-
(e[(e.Reveal = 28)] = "Reveal"),
|
543
|
-
(e[(e.NotCrossedOut = 29)] = "NotCrossedOut"),
|
544
|
-
(e[(e.ForegroundBlack = 30)] = "ForegroundBlack"),
|
545
|
-
(e[(e.ForegroundRed = 31)] = "ForegroundRed"),
|
546
|
-
(e[(e.ForegroundGreen = 32)] = "ForegroundGreen"),
|
547
|
-
(e[(e.ForegroundYellow = 33)] = "ForegroundYellow"),
|
548
|
-
(e[(e.ForegroundBlue = 34)] = "ForegroundBlue"),
|
549
|
-
(e[(e.ForegroundMagenta = 35)] = "ForegroundMagenta"),
|
550
|
-
(e[(e.ForegroundCyan = 36)] = "ForegroundCyan"),
|
551
|
-
(e[(e.ForegroundWhite = 37)] = "ForegroundWhite"),
|
552
|
-
(e[(e.SetForeground = 38)] = "SetForeground"),
|
553
|
-
(e[(e.DefaultForeground = 39)] = "DefaultForeground"),
|
554
|
-
(e[(e.BackgroundBlack = 40)] = "BackgroundBlack"),
|
555
|
-
(e[(e.BackgroundRed = 41)] = "BackgroundRed"),
|
556
|
-
(e[(e.BackgroundGreen = 42)] = "BackgroundGreen"),
|
557
|
-
(e[(e.BackgroundYellow = 43)] = "BackgroundYellow"),
|
558
|
-
(e[(e.BackgroundBlue = 44)] = "BackgroundBlue"),
|
559
|
-
(e[(e.BackgroundMagenta = 45)] = "BackgroundMagenta"),
|
560
|
-
(e[(e.BackgroundCyan = 46)] = "BackgroundCyan"),
|
561
|
-
(e[(e.BackgroundWhite = 47)] = "BackgroundWhite"),
|
562
|
-
(e[(e.SetBackground = 48)] = "SetBackground"),
|
563
|
-
(e[(e.DefaultBackground = 49)] = "DefaultBackground"),
|
564
|
-
(e[(e.DisableProportionalSpacing = 50)] =
|
565
|
-
"DisableProportionalSpacing"),
|
566
|
-
(e[(e.Framed = 51)] = "Framed"),
|
567
|
-
(e[(e.Encircled = 52)] = "Encircled"),
|
568
|
-
(e[(e.Overlined = 53)] = "Overlined"),
|
569
|
-
(e[(e.NotFramedNotEncircled = 54)] = "NotFramedNotEncircled"),
|
570
|
-
(e[(e.NotOverlined = 55)] = "NotOverlined"),
|
571
|
-
(e[(e.SetUnderline = 58)] = "SetUnderline"),
|
572
|
-
(e[(e.DefaultUnderline = 59)] = "DefaultUnderline"),
|
573
|
-
(e[(e.IdeogramUnderlineOrRightSideLine = 60)] =
|
574
|
-
"IdeogramUnderlineOrRightSideLine"),
|
575
|
-
(e[(e.IdeogramDoubleUnderlineOrDoubleRightSideLine = 61)] =
|
576
|
-
"IdeogramDoubleUnderlineOrDoubleRightSideLine"),
|
577
|
-
(e[(e.IdeogramOverlineOrLeftSideLine = 62)] =
|
578
|
-
"IdeogramOverlineOrLeftSideLine"),
|
579
|
-
(e[(e.IdeogramDoubleOverlineOrDoubleLeftSideLine = 63)] =
|
580
|
-
"IdeogramDoubleOverlineOrDoubleLeftSideLine"),
|
581
|
-
(e[(e.IdeogramStressMarking = 64)] = "IdeogramStressMarking"),
|
582
|
-
(e[(e.NoIdeogramAttributes = 65)] = "NoIdeogramAttributes"),
|
583
|
-
(e[(e.Superscript = 73)] = "Superscript"),
|
584
|
-
(e[(e.Subscript = 74)] = "Subscript"),
|
585
|
-
(e[(e.NotSuperscriptNotSubscript = 75)] =
|
586
|
-
"NotSuperscriptNotSubscript"),
|
587
|
-
(e[(e.ForegroundBrightBlack = 90)] = "ForegroundBrightBlack"),
|
588
|
-
(e[(e.ForegroundBrightRed = 91)] = "ForegroundBrightRed"),
|
589
|
-
(e[(e.ForegroundBrightGreen = 92)] = "ForegroundBrightGreen"),
|
590
|
-
(e[(e.ForegroundBrightYellow = 93)] = "ForegroundBrightYellow"),
|
591
|
-
(e[(e.ForegroundBrightBlue = 94)] = "ForegroundBrightBlue"),
|
592
|
-
(e[(e.ForegroundBrightMagenta = 95)] = "ForegroundBrightMagenta"),
|
593
|
-
(e[(e.ForegroundBrightCyan = 96)] = "ForegroundBrightCyan"),
|
594
|
-
(e[(e.ForegroundBrightWhite = 97)] = "ForegroundBrightWhite"),
|
595
|
-
(e[(e.BackgroundBrightBlack = 100)] = "BackgroundBrightBlack"),
|
596
|
-
(e[(e.BackgroundBrightRed = 101)] = "BackgroundBrightRed"),
|
597
|
-
(e[(e.BackgroundBrightGreen = 102)] = "BackgroundBrightGreen"),
|
598
|
-
(e[(e.BackgroundBrightYellow = 103)] = "BackgroundBrightYellow"),
|
599
|
-
(e[(e.BackgroundBrightBlue = 104)] = "BackgroundBrightBlue"),
|
600
|
-
(e[(e.BackgroundBrightMagenta = 105)] = "BackgroundBrightMagenta"),
|
601
|
-
(e[(e.BackgroundBrightCyan = 106)] = "BackgroundBrightCyan"),
|
602
|
-
(e[(e.BackgroundBrightWhite = 107)] = "BackgroundBrightWhite");
|
603
|
-
})(a || (a = {})),
|
604
|
-
(function (e) {
|
605
|
-
(e[(e.Color256 = 5)] = "Color256"), (e[(e.ColorRGB = 2)] = "ColorRGB");
|
606
|
-
})(u || (u = {})),
|
607
|
-
(function (e) {
|
608
|
-
(e[(e.Black = 0)] = "Black"),
|
609
|
-
(e[(e.Red = 1)] = "Red"),
|
610
|
-
(e[(e.Green = 2)] = "Green"),
|
611
|
-
(e[(e.Yellow = 3)] = "Yellow"),
|
612
|
-
(e[(e.Blue = 4)] = "Blue"),
|
613
|
-
(e[(e.Magenta = 5)] = "Magenta"),
|
614
|
-
(e[(e.Cyan = 6)] = "Cyan"),
|
615
|
-
(e[(e.White = 7)] = "White"),
|
616
|
-
(e[(e.BrightBlack = 8)] = "BrightBlack"),
|
617
|
-
(e[(e.BrightRed = 9)] = "BrightRed"),
|
618
|
-
(e[(e.BrightGreen = 10)] = "BrightGreen"),
|
619
|
-
(e[(e.BrightYellow = 11)] = "BrightYellow"),
|
620
|
-
(e[(e.BrightBlue = 12)] = "BrightBlue"),
|
621
|
-
(e[(e.BrightMagenta = 13)] = "BrightMagenta"),
|
622
|
-
(e[(e.BrightCyan = 14)] = "BrightCyan"),
|
623
|
-
(e[(e.BrightWhite = 15)] = "BrightWhite");
|
624
|
-
})(l || (l = {})),
|
625
|
-
(function (e) {
|
626
|
-
(e[(e.BufferingOutput = 0)] = "BufferingOutput"),
|
627
|
-
(e[(e.ControlSequenceStarted = 1)] = "ControlSequenceStarted"),
|
628
|
-
(e[(e.ParsingControlSequence = 2)] = "ParsingControlSequence");
|
629
|
-
})(g || (g = {}));
|
630
|
-
class c {
|
631
|
-
_styles;
|
632
|
-
_foregroundColor;
|
633
|
-
_backgroundColor;
|
634
|
-
_underlinedColor;
|
635
|
-
_reversed;
|
636
|
-
_font;
|
637
|
-
reset() {
|
638
|
-
(this._styles = void 0),
|
639
|
-
(this._foregroundColor = void 0),
|
640
|
-
(this._backgroundColor = void 0),
|
641
|
-
(this._underlinedColor = void 0),
|
642
|
-
(this._reversed = void 0),
|
643
|
-
(this._font = void 0);
|
644
|
-
}
|
645
|
-
copy() {
|
646
|
-
const e = new c();
|
647
|
-
if (this._styles && this._styles.size) {
|
648
|
-
const t = new Set();
|
649
|
-
this._styles.forEach((e) => t.add(e)), (e._styles = t);
|
650
|
-
}
|
651
|
-
return (
|
652
|
-
(e._foregroundColor = this._foregroundColor),
|
653
|
-
(e._backgroundColor = this._backgroundColor),
|
654
|
-
(e._underlinedColor = this._underlinedColor),
|
655
|
-
(e._reversed = this._reversed),
|
656
|
-
(e._font = this._font),
|
657
|
-
e
|
658
|
-
);
|
659
|
-
}
|
660
|
-
setStyle(e, ...t) {
|
661
|
-
if (this._styles) for (const e of t) this._styles.delete(e);
|
662
|
-
else this._styles = new Set();
|
663
|
-
this._styles.add(e);
|
664
|
-
}
|
665
|
-
deleteStyles(...e) {
|
666
|
-
if (this._styles) {
|
667
|
-
for (const t of e) this._styles.delete(t);
|
668
|
-
this._styles.size || (this._styles = void 0);
|
669
|
-
}
|
670
|
-
}
|
671
|
-
setForegroundColor(e) {
|
672
|
-
this._reversed
|
673
|
-
? (this._backgroundColor = e)
|
674
|
-
: (this._foregroundColor = e);
|
675
|
-
}
|
676
|
-
setBackgroundColor(e) {
|
677
|
-
this._reversed
|
678
|
-
? (this._foregroundColor = e)
|
679
|
-
: (this._backgroundColor = e);
|
680
|
-
}
|
681
|
-
setReversed(e) {
|
682
|
-
e
|
683
|
-
? this._reversed ||
|
684
|
-
((this._reversed = !0), this.reverseForegroundAndBackgroundColors())
|
685
|
-
: this._reversed &&
|
686
|
-
((this._reversed = void 0),
|
687
|
-
this.reverseForegroundAndBackgroundColors());
|
688
|
-
}
|
689
|
-
setFont(e) {
|
690
|
-
this._font = e;
|
691
|
-
}
|
692
|
-
static equivalent(e, t) {
|
693
|
-
const r = (e, t) => (t instanceof Set ? (t.size ? [...t] : void 0) : t);
|
694
|
-
return e === t || JSON.stringify(e, r) === JSON.stringify(t, r);
|
695
|
-
}
|
696
|
-
get styles() {
|
697
|
-
return this._styles ? [...this._styles] : void 0;
|
698
|
-
}
|
699
|
-
get foregroundColor() {
|
700
|
-
if (this._backgroundColor && !this._foregroundColor)
|
701
|
-
switch (this._backgroundColor) {
|
702
|
-
case s.Black:
|
703
|
-
case s.BrightBlack:
|
704
|
-
case s.Red:
|
705
|
-
case s.BrightRed:
|
706
|
-
return s.White;
|
707
|
-
case s.Green:
|
708
|
-
case s.BrightGreen:
|
709
|
-
case s.Yellow:
|
710
|
-
case s.BrightYellow:
|
711
|
-
case s.Blue:
|
712
|
-
case s.BrightBlue:
|
713
|
-
case s.Magenta:
|
714
|
-
case s.BrightMagenta:
|
715
|
-
case s.Cyan:
|
716
|
-
case s.BrightCyan:
|
717
|
-
case s.White:
|
718
|
-
case s.BrightWhite:
|
719
|
-
return s.Black;
|
720
|
-
}
|
721
|
-
return this._foregroundColor;
|
722
|
-
}
|
723
|
-
get backgroundColor() {
|
724
|
-
return this._backgroundColor;
|
725
|
-
}
|
726
|
-
get underlinedColor() {
|
727
|
-
return this._underlinedColor;
|
728
|
-
}
|
729
|
-
get font() {
|
730
|
-
return this._font;
|
731
|
-
}
|
732
|
-
reverseForegroundAndBackgroundColors() {
|
733
|
-
const e = this._foregroundColor;
|
734
|
-
(this._foregroundColor = this._backgroundColor),
|
735
|
-
(this._backgroundColor = e);
|
736
|
-
}
|
737
|
-
}
|
738
|
-
class d {
|
739
|
-
_id = n();
|
740
|
-
_outputRuns = [];
|
741
|
-
_totalLength = 0;
|
742
|
-
clearEntireLine() {
|
743
|
-
this._totalLength &&
|
744
|
-
(this._outputRuns = [new B(" ".repeat(this._totalLength))]);
|
745
|
-
}
|
746
|
-
clearToEndOfLine(e) {
|
747
|
-
if ((e = Math.max(e, 0)) >= this._totalLength) return;
|
748
|
-
if (0 === e) return void this.clearEntireLine();
|
749
|
-
let t,
|
750
|
-
r,
|
751
|
-
n = 0;
|
752
|
-
for (let o = 0; o < this._outputRuns.length; o++) {
|
753
|
-
const i = this._outputRuns[o];
|
754
|
-
if (e < n + i.text.length) {
|
755
|
-
(t = i), (r = o);
|
756
|
-
break;
|
757
|
-
}
|
758
|
-
n += i.text.length;
|
759
|
-
}
|
760
|
-
if (void 0 === t || void 0 === r) return;
|
761
|
-
const o = e - n,
|
762
|
-
i = " ".repeat(this._totalLength - e),
|
763
|
-
s = [];
|
764
|
-
if (o) {
|
765
|
-
const e = t.text.slice(0, o);
|
766
|
-
s.push(new B(e, t.sgrState)), s.push(new B(i));
|
767
|
-
} else s.push(new B(i));
|
768
|
-
this.outputRuns.splice(r, this._outputRuns.length - r, ...s);
|
769
|
-
}
|
770
|
-
clearToBeginningOfLine(e) {
|
771
|
-
if (0 === (e = Math.max(e, 0))) return;
|
772
|
-
if (e >= this._totalLength) return void this.clearEntireLine();
|
773
|
-
let t,
|
774
|
-
r,
|
775
|
-
n = 0;
|
776
|
-
for (let o = this._outputRuns.length - 1; o >= 0; o--) {
|
777
|
-
const i = this._outputRuns[o];
|
778
|
-
if (e >= n - i.text.length) {
|
779
|
-
(t = i), (r = o);
|
780
|
-
break;
|
781
|
-
}
|
782
|
-
n -= i.text.length;
|
783
|
-
}
|
784
|
-
if (void 0 === t || void 0 === r) return;
|
785
|
-
const o = n - e,
|
786
|
-
i = " ".repeat(e),
|
787
|
-
s = [new B(i)];
|
788
|
-
if (o) {
|
789
|
-
const e = t.text.slice(-o);
|
790
|
-
s.push(new B(e, t.sgrState));
|
791
|
-
}
|
792
|
-
this.outputRuns.splice(0, this._outputRuns.length - r, ...s);
|
793
|
-
}
|
794
|
-
insert(e, t, r) {
|
795
|
-
if (!e.length) return;
|
796
|
-
if (t === this._totalLength) {
|
797
|
-
if (((this._totalLength += e.length), this._outputRuns.length)) {
|
798
|
-
const t = this._outputRuns[this._outputRuns.length - 1];
|
799
|
-
if (c.equivalent(t.sgrState, r)) return void t.appendText(e);
|
800
|
-
}
|
801
|
-
return void this._outputRuns.push(new B(e, r));
|
802
|
-
}
|
803
|
-
if (t > this._totalLength) {
|
804
|
-
const n = " ".repeat(t - this._totalLength);
|
805
|
-
if (
|
806
|
-
((this._totalLength += n.length + e.length),
|
807
|
-
!r && this._outputRuns.length)
|
808
|
-
) {
|
809
|
-
const t = this._outputRuns[this._outputRuns.length - 1];
|
810
|
-
if (!t.sgrState) return t.appendText(n), void t.appendText(e);
|
811
|
-
}
|
812
|
-
r
|
813
|
-
? (this._outputRuns.push(new B(n)),
|
814
|
-
this._outputRuns.push(new B(e, r)))
|
815
|
-
: this._outputRuns.push(new B(n + e));
|
816
|
-
}
|
817
|
-
let n,
|
818
|
-
o = 0;
|
819
|
-
for (let e = 0; e < this._outputRuns.length; e++) {
|
820
|
-
const r = this._outputRuns[e];
|
821
|
-
if (t < o + r.text.length) {
|
822
|
-
n = e;
|
823
|
-
break;
|
824
|
-
}
|
825
|
-
o += r.text.length;
|
826
|
-
}
|
827
|
-
if (void 0 === n) return void this._outputRuns.push(new B(e, r));
|
828
|
-
if (t + e.length >= this._totalLength) {
|
829
|
-
const i = t - o,
|
830
|
-
s = [];
|
831
|
-
if (i) {
|
832
|
-
const t = this._outputRuns[n],
|
833
|
-
o = t.text.slice(0, i);
|
834
|
-
c.equivalent(t.sgrState, r)
|
835
|
-
? s.push(new B(o + e, r))
|
836
|
-
: (s.push(new B(o, t.sgrState)), s.push(new B(e, r)));
|
837
|
-
} else s.push(new B(e, r));
|
838
|
-
return (
|
839
|
-
this.outputRuns.splice(n, 1, ...s),
|
840
|
-
void (this._totalLength = o + i + e.length)
|
841
|
-
);
|
842
|
-
}
|
843
|
-
let i,
|
844
|
-
s = this._totalLength;
|
845
|
-
for (let r = this._outputRuns.length - 1; r >= 0; r--) {
|
846
|
-
const n = this._outputRuns[r];
|
847
|
-
if (t + e.length > s - n.text.length) {
|
848
|
-
i = r;
|
849
|
-
break;
|
850
|
-
}
|
851
|
-
s -= n.text.length;
|
852
|
-
}
|
853
|
-
if (void 0 === i) return void this._outputRuns.push(new B(e, r));
|
854
|
-
const a = [],
|
855
|
-
u = t - o;
|
856
|
-
if (u) {
|
857
|
-
const e = this._outputRuns[n],
|
858
|
-
t = e.text.slice(0, u);
|
859
|
-
a.push(new B(t, e.sgrState));
|
860
|
-
}
|
861
|
-
a.push(new B(e, r));
|
862
|
-
const l = s - (t + e.length);
|
863
|
-
if (l) {
|
864
|
-
const e = this._outputRuns[i],
|
865
|
-
t = e.text.slice(-l);
|
866
|
-
a.push(new B(t, e.sgrState));
|
867
|
-
}
|
868
|
-
this._outputRuns.splice(n, i - n + 1, ...a),
|
869
|
-
this._outputRuns.length > 1 &&
|
870
|
-
(this._outputRuns = B.optimizeOutputRuns(this._outputRuns)),
|
871
|
-
(this._totalLength = this._outputRuns.reduce(
|
872
|
-
(e, t) => e + t.text.length,
|
873
|
-
0,
|
874
|
-
));
|
875
|
-
}
|
876
|
-
get id() {
|
877
|
-
return this._id;
|
878
|
-
}
|
879
|
-
get outputRuns() {
|
880
|
-
return this._outputRuns;
|
881
|
-
}
|
882
|
-
}
|
883
|
-
class B {
|
884
|
-
_id = n();
|
885
|
-
_sgrState;
|
886
|
-
_text;
|
887
|
-
get sgrState() {
|
888
|
-
return this._sgrState;
|
889
|
-
}
|
890
|
-
constructor(e, t) {
|
891
|
-
(this._sgrState = t), (this._text = e);
|
892
|
-
}
|
893
|
-
static optimizeOutputRuns(e) {
|
894
|
-
const t = [e[0]];
|
895
|
-
for (let r = 1, n = 0; r < e.length; r++) {
|
896
|
-
const o = e[r];
|
897
|
-
c.equivalent(t[n].sgrState, o.sgrState)
|
898
|
-
? (t[n]._text += o.text)
|
899
|
-
: (t[++n] = o);
|
900
|
-
}
|
901
|
-
return t;
|
902
|
-
}
|
903
|
-
appendText(e) {
|
904
|
-
this._text += e;
|
905
|
-
}
|
906
|
-
get id() {
|
907
|
-
return this._id;
|
908
|
-
}
|
909
|
-
get format() {
|
910
|
-
return this._sgrState;
|
911
|
-
}
|
912
|
-
get text() {
|
913
|
-
return this._text;
|
914
|
-
}
|
915
|
-
}
|
916
|
-
const k = (e, t, r) => {
|
917
|
-
const n = p(e, t);
|
918
|
-
return Math.max(n, r);
|
919
|
-
},
|
920
|
-
p = (e, t) => {
|
921
|
-
const r = parseInt(e);
|
922
|
-
return Number.isNaN(r) ? t : r;
|
923
|
-
},
|
924
|
-
_ = (e) => {
|
925
|
-
const t = Math.max(Math.min(255, e), 0).toString(16);
|
926
|
-
return 2 === t.length ? t : "0" + t;
|
927
|
-
};
|
928
|
-
})(0, r.exports)),
|
929
|
-
void 0 !== t && (e.exports = t);
|
930
|
-
var n = r.exports;
|
931
|
-
export { n as default };
|
932
|
-
//# sourceMappingURL=/sm/e2bb81b6893b38ca5911532123780d53bdf6e15fbe7b44eb87ce76582ffdd9ab.map
|